[Libreoffice-commits] core.git: Branch 'feature/cib_contract891' - 11 commits - config_host.mk.in configure.ac download.lst external/librevenge external/Module_external.mk Makefile.fetch RepositoryExt

2022-07-16 Thread Serge Krot (via logerrit)
 Makefile.fetch |1 
 RepositoryExternal.mk  |   64 +
 config_host.mk.in  |3 
 configure.ac   |6 
 download.lst   |2 
 external/Module_external.mk|1 
 external/librevenge/ExternalPackage_librevenge.mk  |   22 
 external/librevenge/ExternalProject_librevenge.mk  |   44 +
 external/librevenge/Library_revenge.mk |   48 +
 external/librevenge/Makefile   |7 
 external/librevenge/Module_librevenge.mk   |   31 
 external/librevenge/README |3 
 external/librevenge/UnpackedTarball_librevenge.mk  |   16 
 sw/qa/extras/uiwriter/data/tdf113877_blank.odt |binary
 sw/qa/extras/uiwriter/data/tdf113877_blank_bold_off.odt|binary
 sw/qa/extras/uiwriter/data/tdf113877_blank_bold_on.odt |binary
 sw/qa/extras/uiwriter/data/tdf113877_blank_ownStandard.odt |binary
 sw/qa/extras/uiwriter/data/tdf113877_insert_numbered_list.odt  |binary
 sw/qa/extras/uiwriter/data/tdf113877_insert_numbered_list_abcd.odt |binary
 sw/qa/extras/uiwriter/uiwriter.cxx |  136 +++
 sw/source/core/txtnode/ndtxt.cxx   |   47 +
 sw/source/filter/xml/xmlimp.cxx|  214 
 sw/source/filter/xml/xmlimp.hxx|1 
 writerperfect/source/common/WPXSvStream.cxx|  436 
--
 writerperfect/source/common/WPXSvStream.hxx|   12 
 25 files changed, 1016 insertions(+), 78 deletions(-)

New commits:
commit 0dbc79be3a0de50700205eae501cf18254d88e40
Author: Serge Krot 
AuthorDate: Thu Oct 8 09:01:33 2020 +0200
Commit: Gabor Kelemen 
CommitDate: Fri Jul 15 16:25:07 2022 +0200

tdf#132289 missing styles when inserting file with list

Warning: this does not work yet
Follow the instructions in the bug, inserting does not change
style for first line in document

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104085
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104319
Tested-by: Thorsten Behrens 
(cherry picked from commit 92c05bd1f8ef695a56718c4b54babbe757ab9b89)

Change-Id: I444997a6cc55cfe287f4c610f538f2f54803646c

diff --git a/sw/qa/extras/uiwriter/data/tdf113877_blank_bold_off.odt 
b/sw/qa/extras/uiwriter/data/tdf113877_blank_bold_off.odt
new file mode 100644
index ..f4d58da53b95
Binary files /dev/null and 
b/sw/qa/extras/uiwriter/data/tdf113877_blank_bold_off.odt differ
diff --git a/sw/qa/extras/uiwriter/data/tdf113877_blank_bold_on.odt 
b/sw/qa/extras/uiwriter/data/tdf113877_blank_bold_on.odt
new file mode 100644
index ..8de77fc6161c
Binary files /dev/null and 
b/sw/qa/extras/uiwriter/data/tdf113877_blank_bold_on.odt differ
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx 
b/sw/qa/extras/uiwriter/uiwriter.cxx
index 12f74e1d9647..0881a66412ba 100755
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -25,6 +25,11 @@ public:
 void testFdo69893();
 void testFdo75110();
 void testFdo75898();
+
+void testTdf113877_mergeDocs(const char* aDestDoc, const char* aInsertDoc);
+void testTdf113877_blank_bold_on();
+void testTdf113877_blank_bold_off();
+
 void testTdf113877();
 void testTdf113877NoMerge();
 void testTdf113877_default_style();
@@ -36,6 +41,8 @@ public:
 CPPUNIT_TEST(testFdo69893);
 CPPUNIT_TEST(testFdo75110);
 CPPUNIT_TEST(testFdo75898);
+CPPUNIT_TEST(testTdf113877_blank_bold_on);
+CPPUNIT_TEST(testTdf113877_blank_bold_off);
 CPPUNIT_TEST(testTdf113877);
 CPPUNIT_TEST(testTdf113877NoMerge);
 CPPUNIT_TEST(testTdf113877_default_style);
@@ -153,11 +160,9 @@ void SwUiWriterTest::testFdo69893()
 CPPUNIT_ASSERT_EQUAL(OUString("Para after table."), rEnd.GetTxt());
 }
 
-// During insert of the document with list inside into the main document 
inside the list
-// we should merge both lists into one, when they have the same list properties
-void SwUiWriterTest::testTdf113877()
+void SwUiWriterTest::testTdf113877_mergeDocs(const char* aDestDoc, const char* 
aInsertDoc)
 {
-load(DATA_DIRECTORY, "tdf113877_insert_numbered_list.odt");
+load(DATA_DIRECTORY, aDestDoc);
 
 // set a page cursor into the end of the document
 uno::Reference xModel(mxComponent, uno::UNO_QUERY);
@@ -167,10 +172,17 @@ void SwUiWriterTest::testTdf113877()
 
 // insert the same document at cur

[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-1+backports' - sw/qa

2021-08-24 Thread Serge Krot (via logerrit)
 sw/qa/extras/inc/swmodeltestbase.hxx |9 ++
 sw/qa/extras/mailmerge/data/tdf78611.odt |binary
 sw/qa/extras/mailmerge/mailmerge.cxx |   46 +++
 3 files changed, 50 insertions(+), 5 deletions(-)

New commits:
commit 54423d5c51cb7733cb8766733ceec21d128c3bff
Author: Serge Krot 
AuthorDate: Wed Dec 12 15:18:05 2018 +0100
Commit: Michael Stahl 
CommitDate: Tue Aug 24 11:04:05 2021 +0200

tdf#78611 mailmerge: new unit tests: numbering in headings

Change-Id: I8672376dabcdc0011c59bb9ac5c32b8dbb88396d
Reviewed-on: https://gerrit.libreoffice.org/65035
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
(cherry picked from commit 7bbc1fd443ff0b137206ad279eaed7bd4d5ec6ec)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120913
Tested-by: Michael Stahl 
Reviewed-by: Michael Stahl 

diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx 
b/sw/qa/extras/inc/swmodeltestbase.hxx
index 5a11a088b9ba..df717abfb2d9 100644
--- a/sw/qa/extras/inc/swmodeltestbase.hxx
+++ b/sw/qa/extras/inc/swmodeltestbase.hxx
@@ -348,8 +348,8 @@ protected:
 return false;
 }
 
-private:
-void dumpLayout()
+protected:
+void dumpLayout(uno::Reference< lang::XComponent > & rComponent)
 {
 // create the xml writer
 mpXmlBuffer = xmlBufferCreate();
@@ -357,7 +357,7 @@ private:
 xmlTextWriterStartDocument(pXmlWriter, nullptr, nullptr, nullptr);
 
 // create the dump
-SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get());
+SwXTextDocument* pTextDoc = dynamic_cast(rComponent.get());
 CPPUNIT_ASSERT(pTextDoc);
 SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc();
 SwRootFrame* pLayout = 
pDoc->getIDocumentLayoutAccess().GetCurrentLayout();
@@ -368,7 +368,6 @@ private:
 xmlFreeTextWriter(pXmlWriter);
 }
 
-protected:
 void discardDumpedLayout()
 {
 if (mpXmlBuffer)
@@ -428,7 +427,7 @@ protected:
 xmlDocPtr parseLayoutDump()
 {
 if (!mpXmlBuffer)
-dumpLayout();
+dumpLayout(mxComponent);
 
 return xmlParseMemory(reinterpret_cast(xmlBufferContent(mpXmlBuffer)), xmlBufferLength(mpXmlBuffer));
 }
diff --git a/sw/qa/extras/mailmerge/data/tdf78611.odt 
b/sw/qa/extras/mailmerge/data/tdf78611.odt
new file mode 100644
index ..577597654740
Binary files /dev/null and b/sw/qa/extras/mailmerge/data/tdf78611.odt differ
diff --git a/sw/qa/extras/mailmerge/mailmerge.cxx 
b/sw/qa/extras/mailmerge/mailmerge.cxx
index 5b6411c153c0..9c84c312ef1e 100644
--- a/sw/qa/extras/mailmerge/mailmerge.cxx
+++ b/sw/qa/extras/mailmerge/mailmerge.cxx
@@ -276,6 +276,17 @@ public:
 loadMailMergeDocument( name );
 }
 
+/**
+ Resets currently opened layout of the original template,
+ and creates the layout of the document with N mails inside
+ (result run with text::MailMergeType::SHELL)
+*/
+void dumpMMLayout()
+{
+mpXmlBuffer = xmlBufferPtr();
+dumpLayout(mxMMComponent);
+}
+
 protected:
 // Returns page number of the first page of a MM document inside the large 
MM document (used in the SHELL case).
 int documentStartPageNumber( int document ) const;
@@ -1041,5 +1052,40 @@ DECLARE_FILE_MAILMERGE_TEST(testTdf123057_file, 
"pagecounttest.ott", "db_pagecou
 }
 }
 
+DECLARE_SHELL_MAILMERGE_TEST(testTd78611_shell, "tdf78611.odt", 
"10-testing-addresses.ods", "testing-addresses")
+{
+// prepare unit test and run
+executeMailMerge();
+
+// reset currently opened layout of the original template,
+// and create the layout of the document with 10 mails inside
+dumpMMLayout();
+
+// check: each page (one page is one sub doc) has different paragraphs and 
header paragraphs.
+// All header paragraphs should have numbering.
+
+// check first page
+CPPUNIT_ASSERT_EQUAL( OUString("1"), 
parseDump("/root/page[1]/body/txt[6]/Special", "rText"));
+CPPUNIT_ASSERT_EQUAL( OUString("1.1"), 
parseDump("/root/page[1]/body/txt[8]/Special", "rText"));
+CPPUNIT_ASSERT_EQUAL( OUString("1.2"), 
parseDump("/root/page[1]/body/txt[10]/Special", "rText"));
+
+// check some other pages
+CPPUNIT_ASSERT_EQUAL( OUString("1"), 
parseDump("/root/page[3]/body/txt[6]/Special", "rText"));
+CPPUNIT_ASSERT_EQUAL( OUString("1.1"), 
parseDump("/root/page[5]/body/txt[8]/Special", "rText"));
+CPPUNIT_ASSERT_EQUAL( OUString("1.2"), 
parseDump("/root/page[7]/body/txt[10]/Special", "rText"));
+}
+
+DECLARE_FILE_MAILMERGE_TEST(testTd78611_file, "tdf78611.odt", 
"10-testing-addresses.ods", "testing-addresses")
+{
+executeMailMerge(true);
+for (int doc =

[Libreoffice-commits] core.git: Branch 'feature/cib_contract891c' - 4 commits - sw/qa sw/source

2021-08-17 Thread Serge Krot (via logerrit)
 sw/qa/extras/uiwriter/data/tdf113877_blank.odt |binary
 sw/qa/extras/uiwriter/data/tdf113877_blank_bold_off.odt|binary
 sw/qa/extras/uiwriter/data/tdf113877_blank_bold_on.odt |binary
 sw/qa/extras/uiwriter/data/tdf113877_blank_ownStandard.odt |binary
 sw/qa/extras/uiwriter/data/tdf113877_insert_numbered_list.odt  |binary
 sw/qa/extras/uiwriter/data/tdf113877_insert_numbered_list_abcd.odt |binary
 sw/qa/extras/uiwriter/uiwriter.cxx |  136 
++
 sw/source/core/txtnode/ndtxt.cxx   |   45 ++
 sw/source/filter/xml/xmlimp.cxx|  208 
++
 sw/source/filter/xml/xmlimp.hxx|1 
 10 files changed, 389 insertions(+), 1 deletion(-)

New commits:
commit 9f1a4dfa29354155eebf589174dfeed60b7884f2
Author: Serge Krot 
AuthorDate: Thu Oct 8 09:01:33 2020 +0200
Commit: Samuel Mehrbrodt 
CommitDate: Mon Aug 16 13:50:23 2021 +

tdf#132289 missing styles when inserting file with list

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104085
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104319
Tested-by: Thorsten Behrens 
(cherry picked from commit 92c05bd1f8ef695a56718c4b54babbe757ab9b89)

Change-Id: I444997a6cc55cfe287f4c610f538f2f54803646c

diff --git a/sw/qa/extras/uiwriter/data/tdf113877_blank_bold_off.odt 
b/sw/qa/extras/uiwriter/data/tdf113877_blank_bold_off.odt
new file mode 100644
index ..f4d58da53b95
Binary files /dev/null and 
b/sw/qa/extras/uiwriter/data/tdf113877_blank_bold_off.odt differ
diff --git a/sw/qa/extras/uiwriter/data/tdf113877_blank_bold_on.odt 
b/sw/qa/extras/uiwriter/data/tdf113877_blank_bold_on.odt
new file mode 100644
index ..8de77fc6161c
Binary files /dev/null and 
b/sw/qa/extras/uiwriter/data/tdf113877_blank_bold_on.odt differ
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx 
b/sw/qa/extras/uiwriter/uiwriter.cxx
index 18ce6702c239..d11cf4e2d3f8 100755
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -248,6 +248,11 @@ public:
 void testTdf105417();
 void testTdf105625();
 void testTdf106736();
+
+void testTdf113877_mergeDocs(const char* aDestDoc, const char* aInsertDoc);
+void testTdf113877_blank_bold_on();
+void testTdf113877_blank_bold_off();
+
 void testMsWordCompTrailingBlanks();
 void testCreateDocxAnnotation();
 void testTdf107976();
@@ -392,6 +397,8 @@ public:
 CPPUNIT_TEST(testTdf105417);
 CPPUNIT_TEST(testTdf105625);
 CPPUNIT_TEST(testTdf106736);
+CPPUNIT_TEST(testTdf113877_blank_bold_on);
+CPPUNIT_TEST(testTdf113877_blank_bold_off);
 CPPUNIT_TEST(testMsWordCompTrailingBlanks);
 CPPUNIT_TEST(testCreateDocxAnnotation);
 CPPUNIT_TEST(testTdf107976);
@@ -5040,11 +5047,9 @@ void SwUiWriterTest::testTdf113790()
 CPPUNIT_ASSERT(dynamic_cast(mxComponent.get()));
 }
 
-// During insert of the document with list inside into the main document 
inside the list
-// we should merge both lists into one, when they have the same list properties
-void SwUiWriterTest::testTdf113877()
+void SwUiWriterTest::testTdf113877_mergeDocs(const char* aDestDoc, const char* 
aInsertDoc)
 {
-load(DATA_DIRECTORY, "tdf113877_insert_numbered_list.odt");
+load(DATA_DIRECTORY, aDestDoc);
 
 // set a page cursor into the end of the document
 uno::Reference xModel(mxComponent, uno::UNO_QUERY);
@@ -5054,10 +5059,17 @@ void SwUiWriterTest::testTdf113877()
 
 // insert the same document at current cursor position
 {
-const OUString insertFileid = 
m_directories.getURLFromSrc(DATA_DIRECTORY) + 
"tdf113877_insert_numbered_list.odt";
+const OUString insertFileid = 
m_directories.getURLFromSrc(DATA_DIRECTORY) + 
OUString::createFromAscii(aInsertDoc);
 uno::Sequence 
aPropertyValues(comphelper::InitPropertySequence({ { "Name", 
uno::makeAny(insertFileid) } }));
 lcl_dispatchCommand(mxComponent, ".uno:InsertDoc", aPropertyValues);
 }
+}
+
+// During insert of the document with list inside into the main document 
inside the list
+// we should merge both lists into one, when they have the same list properties
+void SwUiWriterTest::testTdf113877()
+{
+testTdf113877_mergeDocs("tdf113877_insert_numbered_list.odt", 
"tdf113877_insert_numbered_list.odt");
 
 const OUString listId1 = getProperty(getParagraph(1), "ListId");
 const OUString listId4 = getProperty(getParagraph(4), "ListId");
@@ -5077,20 +5089,7 @@ void SwUiWriterTest::testTdf113877()
 // The same test as testTdf113877() but merging of two list should not be 
performed.
 void SwUiWriterTest::testTdf113877NoMerge()
 {
-load(DATA_DIRECTORY, "tdf113877_insert_numbered_list.odt");
-
-  

[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-4+backports' - cui/source include/svx sc/qa svx/source

2020-11-13 Thread Serge Krot (via logerrit)
 cui/source/tabpages/border.cxx |  120 +
 include/svx/frmsel.hxx |2 
 sc/qa/uitest/calc_tests/formatCells.py |   53 ++
 svx/source/dialog/frmsel.cxx   |5 +
 4 files changed, 151 insertions(+), 29 deletions(-)

New commits:
commit 63540cbef6484fa9dc017c93676d0b5e85075303
Author: Serge Krot 
AuthorDate: Tue Oct 27 11:26:55 2020 +0100
Commit: Thorsten Behrens 
CommitDate: Fri Nov 13 21:29:45 2020 +0100

tdf#137790 calc: Minimal line width for different line styles

Change-Id: I4d062f054a5ef6da7ef595190a7b3c6e2a0b191e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104865
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

tdf#137790 calc: set minimal line width: unit test

Change-Id: Idac7c23e55b3c4ee94790458fca5e7a7a5522098
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105301
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105409
Tested-by: Thorsten Behrens 

diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx
index 84bdcd8f92c1..5ded87ea6659 100644
--- a/cui/source/tabpages/border.cxx
+++ b/cui/source/tabpages/border.cxx
@@ -81,6 +81,43 @@ static void lcl_SetDecimalDigitsTo1(weld::MetricSpinButton& 
rField)
 rField.set_min(rField.normalize(nMin), FieldUnit::TWIP);
 }
 
+// returns in pt
+static sal_Int64 lcl_GetMinLineWidth(SvxBorderLineStyle aStyle)
+{
+switch (aStyle)
+{
+case SvxBorderLineStyle::NONE:
+return 0;
+
+case SvxBorderLineStyle::SOLID:
+case SvxBorderLineStyle::DOTTED:
+case SvxBorderLineStyle::DASHED:
+case SvxBorderLineStyle::FINE_DASHED:
+case SvxBorderLineStyle::DASH_DOT:
+case SvxBorderLineStyle::DASH_DOT_DOT:
+return 15;
+
+// Double lines
+case SvxBorderLineStyle::DOUBLE: return 22;
+case SvxBorderLineStyle::DOUBLE_THIN: return 22;
+case SvxBorderLineStyle::THINTHICK_SMALLGAP: return 20;
+case SvxBorderLineStyle::THINTHICK_MEDIUMGAP: return 15;
+case SvxBorderLineStyle::THINTHICK_LARGEGAP: return 15;
+case SvxBorderLineStyle::THICKTHIN_SMALLGAP: return 20;
+case SvxBorderLineStyle::THICKTHIN_MEDIUMGAP: return 15;
+case SvxBorderLineStyle::THICKTHIN_LARGEGAP: return 15;
+
+case SvxBorderLineStyle::EMBOSSED: return 15;
+case SvxBorderLineStyle::ENGRAVED: return 15;
+
+case SvxBorderLineStyle::OUTSET: return 10;
+case SvxBorderLineStyle::INSET: return 10;
+
+default:
+return 15;
+}
+}
+
 // number of preset images to show
 const sal_uInt16 SVX_BORDER_PRESET_COUNT = 5;
 
@@ -1170,15 +1207,37 @@ IMPL_LINK_NOARG(SvxBorderTabPage, ModifyWidthHdl_Impl, 
weld::MetricSpinButton&,
 
 IMPL_LINK_NOARG(SvxBorderTabPage, SelStyleHdl_Impl, SvtLineListBox&, void)
 {
-sal_Int64 nVal = m_xLineWidthMF->get_value(FieldUnit::NONE);
-nVal = static_cast(MetricField::ConvertDoubleValue(
-nVal,
-m_xLineWidthMF->get_digits(),
-FieldUnit::POINT, MapUnit::MapTwip ));
-m_aFrameSel.SetStyleToSelection ( nVal,
+sal_Int64 nOldWidth = m_xLineWidthMF->get_value(FieldUnit::NONE);
+nOldWidth = static_cast(MetricField::ConvertDoubleValue(
+nOldWidth,
+m_xLineWidthMF->get_digits(),
+FieldUnit::POINT,
+MapUnit::MapTwip));
+
+const sal_Int64 nOldMinWidth = 
lcl_GetMinLineWidth(m_aFrameSel.getCurrentStyleLineStyle());
+const sal_Int64 nNewMinWidth = 
lcl_GetMinLineWidth(m_xLbLineStyle->GetSelectEntryStyle());
+
+// auto change line-width if it doesn't correspond to minimal value
+// let's change only in case when user has not changed the line-width into 
some custom value
+const sal_Int64 nNewWidth = (nOldMinWidth == nOldWidth)? nNewMinWidth : 
nOldWidth;
+
+// set value inside edit box
+if (nOldWidth != nNewWidth)
+{
+const sal_Int64 nNewWidthPt = 
static_cast(MetricField::ConvertDoubleValue(
+nNewWidth,
+m_xLineWidthMF->get_digits(),
+MapUnit::MapTwip,
+FieldUnit::POINT));
+m_xLineWidthMF->set_value(nNewWidthPt, FieldUnit::POINT);
+}
+
+// set value inside style box
+m_aFrameSel.SetStyleToSelection( nNewWidth,
 m_xLbLineStyle->GetSelectEntryStyle() );
 }
 
+
 // ValueSet handling
 sal_uInt16 SvxBorderTabPage::GetPresetImageId( sal_uInt16 nValueSetIdx ) const
 {
@@ -1309,34 +1368,33 @@ void SvxBorderTabPage::FillLineListBox_Impl()
 
 static struct {
 SvxBorderLineStyle mnStyle;
-long mnMinWidth;
 SvtLineListBox::ColorFunc mpColor1Fn;
 SvtLineListBox::ColorFunc mpColor2Fn;
 SvtLineListBox::ColorDistFunc mpColorDistFn;
 } const aLines[] = {
 // Simple lines
-{ SvxBorderLineStyle::SOLID,0, , , 
 },
-{

[Libreoffice-commits] core.git: sc/qa

2020-11-04 Thread Serge Krot (via logerrit)
 sc/qa/uitest/calc_tests/formatCells.py |   53 +
 1 file changed, 53 insertions(+)

New commits:
commit 268a79985c773be7bd843a240eb7226c6f51d3aa
Author: Serge Krot 
AuthorDate: Wed Nov 4 17:38:44 2020 +0100
Commit: Thorsten Behrens 
CommitDate: Thu Nov 5 02:28:06 2020 +0100

tdf#137790 calc: set minimal line width: unit test

Change-Id: Idac7c23e55b3c4ee94790458fca5e7a7a5522098
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105301
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/sc/qa/uitest/calc_tests/formatCells.py 
b/sc/qa/uitest/calc_tests/formatCells.py
index 7508a47aaf4a..3bb78348fac2 100644
--- a/sc/qa/uitest/calc_tests/formatCells.py
+++ b/sc/qa/uitest/calc_tests/formatCells.py
@@ -294,6 +294,59 @@ class formatCell(UITestCase):
 
 self.ui_test.close_doc()
 
+def test_minimal_border_width(self):
+#borderpage.ui, tdf#137790
+calc_doc = self.ui_test.create_doc_in_start_center("calc")
+xCalcDoc = self.xUITest.getTopFocusWindow()
+gridwin = xCalcDoc.getChild("grid_window")
+document = self.ui_test.get_component()
+
+#set points pt measurement
+change_measurement_unit(self, "Point")
+
+#select cell A1
+gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+#format - cell
+self.ui_test.execute_dialog_through_command(".uno:FormatCellDialog")
+xDialog = self.xUITest.getTopFocusWindow()
+xTabs = xDialog.getChild("tabcontrol")
+select_pos(xTabs, "5")  #tab Borders
+
+linewidthmf = xDialog.getChild("linewidthmf")
+xLineSet = xDialog.getChild('lineset')
+
+# check line-width for default solid line
+self.assertEqual('0', get_state_as_dict(xLineSet)['SelectedItemPos'])
+widthVal = get_state_as_dict(linewidthmf)["Text"]
+self.assertEqual(widthVal, '0.75 pt')
+
+# set line style to "double" (minimal width is taken)
+xLineSet.executeAction("CHOOSE", mkPropertyValues({"POS": '16'}))
+widthVal = get_state_as_dict(linewidthmf)["Text"]
+self.assertEqual(widthVal, '1.10 pt')
+
+# set line style to "solid"
+xLineSet.executeAction("CHOOSE", mkPropertyValues({"POS": "1"}))
+widthVal = get_state_as_dict(linewidthmf)["Text"]
+self.assertEqual(widthVal, '0.75 pt')
+
+# make custom line width
+linewidthmf.executeAction("UP", tuple())
+linewidthmf.executeAction("UP", tuple())
+linewidthmf.executeAction("UP", tuple())
+widthVal = get_state_as_dict(linewidthmf)["Text"]
+self.assertEqual(widthVal, '1.50 pt')
+
+# set line style to "double" (minimal width is not taken)
+xLineSet.executeAction("CHOOSE", mkPropertyValues({"POS": "8"}))
+widthVal = get_state_as_dict(linewidthmf)["Text"]
+self.assertEqual(widthVal, '1.50 pt')
+
+xOKBtn = xDialog.getChild("ok")
+self.ui_test.close_dialog_through_button(xOKBtn)
+
+self.ui_test.close_doc()
+
 def test_format_cell_borders_tab(self):
 #borderpage.ui
 calc_doc = self.ui_test.create_doc_in_start_center("calc")
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: cui/source include/svx svx/source

2020-10-28 Thread Serge Krot (via logerrit)
 cui/source/tabpages/border.cxx |  120 +++--
 include/svx/frmsel.hxx |2 
 svx/source/dialog/frmsel.cxx   |5 +
 3 files changed, 98 insertions(+), 29 deletions(-)

New commits:
commit de1c4863ab993c80d8fea50ce420d568f75bf2e6
Author: Serge Krot 
AuthorDate: Tue Oct 27 11:26:55 2020 +0100
Commit: Thorsten Behrens 
CommitDate: Wed Oct 28 10:36:38 2020 +0100

tdf#137790 calc: Minimal line width for different line styles

Change-Id: I4d062f054a5ef6da7ef595190a7b3c6e2a0b191e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104865
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx
index d952ae97ad8c..c60e2a9aba1d 100644
--- a/cui/source/tabpages/border.cxx
+++ b/cui/source/tabpages/border.cxx
@@ -85,6 +85,43 @@ static void lcl_SetDecimalDigitsTo1(weld::MetricSpinButton& 
rField)
 rField.set_min(rField.normalize(nMin), FieldUnit::TWIP);
 }
 
+// returns in pt
+static sal_Int64 lcl_GetMinLineWidth(SvxBorderLineStyle aStyle)
+{
+switch (aStyle)
+{
+case SvxBorderLineStyle::NONE:
+return 0;
+
+case SvxBorderLineStyle::SOLID:
+case SvxBorderLineStyle::DOTTED:
+case SvxBorderLineStyle::DASHED:
+case SvxBorderLineStyle::FINE_DASHED:
+case SvxBorderLineStyle::DASH_DOT:
+case SvxBorderLineStyle::DASH_DOT_DOT:
+return 15;
+
+// Double lines
+case SvxBorderLineStyle::DOUBLE: return 22;
+case SvxBorderLineStyle::DOUBLE_THIN: return 22;
+case SvxBorderLineStyle::THINTHICK_SMALLGAP: return 20;
+case SvxBorderLineStyle::THINTHICK_MEDIUMGAP: return 15;
+case SvxBorderLineStyle::THINTHICK_LARGEGAP: return 15;
+case SvxBorderLineStyle::THICKTHIN_SMALLGAP: return 20;
+case SvxBorderLineStyle::THICKTHIN_MEDIUMGAP: return 15;
+case SvxBorderLineStyle::THICKTHIN_LARGEGAP: return 15;
+
+case SvxBorderLineStyle::EMBOSSED: return 15;
+case SvxBorderLineStyle::ENGRAVED: return 15;
+
+case SvxBorderLineStyle::OUTSET: return 10;
+case SvxBorderLineStyle::INSET: return 10;
+
+default:
+return 15;
+}
+}
+
 // number of preset images to show
 const sal_uInt16 SVX_BORDER_PRESET_COUNT = 5;
 
@@ -1192,15 +1229,37 @@ IMPL_LINK_NOARG(SvxBorderTabPage, ModifyWidthHdl_Impl, 
weld::MetricSpinButton&,
 
 IMPL_LINK_NOARG(SvxBorderTabPage, SelStyleHdl_Impl, SvtLineListBox&, void)
 {
-sal_Int64 nVal = m_xLineWidthMF->get_value(FieldUnit::NONE);
-nVal = static_cast(vcl::ConvertDoubleValue(
-nVal,
-m_xLineWidthMF->get_digits(),
-FieldUnit::POINT, MapUnit::MapTwip ));
-m_aFrameSel.SetStyleToSelection ( nVal,
+sal_Int64 nOldWidth = m_xLineWidthMF->get_value(FieldUnit::NONE);
+nOldWidth = static_cast(vcl::ConvertDoubleValue(
+nOldWidth,
+m_xLineWidthMF->get_digits(),
+FieldUnit::POINT,
+MapUnit::MapTwip));
+
+const sal_Int64 nOldMinWidth = 
lcl_GetMinLineWidth(m_aFrameSel.getCurrentStyleLineStyle());
+const sal_Int64 nNewMinWidth = 
lcl_GetMinLineWidth(m_xLbLineStyle->GetSelectEntryStyle());
+
+// auto change line-width if it doesn't correspond to minimal value
+// let's change only in case when user has not changed the line-width into 
some custom value
+const sal_Int64 nNewWidth = (nOldMinWidth == nOldWidth)? nNewMinWidth : 
nOldWidth;
+
+// set value inside edit box
+if (nOldWidth != nNewWidth)
+{
+const sal_Int64 nNewWidthPt = 
static_cast(vcl::ConvertDoubleValue(
+nNewWidth,
+m_xLineWidthMF->get_digits(),
+MapUnit::MapTwip,
+FieldUnit::POINT));
+m_xLineWidthMF->set_value(nNewWidthPt, FieldUnit::POINT);
+}
+
+// set value inside style box
+m_aFrameSel.SetStyleToSelection( nNewWidth,
 m_xLbLineStyle->GetSelectEntryStyle() );
 }
 
+
 // ValueSet handling
 sal_uInt16 SvxBorderTabPage::GetPresetImageId( sal_uInt16 nValueSetIdx ) const
 {
@@ -1331,34 +1390,33 @@ void SvxBorderTabPage::FillLineListBox_Impl()
 
 static struct {
 SvxBorderLineStyle mnStyle;
-tools::Long mnMinWidth;
 SvtLineListBox::ColorFunc mpColor1Fn;
 SvtLineListBox::ColorFunc mpColor2Fn;
 SvtLineListBox::ColorDistFunc mpColorDistFn;
 } const aLines[] = {
 // Simple lines
-{ SvxBorderLineStyle::SOLID,0, , , 
 },
-{ SvxBorderLineStyle::DOTTED,   0, , , 
 },
-{ SvxBorderLineStyle::DASHED,   0, , , 
 },
-{ SvxBorderLineStyle::FINE_DASHED,  0, , , 
 },
-{ SvxBorderLineStyle::DASH_DOT, 0, , , 
 },
-{ SvxBorderLineStyle::DASH_DOT_DOT, 0, , , 
 },
+{ SvxBorderLineStyle::SOLID,, , 
 },
+{ SvxBorderLineStyle::DOTTED,   , , 
 },
+{ SvxBorderLineStyle::DASHED,   , , 
 },
+ 

[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - xmlscript/source

2020-10-28 Thread Serge Krot (via logerrit)
 xmlscript/source/xmldlg_imexp/imp_share.hxx|5 -
 xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx |8 
 2 files changed, 8 insertions(+), 5 deletions(-)

New commits:
commit d0124b5178d4edbbfeae0ea5edd64873bc942666
Author: Serge Krot 
AuthorDate: Wed Oct 21 13:39:01 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Wed Oct 28 10:34:22 2020 +0100

tdf#137652 fix XDL import: no more missing empty items for combobox

Change-Id: I6837968ee7cc5e4b3bc9abd7e320f562c6ff0833
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104619
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
(cherry picked from commit f4a5893eceabc1f6d541164a0e858456f0ce0905)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104679

diff --git a/xmlscript/source/xmldlg_imexp/imp_share.hxx 
b/xmlscript/source/xmldlg_imexp/imp_share.hxx
index 977625bebae0..6d8e9128a336 100644
--- a/xmlscript/source/xmldlg_imexp/imp_share.hxx
+++ b/xmlscript/source/xmldlg_imexp/imp_share.hxx
@@ -311,6 +311,7 @@ class MenuPopupElement
 {
 std::vector< OUString > _itemValues;
 std::vector< sal_Int16 > _itemSelected;
+bool _allowEmptyItems;
 public:
 css::uno::Sequence< OUString > getItemValues();
 css::uno::Sequence< sal_Int16 > getSelectedItems();
@@ -323,9 +324,11 @@ public:
 MenuPopupElement(
 OUString const & rLocalName,
 css::uno::Reference< css::xml::input::XAttributes > const & 
xAttributes,
-ElementBase * pParent, DialogImport * pImport )
+ElementBase * pParent, DialogImport * pImport,
+bool aAllowEmptyItems)
 : ElementBase( pImport->XMLNS_DIALOGS_UID,
rLocalName, xAttributes, pParent, pImport )
+, _allowEmptyItems(aAllowEmptyItems)
 {}
 };
 
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx 
b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
index 640776592e58..f3ed895b0c24 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
@@ -1275,8 +1275,8 @@ Reference< xml::input::XElement > 
MenuPopupElement::startChildElement(
 else if ( rLocalName == "menuitem" )
 {
 OUString aValue( xAttributes->getValueByUidName( 
m_xImport->XMLNS_DIALOGS_UID,"value" ) );
-SAL_WARN_IF( aValue.isEmpty(), "xmlscript.xmldlg", "### menuitem has 
no value?" );
-if (!aValue.isEmpty())
+SAL_WARN_IF( aValue.isEmpty() && !_allowEmptyItems, 
"xmlscript.xmldlg", "### menuitem has no value?" );
+if ((!aValue.isEmpty()) || _allowEmptyItems)
 {
 _itemValues.push_back( aValue );
 
@@ -1331,7 +1331,7 @@ Reference< xml::input::XElement > 
MenuListElement::startChildElement(
 // menupopup
 else if ( rLocalName == "menupopup" )
 {
-_popup = new MenuPopupElement( rLocalName, xAttributes, this, 
m_xImport.get() );
+_popup = new MenuPopupElement( rLocalName, xAttributes, this, 
m_xImport.get(), false );
 return _popup;
 }
 else
@@ -1399,7 +1399,7 @@ Reference< xml::input::XElement > 
ComboBoxElement::startChildElement(
 // menupopup
 else if ( rLocalName == "menupopup" )
 {
-_popup = new MenuPopupElement( rLocalName, xAttributes, this, 
m_xImport.get() );
+_popup = new MenuPopupElement( rLocalName, xAttributes, this, 
m_xImport.get(), true );
 return _popup;
 }
 else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-4+backports' - xmlscript/source

2020-10-27 Thread Serge Krot (via logerrit)
 xmlscript/source/xmldlg_imexp/imp_share.hxx|5 -
 xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx |8 
 2 files changed, 8 insertions(+), 5 deletions(-)

New commits:
commit bc3d663ac83c59ccc6850277e0a00a9ab4881724
Author: Serge Krot 
AuthorDate: Wed Oct 21 13:39:01 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Tue Oct 27 15:37:03 2020 +0100

tdf#137652 fix XDL import: no more missing empty items for combobox

Change-Id: I6837968ee7cc5e4b3bc9abd7e320f562c6ff0833
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104619
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104715
Tested-by: Thorsten Behrens 

diff --git a/xmlscript/source/xmldlg_imexp/imp_share.hxx 
b/xmlscript/source/xmldlg_imexp/imp_share.hxx
index 709bdf88c8ee..caed524c9a54 100644
--- a/xmlscript/source/xmldlg_imexp/imp_share.hxx
+++ b/xmlscript/source/xmldlg_imexp/imp_share.hxx
@@ -312,6 +312,7 @@ class MenuPopupElement
 {
 std::vector< OUString > _itemValues;
 std::vector< sal_Int16 > _itemSelected;
+bool _allowEmptyItems;
 public:
 css::uno::Sequence< OUString > getItemValues();
 css::uno::Sequence< sal_Int16 > getSelectedItems();
@@ -324,9 +325,11 @@ public:
 MenuPopupElement(
 OUString const & rLocalName,
 css::uno::Reference< css::xml::input::XAttributes > const & 
xAttributes,
-ElementBase * pParent, DialogImport * pImport )
+ElementBase * pParent, DialogImport * pImport,
+bool aAllowEmptyItems)
 : ElementBase( pImport->XMLNS_DIALOGS_UID,
rLocalName, xAttributes, pParent, pImport )
+, _allowEmptyItems(aAllowEmptyItems)
 {}
 };
 
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx 
b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
index 640776592e58..f3ed895b0c24 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
@@ -1275,8 +1275,8 @@ Reference< xml::input::XElement > 
MenuPopupElement::startChildElement(
 else if ( rLocalName == "menuitem" )
 {
 OUString aValue( xAttributes->getValueByUidName( 
m_xImport->XMLNS_DIALOGS_UID,"value" ) );
-SAL_WARN_IF( aValue.isEmpty(), "xmlscript.xmldlg", "### menuitem has 
no value?" );
-if (!aValue.isEmpty())
+SAL_WARN_IF( aValue.isEmpty() && !_allowEmptyItems, 
"xmlscript.xmldlg", "### menuitem has no value?" );
+if ((!aValue.isEmpty()) || _allowEmptyItems)
 {
 _itemValues.push_back( aValue );
 
@@ -1331,7 +1331,7 @@ Reference< xml::input::XElement > 
MenuListElement::startChildElement(
 // menupopup
 else if ( rLocalName == "menupopup" )
 {
-_popup = new MenuPopupElement( rLocalName, xAttributes, this, 
m_xImport.get() );
+_popup = new MenuPopupElement( rLocalName, xAttributes, this, 
m_xImport.get(), false );
 return _popup;
 }
 else
@@ -1399,7 +1399,7 @@ Reference< xml::input::XElement > 
ComboBoxElement::startChildElement(
 // menupopup
 else if ( rLocalName == "menupopup" )
 {
-_popup = new MenuPopupElement( rLocalName, xAttributes, this, 
m_xImport.get() );
+_popup = new MenuPopupElement( rLocalName, xAttributes, this, 
m_xImport.get(), true );
 return _popup;
 }
 else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: xmlscript/source

2020-10-22 Thread Serge Krot (via logerrit)
 xmlscript/source/xmldlg_imexp/imp_share.hxx|5 -
 xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx |8 
 2 files changed, 8 insertions(+), 5 deletions(-)

New commits:
commit f4a5893eceabc1f6d541164a0e858456f0ce0905
Author: Serge Krot 
AuthorDate: Wed Oct 21 13:39:01 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Thu Oct 22 16:30:48 2020 +0200

tdf#137652 fix XDL import: no more missing empty items for combobox

Change-Id: I6837968ee7cc5e4b3bc9abd7e320f562c6ff0833
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104619
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/xmlscript/source/xmldlg_imexp/imp_share.hxx 
b/xmlscript/source/xmldlg_imexp/imp_share.hxx
index 977625bebae0..6d8e9128a336 100644
--- a/xmlscript/source/xmldlg_imexp/imp_share.hxx
+++ b/xmlscript/source/xmldlg_imexp/imp_share.hxx
@@ -311,6 +311,7 @@ class MenuPopupElement
 {
 std::vector< OUString > _itemValues;
 std::vector< sal_Int16 > _itemSelected;
+bool _allowEmptyItems;
 public:
 css::uno::Sequence< OUString > getItemValues();
 css::uno::Sequence< sal_Int16 > getSelectedItems();
@@ -323,9 +324,11 @@ public:
 MenuPopupElement(
 OUString const & rLocalName,
 css::uno::Reference< css::xml::input::XAttributes > const & 
xAttributes,
-ElementBase * pParent, DialogImport * pImport )
+ElementBase * pParent, DialogImport * pImport,
+bool aAllowEmptyItems)
 : ElementBase( pImport->XMLNS_DIALOGS_UID,
rLocalName, xAttributes, pParent, pImport )
+, _allowEmptyItems(aAllowEmptyItems)
 {}
 };
 
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx 
b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
index 96177d502165..9f324465cf48 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
@@ -1275,8 +1275,8 @@ Reference< xml::input::XElement > 
MenuPopupElement::startChildElement(
 else if ( rLocalName == "menuitem" )
 {
 OUString aValue( xAttributes->getValueByUidName( 
m_xImport->XMLNS_DIALOGS_UID,"value" ) );
-SAL_WARN_IF( aValue.isEmpty(), "xmlscript.xmldlg", "### menuitem has 
no value?" );
-if (!aValue.isEmpty())
+SAL_WARN_IF( aValue.isEmpty() && !_allowEmptyItems, 
"xmlscript.xmldlg", "### menuitem has no value?" );
+if ((!aValue.isEmpty()) || _allowEmptyItems)
 {
 _itemValues.push_back( aValue );
 
@@ -1331,7 +1331,7 @@ Reference< xml::input::XElement > 
MenuListElement::startChildElement(
 // menupopup
 else if ( rLocalName == "menupopup" )
 {
-_popup = new MenuPopupElement( rLocalName, xAttributes, this, 
m_xImport.get() );
+_popup = new MenuPopupElement( rLocalName, xAttributes, this, 
m_xImport.get(), false );
 return _popup;
 }
 else
@@ -1399,7 +1399,7 @@ Reference< xml::input::XElement > 
ComboBoxElement::startChildElement(
 // menupopup
 else if ( rLocalName == "menupopup" )
 {
-_popup = new MenuPopupElement( rLocalName, xAttributes, this, 
m_xImport.get() );
+_popup = new MenuPopupElement( rLocalName, xAttributes, this, 
m_xImport.get(), true );
 return _popup;
 }
 else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-4+backports' - sw/qa sw/source

2020-10-14 Thread Serge Krot (via logerrit)
 sw/qa/extras/uiwriter/data/tdf113877_blank_bold_off.odt |binary
 sw/qa/extras/uiwriter/data/tdf113877_blank_bold_on.odt  |binary
 sw/qa/extras/uiwriter/uiwriter.cxx  |   88 +++-
 sw/source/core/txtnode/ndtxt.cxx|4 
 sw/source/filter/xml/xmlimp.cxx |3 
 5 files changed, 48 insertions(+), 47 deletions(-)

New commits:
commit 92c05bd1f8ef695a56718c4b54babbe757ab9b89
Author: Serge Krot 
AuthorDate: Thu Oct 8 09:01:33 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Wed Oct 14 22:59:35 2020 +0200

tdf#132289 missing styles when inserting file with list

Change-Id: I444997a6cc55cfe287f4c610f538f2f54803646c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104085
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104319
Tested-by: Thorsten Behrens 

diff --git a/sw/qa/extras/uiwriter/data/tdf113877_blank_bold_off.odt 
b/sw/qa/extras/uiwriter/data/tdf113877_blank_bold_off.odt
new file mode 100644
index ..f4d58da53b95
Binary files /dev/null and 
b/sw/qa/extras/uiwriter/data/tdf113877_blank_bold_off.odt differ
diff --git a/sw/qa/extras/uiwriter/data/tdf113877_blank_bold_on.odt 
b/sw/qa/extras/uiwriter/data/tdf113877_blank_bold_on.odt
new file mode 100644
index ..8de77fc6161c
Binary files /dev/null and 
b/sw/qa/extras/uiwriter/data/tdf113877_blank_bold_on.odt differ
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx 
b/sw/qa/extras/uiwriter/uiwriter.cxx
index be8a972a181a..cd8516d6c29e 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -317,10 +317,15 @@ public:
 void testTdf58604();
 void testTdf112025();
 void testTdf72942();
+
+void testTdf113877_mergeDocs(const char* aDestDoc, const char* aInsertDoc);
 void testTdf113877();
 void testTdf113877NoMerge();
 void testTdf113877_default_style();
 void testTdf113877_Standard_style();
+void testTdf113877_blank_bold_on();
+void testTdf113877_blank_bold_off();
+
 void testMsWordCompTrailingBlanks();
 void testCreateDocxAnnotation();
 void testTdf107976();
@@ -530,6 +535,8 @@ public:
 CPPUNIT_TEST(testTdf113877NoMerge);
 CPPUNIT_TEST(testTdf113877_default_style);
 CPPUNIT_TEST(testTdf113877_Standard_style);
+CPPUNIT_TEST(testTdf113877_blank_bold_on);
+CPPUNIT_TEST(testTdf113877_blank_bold_off);
 CPPUNIT_TEST(testMsWordCompTrailingBlanks);
 CPPUNIT_TEST(testCreateDocxAnnotation);
 CPPUNIT_TEST(testTdf107976);
@@ -6250,12 +6257,9 @@ void SwUiWriterTest::testTdf114306_2()
 CPPUNIT_ASSERT_EQUAL(4, getPages());
 }
 
-
-// During insert of the document with list inside into the main document 
inside the list
-// we should merge both lists into one, when they have the same list properties
-void SwUiWriterTest::testTdf113877()
+void SwUiWriterTest::testTdf113877_mergeDocs(const char* aDestDoc, const char* 
aInsertDoc)
 {
-load(DATA_DIRECTORY, "tdf113877_insert_numbered_list.odt");
+load(DATA_DIRECTORY, aDestDoc);
 
 // set a page cursor into the end of the document
 uno::Reference xModel(mxComponent, uno::UNO_QUERY);
@@ -6265,10 +6269,17 @@ void SwUiWriterTest::testTdf113877()
 
 // insert the same document at current cursor position
 {
-const OUString insertFileid = 
m_directories.getURLFromSrc(DATA_DIRECTORY) + 
"tdf113877_insert_numbered_list.odt";
+const OUString insertFileid = 
m_directories.getURLFromSrc(DATA_DIRECTORY) + 
OUString::createFromAscii(aInsertDoc);
 uno::Sequence 
aPropertyValues(comphelper::InitPropertySequence({ { "Name", 
uno::makeAny(insertFileid) } }));
 lcl_dispatchCommand(mxComponent, ".uno:InsertDoc", aPropertyValues);
 }
+}
+
+// During insert of the document with list inside into the main document 
inside the list
+// we should merge both lists into one, when they have the same list properties
+void SwUiWriterTest::testTdf113877()
+{
+testTdf113877_mergeDocs("tdf113877_insert_numbered_list.odt", 
"tdf113877_insert_numbered_list.odt");
 
 const OUString listId1 = getProperty(getParagraph(1), "ListId");
 const OUString listId4 = getProperty(getParagraph(4), "ListId");
@@ -6288,20 +6299,7 @@ void SwUiWriterTest::testTdf113877()
 // The same test as testTdf113877() but merging of two list should not be 
performed.
 void SwUiWriterTest::testTdf113877NoMerge()
 {
-load(DATA_DIRECTORY, "tdf113877_insert_numbered_list.odt");
-
-// set a page cursor into the end of the document
-uno::Reference xModel(mxComponent, uno::UNO_QUERY);
-uno::Reference 
xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY);
-uno::Reference 
xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY);
-xCursor->jumpToEndOfPage();
-
-   

[Libreoffice-commits] core.git: sw/qa sw/source

2020-10-10 Thread Serge Krot (via logerrit)
 sw/qa/extras/uiwriter/data/tdf113877_blank_bold_off.odt |binary
 sw/qa/extras/uiwriter/data/tdf113877_blank_bold_on.odt  |binary
 sw/qa/extras/uiwriter/uiwriter.cxx  |   88 +++-
 sw/source/core/txtnode/ndtxt.cxx|4 
 sw/source/filter/xml/xmlimp.cxx |1 
 5 files changed, 46 insertions(+), 47 deletions(-)

New commits:
commit 3f425069fc31bd6bac86d98312631321d0ff591f
Author: Serge Krot 
AuthorDate: Thu Oct 8 09:01:33 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Sat Oct 10 13:40:39 2020 +0200

tdf#132289 missing styles when inserting file with list

Change-Id: I444997a6cc55cfe287f4c610f538f2f54803646c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104085
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/sw/qa/extras/uiwriter/data/tdf113877_blank_bold_off.odt 
b/sw/qa/extras/uiwriter/data/tdf113877_blank_bold_off.odt
new file mode 100644
index ..f4d58da53b95
Binary files /dev/null and 
b/sw/qa/extras/uiwriter/data/tdf113877_blank_bold_off.odt differ
diff --git a/sw/qa/extras/uiwriter/data/tdf113877_blank_bold_on.odt 
b/sw/qa/extras/uiwriter/data/tdf113877_blank_bold_on.odt
new file mode 100644
index ..8de77fc6161c
Binary files /dev/null and 
b/sw/qa/extras/uiwriter/data/tdf113877_blank_bold_on.odt differ
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx 
b/sw/qa/extras/uiwriter/uiwriter.cxx
index 8bacd6781b18..9807343e912c 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -322,10 +322,15 @@ public:
 void testTdf58604();
 void testTdf112025();
 void testTdf72942();
+
+void testTdf113877_mergeDocs(const char* aDestDoc, const char* aInsertDoc);
 void testTdf113877();
 void testTdf113877NoMerge();
 void testTdf113877_default_style();
 void testTdf113877_Standard_style();
+void testTdf113877_blank_bold_on();
+void testTdf113877_blank_bold_off();
+
 void testMsWordCompTrailingBlanks();
 void testCreateDocxAnnotation();
 void testTdf107976();
@@ -546,6 +551,8 @@ public:
 CPPUNIT_TEST(testTdf113877NoMerge);
 CPPUNIT_TEST(testTdf113877_default_style);
 CPPUNIT_TEST(testTdf113877_Standard_style);
+CPPUNIT_TEST(testTdf113877_blank_bold_on);
+CPPUNIT_TEST(testTdf113877_blank_bold_off);
 CPPUNIT_TEST(testMsWordCompTrailingBlanks);
 CPPUNIT_TEST(testCreateDocxAnnotation);
 CPPUNIT_TEST(testTdf107976);
@@ -6300,12 +6307,9 @@ void SwUiWriterTest::testTdf114306_2()
 CPPUNIT_ASSERT_EQUAL(4, getPages());
 }
 
-
-// During insert of the document with list inside into the main document 
inside the list
-// we should merge both lists into one, when they have the same list properties
-void SwUiWriterTest::testTdf113877()
+void SwUiWriterTest::testTdf113877_mergeDocs(const char* aDestDoc, const char* 
aInsertDoc)
 {
-load(DATA_DIRECTORY, "tdf113877_insert_numbered_list.odt");
+load(DATA_DIRECTORY, aDestDoc);
 
 // set a page cursor into the end of the document
 uno::Reference xModel(mxComponent, uno::UNO_QUERY);
@@ -6315,10 +6319,17 @@ void SwUiWriterTest::testTdf113877()
 
 // insert the same document at current cursor position
 {
-const OUString insertFileid = 
m_directories.getURLFromSrc(DATA_DIRECTORY) + 
"tdf113877_insert_numbered_list.odt";
+const OUString insertFileid = 
m_directories.getURLFromSrc(DATA_DIRECTORY) + 
OUString::createFromAscii(aInsertDoc);
 uno::Sequence 
aPropertyValues(comphelper::InitPropertySequence({ { "Name", 
uno::makeAny(insertFileid) } }));
 dispatchCommand(mxComponent, ".uno:InsertDoc", aPropertyValues);
 }
+}
+
+// During insert of the document with list inside into the main document 
inside the list
+// we should merge both lists into one, when they have the same list properties
+void SwUiWriterTest::testTdf113877()
+{
+testTdf113877_mergeDocs("tdf113877_insert_numbered_list.odt", 
"tdf113877_insert_numbered_list.odt");
 
 const OUString listId1 = getProperty(getParagraph(1), "ListId");
 const OUString listId4 = getProperty(getParagraph(4), "ListId");
@@ -6338,20 +6349,7 @@ void SwUiWriterTest::testTdf113877()
 // The same test as testTdf113877() but merging of two list should not be 
performed.
 void SwUiWriterTest::testTdf113877NoMerge()
 {
-load(DATA_DIRECTORY, "tdf113877_insert_numbered_list.odt");
-
-// set a page cursor into the end of the document
-uno::Reference xModel(mxComponent, uno::UNO_QUERY);
-uno::Reference 
xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY);
-uno::Reference 
xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY);
-xCursor->jumpToEndOfPage();
-
-// insert the same document at current cursor position
-{
-const OUString insertFileid = 
m_d

[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-4+backports' - desktop/source officecfg/registry stoc/source

2020-09-27 Thread Serge Krot (via logerrit)
 desktop/source/app/app.cxx |   51 +
 officecfg/registry/schema/org/openoffice/Office/Common.xcs |7 +
 stoc/source/javaloader/javaloader.cxx  |8 +-
 3 files changed, 65 insertions(+), 1 deletion(-)

New commits:
commit d0fdfe0e92a1989c61613fcb8deeb3256eb0816a
Author: Serge Krot 
AuthorDate: Wed Mar 25 16:56:18 2020 +0100
Commit: Thorsten Behrens 
CommitDate: Sun Sep 27 12:03:08 2020 +0200

speed-up: preload JVM when PreloadJVM is set

Change-Id: I57f77f127f7cb45fb181b755b40873d47015e5b2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91059
Tested-by: Thorsten Behrens 
Reviewed-by: Thorsten Behrens 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103390

diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index e5d0939b2e93..2da91af2cccb 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -83,6 +83,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -129,6 +130,7 @@
 #include 
 #include 
 #include "langselect.hxx"
+#include 
 
 #if defined MACOSX
 #include 
@@ -1217,6 +1219,38 @@ void Desktop::AppEvent( const ApplicationEvent& 
rAppEvent )
 HandleAppEvent( rAppEvent );
 }
 
+namespace {
+
+class JVMloadThread : public salhelper::Thread {
+public:
+JVMloadThread() : salhelper::Thread("Preload JVM thread")
+{
+}
+
+private:
+virtual void execute() override final
+{
+Reference< XMultiServiceFactory > xSMgr = 
comphelper::getProcessServiceFactory();
+
+Reference< css::loader::XImplementationLoader > xJavaComponentLoader(
+
xSMgr->createInstance("com.sun.star.comp.stoc.JavaComponentLoader"),
+css::uno::UNO_QUERY_THROW);
+
+if (xJavaComponentLoader.is())
+{
+const css::uno::Reference< 
::com::sun::star::registry::XRegistryKey > xRegistryKey;
+try
+{
+xJavaComponentLoader->activate("", "", "", xRegistryKey);
+}
+catch (...)
+{
+SAL_WARN("desktop.app", "Cannot activate factory during JVM 
preloading");
+}
+}
+}
+};
+
 struct ExecuteGlobals
 {
 Reference < css::document::XDocumentEventListener > xGlobalBroadcaster;
@@ -1224,12 +1258,14 @@ struct ExecuteGlobals
 bool bUseSystemFileDialog;
 std::unique_ptr pLanguageOptions;
 std::unique_ptr pPathOptions;
+rtl::Reference< JVMloadThread > xJVMloadThread;
 
 ExecuteGlobals()
 : bRestartRequested( false )
 , bUseSystemFileDialog( true )
 {}
 };
+}
 
 static ExecuteGlobals* pExecGlobals = nullptr;
 
@@ -1254,6 +1290,15 @@ int Desktop::Main()
 // Detect desktop environment - need to do this as early as possible
 css::uno::setCurrentContext( new DesktopContext( 
css::uno::getCurrentContext() ) );
 
+if (officecfg::Office::Common::Misc::PreloadJVM::get() && pExecGlobals)
+{
+SAL_INFO("desktop.app", "Preload JVM");
+
+// pre-load JVM
+pExecGlobals->xJVMloadThread = new JVMloadThread();
+pExecGlobals->xJVMloadThread->launch();
+}
+
 CommandLineArgs& rCmdLineArgs = GetCommandLineArgs();
 
 Translate::SetReadStringHook(ReplaceStringHookProc);
@@ -1663,6 +1708,12 @@ int Desktop::doShutdown()
 if (m_aUpdateThread.joinable())
 m_aUpdateThread.join();
 
+if (pExecGlobals->xJVMloadThread.is())
+{
+pExecGlobals->xJVMloadThread->join();
+pExecGlobals->xJVMloadThread.clear();
+}
+
 pExecGlobals->bRestartRequested = pExecGlobals->bRestartRequested ||
 OfficeRestartManager::get(comphelper::getProcessComponentContext())->
 isRestartRequested(true);
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index cebb7d7ec0ef..3a9472e924fc 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -5723,6 +5723,13 @@
 
 true
   
+  
+
+  Specifies if the JVM should be preloaded during LO start 
up.
+  PreloadJVM
+
+false
+  
   
 
   List of URLs of the places the user bookmarked in the file 
picker dialog.
diff --git a/stoc/source/javaloader/javaloader.cxx 
b/stoc/source/javaloader/javaloader.cxx
index 4af288f737b8..36b26c0a609d 100644
--- a/stoc/source/javaloader/javaloader.cxx
+++ b/stoc/source/javaloader/javaloader.cxx
@@ -311,11 +311,17 @@ sal_Bool SAL_CALL JavaComponentLoader::writeRegistryInfo(
 return loader->writeRegistryInfo(xKey, blabla, rLibName);
 }
 
-
 css::uno::Reference SAL_CALL JavaComponentLoader:

[Libreoffice-commits] core.git: desktop/source officecfg/registry stoc/source

2020-09-24 Thread Serge Krot (via logerrit)
 desktop/source/app/app.cxx |   48 +
 officecfg/registry/schema/org/openoffice/Office/Common.xcs |7 +
 stoc/source/javaloader/javaloader.cxx  |8 +-
 3 files changed, 62 insertions(+), 1 deletion(-)

New commits:
commit b2c1ba213143444163a0d4208f163fc1726421a7
Author: Serge Krot 
AuthorDate: Wed Mar 25 16:56:18 2020 +0100
Commit: Thorsten Behrens 
CommitDate: Thu Sep 24 15:01:32 2020 +0200

speed-up: preload JVM when PreloadJVM is set

Change-Id: I57f77f127f7cb45fb181b755b40873d47015e5b2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91059
Tested-by: Thorsten Behrens 
Reviewed-by: Thorsten Behrens 

diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 6e067efad529..dd38a74aa89e 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -74,6 +74,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -120,6 +121,7 @@
 #include 
 #include 
 #include "langselect.hxx"
+#include 
 
 #if defined MACOSX
 #include 
@@ -1173,6 +1175,36 @@ void Desktop::AppEvent( const ApplicationEvent& 
rAppEvent )
 
 namespace {
 
+class JVMloadThread : public salhelper::Thread {
+public:
+JVMloadThread() : salhelper::Thread("Preload JVM thread")
+{
+}
+
+private:
+virtual void execute() override final
+{
+Reference< XMultiServiceFactory > xSMgr = 
comphelper::getProcessServiceFactory();
+
+Reference< css::loader::XImplementationLoader > xJavaComponentLoader(
+
xSMgr->createInstance("com.sun.star.comp.stoc.JavaComponentLoader"),
+css::uno::UNO_QUERY_THROW);
+
+if (xJavaComponentLoader.is())
+{
+const css::uno::Reference< 
::com::sun::star::registry::XRegistryKey > xRegistryKey;
+try
+{
+xJavaComponentLoader->activate("", "", "", xRegistryKey);
+}
+catch (...)
+{
+SAL_WARN("desktop.app", "Cannot activate factory during JVM 
preloading");
+}
+}
+}
+};
+
 struct ExecuteGlobals
 {
 Reference < css::document::XDocumentEventListener > xGlobalBroadcaster;
@@ -1180,6 +1212,7 @@ struct ExecuteGlobals
 bool bUseSystemFileDialog;
 std::unique_ptr pLanguageOptions;
 std::unique_ptr pPathOptions;
+rtl::Reference< JVMloadThread > xJVMloadThread;
 
 ExecuteGlobals()
 : bRestartRequested( false )
@@ -1212,6 +1245,15 @@ int Desktop::Main()
 // Detect desktop environment - need to do this as early as possible
 css::uno::setCurrentContext( new DesktopContext( 
css::uno::getCurrentContext() ) );
 
+if (officecfg::Office::Common::Misc::PreloadJVM::get() && pExecGlobals)
+{
+SAL_INFO("desktop.app", "Preload JVM");
+
+// pre-load JVM
+pExecGlobals->xJVMloadThread = new JVMloadThread();
+pExecGlobals->xJVMloadThread->launch();
+}
+
 CommandLineArgs& rCmdLineArgs = GetCommandLineArgs();
 
 Translate::SetReadStringHook(ReplaceStringHookProc);
@@ -1566,6 +1608,12 @@ int Desktop::doShutdown()
 if (m_aUpdateThread.joinable())
 m_aUpdateThread.join();
 
+if (pExecGlobals->xJVMloadThread.is())
+{
+pExecGlobals->xJVMloadThread->join();
+pExecGlobals->xJVMloadThread.clear();
+}
+
 pExecGlobals->bRestartRequested = pExecGlobals->bRestartRequested ||
 OfficeRestartManager::get(comphelper::getProcessComponentContext())->
 isRestartRequested(true);
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index 048f64ab3f18..f764d3d7aa45 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -5824,6 +5824,13 @@
 
 true
   
+  
+
+  Specifies if the JVM should be preloaded during LO start 
up.
+  PreloadJVM
+
+false
+  
   
 
   List of URLs of the places the user bookmarked in the file 
picker dialog.
diff --git a/stoc/source/javaloader/javaloader.cxx 
b/stoc/source/javaloader/javaloader.cxx
index 2b40cdd219db..73b0ddf557ff 100644
--- a/stoc/source/javaloader/javaloader.cxx
+++ b/stoc/source/javaloader/javaloader.cxx
@@ -304,11 +304,17 @@ sal_Bool SAL_CALL JavaComponentLoader::writeRegistryInfo(
 return loader->writeRegistryInfo(xKey, blabla, rLibName);
 }
 
-
 css::uno::Reference SAL_CALL JavaComponentLoader::activate(
 const OUString & rImplName, const OUString & blabla, const OUString & 
rLibName,
 const css::uno::Reference & xKey)
 {
+if (rImplName.isEmpty() && blabla.isEmp

[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - sc/inc sc/qa sc/source

2020-09-10 Thread Serge Krot (via logerrit)
 sc/inc/clipparam.hxx |2 -
 sc/inc/document.hxx  |4 +-
 sc/qa/unit/data/ods/validation-copypaste.ods |binary
 sc/qa/unit/subsequent_export-test.cxx|   39 +++
 sc/source/core/tool/compiler.cxx |   19 +
 5 files changed, 61 insertions(+), 3 deletions(-)

New commits:
commit bd416f4a44acfea54afc377b9880863fd969dbe1
Author: Serge Krot 
AuthorDate: Fri Jul 10 11:09:35 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Thu Sep 10 12:10:25 2020 +0200

tdf#108673 XLSX: Don't export invalid sheet references in cell validation

Change-Id: Id9d88f5e34f3017516f693505df4c3ce82b1890f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98479
Tested-by: Jenkins
Reviewed-by: Eike Rathke 
(cherry picked from commit a3b4831208da615789bd1e2d5660dd130807f504)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102128
Reviewed-by: Thorsten Behrens 

diff --git a/sc/inc/clipparam.hxx b/sc/inc/clipparam.hxx
index ee9422bc27db..575a04526763 100644
--- a/sc/inc/clipparam.hxx
+++ b/sc/inc/clipparam.hxx
@@ -27,7 +27,7 @@
  * This struct stores general clipboard parameters associated with a
  * ScDocument instance created in clipboard mode.
  */
-struct ScClipParam
+struct SC_DLLPUBLIC ScClipParam
 {
 enum Direction { Unspecified, Column, Row };
 
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 63009443b919..8091f7e2ffb9 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -1536,7 +1536,7 @@ public:
SCTAB nTab, InsertDeleteFlags 
nDelFlag);
 void DeleteAreaTab(const ScRange& rRange, 
InsertDeleteFlags nDelFlag);
 
-void CopyToClip( const ScClipParam& rClipParam, 
ScDocument* pClipDoc,
+SC_DLLPUBLIC voidCopyToClip( const ScClipParam& rClipParam, 
ScDocument* pClipDoc,
  const ScMarkData* pMarks, bool 
bKeepScenarioFlags,
  bool bIncludeObjects );
 
@@ -1587,7 +1587,7 @@ public:
 
 /** If pDestRanges is given it overrides rDestRange, rDestRange in this
 case is the overall encompassing range. */
-voidCopyFromClip( const ScRange& rDestRange, const 
ScMarkData& rMark,
+SC_DLLPUBLIC void   CopyFromClip( const ScRange& rDestRange, const 
ScMarkData& rMark,
 InsertDeleteFlags nInsFlag,
 ScDocument* pRefUndoDoc,
 ScDocument* pClipDoc,
diff --git a/sc/qa/unit/data/ods/validation-copypaste.ods 
b/sc/qa/unit/data/ods/validation-copypaste.ods
new file mode 100644
index ..55f8d823b88b
Binary files /dev/null and b/sc/qa/unit/data/ods/validation-copypaste.ods differ
diff --git a/sc/qa/unit/subsequent_export-test.cxx 
b/sc/qa/unit/subsequent_export-test.cxx
index b7b41d40addb..61f6a46eba19 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -41,6 +41,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -233,6 +234,7 @@ public:
 void testTdf126177XLSX();
 void testCommentTextVAlignment();
 void testCommentTextHAlignment();
+void testValidationCopyPaste();
 
 void testXltxExport();
 void testRotatedImageODS();
@@ -368,6 +370,7 @@ public:
 CPPUNIT_TEST(testTdf126177XLSX);
 CPPUNIT_TEST(testCommentTextVAlignment);
 CPPUNIT_TEST(testCommentTextHAlignment);
+CPPUNIT_TEST(testValidationCopyPaste);
 
 CPPUNIT_TEST(testXltxExport);
 CPPUNIT_TEST(testRotatedImageODS);
@@ -4409,6 +4412,42 @@ void ScExportTest::testTdf91634XLSX()
 assertXPath(pXmlRels, "/r:Relationships/r:Relationship[@Id='rId1']", 
"TargetMode", "External");
 }
 
+void ScExportTest::testValidationCopyPaste()
+{
+ScDocShellRef xDocSh = loadDoc("validation-copypaste.", FORMAT_ODS);
+CPPUNIT_ASSERT(xDocSh.is());
+ScDocument& rSrcDoc = xDocSh->GetDocument();
+
+// Copy B1 from src doc to clip
+ScDocument aClipDoc(SCDOCMODE_CLIP);
+ScRange aSrcRange(1, 0, 1);
+ScClipParam aClipParam(aSrcRange, false);
+ScMarkData aMark(rSrcDoc.MaxRow(), rSrcDoc.MaxCol());
+aMark.SetMarkArea(aSrcRange);
+rSrcDoc.CopyToClip(aClipParam, , , false, false);
+
+// Create second document, paste B1 from clip
+ScDocShell* pShell2
+= new ScDocShell(SfxModelFlags::EMBEDDED_OBJECT | 
SfxModelFlags::DISABLE_EMBEDDED_SCRIPTS
+ | SfxModelFlags::DISABLE_DOCUMENT_RECOVERY);
+pShell2->DoInitNew();
+ScDocument& rDestDoc = pShell2->GetDocument();
+ScRange aDstRange(1, 0, 0);
+ScMarkData aMark2(rDestDoc.MaxRow(), rDestDoc.MaxCol());
+aMark2.SetMarkArea(aDstRange);
+rDestDoc.CopyFr

[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - sc/inc sc/qa sc/source

2020-09-09 Thread Serge Krot (via logerrit)
 sc/inc/dbdata.hxx  |4 
 sc/inc/document.hxx|4 
 sc/qa/unit/data/ods/tdf95640.ods   |binary
 sc/qa/unit/data/ods/tdf95640_standard_list.ods |binary
 sc/qa/unit/data/xlsx/tdf95640.xlsx |binary
 sc/qa/unit/subsequent_export-test.cxx  |   63 +
 sc/source/filter/excel/excrecds.cxx|   64 +
 sc/source/filter/inc/autofilterbuffer.hxx  |   30 ++
 sc/source/filter/inc/autofiltercontext.hxx |   39 
 sc/source/filter/inc/excrecds.hxx  |3 
 sc/source/filter/oox/autofilterbuffer.cxx  |  116 +++--
 sc/source/filter/oox/autofiltercontext.cxx |   68 ++
 sc/source/filter/oox/tablebuffer.cxx   |2 
 13 files changed, 375 insertions(+), 18 deletions(-)

New commits:
commit a86ddd7fc0413f65ee7851eb09b15a24e5d457ba
Author: Serge Krot 
AuthorDate: Mon Jun 29 13:23:34 2020 +0200
Commit: Samuel Mehrbrodt 
CommitDate: Wed Sep 9 17:09:04 2020 +0200

tdf#95640 XLSX: import/export of custom sort lists

Conflicts:
sc/source/filter/excel/excrecds.cxx
sc/source/filter/oox/autofilterbuffer.cxx
sc/source/filter/oox/tablebuffer.cxx

Change-Id: If5ffef39770bf7abd6e75e8de998d4a2b4749a0d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97399
Tested-by: Jenkins
Tested-by: Serge Krot 
Reviewed-by: Serge Krot 
Reviewed-by: Thorsten Behrens 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102254
Reviewed-by: Samuel Mehrbrodt 

diff --git a/sc/inc/dbdata.hxx b/sc/inc/dbdata.hxx
index a7dc35c3b61b..24eaa3be7d18 100644
--- a/sc/inc/dbdata.hxx
+++ b/sc/inc/dbdata.hxx
@@ -172,8 +172,8 @@ public:
 OUString GetSourceString() const;
 OUString GetOperations() const;
 
-voidGetSortParam(ScSortParam& rSortParam) const;
-voidSetSortParam(const ScSortParam& rSortParam);
+SC_DLLPUBLIC void GetSortParam(ScSortParam& rSortParam) const;
+SC_DLLPUBLIC void SetSortParam(const ScSortParam& rSortParam);
 
 /** Remember some more settings of ScSortParam, only to be called at
 anonymous DB ranges as it at least overwrites bHasHeader. */
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 15fdc5074357..63009443b919 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -805,8 +805,8 @@ public:
   bool bRemoveAutoFilter = 
false );
 const ScDBData*  GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB 
nTab, ScDBDataPortion ePortion) const;
 ScDBData*GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB 
nTab, ScDBDataPortion ePortion);
-const ScDBData*  GetDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW 
nRow1, SCCOL nCol2, SCROW nRow2) const;
-ScDBData*GetDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW 
nRow1, SCCOL nCol2, SCROW nRow2);
+SC_DLLPUBLIC const ScDBData* GetDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW 
nRow1, SCCOL nCol2, SCROW nRow2) const;
+SC_DLLPUBLIC ScDBData*   GetDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW 
nRow1, SCCOL nCol2, SCROW nRow2);
 void RefreshDirtyTableColumnNames();
 SC_DLLPUBLIC sc::ExternalDataMapper& GetExternalDataMapper();
 
diff --git a/sc/qa/unit/data/ods/tdf95640.ods b/sc/qa/unit/data/ods/tdf95640.ods
new file mode 100644
index ..5d435c61cc85
Binary files /dev/null and b/sc/qa/unit/data/ods/tdf95640.ods differ
diff --git a/sc/qa/unit/data/ods/tdf95640_standard_list.ods 
b/sc/qa/unit/data/ods/tdf95640_standard_list.ods
new file mode 100644
index ..37bea8a0c93e
Binary files /dev/null and b/sc/qa/unit/data/ods/tdf95640_standard_list.ods 
differ
diff --git a/sc/qa/unit/data/xlsx/tdf95640.xlsx 
b/sc/qa/unit/data/xlsx/tdf95640.xlsx
new file mode 100644
index ..78c2d32c2cf6
Binary files /dev/null and b/sc/qa/unit/data/xlsx/tdf95640.xlsx differ
diff --git a/sc/qa/unit/subsequent_export-test.cxx 
b/sc/qa/unit/subsequent_export-test.cxx
index e220803967cb..b7b41d40addb 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -195,6 +195,12 @@ public:
 void testPreserveTextWhitespace2XLSX();
 void testTextDirectionXLSX();
 
+xmlDocPtr testTdf95640(const OUString& rFileName, sal_Int32 nSourceFormat,
+   sal_Int32 nDestFormat);
+void testTdf95640_ods_to_xlsx();
+void testTdf95640_ods_to_xlsx_with_standard_list();
+void testTdf95640_xlsx_to_xlsx();
+
 void testRefStringXLSX();
 void testRefStringConfigXLSX();
 void testRefStringUnspecified();
@@ -326,6 +332,9 @@ public:
 CPPUNIT_TEST(testMoveCellAnchoredShapesODS);
 CPPUNIT_TEST(testMatrixMultiplicationXLSX);
 CPPUNIT_TEST(testTextDirectionXLSX);
+CPPUNIT_TEST(testTdf95640_ods_to_

[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sc/inc sc/qa sc/source

2020-09-09 Thread Serge Krot (via logerrit)
 sc/inc/clipparam.hxx |2 -
 sc/inc/document.hxx  |4 +-
 sc/qa/unit/data/ods/validation-copypaste.ods |binary
 sc/qa/unit/subsequent_export-test.cxx|   39 +++
 sc/source/core/tool/compiler.cxx |   21 ++
 5 files changed, 63 insertions(+), 3 deletions(-)

New commits:
commit 03f601d10c8fe8772dcb8542e1d44f2d2e87fbb4
Author: Serge Krot 
AuthorDate: Fri Jul 10 11:09:35 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Wed Sep 9 09:16:47 2020 +0200

tdf#108673 XLSX: Don't export invalid sheet references in cell validation

Change-Id: Id9d88f5e34f3017516f693505df4c3ce82b1890f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98479
Tested-by: Jenkins
Reviewed-by: Eike Rathke 
(cherry picked from commit a3b4831208da615789bd1e2d5660dd130807f504)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102127
Reviewed-by: Thorsten Behrens 

diff --git a/sc/inc/clipparam.hxx b/sc/inc/clipparam.hxx
index ee9422bc27db..575a04526763 100644
--- a/sc/inc/clipparam.hxx
+++ b/sc/inc/clipparam.hxx
@@ -27,7 +27,7 @@
  * This struct stores general clipboard parameters associated with a
  * ScDocument instance created in clipboard mode.
  */
-struct ScClipParam
+struct SC_DLLPUBLIC ScClipParam
 {
 enum Direction { Unspecified, Column, Row };
 
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 0c5ccc248faf..971377559ce9 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -1560,7 +1560,7 @@ public:
SCTAB nTab, InsertDeleteFlags 
nDelFlag);
 void DeleteAreaTab(const ScRange& rRange, 
InsertDeleteFlags nDelFlag);
 
-void CopyToClip( const ScClipParam& rClipParam, 
ScDocument* pClipDoc,
+SC_DLLPUBLIC voidCopyToClip( const ScClipParam& rClipParam, 
ScDocument* pClipDoc,
  const ScMarkData* pMarks, bool 
bKeepScenarioFlags,
  bool bIncludeObjects );
 
@@ -1611,7 +1611,7 @@ public:
 
 /** If pDestRanges is given it overrides rDestRange, rDestRange in this
 case is the overall encompassing range. */
-voidCopyFromClip( const ScRange& rDestRange, const 
ScMarkData& rMark,
+SC_DLLPUBLIC void   CopyFromClip( const ScRange& rDestRange, const 
ScMarkData& rMark,
 InsertDeleteFlags nInsFlag,
 ScDocument* pRefUndoDoc,
 ScDocument* pClipDoc,
diff --git a/sc/qa/unit/data/ods/validation-copypaste.ods 
b/sc/qa/unit/data/ods/validation-copypaste.ods
new file mode 100644
index ..55f8d823b88b
Binary files /dev/null and b/sc/qa/unit/data/ods/validation-copypaste.ods differ
diff --git a/sc/qa/unit/subsequent_export-test.cxx 
b/sc/qa/unit/subsequent_export-test.cxx
index 2f0a7c7fdd0e..9647d0964277 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -43,6 +43,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -247,6 +248,7 @@ public:
 void testTdf126177XLSX();
 void testCommentTextVAlignment();
 void testCommentTextHAlignment();
+void testValidationCopyPaste();
 
 void testXltxExport();
 void testRotatedImageODS();
@@ -398,6 +400,7 @@ public:
 CPPUNIT_TEST(testTdf126177XLSX);
 CPPUNIT_TEST(testCommentTextVAlignment);
 CPPUNIT_TEST(testCommentTextHAlignment);
+CPPUNIT_TEST(testValidationCopyPaste);
 
 CPPUNIT_TEST(testXltxExport);
 CPPUNIT_TEST(testRotatedImageODS);
@@ -4797,6 +4800,42 @@ void ScExportTest::testTdf91634XLSX()
 xDocSh->DoClose();
 }
 
+void ScExportTest::testValidationCopyPaste()
+{
+ScDocShellRef xDocSh = loadDoc("validation-copypaste.", FORMAT_ODS);
+CPPUNIT_ASSERT(xDocSh.is());
+ScDocument& rSrcDoc = xDocSh->GetDocument();
+
+// Copy B1 from src doc to clip
+ScDocument aClipDoc(SCDOCMODE_CLIP);
+ScRange aSrcRange(1, 0, 1);
+ScClipParam aClipParam(aSrcRange, false);
+ScMarkData aMark(rSrcDoc.GetSheetLimits().mnMaxRow, 
rSrcDoc.GetSheetLimits().mnMaxCol);
+aMark.SetMarkArea(aSrcRange);
+rSrcDoc.CopyToClip(aClipParam, , , false, false);
+
+// Create second document, paste B1 from clip
+ScDocShell* pShell2
+= new ScDocShell(SfxModelFlags::EMBEDDED_OBJECT | 
SfxModelFlags::DISABLE_EMBEDDED_SCRIPTS
+ | SfxModelFlags::DISABLE_DOCUMENT_RECOVERY);
+pShell2->DoInitNew();
+ScDocument& rDestDoc = pShell2->GetDocument();
+ScRange aDstRange(1, 0, 0);
+ScMarkData aMark2(rDestDoc.GetSheetLimits().mnMaxRow, 
rDestDoc.GetSheetLimits().mnMaxCol);
+aMark2.SetMarkArea(aDstRange);
+rDestDoc.CopyFromClip(aDstRange, aMark2, InsertDele

[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sc/inc sc/qa sc/source

2020-09-09 Thread Serge Krot (via logerrit)
 sc/inc/dbdata.hxx  |4 
 sc/inc/document.hxx|4 
 sc/qa/unit/data/ods/tdf95640.ods   |binary
 sc/qa/unit/data/ods/tdf95640_standard_list.ods |binary
 sc/qa/unit/data/xlsx/tdf95640.xlsx |binary
 sc/qa/unit/subsequent_export-test.cxx  |   63 +
 sc/source/filter/excel/excrecds.cxx|   64 +
 sc/source/filter/inc/autofilterbuffer.hxx  |   30 ++
 sc/source/filter/inc/autofiltercontext.hxx |   39 
 sc/source/filter/inc/excrecds.hxx  |3 
 sc/source/filter/oox/autofilterbuffer.cxx  |  116 +++--
 sc/source/filter/oox/autofiltercontext.cxx |   68 ++
 sc/source/filter/oox/tablebuffer.cxx   |2 
 13 files changed, 375 insertions(+), 18 deletions(-)

New commits:
commit e6bdfaaf572b592f7e8b510cb38f82a4aca41593
Author: Serge Krot 
AuthorDate: Mon Jun 29 13:23:34 2020 +0200
Commit: Samuel Mehrbrodt 
CommitDate: Wed Sep 9 08:49:19 2020 +0200

tdf#95640 XLSX: import/export of custom sort lists

Conflicts:
sc/source/filter/excel/excrecds.cxx
sc/source/filter/oox/autofilterbuffer.cxx
sc/source/filter/oox/tablebuffer.cxx

Change-Id: If5ffef39770bf7abd6e75e8de998d4a2b4749a0d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97399
Tested-by: Jenkins
Tested-by: Serge Krot 
Reviewed-by: Serge Krot 
Reviewed-by: Thorsten Behrens 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102252
Reviewed-by: Samuel Mehrbrodt 

diff --git a/sc/inc/dbdata.hxx b/sc/inc/dbdata.hxx
index 488063cd0a2b..0e31a0f02152 100644
--- a/sc/inc/dbdata.hxx
+++ b/sc/inc/dbdata.hxx
@@ -172,8 +172,8 @@ public:
 OUString GetSourceString() const;
 OUString GetOperations() const;
 
-voidGetSortParam(ScSortParam& rSortParam) const;
-voidSetSortParam(const ScSortParam& rSortParam);
+SC_DLLPUBLIC void GetSortParam(ScSortParam& rSortParam) const;
+SC_DLLPUBLIC void SetSortParam(const ScSortParam& rSortParam);
 
 /** Remember some more settings of ScSortParam, only to be called at
 anonymous DB ranges as it at least overwrites bHasHeader. */
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 15a7145b7abc..0c5ccc248faf 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -812,8 +812,8 @@ public:
   bool bRemoveAutoFilter = 
false );
 const ScDBData*  GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB 
nTab, ScDBDataPortion ePortion) const;
 ScDBData*GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB 
nTab, ScDBDataPortion ePortion);
-const ScDBData*  GetDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW 
nRow1, SCCOL nCol2, SCROW nRow2) const;
-ScDBData*GetDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW 
nRow1, SCCOL nCol2, SCROW nRow2);
+SC_DLLPUBLIC const ScDBData* GetDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW 
nRow1, SCCOL nCol2, SCROW nRow2) const;
+SC_DLLPUBLIC ScDBData*   GetDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW 
nRow1, SCCOL nCol2, SCROW nRow2);
 void RefreshDirtyTableColumnNames();
 SC_DLLPUBLIC sc::ExternalDataMapper& GetExternalDataMapper();
 
diff --git a/sc/qa/unit/data/ods/tdf95640.ods b/sc/qa/unit/data/ods/tdf95640.ods
new file mode 100644
index ..5d435c61cc85
Binary files /dev/null and b/sc/qa/unit/data/ods/tdf95640.ods differ
diff --git a/sc/qa/unit/data/ods/tdf95640_standard_list.ods 
b/sc/qa/unit/data/ods/tdf95640_standard_list.ods
new file mode 100644
index ..37bea8a0c93e
Binary files /dev/null and b/sc/qa/unit/data/ods/tdf95640_standard_list.ods 
differ
diff --git a/sc/qa/unit/data/xlsx/tdf95640.xlsx 
b/sc/qa/unit/data/xlsx/tdf95640.xlsx
new file mode 100644
index ..78c2d32c2cf6
Binary files /dev/null and b/sc/qa/unit/data/xlsx/tdf95640.xlsx differ
diff --git a/sc/qa/unit/subsequent_export-test.cxx 
b/sc/qa/unit/subsequent_export-test.cxx
index d74d4d63d0ec..2f0a7c7fdd0e 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -205,6 +205,12 @@ public:
 void testTdf129985();
 void testTdf73063();
 
+xmlDocUniquePtr testTdf95640(const OUString& rFileName, sal_Int32 
nSourceFormat,
+ sal_Int32 nDestFormat);
+void testTdf95640_ods_to_xlsx();
+void testTdf95640_ods_to_xlsx_with_standard_list();
+void testTdf95640_xlsx_to_xlsx();
+
 void testRefStringXLSX();
 void testRefStringConfigXLSX();
 void testRefStringUnspecified();
@@ -352,6 +358,9 @@ public:
 CPPUNIT_TEST(testTdf55417);
 CPPUNIT_TEST(testTdf129985);
 CPPUNIT_TEST(testTdf73063);
+CPPUNIT_TEST(testTdf95640_ods_to_xlsx);
+CPPUNIT_TEST(testTdf95640_ods_to_xlsx_with_standard_

[Libreoffice-commits] core.git: sc/inc sc/qa sc/source

2020-09-08 Thread Serge Krot (via logerrit)
 sc/inc/dbdata.hxx  |4 
 sc/inc/document.hxx|4 
 sc/qa/unit/data/ods/tdf95640.ods   |binary
 sc/qa/unit/data/ods/tdf95640_standard_list.ods |binary
 sc/qa/unit/data/xlsx/tdf95640.xlsx |binary
 sc/qa/unit/subsequent_export-test.cxx  |   63 +
 sc/source/filter/excel/excrecds.cxx|   64 +
 sc/source/filter/inc/autofilterbuffer.hxx  |   30 ++
 sc/source/filter/inc/autofiltercontext.hxx |   39 
 sc/source/filter/inc/excrecds.hxx  |3 
 sc/source/filter/oox/autofilterbuffer.cxx  |  116 +++--
 sc/source/filter/oox/autofiltercontext.cxx |   68 ++
 sc/source/filter/oox/tablebuffer.cxx   |2 
 13 files changed, 375 insertions(+), 18 deletions(-)

New commits:
commit a9f8f0a484965338221cad4f97d98f418b5ccff1
Author: Serge Krot 
AuthorDate: Mon Jun 29 13:23:34 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Tue Sep 8 12:51:17 2020 +0200

tdf#95640 XLSX: import/export of custom sort lists

Change-Id: If5ffef39770bf7abd6e75e8de998d4a2b4749a0d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97399
Tested-by: Jenkins
Tested-by: Serge Krot 
Reviewed-by: Serge Krot 
Reviewed-by: Thorsten Behrens 

diff --git a/sc/inc/dbdata.hxx b/sc/inc/dbdata.hxx
index 488063cd0a2b..0e31a0f02152 100644
--- a/sc/inc/dbdata.hxx
+++ b/sc/inc/dbdata.hxx
@@ -172,8 +172,8 @@ public:
 OUString GetSourceString() const;
 OUString GetOperations() const;
 
-voidGetSortParam(ScSortParam& rSortParam) const;
-voidSetSortParam(const ScSortParam& rSortParam);
+SC_DLLPUBLIC void GetSortParam(ScSortParam& rSortParam) const;
+SC_DLLPUBLIC void SetSortParam(const ScSortParam& rSortParam);
 
 /** Remember some more settings of ScSortParam, only to be called at
 anonymous DB ranges as it at least overwrites bHasHeader. */
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 6917d6c47a74..370effa1b01b 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -818,8 +818,8 @@ public:
   bool bRemoveAutoFilter = 
false );
 const ScDBData*  GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB 
nTab, ScDBDataPortion ePortion) const;
 ScDBData*GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB 
nTab, ScDBDataPortion ePortion);
-const ScDBData*  GetDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW 
nRow1, SCCOL nCol2, SCROW nRow2) const;
-ScDBData*GetDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW 
nRow1, SCCOL nCol2, SCROW nRow2);
+SC_DLLPUBLIC const ScDBData* GetDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW 
nRow1, SCCOL nCol2, SCROW nRow2) const;
+SC_DLLPUBLIC ScDBData*   GetDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW 
nRow1, SCCOL nCol2, SCROW nRow2);
 void RefreshDirtyTableColumnNames();
 SC_DLLPUBLIC sc::ExternalDataMapper& GetExternalDataMapper();
 
diff --git a/sc/qa/unit/data/ods/tdf95640.ods b/sc/qa/unit/data/ods/tdf95640.ods
new file mode 100644
index ..5d435c61cc85
Binary files /dev/null and b/sc/qa/unit/data/ods/tdf95640.ods differ
diff --git a/sc/qa/unit/data/ods/tdf95640_standard_list.ods 
b/sc/qa/unit/data/ods/tdf95640_standard_list.ods
new file mode 100644
index ..37bea8a0c93e
Binary files /dev/null and b/sc/qa/unit/data/ods/tdf95640_standard_list.ods 
differ
diff --git a/sc/qa/unit/data/xlsx/tdf95640.xlsx 
b/sc/qa/unit/data/xlsx/tdf95640.xlsx
new file mode 100644
index ..78c2d32c2cf6
Binary files /dev/null and b/sc/qa/unit/data/xlsx/tdf95640.xlsx differ
diff --git a/sc/qa/unit/subsequent_export-test.cxx 
b/sc/qa/unit/subsequent_export-test.cxx
index 8c7654c881eb..451d45d99c84 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -206,6 +206,12 @@ public:
 void testTdf129985();
 void testTdf73063();
 
+xmlDocUniquePtr testTdf95640(const OUString& rFileName, sal_Int32 
nSourceFormat,
+ sal_Int32 nDestFormat);
+void testTdf95640_ods_to_xlsx();
+void testTdf95640_ods_to_xlsx_with_standard_list();
+void testTdf95640_xlsx_to_xlsx();
+
 void testRefStringXLSX();
 void testRefStringConfigXLSX();
 void testRefStringUnspecified();
@@ -364,6 +370,9 @@ public:
 CPPUNIT_TEST(testTdf55417);
 CPPUNIT_TEST(testTdf129985);
 CPPUNIT_TEST(testTdf73063);
+CPPUNIT_TEST(testTdf95640_ods_to_xlsx);
+CPPUNIT_TEST(testTdf95640_ods_to_xlsx_with_standard_list);
+CPPUNIT_TEST(testTdf95640_xlsx_to_xlsx);
 
 CPPUNIT_TEST(testRefStringXLSX);
 CPPUNIT_TEST(testRefStringConfigXLSX);
@@ -4292,6 +4301,60 @@ void ScExportTest::testTdf73063()
 xDocSh->DoClose();
 }
 
+xmlDocUniquePtr ScExportTest::testTdf95640(const OUString& rFil

[Libreoffice-commits] core.git: sc/inc sc/qa sc/source

2020-09-07 Thread Serge Krot (via logerrit)
 sc/inc/clipparam.hxx |2 -
 sc/inc/document.hxx  |4 +-
 sc/qa/unit/data/ods/validation-copypaste.ods |binary
 sc/qa/unit/subsequent_export-test.cxx|   39 +++
 sc/source/core/tool/compiler.cxx |   21 ++
 5 files changed, 63 insertions(+), 3 deletions(-)

New commits:
commit a3b4831208da615789bd1e2d5660dd130807f504
Author: Serge Krot 
AuthorDate: Fri Jul 10 11:09:35 2020 +0200
Commit: Eike Rathke 
CommitDate: Tue Sep 8 01:19:58 2020 +0200

tdf#108673 XLSX: Don't export invalid sheet references in cell validation

Change-Id: Id9d88f5e34f3017516f693505df4c3ce82b1890f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98479
Tested-by: Jenkins
Reviewed-by: Eike Rathke 

diff --git a/sc/inc/clipparam.hxx b/sc/inc/clipparam.hxx
index ee9422bc27db..575a04526763 100644
--- a/sc/inc/clipparam.hxx
+++ b/sc/inc/clipparam.hxx
@@ -27,7 +27,7 @@
  * This struct stores general clipboard parameters associated with a
  * ScDocument instance created in clipboard mode.
  */
-struct ScClipParam
+struct SC_DLLPUBLIC ScClipParam
 {
 enum Direction { Unspecified, Column, Row };
 
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 69e0b06a6cab..6917d6c47a74 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -1566,7 +1566,7 @@ public:
SCTAB nTab, InsertDeleteFlags 
nDelFlag);
 void DeleteAreaTab(const ScRange& rRange, 
InsertDeleteFlags nDelFlag);
 
-void CopyToClip( const ScClipParam& rClipParam, 
ScDocument* pClipDoc,
+SC_DLLPUBLIC voidCopyToClip( const ScClipParam& rClipParam, 
ScDocument* pClipDoc,
  const ScMarkData* pMarks, bool 
bKeepScenarioFlags,
  bool bIncludeObjects );
 
@@ -1617,7 +1617,7 @@ public:
 
 /** If pDestRanges is given it overrides rDestRange, rDestRange in this
 case is the overall encompassing range. */
-voidCopyFromClip( const ScRange& rDestRange, const 
ScMarkData& rMark,
+SC_DLLPUBLIC void   CopyFromClip( const ScRange& rDestRange, const 
ScMarkData& rMark,
 InsertDeleteFlags nInsFlag,
 ScDocument* pRefUndoDoc,
 ScDocument* pClipDoc,
diff --git a/sc/qa/unit/data/ods/validation-copypaste.ods 
b/sc/qa/unit/data/ods/validation-copypaste.ods
new file mode 100644
index ..55f8d823b88b
Binary files /dev/null and b/sc/qa/unit/data/ods/validation-copypaste.ods differ
diff --git a/sc/qa/unit/subsequent_export-test.cxx 
b/sc/qa/unit/subsequent_export-test.cxx
index efe44fc22f2b..8c7654c881eb 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -43,6 +43,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -244,6 +245,7 @@ public:
 void testTdf126177XLSX();
 void testCommentTextVAlignment();
 void testCommentTextHAlignment();
+void testValidationCopyPaste();
 
 void testXltxExport();
 void testRotatedImageODS();
@@ -402,6 +404,7 @@ public:
 CPPUNIT_TEST(testTdf126177XLSX);
 CPPUNIT_TEST(testCommentTextVAlignment);
 CPPUNIT_TEST(testCommentTextHAlignment);
+CPPUNIT_TEST(testValidationCopyPaste);
 
 CPPUNIT_TEST(testXltxExport);
 CPPUNIT_TEST(testRotatedImageODS);
@@ -4809,6 +4812,42 @@ void ScExportTest::testTdf91634XLSX()
 xDocSh->DoClose();
 }
 
+void ScExportTest::testValidationCopyPaste()
+{
+ScDocShellRef xDocSh = loadDoc("validation-copypaste.", FORMAT_ODS);
+CPPUNIT_ASSERT(xDocSh.is());
+ScDocument& rSrcDoc = xDocSh->GetDocument();
+
+// Copy B1 from src doc to clip
+ScDocument aClipDoc(SCDOCMODE_CLIP);
+ScRange aSrcRange(1, 0, 1);
+ScClipParam aClipParam(aSrcRange, false);
+ScMarkData aMark(rSrcDoc.GetSheetLimits());
+aMark.SetMarkArea(aSrcRange);
+rSrcDoc.CopyToClip(aClipParam, , , false, false);
+
+// Create second document, paste B1 from clip
+ScDocShell* pShell2
+= new ScDocShell(SfxModelFlags::EMBEDDED_OBJECT | 
SfxModelFlags::DISABLE_EMBEDDED_SCRIPTS
+ | SfxModelFlags::DISABLE_DOCUMENT_RECOVERY);
+pShell2->DoInitNew();
+ScDocument& rDestDoc = pShell2->GetDocument();
+ScRange aDstRange(1, 0, 0);
+ScMarkData aMark2(rDestDoc.GetSheetLimits());
+aMark2.SetMarkArea(aDstRange);
+rDestDoc.CopyFromClip(aDstRange, aMark2, InsertDeleteFlags::ALL, nullptr, 
);
+
+// save as XLSX
+std::shared_ptr pXPathFile
+= ScBootstrapFixture::exportTo(&(*pShell2), FORMAT_XLSX);
+
+// check validation
+xmlDocUniquePtr pDoc
+= XPathHelper::parseExport(pXPathFile, m_xSF

[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/qa writerfilter/source

2020-08-10 Thread Serge Krot (via logerrit)
 sw/qa/extras/ooxmlexport/ooxmlexport13.cxx |2 +-
 sw/qa/extras/ooxmlexport/ooxmlexport4.cxx  |5 +++--
 sw/qa/extras/ooxmlexport/ooxmlexport8.cxx  |3 ++-
 writerfilter/source/dmapper/SdtHelper.cxx  |9 +
 4 files changed, 15 insertions(+), 4 deletions(-)

New commits:
commit 73b2bacf2f3f531896fc20aeecb51d433ecd5a9c
Author: Serge Krot 
AuthorDate: Mon Jul 20 15:15:47 2020 +0200
Commit: Xisco Fauli 
CommitDate: Mon Aug 10 10:39:39 2020 +0200

tdf#134572 DOCX: Incorrect default value in dropdown text fields

Change-Id: I3169e817c2f033d1525adc3b02ac3680ad220d70
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99074
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
(cherry picked from commit 89b6b2dbb728abea2186ff1ae158c0adb67d05be)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100216
Reviewed-by: Xisco Fauli 

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
index 430749768862..1b9621b473b0 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
@@ -1052,7 +1052,7 @@ DECLARE_OOXMLEXPORT_TEST(tdf119809, "tdf119809.docx")
 
CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.text.textfield.DropDown"));
 
 uno::Sequence aItems = getProperty< uno::Sequence 
>(aField, "Items");
-CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aItems.getLength());
+CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aItems.getLength());
 }
 }
 
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
index 22d069a90864..c6cb3c351843 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
@@ -741,9 +741,10 @@ void Test::verifyComboBoxExport(bool aComboBoxAsDropDown)
 
CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.text.textfield.DropDown"));
 
 uno::Sequence aItems = getProperty< uno::Sequence 
>(aField, "Items");
-CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aItems.getLength());
+CPPUNIT_ASSERT_EQUAL(sal_Int32(3), aItems.getLength());
 CPPUNIT_ASSERT_EQUAL(OUString("manolo"), aItems[0]);
 CPPUNIT_ASSERT_EQUAL(OUString("pepito"), aItems[1]);
+CPPUNIT_ASSERT_EQUAL(OUString("Manolo"), aItems[2]);
 }
 else
 {
@@ -767,7 +768,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testComboBoxControl, 
"combobox-control.docx"
 xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
 assertXPath(pXmlDoc, 
"/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dropDownList/w:listItem[1]", "value", 
"manolo");
 assertXPath(pXmlDoc, 
"/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dropDownList/w:listItem[2]", "value", 
"pepito");
-assertXPathContent(pXmlDoc, 
"/w:document/w:body/w:p/w:sdt/w:sdtContent/w:r/w:t", "manolo");
+assertXPathContent(pXmlDoc, 
"/w:document/w:body/w:p/w:sdt/w:sdtContent/w:r/w:t", "Manolo");
 
 // check imported control
 verifyComboBoxExport(getShapes() == 0);
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
index 5f401b266bfc..5b09147a0ad2 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
@@ -948,9 +948,10 @@ DECLARE_OOXMLEXPORT_TEST(testN779630, "n779630.docx")
 
CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.text.textfield.DropDown"));
 
 uno::Sequence aItems = getProperty< uno::Sequence 
>(aField, "Items");
-CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aItems.getLength());
+CPPUNIT_ASSERT_EQUAL(sal_Int32(3), aItems.getLength());
 CPPUNIT_ASSERT_EQUAL(OUString("Yes"), aItems[0]);
 CPPUNIT_ASSERT_EQUAL(OUString("No"), aItems[1]);
+CPPUNIT_ASSERT_EQUAL(OUString("dropdown default text"), aItems[2]);
 }
 }
 
diff --git a/writerfilter/source/dmapper/SdtHelper.cxx 
b/writerfilter/source/dmapper/SdtHelper.cxx
index 4e437ae0e562..60153d4c6126 100644
--- a/writerfilter/source/dmapper/SdtHelper.cxx
+++ b/writerfilter/source/dmapper/SdtHelper.cxx
@@ -90,6 +90,15 @@ void SdtHelper::createDropDownControl()
 
m_rDM_Impl.GetTextFactory()->createInstance("com.sun.star.text.TextField.DropDown"),
 uno::UNO_QUERY);
 
+const auto it = std::find_if(
+m_aDropDownItems.begin(), m_aDropDownItems.end(),
+[aDefaultText](const OUString& item) -> bool { return 
!item.compareTo(aDefaultText); });
+
+if (m_aDropDownItems.end() == it)
+{
+m_aDropDownItems.push_back(aDefaultText);
+}
+
 // set properties
 uno::Reference xPropertySet(xControlModel, 
uno::UNO_QUERY);
 xPropertySet->setPropertyValue("SelectedItem", 
uno::makeAny(aDefaultText));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sw/qa writerfilter/source

2020-08-05 Thread Serge Krot (via logerrit)
 sw/qa/extras/ooxmlexport/ooxmlexport13.cxx |2 +-
 sw/qa/extras/ooxmlexport/ooxmlexport4.cxx  |5 +++--
 sw/qa/extras/ooxmlexport/ooxmlexport8.cxx  |3 ++-
 writerfilter/source/dmapper/SdtHelper.cxx  |9 +
 4 files changed, 15 insertions(+), 4 deletions(-)

New commits:
commit 89b6b2dbb728abea2186ff1ae158c0adb67d05be
Author: Serge Krot 
AuthorDate: Mon Jul 20 15:15:47 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Wed Aug 5 23:21:15 2020 +0200

tdf#134572 DOCX: Incorrect default value in dropdown text fields

Change-Id: I3169e817c2f033d1525adc3b02ac3680ad220d70
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99074
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
index b0cce67a1b9c..ac2ca0c7d1f3 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
@@ -1058,7 +1058,7 @@ DECLARE_OOXMLEXPORT_TEST(tdf119809, "tdf119809.docx")
 
CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.text.textfield.DropDown"));
 
 uno::Sequence aItems = getProperty< uno::Sequence 
>(aField, "Items");
-CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aItems.getLength());
+CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aItems.getLength());
 }
 }
 
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
index 953a2434ba3f..80c9821cf0f6 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
@@ -744,9 +744,10 @@ void Test::verifyComboBoxExport(bool aComboBoxAsDropDown)
 
CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.text.textfield.DropDown"));
 
 uno::Sequence aItems = getProperty< uno::Sequence 
>(aField, "Items");
-CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aItems.getLength());
+CPPUNIT_ASSERT_EQUAL(sal_Int32(3), aItems.getLength());
 CPPUNIT_ASSERT_EQUAL(OUString("manolo"), aItems[0]);
 CPPUNIT_ASSERT_EQUAL(OUString("pepito"), aItems[1]);
+CPPUNIT_ASSERT_EQUAL(OUString("Manolo"), aItems[2]);
 }
 else
 {
@@ -770,7 +771,7 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testComboBoxControl, 
"combobox-control.docx"
 xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
 assertXPath(pXmlDoc, 
"/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dropDownList/w:listItem[1]", "value", 
"manolo");
 assertXPath(pXmlDoc, 
"/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dropDownList/w:listItem[2]", "value", 
"pepito");
-assertXPathContent(pXmlDoc, 
"/w:document/w:body/w:p/w:sdt/w:sdtContent/w:r/w:t", "manolo");
+assertXPathContent(pXmlDoc, 
"/w:document/w:body/w:p/w:sdt/w:sdtContent/w:r/w:t", "Manolo");
 
 // check imported control
 verifyComboBoxExport(getShapes() == 0);
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
index c592eb7dec07..a5e11ec83484 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
@@ -958,9 +958,10 @@ DECLARE_OOXMLEXPORT_TEST(testN779630, "n779630.docx")
 
CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.text.textfield.DropDown"));
 
 uno::Sequence aItems = getProperty< uno::Sequence 
>(aField, "Items");
-CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aItems.getLength());
+CPPUNIT_ASSERT_EQUAL(sal_Int32(3), aItems.getLength());
 CPPUNIT_ASSERT_EQUAL(OUString("Yes"), aItems[0]);
 CPPUNIT_ASSERT_EQUAL(OUString("No"), aItems[1]);
+CPPUNIT_ASSERT_EQUAL(OUString("dropdown default text"), aItems[2]);
 }
 }
 
diff --git a/writerfilter/source/dmapper/SdtHelper.cxx 
b/writerfilter/source/dmapper/SdtHelper.cxx
index dff106acee13..dd3b7c755ac6 100644
--- a/writerfilter/source/dmapper/SdtHelper.cxx
+++ b/writerfilter/source/dmapper/SdtHelper.cxx
@@ -90,6 +90,15 @@ void SdtHelper::createDropDownControl()
 
m_rDM_Impl.GetTextFactory()->createInstance("com.sun.star.text.TextField.DropDown"),
 uno::UNO_QUERY);
 
+const auto it = std::find_if(
+m_aDropDownItems.begin(), m_aDropDownItems.end(),
+[aDefaultText](const OUString& item) -> bool { return 
!item.compareTo(aDefaultText); });
+
+if (m_aDropDownItems.end() == it)
+{
+m_aDropDownItems.push_back(aDefaultText);
+}
+
 // set properties
 uno::Reference xPropertySet(xControlModel, 
uno::UNO_QUERY);
 xPropertySet->setPropertyValue("SelectedItem", 
uno::makeAny(aDefaultText));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-0-0' - 2 commits - sc/source vcl/skia

2020-07-29 Thread Serge Krot (via logerrit)
 sc/source/filter/xcl97/xcl97rec.cxx |2 +-
 vcl/skia/gdiimpl.cxx|2 +-
 vcl/skia/win/gdiimpl.cxx|1 +
 vcl/skia/x11/gdiimpl.cxx|1 +
 4 files changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 44b593c4f8ac277db63f2a6f43ba83febea48a14
Author: Serge Krot 
AuthorDate: Tue Jul 21 16:05:15 2020 +0200
Commit: Christian Lohmaier 
CommitDate: Wed Jul 29 20:18:31 2020 +0200

tdf#134769 XLSX export fix: unable to open with MS Excel

Change-Id: I8fff01118e25768ca54c816fcb0eb522da6f38bb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99149
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
(cherry picked from commit 641dbafcb4c7b00bc9e56b58d12c95a6f05ee88d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99394
(cherry picked from commit 6bb924a5d2b48336bbae47244210bbc78763b2ed)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99404
Reviewed-by: Xisco Fauli 
Reviewed-by: Serge Krot 
Reviewed-by: Eike Rathke 
Reviewed-by: Christian Lohmaier 
Tested-by: Christian Lohmaier 

diff --git a/sc/source/filter/xcl97/xcl97rec.cxx 
b/sc/source/filter/xcl97/xcl97rec.cxx
index 503d78ad75f2..3227937b3c03 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -365,8 +365,8 @@ void XclExpObjList::SaveXml( XclExpXmlStream& rStrm )
 return;
 
 SaveDrawingMLObjects( *this, rStrm );
-SaveFormControlObjects( *this, rStrm );
 SaveVmlObjects( *this, rStrm, mnVmlCount );
+SaveFormControlObjects( *this, rStrm );
 }
 
 void XclExpObjList::ResetCounters()
commit cc5f97ad017b71f909135f5970286ac731449967
Author: Luboš Luňák 
AuthorDate: Wed Jul 15 12:16:47 2020 +0200
Commit: Christian Lohmaier 
CommitDate: Wed Jul 29 20:18:15 2020 +0200

flush all Skia drawing before drawing to the screen

Otherwise xor drawing might not get applied.

Change-Id: Ic1f9496c76c8f1162951e2ac4acbcd131c714a3b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98885
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 
(cherry picked from commit b0ba9e835060f8f5daf3943a03039ed443705eba)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98846
Reviewed-by: Michael Stahl 
Reviewed-by: Adolfo Jayme Barrientos 
Reviewed-by: Christian Lohmaier 
Tested-by: Christian Lohmaier 

diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx
index 11b59d30d8ed..cddb8f78290f 100644
--- a/vcl/skia/gdiimpl.cxx
+++ b/vcl/skia/gdiimpl.cxx
@@ -1082,7 +1082,7 @@ Color SkiaSalGraphicsImpl::getPixel(long nX, long nY)
 SkiaZone zone;
 checkSurface();
 SAL_INFO("vcl.skia.trace", "getpixel(" << this << "): " << Point(nX, nY));
-mSurface->getCanvas()->flush();
+flushDrawing();
 // This is presumably slow, but getPixel() should be generally used only 
by unit tests.
 SkBitmap bitmap;
 if (!bitmap.tryAllocN32Pixels(GetWidth(), GetHeight()))
diff --git a/vcl/skia/win/gdiimpl.cxx b/vcl/skia/win/gdiimpl.cxx
index 43ced4e9639f..c42bd79fa22a 100644
--- a/vcl/skia/win/gdiimpl.cxx
+++ b/vcl/skia/win/gdiimpl.cxx
@@ -66,6 +66,7 @@ void WinSkiaSalGraphicsImpl::freeResources() {}
 void WinSkiaSalGraphicsImpl::performFlush()
 {
 SkiaZone zone;
+flushDrawing();
 if (mWindowContext)
 mWindowContext->swapBuffers();
 }
diff --git a/vcl/skia/x11/gdiimpl.cxx b/vcl/skia/x11/gdiimpl.cxx
index 4754bfc64f95..93025c0ef7d1 100644
--- a/vcl/skia/x11/gdiimpl.cxx
+++ b/vcl/skia/x11/gdiimpl.cxx
@@ -128,6 +128,7 @@ void X11SkiaSalGraphicsImpl::freeResources() {}
 void X11SkiaSalGraphicsImpl::performFlush()
 {
 SkiaZone zone;
+flushDrawing();
 // TODO XPutImage() is somewhat inefficient, XShmPutImage() should be 
preferred.
 mWindowContext->swapBuffers();
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-4-6' - sc/source

2020-07-29 Thread Serge Krot (via logerrit)
 sc/source/filter/xcl97/xcl97rec.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6a227cbd36bfc7847ab1d940c90d46552b959fb6
Author: Serge Krot 
AuthorDate: Tue Jul 21 16:05:15 2020 +0200
Commit: Serge Krot 
CommitDate: Wed Jul 29 10:15:47 2020 +0200

tdf#134769 XLSX export fix: unable to open with MS Excel

Change-Id: I8fff01118e25768ca54c816fcb0eb522da6f38bb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99149
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
(cherry picked from commit 641dbafcb4c7b00bc9e56b58d12c95a6f05ee88d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99395
Reviewed-by: Xisco Fauli 
(cherry picked from commit 05b1e42a168b9675cff45b6be3ca8c28f01a629a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99491
Reviewed-by: Serge Krot 
Tested-by: Serge Krot 

diff --git a/sc/source/filter/xcl97/xcl97rec.cxx 
b/sc/source/filter/xcl97/xcl97rec.cxx
index 37c55e9d629c..4a4656f57a94 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -364,8 +364,8 @@ void XclExpObjList::SaveXml( XclExpXmlStream& rStrm )
 return;
 
 SaveDrawingMLObjects( *this, rStrm );
-SaveFormControlObjects( *this, rStrm );
 SaveVmlObjects( *this, rStrm, mnVmlCount );
+SaveFormControlObjects( *this, rStrm );
 }
 
 void XclExpObjList::ResetCounters()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - sc/source

2020-07-27 Thread Serge Krot (via logerrit)
 sc/source/filter/xcl97/xcl97rec.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 05b1e42a168b9675cff45b6be3ca8c28f01a629a
Author: Serge Krot 
AuthorDate: Tue Jul 21 16:05:15 2020 +0200
Commit: Xisco Fauli 
CommitDate: Mon Jul 27 11:21:31 2020 +0200

tdf#134769 XLSX export fix: unable to open with MS Excel

Change-Id: I8fff01118e25768ca54c816fcb0eb522da6f38bb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99149
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
(cherry picked from commit 641dbafcb4c7b00bc9e56b58d12c95a6f05ee88d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99395
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/filter/xcl97/xcl97rec.cxx 
b/sc/source/filter/xcl97/xcl97rec.cxx
index 37c55e9d629c..4a4656f57a94 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -364,8 +364,8 @@ void XclExpObjList::SaveXml( XclExpXmlStream& rStrm )
 return;
 
 SaveDrawingMLObjects( *this, rStrm );
-SaveFormControlObjects( *this, rStrm );
 SaveVmlObjects( *this, rStrm, mnVmlCount );
+SaveFormControlObjects( *this, rStrm );
 }
 
 void XclExpObjList::ResetCounters()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sc/source

2020-07-27 Thread Serge Krot (via logerrit)
 sc/source/filter/xcl97/xcl97rec.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6bb924a5d2b48336bbae47244210bbc78763b2ed
Author: Serge Krot 
AuthorDate: Tue Jul 21 16:05:15 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Mon Jul 27 09:57:46 2020 +0200

tdf#134769 XLSX export fix: unable to open with MS Excel

Change-Id: I8fff01118e25768ca54c816fcb0eb522da6f38bb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99149
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
(cherry picked from commit 641dbafcb4c7b00bc9e56b58d12c95a6f05ee88d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99394

diff --git a/sc/source/filter/xcl97/xcl97rec.cxx 
b/sc/source/filter/xcl97/xcl97rec.cxx
index 503d78ad75f2..3227937b3c03 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -365,8 +365,8 @@ void XclExpObjList::SaveXml( XclExpXmlStream& rStrm )
 return;
 
 SaveDrawingMLObjects( *this, rStrm );
-SaveFormControlObjects( *this, rStrm );
 SaveVmlObjects( *this, rStrm, mnVmlCount );
+SaveFormControlObjects( *this, rStrm );
 }
 
 void XclExpObjList::ResetCounters()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sc/source

2020-07-24 Thread Serge Krot (via logerrit)
 sc/source/filter/xcl97/xcl97rec.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 641dbafcb4c7b00bc9e56b58d12c95a6f05ee88d
Author: Serge Krot 
AuthorDate: Tue Jul 21 16:05:15 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Sat Jul 25 00:46:25 2020 +0200

tdf#134769 XLSX export fix: unable to open with MS Excel

Change-Id: I8fff01118e25768ca54c816fcb0eb522da6f38bb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99149
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/sc/source/filter/xcl97/xcl97rec.cxx 
b/sc/source/filter/xcl97/xcl97rec.cxx
index b58c3d6b..c4037caa6848 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -365,8 +365,8 @@ void XclExpObjList::SaveXml( XclExpXmlStream& rStrm )
 return;
 
 SaveDrawingMLObjects( *this, rStrm );
-SaveFormControlObjects( *this, rStrm );
 SaveVmlObjects( *this, rStrm, mnVmlCount );
+SaveFormControlObjects( *this, rStrm );
 }
 
 void XclExpObjList::ResetCounters()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/nisz/libreoffice-6-4' - officecfg/registry sc/qa sc/source

2020-07-13 Thread Serge Krot (via logerrit)
 officecfg/registry/schema/org/openoffice/Office/Calc.xcs |   17 +
 sc/qa/unit/data/ods/tdf79998.ods |binary
 sc/qa/unit/filters-test.cxx  |   20 ++
 sc/source/filter/excel/xestream.cxx  |  129 +++
 sc/source/filter/inc/xestream.hxx|5 
 5 files changed, 171 insertions(+)

New commits:
commit 4a30d3ee174159bf11a3d3b5b13504cd261efb13
Author: Serge Krot 
AuthorDate: Thu Apr 16 15:42:33 2020 +0200
Commit: Gabor Kelemen 
CommitDate: Mon Jul 13 23:34:21 2020 +0200

tdf#79998 FILESAVE: XLSX export with long sheet names (length > 31 
characters)

Change-Id: If18e3b751486144f3477b6e0c2615751f57e5565
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92372
Tested-by: Jenkins
Reviewed-by: Eike Rathke 
(cherry picked from commit 6b75874386b7b1ec44f7acc49cd3556a56108ed8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93539
Reviewed-by: Thorsten Behrens 
(cherry picked from commit e9124ef7cadd36329d8a5bc1cc8c3a4706e26582)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98643
Tested-by: Gabor Kelemen 
Reviewed-by: Gabor Kelemen 

diff --git a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
index 1517514c903d..c02a76d45315 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
@@ -1830,6 +1830,23 @@
   
 
   
+  
+
+  Contains settings for export filters.
+
+
+  
+Contains settings for MS Excel export.
+  
+  
+
+  Indicates whether sheet names should be truncated to 31 
characters.
+  Truncate long sheet names
+
+true
+  
+
+  
 
 
   
diff --git a/sc/qa/unit/data/ods/tdf79998.ods b/sc/qa/unit/data/ods/tdf79998.ods
new file mode 100644
index ..201cca140585
Binary files /dev/null and b/sc/qa/unit/data/ods/tdf79998.ods differ
diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx
index dc097180cbbd..43c3483bb281 100644
--- a/sc/qa/unit/filters-test.cxx
+++ b/sc/qa/unit/filters-test.cxx
@@ -70,6 +70,7 @@ public:
 void testSharedFormulaXLSX();
 void testSharedFormulaRefUpdateXLSX();
 void testSheetNamesXLSX();
+void testTdf79998();
 void testLegacyCellAnchoredRotatedShape();
 void testEnhancedProtectionXLS();
 void testEnhancedProtectionXLSX();
@@ -96,6 +97,7 @@ public:
 CPPUNIT_TEST(testSharedFormulaXLSX);
 CPPUNIT_TEST(testSharedFormulaRefUpdateXLSX);
 CPPUNIT_TEST(testSheetNamesXLSX);
+CPPUNIT_TEST(testTdf79998);
 CPPUNIT_TEST(testLegacyCellAnchoredRotatedShape);
 CPPUNIT_TEST(testEnhancedProtectionXLS);
 CPPUNIT_TEST(testEnhancedProtectionXLSX);
@@ -468,6 +470,24 @@ void ScFiltersTest::testSheetNamesXLSX()
 xDocSh->DoClose();
 }
 
+// FILESAVE: XLSX export with long sheet names (length > 31 characters)
+void ScFiltersTest::testTdf79998()
+{
+// check: original document has tab name > 31 characters
+ScDocShellRef xDocSh = loadDoc("tdf79998.", FORMAT_ODS);
+ScDocument& rDoc1 = xDocSh->GetDocument();
+const std::vector aTabNames1 = rDoc1.GetAllTableNames();
+CPPUNIT_ASSERT_EQUAL(OUString("Utilities (FX Kurse, Kreditkarten etc)"), 
aTabNames1[1]);
+
+// check: saved XLSX document has truncated tab name
+xDocSh = saveAndReload( &(*xDocSh), FORMAT_XLSX);
+ScDocument& rDoc2 = xDocSh->GetDocument();
+const std::vector aTabNames2 = rDoc2.GetAllTableNames();
+CPPUNIT_ASSERT_EQUAL(OUString("Utilities (FX Kurse, Kreditkart"), 
aTabNames2[1]);
+
+xDocSh->DoClose();
+}
+
 static void impl_testLegacyCellAnchoredRotatedShape( ScDocument& rDoc, const 
tools::Rectangle& aRect, const ScDrawObjData& aAnchor, long TOLERANCE = 30 /* 
30 hmm */ )
 {
 ScDrawLayer* pDrawLayer = rDoc.GetDrawLayer();
diff --git a/sc/source/filter/excel/xestream.cxx 
b/sc/source/filter/excel/xestream.cxx
index 6b1e29a79a66..968a057f9f58 100644
--- a/sc/source/filter/excel/xestream.cxx
+++ b/sc/source/filter/excel/xestream.cxx
@@ -32,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -49,6 +50,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -1002,6 +1004,13 @@ bool XclExpXmlStream::exportDocument()
 ScDocument& rDoc = pShell->GetDocument();
 ScRefreshTimerProtector aProt(rDoc.GetRefreshTimerControlAddress());
 
+const bool bValidateTabNames = 
officecfg::Office::Calc::Filter::Export::MS_Excel::TruncateLongSheetNames::get();
+std::vector aOriginalTabNames;
+if (bValidateTabNames)
+{
+validateTabNames(aOriginalTabNames);
+}
+
 uno::Reference xSta

[Libreoffice-commits] core.git: sw/CppunitTest_sw_ooxmlexport4.mk sw/qa

2020-06-30 Thread Serge Krot (via logerrit)
 sw/CppunitTest_sw_ooxmlexport4.mk |4 +
 sw/qa/extras/ooxmlexport/ooxmlexport4.cxx |   75 +-
 2 files changed, 57 insertions(+), 22 deletions(-)

New commits:
commit 7b00fbddfb1cd55a68ed7481ebd4a5d5f60c6128
Author: Serge Krot 
AuthorDate: Tue Jun 30 16:31:08 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Tue Jun 30 23:54:20 2020 +0200

tdf#134043 DOCX import: new unit tests: ComboBox to DropDown

Change-Id: I513933b508ca531e17271a3cc821a6aef2244868
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97531
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/sw/CppunitTest_sw_ooxmlexport4.mk 
b/sw/CppunitTest_sw_ooxmlexport4.mk
index e3285932e004..0f026bc8384e 100644
--- a/sw/CppunitTest_sw_ooxmlexport4.mk
+++ b/sw/CppunitTest_sw_ooxmlexport4.mk
@@ -11,4 +11,8 @@
 
 $(eval $(call sw_ooxmlexport_test,4))
 
+$(eval $(call gb_CppunitTest_use_custom_headers,sw_ooxmlexport4,\
+officecfg/registry \
+))
+
 # vim: set noet sw=4 ts=4:
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
index cc5f2d3364b1..db5add6d8014 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
@@ -23,6 +23,9 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+
 
 class Test : public SwModelTestBase
 {
@@ -43,6 +46,8 @@ protected:
 // If the testcase is stored in some other format, it's pointless to 
test.
 return (OString(filename).endsWith(".docx") && 
std::find(vBlacklist.begin(), vBlacklist.end(), filename) == vBlacklist.end());
 }
+
+void verifyComboBoxExport(bool aComboBoxAsDropDown);
 };
 
 DECLARE_OOXMLEXPORT_TEST(testRelorientation, "relorientation.docx")
@@ -708,27 +713,9 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testFDO76312, 
"FDO76312.docx")
 assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr[1]/w:tc[1]");
 }
 
-DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testComboBoxControl, 
"combobox-control.docx")
+void Test::verifyComboBoxExport(bool aComboBoxAsDropDown)
 {
-// check XML
-xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
-assertXPath(pXmlDoc, 
"/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dropDownList/w:listItem[1]", "value", 
"manolo");
-assertXPath(pXmlDoc, 
"/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dropDownList/w:listItem[2]", "value", 
"pepito");
-assertXPathContent(pXmlDoc, 
"/w:document/w:body/w:p/w:sdt/w:sdtContent/w:r/w:t", "manolo");
-
-// check imported control
-if (getShapes() > 0)
-{
-uno::Reference xControl(getShape(1), 
uno::UNO_QUERY);
-
-CPPUNIT_ASSERT_EQUAL(OUString("Manolo"), 
getProperty(xControl->getControl(), "Text"));
-
-uno::Sequence aItems = getProperty< uno::Sequence 
>(xControl->getControl(), "StringItemList");
-CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aItems.getLength());
-CPPUNIT_ASSERT_EQUAL(OUString("manolo"), aItems[0]);
-CPPUNIT_ASSERT_EQUAL(OUString("pepito"), aItems[1]);
-}
-else
+if (aComboBoxAsDropDown)
 {
 // ComboBox was imported as DropDown text field
 uno::Reference 
xTextFieldsSupplier(mxComponent, uno::UNO_QUERY);
@@ -739,13 +726,57 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testComboBoxControl, 
"combobox-control.docx"
 uno::Reference xServiceInfo(aField, 
uno::UNO_QUERY);
 
CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.text.textfield.DropDown"));
 
-CPPUNIT_ASSERT_EQUAL(OUString("manolo"), getProperty(aField, 
"SelectedItem"));
-
 uno::Sequence aItems = getProperty< uno::Sequence 
>(aField, "Items");
 CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aItems.getLength());
 CPPUNIT_ASSERT_EQUAL(OUString("manolo"), aItems[0]);
 CPPUNIT_ASSERT_EQUAL(OUString("pepito"), aItems[1]);
 }
+else
+{
+uno::Reference 
xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
+uno::Reference xDrawPage = 
xDrawPageSupplier->getDrawPage();
+uno::Reference xShape(xDrawPage->getByIndex(0), 
uno::UNO_QUERY);
+uno::Reference xControl(xShape, 
uno::UNO_QUERY);
+
+CPPUNIT_ASSERT_EQUAL(OUString("Manolo"), 
getProperty(xControl->getControl(), "Text"));
+
+uno::Sequence aItems = getProperty< uno::Sequence 
>(xControl->getControl(), "StringItemList");
+CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aItems.getLength());
+CPPUNIT_ASSERT_EQUAL(OUString("manolo"), aItems[0]);
+CPPUNIT_ASSERT_EQUAL(OUString("pepito"), aItems[1]);
+}
+}
+
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testComboBoxControl, 
"combobox-c

[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - officecfg/registry sw/qa writerfilter/source

2020-06-30 Thread Serge Krot (via logerrit)
 officecfg/registry/schema/org/openoffice/Office/Writer.xcs |   12 ++
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx   |   29 --
 sw/qa/extras/ooxmlexport/ooxmlexport13.cxx |   37 ++--
 sw/qa/extras/ooxmlexport/ooxmlexport4.cxx  |   36 ++-
 sw/qa/extras/ooxmlexport/ooxmlexport8.cxx  |   36 ++-
 writerfilter/source/dmapper/SdtHelper.cxx  |   60 +
 6 files changed, 171 insertions(+), 39 deletions(-)

New commits:
commit 029d239dd64a52ebb548f699c89e9109ae836fce
Author: Serge Krot 
AuthorDate: Tue Jun 16 17:11:12 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Tue Jun 30 23:29:51 2020 +0200

tdf#134043 DOCX import: DropDown text field instead of ComboBox form control

Change-Id: Ide9cedefde3b00fa0eeb37a6540e8d4a420b70c0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96471
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96608

diff --git a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
index e76bbeef495b..6ba34c5338ff 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
@@ -5883,6 +5883,18 @@
 true
   
 
+
+  
+Contains settings for importing DOCX.
+  
+  
+
+  Specifies whether ComboBox form control should be imported 
as DropDown text field.
+  Import ComboBox as DropDown
+
+false
+  
+
   
 
 
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index d4a453a27580..9a771a5f81b7 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -272,13 +272,30 @@ DECLARE_OOXMLEXPORT_TEST(testDropdownInCell, 
"dropdown-in-cell.docx")
 uno::Reference 
xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY);
 CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTables->getCount());
 
+uno::Reference xDrawPageSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Reference xDrawPage = 
xDrawPageSupplier->getDrawPage();
+
 // Second problem: dropdown shape wasn't anchored inside the B1 cell.
-uno::Reference xShape(getShape(1), uno::UNO_QUERY);
-uno::Reference xAnchor = xShape->getAnchor();
-uno::Reference xTable(xTables->getByIndex(0), 
uno::UNO_QUERY);
-uno::Reference xCell(xTable->getCellByName("B1"), 
uno::UNO_QUERY);
-uno::Reference xTextRangeCompare(xCell, 
uno::UNO_QUERY);
-CPPUNIT_ASSERT_EQUAL(sal_Int16(0), 
xTextRangeCompare->compareRegionStarts(xAnchor, xCell));
+if (xDrawPage->getCount() > 0)
+{
+uno::Reference xShape(getShape(1), uno::UNO_QUERY);
+uno::Reference xAnchor = xShape->getAnchor();
+uno::Reference xTable(xTables->getByIndex(0), 
uno::UNO_QUERY);
+uno::Reference xCell(xTable->getCellByName("B1"), 
uno::UNO_QUERY);
+uno::Reference xTextRangeCompare(xCell, 
uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(sal_Int16(0), 
xTextRangeCompare->compareRegionStarts(xAnchor, xCell));
+}
+else
+{
+// ComboBox was imported as DropDown text field
+uno::Reference 
xTextFieldsSupplier(mxComponent, uno::UNO_QUERY);
+uno::Reference 
xFieldsAccess(xTextFieldsSupplier->getTextFields());
+uno::Reference 
xFields(xFieldsAccess->createEnumeration());
+CPPUNIT_ASSERT(xFields->hasMoreElements());
+uno::Any aField = xFields->nextElement();
+uno::Reference xServiceInfo(aField, 
uno::UNO_QUERY);
+
CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.text.textfield.DropDown"));
+}
 }
 
 DECLARE_OOXMLEXPORT_TEST(testTableAlignment, "table-alignment.docx")
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
index e586a666dff4..3cd34365a2f2 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
@@ -505,7 +505,12 @@ DECLARE_OOXMLEXPORT_TEST(testParaAdjustDistribute, 
"para-adjust-distribute.docx"
 
 DECLARE_OOXMLEXPORT_TEST(testInputListExport, "tdf122186_input_list.odt")
 {
-if (!mbExported) // importing the ODT, an input field
+CPPUNIT_ASSERT_EQUAL(1, getPages());
+
+uno::Reference xDrawPageSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Reference xDrawPage = 
xDrawPageSupplier->getDrawPage();
+
+if (!mbExported || xDrawPage->getCount() == 0) // importing the ODT, an 
input field
 {
 uno::Reference 
xTextFieldsSupplier(mxComponent, uno::UNO_QUERY);
 uno::Reference 
xFieldsAccess(xTextFieldsSupplier->getTextFields()

[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-1+backports' - sw/source

2020-06-25 Thread Serge Krot (via logerrit)
 sw/source/core/text/portxt.cxx |   23 +++
 1 file changed, 23 insertions(+)

New commits:
commit bb3743dae784bdab66117a83ac65ded221440774
Author: Serge Krot 
AuthorDate: Fri Jun 19 13:06:33 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Thu Jun 25 13:05:43 2020 +0200

tdf#101830 sw: highlight empty 'invisible' input fields

Change-Id: Ibcf4f7ce88c7bf364510c522e224028aa4737790
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96717
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97098
Tested-by: Thorsten Behrens 

diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx
index f520130458e2..40f7223ab97a 100644
--- a/sw/source/core/text/portxt.cxx
+++ b/sw/source/core/text/portxt.cxx
@@ -42,6 +42,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace ::sw::mark;
 using namespace ::com::sun::star;
@@ -691,6 +692,28 @@ void SwTextInputFieldPortion::Paint( const SwTextPaintInfo 
 ) const
 SwTextSlot aPaintText( , this, true, true, OUString() );
 SwTextPortion::Paint( rInf );
 }
+else
+{
+// highlight empty input field, elsewhere they are completely 
invisible for the user
+SwRect aIntersect;
+rInf.CalcRect(*this, );
+const sal_uInt16 aAreaWidth = rInf.GetTextSize(OUString(' ')).Width();
+aIntersect.Left(aIntersect.Left() - aAreaWidth/2);
+aIntersect.Width(aAreaWidth);
+
+if (aIntersect.HasArea()
+&& rInf.OnWin()
+&& SwViewOption::IsFieldShadings()
+&& !rInf.GetOpt().IsPagePreview())
+{
+OutputDevice* pOut = const_cast(rInf.GetOut());
+pOut->Push(PushFlags::LINECOLOR | PushFlags::FILLCOLOR);
+pOut->SetFillColor(SwViewOption::GetFieldShadingsColor());
+pOut->SetLineColor();
+pOut->DrawRect(aIntersect.SVRect());
+pOut->Pop();
+}
+}
 }
 
 bool SwTextInputFieldPortion::GetExpText( const SwTextSizeInfo , OUString 
 ) const
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-1+backports' - sw/source

2020-06-24 Thread Serge Krot (via logerrit)
 sw/source/ui/dbui/mmresultdialogs.cxx |4 +++-
 sw/source/uibase/dbui/dbmgr.cxx   |3 ++-
 2 files changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 1f251925eda69fc925a4020af015f4bfa1141eb3
Author: Serge Krot 
AuthorDate: Fri May 22 13:20:23 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Wed Jun 24 21:08:19 2020 +0200

tdf#133270 MAILMERGE progress is not updated during export of many files

See also https://gerrit.libreoffice.org/c/core/+/90686 for a similar
change.

Change-Id: I063394f7ef0a68c79366f09c9d2cf5775a57e640
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94663
Tested-by: Thorsten Behrens 
Reviewed-by: Thorsten Behrens 
(cherry picked from commit 80cea3682b2cf07f1685852cd8809d9db58a1cb5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95481
Reviewed-by: Michael Stahl 
Tested-by: Jenkins
(cherry picked from commit ef61c49236c2bc11175fb26e55870a06b3e92f0c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97042

diff --git a/sw/source/ui/dbui/mmresultdialogs.cxx 
b/sw/source/ui/dbui/mmresultdialogs.cxx
index 0c4952f68d76..a70385c14fa1 100644
--- a/sw/source/ui/dbui/mmresultdialogs.cxx
+++ b/sw/source/ui/dbui/mmresultdialogs.cxx
@@ -43,6 +43,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -675,7 +676,8 @@ IMPL_LINK_NOARG(SwMMResultSaveDialog, SaveOutputHdl_Impl, 
weld::Button&, void)
 while(true)
 {
 //time for other slots is needed
-Application::Reschedule( true );
+Scheduler::ProcessEventsToIdle();
+
 bool bFailed = false;
 try
 {
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index 23304b977c54..3dd0da2c98fd 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -45,6 +45,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1485,7 +1486,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell,
 //TODO xProgressDlg->queue_draw();
 }
 
-Application::Reschedule( true );
+Scheduler::ProcessEventsToIdle();
 
 // Create a copy of the source document and work with that one 
instead of the source.
 // If we're not in the single file mode (which requires modifying 
the document for the merging),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - officecfg/registry sw/qa writerfilter/source

2020-06-23 Thread Serge Krot (via logerrit)
 officecfg/registry/schema/org/openoffice/Office/Writer.xcs |   12 ++
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx   |   26 -
 sw/qa/extras/ooxmlexport/ooxmlexport13.cxx |   29 --
 sw/qa/extras/ooxmlexport/ooxmlexport4.cxx  |   35 ++-
 sw/qa/extras/ooxmlexport/ooxmlexport8.cxx  |   33 +--
 writerfilter/source/dmapper/SdtHelper.cxx  |   60 +
 6 files changed, 155 insertions(+), 40 deletions(-)

New commits:
commit f7606f0c7d9fc5961adec6a84ccedf0f4dbcdad9
Author: Serge Krot 
AuthorDate: Tue Jun 16 17:11:12 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Tue Jun 23 14:23:01 2020 +0200

tdf#134043 DOCX import: DropDown text field instead of ComboBox form control

Change-Id: Ide9cedefde3b00fa0eeb37a6540e8d4a420b70c0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96471
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96729

diff --git a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
index 8b76534d540d..6beb18105b08 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
@@ -5899,6 +5899,18 @@
 true
   
 
+
+  
+Contains settings for importing DOCX.
+  
+  
+
+  Specifies whether ComboBox form control should be imported 
as DropDown text field.
+  Import ComboBox as DropDown
+
+true
+  
+
   
 
 
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 5ff581743ccd..133c2add7822 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -264,12 +264,26 @@ DECLARE_OOXMLEXPORT_TEST(testDropdownInCell, 
"dropdown-in-cell.docx")
 CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTables->getCount());
 
 // Second problem: dropdown shape wasn't anchored inside the B1 cell.
-uno::Reference xShape(getShape(1), uno::UNO_QUERY);
-uno::Reference xAnchor = xShape->getAnchor();
-uno::Reference xTable(xTables->getByIndex(0), 
uno::UNO_QUERY);
-uno::Reference xCell(xTable->getCellByName("B1"), 
uno::UNO_QUERY);
-uno::Reference xTextRangeCompare(xCell, 
uno::UNO_QUERY);
-CPPUNIT_ASSERT_EQUAL(sal_Int16(0), 
xTextRangeCompare->compareRegionStarts(xAnchor, xCell));
+if (getShapes() > 0)
+{
+uno::Reference xShape(getShape(1), uno::UNO_QUERY);
+uno::Reference xAnchor = xShape->getAnchor();
+uno::Reference xTable(xTables->getByIndex(0), 
uno::UNO_QUERY);
+uno::Reference xCell(xTable->getCellByName("B1"), 
uno::UNO_QUERY);
+uno::Reference xTextRangeCompare(xCell, 
uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(sal_Int16(0), 
xTextRangeCompare->compareRegionStarts(xAnchor, xCell));
+}
+else
+{
+// ComboBox was imported as DropDown text field
+uno::Reference 
xTextFieldsSupplier(mxComponent, uno::UNO_QUERY);
+uno::Reference 
xFieldsAccess(xTextFieldsSupplier->getTextFields());
+uno::Reference 
xFields(xFieldsAccess->createEnumeration());
+CPPUNIT_ASSERT(xFields->hasMoreElements());
+uno::Any aField = xFields->nextElement();
+uno::Reference xServiceInfo(aField, 
uno::UNO_QUERY);
+
CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.text.textfield.DropDown"));
+}
 }
 
 DECLARE_OOXMLEXPORT_TEST(testTableAlignment, "table-alignment.docx")
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
index 272daae72c78..430749768862 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
@@ -560,7 +560,7 @@ DECLARE_OOXMLEXPORT_TEST(testParaAdjustDistribute, 
"para-adjust-distribute.docx"
 DECLARE_OOXMLEXPORT_TEST(testInputListExport, "tdf122186_input_list.odt")
 {
 CPPUNIT_ASSERT_EQUAL(1, getPages());
-if (!mbExported) // importing the ODT, an input field
+if (!mbExported || getShapes() == 0) // importing the ODT, an input field
 {
 uno::Reference 
xTextFieldsSupplier(mxComponent, uno::UNO_QUERY);
 uno::Reference 
xFieldsAccess(xTextFieldsSupplier->getTextFields());
@@ -1032,11 +1032,28 @@ DECLARE_OOXMLEXPORT_TEST(tdf127085, "tdf127085.docx")
 DECLARE_OOXMLEXPORT_TEST(tdf119809, "tdf119809.docx")
 {
 // Combobox without an item list lost during import
-uno::Reference xControlShape(getShape(1), 
uno::UNO_QUERY);
-uno::Reference 
xPropertySet(xControlShape->getControl(), uno::UNO_QUERY);
-uno::Reference xServiceI

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sw/source

2020-06-23 Thread Serge Krot (via logerrit)
 sw/source/core/text/portxt.cxx |   23 +++
 1 file changed, 23 insertions(+)

New commits:
commit cec306c2e2bff6cd70fc698a5026425f41c98ab7
Author: Serge Krot 
AuthorDate: Fri Jun 19 13:06:33 2020 +0200
Commit: Andras Timar 
CommitDate: Tue Jun 23 08:55:49 2020 +0200

tdf#101830 sw: highlight empty 'invisible' input fields

Change-Id: Ibcf4f7ce88c7bf364510c522e224028aa4737790
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96717
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
(cherry picked from commit 63d4e8aa10186b4ed0e3106c116ad25c5fb5ed6d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96709
(cherry picked from commit 9733be8607fe36c7f69ff050a487ff0e6e88f79f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96790

diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx
index 0460cb343dd3..79963e311b29 100644
--- a/sw/source/core/text/portxt.cxx
+++ b/sw/source/core/text/portxt.cxx
@@ -43,6 +43,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace ::sw::mark;
 using namespace ::com::sun::star;
@@ -695,6 +696,28 @@ void SwTextInputFieldPortion::Paint( const SwTextPaintInfo 
 ) const
 SwTextSlot aPaintText( , this, true, true, OUString() );
 SwTextPortion::Paint( rInf );
 }
+else
+{
+// highlight empty input field, elsewhere they are completely 
invisible for the user
+SwRect aIntersect;
+rInf.CalcRect(*this, );
+const sal_uInt16 aAreaWidth = rInf.GetTextSize(OUString(' ')).Width();
+aIntersect.Left(aIntersect.Left() - aAreaWidth/2);
+aIntersect.Width(aAreaWidth);
+
+if (aIntersect.HasArea()
+&& rInf.OnWin()
+&& SwViewOption::IsFieldShadings()
+&& !rInf.GetOpt().IsPagePreview())
+{
+OutputDevice* pOut = const_cast(rInf.GetOut());
+pOut->Push(PushFlags::LINECOLOR | PushFlags::FILLCOLOR);
+pOut->SetFillColor(SwViewOption::GetFieldShadingsColor());
+pOut->SetLineColor();
+pOut->DrawRect(aIntersect.SVRect());
+pOut->Pop();
+}
+}
 }
 
 bool SwTextInputFieldPortion::GetExpText( const SwTextSizeInfo , OUString 
 ) const
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - sw/source

2020-06-22 Thread Serge Krot (via logerrit)
 sw/source/core/text/portxt.cxx |   23 +++
 1 file changed, 23 insertions(+)

New commits:
commit 12e1cfbb49686d4c5309a4c3443a59bdab21dd16
Author: Serge Krot 
AuthorDate: Fri Jun 19 13:06:33 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Mon Jun 22 09:18:51 2020 +0200

tdf#101830 sw: highlight empty 'invisible' input fields

Change-Id: Ibcf4f7ce88c7bf364510c522e224028aa4737790
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96717
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
(cherry picked from commit 63d4e8aa10186b4ed0e3106c116ad25c5fb5ed6d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96709
(cherry picked from commit 9733be8607fe36c7f69ff050a487ff0e6e88f79f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96790

diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx
index 0460cb343dd3..79963e311b29 100644
--- a/sw/source/core/text/portxt.cxx
+++ b/sw/source/core/text/portxt.cxx
@@ -43,6 +43,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace ::sw::mark;
 using namespace ::com::sun::star;
@@ -695,6 +696,28 @@ void SwTextInputFieldPortion::Paint( const SwTextPaintInfo 
 ) const
 SwTextSlot aPaintText( , this, true, true, OUString() );
 SwTextPortion::Paint( rInf );
 }
+else
+{
+// highlight empty input field, elsewhere they are completely 
invisible for the user
+SwRect aIntersect;
+rInf.CalcRect(*this, );
+const sal_uInt16 aAreaWidth = rInf.GetTextSize(OUString(' ')).Width();
+aIntersect.Left(aIntersect.Left() - aAreaWidth/2);
+aIntersect.Width(aAreaWidth);
+
+if (aIntersect.HasArea()
+&& rInf.OnWin()
+&& SwViewOption::IsFieldShadings()
+&& !rInf.GetOpt().IsPagePreview())
+{
+OutputDevice* pOut = const_cast(rInf.GetOut());
+pOut->Push(PushFlags::LINECOLOR | PushFlags::FILLCOLOR);
+pOut->SetFillColor(SwViewOption::GetFieldShadingsColor());
+pOut->SetLineColor();
+pOut->DrawRect(aIntersect.SVRect());
+pOut->Pop();
+}
+}
 }
 
 bool SwTextInputFieldPortion::GetExpText( const SwTextSizeInfo , OUString 
 ) const
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source

2020-06-20 Thread Serge Krot (via logerrit)
 sw/source/core/text/portxt.cxx |   23 +++
 1 file changed, 23 insertions(+)

New commits:
commit c19bc04920df332a2c1f89b7e5ee4ef70e028bf5
Author: Serge Krot 
AuthorDate: Fri Jun 19 13:06:33 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Sat Jun 20 16:23:34 2020 +0200

tdf#101830 sw: highlight empty 'invisible' input fields

Change-Id: Ibcf4f7ce88c7bf364510c522e224028aa4737790
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96717
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
(cherry picked from commit 63d4e8aa10186b4ed0e3106c116ad25c5fb5ed6d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96709

diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx
index ea16142b9f33..84bbee847d72 100644
--- a/sw/source/core/text/portxt.cxx
+++ b/sw/source/core/text/portxt.cxx
@@ -37,6 +37,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace ::sw::mark;
 using namespace ::com::sun::star;
@@ -689,6 +690,28 @@ void SwTextInputFieldPortion::Paint( const SwTextPaintInfo 
 ) const
 SwTextSlot aPaintText( , this, true, true, OUString() );
 SwTextPortion::Paint( rInf );
 }
+else
+{
+// highlight empty input field, elsewhere they are completely 
invisible for the user
+SwRect aIntersect;
+rInf.CalcRect(*this, );
+const sal_uInt16 aAreaWidth = rInf.GetTextSize(OUString(' ')).Width();
+aIntersect.Left(aIntersect.Left() - aAreaWidth/2);
+aIntersect.Width(aAreaWidth);
+
+if (aIntersect.HasArea()
+&& rInf.OnWin()
+&& SwViewOption::IsFieldShadings()
+&& !rInf.GetOpt().IsPagePreview())
+{
+OutputDevice* pOut = const_cast(rInf.GetOut());
+pOut->Push(PushFlags::LINECOLOR | PushFlags::FILLCOLOR);
+pOut->SetFillColor(SwViewOption::GetFieldShadingsColor());
+pOut->SetLineColor();
+pOut->DrawRect(aIntersect.SVRect());
+pOut->Pop();
+}
+}
 }
 
 bool SwTextInputFieldPortion::GetExpText( const SwTextSizeInfo , OUString 
 ) const
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sw/source

2020-06-19 Thread Serge Krot (via logerrit)
 sw/source/core/text/portxt.cxx |   23 +++
 1 file changed, 23 insertions(+)

New commits:
commit 63d4e8aa10186b4ed0e3106c116ad25c5fb5ed6d
Author: Serge Krot 
AuthorDate: Fri Jun 19 13:06:33 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Sat Jun 20 01:47:03 2020 +0200

tdf#101830 sw: highlight empty 'invisible' input fields

Change-Id: Ibcf4f7ce88c7bf364510c522e224028aa4737790
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96717
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx
index ea16142b9f33..84bbee847d72 100644
--- a/sw/source/core/text/portxt.cxx
+++ b/sw/source/core/text/portxt.cxx
@@ -37,6 +37,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace ::sw::mark;
 using namespace ::com::sun::star;
@@ -689,6 +690,28 @@ void SwTextInputFieldPortion::Paint( const SwTextPaintInfo 
 ) const
 SwTextSlot aPaintText( , this, true, true, OUString() );
 SwTextPortion::Paint( rInf );
 }
+else
+{
+// highlight empty input field, elsewhere they are completely 
invisible for the user
+SwRect aIntersect;
+rInf.CalcRect(*this, );
+const sal_uInt16 aAreaWidth = rInf.GetTextSize(OUString(' ')).Width();
+aIntersect.Left(aIntersect.Left() - aAreaWidth/2);
+aIntersect.Width(aAreaWidth);
+
+if (aIntersect.HasArea()
+&& rInf.OnWin()
+&& SwViewOption::IsFieldShadings()
+&& !rInf.GetOpt().IsPagePreview())
+{
+OutputDevice* pOut = const_cast(rInf.GetOut());
+pOut->Push(PushFlags::LINECOLOR | PushFlags::FILLCOLOR);
+pOut->SetFillColor(SwViewOption::GetFieldShadingsColor());
+pOut->SetLineColor();
+pOut->DrawRect(aIntersect.SVRect());
+pOut->Pop();
+}
+}
 }
 
 bool SwTextInputFieldPortion::GetExpText( const SwTextSizeInfo , OUString 
 ) const
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: officecfg/registry sw/qa writerfilter/source

2020-06-17 Thread Serge Krot (via logerrit)
 officecfg/registry/schema/org/openoffice/Office/Writer.xcs |   12 ++
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx   |   26 -
 sw/qa/extras/ooxmlexport/ooxmlexport13.cxx |   29 --
 sw/qa/extras/ooxmlexport/ooxmlexport4.cxx  |   35 ++-
 sw/qa/extras/ooxmlexport/ooxmlexport8.cxx  |   33 +--
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx   |4 
 writerfilter/source/dmapper/SdtHelper.cxx  |   60 +
 7 files changed, 157 insertions(+), 42 deletions(-)

New commits:
commit 33ad3ee258587904afaa03550858beac25b883f7
Author: Serge Krot 
AuthorDate: Tue Jun 16 17:11:12 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Wed Jun 17 17:00:46 2020 +0200

tdf#134043 DOCX import: DropDown text field instead of ComboBox form control

Change-Id: Ide9cedefde3b00fa0eeb37a6540e8d4a420b70c0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96471
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
index 8b76534d540d..6beb18105b08 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
@@ -5899,6 +5899,18 @@
 true
   
 
+
+  
+Contains settings for importing DOCX.
+  
+  
+
+  Specifies whether ComboBox form control should be imported 
as DropDown text field.
+  Import ComboBox as DropDown
+
+true
+  
+
   
 
 
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 5ff581743ccd..133c2add7822 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -264,12 +264,26 @@ DECLARE_OOXMLEXPORT_TEST(testDropdownInCell, 
"dropdown-in-cell.docx")
 CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTables->getCount());
 
 // Second problem: dropdown shape wasn't anchored inside the B1 cell.
-uno::Reference xShape(getShape(1), uno::UNO_QUERY);
-uno::Reference xAnchor = xShape->getAnchor();
-uno::Reference xTable(xTables->getByIndex(0), 
uno::UNO_QUERY);
-uno::Reference xCell(xTable->getCellByName("B1"), 
uno::UNO_QUERY);
-uno::Reference xTextRangeCompare(xCell, 
uno::UNO_QUERY);
-CPPUNIT_ASSERT_EQUAL(sal_Int16(0), 
xTextRangeCompare->compareRegionStarts(xAnchor, xCell));
+if (getShapes() > 0)
+{
+uno::Reference xShape(getShape(1), uno::UNO_QUERY);
+uno::Reference xAnchor = xShape->getAnchor();
+uno::Reference xTable(xTables->getByIndex(0), 
uno::UNO_QUERY);
+uno::Reference xCell(xTable->getCellByName("B1"), 
uno::UNO_QUERY);
+uno::Reference xTextRangeCompare(xCell, 
uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL(sal_Int16(0), 
xTextRangeCompare->compareRegionStarts(xAnchor, xCell));
+}
+else
+{
+// ComboBox was imported as DropDown text field
+uno::Reference 
xTextFieldsSupplier(mxComponent, uno::UNO_QUERY);
+uno::Reference 
xFieldsAccess(xTextFieldsSupplier->getTextFields());
+uno::Reference 
xFields(xFieldsAccess->createEnumeration());
+CPPUNIT_ASSERT(xFields->hasMoreElements());
+uno::Any aField = xFields->nextElement();
+uno::Reference xServiceInfo(aField, 
uno::UNO_QUERY);
+
CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.text.textfield.DropDown"));
+}
 }
 
 DECLARE_OOXMLEXPORT_TEST(testTableAlignment, "table-alignment.docx")
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
index 272daae72c78..430749768862 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
@@ -560,7 +560,7 @@ DECLARE_OOXMLEXPORT_TEST(testParaAdjustDistribute, 
"para-adjust-distribute.docx"
 DECLARE_OOXMLEXPORT_TEST(testInputListExport, "tdf122186_input_list.odt")
 {
 CPPUNIT_ASSERT_EQUAL(1, getPages());
-if (!mbExported) // importing the ODT, an input field
+if (!mbExported || getShapes() == 0) // importing the ODT, an input field
 {
 uno::Reference 
xTextFieldsSupplier(mxComponent, uno::UNO_QUERY);
 uno::Reference 
xFieldsAccess(xTextFieldsSupplier->getTextFields());
@@ -1032,11 +1032,28 @@ DECLARE_OOXMLEXPORT_TEST(tdf127085, "tdf127085.docx")
 DECLARE_OOXMLEXPORT_TEST(tdf119809, "tdf119809.docx")
 {
 // Combobox without an item list lost during import
-uno::Reference xControlShape(getShape(1), 
uno::UNO_QUERY);
-uno::Reference 
xPropertySet(xControlShape->getControl(), uno::UNO_QUERY);
-uno::Reference xServiceI

[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-1+backports' - sw/source

2020-06-12 Thread Serge Krot (via logerrit)
 sw/source/core/doc/DocumentContentOperationsManager.cxx |2 ++
 sw/source/core/doc/docbm.cxx|7 ++-
 sw/source/core/inc/mvsave.hxx   |2 ++
 sw/source/core/inc/rolbck.hxx   |2 ++
 sw/source/core/undo/rolbck.cxx  |8 ++--
 5 files changed, 18 insertions(+), 3 deletions(-)

New commits:
commit fc075494106285c4e0ce1f765e21bd8b7f2cb164
Author: Serge Krot 
AuthorDate: Wed Jun 10 19:15:41 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Fri Jun 12 13:40:38 2020 +0200

tdf#101856 copy missing bookmark properties

- in case of undo/redo
- in case of copying bookmark

Change-Id: Ia21f42973b0e7c2cc4abfe2febe9818509aec4d5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96064
Tested-by: Thorsten Behrens 
Reviewed-by: Thorsten Behrens 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96116

diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx 
b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index b3243bd0e624..3135172cfe84 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -291,6 +291,8 @@ namespace
 {
 pNewBookmark->SetKeyCode(pOldBookmark->GetKeyCode());
 pNewBookmark->SetShortName(pOldBookmark->GetShortName());
+pNewBookmark->Hide(pOldBookmark->IsHidden());
+
pNewBookmark->SetHideCondition(pOldBookmark->GetHideCondition());
 }
 ::sw::mark::IFieldmark* const pNewFieldmark =
 dynamic_cast< ::sw::mark::IFieldmark* const >(pNewMark);
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index 65ae2df1c182..ed383ecec8e2 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -1222,7 +1222,7 @@ SaveBookmark::SaveBookmark(
 const SwNodeIndex & rMvPos,
 const SwIndex* pIdx)
 : m_aName(rBkmk.GetName())
-, m_aShortName()
+, m_bHidden(false)
 , m_aCode()
 , m_eOrigBkmType(IDocumentMarkAccess::GetType(rBkmk))
 {
@@ -1231,6 +1231,8 @@ SaveBookmark::SaveBookmark(
 {
 m_aShortName = pBookmark->GetShortName();
 m_aCode = pBookmark->GetKeyCode();
+m_bHidden = pBookmark->IsHidden();
+m_aHideCondition = pBookmark->GetHideCondition();
 
 ::sfx2::Metadatable const*const pMetadatable(
 dynamic_cast< ::sfx2::Metadatable const* >(pBookmark));
@@ -1299,6 +1301,9 @@ void SaveBookmark::SetInDoc(
 {
 pBookmark->SetKeyCode(m_aCode);
 pBookmark->SetShortName(m_aShortName);
+pBookmark->Hide(m_bHidden);
+pBookmark->SetHideCondition(m_aHideCondition);
+
 if (m_pMetadataUndo)
 {
 ::sfx2::Metadatable * const pMeta(
diff --git a/sw/source/core/inc/mvsave.hxx b/sw/source/core/inc/mvsave.hxx
index ec0a1e412787..852ac885faa0 100644
--- a/sw/source/core/inc/mvsave.hxx
+++ b/sw/source/core/inc/mvsave.hxx
@@ -58,6 +58,8 @@ namespace sw { namespace mark
 private:
 OUString m_aName;
 OUString m_aShortName;
+bool m_bHidden;
+OUString m_aHideCondition;
 vcl::KeyCode m_aCode;
 IDocumentMarkAccess::MarkType m_eOrigBkmType;
 sal_uLong m_nNode1;
diff --git a/sw/source/core/inc/rolbck.hxx b/sw/source/core/inc/rolbck.hxx
index ef6642719a72..2abb4e4bfbb3 100644
--- a/sw/source/core/inc/rolbck.hxx
+++ b/sw/source/core/inc/rolbck.hxx
@@ -248,6 +248,8 @@ class SwHistoryBookmark : public SwHistoryHint
 private:
 const OUString m_aName;
 OUString m_aShortName;
+bool m_bHidden;
+OUString m_aHideCondition;
 vcl::KeyCode m_aKeycode;
 const sal_uLong m_nNode;
 const sal_uLong m_nOtherNode;
diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx
index 835ad7f6a86e..f22b31f77d23 100644
--- a/sw/source/core/undo/rolbck.cxx
+++ b/sw/source/core/undo/rolbck.cxx
@@ -559,8 +559,7 @@ SwHistoryBookmark::SwHistoryBookmark(
 bool bSaveOtherPos)
 : SwHistoryHint(HSTRY_BOOKMARK)
 , m_aName(rBkmk.GetName())
-, m_aShortName()
-, m_aKeycode()
+, m_bHidden(false)
 , m_nNode(bSavePos ?
 rBkmk.GetMarkPos().nNode.GetIndex() : 0)
 , m_nOtherNode(bSaveOtherPos ?
@@ -579,6 +578,8 @@ SwHistoryBookmark::SwHistoryBookmark(
 {
 m_aKeycode = pBookmark->GetKeyCode();
 m_aShortName = pBookmark->GetShortName();
+m_bHidden = pBookmark->IsHidden();
+m_aHideCondition = pBookmark->GetHideCondition();
 
 ::sfx2::Metadatable const*const pMetadatable(
 dynamic_cast< ::sfx2::Metadatable const* >(pBookmark));
@@ -653,6 +654,9 @@ void SwHistoryBoo

[Libreoffice-commits] core.git: sw/source

2020-06-11 Thread Serge Krot (via logerrit)
 sw/source/core/doc/DocumentContentOperationsManager.cxx |2 ++
 sw/source/core/doc/docbm.cxx|7 ++-
 sw/source/core/inc/mvsave.hxx   |2 ++
 sw/source/core/inc/rolbck.hxx   |2 ++
 sw/source/core/undo/rolbck.cxx  |8 ++--
 5 files changed, 18 insertions(+), 3 deletions(-)

New commits:
commit ddd9b1bccd87c6913ba4576da8af2d59daf106e9
Author: Serge Krot 
AuthorDate: Wed Jun 10 19:15:41 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Thu Jun 11 11:55:50 2020 +0200

tdf#101856 copy missing bookmark properties

- in case of undo/redo
- in case of copying bookmark

Change-Id: Ia21f42973b0e7c2cc4abfe2febe9818509aec4d5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96064
Tested-by: Thorsten Behrens 
Reviewed-by: Thorsten Behrens 

diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx 
b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 4151f9d6b562..12350ceb49d9 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -298,6 +298,8 @@ namespace sw
 {
 pNewBookmark->SetKeyCode(pOldBookmark->GetKeyCode());
 pNewBookmark->SetShortName(pOldBookmark->GetShortName());
+pNewBookmark->Hide(pOldBookmark->IsHidden());
+
pNewBookmark->SetHideCondition(pOldBookmark->GetHideCondition());
 }
 ::sw::mark::IFieldmark* const pNewFieldmark =
 dynamic_cast< ::sw::mark::IFieldmark* const >(pNewMark);
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index d18d020e8c88..429c2e1129f6 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -1690,7 +1690,7 @@ SaveBookmark::SaveBookmark(
 const SwNodeIndex & rMvPos,
 const SwIndex* pIdx)
 : m_aName(rBkmk.GetName())
-, m_aShortName()
+, m_bHidden(false)
 , m_aCode()
 , m_eOrigBkmType(IDocumentMarkAccess::GetType(rBkmk))
 {
@@ -1699,6 +1699,8 @@ SaveBookmark::SaveBookmark(
 {
 m_aShortName = pBookmark->GetShortName();
 m_aCode = pBookmark->GetKeyCode();
+m_bHidden = pBookmark->IsHidden();
+m_aHideCondition = pBookmark->GetHideCondition();
 
 ::sfx2::Metadatable const*const pMetadatable(
 dynamic_cast< ::sfx2::Metadatable const* >(pBookmark));
@@ -1767,6 +1769,9 @@ void SaveBookmark::SetInDoc(
 {
 pBookmark->SetKeyCode(m_aCode);
 pBookmark->SetShortName(m_aShortName);
+pBookmark->Hide(m_bHidden);
+pBookmark->SetHideCondition(m_aHideCondition);
+
 if (m_pMetadataUndo)
 {
 ::sfx2::Metadatable * const pMeta(
diff --git a/sw/source/core/inc/mvsave.hxx b/sw/source/core/inc/mvsave.hxx
index 64064a858023..b0b0c4fc3e34 100644
--- a/sw/source/core/inc/mvsave.hxx
+++ b/sw/source/core/inc/mvsave.hxx
@@ -58,6 +58,8 @@ namespace sw::mark
 private:
 OUString m_aName;
 OUString m_aShortName;
+bool m_bHidden;
+OUString m_aHideCondition;
 vcl::KeyCode m_aCode;
 IDocumentMarkAccess::MarkType m_eOrigBkmType;
 sal_uLong m_nNode1;
diff --git a/sw/source/core/inc/rolbck.hxx b/sw/source/core/inc/rolbck.hxx
index f473ad63b753..1882a68d1d0e 100644
--- a/sw/source/core/inc/rolbck.hxx
+++ b/sw/source/core/inc/rolbck.hxx
@@ -249,6 +249,8 @@ class SwHistoryBookmark : public SwHistoryHint
 private:
 const OUString m_aName;
 OUString m_aShortName;
+bool m_bHidden;
+OUString m_aHideCondition;
 vcl::KeyCode m_aKeycode;
 const sal_uLong m_nNode;
 const sal_uLong m_nOtherNode;
diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx
index ceac742f9bbc..2de4c627109e 100644
--- a/sw/source/core/undo/rolbck.cxx
+++ b/sw/source/core/undo/rolbck.cxx
@@ -559,8 +559,7 @@ SwHistoryBookmark::SwHistoryBookmark(
 bool bSaveOtherPos)
 : SwHistoryHint(HSTRY_BOOKMARK)
 , m_aName(rBkmk.GetName())
-, m_aShortName()
-, m_aKeycode()
+, m_bHidden(false)
 , m_nNode(bSavePos ?
 rBkmk.GetMarkPos().nNode.GetIndex() : 0)
 , m_nOtherNode(bSaveOtherPos ?
@@ -579,6 +578,8 @@ SwHistoryBookmark::SwHistoryBookmark(
 {
 m_aKeycode = pBookmark->GetKeyCode();
 m_aShortName = pBookmark->GetShortName();
+m_bHidden = pBookmark->IsHidden();
+m_aHideCondition = pBookmark->GetHideCondition();
 
 ::sfx2::Metadatable const*const pMetadatable(
 dynamic_cast< ::sfx2::Metadatable const* >(pBookmark));
@@ -653,6 +654,9 @@ void SwHistoryBookmark::SetInDoc( SwDoc* pDoc, bool )
 {
 pB

[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - sw/source

2020-06-11 Thread Serge Krot (via logerrit)
 sw/source/core/doc/DocumentContentOperationsManager.cxx |2 ++
 sw/source/core/doc/docbm.cxx|7 ++-
 sw/source/core/inc/mvsave.hxx   |2 ++
 sw/source/core/inc/rolbck.hxx   |2 ++
 sw/source/core/undo/rolbck.cxx  |8 ++--
 5 files changed, 18 insertions(+), 3 deletions(-)

New commits:
commit b5e2b9d11d0a32a10709049835cc00b23542d869
Author: Serge Krot 
AuthorDate: Wed Jun 10 19:15:41 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Thu Jun 11 11:28:22 2020 +0200

tdf#101856 copy missing bookmark properties

- in case of undo/redo
- in case of copying bookmark

Change-Id: Ia21f42973b0e7c2cc4abfe2febe9818509aec4d5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96038
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx 
b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 49920f65d503..8ba8a4c5a136 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -297,6 +297,8 @@ namespace sw
 {
 pNewBookmark->SetKeyCode(pOldBookmark->GetKeyCode());
 pNewBookmark->SetShortName(pOldBookmark->GetShortName());
+pNewBookmark->Hide(pOldBookmark->IsHidden());
+
pNewBookmark->SetHideCondition(pOldBookmark->GetHideCondition());
 }
 ::sw::mark::IFieldmark* const pNewFieldmark =
 dynamic_cast< ::sw::mark::IFieldmark* const >(pNewMark);
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index bab44aa4a5f5..a9eed445a21c 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -1629,7 +1629,7 @@ SaveBookmark::SaveBookmark(
 const SwNodeIndex & rMvPos,
 const SwIndex* pIdx)
 : m_aName(rBkmk.GetName())
-, m_aShortName()
+, m_bHidden(false)
 , m_aCode()
 , m_eOrigBkmType(IDocumentMarkAccess::GetType(rBkmk))
 {
@@ -1638,6 +1638,8 @@ SaveBookmark::SaveBookmark(
 {
 m_aShortName = pBookmark->GetShortName();
 m_aCode = pBookmark->GetKeyCode();
+m_bHidden = pBookmark->IsHidden();
+m_aHideCondition = pBookmark->GetHideCondition();
 
 ::sfx2::Metadatable const*const pMetadatable(
 dynamic_cast< ::sfx2::Metadatable const* >(pBookmark));
@@ -1706,6 +1708,9 @@ void SaveBookmark::SetInDoc(
 {
 pBookmark->SetKeyCode(m_aCode);
 pBookmark->SetShortName(m_aShortName);
+pBookmark->Hide(m_bHidden);
+pBookmark->SetHideCondition(m_aHideCondition);
+
 if (m_pMetadataUndo)
 {
 ::sfx2::Metadatable * const pMeta(
diff --git a/sw/source/core/inc/mvsave.hxx b/sw/source/core/inc/mvsave.hxx
index bdbab23f08ab..c472b6f7bc1a 100644
--- a/sw/source/core/inc/mvsave.hxx
+++ b/sw/source/core/inc/mvsave.hxx
@@ -58,6 +58,8 @@ namespace sw { namespace mark
 private:
 OUString const m_aName;
 OUString m_aShortName;
+bool m_bHidden;
+OUString m_aHideCondition;
 vcl::KeyCode m_aCode;
 IDocumentMarkAccess::MarkType const m_eOrigBkmType;
 sal_uLong m_nNode1;
diff --git a/sw/source/core/inc/rolbck.hxx b/sw/source/core/inc/rolbck.hxx
index 2abe1d590b88..7cceb86a58e6 100644
--- a/sw/source/core/inc/rolbck.hxx
+++ b/sw/source/core/inc/rolbck.hxx
@@ -249,6 +249,8 @@ class SwHistoryBookmark : public SwHistoryHint
 private:
 const OUString m_aName;
 OUString m_aShortName;
+bool m_bHidden;
+OUString m_aHideCondition;
 vcl::KeyCode m_aKeycode;
 const sal_uLong m_nNode;
 const sal_uLong m_nOtherNode;
diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx
index ef4815a1cff4..50ff24aa4d98 100644
--- a/sw/source/core/undo/rolbck.cxx
+++ b/sw/source/core/undo/rolbck.cxx
@@ -559,8 +559,7 @@ SwHistoryBookmark::SwHistoryBookmark(
 bool bSaveOtherPos)
 : SwHistoryHint(HSTRY_BOOKMARK)
 , m_aName(rBkmk.GetName())
-, m_aShortName()
-, m_aKeycode()
+, m_bHidden(false)
 , m_nNode(bSavePos ?
 rBkmk.GetMarkPos().nNode.GetIndex() : 0)
 , m_nOtherNode(bSaveOtherPos ?
@@ -579,6 +578,8 @@ SwHistoryBookmark::SwHistoryBookmark(
 {
 m_aKeycode = pBookmark->GetKeyCode();
 m_aShortName = pBookmark->GetShortName();
+m_bHidden = pBookmark->IsHidden();
+m_aHideCondition = pBookmark->GetHideCondition();
 
 ::sfx2::Metadatable const*const pMetadatable(
 dynamic_cast< ::sfx2::Metadatable const* >(pBookmark));
@@ -653,6 +654,9 @@ void SwHistoryBookmark::SetInDoc( SwDoc* pDoc, bool )
 {
  

[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - sw/source

2020-06-10 Thread Serge Krot (via logerrit)
 sw/source/core/text/porlay.cxx |   24 
 1 file changed, 24 insertions(+)

New commits:
commit 4b3f9c6a06650532df34af6388fa62d659eabd90
Author: Serge Krot 
AuthorDate: Mon Jun 8 12:43:53 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Wed Jun 10 23:53:16 2020 +0200

tdf#101856 evaluate condition to expand / collapse bookmarks

Change-Id: I7c135eab0feeca0ede794f6c88a2b06e339d6a14
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95795
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96003
Reviewed-by: Michael Stahl 

diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index d9406a4e28c1..2bb9e87bd2c9 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -54,9 +54,11 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
+#include 
 #include 
 
 using namespace ::com::sun::star;
@@ -2283,7 +2285,29 @@ void SwScriptInfo::selectHiddenTextProperty(const 
SwTextNode& rNode, MultiSelect
 {
 const sw::mark::IMark* pMark = pIndex->GetMark();
 const sw::mark::IBookmark* pBookmark = dynamic_cast(pMark);
+
+bool bHide = false;
 if (pBookmark && pBookmark->IsHidden())
+{
+// bookmark is marked as hidden
+bHide = true;
+
+// bookmark is marked as hidden with conditions
+if (!pBookmark->GetHideCondition().isEmpty())
+{
+SwDoc& rDoc = *const_cast(rNode.GetDoc());
+SwCalc aCalc(rDoc);
+rDoc.getIDocumentFieldsAccess().FieldsToCalc(aCalc, 
rNode.GetIndex(), USHRT_MAX);
+
+SwSbxValue aValue = 
aCalc.Calculate(pBookmark->GetHideCondition());
+if(!aValue.IsVoidValue())
+{
+bHide = aValue.GetBool();
+}
+}
+}
+
+if (bHide)
 {
 // intersect bookmark range with textnode range and add the 
intersection to rHiddenMulti
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-1+backports' - sw/source sw/uiconfig

2020-06-10 Thread Serge Krot (via logerrit)
 sw/source/ui/misc/bookmark.cxx   |4 
 sw/uiconfig/swriter/ui/insertbookmark.ui |4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

New commits:
commit e4d5a57bdce67912847dacf2df113ef24c03aa8d
Author: Serge Krot 
AuthorDate: Mon Jun 8 20:13:04 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Wed Jun 10 23:51:36 2020 +0200

tdf#101856 correct Insert bookmark dialog

- left align checkbox "Hide"
- do not resize "Close" button
- place "Close" button at the bottom of the dialog

Change-Id: I57caa83edde2c377dfbf0aaacb60281e4966fbaf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95855
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96016
Tested-by: Thorsten Behrens 

diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx
index 758b85ff73e2..76f9eacae7eb 100644
--- a/sw/source/ui/misc/bookmark.cxx
+++ b/sw/source/ui/misc/bookmark.cxx
@@ -338,6 +338,10 @@ SwInsertBookmarkDlg::SwInsertBookmarkDlg(vcl::Window* 
pParent, SwWrtShell& rS, S
 m_pEditBox->SetCursorAtLast();
 
 sRemoveWarning = SwResId(STR_REMOVE_WARNING);
+
+// disabled until "Hide" flag is not checked
+m_pConditionED->Enable(false);
+m_pConditionFT->Enable(false);
 }
 
 SwInsertBookmarkDlg::~SwInsertBookmarkDlg()
diff --git a/sw/uiconfig/swriter/ui/insertbookmark.ui 
b/sw/uiconfig/swriter/ui/insertbookmark.ui
index 6079aefe7a88..81d5cac231dd 100644
--- a/sw/uiconfig/swriter/ui/insertbookmark.ui
+++ b/sw/uiconfig/swriter/ui/insertbookmark.ui
@@ -208,8 +208,8 @@
 
   
   
-True
-True
+False
+False
 5
   
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-1+backports' - sw/source

2020-06-10 Thread Serge Krot (via logerrit)
 sw/source/core/text/porlay.cxx |   24 
 1 file changed, 24 insertions(+)

New commits:
commit 60c58d5b8df00815c238c6a95978a0517751efd4
Author: Serge Krot 
AuthorDate: Mon Jun 8 12:43:53 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Wed Jun 10 23:49:52 2020 +0200

tdf#101856 evaluate condition to expand / collapse bookmarks

Change-Id: I7c135eab0feeca0ede794f6c88a2b06e339d6a14
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95795
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96015
Tested-by: Thorsten Behrens 

diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index d7dc2f10838d..92184de27fd4 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -51,9 +51,11 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
+#include 
 #include 
 
 using namespace ::com::sun::star;
@@ -2270,7 +2272,29 @@ void SwScriptInfo::selectHiddenTextProperty(const 
SwTextNode& rNode, MultiSelect
 {
 const sw::mark::IMark* pMark = pIndex->GetMark();
 const sw::mark::IBookmark* pBookmark = dynamic_cast(pMark);
+
+bool bHide = false;
 if (pBookmark && pBookmark->IsHidden())
+{
+// bookmark is marked as hidden
+bHide = true;
+
+// bookmark is marked as hidden with conditions
+if (!pBookmark->GetHideCondition().isEmpty())
+{
+SwDoc& rDoc = *const_cast(rNode.GetDoc());
+SwCalc aCalc(rDoc);
+rDoc.getIDocumentFieldsAccess().FieldsToCalc(aCalc, 
rNode.GetIndex(), USHRT_MAX);
+
+SwSbxValue aValue = 
aCalc.Calculate(pBookmark->GetHideCondition());
+if(!aValue.IsVoidValue())
+{
+bHide = aValue.GetBool();
+}
+}
+}
+
+if (bHide)
 {
 // intersect bookmark range with textnode range and add the 
intersection to rHiddenMulti
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source sw/uiconfig

2020-06-09 Thread Serge Krot (via logerrit)
 sw/source/ui/misc/bookmark.cxx   |4 
 sw/uiconfig/swriter/ui/insertbookmark.ui |7 ---
 2 files changed, 8 insertions(+), 3 deletions(-)

New commits:
commit 280c56db840b5822d0b4560f02fcd1b8ced74f90
Author: Serge Krot 
AuthorDate: Mon Jun 8 20:13:04 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Tue Jun 9 22:53:51 2020 +0200

tdf#101856 correct Insert bookmark dialog

- left align checkbox "Hide"
- do not resize "Close" button
- place "Close" button at the bottom of the dialog

Change-Id: I57caa83edde2c377dfbf0aaacb60281e4966fbaf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95855
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
(cherry picked from commit 3a371da71ab738a99e81e75c736fa5e384ebd9d3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95971

diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx
index 1c67f547558c..29f090f94ff6 100644
--- a/sw/source/ui/misc/bookmark.cxx
+++ b/sw/source/ui/misc/bookmark.cxx
@@ -343,6 +343,10 @@ SwInsertBookmarkDlg::SwInsertBookmarkDlg(weld::Window* 
pParent, SwWrtShell& rS,
 }
 
 m_bAreProtected = 
rSh.getIDocumentSettingAccess().get(DocumentSettingId::PROTECT_BOOKMARKS);
+
+// disabled until "Hide" flag is not checked
+m_xConditionED->set_sensitive(false);
+m_xConditionFT->set_sensitive(false);
 }
 
 IMPL_LINK(SwInsertBookmarkDlg, HeaderBarClick, int, nColumn, void)
diff --git a/sw/uiconfig/swriter/ui/insertbookmark.ui 
b/sw/uiconfig/swriter/ui/insertbookmark.ui
index f062451af767..8b65bfc619b9 100644
--- a/sw/uiconfig/swriter/ui/insertbookmark.ui
+++ b/sw/uiconfig/swriter/ui/insertbookmark.ui
@@ -71,9 +71,9 @@
 
   
   
-True
-True
-6
+False
+False
+7
   
 
 
@@ -145,6 +145,7 @@
 True
 False
 start
+start
 True
 True
   
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sw/source

2020-06-09 Thread Serge Krot (via logerrit)
 sw/source/core/text/porlay.cxx |   24 
 1 file changed, 24 insertions(+)

New commits:
commit dadba793c107cbf2ccadfbd7b41b6187ff06d4b8
Author: Serge Krot 
AuthorDate: Mon Jun 8 12:43:53 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Tue Jun 9 16:36:14 2020 +0200

tdf#101856 evaluate condition to expand / collapse bookmarks

Change-Id: I7c135eab0feeca0ede794f6c88a2b06e339d6a14
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95795
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 499dac050009..b9ed4ec5a393 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -48,9 +48,11 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
+#include 
 #include 
 
 using namespace ::com::sun::star;
@@ -2515,7 +2517,29 @@ void SwScriptInfo::selectHiddenTextProperty(const 
SwTextNode& rNode,
 pBookmarks->emplace_back(pBookmark, MarkKind::End);
 }
 }
+
+bool bHide = false;
 if (pBookmark && pBookmark->IsHidden())
+{
+// bookmark is marked as hidden
+bHide = true;
+
+// bookmark is marked as hidden with conditions
+if (!pBookmark->GetHideCondition().isEmpty())
+{
+SwDoc& rDoc = *const_cast(rNode.GetDoc());
+SwCalc aCalc(rDoc);
+rDoc.getIDocumentFieldsAccess().FieldsToCalc(aCalc, 
rNode.GetIndex(), USHRT_MAX);
+
+SwSbxValue aValue = 
aCalc.Calculate(pBookmark->GetHideCondition());
+if(!aValue.IsVoidValue())
+{
+bHide = aValue.GetBool();
+}
+}
+}
+
+if (bHide)
 {
 // intersect bookmark range with textnode range and add the 
intersection to rHiddenMulti
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - sc/source

2020-06-09 Thread Serge Krot (via logerrit)
 sc/source/filter/xcl97/xcl97rec.cxx |   15 +++
 1 file changed, 15 insertions(+)

New commits:
commit ed0225b36ca31bb40a20de92cd1f988f94143ad1
Author: Serge Krot 
AuthorDate: Thu Jun 4 11:14:39 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Tue Jun 9 16:33:51 2020 +0200

tdf#133595 FILESAVE XLSX: invalid content when opening file with shape

Change-Id: I67fe29bbc9b982328a3efe63874922e7ed1a5854
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95490
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
(cherry picked from commit 2081ab036bfd203d4d3be07064ef783baae97c3b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95671
Reviewed-by: Xisco Fauli 
(cherry picked from commit 23506180a82bae5c77bd1df4bef73dd4f687dae2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95880

diff --git a/sc/source/filter/xcl97/xcl97rec.cxx 
b/sc/source/filter/xcl97/xcl97rec.cxx
index 277f3157afd7..37c55e9d629c 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -277,6 +277,21 @@ void SaveDrawingMLObjects( XclExpObjList& rList, 
XclExpXmlStream& rStrm )
 
 void SaveFormControlObjects(XclExpObjList& rList, XclExpXmlStream& rStrm)
 {
+bool hasControls = false;
+for (const auto& rxObj : rList)
+{
+if (IsFormControlObject(rxObj.get()))
+{
+hasControls = true;
+break;
+}
+}
+
+if (!hasControls)
+{
+return;
+}
+
 sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();
 
 rWorksheet->startElement(FSNS(XML_mc, XML_AlternateContent),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - sw/source sw/uiconfig

2020-06-09 Thread Serge Krot (via logerrit)
 sw/source/ui/misc/bookmark.cxx   |3 +++
 sw/uiconfig/swriter/ui/insertbookmark.ui |7 ---
 2 files changed, 7 insertions(+), 3 deletions(-)

New commits:
commit ce8087a61350f1f51cf0a75a1a5698183b3e17db
Author: Serge Krot 
AuthorDate: Mon Jun 8 20:13:04 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Tue Jun 9 16:27:17 2020 +0200

tdf#101856 correct Insert bookmark dialog

- left align checkbox "Hide"
- do not resize "Close" button
- place "Close" button at the bottom of the dialog

Change-Id: I57caa83edde2c377dfbf0aaacb60281e4966fbaf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95855
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95938
Tested-by: Vasily Melenchuk 
Reviewed-by: Vasily Melenchuk 

diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx
index 3c99ab0c6848..e5be414d7bdb 100644
--- a/sw/source/ui/misc/bookmark.cxx
+++ b/sw/source/ui/misc/bookmark.cxx
@@ -344,6 +344,9 @@ SwInsertBookmarkDlg::SwInsertBookmarkDlg(weld::Window* 
pParent, SwWrtShell& rS,
 m_xConditionED->set_visible( false );
 }
 
+// disabled until "Hide" flag is not checked
+m_xConditionED->set_sensitive(false);
+m_xConditionFT->set_sensitive(false);
 }
 
 IMPL_LINK(SwInsertBookmarkDlg, HeaderBarClick, int, nColumn, void)
diff --git a/sw/uiconfig/swriter/ui/insertbookmark.ui 
b/sw/uiconfig/swriter/ui/insertbookmark.ui
index f062451af767..8b65bfc619b9 100644
--- a/sw/uiconfig/swriter/ui/insertbookmark.ui
+++ b/sw/uiconfig/swriter/ui/insertbookmark.ui
@@ -71,9 +71,9 @@
 
   
   
-True
-True
-6
+False
+False
+7
   
 
 
@@ -145,6 +145,7 @@
 True
 False
 start
+start
 True
 True
   
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sc/source

2020-06-08 Thread Serge Krot (via logerrit)
 sc/source/filter/xcl97/xcl97rec.cxx |   15 +++
 1 file changed, 15 insertions(+)

New commits:
commit 23506180a82bae5c77bd1df4bef73dd4f687dae2
Author: Serge Krot 
AuthorDate: Thu Jun 4 11:14:39 2020 +0200
Commit: Xisco Fauli 
CommitDate: Mon Jun 8 12:36:37 2020 +0200

tdf#133595 FILESAVE XLSX: invalid content when opening file with shape

Change-Id: I67fe29bbc9b982328a3efe63874922e7ed1a5854
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95490
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
(cherry picked from commit 2081ab036bfd203d4d3be07064ef783baae97c3b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95671
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/filter/xcl97/xcl97rec.cxx 
b/sc/source/filter/xcl97/xcl97rec.cxx
index 88cdd82cdcd6..503d78ad75f2 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -278,6 +278,21 @@ void SaveDrawingMLObjects( XclExpObjList& rList, 
XclExpXmlStream& rStrm )
 
 void SaveFormControlObjects(XclExpObjList& rList, XclExpXmlStream& rStrm)
 {
+bool hasControls = false;
+for (const auto& rxObj : rList)
+{
+if (IsFormControlObject(rxObj.get()))
+{
+hasControls = true;
+break;
+}
+}
+
+if (!hasControls)
+{
+return;
+}
+
 sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();
 
 rWorksheet->startElement(FSNS(XML_mc, XML_AlternateContent),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - 9 commits - compilerplugins/clang connectivity/source external/python3 extras/source include/editeng include/vcl sc/source sw/Cppunit

2020-06-06 Thread Serge Krot (via logerrit)
 compilerplugins/clang/referencecasting.cxx  |3 +++
 connectivity/source/parse/sqlflex.l |4 +++-
 external/python3/python-3.7.6-msvc-ssl.patch.1  |   15 +++
 extras/source/shellnew/soffice.odg  |binary
 extras/source/shellnew/soffice.ods  |binary
 extras/source/shellnew/soffice.odt  |binary
 include/editeng/numitem.hxx |8 ++--
 include/vcl/errinf.hxx  |1 +
 sc/source/ui/app/inputhdl.cxx   |   11 +++
 sc/source/ui/view/cellsh3.cxx   |   16 ++--
 sw/CppunitTest_sw_core_doc.mk   |1 +
 sw/qa/core/doc/data/textbox-textrotateangle.odt |binary
 sw/qa/core/doc/doc.cxx  |   22 ++
 sw/source/core/doc/number.cxx   |4 ++--
 sw/source/core/doc/textboxhelper.cxx|   14 --
 sw/source/core/unocore/unosett.cxx  |7 ---
 sw/source/filter/ww8/wrtw8num.cxx   |2 +-
 sw/source/ui/dbui/mmresultdialogs.cxx   |4 +++-
 sw/source/uibase/dbui/dbmgr.cxx |3 ++-
 toolkit/source/controls/stdtabcontroller.cxx|   16 +---
 vcl/source/window/errinf.cxx|6 ++
 winaccessibility/source/UAccCOM/MAccessible.cxx |4 
 22 files changed, 115 insertions(+), 26 deletions(-)

New commits:
commit 2631f65a9b64c86456f9083e282f7f05af82fca1
Author: Serge Krot 
AuthorDate: Fri May 22 13:20:23 2020 +0200
Commit: Michael Meeks 
CommitDate: Sat Jun 6 09:33:00 2020 +0100

tdf#133270 MAILMERGE progress is not updated during export of many files

See also https://gerrit.libreoffice.org/c/core/+/90686 for a similar
change.

Change-Id: I063394f7ef0a68c79366f09c9d2cf5775a57e640
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94663
Tested-by: Thorsten Behrens 
Reviewed-by: Thorsten Behrens 
(cherry picked from commit 80cea3682b2cf07f1685852cd8809d9db58a1cb5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95481
Reviewed-by: Michael Stahl 
Tested-by: Jenkins

diff --git a/sw/source/ui/dbui/mmresultdialogs.cxx 
b/sw/source/ui/dbui/mmresultdialogs.cxx
index 53a76b8eb2bb..9d507f204ce9 100644
--- a/sw/source/ui/dbui/mmresultdialogs.cxx
+++ b/sw/source/ui/dbui/mmresultdialogs.cxx
@@ -45,6 +45,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -664,7 +665,8 @@ IMPL_LINK_NOARG(SwMMResultSaveDialog, SaveOutputHdl_Impl, 
weld::Button&, void)
 while(true)
 {
 //time for other slots is needed
-Application::Reschedule( true );
+Scheduler::ProcessEventsToIdle();
+
 bool bFailed = false;
 try
 {
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index 0b28c048bffb..2daa67893592 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -45,6 +45,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1436,7 +1437,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell,
 //TODO xProgressDlg->queue_draw();
 }
 
-Application::Reschedule( true );
+Scheduler::ProcessEventsToIdle();
 
 // Create a copy of the source document and work with that one 
instead of the source.
 // If we're not in the single file mode (which requires 
modifying the document for the merging),
commit a3bba79435537982445d7ce0a8fa9f4c3450b49f
Author: Jan-Marek Glogowski 
AuthorDate: Fri Jan 24 13:33:37 2020 +
Commit: Michael Meeks 
CommitDate: Sat Jun 6 09:32:54 2020 +0100

python3+WIN: don't fail copy of openssl DLLs+PDBs

The LO python3 target fails for me on Windows with:
  
C:\lode\dev\core\workdir\UnpackedTarball\python3\PCBuild\openssl.props(24,5):
error MSB3030: Datei 
"C:/lode/dev/core/workdir/UnpackedTarball/openssl/out32dll\libcrypto-1_1.dll"
konnte nicht kopiert werden, da die Datei nicht gefunden wurde.
[C:\lode\dev\core\workdir\UnpackedTarball\python3\PCBuild\_ssl.vcxproj]

Same for
  "C:/lode/dev/core/workdir/UnpackedTarball/openssl/out32dll\libssl-1_1.pdb"
  
"C:/lode/dev/core/workdir/UnpackedTarball/openssl/out32dll\libcrypto-1_1.pdb"
  "C:/lode/dev/core/workdir/UnpackedTarball/openssl/out32dll\libssl-1_1.dll"

Other files were also renamed in a previous hunk of this patch.

For other people these failures are silently ignored, but they
show up in their python3 build.log. But my msbuild version
15.9.21+g9802d43bc3 from VS2017 fails hard on these errors.

So this just adapt the pdb and dll names to match the previous
renames, whic

[Libreoffice-commits] core.git: sc/source

2020-06-05 Thread Serge Krot (via logerrit)
 sc/source/filter/xcl97/xcl97rec.cxx |   15 +++
 1 file changed, 15 insertions(+)

New commits:
commit 2081ab036bfd203d4d3be07064ef783baae97c3b
Author: Serge Krot 
AuthorDate: Thu Jun 4 11:14:39 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Sat Jun 6 02:25:05 2020 +0200

tdf#133595 FILESAVE XLSX: invalid content when opening file with shape

Change-Id: I67fe29bbc9b982328a3efe63874922e7ed1a5854
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95490
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/sc/source/filter/xcl97/xcl97rec.cxx 
b/sc/source/filter/xcl97/xcl97rec.cxx
index 0580e30bbbae..4f114bbbd04f 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -278,6 +278,21 @@ void SaveDrawingMLObjects( XclExpObjList& rList, 
XclExpXmlStream& rStrm )
 
 void SaveFormControlObjects(XclExpObjList& rList, XclExpXmlStream& rStrm)
 {
+bool hasControls = false;
+for (const auto& rxObj : rList)
+{
+if (IsFormControlObject(rxObj.get()))
+{
+hasControls = true;
+break;
+}
+}
+
+if (!hasControls)
+{
+return;
+}
+
 sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();
 
 rWorksheet->startElement(FSNS(XML_mc, XML_AlternateContent),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - sw/source

2020-06-05 Thread Serge Krot (via logerrit)
 sw/source/ui/dbui/mmresultdialogs.cxx |4 +++-
 sw/source/uibase/dbui/dbmgr.cxx   |3 ++-
 2 files changed, 5 insertions(+), 2 deletions(-)

New commits:
commit ef61c49236c2bc11175fb26e55870a06b3e92f0c
Author: Serge Krot 
AuthorDate: Fri May 22 13:20:23 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Sat Jun 6 02:23:31 2020 +0200

tdf#133270 MAILMERGE progress is not updated during export of many files

See also https://gerrit.libreoffice.org/c/core/+/90686 for a similar
change.

Change-Id: I063394f7ef0a68c79366f09c9d2cf5775a57e640
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94663
Tested-by: Thorsten Behrens 
Reviewed-by: Thorsten Behrens 
(cherry picked from commit 80cea3682b2cf07f1685852cd8809d9db58a1cb5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95481
Reviewed-by: Michael Stahl 
Tested-by: Jenkins

diff --git a/sw/source/ui/dbui/mmresultdialogs.cxx 
b/sw/source/ui/dbui/mmresultdialogs.cxx
index 53a76b8eb2bb..9d507f204ce9 100644
--- a/sw/source/ui/dbui/mmresultdialogs.cxx
+++ b/sw/source/ui/dbui/mmresultdialogs.cxx
@@ -45,6 +45,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -664,7 +665,8 @@ IMPL_LINK_NOARG(SwMMResultSaveDialog, SaveOutputHdl_Impl, 
weld::Button&, void)
 while(true)
 {
 //time for other slots is needed
-Application::Reschedule( true );
+Scheduler::ProcessEventsToIdle();
+
 bool bFailed = false;
 try
 {
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index 05216c55c08b..4c4c30516b8a 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -45,6 +45,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1394,7 +1395,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell,
 //TODO xProgressDlg->queue_draw();
 }
 
-Application::Reschedule( true );
+Scheduler::ProcessEventsToIdle();
 
 // Create a copy of the source document and work with that one 
instead of the source.
 // If we're not in the single file mode (which requires 
modifying the document for the merging),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: filter/source include/oox oox/source sc/source

2020-05-25 Thread Serge Krot (via logerrit)
 filter/source/msfilter/eschesdo.cxx |   23 +-
 include/oox/token/relationship.hxx  |1 
 oox/source/token/relationship.inc   |1 
 sc/source/filter/excel/excdoc.cxx   |7 
 sc/source/filter/excel/xeescher.cxx |  351 +---
 sc/source/filter/inc/xcl97rec.hxx   |2 
 sc/source/filter/inc/xeescher.hxx   |   17 +
 sc/source/filter/xcl97/xcl97rec.cxx |   58 +
 8 files changed, 419 insertions(+), 41 deletions(-)

New commits:
commit fd238380ae7820f12ac1f7c52d0f7180a93f3ba3
Author: Serge Krot 
AuthorDate: Wed May 13 22:52:52 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Tue May 26 00:20:54 2020 +0200

tdf#106181 XLSX export: output form controls

Prepared general algorithm to ouput form controls into XLSX.
For now only CHECKBOX is supported with a possibility to
link withem to any worksheet/cell.

Change-Id: Ide8739d81ffb755aeae074c4ebecf24251383e34
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94161
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/filter/source/msfilter/eschesdo.cxx 
b/filter/source/msfilter/eschesdo.cxx
index 22f47daa15af..efe3c908b6b4 100644
--- a/filter/source/msfilter/eschesdo.cxx
+++ b/filter/source/msfilter/eschesdo.cxx
@@ -401,11 +401,16 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( 
ImplEESdrObject& rObj,
 const Reference< XPropertySet > xPropSet = rObj.mXPropSet;
 const Reference xPropInfo = xPropSet.is() ? 
xPropSet->getPropertySetInfo() : Reference();
 // This code is expected to be called only for DOCX format.
-if (xPropInfo.is() && xPropInfo->hasPropertyByName("AnchorType") 
&& bOOxmlExport)
+if (xPropInfo.is())
 {
-text::TextContentAnchorType eAnchorType;
-xPropSet->getPropertyValue("AnchorType") >>= eAnchorType;
-bool bInline = eAnchorType == 
text::TextContentAnchorType_AS_CHARACTER;
+bool bInline = false;
+if (xPropInfo->hasPropertyByName("AnchorType"))
+{
+text::TextContentAnchorType eAnchorType;
+xPropSet->getPropertyValue("AnchorType") >>= eAnchorType;
+bInline = eAnchorType == 
text::TextContentAnchorType_AS_CHARACTER;
+}
+
 mpEscherEx->OpenContainer( ESCHER_SpContainer );
 if(bInline)
 {
@@ -812,20 +817,14 @@ void ImplEESdrWriter::ImplWritePage(
 {
 ImplInitPageValues();
 
-sal_uInt32 nLastPer = 0, nShapes = mXShapes->getCount();
+const sal_uInt32 nShapes = mXShapes->getCount();
 for( sal_uInt32 n = 0; n < nShapes; ++n )
 {
-sal_uInt32 nPer = ( 5 * n ) / nShapes;
-if( nPer != nLastPer )
-{
-nLastPer = nPer;
-}
-
 ImplEESdrObject aObj( *this, *o3tl::doAccess>(
 mXShapes->getByIndex( n )) );
 if( aObj.IsValid() )
 {
-ImplWriteShape( aObj, rSolverContainer );
+ImplWriteShape( aObj, rSolverContainer, true );
 }
 }
 }
diff --git a/include/oox/token/relationship.hxx 
b/include/oox/token/relationship.hxx
index ae1580bf2bc5..adc25f4a73b6 100644
--- a/include/oox/token/relationship.hxx
+++ b/include/oox/token/relationship.hxx
@@ -23,6 +23,7 @@ enum class Relationship
 COMMENTS,
 COMMENTAUTHORS,
 CONTROL,
+CTRLPROP,
 CUSTOMXML,
 CUSTOMXMLPROPS,
 DIAGRAMCOLORS,
diff --git a/oox/source/token/relationship.inc 
b/oox/source/token/relationship.inc
index 9b163038b169..2b973ded1653 100644
--- a/oox/source/token/relationship.inc
+++ b/oox/source/token/relationship.inc
@@ -3,6 +3,7 @@
 {Relationship::COMMENTS, 
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments"},
 {Relationship::COMMENTAUTHORS, 
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/commentAuthors"},
 {Relationship::CONTROL, 
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/control"},
+{Relationship::CTRLPROP, 
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/ctrlProp"},
 {Relationship::CUSTOMXML, 
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml"},
 {Relationship::CUSTOMXMLPROPS, 
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps"},
 {Relationship::DIAGRAMCOLORS, 
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramColors"},
diff --git a/sc/source/filter/excel/excdoc.cxx 
b/sc/source/filter/excel/excdoc.cxx
index c1e67ffeaf5b..4eb91066b865 100644
--- a/sc/source/filter/excel/excdoc.cxx
+++ b/sc/source/filter/excel/excdoc.cxx
@@ -689,8 +689,11 @@ void ExcTable::WriteXml( XclExpXmlStream

[Libreoffice-commits] core.git: sw/source

2020-05-23 Thread Serge Krot (via logerrit)
 sw/source/ui/dbui/mmresultdialogs.cxx |4 +++-
 sw/source/uibase/dbui/dbmgr.cxx   |3 ++-
 2 files changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 80cea3682b2cf07f1685852cd8809d9db58a1cb5
Author: Serge Krot 
AuthorDate: Fri May 22 13:20:23 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Sat May 23 16:45:16 2020 +0200

tdf#133270 MAILMERGE progress is not updated during export of many files

See also https://gerrit.libreoffice.org/c/core/+/90686 for a similar
change.

Change-Id: I063394f7ef0a68c79366f09c9d2cf5775a57e640
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94663
Tested-by: Thorsten Behrens 
Reviewed-by: Thorsten Behrens 

diff --git a/sw/source/ui/dbui/mmresultdialogs.cxx 
b/sw/source/ui/dbui/mmresultdialogs.cxx
index e9dcc0b93a1b..2702afde2b17 100644
--- a/sw/source/ui/dbui/mmresultdialogs.cxx
+++ b/sw/source/ui/dbui/mmresultdialogs.cxx
@@ -41,6 +41,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -668,7 +669,8 @@ IMPL_LINK_NOARG(SwMMResultSaveDialog, SaveOutputHdl_Impl, 
weld::Button&, void)
 while(true)
 {
 //time for other slots is needed
-Application::Reschedule( true );
+Scheduler::ProcessEventsToIdle();
+
 bool bFailed = false;
 try
 {
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index 282f726996aa..01da353a78a3 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -43,6 +43,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1380,7 +1381,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell,
 //TODO xProgressDlg->queue_draw();
 }
 
-Application::Reschedule( true );
+Scheduler::ProcessEventsToIdle();
 
 // Create a copy of the source document and work with that one 
instead of the source.
 // If we're not in the single file mode (which requires 
modifying the document for the merging),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - officecfg/registry sc/qa sc/source

2020-05-08 Thread Serge Krot (via logerrit)
 officecfg/registry/schema/org/openoffice/Office/Calc.xcs |   17 +
 sc/qa/unit/data/ods/tdf79998.ods |binary
 sc/qa/unit/filters-test.cxx  |   20 ++
 sc/source/filter/excel/xestream.cxx  |  129 +++
 sc/source/filter/inc/xestream.hxx|5 
 5 files changed, 171 insertions(+)

New commits:
commit e9124ef7cadd36329d8a5bc1cc8c3a4706e26582
Author: Serge Krot 
AuthorDate: Thu Apr 16 15:42:33 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Sat May 9 00:18:55 2020 +0200

tdf#79998 FILESAVE: XLSX export with long sheet names (length > 31 
characters)

Change-Id: If18e3b751486144f3477b6e0c2615751f57e5565
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92372
Tested-by: Jenkins
Reviewed-by: Eike Rathke 
(cherry picked from commit 6b75874386b7b1ec44f7acc49cd3556a56108ed8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93539
Reviewed-by: Thorsten Behrens 

diff --git a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
index 1517514c903d..c02a76d45315 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
@@ -1830,6 +1830,23 @@
   
 
   
+  
+
+  Contains settings for export filters.
+
+
+  
+Contains settings for MS Excel export.
+  
+  
+
+  Indicates whether sheet names should be truncated to 31 
characters.
+  Truncate long sheet names
+
+true
+  
+
+  
 
 
   
diff --git a/sc/qa/unit/data/ods/tdf79998.ods b/sc/qa/unit/data/ods/tdf79998.ods
new file mode 100644
index ..201cca140585
Binary files /dev/null and b/sc/qa/unit/data/ods/tdf79998.ods differ
diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx
index dc097180cbbd..43c3483bb281 100644
--- a/sc/qa/unit/filters-test.cxx
+++ b/sc/qa/unit/filters-test.cxx
@@ -70,6 +70,7 @@ public:
 void testSharedFormulaXLSX();
 void testSharedFormulaRefUpdateXLSX();
 void testSheetNamesXLSX();
+void testTdf79998();
 void testLegacyCellAnchoredRotatedShape();
 void testEnhancedProtectionXLS();
 void testEnhancedProtectionXLSX();
@@ -96,6 +97,7 @@ public:
 CPPUNIT_TEST(testSharedFormulaXLSX);
 CPPUNIT_TEST(testSharedFormulaRefUpdateXLSX);
 CPPUNIT_TEST(testSheetNamesXLSX);
+CPPUNIT_TEST(testTdf79998);
 CPPUNIT_TEST(testLegacyCellAnchoredRotatedShape);
 CPPUNIT_TEST(testEnhancedProtectionXLS);
 CPPUNIT_TEST(testEnhancedProtectionXLSX);
@@ -468,6 +470,24 @@ void ScFiltersTest::testSheetNamesXLSX()
 xDocSh->DoClose();
 }
 
+// FILESAVE: XLSX export with long sheet names (length > 31 characters)
+void ScFiltersTest::testTdf79998()
+{
+// check: original document has tab name > 31 characters
+ScDocShellRef xDocSh = loadDoc("tdf79998.", FORMAT_ODS);
+ScDocument& rDoc1 = xDocSh->GetDocument();
+const std::vector aTabNames1 = rDoc1.GetAllTableNames();
+CPPUNIT_ASSERT_EQUAL(OUString("Utilities (FX Kurse, Kreditkarten etc)"), 
aTabNames1[1]);
+
+// check: saved XLSX document has truncated tab name
+xDocSh = saveAndReload( &(*xDocSh), FORMAT_XLSX);
+ScDocument& rDoc2 = xDocSh->GetDocument();
+const std::vector aTabNames2 = rDoc2.GetAllTableNames();
+CPPUNIT_ASSERT_EQUAL(OUString("Utilities (FX Kurse, Kreditkart"), 
aTabNames2[1]);
+
+xDocSh->DoClose();
+}
+
 static void impl_testLegacyCellAnchoredRotatedShape( ScDocument& rDoc, const 
tools::Rectangle& aRect, const ScDrawObjData& aAnchor, long TOLERANCE = 30 /* 
30 hmm */ )
 {
 ScDrawLayer* pDrawLayer = rDoc.GetDrawLayer();
diff --git a/sc/source/filter/excel/xestream.cxx 
b/sc/source/filter/excel/xestream.cxx
index 6b1e29a79a66..968a057f9f58 100644
--- a/sc/source/filter/excel/xestream.cxx
+++ b/sc/source/filter/excel/xestream.cxx
@@ -32,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -49,6 +50,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -1002,6 +1004,13 @@ bool XclExpXmlStream::exportDocument()
 ScDocument& rDoc = pShell->GetDocument();
 ScRefreshTimerProtector aProt(rDoc.GetRefreshTimerControlAddress());
 
+const bool bValidateTabNames = 
officecfg::Office::Calc::Filter::Export::MS_Excel::TruncateLongSheetNames::get();
+std::vector aOriginalTabNames;
+if (bValidateTabNames)
+{
+validateTabNames(aOriginalTabNames);
+}
+
 uno::Reference xStatusIndicator = 
getStatusIndicator();
 
 if (xStatusIndicator.is())
@@ -1103,6 +1112,11 @@ bool XclExpXmlStream::exportDocument()
 
 commitStorage();
 
+if (bValidateTabNames)
+{

[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-1+backports' - svx/source

2020-04-27 Thread Serge Krot (via logerrit)
 svx/source/accessibility/AccessibleShape.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d046a2cf14efe107db60050dc28667a5f78741f4
Author: Serge Krot 
AuthorDate: Wed Jan 8 21:18:20 2020 +0100
Commit: Thorsten Behrens 
CommitDate: Tue Apr 28 01:10:48 2020 +0200

tdf#129887: fix crash during scrolling down document

regression from tdf#129708

Change-Id: I6c5d7eb90030234e899ab8ce5b3adec33e03962a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86454
Reviewed-by: Julien Nabet 
Tested-by: Thorsten Behrens 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92651
Reviewed-by: Thorsten Behrens 

diff --git a/svx/source/accessibility/AccessibleShape.cxx 
b/svx/source/accessibility/AccessibleShape.cxx
index 2d09f0f4db18..b67f4062722e 100644
--- a/svx/source/accessibility/AccessibleShape.cxx
+++ b/svx/source/accessibility/AccessibleShape.cxx
@@ -158,7 +158,7 @@ void AccessibleShape::Init()
 if( pSdrObject )
 {
 SdrTextObj* pTextObj = dynamic_cast( pSdrObject  
);
-const bool hasOutlinerParaObject = 
pTextObj->CanCreateEditOutlinerParaObject() || 
pSdrObject->GetOutlinerParaObject() != nullptr;
+const bool hasOutlinerParaObject = (pTextObj && 
pTextObj->CanCreateEditOutlinerParaObject()) || 
(pSdrObject->GetOutlinerParaObject() != nullptr);
 
 // create AccessibleTextHelper to handle this shape's text
 if( !hasOutlinerParaObject )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-1+backports' - include/svx oox/source sd/source svx/source sw/source

2020-04-27 Thread Serge Krot (via logerrit)
 include/svx/svdotext.hxx   |3 +-
 oox/source/export/drawingml.cxx|2 -
 oox/source/export/vmlexport.cxx|2 -
 sd/source/ui/slidesorter/controller/SlsSlotManager.cxx |4 ---
 sd/source/ui/unoidl/unoobj.cxx |3 --
 sd/source/ui/view/drviews7.cxx |4 ---
 sd/source/ui/view/outlnvsh.cxx |4 ---
 svx/source/accessibility/AccessibleShape.cxx   |   15 +---
 svx/source/inc/cell.hxx|3 +-
 svx/source/sdr/primitive2d/sdrattributecreator.cxx |5 +---
 svx/source/svdraw/svdotext.cxx |   15 +---
 svx/source/table/accessiblecell.cxx|   12 -
 svx/source/table/cell.cxx  |   21 ++---
 svx/source/table/tablertfexporter.cxx  |2 -
 svx/source/unodraw/unoshtxt.cxx|   19 ++-
 sw/source/filter/ww8/rtfsdrexport.cxx  |2 -
 sw/source/filter/ww8/wrtw8esh.cxx  |2 -
 17 files changed, 61 insertions(+), 57 deletions(-)

New commits:
commit c075add8c86d11baba63a13c637b5b1a5a886283
Author: Serge Krot 
AuthorDate: Fri Jan 3 20:08:45 2020 +0100
Commit: Thorsten Behrens 
CommitDate: Tue Apr 28 01:10:04 2020 +0200

tdf#129708 speed-up: check if we could create outline instead of creation 
of it

Conflicts:
include/svx/svdotext.hxx
oox/source/export/drawingml.cxx
oox/source/export/vmlexport.cxx
sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
sd/source/ui/view/drviews7.cxx
sd/source/ui/view/outlnvsh.cxx
svx/source/accessibility/AccessibleShape.cxx
svx/source/inc/cell.hxx
svx/source/sdr/primitive2d/sdrattributecreator.cxx
svx/source/svdraw/svdotext.cxx
svx/source/table/accessiblecell.cxx
svx/source/table/cell.cxx
svx/source/table/tablertfexporter.cxx
svx/source/unodraw/unoshtxt.cxx
sw/source/filter/ww8/rtfsdrexport.cxx
sw/source/filter/ww8/wrtw8esh.cxx

Change-Id: I0629b4e6ccae4ab9be0142fe39c627f2f9a8f5ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86199
Reviewed-by: Noel Grandin 
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92650
Tested-by: Thorsten Behrens 

diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx
index 7be26b52d40f..8fccc05978c8 100644
--- a/include/svx/svdotext.hxx
+++ b/include/svx/svdotext.hxx
@@ -491,7 +491,8 @@ public:
 virtual void NbcSetOutlinerParaObject(OutlinerParaObject* pTextObject) 
override;
 void NbcSetOutlinerParaObjectForText( OutlinerParaObject* pTextObject, 
SdrText* pText );
 virtual OutlinerParaObject* GetOutlinerParaObject() const override;
-OutlinerParaObject* GetEditOutlinerParaObject() const;
+bool CanCreateEditOutlinerParaObject() const;
+std::unique_ptr CreateEditOutlinerParaObject() const;
 
 virtual void NbcReformatText() override;
 virtual void ReformatText() override;
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 943d5aed9add..b6249f535aa9 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -2490,7 +2490,7 @@ void DrawingML::WriteText( const Reference< XInterface >& 
rXIface, const OUStrin
 */
 if (pTxtObj->IsTextEditActive())
 {
-pParaObj = pTxtObj->GetEditOutlinerParaObject();
+pParaObj = pTxtObj->CreateEditOutlinerParaObject().release();
 bOwnParaObj = true;
 }
 else
diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx
index 2ec6992381a6..c3078b6cd983 100644
--- a/oox/source/export/vmlexport.cxx
+++ b/oox/source/export/vmlexport.cxx
@@ -1346,7 +1346,7 @@ sal_Int32 VMLExport::StartShape()
 */
 if (pTxtObj->IsTextEditActive())
 {
-pParaObj = pTxtObj->GetEditOutlinerParaObject();
+pParaObj = pTxtObj->CreateEditOutlinerParaObject().release();
 bOwnParaObj = true;
 }
 else
diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx 
b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
index 18b9b01b24cc..0c996d8dedf8 100644
--- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
@@ -560,10 +560,8 @@ void SlotManager::GetMenuState (SfxItemSet& rSet)
 SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( 
pObj );
 if( pTextObj )
 {
-OutlinerParaObject* pParaObj 

[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-1+backports' - editeng/source sd/inc sd/source

2020-04-27 Thread Serge Krot (via logerrit)
 editeng/source/uno/unotext2.cxx  |   57 ++--
 sd/inc/CustomAnimationEffect.hxx |4 
 sd/source/core/CustomAnimationEffect.cxx |  146 ++-
 3 files changed, 139 insertions(+), 68 deletions(-)

New commits:
commit 6d9cc6bf2fc9226f9cd0febdf8720fb8a02ae6df
Author: Serge Krot 
AuthorDate: Thu Jan 2 12:24:27 2020 +0100
Commit: Thorsten Behrens 
CommitDate: Tue Apr 28 01:06:14 2020 +0200

tdf#129708 speed-up: reuse enumeration for each effect

Conflicts:
editeng/source/uno/unotext2.cxx
sd/source/core/CustomAnimationEffect.cxx

Change-Id: I336278c5a9eec75a2a71fe4d04d2029a5a08e6a7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86102
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92649
Tested-by: Thorsten Behrens 

diff --git a/editeng/source/uno/unotext2.cxx b/editeng/source/uno/unotext2.cxx
index 43d803c3d340..45f57c4ccd9f 100644
--- a/editeng/source/uno/unotext2.cxx
+++ b/editeng/source/uno/unotext2.cxx
@@ -46,40 +46,41 @@ SvxUnoTextContentEnumeration::SvxUnoTextContentEnumeration( 
const SvxUnoTextBase
 if( mrText.GetEditSource() )
 mpEditSource = mrText.GetEditSource()->Clone();
 mnNextParagraph = 0;
-for( sal_Int32 currentPara = 0; currentPara < 
mrText.GetEditSource()->GetTextForwarder()->GetParagraphCount(); currentPara++ )
+
+const SvxTextForwarder* pTextForwarder = 
mrText.GetEditSource()->GetTextForwarder();
+const sal_Int32 maxParaIndex = std::min( rSel.nEndPara + 1, 
pTextForwarder->GetParagraphCount() );
+
+for( sal_Int32 currentPara = rSel.nStartPara; currentPara < maxParaIndex; 
currentPara++ )
 {
-if( currentPara>=rSel.nStartPara && currentPara<=rSel.nEndPara )
+const SvxUnoTextRangeBaseVec& rRanges( mpEditSource->getRanges() );
+SvxUnoTextContent* pContent = nullptr;
+sal_Int32 nStartPos = 0;
+sal_Int32 nEndPos = pTextForwarder->GetTextLen( currentPara );
+if( currentPara == rSel.nStartPara )
+nStartPos = std::max(nStartPos, rSel.nStartPos);
+if( currentPara == rSel.nEndPara )
+nEndPos = std::min(nEndPos, rSel.nEndPos);
+ESelection aCurrentParaSel( currentPara, nStartPos, currentPara, 
nEndPos );
+for (auto const& elemRange : rRanges)
 {
-const SvxUnoTextRangeBaseVec& rRanges( mpEditSource->getRanges() );
-SvxUnoTextContent* pContent = nullptr;
-sal_Int32 nStartPos = 0;
-sal_Int32 nEndPos = 
mrText.GetEditSource()->GetTextForwarder()->GetTextLen( currentPara );
-if( currentPara == rSel.nStartPara )
-nStartPos = std::max(nStartPos, rSel.nStartPos);
-if( currentPara == rSel.nEndPara )
-nEndPos = std::min(nEndPos, rSel.nEndPos);
-ESelection aCurrentParaSel = ESelection( currentPara, nStartPos, 
currentPara, nEndPos );
-for (auto const& elemRange : rRanges)
+if (pContent)
+break;
+SvxUnoTextContent* pIterContent = dynamic_cast< SvxUnoTextContent* 
>( elemRange );
+if( pIterContent && (pIterContent->mnParagraph == currentPara) )
 {
-if (pContent)
-break;
-SvxUnoTextContent* pIterContent = dynamic_cast< 
SvxUnoTextContent* >( elemRange );
-if( pIterContent && (pIterContent->mnParagraph == currentPara) 
)
+ESelection aIterSel = pIterContent->GetSelection();
+if( aIterSel == aCurrentParaSel )
 {
-ESelection aIterSel = pIterContent->GetSelection();
-if( aIterSel == aCurrentParaSel )
-{
-pContent = pIterContent;
-maContents.emplace_back(pContent );
-}
+pContent = pIterContent;
+maContents.emplace_back(pContent );
 }
 }
-if( pContent == nullptr )
-{
-pContent = new SvxUnoTextContent( mrText, currentPara );
-pContent->SetSelection( aCurrentParaSel );
-maContents.emplace_back(pContent );
-}
+}
+if( pContent == nullptr )
+{
+pContent = new SvxUnoTextContent( mrText, currentPara );
+pContent->SetSelection( aCurrentParaSel );
+maContents.emplace_back(pContent );
 }
 }
 }
diff --git a/sd/inc/CustomAnimationEffect.hxx b/sd/inc/CustomAnimationEffect.hxx
index 91dc355b8cc7..d878175cb445 100644
--- a/sd/inc/CustomAnimationEffect.hxx
+++ b/sd/inc/CustomAnimationEffect.hxx
@@ -143,7 +143,7 @@ public:
 SAL_DLLPRIVATE OUString get

[Libreoffice-commits] core.git: oox/source sd/qa

2020-04-20 Thread Serge Krot (via logerrit)
 oox/source/ppt/pptshape.cxx |  125 +++-
 sd/qa/unit/data/pptx/tdf119187.pptx |binary
 sd/qa/unit/import-tests.cxx |   27 +++
 3 files changed, 108 insertions(+), 44 deletions(-)

New commits:
commit 912217285b3058efa54c2336f91fda4efdad6ff0
Author: Serge Krot 
AuthorDate: Fri Apr 10 20:08:37 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Mon Apr 20 22:17:42 2020 +0200

tdf#119187 fix: Top-aligned text in PPTX becomes bottom-aligned

Change-Id: Ic6c03e512ce3f6e240d86186fb16e24c86942343
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92051
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx
index 335e37335879..a781aa5e4a6e 100644
--- a/oox/source/ppt/pptshape.cxx
+++ b/oox/source/ppt/pptshape.cxx
@@ -425,65 +425,102 @@ namespace
 oox::drawingml::ShapePtr PPTShape::findPlaceholder( sal_Int32 nFirstSubType, 
sal_Int32 nSecondSubType,
 const OptValue< sal_Int32 >& oSubTypeIndex, std::vector< 
oox::drawingml::ShapePtr >& rShapes, bool bMasterOnly )
 {
-oox::drawingml::ShapePtr aShapePtr;
-oox::drawingml::ShapePtr aChoiceShapePtr1;
-oox::drawingml::ShapePtr aChoiceShapePtr2;
-oox::drawingml::ShapePtr aChoiceShapePtr3;
-oox::drawingml::ShapePtr aChoiceShapePtr4;
-std::vector< oox::drawingml::ShapePtr >::reverse_iterator aRevIter( 
rShapes.rbegin() );
-while (aRevIter != rShapes.rend())
+class Placeholders
 {
-if (!bMasterOnly || ShapeLocationIsMaster((*aRevIter).get()))
+public:
+Placeholders()
+: aChoice(5) // resize to 5
 {
-if ((*aRevIter)->getSubTypeIndex() == oSubTypeIndex)
+}
+
+void add(const oox::drawingml::ShapePtr& aShape, sal_Int32 
nFirstSubType, sal_Int32 nSecondSubType, const OptValue< sal_Int32 >& 
oSubTypeIndex)
+{
+if (!aShape.get())
+return;
+
+// get flags
+const bool bSameFirstSubType = aShape->getSubType() == 
nFirstSubType;
+const bool bSameSecondSubType = aShape->getSubType() == 
nSecondSubType;
+const bool bSameIndex = aShape->getSubTypeIndex() == oSubTypeIndex;
+
+// get prio
+int aPrioIndex = -1;
+if (bSameIndex && bSameFirstSubType)
+aPrioIndex = 0;
+else if (!bSameIndex && bSameFirstSubType)
+aPrioIndex = 1;
+else if (bSameIndex && bSameSecondSubType)
+aPrioIndex = 2;
+else if (!bSameIndex && bSameSecondSubType)
+aPrioIndex = 3;
+else if (bSameIndex)
+aPrioIndex = 4;
+
+// add
+if (aPrioIndex != -1)
 {
-if ((*aRevIter)->getSubType() == nFirstSubType)
+if (!aChoice.at(aPrioIndex).get())
 {
-aShapePtr = *aRevIter;
-break;
+aChoice.at(aPrioIndex) = aShape;
 }
-else if ((*aRevIter)->getSubType() == nSecondSubType && 
!aChoiceShapePtr2.get())
-aChoiceShapePtr2 = *aRevIter;
-else if (!aChoiceShapePtr4.get())
-aChoiceShapePtr4 = *aRevIter;
 }
-else if ((*aRevIter)->getSubType() == nFirstSubType && 
!aChoiceShapePtr1.get())
-aChoiceShapePtr1 = *aRevIter;
-else if ((*aRevIter)->getSubType() == nSecondSubType && 
!aChoiceShapePtr3.get())
-aChoiceShapePtr3 = *aRevIter;
 }
-std::vector< oox::drawingml::ShapePtr >& rChildren = 
(*aRevIter)->getChildren();
-aChoiceShapePtr4 = findPlaceholder( nFirstSubType, nSecondSubType, 
oSubTypeIndex, rChildren, bMasterOnly );
-if (aChoiceShapePtr4.get())
+
+// return according to prio
+oox::drawingml::ShapePtr getByPrio() const
 {
-if (aChoiceShapePtr4->getSubType() == nFirstSubType)
+for (const oox::drawingml::ShapePtr& aShape : aChoice)
 {
-if (aChoiceShapePtr4->getSubTypeIndex() == oSubTypeIndex)
-aShapePtr = aChoiceShapePtr4;
-else
-aChoiceShapePtr1 = aChoiceShapePtr4;
+if (aShape.get())
+{
+return aShape;
+}
 }
-else if (aChoiceShapePtr4->getSubType() == nSecondSubType)
+
+return oox::drawingml::ShapePtr();
+}
+
+bool hasByPrio(size_t aIndex) const
+{
+return aChoice.at(aIndex).get();
+}
+
+private:
+std::vector< oox::drawingml::ShapePtr > aChoice;
+
+} aPlaceholders;
+
+  

[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - sw/source

2020-04-04 Thread Serge Krot (via logerrit)
 sw/source/core/layout/paintfrm.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 27b775647e8fd557d5581b6416f3f35f5ae02b4d
Author: Serge Krot 
AuthorDate: Wed Apr 1 21:08:29 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Sun Apr 5 00:23:52 2020 +0200

tdf#131004 fix unstable paint of writer consecutive section frames

Change-Id: I565129dcd077ddbfccedb37dfbf1b9e1acf4eb95
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91532
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
(cherry picked from commit 8666dfecbaac69b9dc9a9c23a05654d847608907)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91521

diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index 1ca2e28d858e..60b25866d073 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -836,8 +836,8 @@ void SwSubsRects::RemoveSuperfluousSubsidiaryLines( const 
SwLineRects , S
 
 void SwLineRects::LockLines( bool bLock )
 {
-for (iterator it = aLineRects.begin(); it != aLineRects.end(); ++it)
-   (*it).Lock( bLock );
+for (SwLineRect& rLRect : aLineRects)
+   rLRect.Lock( bLock );
 }
 
 static void lcl_DrawDashedRect( OutputDevice * pOut, SwLineRect const & rLRect 
)
@@ -1016,7 +1016,7 @@ void SwSubsRects::PaintSubsidiary( OutputDevice *pOut,
  ((nLi < rLk.Left() && nLi+21 > rLk.Left()) ||
   (nLk < rLi.Left() && nLk+21 > rLi.Left(
 {
-aLineRects.erase(aLineRects.begin() + k);
+aLineRects.erase(aLineRects.begin() + i);
 // don't continue with inner loop any more:
 // the array may shrink!
 --i;
@@ -1031,7 +1031,7 @@ void SwSubsRects::PaintSubsidiary( OutputDevice *pOut,
  ((nLi < rLk.Top() && nLi+21 > rLk.Top()) ||
   (nLk < rLi.Top() && nLk+21 > rLi.Top(
 {
-aLineRects.erase(aLineRects.begin() + k);
+aLineRects.erase(aLineRects.begin() + i);
 // don't continue with inner loop any more:
 // the array may shrink!
 --i;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sw/source

2020-04-03 Thread Serge Krot (via logerrit)
 sw/source/core/layout/paintfrm.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 8666dfecbaac69b9dc9a9c23a05654d847608907
Author: Serge Krot 
AuthorDate: Wed Apr 1 21:08:29 2020 +0200
Commit: Thorsten Behrens 
CommitDate: Fri Apr 3 11:11:23 2020 +0200

tdf#131004 fix unstable paint of writer consecutive section frames

Change-Id: I565129dcd077ddbfccedb37dfbf1b9e1acf4eb95
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91532
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index 2f7f4e4d4dc3..ec99cacfd9f6 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -853,8 +853,8 @@ void SwSubsRects::RemoveSuperfluousSubsidiaryLines( const 
SwLineRects , S
 
 void SwLineRects::LockLines( bool bLock )
 {
-for (iterator it = aLineRects.begin(); it != aLineRects.end(); ++it)
-   (*it).Lock( bLock );
+for (SwLineRect& rLRect : aLineRects)
+   rLRect.Lock( bLock );
 }
 
 static void lcl_DrawDashedRect( OutputDevice * pOut, SwLineRect const & rLRect 
)
@@ -1033,7 +1033,7 @@ void SwSubsRects::PaintSubsidiary( OutputDevice *pOut,
  ((nLi < rLk.Left() && nLi+21 > rLk.Left()) ||
   (nLk < rLi.Left() && nLk+21 > rLi.Left(
 {
-aLineRects.erase(aLineRects.begin() + k);
+aLineRects.erase(aLineRects.begin() + i);
 // don't continue with inner loop any more:
 // the array may shrink!
 --i;
@@ -1048,7 +1048,7 @@ void SwSubsRects::PaintSubsidiary( OutputDevice *pOut,
  ((nLi < rLk.Top() && nLi+21 > rLk.Top()) ||
   (nLk < rLi.Top() && nLk+21 > rLi.Top(
 {
-aLineRects.erase(aLineRects.begin() + k);
+aLineRects.erase(aLineRects.begin() + i);
 // don't continue with inner loop any more:
 // the array may shrink!
 --i;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - embeddedobj/source

2020-03-10 Thread Serge Krot (via logerrit)
 embeddedobj/source/commonembedding/embedobj.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit b5762d877423579a483fc531597597a3204cc730
Author: Serge Krot 
AuthorDate: Thu Mar 5 10:59:35 2020 +0100
Commit: Thorsten Behrens 
CommitDate: Wed Mar 11 00:57:33 2020 +0100

tdf#131146 Linked Calc: changes are lost in last edited cell

Change-Id: I768ccc1d98a0785806986a6ffc70de057991e08a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90009
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
(cherry picked from commit a91e19e30833c2743c1c2ce010a2d0f06aad7706)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90039

diff --git a/embeddedobj/source/commonembedding/embedobj.cxx 
b/embeddedobj/source/commonembedding/embedobj.cxx
index 641253008580..e6e5bec2a316 100644
--- a/embeddedobj/source/commonembedding/embedobj.cxx
+++ b/embeddedobj/source/commonembedding/embedobj.cxx
@@ -91,6 +91,10 @@ void OCommonEmbeddedObject::Deactivate()
 if ( !xClientSite.is() )
 throw embed::WrongStateException(); //TODO: client site is not set!
 
+// tdf#131146 close frame before saving of the document
+// (during CloseFrame() call some changes could be detected not registered 
in util::XModifiable)
+m_xDocHolder->CloseFrame();
+
 // store document if it is modified
 if ( xModif.is() && xModif->isModified() )
 {
@@ -110,8 +114,6 @@ void OCommonEmbeddedObject::Deactivate()
 }
 }
 
-m_xDocHolder->CloseFrame();
-
 xClientSite->visibilityChanged( false );
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: embeddedobj/source

2020-03-06 Thread Serge Krot (via logerrit)
 embeddedobj/source/commonembedding/embedobj.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit a91e19e30833c2743c1c2ce010a2d0f06aad7706
Author: Serge Krot 
AuthorDate: Thu Mar 5 10:59:35 2020 +0100
Commit: Thorsten Behrens 
CommitDate: Fri Mar 6 16:26:14 2020 +0100

tdf#131146 Linked Calc: changes are lost in last edited cell

Change-Id: I768ccc1d98a0785806986a6ffc70de057991e08a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90009
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/embeddedobj/source/commonembedding/embedobj.cxx 
b/embeddedobj/source/commonembedding/embedobj.cxx
index 641253008580..e6e5bec2a316 100644
--- a/embeddedobj/source/commonembedding/embedobj.cxx
+++ b/embeddedobj/source/commonembedding/embedobj.cxx
@@ -91,6 +91,10 @@ void OCommonEmbeddedObject::Deactivate()
 if ( !xClientSite.is() )
 throw embed::WrongStateException(); //TODO: client site is not set!
 
+// tdf#131146 close frame before saving of the document
+// (during CloseFrame() call some changes could be detected not registered 
in util::XModifiable)
+m_xDocHolder->CloseFrame();
+
 // store document if it is modified
 if ( xModif.is() && xModif->isModified() )
 {
@@ -110,8 +114,6 @@ void OCommonEmbeddedObject::Deactivate()
 }
 }
 
-m_xDocHolder->CloseFrame();
-
 xClientSite->visibilityChanged( false );
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - sw/source

2020-03-02 Thread Serge Krot (via logerrit)
 sw/source/core/frmedt/feflyole.cxx |   16 
 1 file changed, 16 insertions(+)

New commits:
commit b221b09739616a3776800b9784f82ec6b747a0dc
Author: Serge Krot 
AuthorDate: Wed Feb 26 08:41:32 2020 +0100
Commit: Thorsten Behrens 
CommitDate: Tue Mar 3 00:51:26 2020 +0100

tdf#130945 Writer: Preview of linked doc is not updated when edited

Change-Id: Id8ee653cc9cb5dbcb3ad0a31688a0b5e34d99fff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89499
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
(cherry picked from commit 53735aeb937d7f2c1ac5bc0227e4a2fdc24e4947)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89793

diff --git a/sw/source/core/frmedt/feflyole.cxx 
b/sw/source/core/frmedt/feflyole.cxx
index 0bb75aa65845..aff51cb586b0 100644
--- a/sw/source/core/frmedt/feflyole.cxx
+++ b/sw/source/core/frmedt/feflyole.cxx
@@ -37,6 +37,9 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 using namespace com::sun::star;
 
@@ -111,8 +114,21 @@ bool SwFEShell::FinishOLEObj()  // 
Server is terminated
 IsCheckForOLEInCaption() )
 SetCheckForOLEInCaption( !IsCheckForOLEInCaption() );
 
+// enable update of the link preview
+comphelper::EmbeddedObjectContainer& rEmbeddedObjectContainer = 
GetDoc()->GetDocShell()->getEmbeddedObjectContainer();
+const bool aUserAllowsLinkUpdate = 
rEmbeddedObjectContainer.getUserAllowsLinkUpdate();
+rEmbeddedObjectContainer.setUserAllowsLinkUpdate(true);
+
 // leave UIActive state
 pIPClient->DeactivateObject();
+
+// if we have more than one link let's update them too
+sfx2::LinkManager& rLinkManager = 
GetDoc()->getIDocumentLinksAdministration().GetLinkManager();
+if (rLinkManager.GetLinks().size() > 1)
+rLinkManager.UpdateAllLinks(false, false, nullptr);
+
+// return back original value of the "update of the link preview" flag
+
rEmbeddedObjectContainer.setUserAllowsLinkUpdate(aUserAllowsLinkUpdate);
 }
 return bRet;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sw/source

2020-03-01 Thread Serge Krot (via logerrit)
 sw/source/core/frmedt/feflyole.cxx |   16 
 1 file changed, 16 insertions(+)

New commits:
commit 53735aeb937d7f2c1ac5bc0227e4a2fdc24e4947
Author: Serge Krot 
AuthorDate: Wed Feb 26 08:41:32 2020 +0100
Commit: Thorsten Behrens 
CommitDate: Mon Mar 2 01:39:11 2020 +0100

tdf#130945 Writer: Preview of linked doc is not updated when edited

Change-Id: Id8ee653cc9cb5dbcb3ad0a31688a0b5e34d99fff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89499
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/sw/source/core/frmedt/feflyole.cxx 
b/sw/source/core/frmedt/feflyole.cxx
index 33ec9cc9a3b1..b34fb3f77195 100644
--- a/sw/source/core/frmedt/feflyole.cxx
+++ b/sw/source/core/frmedt/feflyole.cxx
@@ -28,6 +28,9 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 using namespace com::sun::star;
 
@@ -102,8 +105,21 @@ bool SwFEShell::FinishOLEObj()  // 
Server is terminated
 IsCheckForOLEInCaption() )
 SetCheckForOLEInCaption( !IsCheckForOLEInCaption() );
 
+// enable update of the link preview
+comphelper::EmbeddedObjectContainer& rEmbeddedObjectContainer = 
GetDoc()->GetDocShell()->getEmbeddedObjectContainer();
+const bool aUserAllowsLinkUpdate = 
rEmbeddedObjectContainer.getUserAllowsLinkUpdate();
+rEmbeddedObjectContainer.setUserAllowsLinkUpdate(true);
+
 // leave UIActive state
 pIPClient->DeactivateObject();
+
+// if we have more than one link let's update them too
+sfx2::LinkManager& rLinkManager = 
GetDoc()->getIDocumentLinksAdministration().GetLinkManager();
+if (rLinkManager.GetLinks().size() > 1)
+rLinkManager.UpdateAllLinks(false, false, nullptr);
+
+// return back original value of the "update of the link preview" flag
+
rEmbeddedObjectContainer.setUserAllowsLinkUpdate(aUserAllowsLinkUpdate);
 }
 return bRet;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - sc/source

2020-02-13 Thread Serge Krot (via logerrit)
 sc/source/core/data/table1.cxx |   21 +
 sc/source/ui/view/printfun.cxx |6 +++---
 2 files changed, 20 insertions(+), 7 deletions(-)

New commits:
commit 66c3b56a2a635aa2ae3779e8575db83400c119c4
Author: Serge Krot 
AuthorDate: Fri Feb 7 18:16:49 2020 +0100
Commit: Noel Grandin 
CommitDate: Thu Feb 13 12:31:48 2020 +0100

tdf#128873 speed up switching into page layout

Change-Id: I993fdafe226680ac718f4611cfb1f842bc99f385
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88231
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
(cherry picked from commit 153c4c7e6ab066c6b1c06704e08e5be815cfc024)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88302
Reviewed-by: Noel Grandin 

diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
old mode 100644
new mode 100755
index 7a2e740bb721..fea4dbcc66c3
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -2038,11 +2038,24 @@ void ScTable::ExtendPrintArea( OutputDevice* pDev,
 
 void ScTable::MaybeAddExtraColumn(SCCOL& rCol, SCROW nRow, OutputDevice* pDev, 
double nPPTX, double nPPTY)
 {
-ScRefCellValue aCell = aCol[rCol].GetCellValue(nRow);
+// tdf#128873 we do not need to calculate text width (heavy operation)
+// when we for sure know that an additional column will not be added
+if (GetAllocatedColumnsCount() > rCol + 1)
+{
+ScRefCellValue aNextCell = aCol[rCol + 1].GetCellValue(nRow);
+if (!aNextCell.isEmpty())
+{
+// return rCol as is
+return;
+}
+}
+
+ScColumn& rColumn = aCol[rCol];
+ScRefCellValue aCell = rColumn.GetCellValue(nRow);
 if (!aCell.hasString())
 return;
 
-long nPixel = aCol[rCol].GetTextWidth(nRow);
+long nPixel = rColumn.GetTextWidth(nRow);
 
 // Width already calculated in Idle-Handler ?
 if ( TEXTWIDTH_DIRTY == nPixel )
@@ -2053,10 +2066,10 @@ void ScTable::MaybeAddExtraColumn(SCCOL& rCol, SCROW 
nRow, OutputDevice* pDev, d
 aOptions.bSkipMerged = false;
 
 Fraction aZoom(1,1);
-nPixel = aCol[rCol].GetNeededSize(
+nPixel = rColumn.GetNeededSize(
 nRow, pDev, nPPTX, nPPTY, aZoom, aZoom, true, aOptions, nullptr );
 
-aCol[rCol].SetTextWidth(nRow, static_cast(nPixel));
+rColumn.SetTextWidth(nRow, static_cast(nPixel));
 }
 
 long nTwips = static_cast(nPixel / nPPTX);
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index 18be8420c7ee..8c6231544659 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -421,13 +421,13 @@ static void lcl_HidePrint( const ScTableInfo& rTabInfo, 
SCCOL nX1, SCCOL nX2 )
 RowInfo* pThisRowInfo = [nArrY];
 for (SCCOL nX=nX1; nX<=nX2; nX++)
 {
-const CellInfo& rCellInfo = pThisRowInfo->pCellInfo[nX+1];
+CellInfo& rCellInfo = pThisRowInfo->pCellInfo[nX+1];
 if (!rCellInfo.bEmptyCellText)
 if (rCellInfo.pPatternAttr->
 GetItem(ATTR_PROTECTION, 
rCellInfo.pConditionSet).GetHidePrint())
 {
-pThisRowInfo->pCellInfo[nX+1].maCell.clear();
-pThisRowInfo->pCellInfo[nX+1].bEmptyCellText = true;
+rCellInfo.maCell.clear();
+rCellInfo.bEmptyCellText = true;
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/cib_contract3753' - 4 commits - include/svx sc/source svx/source sw/qa sw/source

2020-02-13 Thread Serge Krot (via logerrit)
Rebased ref, commits from common ancestor:
commit c38ba97261c0af28cb48786a7ad7edcab1e85cb4
Author: Serge Krot 
AuthorDate: Tue Feb 11 16:04:26 2020 +0100
Commit: Serge Krot (CIB) 
CommitDate: Thu Feb 13 09:47:40 2020 +0100

tdf#130610 docx export: handle bold as toggle properties

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88460
Reviewed-by: Michael Stahl 
Tested-by: Jenkins

Conflicts:
sw/qa/extras/ooxmlexport/ooxmlexport14.cxx

Change-Id: I4c60b7eab6430a64ea1c8bcf40d0036d0b38516f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88574
Tested-by: Jenkins
Reviewed-by: Serge Krot (CIB) 

diff --git a/sw/qa/extras/ooxmlexport/data/tdf130610_bold_in_2_styles.ott 
b/sw/qa/extras/ooxmlexport/data/tdf130610_bold_in_2_styles.ott
new file mode 100755
index ..35937d9a8aa3
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/tdf130610_bold_in_2_styles.ott differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
index bb9e3932320f..2ddc72515991 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
@@ -18,6 +18,7 @@
 #include 
 #include 
 #include 
+#include 
 
 class Test : public SwModelTestBase
 {
@@ -90,6 +91,34 @@ DECLARE_OOXMLEXPORT_TEST(testTdf87569d, 
"tdf87569_drawingml.docx")
  text::RelOrientation::FRAME, nValue);
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf130610, "tdf130610_bold_in_2_styles.ott")
+{
+// check character properties
+{
+uno::Reference xStyle(
+getStyles("CharacterStyles")->getByName("WollMuxRoemischeZiffer"),
+uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Bold", awt::FontWeight::BOLD, 
getProperty(xStyle, "CharWeight"));
+}
+
+// check paragraph properties
+{
+uno::Reference xStyle(
+getStyles("ParagraphStyles")->getByName("WollMuxVerfuegungspunkt"),
+uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Bold", awt::FontWeight::BOLD, 
getProperty(xStyle, "CharWeight"));
+}
+
+// check inline text properties
+{
+xmlDocPtr pXmlDoc =parseExport("word/document.xml");
+if (pXmlDoc)
+{
+assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/w:rPr/w:b");
+}
+}
+}
+
 DECLARE_OOXMLEXPORT_TEST(testTdf120315, "tdf120315.docx")
 {
 // tdf#120315 cells of the second column weren't vertically merged
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx 
b/sw/source/filter/ww8/wrtw8nds.cxx
index 3df5950cff84..cac4cdf247e1 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -43,6 +43,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -473,6 +474,12 @@ void SwWW8AttrIter::OutAttr( sal_Int32 nSwPos, bool 
bWriteCombChars)
 if ( pCharFormatItem )
 ClearOverridesFromSet( *pCharFormatItem, aExportSet );
 
+// check toggle properties in DOCX output
+{
+SvxWeightItem aBoldProperty(WEIGHT_BOLD, RES_CHRATR_WEIGHT);
+handleToggleProperty(aExportSet, pCharFormatItem, RES_CHRATR_WEIGHT, 
);
+}
+
 // tdf#113790: AutoFormat style overwrites char style, so remove all
 // elements from CHARFMT grab bag which are set in AUTOFMT grab bag
 if (const SfxGrabBagItem *pAutoFmtGrabBag = dynamic_cast(pGrabBag))
@@ -535,6 +542,64 @@ void SwWW8AttrIter::OutAttr( sal_Int32 nSwPos, bool 
bWriteCombChars)
 m_rExport.AttrOutput().OutputItem( *pGrabBag );
 }
 
+// Toggle Properties
+//
+// If the value of the toggle property appears at multiple levels of the style 
hierarchy (17.7.2), their
+// effective values shall be combined as follows:
+//
+// value_{effective} = val_{table} XOR val_{paragraph} XOR val_{character}
+//
+// If the value specified by the document defaults is true, the effective 
value is true.
+// Otherwise, the values are combined by a Boolean XOR as follows:
+// i.e., the effective value to be applied to the content shall be true if its 
effective value is true for
+// an odd number of levels of the style hierarchy.
+//
+// To prevent such logic inside output, it is required to write inline w:b 
token on content level.
+void SwWW8AttrIter::handleToggleProperty(SfxItemSet& rExportSet, const 
SwFormatCharFormat* pCharFormatItem,
+sal_uInt16 nWhich, const SfxPoolItem* pValue)
+{
+if (!rExportSet.HasItem(nWhich) && pValue)
+{
+bool hasPropertyInCharStyle = false;
+bool hasPropertyInParaStyle = false;
+
+// get bold flag from specified character style
+if (pCharFormatItem)
+{
+if (const SwCharFormat* pCharFormat = 
pCharFormatItem->GetCharFormat())
+{
+const SfxPoolItem* pIte

[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - sw/qa sw/source

2020-02-13 Thread Serge Krot (via logerrit)
 sw/qa/extras/ooxmlexport/data/tdf130610_bold_in_2_styles.ott |binary
 sw/qa/extras/ooxmlexport/ooxmlexport14.cxx   |   29 
 sw/source/filter/ww8/wrtw8nds.cxx|   65 +++
 sw/source/filter/ww8/wrtww8.hxx  |2 
 4 files changed, 96 insertions(+)

New commits:
commit c38ba97261c0af28cb48786a7ad7edcab1e85cb4
Author: Serge Krot 
AuthorDate: Tue Feb 11 16:04:26 2020 +0100
Commit: Serge Krot (CIB) 
CommitDate: Thu Feb 13 09:47:40 2020 +0100

tdf#130610 docx export: handle bold as toggle properties

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88460
Reviewed-by: Michael Stahl 
Tested-by: Jenkins

Conflicts:
sw/qa/extras/ooxmlexport/ooxmlexport14.cxx

Change-Id: I4c60b7eab6430a64ea1c8bcf40d0036d0b38516f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88574
Tested-by: Jenkins
Reviewed-by: Serge Krot (CIB) 

diff --git a/sw/qa/extras/ooxmlexport/data/tdf130610_bold_in_2_styles.ott 
b/sw/qa/extras/ooxmlexport/data/tdf130610_bold_in_2_styles.ott
new file mode 100755
index ..35937d9a8aa3
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/tdf130610_bold_in_2_styles.ott differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
index bb9e3932320f..2ddc72515991 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
@@ -18,6 +18,7 @@
 #include 
 #include 
 #include 
+#include 
 
 class Test : public SwModelTestBase
 {
@@ -90,6 +91,34 @@ DECLARE_OOXMLEXPORT_TEST(testTdf87569d, 
"tdf87569_drawingml.docx")
  text::RelOrientation::FRAME, nValue);
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf130610, "tdf130610_bold_in_2_styles.ott")
+{
+// check character properties
+{
+uno::Reference xStyle(
+getStyles("CharacterStyles")->getByName("WollMuxRoemischeZiffer"),
+uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Bold", awt::FontWeight::BOLD, 
getProperty(xStyle, "CharWeight"));
+}
+
+// check paragraph properties
+{
+uno::Reference xStyle(
+getStyles("ParagraphStyles")->getByName("WollMuxVerfuegungspunkt"),
+uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Bold", awt::FontWeight::BOLD, 
getProperty(xStyle, "CharWeight"));
+}
+
+// check inline text properties
+{
+xmlDocPtr pXmlDoc =parseExport("word/document.xml");
+if (pXmlDoc)
+{
+assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/w:rPr/w:b");
+}
+}
+}
+
 DECLARE_OOXMLEXPORT_TEST(testTdf120315, "tdf120315.docx")
 {
 // tdf#120315 cells of the second column weren't vertically merged
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx 
b/sw/source/filter/ww8/wrtw8nds.cxx
index 3df5950cff84..cac4cdf247e1 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -43,6 +43,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -473,6 +474,12 @@ void SwWW8AttrIter::OutAttr( sal_Int32 nSwPos, bool 
bWriteCombChars)
 if ( pCharFormatItem )
 ClearOverridesFromSet( *pCharFormatItem, aExportSet );
 
+// check toggle properties in DOCX output
+{
+SvxWeightItem aBoldProperty(WEIGHT_BOLD, RES_CHRATR_WEIGHT);
+handleToggleProperty(aExportSet, pCharFormatItem, RES_CHRATR_WEIGHT, 
);
+}
+
 // tdf#113790: AutoFormat style overwrites char style, so remove all
 // elements from CHARFMT grab bag which are set in AUTOFMT grab bag
 if (const SfxGrabBagItem *pAutoFmtGrabBag = dynamic_cast(pGrabBag))
@@ -535,6 +542,64 @@ void SwWW8AttrIter::OutAttr( sal_Int32 nSwPos, bool 
bWriteCombChars)
 m_rExport.AttrOutput().OutputItem( *pGrabBag );
 }
 
+// Toggle Properties
+//
+// If the value of the toggle property appears at multiple levels of the style 
hierarchy (17.7.2), their
+// effective values shall be combined as follows:
+//
+// value_{effective} = val_{table} XOR val_{paragraph} XOR val_{character}
+//
+// If the value specified by the document defaults is true, the effective 
value is true.
+// Otherwise, the values are combined by a Boolean XOR as follows:
+// i.e., the effective value to be applied to the content shall be true if its 
effective value is true for
+// an odd number of levels of the style hierarchy.
+//
+// To prevent such logic inside output, it is required to write inline w:b 
token on content level.
+void SwWW8AttrIter::handleToggleProperty(SfxItemSet& rExportSet, const 
SwFormatCharFormat* pCharFormatItem,
+sal_uInt16 nWhich, const SfxPoolItem* pValue)
+{
+if (!rExportSet.HasItem(nWhich) && pValue)
+{
+bool hasPropertyInChar

[Libreoffice-commits] core.git: sw/qa sw/source

2020-02-12 Thread Serge Krot (via logerrit)
 sw/qa/extras/ooxmlexport/data/tdf130610_bold_in_2_styles.ott |binary
 sw/qa/extras/ooxmlexport/ooxmlexport14.cxx   |   29 
 sw/source/filter/ww8/wrtw8nds.cxx|   65 +++
 sw/source/filter/ww8/wrtww8.hxx  |2 
 4 files changed, 96 insertions(+)

New commits:
commit 0c6ef9ba325fc37f325a2848e013852d2780a5ca
Author: Serge Krot 
AuthorDate: Tue Feb 11 16:04:26 2020 +0100
Commit: Thorsten Behrens 
CommitDate: Wed Feb 12 22:24:19 2020 +0100

tdf#130610 docx export: handle bold as toggle properties

Change-Id: I4c60b7eab6430a64ea1c8bcf40d0036d0b38516f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88460
Reviewed-by: Michael Stahl 
Tested-by: Jenkins

diff --git a/sw/qa/extras/ooxmlexport/data/tdf130610_bold_in_2_styles.ott 
b/sw/qa/extras/ooxmlexport/data/tdf130610_bold_in_2_styles.ott
new file mode 100755
index ..35937d9a8aa3
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/tdf130610_bold_in_2_styles.ott differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
index 3bdae52c4d65..9fce4ad0e091 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -107,6 +108,34 @@ DECLARE_OOXMLEXPORT_TEST(testTdf87569d, 
"tdf87569_drawingml.docx")
  text::RelOrientation::FRAME, nValue);
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf130610, "tdf130610_bold_in_2_styles.ott")
+{
+// check character properties
+{
+uno::Reference xStyle(
+getStyles("CharacterStyles")->getByName("WollMuxRoemischeZiffer"),
+uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Bold", awt::FontWeight::BOLD, 
getProperty(xStyle, "CharWeight"));
+}
+
+// check paragraph properties
+{
+uno::Reference xStyle(
+getStyles("ParagraphStyles")->getByName("WollMuxVerfuegungspunkt"),
+uno::UNO_QUERY);
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Bold", awt::FontWeight::BOLD, 
getProperty(xStyle, "CharWeight"));
+}
+
+// check inline text properties
+{
+xmlDocPtr pXmlDoc =parseExport("word/document.xml");
+if (pXmlDoc)
+{
+assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/w:rPr/w:b");
+}
+}
+}
+
 DECLARE_OOXMLEXPORT_TEST(testTdf120315, "tdf120315.docx")
 {
 // tdf#120315 cells of the second column weren't vertically merged
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx 
b/sw/source/filter/ww8/wrtw8nds.cxx
index d06072c6de5a..70a855efc7ed 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -39,6 +39,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -466,6 +467,12 @@ void SwWW8AttrIter::OutAttr( sal_Int32 nSwPos, bool 
bWriteCombChars)
 if ( pCharFormatItem )
 ClearOverridesFromSet( *pCharFormatItem, aExportSet );
 
+// check toggle properties in DOCX output
+{
+SvxWeightItem aBoldProperty(WEIGHT_BOLD, RES_CHRATR_WEIGHT);
+handleToggleProperty(aExportSet, pCharFormatItem, RES_CHRATR_WEIGHT, 
);
+}
+
 // tdf#113790: AutoFormat style overwrites char style, so remove all
 // elements from CHARFMT grab bag which are set in AUTOFMT grab bag
 if (const SfxGrabBagItem *pAutoFmtGrabBag = dynamic_cast(pGrabBag))
@@ -528,6 +535,64 @@ void SwWW8AttrIter::OutAttr( sal_Int32 nSwPos, bool 
bWriteCombChars)
 m_rExport.AttrOutput().OutputItem( *pGrabBag );
 }
 
+// Toggle Properties
+//
+// If the value of the toggle property appears at multiple levels of the style 
hierarchy (17.7.2), their
+// effective values shall be combined as follows:
+//
+// value_{effective} = val_{table} XOR val_{paragraph} XOR val_{character}
+//
+// If the value specified by the document defaults is true, the effective 
value is true.
+// Otherwise, the values are combined by a Boolean XOR as follows:
+// i.e., the effective value to be applied to the content shall be true if its 
effective value is true for
+// an odd number of levels of the style hierarchy.
+//
+// To prevent such logic inside output, it is required to write inline w:b 
token on content level.
+void SwWW8AttrIter::handleToggleProperty(SfxItemSet& rExportSet, const 
SwFormatCharFormat* pCharFormatItem,
+sal_uInt16 nWhich, const SfxPoolItem* pValue)
+{
+if (!rExportSet.HasItem(nWhich) && pValue)
+{
+bool hasPropertyInCharStyle = false;
+bool hasPropertyInParaStyle = false;
+
+// get bold flag from specified character style
+if (pCharFormatItem)
+{
+if (const SwCharFormat* pCharFormat =

[Libreoffice-commits] core.git: Changes to 'feature/cib_contract3753'

2020-02-12 Thread Serge Krot (via logerrit)
New branch 'feature/cib_contract3753' available with the following commits:
commit c449fa2ddc09a12937c042b30c1ff09a8c2bd441
Author: Serge Krot 
Date:   Tue Feb 11 16:04:26 2020 +0100

tdf#130610 docx export: handle bold as toggle properties

Conflicts:
sw/qa/extras/ooxmlexport/ooxmlexport14.cxx

Change-Id: I4c60b7eab6430a64ea1c8bcf40d0036d0b38516f

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sc/source

2020-02-08 Thread Serge Krot (via logerrit)
 sc/source/core/data/table1.cxx |   21 +
 sc/source/ui/view/printfun.cxx |6 +++---
 2 files changed, 20 insertions(+), 7 deletions(-)

New commits:
commit 153c4c7e6ab066c6b1c06704e08e5be815cfc024
Author: Serge Krot 
AuthorDate: Fri Feb 7 18:16:49 2020 +0100
Commit: Thorsten Behrens 
CommitDate: Sat Feb 8 18:09:59 2020 +0100

tdf#128873 speed up switching into page layout

Change-Id: I993fdafe226680ac718f4611cfb1f842bc99f385
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88231
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
old mode 100644
new mode 100755
index 7b6f1f771eb8..0b25f838d676
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -2039,11 +2039,24 @@ void ScTable::ExtendPrintArea( OutputDevice* pDev,
 
 void ScTable::MaybeAddExtraColumn(SCCOL& rCol, SCROW nRow, OutputDevice* pDev, 
double nPPTX, double nPPTY)
 {
-ScRefCellValue aCell = aCol[rCol].GetCellValue(nRow);
+// tdf#128873 we do not need to calculate text width (heavy operation)
+// when we for sure know that an additional column will not be added
+if (GetAllocatedColumnsCount() > rCol + 1)
+{
+ScRefCellValue aNextCell = aCol[rCol + 1].GetCellValue(nRow);
+if (!aNextCell.isEmpty())
+{
+// return rCol as is
+return;
+}
+}
+
+ScColumn& rColumn = aCol[rCol];
+ScRefCellValue aCell = rColumn.GetCellValue(nRow);
 if (!aCell.hasString())
 return;
 
-long nPixel = aCol[rCol].GetTextWidth(nRow);
+long nPixel = rColumn.GetTextWidth(nRow);
 
 // Width already calculated in Idle-Handler ?
 if ( TEXTWIDTH_DIRTY == nPixel )
@@ -2054,10 +2067,10 @@ void ScTable::MaybeAddExtraColumn(SCCOL& rCol, SCROW 
nRow, OutputDevice* pDev, d
 aOptions.bSkipMerged = false;
 
 Fraction aZoom(1,1);
-nPixel = aCol[rCol].GetNeededSize(
+nPixel = rColumn.GetNeededSize(
 nRow, pDev, nPPTX, nPPTY, aZoom, aZoom, true, aOptions, nullptr );
 
-aCol[rCol].SetTextWidth(nRow, static_cast(nPixel));
+rColumn.SetTextWidth(nRow, static_cast(nPixel));
 }
 
 long nTwips = static_cast(nPixel / nPPTX);
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index dc1930baff27..799f5fa3ae0c 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -421,13 +421,13 @@ static void lcl_HidePrint( const ScTableInfo& rTabInfo, 
SCCOL nX1, SCCOL nX2 )
 RowInfo* pThisRowInfo = [nArrY];
 for (SCCOL nX=nX1; nX<=nX2; nX++)
 {
-const CellInfo& rCellInfo = pThisRowInfo->pCellInfo[nX+1];
+CellInfo& rCellInfo = pThisRowInfo->pCellInfo[nX+1];
 if (!rCellInfo.bEmptyCellText)
 if (rCellInfo.pPatternAttr->
 GetItem(ATTR_PROTECTION, 
rCellInfo.pConditionSet).GetHidePrint())
 {
-pThisRowInfo->pCellInfo[nX+1].maCell.clear();
-pThisRowInfo->pCellInfo[nX+1].bEmptyCellText = true;
+rCellInfo.maCell.clear();
+rCellInfo.bEmptyCellText = true;
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-4+backports' - sw/source

2020-01-29 Thread Serge Krot (via logerrit)
 sw/source/filter/ww8/ww8atr.cxx |   16 
 1 file changed, 16 insertions(+)

New commits:
commit 98967613b4ca12f6be4d3a75be65caa3b45621e3
Author: Serge Krot 
AuthorDate: Fri Jan 10 14:44:25 2020 +0100
Commit: Thorsten Behrens 
CommitDate: Wed Jan 29 12:46:38 2020 +0100

tdf#129924 docx import: set background color

Change-Id: If586a7a11e375c1592253630af87772bca40b52e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86542
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

tdf#129924 critical fix: use SvxColorItem instead of SvxBrushItem

Change-Id: I09b1e9fe53315974864c8d6947c7cb861f069a68
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86953
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87537
Reviewed-by: Thorsten Behrens 
Tested-by: Thorsten Behrens 

diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index dd9bcf6d02ef..892750d8240f 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -261,6 +261,22 @@ void MSWordExportBase::ExportPoolItemsToCHP( 
ww8::PoolItems , sal_uInt16
 
 AttrOutput().OutputItem( fontHeight );
  }
+ else if (nWhich == RES_CHRATR_COLOR)
+ {
+const SvxColorItem& rColor = static_cast(*pItem);
+const SfxPoolItem* pBackgroundItem = SearchPoolItems(rItems, 
RES_CHRATR_BACKGROUND);
+if (rColor.GetValue() == COL_AUTO && pBackgroundItem)
+{
+const SvxBrushItem& rBrushBackground = static_cast(*pBackgroundItem);
+SvxColorItem 
aForeground(rBrushBackground.GetColor().IsDark() ? COL_WHITE : COL_BLACK, 
RES_CHRATR_COLOR);
+AttrOutput().OutputItem(aForeground);
+}
+else
+{
+// default
+AttrOutput().OutputItem( *pItem );
+}
+ }
  else
  {
 AttrOutput().OutputItem( *pItem );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-4+backports' - sw/source

2020-01-29 Thread Serge Krot (via logerrit)
 sw/source/filter/ww8/docxattributeoutput.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit 0d2d1643e127696dbee30ab57fa56508c0c4d04b
Author: Serge Krot 
AuthorDate: Tue Jan 14 16:03:08 2020 +0100
Commit: Thorsten Behrens 
CommitDate: Wed Jan 29 12:46:03 2020 +0100

tdf#126795 docx export: do not output tab stops twice

Change-Id: I70235df7fb73133f413863ee5eb7c76905a60248
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86767
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
(cherry picked from commit 264d27c94d7286a407b05a32f4097ac9d543e1a3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87525
Tested-by: Thorsten Behrens 

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 7a01c9ff1533..cf0195c2c7ec 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -7869,6 +7869,13 @@ void DocxAttributeOutput::ParaTabStop( const 
SvxTabStopItem& rTabStop )
 return;
 }
 
+// do not output inherited tabs twice (inside styles and inside inline 
properties)
+if ( nCount == nInheritedTabCount && nCount > 0 )
+{
+if ( *pInheritedTabs == rTabStop )
+return;
+}
+
 m_pSerializer->startElementNS(XML_w, XML_tabs);
 
 // Get offset for tabs
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sw/qa

2020-01-17 Thread Serge Krot (via logerrit)
 sw/qa/extras/ooxmlexport/data/tdf126795_TabsRelativeToIndent0.odt |binary
 sw/qa/extras/ooxmlexport/data/tdf126795_TabsRelativeToIndent1.odt |binary
 sw/qa/extras/ooxmlexport/ooxmlexport11.cxx|   16 
++
 3 files changed, 16 insertions(+)

New commits:
commit ee4223bf079b1225e57a51772f6693f69c0e83bd
Author: Serge Krot 
AuthorDate: Wed Jan 15 20:18:15 2020 +0100
Commit: Thorsten Behrens 
CommitDate: Fri Jan 17 16:24:36 2020 +0100

tdf#126795 docx export and TabsRelativeToIndent: added unit test

Change-Id: I233a40133392757978b27666853a1fcef2e00a07
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86878
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/sw/qa/extras/ooxmlexport/data/tdf126795_TabsRelativeToIndent0.odt 
b/sw/qa/extras/ooxmlexport/data/tdf126795_TabsRelativeToIndent0.odt
new file mode 100644
index ..e650076a096a
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/tdf126795_TabsRelativeToIndent0.odt differ
diff --git a/sw/qa/extras/ooxmlexport/data/tdf126795_TabsRelativeToIndent1.odt 
b/sw/qa/extras/ooxmlexport/data/tdf126795_TabsRelativeToIndent1.odt
new file mode 100644
index ..da2eae76bb14
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/tdf126795_TabsRelativeToIndent1.odt differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
index aa57c48f19e1..9cb1474c5603 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx
@@ -97,6 +97,22 @@ 
DECLARE_OOXMLEXPORT_TEST(testTdf121665_back2backColumnBreaks, "tdf121665_back2ba
 style::BreakType_COLUMN_BEFORE, 
getProperty(getParagraph(2), "BreakType"));
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf126795_TabsRelativeToIndent0, 
"tdf126795_TabsRelativeToIndent0.odt")
+{
+uno::Sequence< style::TabStop > stops = getProperty< 
uno::Sequence >(getParagraph( 2 ), "ParaTabStops");
+CPPUNIT_ASSERT_EQUAL( sal_Int32(1), stops.getLength());
+CPPUNIT_ASSERT_EQUAL( css::style::TabAlign_LEFT, stops[ 0 ].Alignment );
+CPPUNIT_ASSERT_EQUAL( sal_Int32(499), stops[ 0 ].Position );
+}
+
+DECLARE_OOXMLEXPORT_TEST(testTdf126795_TabsRelativeToIndent1, 
"tdf126795_TabsRelativeToIndent1.odt")
+{
+uno::Sequence< style::TabStop > stops = getProperty< 
uno::Sequence >(getParagraph( 2 ), "ParaTabStops");
+CPPUNIT_ASSERT_EQUAL( sal_Int32(1), stops.getLength());
+CPPUNIT_ASSERT_EQUAL( css::style::TabAlign_LEFT, stops[ 0 ].Alignment );
+CPPUNIT_ASSERT_EQUAL( sal_Int32(499), stops[ 0 ].Position );
+}
+
 DECLARE_OOXMLEXPORT_TEST(testTdf46938_clearTabStop, 
"tdf46938_clearTabStop.docx")
 {
 // Number of tabstops should be zero, overriding the one in the style
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - sw/source

2020-01-17 Thread Serge Krot (via logerrit)
 sw/source/filter/ww8/ww8atr.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit c212cf92c59946e1431e38396ac0e78fef3f23d8
Author: Serge Krot 
AuthorDate: Fri Jan 17 09:34:01 2020 +0100
Commit: Thorsten Behrens 
CommitDate: Fri Jan 17 16:24:02 2020 +0100

tdf#129924 critical fix: use SvxColorItem instead of SvxBrushItem

Change-Id: I09b1e9fe53315974864c8d6947c7cb861f069a68
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86953
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 
(cherry picked from commit c5747c64d3134ec6d8b6ab6fdc938639157fca09)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86978
Reviewed-by: Thorsten Behrens 

diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 204c915b2a5c..4be2d36e177b 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -263,12 +263,12 @@ void MSWordExportBase::ExportPoolItemsToCHP( 
ww8::PoolItems , sal_uInt16
  }
  else if (nWhich == RES_CHRATR_COLOR)
  {
-const SvxBrushItem& rBrushColor = static_cast(*pItem);
+const SvxColorItem& rColor = static_cast(*pItem);
 const SfxPoolItem* pBackgroundItem = SearchPoolItems(rItems, 
RES_CHRATR_BACKGROUND);
-if (rBrushColor.GetColor() == COL_AUTO && pBackgroundItem)
+if (rColor.GetValue() == COL_AUTO && pBackgroundItem)
 {
 const SvxBrushItem& rBrushBackground = static_cast(*pBackgroundItem);
-SvxBrushItem 
aForeground(rBrushBackground.GetColor().IsDark() ? COL_WHITE : COL_BLACK, 
RES_CHRATR_COLOR);
+SvxColorItem 
aForeground(rBrushBackground.GetColor().IsDark() ? COL_WHITE : COL_BLACK, 
RES_CHRATR_COLOR);
 AttrOutput().OutputItem(aForeground);
 }
 else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - sw/source

2020-01-17 Thread Serge Krot (via logerrit)
 sw/source/filter/ww8/ww8atr.cxx |   16 
 1 file changed, 16 insertions(+)

New commits:
commit c726c7ca57a1484aaeb4bdcc1baa29d91fa9cff9
Author: Serge Krot 
AuthorDate: Fri Jan 10 14:44:25 2020 +0100
Commit: Serge Krot (CIB) 
CommitDate: Fri Jan 17 14:03:04 2020 +0100

tdf#129924 docx import: set background color

Change-Id: If586a7a11e375c1592253630af87772bca40b52e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86542
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
(cherry picked from commit 9476dfe7d1b86b367966e7dedf67e11936c8d9d7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86895
Reviewed-by: Serge Krot (CIB) 

diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 9719ba6ae2ff..204c915b2a5c 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -261,6 +261,22 @@ void MSWordExportBase::ExportPoolItemsToCHP( 
ww8::PoolItems , sal_uInt16
 
 AttrOutput().OutputItem( fontHeight );
  }
+ else if (nWhich == RES_CHRATR_COLOR)
+ {
+const SvxBrushItem& rBrushColor = static_cast(*pItem);
+const SfxPoolItem* pBackgroundItem = SearchPoolItems(rItems, 
RES_CHRATR_BACKGROUND);
+if (rBrushColor.GetColor() == COL_AUTO && pBackgroundItem)
+{
+const SvxBrushItem& rBrushBackground = static_cast(*pBackgroundItem);
+SvxBrushItem 
aForeground(rBrushBackground.GetColor().IsDark() ? COL_WHITE : COL_BLACK, 
RES_CHRATR_COLOR);
+AttrOutput().OutputItem(aForeground);
+}
+else
+{
+// default
+AttrOutput().OutputItem( *pItem );
+}
+ }
  else
  {
 AttrOutput().OutputItem( *pItem );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sw/source

2020-01-17 Thread Serge Krot (via logerrit)
 sw/source/filter/ww8/ww8atr.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit c5747c64d3134ec6d8b6ab6fdc938639157fca09
Author: Serge Krot 
AuthorDate: Fri Jan 17 09:34:01 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Fri Jan 17 13:46:31 2020 +0100

tdf#129924 critical fix: use SvxColorItem instead of SvxBrushItem

Change-Id: I09b1e9fe53315974864c8d6947c7cb861f069a68
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86953
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 813ace50c4fc..8bd8dd43a948 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -258,12 +258,12 @@ void MSWordExportBase::ExportPoolItemsToCHP( 
ww8::PoolItems , sal_uInt16
  }
  else if (nWhich == RES_CHRATR_COLOR)
  {
-const SvxBrushItem& rBrushColor = static_cast(*pItem);
+const SvxColorItem& rColor = static_cast(*pItem);
 const SfxPoolItem* pBackgroundItem = SearchPoolItems(rItems, 
RES_CHRATR_BACKGROUND);
-if (rBrushColor.GetColor() == COL_AUTO && pBackgroundItem)
+if (rColor.GetValue() == COL_AUTO && pBackgroundItem)
 {
 const SvxBrushItem& rBrushBackground = static_cast(*pBackgroundItem);
-SvxBrushItem 
aForeground(rBrushBackground.GetColor().IsDark() ? COL_WHITE : COL_BLACK, 
RES_CHRATR_COLOR);
+SvxColorItem 
aForeground(rBrushBackground.GetColor().IsDark() ? COL_WHITE : COL_BLACK, 
RES_CHRATR_COLOR);
 AttrOutput().OutputItem(aForeground);
 }
 else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - sw/source

2020-01-17 Thread Serge Krot (via logerrit)
 sw/source/filter/ww8/docxattributeoutput.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit 2bcd3ed723463279f7f3e90966a5589e5b8592cf
Author: Serge Krot 
AuthorDate: Tue Jan 14 16:03:08 2020 +0100
Commit: Michael Stahl 
CommitDate: Fri Jan 17 11:18:28 2020 +0100

tdf#126795 docx export: do not output tab stops twice

Change-Id: I70235df7fb73133f413863ee5eb7c76905a60248
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86767
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
(cherry picked from commit 264d27c94d7286a407b05a32f4097ac9d543e1a3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86896
Reviewed-by: Serge Krot (CIB) 
(cherry picked from commit 6358fb7d3139a7b5ce0ea2394faa55ea1e2e4b6c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86954
Reviewed-by: Michael Stahl 

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index d1eb890ddc62..eefacf9c7047 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -7824,6 +7824,13 @@ void DocxAttributeOutput::ParaTabStop( const 
SvxTabStopItem& rTabStop )
 return;
 }
 
+// do not output inherited tabs twice (inside styles and inside inline 
properties)
+if ( nCount == nInheritedTabCount && nCount > 0 )
+{
+if ( *pInheritedTabs == rTabStop )
+return;
+}
+
 m_pSerializer->startElementNS(XML_w, XML_tabs);
 
 // Get offset for tabs
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - sw/source

2020-01-17 Thread Serge Krot (via logerrit)
 sw/source/filter/ww8/docxattributeoutput.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit 6358fb7d3139a7b5ce0ea2394faa55ea1e2e4b6c
Author: Serge Krot 
AuthorDate: Tue Jan 14 16:03:08 2020 +0100
Commit: Serge Krot (CIB) 
CommitDate: Fri Jan 17 09:37:33 2020 +0100

tdf#126795 docx export: do not output tab stops twice

Change-Id: I70235df7fb73133f413863ee5eb7c76905a60248
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86767
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
(cherry picked from commit 264d27c94d7286a407b05a32f4097ac9d543e1a3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86896
Reviewed-by: Serge Krot (CIB) 

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 7a01c9ff1533..cf0195c2c7ec 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -7869,6 +7869,13 @@ void DocxAttributeOutput::ParaTabStop( const 
SvxTabStopItem& rTabStop )
 return;
 }
 
+// do not output inherited tabs twice (inside styles and inside inline 
properties)
+if ( nCount == nInheritedTabCount && nCount > 0 )
+{
+if ( *pInheritedTabs == rTabStop )
+return;
+}
+
 m_pSerializer->startElementNS(XML_w, XML_tabs);
 
 // Get offset for tabs
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sw/source

2020-01-15 Thread Serge Krot (via logerrit)
 sw/source/filter/ww8/ww8atr.cxx |   16 
 1 file changed, 16 insertions(+)

New commits:
commit 9476dfe7d1b86b367966e7dedf67e11936c8d9d7
Author: Serge Krot 
AuthorDate: Fri Jan 10 14:44:25 2020 +0100
Commit: Thorsten Behrens 
CommitDate: Wed Jan 15 23:48:28 2020 +0100

tdf#129924 docx import: set background color

Change-Id: If586a7a11e375c1592253630af87772bca40b52e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86542
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 9e8d815d7de2..813ace50c4fc 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -256,6 +256,22 @@ void MSWordExportBase::ExportPoolItemsToCHP( 
ww8::PoolItems , sal_uInt16
 
 AttrOutput().OutputItem( fontHeight );
  }
+ else if (nWhich == RES_CHRATR_COLOR)
+ {
+const SvxBrushItem& rBrushColor = static_cast(*pItem);
+const SfxPoolItem* pBackgroundItem = SearchPoolItems(rItems, 
RES_CHRATR_BACKGROUND);
+if (rBrushColor.GetColor() == COL_AUTO && pBackgroundItem)
+{
+const SvxBrushItem& rBrushBackground = static_cast(*pBackgroundItem);
+SvxBrushItem 
aForeground(rBrushBackground.GetColor().IsDark() ? COL_WHITE : COL_BLACK, 
RES_CHRATR_COLOR);
+AttrOutput().OutputItem(aForeground);
+}
+else
+{
+// default
+AttrOutput().OutputItem( *pItem );
+}
+ }
  else
  {
 AttrOutput().OutputItem( *pItem );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sw/source

2020-01-15 Thread Serge Krot (via logerrit)
 sw/source/filter/ww8/docxattributeoutput.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit 264d27c94d7286a407b05a32f4097ac9d543e1a3
Author: Serge Krot 
AuthorDate: Tue Jan 14 16:03:08 2020 +0100
Commit: Thorsten Behrens 
CommitDate: Wed Jan 15 10:49:31 2020 +0100

tdf#126795 docx export: do not output tab stops twice

Change-Id: I70235df7fb73133f413863ee5eb7c76905a60248
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86767
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 25a59b0aa79c..25b22b8df5ed 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -7859,6 +7859,13 @@ void DocxAttributeOutput::ParaTabStop( const 
SvxTabStopItem& rTabStop )
 return;
 }
 
+// do not output inherited tabs twice (inside styles and inside inline 
properties)
+if ( nCount == nInheritedTabCount && nCount > 0 )
+{
+if ( *pInheritedTabs == rTabStop )
+return;
+}
+
 m_pSerializer->startElementNS(XML_w, XML_tabs);
 
 // Get offset for tabs
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-4-0' - svx/source

2020-01-09 Thread Serge Krot (via logerrit)
 svx/source/accessibility/AccessibleShape.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 1561a4f3f595bea5f0fe201310b04600704e2ea1
Author: Serge Krot 
AuthorDate: Wed Jan 8 21:18:20 2020 +0100
Commit: Xisco Faulí 
CommitDate: Thu Jan 9 09:34:34 2020 +0100

tdf#129887: fix crash during scrolling down document

regression from tdf#129708

Change-Id: I6c5d7eb90030234e899ab8ce5b3adec33e03962a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86454
Reviewed-by: Julien Nabet 
Tested-by: Thorsten Behrens 
(cherry picked from commit a3c3f21a742f7c7f587bd63ee2617a150bb39b96)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86460
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
(cherry picked from commit 75265fad67c38827aec074e99e010109f9219079)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86461
Tested-by: Xisco Faulí 
Reviewed-by: Xisco Faulí 

diff --git a/svx/source/accessibility/AccessibleShape.cxx 
b/svx/source/accessibility/AccessibleShape.cxx
index debd4fa7243e..f248df629ff0 100644
--- a/svx/source/accessibility/AccessibleShape.cxx
+++ b/svx/source/accessibility/AccessibleShape.cxx
@@ -159,7 +159,7 @@ void AccessibleShape::Init()
 if( pSdrObject )
 {
 SdrTextObj* pTextObj = dynamic_cast( pSdrObject  
);
-const bool hasOutlinerParaObject = 
pTextObj->CanCreateEditOutlinerParaObject() || 
pSdrObject->GetOutlinerParaObject() != nullptr;
+const bool hasOutlinerParaObject = (pTextObj && 
pTextObj->CanCreateEditOutlinerParaObject()) || 
(pSdrObject->GetOutlinerParaObject() != nullptr);
 
 // create AccessibleTextHelper to handle this shape's text
 if( !hasOutlinerParaObject )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - svx/source

2020-01-08 Thread Serge Krot (via logerrit)
 svx/source/accessibility/AccessibleShape.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 75265fad67c38827aec074e99e010109f9219079
Author: Serge Krot 
AuthorDate: Wed Jan 8 21:18:20 2020 +0100
Commit: Thorsten Behrens 
CommitDate: Thu Jan 9 00:59:00 2020 +0100

tdf#129887: fix crash during scrolling down document

regression from tdf#129708

Change-Id: I6c5d7eb90030234e899ab8ce5b3adec33e03962a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86454
Reviewed-by: Julien Nabet 
Tested-by: Thorsten Behrens 
(cherry picked from commit a3c3f21a742f7c7f587bd63ee2617a150bb39b96)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86460
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/svx/source/accessibility/AccessibleShape.cxx 
b/svx/source/accessibility/AccessibleShape.cxx
index debd4fa7243e..f248df629ff0 100644
--- a/svx/source/accessibility/AccessibleShape.cxx
+++ b/svx/source/accessibility/AccessibleShape.cxx
@@ -159,7 +159,7 @@ void AccessibleShape::Init()
 if( pSdrObject )
 {
 SdrTextObj* pTextObj = dynamic_cast( pSdrObject  
);
-const bool hasOutlinerParaObject = 
pTextObj->CanCreateEditOutlinerParaObject() || 
pSdrObject->GetOutlinerParaObject() != nullptr;
+const bool hasOutlinerParaObject = (pTextObj && 
pTextObj->CanCreateEditOutlinerParaObject()) || 
(pSdrObject->GetOutlinerParaObject() != nullptr);
 
 // create AccessibleTextHelper to handle this shape's text
 if( !hasOutlinerParaObject )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: svx/source

2020-01-08 Thread Serge Krot (via logerrit)
 svx/source/accessibility/AccessibleShape.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a3c3f21a742f7c7f587bd63ee2617a150bb39b96
Author: Serge Krot 
AuthorDate: Wed Jan 8 21:18:20 2020 +0100
Commit: Thorsten Behrens 
CommitDate: Wed Jan 8 22:26:24 2020 +0100

tdf#129887: fix crash during scrolling down document

regression from tdf#129708

Change-Id: I6c5d7eb90030234e899ab8ce5b3adec33e03962a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86454
Reviewed-by: Julien Nabet 
Tested-by: Thorsten Behrens 

diff --git a/svx/source/accessibility/AccessibleShape.cxx 
b/svx/source/accessibility/AccessibleShape.cxx
index 1c0f1e83880e..e96f6501069c 100644
--- a/svx/source/accessibility/AccessibleShape.cxx
+++ b/svx/source/accessibility/AccessibleShape.cxx
@@ -159,7 +159,7 @@ void AccessibleShape::Init()
 if( pSdrObject )
 {
 SdrTextObj* pTextObj = dynamic_cast( pSdrObject  
);
-const bool hasOutlinerParaObject = 
pTextObj->CanCreateEditOutlinerParaObject() || 
pSdrObject->GetOutlinerParaObject() != nullptr;
+const bool hasOutlinerParaObject = (pTextObj && 
pTextObj->CanCreateEditOutlinerParaObject()) || 
(pSdrObject->GetOutlinerParaObject() != nullptr);
 
 // create AccessibleTextHelper to handle this shape's text
 if( !hasOutlinerParaObject )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - include/svx oox/source sd/source svx/source sw/source

2020-01-06 Thread Serge Krot (via logerrit)
 include/svx/svdotext.hxx   |3 +-
 oox/source/export/drawingml.cxx|2 -
 oox/source/export/vmlexport.cxx|2 -
 sd/source/ui/slidesorter/controller/SlsSlotManager.cxx |3 --
 sd/source/ui/unoidl/unoobj.cxx |3 --
 sd/source/ui/view/drviews7.cxx |3 --
 sd/source/ui/view/outlnvsh.cxx |3 --
 svx/source/accessibility/AccessibleShape.cxx   |   15 +---
 svx/source/inc/cell.hxx|3 +-
 svx/source/sdr/primitive2d/sdrattributecreator.cxx |4 +--
 svx/source/svdraw/svdotext.cxx |   11 -
 svx/source/table/accessiblecell.cxx|   12 --
 svx/source/table/cell.cxx  |   20 +++--
 svx/source/table/tablertfexporter.cxx  |2 -
 svx/source/unodraw/unoshtxt.cxx|4 +--
 sw/source/filter/ww8/rtfsdrexport.cxx  |2 -
 sw/source/filter/ww8/wrtw8esh.cxx  |2 -
 17 files changed, 43 insertions(+), 51 deletions(-)

New commits:
commit e88a993b5b0a1a6245a0ae9e1d1e9f365ec7cba3
Author: Serge Krot 
AuthorDate: Fri Jan 3 20:08:45 2020 +0100
Commit: Noel Grandin 
CommitDate: Tue Jan 7 05:56:19 2020 +0100

tdf#129708 speed-up: check if we could create outline instead of creation 
of it

Change-Id: I0629b4e6ccae4ab9be0142fe39c627f2f9a8f5ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86199
Reviewed-by: Noel Grandin 
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
(cherry picked from commit 92ccf53b2a8102299ac2c3e2612bb507d3a79c0f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86278

diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx
index d49f1221dc98..78e09d508199 100644
--- a/include/svx/svdotext.hxx
+++ b/include/svx/svdotext.hxx
@@ -492,7 +492,8 @@ public:
 virtual void NbcSetOutlinerParaObject(std::unique_ptr 
pTextObject) override;
 void NbcSetOutlinerParaObjectForText( std::unique_ptr 
pTextObject, SdrText* pText );
 virtual OutlinerParaObject* GetOutlinerParaObject() const override;
-std::unique_ptr GetEditOutlinerParaObject() const;
+bool CanCreateEditOutlinerParaObject() const;
+std::unique_ptr CreateEditOutlinerParaObject() const;
 
 virtual void NbcReformatText() override;
 
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index d5e035528651..438135e7c851 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -2895,7 +2895,7 @@ void DrawingML::WriteText( const Reference< XInterface >& 
rXIface, const OUStrin
 */
 if (pTxtObj->IsTextEditActive())
 {
-pParaObj = pTxtObj->GetEditOutlinerParaObject().release();
+pParaObj = pTxtObj->CreateEditOutlinerParaObject().release();
 bOwnParaObj = true;
 }
 else
diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx
index a5dc0f403271..98f3243e5461 100644
--- a/oox/source/export/vmlexport.cxx
+++ b/oox/source/export/vmlexport.cxx
@@ -1359,7 +1359,7 @@ sal_Int32 VMLExport::StartShape()
 */
 if (pTxtObj->IsTextEditActive())
 {
-pParaObj = pTxtObj->GetEditOutlinerParaObject().release();
+pParaObj = pTxtObj->CreateEditOutlinerParaObject().release();
 bOwnParaObj = true;
 }
 else
diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx 
b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
index 99be5ad168bb..c49d9ddad355 100644
--- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
@@ -578,8 +578,7 @@ void SlotManager::GetMenuState (SfxItemSet& rSet)
 SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( 
pObj );
 if( pTextObj )
 {
-std::unique_ptr pParaObj = 
pTextObj->GetEditOutlinerParaObject();
-if( pParaObj )
+if( pTextObj->CanCreateEditOutlinerParaObject() )
 {
 bDisable = false;
 }
diff --git a/sd/source/ui/unoidl/unoobj.cxx b/sd/source/ui/unoidl/unoobj.cxx
index 6c728052b2cb..e0dab445c5c6 100644
--- a/sd/source/ui/unoidl/unoobj.cxx
+++ b/sd/source/ui/unoidl/unoobj.cxx
@@ -854,8 +854,7 @@ bool SdXShape::IsEmptyPresObj() const
 if( pTextObj == nullptr )
 return true;
 
-const std::unique_ptr 
pParaObj(pTextObj->GetEditOutlinerParaObject());
-return !pParaObj;
+return !pTextObj->CanCreateEditOutlinerParaObject();
 }
 
 return false

[Libreoffice-commits] core.git: include/svx oox/source sd/source svx/source sw/source

2020-01-06 Thread Serge Krot (via logerrit)
 include/svx/svdotext.hxx   |3 +-
 oox/source/export/drawingml.cxx|2 -
 oox/source/export/vmlexport.cxx|2 -
 sd/source/ui/slidesorter/controller/SlsSlotManager.cxx |3 --
 sd/source/ui/unoidl/unoobj.cxx |3 --
 sd/source/ui/view/drviews7.cxx |3 --
 sd/source/ui/view/outlnvsh.cxx |3 --
 svx/source/accessibility/AccessibleShape.cxx   |   15 +---
 svx/source/inc/cell.hxx|3 +-
 svx/source/sdr/primitive2d/sdrattributecreator.cxx |4 +--
 svx/source/svdraw/svdotext.cxx |   11 -
 svx/source/table/accessiblecell.cxx|   12 --
 svx/source/table/cell.cxx  |   20 +++--
 svx/source/table/tablertfexporter.cxx  |2 -
 svx/source/unodraw/unoshtxt.cxx|4 +--
 sw/source/filter/ww8/rtfsdrexport.cxx  |2 -
 sw/source/filter/ww8/wrtw8esh.cxx  |2 -
 17 files changed, 43 insertions(+), 51 deletions(-)

New commits:
commit 92ccf53b2a8102299ac2c3e2612bb507d3a79c0f
Author: Serge Krot 
AuthorDate: Fri Jan 3 20:08:45 2020 +0100
Commit: Thorsten Behrens 
CommitDate: Mon Jan 6 15:55:25 2020 +0100

tdf#129708 speed-up: check if we could create outline instead of creation 
of it

Change-Id: I0629b4e6ccae4ab9be0142fe39c627f2f9a8f5ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86199
Reviewed-by: Noel Grandin 
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx
index ccb6686e883d..f995071617b5 100644
--- a/include/svx/svdotext.hxx
+++ b/include/svx/svdotext.hxx
@@ -492,7 +492,8 @@ public:
 virtual void NbcSetOutlinerParaObject(std::unique_ptr 
pTextObject) override;
 void NbcSetOutlinerParaObjectForText( std::unique_ptr 
pTextObject, SdrText* pText );
 virtual OutlinerParaObject* GetOutlinerParaObject() const override;
-std::unique_ptr GetEditOutlinerParaObject() const;
+bool CanCreateEditOutlinerParaObject() const;
+std::unique_ptr CreateEditOutlinerParaObject() const;
 
 virtual void NbcReformatText() override;
 
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index ce6ef82348a0..087c51da5541 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -2905,7 +2905,7 @@ void DrawingML::WriteText( const Reference< XInterface >& 
rXIface, const OUStrin
 */
 if (pTxtObj->IsTextEditActive())
 {
-pParaObj = pTxtObj->GetEditOutlinerParaObject().release();
+pParaObj = pTxtObj->CreateEditOutlinerParaObject().release();
 bOwnParaObj = true;
 }
 else
diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx
index a5dc0f403271..98f3243e5461 100644
--- a/oox/source/export/vmlexport.cxx
+++ b/oox/source/export/vmlexport.cxx
@@ -1359,7 +1359,7 @@ sal_Int32 VMLExport::StartShape()
 */
 if (pTxtObj->IsTextEditActive())
 {
-pParaObj = pTxtObj->GetEditOutlinerParaObject().release();
+pParaObj = pTxtObj->CreateEditOutlinerParaObject().release();
 bOwnParaObj = true;
 }
 else
diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx 
b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
index 99be5ad168bb..c49d9ddad355 100644
--- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
@@ -578,8 +578,7 @@ void SlotManager::GetMenuState (SfxItemSet& rSet)
 SdrTextObj* pTextObj = dynamic_cast< SdrTextObj* >( 
pObj );
 if( pTextObj )
 {
-std::unique_ptr pParaObj = 
pTextObj->GetEditOutlinerParaObject();
-if( pParaObj )
+if( pTextObj->CanCreateEditOutlinerParaObject() )
 {
 bDisable = false;
 }
diff --git a/sd/source/ui/unoidl/unoobj.cxx b/sd/source/ui/unoidl/unoobj.cxx
index ae275dd57e82..d87821f8c677 100644
--- a/sd/source/ui/unoidl/unoobj.cxx
+++ b/sd/source/ui/unoidl/unoobj.cxx
@@ -852,8 +852,7 @@ bool SdXShape::IsEmptyPresObj() const
 if( pTextObj == nullptr )
 return true;
 
-const std::unique_ptr 
pParaObj(pTextObj->GetEditOutlinerParaObject());
-return !pParaObj;
+return !pTextObj->CanCreateEditOutlinerParaObject();
 }
 
 return false;
diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx
index 7fd0ce58368e..21a4d187c014 100644
--- a/sd/s

[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - editeng/source sd/inc sd/source

2020-01-04 Thread Serge Krot (via logerrit)
 editeng/source/uno/unotext2.cxx  |   57 +++---
 sd/inc/CustomAnimationEffect.hxx |4 
 sd/source/core/CustomAnimationEffect.cxx |  126 ---
 3 files changed, 130 insertions(+), 57 deletions(-)

New commits:
commit 0c8848394df6e0c8ac3149ffde1314e8e1171869
Author: Serge Krot 
AuthorDate: Thu Jan 2 12:24:27 2020 +0100
Commit: Noel Grandin 
CommitDate: Sat Jan 4 14:04:31 2020 +0100

tdf#129708 speed-up: reuse enumeration for each effect

Change-Id: I336278c5a9eec75a2a71fe4d04d2029a5a08e6a7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86102
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
(cherry picked from commit c97f9af5e47ea234ad709a1f66c1e8ed20640066)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86208
Reviewed-by: Noel Grandin 

diff --git a/editeng/source/uno/unotext2.cxx b/editeng/source/uno/unotext2.cxx
index ba9c66f3c37f..c76abfb581a8 100644
--- a/editeng/source/uno/unotext2.cxx
+++ b/editeng/source/uno/unotext2.cxx
@@ -45,40 +45,41 @@ SvxUnoTextContentEnumeration::SvxUnoTextContentEnumeration( 
const SvxUnoTextBase
 if( mrText.GetEditSource() )
 mpEditSource = mrText.GetEditSource()->Clone();
 mnNextParagraph = 0;
-for( sal_Int32 currentPara = 0; currentPara < 
mrText.GetEditSource()->GetTextForwarder()->GetParagraphCount(); currentPara++ )
+
+const SvxTextForwarder* pTextForwarder = 
mrText.GetEditSource()->GetTextForwarder();
+const sal_Int32 maxParaIndex = std::min( rSel.nEndPara + 1, 
pTextForwarder->GetParagraphCount() );
+
+for( sal_Int32 currentPara = rSel.nStartPara; currentPara < maxParaIndex; 
currentPara++ )
 {
-if( currentPara>=rSel.nStartPara && currentPara<=rSel.nEndPara )
+const SvxUnoTextRangeBaseVec& rRanges( mpEditSource->getRanges() );
+SvxUnoTextContent* pContent = nullptr;
+sal_Int32 nStartPos = 0;
+sal_Int32 nEndPos = pTextForwarder->GetTextLen( currentPara );
+if( currentPara == rSel.nStartPara )
+nStartPos = std::max(nStartPos, rSel.nStartPos);
+if( currentPara == rSel.nEndPara )
+nEndPos = std::min(nEndPos, rSel.nEndPos);
+ESelection aCurrentParaSel( currentPara, nStartPos, currentPara, 
nEndPos );
+for (auto const& elemRange : rRanges)
 {
-const SvxUnoTextRangeBaseVec& rRanges( mpEditSource->getRanges() );
-SvxUnoTextContent* pContent = nullptr;
-sal_Int32 nStartPos = 0;
-sal_Int32 nEndPos = 
mrText.GetEditSource()->GetTextForwarder()->GetTextLen( currentPara );
-if( currentPara == rSel.nStartPara )
-nStartPos = std::max(nStartPos, rSel.nStartPos);
-if( currentPara == rSel.nEndPara )
-nEndPos = std::min(nEndPos, rSel.nEndPos);
-ESelection aCurrentParaSel( currentPara, nStartPos, currentPara, 
nEndPos );
-for (auto const& elemRange : rRanges)
+if (pContent)
+break;
+SvxUnoTextContent* pIterContent = dynamic_cast< SvxUnoTextContent* 
>( elemRange );
+if( pIterContent && (pIterContent->mnParagraph == currentPara) )
 {
-if (pContent)
-break;
-SvxUnoTextContent* pIterContent = dynamic_cast< 
SvxUnoTextContent* >( elemRange );
-if( pIterContent && (pIterContent->mnParagraph == currentPara) 
)
+ESelection aIterSel = pIterContent->GetSelection();
+if( aIterSel == aCurrentParaSel )
 {
-ESelection aIterSel = pIterContent->GetSelection();
-if( aIterSel == aCurrentParaSel )
-{
-pContent = pIterContent;
-maContents.emplace_back(pContent );
-}
+pContent = pIterContent;
+maContents.emplace_back(pContent );
 }
 }
-if( pContent == nullptr )
-{
-pContent = new SvxUnoTextContent( mrText, currentPara );
-pContent->SetSelection( aCurrentParaSel );
-maContents.emplace_back(pContent );
-}
+}
+if( pContent == nullptr )
+{
+pContent = new SvxUnoTextContent( mrText, currentPara );
+pContent->SetSelection( aCurrentParaSel );
+maContents.emplace_back(pContent );
 }
 }
 }
diff --git a/sd/inc/CustomAnimationEffect.hxx b/sd/inc/CustomAnimationEffect.hxx
index cf2cfe7cb7a4..c705d10022f3 100644
--- a/sd/inc/CustomAnimationEffect.hxx
+++ b/sd/inc/CustomAnimationEffect.hxx
@@ -144,7 +144,7 @@ public:
 SAL_DLLPRIVATE OUString getPath() const;
 SAL_DLLPRIVATE void setPath( const OUStri

[Libreoffice-commits] core.git: editeng/source sd/inc sd/source

2020-01-03 Thread Serge Krot (via logerrit)
 editeng/source/uno/unotext2.cxx  |   57 +++---
 sd/inc/CustomAnimationEffect.hxx |4 
 sd/source/core/CustomAnimationEffect.cxx |  126 ---
 3 files changed, 130 insertions(+), 57 deletions(-)

New commits:
commit c97f9af5e47ea234ad709a1f66c1e8ed20640066
Author: Serge Krot 
AuthorDate: Thu Jan 2 12:24:27 2020 +0100
Commit: Thorsten Behrens 
CommitDate: Sat Jan 4 01:05:47 2020 +0100

tdf#129708 speed-up: reuse enumeration for each effect

Change-Id: I336278c5a9eec75a2a71fe4d04d2029a5a08e6a7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86102
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/editeng/source/uno/unotext2.cxx b/editeng/source/uno/unotext2.cxx
index ef9ab680adbe..72980c959a9c 100644
--- a/editeng/source/uno/unotext2.cxx
+++ b/editeng/source/uno/unotext2.cxx
@@ -46,40 +46,41 @@ SvxUnoTextContentEnumeration::SvxUnoTextContentEnumeration( 
const SvxUnoTextBase
 if( mrText.GetEditSource() )
 mpEditSource = mrText.GetEditSource()->Clone();
 mnNextParagraph = 0;
-for( sal_Int32 currentPara = 0; currentPara < 
mrText.GetEditSource()->GetTextForwarder()->GetParagraphCount(); currentPara++ )
+
+const SvxTextForwarder* pTextForwarder = 
mrText.GetEditSource()->GetTextForwarder();
+const sal_Int32 maxParaIndex = std::min( rSel.nEndPara + 1, 
pTextForwarder->GetParagraphCount() );
+
+for( sal_Int32 currentPara = rSel.nStartPara; currentPara < maxParaIndex; 
currentPara++ )
 {
-if( currentPara>=rSel.nStartPara && currentPara<=rSel.nEndPara )
+const SvxUnoTextRangeBaseVec& rRanges( mpEditSource->getRanges() );
+SvxUnoTextContent* pContent = nullptr;
+sal_Int32 nStartPos = 0;
+sal_Int32 nEndPos = pTextForwarder->GetTextLen( currentPara );
+if( currentPara == rSel.nStartPara )
+nStartPos = std::max(nStartPos, rSel.nStartPos);
+if( currentPara == rSel.nEndPara )
+nEndPos = std::min(nEndPos, rSel.nEndPos);
+ESelection aCurrentParaSel( currentPara, nStartPos, currentPara, 
nEndPos );
+for (auto const& elemRange : rRanges)
 {
-const SvxUnoTextRangeBaseVec& rRanges( mpEditSource->getRanges() );
-SvxUnoTextContent* pContent = nullptr;
-sal_Int32 nStartPos = 0;
-sal_Int32 nEndPos = 
mrText.GetEditSource()->GetTextForwarder()->GetTextLen( currentPara );
-if( currentPara == rSel.nStartPara )
-nStartPos = std::max(nStartPos, rSel.nStartPos);
-if( currentPara == rSel.nEndPara )
-nEndPos = std::min(nEndPos, rSel.nEndPos);
-ESelection aCurrentParaSel( currentPara, nStartPos, currentPara, 
nEndPos );
-for (auto const& elemRange : rRanges)
+if (pContent)
+break;
+SvxUnoTextContent* pIterContent = dynamic_cast< SvxUnoTextContent* 
>( elemRange );
+if( pIterContent && (pIterContent->mnParagraph == currentPara) )
 {
-if (pContent)
-break;
-SvxUnoTextContent* pIterContent = dynamic_cast< 
SvxUnoTextContent* >( elemRange );
-if( pIterContent && (pIterContent->mnParagraph == currentPara) 
)
+ESelection aIterSel = pIterContent->GetSelection();
+if( aIterSel == aCurrentParaSel )
 {
-ESelection aIterSel = pIterContent->GetSelection();
-if( aIterSel == aCurrentParaSel )
-{
-pContent = pIterContent;
-maContents.emplace_back(pContent );
-}
+pContent = pIterContent;
+maContents.emplace_back(pContent );
 }
 }
-if( pContent == nullptr )
-{
-pContent = new SvxUnoTextContent( mrText, currentPara );
-pContent->SetSelection( aCurrentParaSel );
-maContents.emplace_back(pContent );
-}
+}
+if( pContent == nullptr )
+{
+pContent = new SvxUnoTextContent( mrText, currentPara );
+pContent->SetSelection( aCurrentParaSel );
+maContents.emplace_back(pContent );
 }
 }
 }
diff --git a/sd/inc/CustomAnimationEffect.hxx b/sd/inc/CustomAnimationEffect.hxx
index 962ce9b995d9..26f1cef4a65c 100644
--- a/sd/inc/CustomAnimationEffect.hxx
+++ b/sd/inc/CustomAnimationEffect.hxx
@@ -144,7 +144,7 @@ public:
 SAL_DLLPRIVATE OUString getPath() const;
 SAL_DLLPRIVATE void setPath( const OUString& rPath );
 
-SAL_DLLPRIVATE bool checkForText();
+SAL_DLLPRIVATE bool checkForText( const std::vector* 
paragraphNumberingLevel = nullptr );
 SAL_DLLPRIVA

[Libreoffice-commits] core.git: sfx2/source

2019-11-22 Thread Serge Krot (via logerrit)
 sfx2/source/doc/guisaveas.cxx |   34 ++
 1 file changed, 34 insertions(+)

New commits:
commit 122468bf97f1ea456274991103a13489b8d5df58
Author: Serge Krot 
AuthorDate: Fri Nov 15 19:30:36 2019 +0100
Commit: Thorsten Behrens 
CommitDate: Fri Nov 22 14:30:43 2019 +0100

Warn user when output format does not support used encryption

Change-Id: Id5614cb7647b465c3edb2485fcd4f621cfee42b2
Reviewed-on: https://gerrit.libreoffice.org/82816
Reviewed-by: Serge Krot (CIB) 
Tested-by: Serge Krot (CIB) 
Reviewed-on: https://gerrit.libreoffice.org/82817
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 6a9012f63c1f..74a753d8da5c 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -724,6 +724,8 @@ sal_Int8 ModelData_Impl::CheckFilter( const OUString& 
aFilterName )
 ::comphelper::SequenceAsHashMap aDefFiltPropsHM = 
GetDocServiceDefaultFilterCheckFlags( SfxFilterFlags::IMPORT | 
SfxFilterFlags::EXPORT, SfxFilterFlags::NONE );
 SfxFilterFlags nDefFiltFlags = 
static_cast(aDefFiltPropsHM.getUnpackedValueOrDefault("Flags", 
sal_Int32(0) ));
 
+bool bAsk = false;
+
 // if the old filter is not acceptable
 // and there is no default filter or it is not acceptable for requested 
parameters then proceed with saveAs
 if ( ( aFiltPropsHM.empty() || !( nFiltFlags & SfxFilterFlags::EXPORT ) )
@@ -740,6 +742,38 @@ sal_Int8 ModelData_Impl::CheckFilter( const OUString& 
aFilterName )
&& !aDefFiltPropsHM.empty()
&& ( nDefFiltFlags & SfxFilterFlags::EXPORT ) && !( nDefFiltFlags & 
SfxFilterFlags::INTERNAL ))
 {
+bAsk = true;
+}
+
+// check if EncryptionData supports this output format
+{
+OUString aSupportedFilters;
+const ::comphelper::SequenceAsHashMap& rDocumentProperties = 
GetDocProps();
+const css::uno::Sequence aEncryptionData = 
rDocumentProperties.getUnpackedValueOrDefault("EncryptionData", 
css::uno::Sequence());
+if (aEncryptionData != css::uno::Sequence())
+{
+for (const css::beans::NamedValue& aNamedValue : aEncryptionData)
+{
+if (aNamedValue.Name == "SupportedFilters")
+{
+aNamedValue.Value >>= aSupportedFilters;
+}
+}
+}
+
+// if 'SupportedFilters' is empty assume that all filters are 
supported.
+if (!aSupportedFilters.isEmpty())
+{
+const OUString aSelectedFilter = 
aFiltPropsHM.getUnpackedValueOrDefault("UIName", OUString());
+
+aSupportedFilters = ";" + aSupportedFilters + ";";
+const OUString aSearchToken = ";" + aSelectedFilter + ";";
+bAsk = (aSupportedFilters.indexOf(aSearchToken) < 0);
+}
+}
+
+if (bAsk)
+{
 // the default filter is acceptable and the old filter is alien one
 // so ask to make a saveAs operation
 const OUString aUIName = 
aFiltPropsHM.getUnpackedValueOrDefault("UIName", OUString() );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'feature/cib_contract3756' - sfx2/source

2019-11-15 Thread Serge Krot (via logerrit)
 sfx2/source/doc/guisaveas.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit db8c0c5a5dea59000386db8aeaf5d94d4bb700a5
Author: Serge Krot 
AuthorDate: Fri Nov 15 19:30:36 2019 +0100
Commit: Serge Krot (CIB) 
CommitDate: Fri Nov 15 20:14:37 2019 +0100

Warn user when output format does not support used encryption

Change-Id: I346517445f358fe0e61497221dfde68bcb8ba25c
Reviewed-on: https://gerrit.libreoffice.org/82963
Reviewed-by: Serge Krot (CIB) 
Tested-by: Serge Krot (CIB) 

diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 508524b37220..654cfd1f5ed5 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -764,8 +764,10 @@ sal_Int8 ModelData_Impl::CheckFilter( const OUString& 
aFilterName )
 // if 'SupportedFilters' is empty assume that all filters are 
supported.
 if (!aSupportedFilters.isEmpty())
 {
+const OUString aSelectedFilter = 
aFiltPropsHM.getUnpackedValueOrDefault("UIName", OUString());
+
 aSupportedFilters = ";" + aSupportedFilters + ";";
-const OUString aSearchToken = ";" + aFilterName + ";";
+const OUString aSearchToken = ";" + aSelectedFilter + ";";
 bAsk = (aSupportedFilters.indexOf(aSearchToken) < 0);
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'feature/cib_contract3756' - sfx2/source

2019-11-15 Thread Serge Krot (via logerrit)
 sfx2/source/doc/guisaveas.cxx |   32 
 1 file changed, 32 insertions(+)

New commits:
commit d9afd58186543f556987d817622eae587cdf09a3
Author: Serge Krot 
AuthorDate: Fri Nov 15 19:30:36 2019 +0100
Commit: Serge Krot (CIB) 
CommitDate: Fri Nov 15 19:33:49 2019 +0100

Warn user when output format does not support used encryption

Change-Id: Id5614cb7647b465c3edb2485fcd4f621cfee42b2
Reviewed-on: https://gerrit.libreoffice.org/82816
Reviewed-by: Serge Krot (CIB) 
Tested-by: Serge Krot (CIB) 

diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 6a9012f63c1f..508524b37220 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -724,6 +724,8 @@ sal_Int8 ModelData_Impl::CheckFilter( const OUString& 
aFilterName )
 ::comphelper::SequenceAsHashMap aDefFiltPropsHM = 
GetDocServiceDefaultFilterCheckFlags( SfxFilterFlags::IMPORT | 
SfxFilterFlags::EXPORT, SfxFilterFlags::NONE );
 SfxFilterFlags nDefFiltFlags = 
static_cast(aDefFiltPropsHM.getUnpackedValueOrDefault("Flags", 
sal_Int32(0) ));
 
+bool bAsk = false;
+
 // if the old filter is not acceptable
 // and there is no default filter or it is not acceptable for requested 
parameters then proceed with saveAs
 if ( ( aFiltPropsHM.empty() || !( nFiltFlags & SfxFilterFlags::EXPORT ) )
@@ -740,6 +742,36 @@ sal_Int8 ModelData_Impl::CheckFilter( const OUString& 
aFilterName )
&& !aDefFiltPropsHM.empty()
&& ( nDefFiltFlags & SfxFilterFlags::EXPORT ) && !( nDefFiltFlags & 
SfxFilterFlags::INTERNAL ))
 {
+bAsk = true;
+}
+
+// check if EncryptionData supports this output format
+{
+OUString aSupportedFilters;
+const ::comphelper::SequenceAsHashMap& rDocumentProperties = 
GetDocProps();
+css::uno::Sequence aEncryptionData = 
rDocumentProperties.getUnpackedValueOrDefault("EncryptionData", 
css::uno::Sequence());
+if (aEncryptionData != css::uno::Sequence())
+{
+for (const css::beans::NamedValue& aNamedValue : aEncryptionData)
+{
+if (aNamedValue.Name == "SupportedFilters")
+{
+aNamedValue.Value >>= aSupportedFilters;
+}
+}
+}
+
+// if 'SupportedFilters' is empty assume that all filters are 
supported.
+if (!aSupportedFilters.isEmpty())
+{
+aSupportedFilters = ";" + aSupportedFilters + ";";
+const OUString aSearchToken = ";" + aFilterName + ";";
+bAsk = (aSupportedFilters.indexOf(aSearchToken) < 0);
+}
+}
+
+if (bAsk)
+{
 // the default filter is acceptable and the old filter is alien one
 // so ask to make a saveAs operation
 const OUString aUIName = 
aFiltPropsHM.getUnpackedValueOrDefault("UIName", OUString() );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: include/sfx2 offapi/com sfx2/source sw/qa

2019-11-13 Thread Serge Krot (via logerrit)
 include/sfx2/sfxsids.hrc |3 ++-
 include/sfx2/viewsh.hxx  |1 +
 offapi/com/sun/star/document/MediaDescriptor.idl |6 ++
 offapi/com/sun/star/frame/XModel2.idl|2 +-
 sfx2/source/appl/appuno.cxx  |   18 ++
 sfx2/source/doc/sfxbasemodel.cxx |5 +
 sfx2/source/view/viewfrm.cxx |   22 +-
 sfx2/source/view/viewsh.cxx  |9 +
 sw/qa/python/check_xmodel.py |4 +++-
 9 files changed, 62 insertions(+), 8 deletions(-)

New commits:
commit a474e2267cdcb1707333acdea1353d883d58c801
Author: Serge Krot 
AuthorDate: Tue Nov 12 21:52:05 2019 +0100
Commit: Samuel Mehrbrodt 
CommitDate: Wed Nov 13 12:45:39 2019 +0100

Add document level option to lock down edit doc command

Change-Id: I431fa4cd0daa52c885030dbadcc4052b5a890d34
Reviewed-on: https://gerrit.libreoffice.org/82553
Reviewed-by: Serge Krot (CIB) 
Tested-by: Serge Krot (CIB) 
Reviewed-on: https://gerrit.libreoffice.org/82576
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 

diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc
index 2e1dbf6ff748..9fa90a5f6226 100644
--- a/include/sfx2/sfxsids.hrc
+++ b/include/sfx2/sfxsids.hrc
@@ -268,8 +268,9 @@ class SvxSearchItem;
 #define SID_DIALOG_PARENT   (SID_SFX_START + 1735)
 #define SID_LOCK_PRINT  (SID_SFX_START + 1736)
 #define SID_LOCK_SAVE   (SID_SFX_START + 1737)
+#define SID_LOCK_EDITDOC(SID_SFX_START + 1738)
 
-//  SID_SFX_free_START  (SID_SFX_START + 1738)
+//  SID_SFX_free_START  (SID_SFX_START + 1739)
 //  SID_SFX_free_END(SID_SFX_START + 3999)
 
 #define SID_OPEN_NEW_VIEW   (SID_SFX_START + 520)
diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx
index a1a225aa1b28..d65fae656b16 100644
--- a/include/sfx2/viewsh.hxx
+++ b/include/sfx2/viewsh.hxx
@@ -292,6 +292,7 @@ public:
 bool isExportLocked();
 bool isPrintLocked();
 bool isSaveLocked();
+bool isEditDocLocked();
 
 SAL_DLLPRIVATE SfxInPlaceClient* GetUIActiveIPClient_Impl() const;
 SAL_DLLPRIVATE void AddContextMenuInterceptor_Impl( const 
css::uno::Reference < css::ui::XContextMenuInterceptor >& xInterceptor );
diff --git a/offapi/com/sun/star/document/MediaDescriptor.idl 
b/offapi/com/sun/star/document/MediaDescriptor.idl
index 72ee23fcd2ee..728ef4ab4a29 100644
--- a/offapi/com/sun/star/document/MediaDescriptor.idl
+++ b/offapi/com/sun/star/document/MediaDescriptor.idl
@@ -590,6 +590,12 @@ service MediaDescriptor
 @since LibreOffice 6.4
  */
 [optional,property] boolean LockSave;
+
+/** Setting this option will disable switching to edit mode from read-only 
mode.
+ *
+@since LibreOffice 6.4
+ */
+[optional,property] boolean LockEditDoc;
 };
 
 
diff --git a/offapi/com/sun/star/frame/XModel2.idl 
b/offapi/com/sun/star/frame/XModel2.idl
index 128d5ced20d6..4221a527c380 100644
--- a/offapi/com/sun/star/frame/XModel2.idl
+++ b/offapi/com/sun/star/frame/XModel2.idl
@@ -146,7 +146,7 @@ interface XModel2 : com::sun::star::frame::XModel
 com::sun::star::document::MediaDescriptor::LockExport
 com::sun::star::document::MediaDescriptor::LockPrint
 com::sun::star::document::MediaDescriptor::LockSave
-
+com::sun::star::document::MediaDescriptor::LockEditDoc
 
 
 @throws com::sun::star::lang::IllegalArgumentException When trying to 
set an unsupported property
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index c633978076d9..bfbe90dc896b 100644
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
@@ -173,6 +173,7 @@ static char const sLockContentExtraction[] = 
"LockContentExtraction";
 static char const sLockExport[] = "LockExport";
 static char const sLockPrint[] = "LockPrint";
 static char const sLockSave[] = "LockSave";
+static char const sLockEditDoc[] = "LockEditDoc";
 
 static bool isMediaDescriptor( sal_uInt16 nSlotId )
 {
@@ -879,6 +880,14 @@ void TransformParameters( sal_uInt16 nSlotId, const 
uno::Sequence>= bVal);
+DBG_ASSERT( bOK, "invalid type for LockEditDoc" );
+if (bOK)
+rSet.Put( SfxBoolItem( SID_LOCK_EDITDOC, bVal ) );
+}
 #ifdef DBG_UTIL
 else
 --nFoundArgs;
@@ -1104,6 +1113,8 @@ void TransformItems( sal_uInt16 nSlotId, const 
SfxItemSet& rSet, uno::Sequence(nId));
@@ -1681,6 +1694,11 @@ void TransformItems( sal_uInt16 nSlotId, const 
SfxItemSet& rSet, uno::Sequence(pItem)->GetValue() ;
 }
+if ( rSet.GetItemState( SID_LOCK_EDIT

[Libreoffice-commits] core.git: Branch 'feature/cib_contract3756' - include/sfx2 offapi/com sfx2/source sw/qa

2019-11-12 Thread Serge Krot (via logerrit)
 include/sfx2/sfxsids.hrc |3 ++-
 include/sfx2/viewsh.hxx  |1 +
 offapi/com/sun/star/document/MediaDescriptor.idl |6 ++
 offapi/com/sun/star/frame/XModel2.idl|1 +
 sfx2/source/appl/appuno.cxx  |   18 ++
 sfx2/source/doc/sfxbasemodel.cxx |5 +
 sfx2/source/view/viewfrm.cxx |   22 +-
 sfx2/source/view/viewsh.cxx  |9 +
 sw/qa/python/check_xmodel.py |4 +++-
 9 files changed, 62 insertions(+), 7 deletions(-)

New commits:
commit 2c3a9d58bcb46dafe1901466861abdf24bab6744
Author: Serge Krot 
AuthorDate: Tue Nov 12 21:52:05 2019 +0100
Commit: Serge Krot (CIB) 
CommitDate: Tue Nov 12 21:57:53 2019 +0100

Add document level option to lock down edit doc command

Change-Id: I431fa4cd0daa52c885030dbadcc4052b5a890d34
Reviewed-on: https://gerrit.libreoffice.org/82553
Reviewed-by: Serge Krot (CIB) 
Tested-by: Serge Krot (CIB) 

diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc
index 2e1dbf6ff748..9fa90a5f6226 100644
--- a/include/sfx2/sfxsids.hrc
+++ b/include/sfx2/sfxsids.hrc
@@ -268,8 +268,9 @@ class SvxSearchItem;
 #define SID_DIALOG_PARENT   (SID_SFX_START + 1735)
 #define SID_LOCK_PRINT  (SID_SFX_START + 1736)
 #define SID_LOCK_SAVE   (SID_SFX_START + 1737)
+#define SID_LOCK_EDITDOC(SID_SFX_START + 1738)
 
-//  SID_SFX_free_START  (SID_SFX_START + 1738)
+//  SID_SFX_free_START  (SID_SFX_START + 1739)
 //  SID_SFX_free_END(SID_SFX_START + 3999)
 
 #define SID_OPEN_NEW_VIEW   (SID_SFX_START + 520)
diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx
index a1a225aa1b28..d65fae656b16 100644
--- a/include/sfx2/viewsh.hxx
+++ b/include/sfx2/viewsh.hxx
@@ -292,6 +292,7 @@ public:
 bool isExportLocked();
 bool isPrintLocked();
 bool isSaveLocked();
+bool isEditDocLocked();
 
 SAL_DLLPRIVATE SfxInPlaceClient* GetUIActiveIPClient_Impl() const;
 SAL_DLLPRIVATE void AddContextMenuInterceptor_Impl( const 
css::uno::Reference < css::ui::XContextMenuInterceptor >& xInterceptor );
diff --git a/offapi/com/sun/star/document/MediaDescriptor.idl 
b/offapi/com/sun/star/document/MediaDescriptor.idl
index 72ee23fcd2ee..728ef4ab4a29 100644
--- a/offapi/com/sun/star/document/MediaDescriptor.idl
+++ b/offapi/com/sun/star/document/MediaDescriptor.idl
@@ -590,6 +590,12 @@ service MediaDescriptor
 @since LibreOffice 6.4
  */
 [optional,property] boolean LockSave;
+
+/** Setting this option will disable switching to edit mode from read-only 
mode.
+ *
+@since LibreOffice 6.4
+ */
+[optional,property] boolean LockEditDoc;
 };
 
 
diff --git a/offapi/com/sun/star/frame/XModel2.idl 
b/offapi/com/sun/star/frame/XModel2.idl
index bab2427a3617..b616d938e8ec 100644
--- a/offapi/com/sun/star/frame/XModel2.idl
+++ b/offapi/com/sun/star/frame/XModel2.idl
@@ -146,6 +146,7 @@ interface XModel2 : com::sun::star::frame::XModel
 com::sun::star::document::MediaDescriptor::LockExport
 com::sun::star::document::MediaDescriptor::LockPrint
 com::sun::star::document::MediaDescriptor::LockSave
+com::sun::star::document::MediaDescriptor::LockEditDoc
 
com::sun::star::document::MediaDescriptor::EncryptionData
 
 
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index c633978076d9..bfbe90dc896b 100644
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
@@ -173,6 +173,7 @@ static char const sLockContentExtraction[] = 
"LockContentExtraction";
 static char const sLockExport[] = "LockExport";
 static char const sLockPrint[] = "LockPrint";
 static char const sLockSave[] = "LockSave";
+static char const sLockEditDoc[] = "LockEditDoc";
 
 static bool isMediaDescriptor( sal_uInt16 nSlotId )
 {
@@ -879,6 +880,14 @@ void TransformParameters( sal_uInt16 nSlotId, const 
uno::Sequence>= bVal);
+DBG_ASSERT( bOK, "invalid type for LockEditDoc" );
+if (bOK)
+rSet.Put( SfxBoolItem( SID_LOCK_EDITDOC, bVal ) );
+}
 #ifdef DBG_UTIL
 else
 --nFoundArgs;
@@ -1104,6 +1113,8 @@ void TransformItems( sal_uInt16 nSlotId, const 
SfxItemSet& rSet, uno::Sequence(nId));
@@ -1681,6 +1694,11 @@ void TransformItems( sal_uInt16 nSlotId, const 
SfxItemSet& rSet, uno::Sequence(pItem)->GetValue() ;
 }
+if ( rSet.GetItemState( SID_LOCK_EDITDOC, false,  ) == 
SfxItemState::SET )
+{
+pValue[nActProp].Name = sLockEditDoc;
+pValue[nActProp++].Value <<=

[Libreoffice-commits] core.git: Branch 'feature/cib_contract3756' - 41 commits - basctl/source basic/source chart2/source cui/source extras/source framework/source .gitreview icon-themes/colibre icon-

2019-11-09 Thread Serge Krot (via logerrit)
Rebased ref, commits from common ancestor:
commit 8151de3b7c7dff6313e7f0a6d68a21a3216d440d
Author: Serge Krot 
AuthorDate: Fri Nov 8 21:14:28 2019 +0100
Commit: Thorsten Behrens 
CommitDate: Sat Nov 9 19:56:42 2019 +0100

Source code clean up: do not clean up EncryptionData during SaveAs

Change-Id: I1213ec55d6dc42f062930467976de45c73152f0b
Reviewed-on: https://gerrit.libreoffice.org/82326
Reviewed-by: Serge Krot (CIB) 
Tested-by: Serge Krot (CIB) 

diff --git a/package/source/zippackage/ZipPackage.cxx 
b/package/source/zippackage/ZipPackage.cxx
index cf8df0b417cc..63178c7fec24 100644
--- a/package/source/zippackage/ZipPackage.cxx
+++ b/package/source/zippackage/ZipPackage.cxx
@@ -1748,27 +1748,9 @@ void SAL_CALL ZipPackage::setPropertyValue( const 
OUString& aPropertyName, const
 // this property is only necessary to support raw passwords in storage 
API;
 // because of this support the storage has to operate with more than 
one key dependent on storage generation algorithm;
 // when this support is removed, the storage will get only one key 
from outside
-uno::Sequence< beans::NamedValue > aKeys;
-if ( !( aValue >>= aKeys ) )
+if ( !( aValue >>= m_aStorageEncryptionKeys ) )
 throw IllegalArgumentException(THROW_WHERE, uno::Reference< 
uno::XInterface >(), 2 );
 
-/*if ( aKeys.hasElements() )
-{
-bool bHasSHA256 = false;
-bool bHasSHA1 = false;
-for ( const auto& rKey : std::as_const(aKeys) )
-{
-if ( rKey.Name == PACKAGE_ENCRYPTIONDATA_SHA256UTF8 )
-bHasSHA256 = true;
-if ( rKey.Name == PACKAGE_ENCRYPTIONDATA_SHA1UTF8 )
-bHasSHA1 = true;
-}
-
-if ( !bHasSHA256 && !bHasSHA1 )
-throw IllegalArgumentException(THROW_WHERE "Expected keys are 
not provided!", uno::Reference< uno::XInterface >(), 2 );
-}*/
-
-m_aStorageEncryptionKeys = aKeys;
 m_aEncryptionKey.realloc( 0 );
 }
 else if ( aPropertyName == ENCRYPTION_ALGORITHMS_PROPERTY )
diff --git a/sfx2/source/dialog/filedlghelper.cxx 
b/sfx2/source/dialog/filedlghelper.cxx
index 545f520a7a1d..27e4284b258c 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -1414,8 +1414,13 @@ ErrCode FileDialogHelper_Impl::execute( 
std::vector& rpURLList,
 
 // the password will be set in case user decide so
 rpSet->ClearItem( SID_PASSWORDINTERACTION );
-rpSet->ClearItem( SID_PASSWORD );
-//rpSet->ClearItem( SID_ENCRYPTIONDATA );
+if (rpSet->HasItem( SID_PASSWORD ))
+{
+// As the SID_ENCRYPTIONDATA and SID_PASSWORD are using for 
setting password together, we need to clear them both.
+// Note: Do not remove SID_ENCRYPTIONDATA without SID_PASSWORD
+rpSet->ClearItem( SID_PASSWORD );
+rpSet->ClearItem( SID_ENCRYPTIONDATA );
+}
 rpSet->ClearItem( SID_RECOMMENDREADONLY );
 rpSet->ClearItem( SID_MODIFYPASSWORDINFO );
 
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 9e386d8c5964..512fe81d6efd 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -809,22 +809,9 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest )
 }
 
 
-bool bPreselectPassword = false;
 const SfxStringItem* pOldPasswordItem = 
SfxItemSet::GetItem(GetMedium()->GetItemSet(), SID_PASSWORD, 
false);
-if (pOldPasswordItem)
-{
-bPreselectPassword = true;
-}
-else
-{
-const SfxUnoAnyItem* pOldEncryptionDataItem = 
SfxItemSet::GetItem(GetMedium()->GetItemSet(), 
SID_ENCRYPTIONDATA, false);
-if (pOldEncryptionDataItem)
-{
-uno::Sequence< beans::NamedValue > aEncryptionData;
-pOldEncryptionDataItem->GetValue() >>= aEncryptionData;
-
-}
-}
+const SfxUnoAnyItem* pOldEncryptionDataItem = 
SfxItemSet::GetItem(GetMedium()->GetItemSet(), 
SID_ENCRYPTIONDATA, false);
+bool bPreselectPassword = (pOldPasswordItem && 
pOldEncryptionDataItem);
 
 uno::Sequence< beans::PropertyValue > aDispatchArgs;
 if ( rReq.GetArgs() )
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index ae58f9a88e97..174b06c761f3 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -2764,11 +2764,13 @@ bool SfxObjectShell::PreDoSaveAs_Impl(const OUString& 
rFileName, const OUString&
 std::unique_ptr pMergedParams(new SfxAllI

[Libreoffice-commits] core.git: sfx2/source

2019-11-09 Thread Serge Krot (via logerrit)
 sfx2/source/view/viewfrm.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit b505ca5b9c31b3d9c639406d03a25bea4e914242
Author: Serge Krot 
AuthorDate: Fri Nov 8 17:31:49 2019 +0100
Commit: Thorsten Behrens 
CommitDate: Sat Nov 9 11:41:28 2019 +0100

Switch to read-only mode: do not force reload document if possible

Change-Id: I5f83e7626e58cb4b558b54130b725b1041b7142f
Reviewed-on: https://gerrit.libreoffice.org/82313
Reviewed-by: Serge Krot (CIB) 
Tested-by: Serge Krot (CIB) 
(cherry picked from commit b92e774bbfe83aba80c8d480399887394937cc96)
Reviewed-on: https://gerrit.libreoffice.org/82314
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
old mode 100644
new mode 100755
index fafe5df417dc..e3f39e3aab40
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -459,6 +459,8 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
  || pVersionItem )
 // <- tdf#82744
 {
+bNeedsReload = true;
+
 bool bOK = false;
 bool bRetryIgnoringLock = false;
 bool bOpenTemplate = false;
@@ -601,7 +603,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
 }
 }
 
-rReq.AppendItem( SfxBoolItem( SID_FORCERELOAD, true) );
+rReq.AppendItem( SfxBoolItem( SID_FORCERELOAD, bNeedsReload) );
 rReq.AppendItem( SfxBoolItem( SID_SILENT, true ));
 
 [[fallthrough]]; //TODO ???
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'feature/cib_contract3756' - 213 commits - accessibility/source android/Bootstrap android/source avmedia/source basctl/source basic/inc basic/source bridges/sour

2019-11-08 Thread Serge Krot (via logerrit)
Rebased ref, commits from common ancestor:
commit 6afefb6bb8d7a5593a18325df58e47f7ba076777
Author: Serge Krot 
AuthorDate: Fri Nov 8 21:14:28 2019 +0100
Commit: Thorsten Behrens 
CommitDate: Fri Nov 8 23:25:10 2019 +0100

Source code clean up: do not clean up EncryptionData during SaveAs

Change-Id: I1213ec55d6dc42f062930467976de45c73152f0b
Reviewed-on: https://gerrit.libreoffice.org/82326
Reviewed-by: Serge Krot (CIB) 
Tested-by: Serge Krot (CIB) 

diff --git a/package/source/zippackage/ZipPackage.cxx 
b/package/source/zippackage/ZipPackage.cxx
index cf8df0b417cc..63178c7fec24 100644
--- a/package/source/zippackage/ZipPackage.cxx
+++ b/package/source/zippackage/ZipPackage.cxx
@@ -1748,27 +1748,9 @@ void SAL_CALL ZipPackage::setPropertyValue( const 
OUString& aPropertyName, const
 // this property is only necessary to support raw passwords in storage 
API;
 // because of this support the storage has to operate with more than 
one key dependent on storage generation algorithm;
 // when this support is removed, the storage will get only one key 
from outside
-uno::Sequence< beans::NamedValue > aKeys;
-if ( !( aValue >>= aKeys ) )
+if ( !( aValue >>= m_aStorageEncryptionKeys ) )
 throw IllegalArgumentException(THROW_WHERE, uno::Reference< 
uno::XInterface >(), 2 );
 
-/*if ( aKeys.hasElements() )
-{
-bool bHasSHA256 = false;
-bool bHasSHA1 = false;
-for ( const auto& rKey : std::as_const(aKeys) )
-{
-if ( rKey.Name == PACKAGE_ENCRYPTIONDATA_SHA256UTF8 )
-bHasSHA256 = true;
-if ( rKey.Name == PACKAGE_ENCRYPTIONDATA_SHA1UTF8 )
-bHasSHA1 = true;
-}
-
-if ( !bHasSHA256 && !bHasSHA1 )
-throw IllegalArgumentException(THROW_WHERE "Expected keys are 
not provided!", uno::Reference< uno::XInterface >(), 2 );
-}*/
-
-m_aStorageEncryptionKeys = aKeys;
 m_aEncryptionKey.realloc( 0 );
 }
 else if ( aPropertyName == ENCRYPTION_ALGORITHMS_PROPERTY )
diff --git a/sfx2/source/dialog/filedlghelper.cxx 
b/sfx2/source/dialog/filedlghelper.cxx
index 545f520a7a1d..27e4284b258c 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -1414,8 +1414,13 @@ ErrCode FileDialogHelper_Impl::execute( 
std::vector& rpURLList,
 
 // the password will be set in case user decide so
 rpSet->ClearItem( SID_PASSWORDINTERACTION );
-rpSet->ClearItem( SID_PASSWORD );
-//rpSet->ClearItem( SID_ENCRYPTIONDATA );
+if (rpSet->HasItem( SID_PASSWORD ))
+{
+// As the SID_ENCRYPTIONDATA and SID_PASSWORD are using for 
setting password together, we need to clear them both.
+// Note: Do not remove SID_ENCRYPTIONDATA without SID_PASSWORD
+rpSet->ClearItem( SID_PASSWORD );
+rpSet->ClearItem( SID_ENCRYPTIONDATA );
+}
 rpSet->ClearItem( SID_RECOMMENDREADONLY );
 rpSet->ClearItem( SID_MODIFYPASSWORDINFO );
 
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 9e386d8c5964..512fe81d6efd 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -809,22 +809,9 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest )
 }
 
 
-bool bPreselectPassword = false;
 const SfxStringItem* pOldPasswordItem = 
SfxItemSet::GetItem(GetMedium()->GetItemSet(), SID_PASSWORD, 
false);
-if (pOldPasswordItem)
-{
-bPreselectPassword = true;
-}
-else
-{
-const SfxUnoAnyItem* pOldEncryptionDataItem = 
SfxItemSet::GetItem(GetMedium()->GetItemSet(), 
SID_ENCRYPTIONDATA, false);
-if (pOldEncryptionDataItem)
-{
-uno::Sequence< beans::NamedValue > aEncryptionData;
-pOldEncryptionDataItem->GetValue() >>= aEncryptionData;
-
-}
-}
+const SfxUnoAnyItem* pOldEncryptionDataItem = 
SfxItemSet::GetItem(GetMedium()->GetItemSet(), 
SID_ENCRYPTIONDATA, false);
+bool bPreselectPassword = (pOldPasswordItem && 
pOldEncryptionDataItem);
 
 uno::Sequence< beans::PropertyValue > aDispatchArgs;
 if ( rReq.GetArgs() )
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index ae58f9a88e97..174b06c761f3 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -2764,11 +2764,13 @@ bool SfxObjectShell::PreDoSaveAs_Impl(const OUString& 
rFileName, const OUString&
 std::unique_ptr pMergedParams(new SfxAllI

[Libreoffice-commits] core.git: Branch 'feature/cib_contract3756' - package/source sfx2/source

2019-11-08 Thread Serge Krot (via logerrit)
 package/source/zippackage/ZipPackage.cxx |   20 +---
 sfx2/source/dialog/filedlghelper.cxx |9 +++--
 sfx2/source/doc/objserv.cxx  |   17 ++---
 sfx2/source/doc/objstor.cxx  |8 +---
 4 files changed, 15 insertions(+), 39 deletions(-)

New commits:
commit 6cee6c0e9dd98ec6f22e1191121a0e6f8d6676fc
Author: Serge Krot 
AuthorDate: Fri Nov 8 21:14:28 2019 +0100
Commit: Serge Krot (CIB) 
CommitDate: Fri Nov 8 21:19:20 2019 +0100

Source code clean up: do not clean up EncryptionData during SaveAs

Change-Id: I1213ec55d6dc42f062930467976de45c73152f0b
Reviewed-on: https://gerrit.libreoffice.org/82326
Reviewed-by: Serge Krot (CIB) 
Tested-by: Serge Krot (CIB) 

diff --git a/package/source/zippackage/ZipPackage.cxx 
b/package/source/zippackage/ZipPackage.cxx
index cf8df0b417cc..63178c7fec24 100644
--- a/package/source/zippackage/ZipPackage.cxx
+++ b/package/source/zippackage/ZipPackage.cxx
@@ -1748,27 +1748,9 @@ void SAL_CALL ZipPackage::setPropertyValue( const 
OUString& aPropertyName, const
 // this property is only necessary to support raw passwords in storage 
API;
 // because of this support the storage has to operate with more than 
one key dependent on storage generation algorithm;
 // when this support is removed, the storage will get only one key 
from outside
-uno::Sequence< beans::NamedValue > aKeys;
-if ( !( aValue >>= aKeys ) )
+if ( !( aValue >>= m_aStorageEncryptionKeys ) )
 throw IllegalArgumentException(THROW_WHERE, uno::Reference< 
uno::XInterface >(), 2 );
 
-/*if ( aKeys.hasElements() )
-{
-bool bHasSHA256 = false;
-bool bHasSHA1 = false;
-for ( const auto& rKey : std::as_const(aKeys) )
-{
-if ( rKey.Name == PACKAGE_ENCRYPTIONDATA_SHA256UTF8 )
-bHasSHA256 = true;
-if ( rKey.Name == PACKAGE_ENCRYPTIONDATA_SHA1UTF8 )
-bHasSHA1 = true;
-}
-
-if ( !bHasSHA256 && !bHasSHA1 )
-throw IllegalArgumentException(THROW_WHERE "Expected keys are 
not provided!", uno::Reference< uno::XInterface >(), 2 );
-}*/
-
-m_aStorageEncryptionKeys = aKeys;
 m_aEncryptionKey.realloc( 0 );
 }
 else if ( aPropertyName == ENCRYPTION_ALGORITHMS_PROPERTY )
diff --git a/sfx2/source/dialog/filedlghelper.cxx 
b/sfx2/source/dialog/filedlghelper.cxx
index 4347715a15ab..3b982bbcacf3 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -1414,8 +1414,13 @@ ErrCode FileDialogHelper_Impl::execute( 
std::vector& rpURLList,
 
 // the password will be set in case user decide so
 rpSet->ClearItem( SID_PASSWORDINTERACTION );
-rpSet->ClearItem( SID_PASSWORD );
-//rpSet->ClearItem( SID_ENCRYPTIONDATA );
+if (rpSet->HasItem( SID_PASSWORD ))
+{
+// As the SID_ENCRYPTIONDATA and SID_PASSWORD are using for 
setting password together, we need to clear them both.
+// Note: Do not remove SID_ENCRYPTIONDATA without SID_PASSWORD
+rpSet->ClearItem( SID_PASSWORD );
+rpSet->ClearItem( SID_ENCRYPTIONDATA );
+}
 rpSet->ClearItem( SID_RECOMMENDREADONLY );
 rpSet->ClearItem( SID_MODIFYPASSWORDINFO );
 
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 9e386d8c5964..512fe81d6efd 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -809,22 +809,9 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest )
 }
 
 
-bool bPreselectPassword = false;
 const SfxStringItem* pOldPasswordItem = 
SfxItemSet::GetItem(GetMedium()->GetItemSet(), SID_PASSWORD, 
false);
-if (pOldPasswordItem)
-{
-bPreselectPassword = true;
-}
-else
-{
-const SfxUnoAnyItem* pOldEncryptionDataItem = 
SfxItemSet::GetItem(GetMedium()->GetItemSet(), 
SID_ENCRYPTIONDATA, false);
-if (pOldEncryptionDataItem)
-{
-uno::Sequence< beans::NamedValue > aEncryptionData;
-pOldEncryptionDataItem->GetValue() >>= aEncryptionData;
-
-}
-}
+const SfxUnoAnyItem* pOldEncryptionDataItem = 
SfxItemSet::GetItem(GetMedium()->GetItemSet(), 
SID_ENCRYPTIONDATA, false);
+bool bPreselectPassword = (pOldPasswordItem && 
pOldEncryptionDataItem);
 
 uno::Sequence< beans::PropertyValue > aDispatchArgs;
 if ( rReq.GetArgs() )
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.c

[Libreoffice-commits] core.git: Branch 'feature/cib_contract3756' - sfx2/source

2019-11-08 Thread Serge Krot (via logerrit)
 sfx2/source/view/viewfrm.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit b92e774bbfe83aba80c8d480399887394937cc96
Author: Serge Krot 
AuthorDate: Fri Nov 8 17:31:49 2019 +0100
Commit: Serge Krot (CIB) 
CommitDate: Fri Nov 8 17:39:46 2019 +0100

Switch to read-only mode: do not force reload document if possible

Change-Id: I5f83e7626e58cb4b558b54130b725b1041b7142f
Reviewed-on: https://gerrit.libreoffice.org/82313
Reviewed-by: Serge Krot (CIB) 
Tested-by: Serge Krot (CIB) 

diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
old mode 100644
new mode 100755
index fafe5df417dc..e3f39e3aab40
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -459,6 +459,8 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
  || pVersionItem )
 // <- tdf#82744
 {
+bNeedsReload = true;
+
 bool bOK = false;
 bool bRetryIgnoringLock = false;
 bool bOpenTemplate = false;
@@ -601,7 +603,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
 }
 }
 
-rReq.AppendItem( SfxBoolItem( SID_FORCERELOAD, true) );
+rReq.AppendItem( SfxBoolItem( SID_FORCERELOAD, bNeedsReload) );
 rReq.AppendItem( SfxBoolItem( SID_SILENT, true ));
 
 [[fallthrough]]; //TODO ???
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: framework/inc framework/Library_fwk.mk framework/source

2019-11-04 Thread Serge Krot (via logerrit)
 framework/Library_fwk.mk   |1 
 framework/inc/uielement/FixedImageToolbarController.hxx|   59 ++
 framework/inc/uielement/toolbarmerger.hxx  |1 
 framework/source/uielement/FixedImageToolbarController.cxx |  113 +
 framework/source/uielement/toolbarmerger.cxx   |3 
 5 files changed, 177 insertions(+)

New commits:
commit 2187cff2d452e20aa1fdfd5d8aa7473242cd1eb6
Author: Serge Krot 
AuthorDate: Fri Oct 18 17:40:11 2019 +0200
Commit: Thorsten Behrens 
CommitDate: Mon Nov 4 01:20:00 2019 +0100

Toolbar: Added usage of ImageControl as toolbar control

Reviewed-on: https://gerrit.libreoffice.org/81064
Reviewed-by: Serge Krot (CIB) 
Tested-by: Serge Krot (CIB) 
(cherry picked from commit 48f945a3be16ee0eba0c526e51280dc8deafc316)

Change-Id: I2536a505650b6e4c98e79f749c3b237518cc995d
Reviewed-on: https://gerrit.libreoffice.org/81872
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/framework/Library_fwk.mk b/framework/Library_fwk.mk
index 5d59402c2be5..1fe75ccab4b7 100644
--- a/framework/Library_fwk.mk
+++ b/framework/Library_fwk.mk
@@ -132,6 +132,7 @@ $(eval $(call gb_Library_add_exception_objects,fwk,\
 framework/source/uielement/controlmenucontroller \
 framework/source/uielement/dropdownboxtoolbarcontroller \
 framework/source/uielement/edittoolbarcontroller \
+framework/source/uielement/FixedImageToolbarController \
 framework/source/uielement/FixedTextToolbarController \
 framework/source/uielement/genericstatusbarcontroller \
 framework/source/uielement/generictoolbarcontroller \
diff --git a/framework/inc/uielement/FixedImageToolbarController.hxx 
b/framework/inc/uielement/FixedImageToolbarController.hxx
new file mode 100644
index ..2fa55e4e8cc5
--- /dev/null
+++ b/framework/inc/uielement/FixedImageToolbarController.hxx
@@ -0,0 +1,59 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_FRAMEWORK_INC_UIELEMENT_FIXEDIMAGETOOLBARCONTROLLER_HXX
+#define INCLUDED_FRAMEWORK_INC_UIELEMENT_FIXEDIMAGETOOLBARCONTROLLER_HXX
+
+#include 
+#include 
+
+#include 
+
+class ToolBox;
+class ImageControl;
+
+namespace framework
+{
+class FixedImageToolbarController : public ComplexToolbarController
+{
+public:
+FixedImageToolbarController(const 
css::uno::Reference& rxContext,
+const css::uno::Reference& 
rFrame,
+ToolBox* pToolBar, sal_uInt16 nID, const 
OUString& aCommand);
+
+// XComponent
+virtual void SAL_CALL dispose() override;
+
+void CheckAndUpdateImages();
+
+protected:
+virtual void executeControlCommand(const css::frame::ControlCommand& 
rControlCommand) override;
+
+protected:
+DECL_LINK(MiscOptionsChanged, LinkParamNone*, void);
+
+private:
+VclPtr m_pFixedImageControl;
+sal_Int16 m_eSymbolSize;
+};
+} // namespace framework
+
+#endif // INCLUDED_FRAMEWORK_INC_UIELEMENT_FIXEDIMAGETOOLBARCONTROLLER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
diff --git a/framework/inc/uielement/toolbarmerger.hxx 
b/framework/inc/uielement/toolbarmerger.hxx
index cfe236f8328a..bb41a2bece60 100644
--- a/framework/inc/uielement/toolbarmerger.hxx
+++ b/framework/inc/uielement/toolbarmerger.hxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
diff --git a/framework/source/uielement/FixedImageToolbarController.cxx 
b/framework/source/uielement/FixedImageToolbarController.cxx
new file mode 100644
index ..6338287a8dd9
--- /dev/null
+++ b/framework/source/uielement/FixedImageToolbarController.cxx
@@ -0,0 +1,113 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * T

[Libreoffice-commits] core.git: Branch 'feature/cib_contract3756' - framework/inc framework/Library_fwk.mk framework/source

2019-11-01 Thread Serge Krot (via logerrit)
Rebased ref, commits from common ancestor:
commit d2253e592c644c99c0e17ced2d87a1cd3687254e
Author: Serge Krot 
AuthorDate: Fri Oct 18 17:40:11 2019 +0200
Commit: Thorsten Behrens 
CommitDate: Fri Nov 1 13:41:06 2019 +0100

Toolbar: Added usage of ImageControl as toolbar control

Change-Id: I2536a505650b6e4c98e79f749c3b237518cc995d
Reviewed-on: https://gerrit.libreoffice.org/81064
Reviewed-by: Serge Krot (CIB) 
Tested-by: Serge Krot (CIB) 

diff --git a/framework/Library_fwk.mk b/framework/Library_fwk.mk
index 5d59402c2be5..1fe75ccab4b7 100644
--- a/framework/Library_fwk.mk
+++ b/framework/Library_fwk.mk
@@ -132,6 +132,7 @@ $(eval $(call gb_Library_add_exception_objects,fwk,\
 framework/source/uielement/controlmenucontroller \
 framework/source/uielement/dropdownboxtoolbarcontroller \
 framework/source/uielement/edittoolbarcontroller \
+framework/source/uielement/FixedImageToolbarController \
 framework/source/uielement/FixedTextToolbarController \
 framework/source/uielement/genericstatusbarcontroller \
 framework/source/uielement/generictoolbarcontroller \
diff --git a/framework/inc/uielement/FixedImageToolbarController.hxx 
b/framework/inc/uielement/FixedImageToolbarController.hxx
new file mode 100755
index ..54afb9ee29fe
--- /dev/null
+++ b/framework/inc/uielement/FixedImageToolbarController.hxx
@@ -0,0 +1,59 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_FRAMEWORK_INC_UIELEMENT_FIXEDIMAGETOOLBARCONTROLLER_HXX
+#define INCLUDED_FRAMEWORK_INC_UIELEMENT_FIXEDIMAGETOOLBARCONTROLLER_HXX
+
+#include 
+#include 
+
+#include 
+
+class ToolBox;
+class ImageControl;
+
+namespace framework
+{
+class FixedImageToolbarController : public ComplexToolbarController
+{
+public:
+FixedImageToolbarController(const 
css::uno::Reference& rxContext,
+const css::uno::Reference& 
rFrame,
+ToolBox* pToolBar, sal_uInt16 nID, const 
OUString& aCommand);
+
+// XComponent
+virtual void SAL_CALL dispose() override;
+
+void CheckAndUpdateImages();
+
+protected:
+virtual void executeControlCommand(const css::frame::ControlCommand& 
rControlCommand) override;
+
+protected:
+DECL_LINK(MiscOptionsChanged, LinkParamNone*, void);
+
+private:
+VclPtr m_pFixedImageControl;
+sal_Int16 m_eSymbolSize;
+};
+}
+
+#endif // INCLUDED_FRAMEWORK_INC_UIELEMENT_FIXEDIMAGETOOLBARCONTROLLER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
diff --git a/framework/inc/uielement/toolbarmerger.hxx 
b/framework/inc/uielement/toolbarmerger.hxx
index cfe236f8328a..bb41a2bece60 100644
--- a/framework/inc/uielement/toolbarmerger.hxx
+++ b/framework/inc/uielement/toolbarmerger.hxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
diff --git a/framework/source/uielement/FixedImageToolbarController.cxx 
b/framework/source/uielement/FixedImageToolbarController.cxx
new file mode 100755
index ..49fea1fb1b69
--- /dev/null
+++ b/framework/source/uielement/FixedImageToolbarController.cxx
@@ -0,0 +1,114 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */

[Libreoffice-commits] core.git: Branch 'feature/cib_contract3756' - 689 commits - accessibility/inc accessibility/IwyuFilter_accessibility.yaml accessibility/source android/Bootstrap android/source av

2019-10-31 Thread Serge Krot (via logerrit)
Rebased ref, commits from common ancestor:
commit ada416ed7c3aed8f02b9cefe5882e3b75a783c53
Author: Serge Krot 
AuthorDate: Fri Oct 18 17:40:11 2019 +0200
Commit: Thorsten Behrens 
CommitDate: Fri Nov 1 01:06:06 2019 +0100

Toolbar: Added usage of ImageControl as toolbar control

Change-Id: I2536a505650b6e4c98e79f749c3b237518cc995d
Reviewed-on: https://gerrit.libreoffice.org/81064
Reviewed-by: Serge Krot (CIB) 
Tested-by: Serge Krot (CIB) 

diff --git a/framework/Library_fwk.mk b/framework/Library_fwk.mk
index 5d59402c2be5..1fe75ccab4b7 100644
--- a/framework/Library_fwk.mk
+++ b/framework/Library_fwk.mk
@@ -132,6 +132,7 @@ $(eval $(call gb_Library_add_exception_objects,fwk,\
 framework/source/uielement/controlmenucontroller \
 framework/source/uielement/dropdownboxtoolbarcontroller \
 framework/source/uielement/edittoolbarcontroller \
+framework/source/uielement/FixedImageToolbarController \
 framework/source/uielement/FixedTextToolbarController \
 framework/source/uielement/genericstatusbarcontroller \
 framework/source/uielement/generictoolbarcontroller \
diff --git a/framework/inc/uielement/FixedImageToolbarController.hxx 
b/framework/inc/uielement/FixedImageToolbarController.hxx
new file mode 100755
index ..54afb9ee29fe
--- /dev/null
+++ b/framework/inc/uielement/FixedImageToolbarController.hxx
@@ -0,0 +1,59 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_FRAMEWORK_INC_UIELEMENT_FIXEDIMAGETOOLBARCONTROLLER_HXX
+#define INCLUDED_FRAMEWORK_INC_UIELEMENT_FIXEDIMAGETOOLBARCONTROLLER_HXX
+
+#include 
+#include 
+
+#include 
+
+class ToolBox;
+class ImageControl;
+
+namespace framework
+{
+class FixedImageToolbarController : public ComplexToolbarController
+{
+public:
+FixedImageToolbarController(const 
css::uno::Reference& rxContext,
+const css::uno::Reference& 
rFrame,
+ToolBox* pToolBar, sal_uInt16 nID, const 
OUString& aCommand);
+
+// XComponent
+virtual void SAL_CALL dispose() override;
+
+void CheckAndUpdateImages();
+
+protected:
+virtual void executeControlCommand(const css::frame::ControlCommand& 
rControlCommand) override;
+
+protected:
+DECL_LINK(MiscOptionsChanged, LinkParamNone*, void);
+
+private:
+VclPtr m_pFixedImageControl;
+sal_Int16 m_eSymbolSize;
+};
+}
+
+#endif // INCLUDED_FRAMEWORK_INC_UIELEMENT_FIXEDIMAGETOOLBARCONTROLLER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
diff --git a/framework/inc/uielement/toolbarmerger.hxx 
b/framework/inc/uielement/toolbarmerger.hxx
index cfe236f8328a..bb41a2bece60 100644
--- a/framework/inc/uielement/toolbarmerger.hxx
+++ b/framework/inc/uielement/toolbarmerger.hxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
diff --git a/framework/source/uielement/FixedImageToolbarController.cxx 
b/framework/source/uielement/FixedImageToolbarController.cxx
new file mode 100755
index ..6f9a1a53c3c0
--- /dev/null
+++ b/framework/source/uielement/FixedImageToolbarController.cxx
@@ -0,0 +1,114 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */

  1   2   3   >