summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2012-05-28 17:21:10 +0200
committerLuboš Luňák <l.lunak@suse.cz>2012-05-28 18:06:15 +0200
commit5845298e615a599d5edc7c42275b52ae954250e8 (patch)
tree9e382faf8eb1e9faf55448e1bb21734efa2237df /filter
parent96c7ab19b77c2f90acd4c34552474b0f616f48a7 (diff)
fix horizontal rule width in .doc documents (bnc#757118)
MSO uses undocumented properties that seem to map to o:hr and o:hrpct from .docx (including differences between .docx spec and implementation), so treat horizontal rule width the same way in .doc too. Also remove the guesswork for #i17200# that is not quite correct and no longer needed. Change-Id: Ibec543fa1679ca0b20e86ef6b4f77147b18dff7e
Diffstat (limited to 'filter')
-rw-r--r--filter/inc/filter/msfilter/msdffimp.hxx2
-rw-r--r--filter/source/msfilter/msdffimp.cxx20
2 files changed, 20 insertions, 2 deletions
diff --git a/filter/inc/filter/msfilter/msdffimp.hxx b/filter/inc/filter/msfilter/msdffimp.hxx
index ad2e55ae8c7c..db15f86c8517 100644
--- a/filter/inc/filter/msfilter/msdffimp.hxx
+++ b/filter/inc/filter/msfilter/msdffimp.hxx
@@ -319,6 +319,8 @@ struct MSFILTER_DLLPUBLIC SvxMSDffImportRec
sal_Bool bVFlip :1;
sal_Bool bHFlip :1;
sal_Bool bAutoWidth :1;
+ int relativeHorizontalWidth; // in 0.1% or -1 for none
+ bool isHorizontalRule;
SvxMSDffImportRec();
SvxMSDffImportRec(const SvxMSDffImportRec& rCopy);
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index 49ba21176c46..9d5e1dc64fb5 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -5209,6 +5209,18 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
*(pImpRec->pYRelTo) = nUDData;
break;
case 0x03BF: pImpRec->nLayoutInTableCell = nUDData; break;
+ case 0x0393:
+ // This seems to correspond to o:hrpct from .docx (even including
+ // the difference that it's in 0.1% even though the .docx spec
+ // says it's in 1%).
+ pImpRec->relativeHorizontalWidth = nUDData;
+ break;
+ case 0x0394:
+ // And this is really just a guess, but a mere presence of this
+ // flag makes a horizontal rule be as wide as the page (unless
+ // overriden by something), so it probably matches o:hr from .docx.
+ pImpRec->isHorizontalRule = true;
+ break;
}
if ( rSt.GetError() != 0 )
break;
@@ -7507,7 +7519,9 @@ SvxMSDffImportRec::SvxMSDffImportRec()
aTextId( 0, 0 ),
nNextShapeId( 0 ),
nShapeId( 0 ),
- eShapeType( mso_sptNil )
+ eShapeType( mso_sptNil ),
+ relativeHorizontalWidth( -1 ),
+ isHorizontalRule( false )
{
eLineStyle = mso_lineSimple; // GPF-Bug #66227#
eLineDashing = mso_lineSolid;
@@ -7545,7 +7559,9 @@ SvxMSDffImportRec::SvxMSDffImportRec(const SvxMSDffImportRec& rCopy)
aTextId( rCopy.aTextId ),
nNextShapeId( rCopy.nNextShapeId ),
nShapeId( rCopy.nShapeId ),
- eShapeType( rCopy.eShapeType )
+ eShapeType( rCopy.eShapeType ),
+ relativeHorizontalWidth( rCopy.relativeHorizontalWidth ),
+ isHorizontalRule( rCopy.isHorizontalRule )
{
if (rCopy.pXRelTo)
{