summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2023-04-14 02:19:44 +0300
committerMaxim Monastirsky <momonasmon@gmail.com>2023-04-18 01:56:31 +0200
commit86cbbbccba19ba0433693e3e5c59c67e9dc6a003 (patch)
tree3d89990e20aff12c185fa7b7d55e0760e88d9269
parent059f99991e8f291404addeba9341d2c4989976af (diff)
sc drawstyles: Fix xlsx export for text attributes in comments
Change-Id: Ic5b6099460bd5e978c04aff3233537059ce711b9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150379 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
-rw-r--r--sc/qa/unit/subsequent_export_test4.cxx16
-rw-r--r--sc/source/filter/excel/xlroot.cxx1
2 files changed, 16 insertions, 1 deletions
diff --git a/sc/qa/unit/subsequent_export_test4.cxx b/sc/qa/unit/subsequent_export_test4.cxx
index 5d629e83eb4a..663767c7374f 100644
--- a/sc/qa/unit/subsequent_export_test4.cxx
+++ b/sc/qa/unit/subsequent_export_test4.cxx
@@ -1583,7 +1583,21 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testCommentStyles)
// Check that the style was imported, and survived copying
CPPUNIT_ASSERT_EQUAL(OUString("MyStyle1"), pCaption->GetStyleSheet()->GetName());
- // Check that the style formatting is in effect
+ }
+
+ saveAndReload("Calc Office Open XML");
+
+ {
+ ScDocument* pDoc = getScDoc();
+
+ ScAddress aPos(0, 0, 0);
+ ScPostIt* pNote = pDoc->GetNote(aPos);
+ CPPUNIT_ASSERT(pNote);
+
+ auto pCaption = pNote->GetOrCreateCaption(aPos);
+ CPPUNIT_ASSERT(pCaption);
+
+ // Check that the style formatting is preserved
CPPUNIT_ASSERT_EQUAL(sal_uInt32(1129),
pCaption->GetMergedItemSet().Get(EE_CHAR_FONTHEIGHT).GetHeight());
}
diff --git a/sc/source/filter/excel/xlroot.cxx b/sc/source/filter/excel/xlroot.cxx
index 47f5ff7806c1..71d308d2f29c 100644
--- a/sc/source/filter/excel/xlroot.cxx
+++ b/sc/source/filter/excel/xlroot.cxx
@@ -408,6 +408,7 @@ EditEngine& XclRoot::GetDrawEditEngine() const
{
mrData.mxDrawEditEng = std::make_shared<EditEngine>( &GetDoc().GetDrawLayer()->GetItemPool() );
EditEngine& rEE = *mrData.mxDrawEditEng;
+ rEE.SetStyleSheetPool(static_cast<SfxStyleSheetPool*>(GetDoc().GetDrawLayer()->GetStyleSheetPool()));
rEE.SetRefMapMode(MapMode(MapUnit::Map100thMM));
rEE.SetUpdateLayout( false );
rEE.EnableUndo( false );