summaryrefslogtreecommitdiff
path: root/writerfilter/source
diff options
context:
space:
mode:
authorUmesh Kadam <umesh.kadam@synerzip.com>2014-06-13 17:26:19 +0530
committerMichael Stahl <mstahl@redhat.com>2014-08-01 12:05:54 +0200
commitf11ec770f360c33953efa989532ff21c28dd38df (patch)
treea41371848e10d2fa84a252f6c475cf49ac81f1f0 /writerfilter/source
parent546cd96371b5ae012e4f3bfe963ea299e1dcec54 (diff)
fdo#78904 : LO hangs while saving the document.
- In case of framePr attributes being omitted in original xml, LO defaults such attributes to incorrect values. - Correcting these values in this fix. - This fix stops LO from getting hang while saving the document, the actual fix needs to be somewhere in the table layout. We need to restrict the frame from being considered as part of the table as MSO does not allow frame to be part of a table. Reviewed-on: https://gerrit.libreoffice.org/9774 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit 75fc9e669f209472ec6a282848166d96d02d84d9) This also fixes fdo#79391, but not compeletely on this branch. Change-Id: I4c35f7eff6ca1122901f5667fc26b849df527f60 Signed-off-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'writerfilter/source')
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx23
1 files changed, 17 insertions, 6 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 3bbd96596cd9..1d5c19946377 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -42,6 +42,7 @@
#include <com/sun/star/text/HoriOrientation.hpp>
#include <com/sun/star/text/VertOrientation.hpp>
#include <com/sun/star/text/ReferenceFieldPart.hpp>
+#include <com/sun/star/text/RelOrientation.hpp>
#include <com/sun/star/text/ReferenceFieldSource.hpp>
#include <com/sun/star/text/SizeType.hpp>
#include <com/sun/star/text/TextContentAnchorType.hpp>
@@ -775,6 +776,8 @@ void lcl_AddRangeAndStyle(
//define some default frame width - 0cm ATM: this allow the frame to be wrapped around the text
#define DEFAULT_FRAME_MIN_WIDTH 0
+#define DEFAULT_FRAME_MIN_HEIGHT 0
+#define DEFAULT_VALUE 0
void DomainMapper_Impl::CheckUnregisteredFrameConversion( )
{
@@ -826,7 +829,7 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( )
pFrameProperties[1].Value <<=
rAppendContext.pLastParagraphProperties->Geth() > 0 ?
rAppendContext.pLastParagraphProperties->Geth() :
- pStyleProperties->Geth();
+ pStyleProperties->Geth() > 0 ? pStyleProperties->Geth() : DEFAULT_FRAME_MIN_HEIGHT;
pFrameProperties[2].Value <<= sal_Int16(
rAppendContext.pLastParagraphProperties->GethRule() >= 0 ?
@@ -841,13 +844,17 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( )
pStyleProperties->GetxAlign() >= 0 ? pStyleProperties->GetxAlign() : text::HoriOrientation::NONE );
pFrameProperties[4].Value <<= nHoriOrient;
+ //set a non negative default value
pFrameProperties[5].Value <<=
rAppendContext.pLastParagraphProperties->IsxValid() ?
- rAppendContext.pLastParagraphProperties->Getx() : pStyleProperties->Getx();
+ rAppendContext.pLastParagraphProperties->Getx() :
+ pStyleProperties->IsxValid() ? pStyleProperties->Getx() : DEFAULT_VALUE;
+
+ //Default the anchor in case FramePr_hAnchor is missing ECMA 17.3.1.11
pFrameProperties[6].Value <<= sal_Int16(
rAppendContext.pLastParagraphProperties->GethAnchor() >= 0 ?
rAppendContext.pLastParagraphProperties->GethAnchor() :
- pStyleProperties->GethAnchor() );
+ pStyleProperties->GethAnchor() >=0 ? pStyleProperties->GethAnchor() : text::RelOrientation::FRAME );
sal_Int16 nVertOrient = sal_Int16(
rAppendContext.pLastParagraphProperties->GetyAlign() >= 0 ?
@@ -855,18 +862,22 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( )
pStyleProperties->GetyAlign() >= 0 ? pStyleProperties->GetyAlign() : text::VertOrientation::NONE );
pFrameProperties[7].Value <<= nVertOrient;
+ //set a non negative default value
pFrameProperties[8].Value <<=
rAppendContext.pLastParagraphProperties->IsyValid() ?
- rAppendContext.pLastParagraphProperties->Gety() : pStyleProperties->Gety();
+ rAppendContext.pLastParagraphProperties->Gety() :
+ pStyleProperties->IsyValid() ? pStyleProperties->Gety() : DEFAULT_VALUE;
+
+ //Default the anchor in case FramePr_vAnchor is missing ECMA 17.3.1.11
pFrameProperties[9].Value <<= sal_Int16(
rAppendContext.pLastParagraphProperties->GetvAnchor() >= 0 ?
rAppendContext.pLastParagraphProperties->GetvAnchor() :
- pStyleProperties->GetvAnchor() );
+ pStyleProperties->GetvAnchor() >= 0 ? pStyleProperties->GetvAnchor() : text::RelOrientation::FRAME );
pFrameProperties[10].Value <<= text::WrapTextMode(
rAppendContext.pLastParagraphProperties->GetWrap() >= 0 ?
rAppendContext.pLastParagraphProperties->GetWrap() :
- pStyleProperties->GetWrap());
+ pStyleProperties->GetWrap() >= 0 ? pStyleProperties->GetWrap() : text::WrapTextMode_NONE );
sal_Int32 nBottomDist;
sal_Int32 nTopDist = nBottomDist =