<commit_before>/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */
#ifndef INCLUDED_WRITERFILTER_SOURCE_DMAPPER_TABLEPOSITIONHANDLER_HXX
#define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_TABLEPOSITIONHANDLER_HXX

#include <resourcemodel/LoggedResources.hxx>
#include <boost/shared_ptr.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>

namespace writerfilter
{
namespace dmapper
{

/// Handler for floating table positioning
class TablePositionHandler
    : public LoggedProperties
{
    OUString m_aVertAnchor;
    OUString m_aYSpec;
    OUString m_aHorzAnchor;
    OUString m_aXSpec;
    sal_Int32 m_nY;
    sal_Int32 m_nX;
    sal_Int32 m_nLeftFromText;
    sal_Int32 m_nRightFromText;
    sal_Int32 m_nTopFromText;
    sal_Int32 m_nBottomFromText;

    // Properties
    virtual void lcl_attribute(Id Name, Value& val) SAL_OVERRIDE;
    virtual void lcl_sprm(Sprm& sprm) SAL_OVERRIDE;

public:
    int getY()
    {
        return m_nY;
    }
    int getX()
    {
        return m_nX;
    }
    int getLeftFromText()
    {
        return m_nLeftFromText;
    }
    int getRightFromText()
    {
        return m_nRightFromText;
    }
    int getTopFromText()
    {
        return m_nTopFromText;
    }
    int getBottomFromText()
    {
        return m_nBottomFromText;
    }

    OUString getVertAnchor()
    {
        return m_aVertAnchor;
    }
    OUString getYSpec()
    {
        return m_aYSpec;
    }
    OUString getHorzAnchor()
    {
        return m_aHorzAnchor;
    }
    OUString getXSpec()
    {
        return m_aXSpec;
    }

    TablePositionHandler();
    virtual ~TablePositionHandler();

    /** Compute the UNO properties for the frame containing the table based
        on the received tokens.

        Note that the properties will need to be adjusted with the table
        properties before actually using them.
      */
    com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> getTablePosition() const;

    bool operator== (const TablePositionHandler& rHandler) const;
};

typedef boost::shared_ptr<TablePositionHandler> TablePositionHandlerPtr;
} // namespace dmapper
} // namespace writerfilter

#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
<commit_msg>writerfilter: try to fix 32-bit builds<commit_after>/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */
#ifndef INCLUDED_WRITERFILTER_SOURCE_DMAPPER_TABLEPOSITIONHANDLER_HXX
#define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_TABLEPOSITIONHANDLER_HXX

#include <resourcemodel/LoggedResources.hxx>
#include <boost/shared_ptr.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>

namespace writerfilter
{
namespace dmapper
{

/// Handler for floating table positioning
class TablePositionHandler
    : public LoggedProperties
{
    OUString m_aVertAnchor;
    OUString m_aYSpec;
    OUString m_aHorzAnchor;
    OUString m_aXSpec;
    sal_Int32 m_nY;
    sal_Int32 m_nX;
    sal_Int32 m_nLeftFromText;
    sal_Int32 m_nRightFromText;
    sal_Int32 m_nTopFromText;
    sal_Int32 m_nBottomFromText;

    // Properties
    virtual void lcl_attribute(Id Name, Value& val) SAL_OVERRIDE;
    virtual void lcl_sprm(Sprm& sprm) SAL_OVERRIDE;

public:
    sal_Int32 getY()
    {
        return m_nY;
    }
    sal_Int32 getX()
    {
        return m_nX;
    }
    sal_Int32 getLeftFromText()
    {
        return m_nLeftFromText;
    }
    sal_Int32 getRightFromText()
    {
        return m_nRightFromText;
    }
    sal_Int32 getTopFromText()
    {
        return m_nTopFromText;
    }
    sal_Int32 getBottomFromText()
    {
        return m_nBottomFromText;
    }

    OUString getVertAnchor()
    {
        return m_aVertAnchor;
    }
    OUString getYSpec()
    {
        return m_aYSpec;
    }
    OUString getHorzAnchor()
    {
        return m_aHorzAnchor;
    }
    OUString getXSpec()
    {
        return m_aXSpec;
    }

    TablePositionHandler();
    virtual ~TablePositionHandler();

    /** Compute the UNO properties for the frame containing the table based
        on the received tokens.

        Note that the properties will need to be adjusted with the table
        properties before actually using them.
      */
    com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> getTablePosition() const;

    bool operator== (const TablePositionHandler& rHandler) const;
};

typedef boost::shared_ptr<TablePositionHandler> TablePositionHandlerPtr;
} // namespace dmapper
} // namespace writerfilter

#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

{'fraction_non_alphanumeric': 0.08453486075449339, 'fraction_numerical': 0.010665613272763184, 'mean_word_length': 3.0415003990422984, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7482579', 'n_tokens_mistral': 1724, 'n_tokens_neox': 1641, 'n_words': 413}