summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2018-10-04 17:55:42 +0300
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-10-05 10:30:40 +0200
commit8ef25505303dcd744d20abf7e328ce1f0eda4dbf (patch)
tree4ef8ba620fff7c4a533f1dc4d8282b2c11a4b10a
parenttdf#119743: add Features entries in Properties block Drivers.xcu (diff)
downloadcore-8ef25505303dcd744d20abf7e328ce1f0eda4dbf.tar.gz
core-8ef25505303dcd744d20abf7e328ce1f0eda4dbf.zip
tdf#120301 oox: lclIsWhiteSpace should return true for a space
Change-Id: I72c79c1fed4d9a91bf02024eef23cd3b1a58632e Reviewed-on: https://gerrit.libreoffice.org/61388 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> (cherry picked from commit 2cae2ecfef47d8dd10647c10f9577392c1887d3a) Reviewed-on: https://gerrit.libreoffice.org/61392 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r--oox/source/vml/vmlinputstream.cxx2
-rw-r--r--sc/qa/unit/data/xlsx/tdf120301_xmlSpaceParsing.xlsxbin0 -> 11519 bytes
-rw-r--r--sc/qa/unit/subsequent_filters-test.cxx19
3 files changed, 20 insertions, 1 deletions
diff --git a/oox/source/vml/vmlinputstream.cxx b/oox/source/vml/vmlinputstream.cxx
index 4545b6924a41..0e9038f3f9f4 100644
--- a/oox/source/vml/vmlinputstream.cxx
+++ b/oox/source/vml/vmlinputstream.cxx
@@ -43,7 +43,7 @@ inline const sal_Char* lclFindCharacter( const sal_Char* pcBeg, const sal_Char*
inline bool lclIsWhiteSpace( sal_Char cChar )
{
- return cChar < 32;
+ return cChar <= 32;
}
const sal_Char* lclFindWhiteSpace( const sal_Char* pcBeg, const sal_Char* pcEnd )
diff --git a/sc/qa/unit/data/xlsx/tdf120301_xmlSpaceParsing.xlsx b/sc/qa/unit/data/xlsx/tdf120301_xmlSpaceParsing.xlsx
new file mode 100644
index 000000000000..0677a0cf2eb2
--- /dev/null
+++ b/sc/qa/unit/data/xlsx/tdf120301_xmlSpaceParsing.xlsx
Binary files differ
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 2e876434ce49..0d6bc90761fb 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -232,6 +232,7 @@ public:
void testPageScalingXLSX();
void testActiveXCheckboxXLSX();
+ void testtdf120301_xmlSpaceParsingXLSX();
#ifdef UNX
void testUnicodeFileNameGnumeric();
#endif
@@ -364,6 +365,7 @@ public:
CPPUNIT_TEST(testPageScalingXLSX);
CPPUNIT_TEST(testActiveXCheckboxXLSX);
+ CPPUNIT_TEST(testtdf120301_xmlSpaceParsingXLSX);
#ifdef UNX
CPPUNIT_TEST(testUnicodeFileNameGnumeric);
#endif
@@ -4018,6 +4020,23 @@ void ScFiltersTest::testActiveXCheckboxXLSX()
xDocSh->DoClose();
}
+void ScFiltersTest::testtdf120301_xmlSpaceParsingXLSX()
+{
+ ScDocShellRef xDocSh = loadDoc("tdf120301_xmlSpaceParsing.", FORMAT_XLSX);
+ uno::Reference< frame::XModel > xModel = xDocSh->GetModel();
+ uno::Reference< sheet::XSpreadsheetDocument > xDoc(xModel, UNO_QUERY_THROW);
+ uno::Reference< container::XIndexAccess > xIA(xDoc->getSheets(), UNO_QUERY_THROW);
+ uno::Reference< drawing::XDrawPageSupplier > xDrawPageSupplier( xIA->getByIndex(0), UNO_QUERY_THROW);
+ uno::Reference< container::XIndexAccess > xIA_DrawPage(xDrawPageSupplier->getDrawPage(), UNO_QUERY_THROW);
+
+ uno::Reference< drawing::XControlShape > xControlShape(xIA_DrawPage->getByIndex(0), UNO_QUERY_THROW);
+ uno::Reference< beans::XPropertySet > XPropSet( xControlShape->getControl(), uno::UNO_QUERY_THROW );
+ OUString sCaption;
+ XPropSet->getPropertyValue("Label") >>= sCaption;
+ CPPUNIT_ASSERT_EQUAL(OUString("Check Box 1"), sCaption);
+ xDocSh->DoClose();
+}
+
namespace {
struct PaintListener : public SfxListener