[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sw/qa sw/source
Andras Timar
timar at kemper.freedesktop.org
Thu Mar 8 05:45:12 PST 2012
sw/qa/core/data/ww8/pass/fdo40686-1.doc |binary
sw/source/filter/ww8/ww8par6.cxx | 15 +++++++++------
2 files changed, 9 insertions(+), 6 deletions(-)
New commits:
commit dbf4c479ae43cdd6ee2f8b9b42452b1a8c46765b
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Mar 8 13:00:45 2012 +0000
Resolves: fdo#40686 dyaLinePitch only valid between [1-31680]
Signed-off-by: Andras Timar <atimar at suse.com>
diff --git a/sw/qa/core/data/ww8/pass/fdo40686-1.doc b/sw/qa/core/data/ww8/pass/fdo40686-1.doc
new file mode 100644
index 0000000..bb0fd59
Binary files /dev/null and b/sw/qa/core/data/ww8/pass/fdo40686-1.doc differ
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 845a381..2f7a956 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));
More information about the Libreoffice-commits
mailing list