summaryrefslogtreecommitdiff
path: root/writerfilter/source/dmapper
diff options
context:
space:
mode:
Diffstat (limited to 'writerfilter/source/dmapper')
-rw-r--r--writerfilter/source/dmapper/DomainMapperTableHandler.cxx2
-rw-r--r--writerfilter/source/dmapper/DomainMapperTableManager.cxx26
-rw-r--r--writerfilter/source/dmapper/DomainMapperTableManager.hxx6
3 files changed, 27 insertions, 7 deletions
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index 3b8177372867..217c7f8428d9 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -715,7 +715,7 @@ void DomainMapperTableHandler::endTable(unsigned int nestedTableLevel)
uno::Reference<text::XTextRange> xStart;
uno::Reference<text::XTextRange> xEnd;
// If we want to make this table a floating one.
- uno::Sequence<beans::PropertyValue> aFrameProperties = m_rDMapper_Impl.getTableManager().getTablePosition();
+ uno::Sequence<beans::PropertyValue> aFrameProperties = m_rDMapper_Impl.getTableManager().getCurrentTablePosition();
bool bFloating = aFrameProperties.hasElements();
// Additional checks: if we can do this.
if (bFloating && (*m_pTableSeq)[0].getLength() > 0 && (*m_pTableSeq)[0][0].getLength() > 0)
diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
index 80bd683e25a3..d81aea774036 100644
--- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
@@ -24,7 +24,6 @@
#include <CellMarginHandler.hxx>
#include <ConversionHelper.hxx>
#include <MeasureHandler.hxx>
-#include <TablePositionHandler.hxx>
#include <TDefTableHandler.hxx>
#include <com/sun/star/text/HoriOrientation.hpp>
#include <com/sun/star/text/SizeType.hpp>
@@ -323,9 +322,14 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm)
writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
if (pProperties.get())
{
- TablePositionHandlerPtr pHandler( new TablePositionHandler );
+ TablePositionHandlerPtr pHandler = m_aTablePositions.back();
+ if ( !pHandler )
+ {
+ m_aTablePositions.pop_back();
+ pHandler.reset( new TablePositionHandler );
+ m_aTablePositions.push_back( pHandler );
+ }
pProperties->resolve(*pHandler);
- m_aTablePosition = pHandler->getTablePosition();
}
}
break;
@@ -361,6 +365,14 @@ boost::shared_ptr< vector< sal_Int32 > > DomainMapperTableManager::getCurrentCel
return m_aCellWidths.back( );
}
+const uno::Sequence<beans::PropertyValue> DomainMapperTableManager::getCurrentTablePosition( )
+{
+ if ( !m_aTablePositions.empty( ) && m_aTablePositions.back() )
+ return m_aTablePositions.back( )->getTablePosition();
+ else
+ return uno::Sequence< beans::PropertyValue >( 0 );
+}
+
void DomainMapperTableManager::startLevel( )
{
DomainMapperTableManager_Base_t::startLevel( );
@@ -376,9 +388,11 @@ void DomainMapperTableManager::startLevel( )
IntVectorPtr pNewGrid( new vector<sal_Int32> );
IntVectorPtr pNewSpans( new vector<sal_Int32> );
IntVectorPtr pNewCellWidths( new vector<sal_Int32> );
+ TablePositionHandlerPtr pNewPositionHandler;
m_aTableGrid.push_back( pNewGrid );
m_aGridSpans.push_back( pNewSpans );
m_aCellWidths.push_back( pNewCellWidths );
+ m_aTablePositions.push_back( pNewPositionHandler );
m_nCell.push_back( 0 );
m_nTableWidth = 0;
@@ -395,6 +409,7 @@ void DomainMapperTableManager::endLevel( )
m_nCell.pop_back( );
m_nTableWidth = 0;
+
DomainMapperTableManager_Base_t::endLevel( );
#ifdef DEBUG_DOMAINMAPPER
dmapper_logger->startElement("dmappertablemanager.endLevel");
@@ -404,6 +419,10 @@ void DomainMapperTableManager::endLevel( )
dmapper_logger->endElement();
#endif
+
+ // Pop back the table position after endLevel as it's used
+ // in the endTable method called in endLevel.
+ m_aTablePositions.pop_back();
}
@@ -577,7 +596,6 @@ void DomainMapperTableManager::clearData()
m_nRow = m_nCellBorderIndex = m_nHeaderRepeat = m_nTableWidth = 0;
m_sTableStyleName = OUString();
m_pTableStyleTextProperies.reset();
- m_aTablePosition = uno::Sequence<beans::PropertyValue>(0);
}
diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.hxx b/writerfilter/source/dmapper/DomainMapperTableManager.hxx
index e18dcea69295..d3164eaf3ee3 100644
--- a/writerfilter/source/dmapper/DomainMapperTableManager.hxx
+++ b/writerfilter/source/dmapper/DomainMapperTableManager.hxx
@@ -20,6 +20,7 @@
#define INCLUDED_DOMAIN_MAPPER_TABLE_MANAGER_HXX
#include "TablePropertiesHandler.hxx"
+#include <TablePositionHandler.hxx>
#include <resourcemodel/TableManager.hxx>
#include <PropertyMap.hxx>
@@ -44,7 +45,7 @@ class DomainMapperTableManager : public DomainMapperTableManager_Base_t
sal_Int32 m_nTableWidth; //might be set directly or has to be calculated from the column positions
bool m_bOOXML;
OUString m_sTableStyleName;
- com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> m_aTablePosition;
+ std::vector< TablePositionHandlerPtr > m_aTablePositions;
PropertyMapPtr m_pTableStyleTextProperies;
::std::vector< IntVectorPtr > m_aTableGrid;
@@ -81,7 +82,8 @@ public:
IntVectorPtr getCurrentCellWidths( );
const OUString& getTableStyleName() const { return m_sTableStyleName; }
- const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> getTablePosition() { return m_aTablePosition; }
+ const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> getCurrentTablePosition();
+
/// copy the text properties of the table style and its parent into pContext
void CopyTextProperties(PropertyMapPtr pContext, StyleSheetTablePtr pStyleSheetTable);