summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-07-22 09:24:06 +0200
committerAndras Timar <andras.timar@collabora.com>2015-08-06 12:56:56 +0200
commit026b8eb1b57974d8b9b2a96a09f348159dd1108a (patch)
tree67e4706968923441feabbbef24aa54216519cddb /writerfilter
parente51864becb489ef0286bacd63e81e9e1eb499180 (diff)
tdf#86374 DOCX import: fix btLr text table direction without <w:cantSplit/>
Commit 0208ead70a9412ccd554fcef3e9308f8ca17037b (DOCX import: improve btLr table cell support, 2013-02-22) made any table row that has at least one btLr cell fixed height. This causes problems in case a table has a minimal height with lots of content, where the fixed height gives wrong layout, but the minimal height is correct. Fix the problem by only making the row fixed height if <w:cantSplit/> is set (as seen in the old bugdoc), and revert to setting the height type to minimal in any other case. Change-Id: Ibaf91f542e64e5caa7904df97eb6eb52618e0023 (cherry picked from commit 233a634a112e6dae07dca5fb1296764cb0001503) Reviewed-on: https://gerrit.libreoffice.org/17338 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/TableManager.hxx2
-rw-r--r--writerfilter/source/dmapper/TablePropertiesHandler.cxx10
2 files changed, 10 insertions, 2 deletions
diff --git a/writerfilter/source/dmapper/TableManager.hxx b/writerfilter/source/dmapper/TableManager.hxx
index 3d44e24c9a6a..7b7b4421c90b 100644
--- a/writerfilter/source/dmapper/TableManager.hxx
+++ b/writerfilter/source/dmapper/TableManager.hxx
@@ -308,6 +308,7 @@ protected:
mState.resetCellProps();
}
+public:
TablePropertyMapPtr getRowProps()
{
return mState.getRowProps();
@@ -323,6 +324,7 @@ protected:
mState.resetRowProps();
}
+protected:
void setInCell(bool bInCell)
{
mState.setInCell(bInCell);
diff --git a/writerfilter/source/dmapper/TablePropertiesHandler.cxx b/writerfilter/source/dmapper/TablePropertiesHandler.cxx
index eb29b481f533..4db5a8c167b3 100644
--- a/writerfilter/source/dmapper/TablePropertiesHandler.cxx
+++ b/writerfilter/source/dmapper/TablePropertiesHandler.cxx
@@ -90,8 +90,14 @@ namespace dmapper {
const int MINLAY = 23; // sw/inc/swtypes.hxx, minimal possible size of frames.
if (!pManager || !pManager->HasBtlrCell() || pMeasureHandler->getMeasureValue() > ConversionHelper::convertTwipToMM100(MINLAY))
{
- // In case a cell already wanted fixed size, we should not overwrite it here.
- if (!pManager || !pManager->IsRowSizeTypeInserted())
+ bool bCantSplit = false;
+ if (pManager && pManager->getRowProps())
+ {
+ boost::optional<PropertyMap::Property> oIsSplitAllowed = pManager->getRowProps()->getProperty(PROP_IS_SPLIT_ALLOWED);
+ bCantSplit = oIsSplitAllowed && !oIsSplitAllowed->second.get<bool>();
+ }
+ // In case a cell already wanted fixed size and the row has <w:cantSplit/>, we should not overwrite it here.
+ if (!pManager || !pManager->IsRowSizeTypeInserted() || !bCantSplit)
pPropMap->Insert( PROP_SIZE_TYPE, uno::makeAny( pMeasureHandler->GetRowHeightSizeType() ), false);
else
pPropMap->Insert( PROP_SIZE_TYPE, uno::makeAny(text::SizeType::FIX), false);