summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-03-08 13:00:45 +0000
committerCaolán McNamara <caolanm@redhat.com>2012-03-08 13:00:45 +0000
commitc0db5469d9bb289075914e60ced856698a6ae249 (patch)
treea9e9a613702a5c037a5109a91f7c6e393d377e11 /sw/source
parentccfbb8647503e9e2531c4fc1fb03354a82401e3d (diff)
Resolves: fdo#40686 dyaLinePitch only valid between [1-31680]
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/filter/ww8/ww8par6.cxx15
1 files changed, 9 insertions, 6 deletions
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 2ca9019452ff..eca258b77dc7 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -270,14 +270,11 @@ void SwWW8ImplReader::SetDocumentGrid(SwFrmFmt &rFmt, const wwSection &rSection)
if (eType != GRID_NONE)
rDoc.set(IDocumentSettingAccess::ADD_EXT_LEADING, false);
- //force to set document as standard page mode
+ //force to set document as standard page mode
sal_Bool bSquaredMode = sal_False;
rDoc.SetDefaultPageMode( bSquaredMode );
aGrid.SetSquaredMode( bSquaredMode );
- //sep.dyaLinePitch
- sal_Int32 nLinePitch = rSection.maSep.dyaLinePitch;
-
//Get the size of word's default styles font
sal_uInt32 nCharWidth=240;
for (sal_uInt16 nI = 0; nI < pStyles->GetCount(); ++nI)
@@ -306,8 +303,14 @@ void SwWW8ImplReader::SetDocumentGrid(SwFrmFmt &rFmt, const wwSection &rSection)
}
aGrid.SetBaseWidth( writer_cast<sal_uInt16>(nCharWidth));
- aGrid.SetLines(writer_cast<sal_uInt16>(nTextareaHeight/nLinePitch));
- aGrid.SetBaseHeight(writer_cast<sal_uInt16>(nLinePitch));
+
+ //sep.dyaLinePitch
+ sal_Int32 nLinePitch = rSection.maSep.dyaLinePitch;
+ if (nLinePitch >= 1 && nLinePitch <= 31680)
+ {
+ aGrid.SetLines(writer_cast<sal_uInt16>(nTextareaHeight/nLinePitch));
+ aGrid.SetBaseHeight(writer_cast<sal_uInt16>(nLinePitch));
+ }
sal_Int32 nRubyHeight = 0;
aGrid.SetRubyHeight(writer_cast<sal_uInt16>(nRubyHeight));