[Libreoffice-commits] core.git: 3 commits - sc/source sw/qa writerfilter/source
LuboÅ¡ LuÅák
l.lunak at collabora.com
Wed Mar 12 06:14:00 PDT 2014
sc/source/filter/excel/xestream.cxx | 2 +-
sc/source/filter/qpro/qpro.cxx | 2 +-
sw/qa/extras/ooxmlimport/data/large-twips.docx |binary
sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 8 ++++++++
writerfilter/source/dmapper/ConversionHelper.cxx | 7 +++++--
5 files changed, 15 insertions(+), 4 deletions(-)
New commits:
commit ff768da1117d63f7c6e8513ab76927e5cc7ec9a6
Author: LuboÅ¡ LuÅák <l.lunak at collabora.com>
Date: Wed Mar 12 13:46:26 2014 +0100
test for ignoring large twips values (cp#1000043)
Change-Id: I366539b83c7a93a81fd72f3f2355b09c59f7ae58
diff --git a/sw/qa/extras/ooxmlimport/data/large-twips.docx b/sw/qa/extras/ooxmlimport/data/large-twips.docx
new file mode 100644
index 0000000..6e9d82d
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/large-twips.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index e67796e..bff4e1e 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -1963,6 +1963,14 @@ DECLARE_OOXMLIMPORT_TEST(testI124106, "i124106.docx")
CPPUNIT_ASSERT_EQUAL(1, getPages());
}
+DECLARE_OOXMLIMPORT_TEST(testLargeTwips, "large-twips.docx" )
+{
+ // cp#1000043: MSO seems to ignore large twips values, we didn't, which resulted in different
+ // layout of broken documents (text not visible in this specific document).
+ OUString width = parseDump( "/root/page/body/tab/row[1]/cell[1]/txt/infos/bounds", "width" );
+ CPPUNIT_ASSERT( width.toInt32() > 0 );
+}
+
#endif
CPPUNIT_PLUGIN_IMPLEMENT();
commit 10b4da63e3143108ba75891e9e98fdaa2f7953ab
Author: LuboÅ¡ LuÅák <l.lunak at collabora.com>
Date: Wed Mar 12 13:45:36 2014 +0100
ignore large twips values like MSO does (cp#1000043)
Change-Id: Ib304245b6ae64c15cfb6c999580f73e5e228c440
diff --git a/writerfilter/source/dmapper/ConversionHelper.cxx b/writerfilter/source/dmapper/ConversionHelper.cxx
index 7f5e760..cba58b7 100644
--- a/writerfilter/source/dmapper/ConversionHelper.cxx
+++ b/writerfilter/source/dmapper/ConversionHelper.cxx
@@ -36,8 +36,6 @@ namespace writerfilter {
namespace dmapper{
namespace ConversionHelper{
-#define TWIP_TO_MM100(TWIP) ((TWIP) >= 0 ? (((TWIP)*127L+36L)/72L) : (((TWIP)*127L-36L)/72L))
-
sal_Int32 MakeBorderLine( sal_Int32 nSprmValue, table::BorderLine2& rToFill )
{
//TODO: Lines are always solid
@@ -231,6 +229,11 @@ OUString ConvertMSFormatStringToSO(
sal_Int32 convertTwipToMM100(sal_Int32 _t)
{
+ // It appears that MSO handles large twip values specially, probably legacy 16bit handling,
+ // anything that's bigger than 32767 appears to be simply ignored.
+ if( _t >= 0x8000 )
+ return 0;
+#define TWIP_TO_MM100(TWIP) ((TWIP) >= 0 ? (((TWIP)*127L+36L)/72L) : (((TWIP)*127L-36L)/72L))
return TWIP_TO_MM100( _t );
}
commit da9bd301c6f62e829daadb2af6a6b9633d4f1cb9
Author: LuboÅ¡ LuÅák <l.lunak at collabora.com>
Date: Wed Mar 12 13:44:29 2014 +0100
std::strlen requires cstring include to build
Or, even simpler, don't bother with the needless namespacing.
Change-Id: I4bbb115c1c2c89881a0bf88ccd54b0f5cb8b3518
diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx
index 6c3aa3b..289fc62 100644
--- a/sc/source/filter/excel/xestream.cxx
+++ b/sc/source/filter/excel/xestream.cxx
@@ -988,7 +988,7 @@ sax_fastparser::FSHelperPtr& XclExpXmlStream::WriteAttributesInternal( sal_Int32
rStream->write( " " )
->writeId( nAttribute )
->write( "=\"" )
- ->writeEscaped( OUString(pValue, std::strlen(pValue), RTL_TEXTENCODING_UTF8) )
+ ->writeEscaped( OUString(pValue, strlen(pValue), RTL_TEXTENCODING_UTF8) )
->write( "\"" );
}
diff --git a/sc/source/filter/qpro/qpro.cxx b/sc/source/filter/qpro/qpro.cxx
index 5767634..2e24dff 100644
--- a/sc/source/filter/qpro/qpro.cxx
+++ b/sc/source/filter/qpro/qpro.cxx
@@ -226,7 +226,7 @@ void ScQProReader::readString( OUString &rString, sal_uInt16 nLength )
sal_Char* pText = new sal_Char[ nLength + 1 ];
nLength = mpStream->Read(pText, nLength);
pText[ nLength ] = 0;
- rString = OUString( pText, std::strlen(pText), mpStream->GetStreamCharSet() );
+ rString = OUString( pText, strlen(pText), mpStream->GetStreamCharSet() );
delete [] pText;
}
More information about the Libreoffice-commits
mailing list