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

2023-08-25 Thread Andreas Heinisch (via logerrit)
 sd/inc/drawdoc.hxx  |4 ++--
 sd/qa/unit/misc-tests.cxx   |   24 
 sd/source/core/drawdoc3.cxx |4 +++-
 3 files changed, 29 insertions(+), 3 deletions(-)

New commits:
commit 139cffc531277b57bae8e272fef13af00ace5366
Author: Andreas Heinisch 
AuthorDate: Mon Jul 24 11:34:27 2023 +0200
Commit: Andreas Heinisch 
CommitDate: Fri Aug 25 14:10:52 2023 +0200

tdf#39519 - Rename slide if its name is not unique

For instance, if a slide is copied by ctrl + drag and drop (DND_ACTION_COPY)

Change-Id: I1c669c299a38431680ce602922c1e2c7f117a2ab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154838
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/sd/inc/drawdoc.hxx b/sd/inc/drawdoc.hxx
index 50a5e2f09ca3..12814f3717b8 100644
--- a/sd/inc/drawdoc.hxx
+++ b/sd/inc/drawdoc.hxx
@@ -346,8 +346,8 @@ public:
 page, or preserve the old name
  */
 
-SAL_DLLPRIVATE bool InsertBookmarkAsPage(const std::vector 
,
-  std::vector *pExchangeList,
+bool InsertBookmarkAsPage(const std::vector ,
+  std::vector *pExchangeList,
   bool bLink, bool bReplace, sal_uInt16 nPgPos,
   bool bNoDialogs, ::sd::DrawDocShell* 
pBookmarkDocSh,
   bool bCopy, bool bMergeMasterPages,
diff --git a/sd/qa/unit/misc-tests.cxx b/sd/qa/unit/misc-tests.cxx
index e8e34c20c8c2..3cdc212e69db 100644
--- a/sd/qa/unit/misc-tests.cxx
+++ b/sd/qa/unit/misc-tests.cxx
@@ -82,6 +82,7 @@ public:
 void testTdf131033();
 void testTdf129898LayerDrawnInSlideshow();
 void testTdf136956();
+void testTdf39519();
 void testEncodedTableStyles();
 
 CPPUNIT_TEST_SUITE(SdMiscTest);
@@ -104,6 +105,7 @@ public:
 CPPUNIT_TEST(testTdf131033);
 CPPUNIT_TEST(testTdf129898LayerDrawnInSlideshow);
 CPPUNIT_TEST(testTdf136956);
+CPPUNIT_TEST(testTdf39519);
 CPPUNIT_TEST(testEncodedTableStyles);
 CPPUNIT_TEST_SUITE_END();
 };
@@ -886,6 +888,28 @@ void SdMiscTest::testTdf136956()
 CPPUNIT_ASSERT_EQUAL(sal_Int32(3), xTable->getRowCount());
 }
 
+void SdMiscTest::testTdf39519()
+{
+createSdImpressDoc();
+SdXImpressDocument* pXImpressDocument = 
dynamic_cast(mxComponent.get());
+CPPUNIT_ASSERT(pXImpressDocument);
+
+// Change the name of the first page in the newly created document
+SdDrawDocument* pDoc = pXImpressDocument->GetDoc();
+SdPage* pPage = static_cast(pDoc->GetPage(1));
+pPage->SetName("Test");
+
+// Insert a bookmark as a new page using the same name
+std::vector aBookmarkList = { "Test" };
+pDoc->InsertBookmarkAsPage(aBookmarkList, nullptr, false, false, 2, true, 
pDoc->GetDocSh(),
+   true, false, false);
+
+// Check if the copied page has a different name
+SdPage* pCopiedPage = static_cast(pDoc->GetPage(2));
+// Without the fix in place, the names of the pages would not be different
+CPPUNIT_ASSERT(pCopiedPage->GetName() != pPage->GetName());
+}
+
 void SdMiscTest::testEncodedTableStyles()
 {
 // Silence unrelated failure:
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index 6fbefd24..357858f46222 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -696,7 +696,9 @@ bool SdDrawDocument::InsertBookmarkAsPage(
 }
 }
 
-if( bMustRename )
+// tdf#39519 - rename page if its name is not unique, e.g., if 
a slide is copied by
+// ctrl + drag and drop (DND_ACTION_COPY)
+if (bMustRename || !mpDocSh->IsPageNameUnique(aPgName))
 {
 // Page name already in use -> use default name for 
default and
 // notes page


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

2023-07-17 Thread Andreas Heinisch (via logerrit)
 sd/inc/strings.hrc  |2 
 sd/qa/unit/uiimpress.cxx|   58 ++
 sd/source/ui/inc/unmodpg.hxx|   28 
 sd/source/ui/slidesorter/controller/SlsPageSelector.cxx |   18 +++
 sd/source/ui/slidesorter/controller/SlsSlotManager.cxx  |9 +
 sd/source/ui/slidesorter/inc/controller/SlsPageSelector.hxx |   14 ++
 sd/source/ui/view/unmodpg.cxx   |   69 
 7 files changed, 198 insertions(+)

New commits:
commit 2b3a950e937efe77ad39b034819c9f7a707fe29e
Author: Andreas Heinisch 
AuthorDate: Wed Jun 21 10:07:02 2023 +0200
Commit: Andreas Heinisch 
CommitDate: Mon Jul 17 09:11:29 2023 +0200

tdf#130581 - Add undo command for hide/show slides

Change-Id: I7305e222df65fda6523940ca63f5759857c94bea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153375
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 

diff --git a/sd/inc/strings.hrc b/sd/inc/strings.hrc
index 0d9303e18bea..afcf1d4e3be3 100644
--- a/sd/inc/strings.hrc
+++ b/sd/inc/strings.hrc
@@ -130,6 +130,8 @@
 #define STR_UNDO_INSERT_FILE
NC_("STR_UNDO_INSERT_FILE", "Insert file")
 #define STR_UNDO_INSERT_SPECCHAR
NC_("STR_UNDO_INSERT_SPECCHAR", "Insert special character")
 #define STR_UNDO_SET_PRESLAYOUT 
NC_("STR_UNDO_SET_PRESLAYOUT", "Apply presentation layout")
+#define STR_UNDO_HIDE_SLIDE 
NC_("STR_UNDO_HIDE_SLIDE", "Hide slide")
+#define STR_UNDO_SHOW_SLIDE 
NC_("STR_UNDO_SHOW_SLIDE", "Show slide")
 #define STR_PLAYNC_("STR_PLAY", 
"~Play")
 #define STR_STOPNC_("STR_STOP", 
"Sto~p")
 #define STR_UNDO_ORIGINALSIZE   
NC_("STR_UNDO_ORIGINALSIZE", "Original Size")
diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx
index c4cdc0a5e338..3a1c2ad911aa 100644
--- a/sd/qa/unit/uiimpress.cxx
+++ b/sd/qa/unit/uiimpress.cxx
@@ -56,6 +56,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 using namespace ::com::sun::star;
 
@@ -491,6 +493,62 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf100950)
 CPPUNIT_ASSERT(rPageSelector.IsPageSelected(2));
 }
 
+CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf130581)
+{
+createSdImpressDoc();
+
+// Hide slide and check the number of available undo actions
+dispatchCommand(mxComponent, ".uno:ShowSlide", {});
+dispatchCommand(mxComponent, ".uno:HideSlide", {});
+
+// There should be a single undo action, i.e., hide slide
+auto pXImpressDocument = 
dynamic_cast(mxComponent.get());
+SdDrawDocument* pDocument = pXImpressDocument->GetDoc();
+sd::UndoManager* pUndoManager = pDocument->GetUndoManager();
+// Without the fix in place, this test would have failed with
+// - Expected: 1
+// - Actual  : 0
+CPPUNIT_ASSERT_EQUAL(static_cast(1), 
pUndoManager->GetUndoActionCount());
+CPPUNIT_ASSERT_EQUAL(SdResId(STR_UNDO_HIDE_SLIDE), 
pUndoManager->GetUndoActionComment());
+sd::slidesorter::SlideSorterViewShell* pSSVS = getSlideSorterViewShell();
+
+// Check if the page is actually hidden
+auto& rSSController = pSSVS->GetSlideSorter().GetController();
+auto& rPageSelector = rSSController.GetPageSelector();
+CPPUNIT_ASSERT_EQUAL(true, rPageSelector.IsPageExcluded(0));
+
+// Undo hide slide action and check the number of available redo actions
+dispatchCommand(mxComponent, ".uno:Undo", {});
+// Without the fix in place, this test would have failed with
+// - Expected: 1
+// - Actual  : 0
+CPPUNIT_ASSERT_EQUAL(static_cast(1), 
pUndoManager->GetRedoActionCount());
+CPPUNIT_ASSERT_EQUAL(SdResId(STR_UNDO_HIDE_SLIDE), 
pUndoManager->GetRedoActionComment());
+CPPUNIT_ASSERT_EQUAL(false, rPageSelector.IsPageExcluded(0));
+
+// Show slide and check the number of available undo actions
+dispatchCommand(mxComponent, ".uno:Redo", {});
+CPPUNIT_ASSERT_EQUAL(true, rPageSelector.IsPageExcluded(0));
+dispatchCommand(mxComponent, ".uno:ShowSlide", {});
+// Without the fix in place, this test would have failed with
+// - Expected: 2
+// - Actual  : 0
+CPPUNIT_ASSERT_EQUAL(static_cast(2), 
pUndoManager->GetUndoActionCount());
+CPPUNIT_ASSERT_EQUAL(SdResId(STR_UNDO_SHOW_SLIDE), 
pUndoManager->GetUndoActionComment());
+CPPUNIT_ASSERT_EQUAL(false, rPageSelector.IsPageExcluded(0));
+
+// Undo show slide action and check the number of available undo/redo 
actions
+dispatchCommand(mxComponent, ".uno:Undo", {});
+// Without the fix in place, this test would have failed with
+// - Expected: 1
+// - Actual  : 0
+CPPUNIT_ASSERT_EQUAL(static_cast(1), 
pUndoManager->GetUndoActionCount());
+CPPUNIT_ASSERT_EQUAL(SdResId(STR_UNDO_HIDE_SLIDE), 

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

2023-05-10 Thread Paris Oplopoios (via logerrit)
 sd/inc/viewopt.hxx   |   34 
 sd/qa/unit/tiledrendering/tiledrendering.cxx |  114 +++
 sd/source/ui/inc/DrawViewShell.hxx   |5 -
 sd/source/ui/inc/unomodel.hxx|3 
 sd/source/ui/unoidl/unomodel.cxx |   16 +++
 sd/source/ui/view/drviews4.cxx   |2 
 sd/source/ui/view/drviews5.cxx   |2 
 sd/source/ui/view/drviewsa.cxx   |1 
 sd/source/ui/view/drviewsk.cxx   |   25 +
 9 files changed, 196 insertions(+), 6 deletions(-)

New commits:
commit fc87b725d5e29f40d78f2ca7c20a2b516bcfa29a
Author: Paris Oplopoios 
AuthorDate: Wed Apr 12 04:23:56 2023 +0300
Commit: Paris Oplopoios 
CommitDate: Wed May 10 13:07:10 2023 +0200

Add view options class in Draw

Add SdViewOptions class in Draw to hold the view state and
manage view separation in tiled rendering mode

Change-Id: I1546fa536555b3262217ff4be163a48b958b7a33
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150249
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 
(cherry picked from commit fa2fdc90d5fba9420cbb475f8c88423124c158ec)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151519
Tested-by: Jenkins
Reviewed-by: Paris Oplopoios 

diff --git a/sd/inc/viewopt.hxx b/sd/inc/viewopt.hxx
new file mode 100644
index ..03ebd2ada659
--- /dev/null
+++ b/sd/inc/viewopt.hxx
@@ -0,0 +1,34 @@
+/* -*- 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 .
+ */
+
+#include 
+#include 
+
+/// View options for the current view
+struct SdViewOptions
+{
+// The color of the area behind the slide (used to be called "Wiese")
+Color mnAppBackgroundColor;
+// The color of the document background
+Color mnDocBackgroundColor;
+// The name of the color scheme
+OUString msColorSchemeName = "Default";
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 40eb72c1c098..91a929a11d07 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -51,6 +51,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 
 #include 
@@ -2391,6 +2393,118 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, 
testCutSelectionChange)
 CPPUNIT_ASSERT_EQUAL(static_cast(0), m_aSelection.size());
 }
 
+CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testGetViewRenderState)
+{
+SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
+int nFirstViewId = SfxLokHelper::getView();
+ViewCallback aView1;
+CPPUNIT_ASSERT_EQUAL(OString(";Default"), 
pXImpressDocument->getViewRenderState());
+// Create a second view
+SfxLokHelper::createView();
+ViewCallback aView2;
+CPPUNIT_ASSERT_EQUAL(OString(";Default"), 
pXImpressDocument->getViewRenderState());
+// Set to dark scheme
+{
+uno::Sequence aPropertyValues = 
comphelper::InitPropertySequence(
+{
+{ "NewTheme", uno::Any(OUString("Dark")) },
+}
+);
+dispatchCommand(mxComponent, ".uno:ChangeTheme", aPropertyValues);
+}
+CPPUNIT_ASSERT_EQUAL(OString(";Dark"), 
pXImpressDocument->getViewRenderState());
+// Switch back to the first view, and check that the options string is the 
same
+SfxLokHelper::setView(nFirstViewId);
+CPPUNIT_ASSERT_EQUAL(OString(";Default"), 
pXImpressDocument->getViewRenderState());
+}
+
+// Helper function to get a tile to a bitmap and check the pixel color
+static void assertTilePixelColor(SdXImpressDocument* pXImpressDocument, int 
nPixelX, int nPixelY, Color aColor)
+{
+size_t nCanvasSize = 1024;
+size_t nTileSize = 256;
+std::vector aPixmap(nCanvasSize * nCanvasSize * 4, 0);
+ScopedVclPtrInstance pDevice(DeviceFormat::WITHOUT_ALPHA);
+pDevice->SetBackground(Wallpaper(COL_TRANSPARENT));
+pDevice->SetOutputSizePixelScaleOffsetAndLOKBuffer(Size(nCanvasSize, 
nCanvasSize),
+Fraction(1.0), Point(), aPixmap.data());

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

2022-10-11 Thread Noel Grandin (via logerrit)
 sd/inc/drawdoc.hxx   |2 +-
 sd/qa/unit/export-tests-ooxml2.cxx   |4 ++--
 sd/source/core/drawdoc2.cxx  |   16 
 sd/source/filter/eppt/eppt.hxx   |4 ++--
 sd/source/filter/eppt/epptso.cxx |   24 
 sd/source/filter/eppt/pptexanimations.cxx|   19 +--
 sd/source/filter/eppt/pptexanimations.hxx|4 ++--
 sd/source/filter/eppt/pptx-epptooxml.cxx |   10 +-
 sd/source/filter/sdpptwrp.cxx|6 +++---
 sd/source/ui/presenter/PresenterTextView.cxx |   12 ++--
 10 files changed, 50 insertions(+), 51 deletions(-)

New commits:
commit 429e327d143a913b93b5788129b33bd26a43
Author: Noel Grandin 
AuthorDate: Mon Oct 10 11:49:26 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue Oct 11 18:02:11 2022 +0200

use more string_view in sd

Change-Id: Iafcab8d5b21f9562838c3494cbfd75090dd6e010
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141152
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sd/inc/drawdoc.hxx b/sd/inc/drawdoc.hxx
index a99c27c49bd1..9637e8f26cc2 100644
--- a/sd/inc/drawdoc.hxx
+++ b/sd/inc/drawdoc.hxx
@@ -598,7 +598,7 @@ public:
 SdStyleSheetPool* GetSdStyleSheetPool() const;
 
 SAL_DLLPRIVATE void UpdatePageRelativeURLs(
-const OUString& rOldName, std::u16string_view rNewName);
+std::u16string_view aOldName, std::u16string_view aNewName);
 
 SAL_DLLPRIVATE static void SetCalcFieldValueHdl( ::Outliner* pOutliner);
 
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index 4366d26fddd1..928ecab95997 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -33,9 +33,9 @@ using namespace css::animations;
 
 namespace {
 
-bool checkBeginWithNumber(const OUString& rStr)
+bool checkBeginWithNumber(std::u16string_view aStr)
 {
-sal_Unicode aChar = (rStr.getLength() > 1) ? rStr[0] : '\0';
+sal_Unicode aChar = (aStr.size() > 1) ? aStr[0] : '\0';
 return aChar == '.' || aChar == '-' || rtl::isAsciiDigit(aChar);
 }
 
diff --git a/sd/source/core/drawdoc2.cxx b/sd/source/core/drawdoc2.cxx
index d0187bab0f8c..d591113fcca9 100644
--- a/sd/source/core/drawdoc2.cxx
+++ b/sd/source/core/drawdoc2.cxx
@@ -264,9 +264,9 @@ void SdDrawDocument::UpdatePageObjectsInNotes(sal_uInt16 
nStartPos)
 }
 }
 
-void SdDrawDocument::UpdatePageRelativeURLs(const OUString& rOldName, 
std::u16string_view rNewName)
+void SdDrawDocument::UpdatePageRelativeURLs(std::u16string_view aOldName, 
std::u16string_view aNewName)
 {
-if (rNewName.empty())
+if (aNewName.empty())
 return;
 
 SfxItemPool& rPool(GetPool());
@@ -282,22 +282,22 @@ void SdDrawDocument::UpdatePageRelativeURLs(const 
OUString& rOldName, std::u16st
 {
 OUString aURL = pURLField->GetURL();
 
-if (!aURL.isEmpty() && (aURL[0] == 35) && 
(aURL.indexOf(rOldName, 1) == 1))
+if (!aURL.isEmpty() && (aURL[0] == 35) && 
(aURL.indexOf(aOldName, 1) == 1))
 {
-if (aURL.getLength() == rOldName.getLength() + 1) // 
standard page name
+if (aURL.getLength() == sal_Int32(aOldName.size() + 1)) // 
standard page name
 {
 aURL = aURL.replaceAt(1, aURL.getLength() - 1, u"") +
-rNewName;
+aNewName;
 pURLField->SetURL(aURL);
 }
 else
 {
 const OUString sNotes(SdResId(STR_NOTES));
-if (aURL.getLength() == rOldName.getLength() + 2 + 
sNotes.getLength()
-&& aURL.indexOf(sNotes, rOldName.getLength() + 2) 
== rOldName.getLength() + 2)
+if (aURL.getLength() == sal_Int32(aOldName.size()) + 2 
+ sNotes.getLength()
+&& aURL.indexOf(sNotes, aOldName.size() + 2) == 
sal_Int32(aOldName.size() + 2))
 {
 aURL = aURL.replaceAt(1, aURL.getLength() - 1, 
u"") +
-rNewName + " " + sNotes;
+aNewName + " " + sNotes;
 pURLField->SetURL(aURL);
 }
 }
diff --git a/sd/source/filter/eppt/eppt.hxx b/sd/source/filter/eppt/eppt.hxx
index ee2219ddd316..635d5a2223a1 100644
--- a/sd/source/filter/eppt/eppt.hxx
+++ b/sd/source/filter/eppt/eppt.hxx
@@ -164,7 +164,7 @@ class PPTWriter final : public PPTWriterBase, public 
PPTExBulletProvider
 sal_uInt32  ImplMasterSlideListContainer( SvStream* pOutStrm );
 
 public:
-static void WriteCString( SvStream&, const OUString&, 
sal_uInt32 nInstance = 0 );
+static void 

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

2021-06-29 Thread Tibor Nagy (via logerrit)
 sd/inc/drawdoc.hxx  |1 +
 sd/qa/unit/uiimpress.cxx|   17 +
 sd/source/core/drawdoc.cxx  |3 ++-
 sd/source/ui/dlg/custsdlg.cxx   |   21 +
 sd/source/ui/func/fucushow.cxx  |   25 ++---
 sd/source/ui/func/fusldlg.cxx   |1 +
 sd/source/ui/inc/custsdlg.hxx   |2 --
 sd/source/ui/inc/slideshow.hxx  |3 ++-
 sd/source/ui/view/drviewse.cxx  |4 
 sd/uiconfig/simpress/ui/customslideshows.ui |   20 
 10 files changed, 50 insertions(+), 47 deletions(-)

New commits:
commit a46a847d4298806d4e91e4665c3c1907c09a17c7
Author: Tibor Nagy 
AuthorDate: Fri Jun 25 11:52:03 2021 +0200
Commit: László Németh 
CommitDate: Tue Jun 29 19:16:47 2021 +0200

tdf#142589 Impress UI: fix Start button of Custom Slide Shows

This button started the selected custom slide show only
by changing the (already) selected custom slide show, and
enabling the checkbox "Use custom slide show". Otherwise it
started always the full show.

Remove the redundant checkbox "Use custom slide show" of the
dialog window "Custom Slide Shows" (Slide Show->Custom Slide Show...)
to avoid inconsistent behavior of the Start button (which could
start the full show instead of the selected custom slide show).

Now Start button of the dialog starts the selected custom slide
show only once, i.e. it doesn't modify the global slide show
settings for all the next slide shows (that is already handled
by Slide Show->Slide Show Settings->Range->"Custom slide show:"
and Slide Show->Slide Show Settings->Range->"All slides").

Change-Id: I6e97a69c546870199d5a45d9a6ad102e30d820c2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117876
Tested-by: László Németh 
Reviewed-by: László Németh 

diff --git a/sd/inc/drawdoc.hxx b/sd/inc/drawdoc.hxx
index 7d4c3c92ce5c..80a79955537f 100644
--- a/sd/inc/drawdoc.hxx
+++ b/sd/inc/drawdoc.hxx
@@ -108,6 +108,7 @@ namespace sd
 bool mbAnimationAllowed;
 sal_Int32 mnPauseTimeout;
 bool mbShowPauseLogo;
+bool mbStartCustomShow;
 
 PresentationSettings();
 };
diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx
index 8fa1622d6197..444677fdda41 100644
--- a/sd/qa/unit/uiimpress.cxx
+++ b/sd/qa/unit/uiimpress.cxx
@@ -49,6 +49,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace ::com::sun::star;
 
@@ -717,6 +718,22 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, 
testSearchAllInDocumentAndNotes)
 Scheduler::ProcessEventsToIdle();
 }
 
+CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf142589)
+{
+mxComponent = loadFromDesktop("private:factory/simpress",
+  
"com.sun.star.presentation.PresentationDocument");
+CPPUNIT_ASSERT(mxComponent.is());
+
+auto pImpressDocument = 
dynamic_cast(mxComponent.get());
+sd::ViewShell* pViewShell = 
pImpressDocument->GetDocShell()->GetViewShell();
+
+SfxRequest aRequest(pViewShell->GetViewFrame(), SID_PRESENTATION);
+pImpressDocument->GetDoc()->getPresentationSettings().mbCustomShow = true;
+pImpressDocument->GetDoc()->getPresentationSettings().mbStartCustomShow = 
true;
+sd::slideshowhelp::ShowSlideShow(aRequest, *pImpressDocument->GetDoc());
+CPPUNIT_ASSERT_EQUAL(false, 
pImpressDocument->GetDoc()->getPresentationSettings().mbCustomShow);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx
index 4e7c6c5dbd88..baf1d57fea18 100644
--- a/sd/source/core/drawdoc.cxx
+++ b/sd/source/core/drawdoc.cxx
@@ -109,7 +109,8 @@ PresentationSettings::PresentationSettings()
 mbFullScreen( true ),
 mbAnimationAllowed( true ),
 mnPauseTimeout( 0 ),
-mbShowPauseLogo( false )
+mbShowPauseLogo( false ),
+mbStartCustomShow( false )
 {
 }
 
diff --git a/sd/source/ui/dlg/custsdlg.cxx b/sd/source/ui/dlg/custsdlg.cxx
index afa9e0be21be..db2414a51fa2 100644
--- a/sd/source/ui/dlg/custsdlg.cxx
+++ b/sd/source/ui/dlg/custsdlg.cxx
@@ -38,7 +38,6 @@ SdCustomShowDlg::SdCustomShowDlg(weld::Window* pWindow, 
SdDrawDocument& rDrawDoc
 , pCustomShowList(nullptr)
 , bModified(false)
 , m_xLbCustomShows(m_xBuilder->weld_tree_view("customshowlist"))
-, m_xCbxUseCustomShow(m_xBuilder->weld_check_button("usecustomshows"))
 , m_xBtnNew(m_xBuilder->weld_button("new"))
 , m_xBtnEdit(m_xBuilder->weld_button("edit"))
 , m_xBtnRemove(m_xBuilder->weld_button("delete"))
@@ -55,7 +54,6 @@ SdCustomShowDlg::SdCustomShowDlg(weld::Window* pWindow, 
SdDrawDocument& rDrawDoc
 m_xBtnEdit->connect_clicked( aLink );
 m_xBtnRemove->connect_clicked( aLink );
 m_xBtnCopy->connect_clicked( aLink );
-m_xCbxUseCustomShow->connect_toggled(LINK(this, 

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

2021-03-24 Thread Vincent LE GARREC (via logerrit)
 sd/inc/AnnotationEnumeration.hxx   
 |5 +
 sd/inc/CustomAnimationCloner.hxx   
 |5 +
 sd/inc/CustomAnimationEffect.hxx   
 |5 +
 sd/inc/CustomAnimationPreset.hxx   
 |5 +
 sd/inc/DocumentRenderer.hrc
 |5 +
 sd/inc/EffectMigration.hxx 
 |5 +
 sd/inc/FactoryIds.hxx  
 |5 +
 sd/inc/Outliner.hxx
 |5 +
 sd/inc/OutlinerIterator.hxx
 |5 +
 sd/inc/SdShapeTypes.hxx
 |5 +
 sd/inc/TransitionPreset.hxx
 |5 +
 sd/inc/animations.hxx  
 |5 +
 sd/inc/anminfo.hxx 
 |5 +
 sd/inc/app.hrc 
 |4 +---
 sd/inc/bitmaps.hlst
 |5 +
 sd/inc/createpresentation.hxx  
 |5 +
 sd/inc/createunocustomshow.hxx 
 |5 +
 sd/inc/createunopageimpl.hxx   
 |5 +
 sd/inc/cusshow.hxx 
 |5 +
 sd/inc/customshowlist.hxx  
 |5 +
 sd/inc/diadef.h
 |5 +
 sd/inc/drawdoc.hxx 
 |5 +
 sd/inc/errhdl.hrc  
 |5 +
 sd/inc/fadedef.h   
 |5 +
 sd/inc/family.hrc  
 |5 +
 sd/inc/glob.hxx
 |5 +
 sd/inc/helper/simplereferencecomponent.hxx 
 |5 +
 sd/inc/helpids.h   
 |5 +
 sd/inc/misc/scopelock.hxx  
 |5 +
 sd/inc/notifydocumentevent.hxx 
 |5 +
 sd/inc/pageformatpanel.hrc 
 |5 +
 sd/inc/pglink.hxx  
 |5 +
 sd/inc/pres.hxx
 |5 +
 sd/inc/prlayout.hxx
 |5 +
 sd/inc/randomnode.hxx  
 |5 +
 sd/inc/resltn.hxx  
 |5 +
 sd/inc/sdabstdlg.hxx   
 |4 +---
 sd/inc/sdattr.hrc  
 |5 +
 sd/inc/sdattr.hxx  
 |5 +
 sd/inc/sdcgmfilter.hxx 
 |5 +
 sd/inc/sdcommands.h
 |5 +
 sd/inc/sddll.hxx   
 |5 +
 sd/inc/sddllapi.h  
 |5 +
 sd/inc/sdenumdef.hxx   
 |5 +
 sd/inc/sderror.hxx 
 |5 +
 sd/inc/sdfilter.hxx
 |5 +
 sd/inc/sdgrffilter.hxx 
 |5 +
 sd/inc/sdhtmlfilter.hxx
 |5 +
 sd/inc/sdiocmpt.hxx
 |5 +
 sd/inc/sdmod.hxx   
 |5 +
 sd/inc/sdpdffilter.hxx 
 |5 +
 sd/inc/sdpptwrp.hxx
 |5 +
 sd/inc/sdundo.hxx   

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

2020-04-01 Thread Noel Grandin (via logerrit)
 sd/inc/prlayout.hxx|   30 
 sd/qa/unit/dialogs-test.cxx|2 -
 sd/source/core/stlsheet.cxx|4 +--
 sd/source/ui/dlg/prltempl.cxx  |   50 -
 sd/source/ui/func/fuprobjs.cxx |4 +--
 sd/source/ui/func/futempl.cxx  |   32 +-
 sd/source/ui/view/drtxtob1.cxx |2 -
 7 files changed, 62 insertions(+), 62 deletions(-)

New commits:
commit 4de3d96458006b8312446397b423bc3dc5d50294
Author: Noel Grandin 
AuthorDate: Wed Apr 1 09:16:28 2020 +0200
Commit: Noel Grandin 
CommitDate: Wed Apr 1 10:27:43 2020 +0200

convert PresentationObjects to scoped enum

Change-Id: I65c030d33b0c3ed6350e98e9a8a63414c905f88c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91462
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sd/inc/prlayout.hxx b/sd/inc/prlayout.hxx
index fcd83737dd86..54c62dda96dc 100644
--- a/sd/inc/prlayout.hxx
+++ b/sd/inc/prlayout.hxx
@@ -26,22 +26,22 @@
 #ifndef INCLUDED_SD_INC_PRLAYOUT_HXX
 #define INCLUDED_SD_INC_PRLAYOUT_HXX
 
-enum PresentationObjects
+enum class PresentationObjects
 {
-PO_TITLE,
-PO_BACKGROUND,
-PO_BACKGROUNDOBJECTS,
-PO_OUTLINE_1,
-PO_OUTLINE_2,
-PO_OUTLINE_3,
-PO_OUTLINE_4,
-PO_OUTLINE_5,
-PO_OUTLINE_6,
-PO_OUTLINE_7,
-PO_OUTLINE_8,
-PO_OUTLINE_9,
-PO_NOTES,
-PO_SUBTITLE
+Title,
+Background,
+BackgroundObjects,
+Outline_1,
+Outline_2,
+Outline_3,
+Outline_4,
+Outline_5,
+Outline_6,
+Outline_7,
+Outline_8,
+Outline_9,
+Notes,
+Subtitle
 };
 
 #endif // INCLUDED_SD_INC_PRLAYOUT_HXX
diff --git a/sd/qa/unit/dialogs-test.cxx b/sd/qa/unit/dialogs-test.cxx
index a3f39a69650b..396e4f9980e6 100644
--- a/sd/qa/unit/dialogs-test.cxx
+++ b/sd/qa/unit/dialogs-test.cxx
@@ -461,7 +461,7 @@ VclPtr 
SdDialogsTest::createDialogByID(sal_uInt32 nID)
 pWin ? pWin->GetFrameWeld() : nullptr,
 false,
 *pStyleSheet,
-PO_TITLE,
+PresentationObjects::Title,
 pStyleSheetPool);
 break;
 }
diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx
index ab8e01cfd629..c19b87e67645 100644
--- a/sd/source/core/stlsheet.cxx
+++ b/sd/source/core/stlsheet.cxx
@@ -1316,12 +1316,12 @@ void 
SdStyleSheet::BroadcastSdStyleSheetChange(SfxStyleSheetBase const * pStyleS
 SdStyleSheet* pRealSheet = static_cast(pStyleSheet)->GetRealStyleSheet();
 pRealSheet->Broadcast(SfxHint(SfxHintId::DataChanged));
 
-if( !((ePO >= PO_OUTLINE_1) && (ePO <= PO_OUTLINE_8)) )
+if( !((ePO >= PresentationObjects::Outline_1) && (ePO <= 
PresentationObjects::Outline_8)) )
 return;
 
 OUString sStyleName(SdResId(STR_PSEUDOSHEET_OUTLINE) + " ");
 
-for( sal_uInt16 n = static_cast(ePO - PO_OUTLINE_1 + 2); n < 
10; n++ )
+for( sal_uInt16 n = static_cast(ePO) - 
static_cast(PresentationObjects::Outline_1) + 2; n < 10; n++ )
 {
 OUString aName( sStyleName + OUString::number(n) );
 
diff --git a/sd/source/ui/dlg/prltempl.cxx b/sd/source/ui/dlg/prltempl.cxx
index 3e6fb20f3d93..55dada4755d3 100644
--- a/sd/source/ui/dlg/prltempl.cxx
+++ b/sd/source/ui/dlg/prltempl.cxx
@@ -37,7 +37,7 @@
 #include 
 #include 
 
-#define IS_OUTLINE(x) (x >= PO_OUTLINE_1 && x <= PO_OUTLINE_9)
+#define IS_OUTLINE(x) (x >= PresentationObjects::Outline_1 && x <= 
PresentationObjects::Outline_9)
 
 /**
  * Constructor of Tab dialog: appends pages to the dialog
@@ -171,36 +171,36 @@ 
SdPresLayoutTemplateDlg::SdPresLayoutTemplateDlg(SfxObjectShell const * pDocSh,
 
 switch( ePO )
 {
-case PO_TITLE:
+case PresentationObjects::Title:
 aTitle = SdResId(STR_PSEUDOSHEET_TITLE);
 break;
 
-case PO_SUBTITLE:
+case PresentationObjects::Subtitle:
 aTitle = SdResId(STR_PSEUDOSHEET_SUBTITLE);
 break;
 
-case PO_BACKGROUND:
+case PresentationObjects::Background:
 aTitle = SdResId(STR_PSEUDOSHEET_BACKGROUND);
 break;
 
-case PO_BACKGROUNDOBJECTS:
+case PresentationObjects::BackgroundObjects:
 aTitle = SdResId(STR_PSEUDOSHEET_BACKGROUNDOBJECTS);
 break;
 
-case PO_OUTLINE_1:
-case PO_OUTLINE_2:
-case PO_OUTLINE_3:
-case PO_OUTLINE_4:
-case PO_OUTLINE_5:
-case PO_OUTLINE_6:
-case PO_OUTLINE_7:
-case PO_OUTLINE_8:
-case PO_OUTLINE_9:
+case PresentationObjects::Outline_1:
+case PresentationObjects::Outline_2:
+case PresentationObjects::Outline_3:
+case PresentationObjects::Outline_4:
+case PresentationObjects::Outline_5:
+case PresentationObjects::Outline_6:
+case PresentationObjects::Outline_7:
+case PresentationObjects::Outline_8:
+case PresentationObjects::Outline_9:
 

[Libreoffice-commits] core.git: sd/inc sd/qa sd/source solenv/clang-format

2020-03-07 Thread Muhammet Kara (via logerrit)
 sd/inc/Outliner.hxx  |   48 ++-
 sd/inc/SdShapeTypes.hxx  |4 +-
 sd/qa/unit/HtmlExportTest.cxx|6 ++--
 sd/source/core/typemap.cxx   |3 --
 sd/source/filter/html/buttonset.hxx  |4 +-
 sd/source/filter/xml/sdtransform.hxx |2 -
 sd/source/ui/inc/MutexOwner.hxx  |4 +-
 sd/source/ui/inc/dlg_char.hxx|4 +-
 sd/source/ui/inc/paragr.hxx  |2 -
 sd/source/ui/inc/unokywds.hxx|5 ++-
 solenv/clang-format/blacklist|   10 ---
 11 files changed, 43 insertions(+), 49 deletions(-)

New commits:
commit be22ca7cc69ba905c86e05f0413c05ca0bd42556
Author: Muhammet Kara 
AuthorDate: Sat Mar 7 12:21:32 2020 +0300
Commit: Muhammet Kara 
CommitDate: Sat Mar 7 11:33:42 2020 +0100

clang-format sd with under 5-percent lines of change

Files which could become clang-format conformant with
under 5-percent lines of change relative to the total
count of lines in the file are found by using bin/find-clang-format.py,
and fixed with /opt/lo/bin/clang-format -i 

There will be follow-up patches to fix all 'under-5-percent' files.

Change-Id: I08c01d7069b041964614c233d452d70f332228f7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90145
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 

diff --git a/sd/inc/Outliner.hxx b/sd/inc/Outliner.hxx
index 27ec4d80127d..11d79a2a1199 100644
--- a/sd/inc/Outliner.hxx
+++ b/sd/inc/Outliner.hxx
@@ -30,12 +30,13 @@ class SdrObject;
 class SdrTextObj;
 class SdDrawDocument;
 
-namespace weld {
+namespace weld
+{
 class Window;
 }
 
-namespace sd {
-
+namespace sd
+{
 class View;
 class ViewShell;
 class Window;
@@ -61,7 +62,6 @@ struct SearchSelection
 
 } // end of namespace sd
 
-
 /** The main purpose of this class is searching and replacing as well as
 spelling of impress documents.  The main part of both tasks lies in
 iterating over the pages and view modes of a document and apply the
@@ -114,8 +114,7 @@ struct SearchSelection
 queried.  This is only sufficient for searching the outline view.
 
 */
-class SdOutliner
-: public SdrOutliner
+class SdOutliner : public SdrOutliner
 {
 public:
 friend class ::sd::outliner::OutlinerContainer;
@@ -131,7 +130,7 @@ public:
 OutlinerMode::OutlineView are defined in
 editeng/outliner.hxx.
 */
-SdOutliner( SdDrawDocument* pDoc, OutlinerMode nMode );
+SdOutliner(SdDrawDocument* pDoc, OutlinerMode nMode);
 virtual ~SdOutliner() override;
 /// Forbid copy construction and copy assignment
 SdOutliner(const Outliner&) = delete;
@@ -156,7 +155,7 @@ public:
 indicated by user input to the search dialog).  A  
value
 indicates that another call to this method is required.
 */
-bool StartSearchAndReplace (const SvxSearchItem* pSearchItem);
+bool StartSearchAndReplace(const SvxSearchItem* pSearchItem);
 
 /** Iterate over the sentences in all text shapes and stop at the
 next sentence with spelling errors. While doing so the view
@@ -174,8 +173,8 @@ public:
 
 /** Starts the text conversion (hangul/hanja or Chinese 
simplified/traditional)
 for the current viewshell */
-void StartConversion( LanguageType nSourceLanguage,  LanguageType 
nTargetLanguage,
-const vcl::Font *pTargetFont, sal_Int32 nOptions, bool 
bIsInteractive );
+void StartConversion(LanguageType nSourceLanguage, LanguageType 
nTargetLanguage,
+ const vcl::Font* pTargetFont, sal_Int32 nOptions, 
bool bIsInteractive);
 
 /** This is called internally when text conversion is started.
 The position of current view mode/page/object/caret position
@@ -186,9 +185,9 @@ public:
 /** Release all resources that have been created during the conversion */
 void EndConversion();
 
-int GetIgnoreCurrentPageChangesLevel() const { return 
mnIgnoreCurrentPageChangesLevel; };
-voidIncreIgnoreCurrentPageChangesLevel() { 
mnIgnoreCurrentPageChangesLevel++; };
-voidDecreIgnoreCurrentPageChangesLevel() { 
mnIgnoreCurrentPageChangesLevel--; };
+int GetIgnoreCurrentPageChangesLevel() const { return 
mnIgnoreCurrentPageChangesLevel; };
+void IncreIgnoreCurrentPageChangesLevel() { 
mnIgnoreCurrentPageChangesLevel++; };
+void DecreIgnoreCurrentPageChangesLevel() { 
mnIgnoreCurrentPageChangesLevel--; };
 SdDrawDocument* GetDoc() const { return mpDrawDocument; }
 
 private:
@@ -197,7 +196,12 @@ private:
 
 /// Specifies whether to search and replace, to spell check or to do a
 /// text conversion.
-enum mode {SEARCH, SPELL, TEXT_CONVERSION} meMode;
+enum mode
+{
+SEARCH,
+SPELL,
+TEXT_CONVERSION
+} meMode;
 
 /// The view which displays the searched objects.
 ::sd::View* mpView;
@@ -207,7 +211,7 @@ private:
 */
 

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

2019-03-14 Thread Libreoffice Gerrit user
 sd/inc/sdabstdlg.hxx |2 +-
 sd/qa/unit/dialogs-test.cxx  |2 +-
 sd/source/ui/dlg/sddlgfact.cxx   |   13 -
 sd/source/ui/dlg/sddlgfact.hxx   |   13 ++---
 sd/source/ui/dlg/tpaction.cxx|   17 -
 sd/source/ui/func/fuoaprms.cxx   |2 +-
 sd/source/ui/inc/tpaction.hxx|4 ++--
 sd/uiconfig/simpress/ui/interactiondialog.ui |8 +++-
 8 files changed, 38 insertions(+), 23 deletions(-)

New commits:
commit 8bc23968129fc38d70fb614668a411599d4e6d0e
Author: Caolán McNamara 
AuthorDate: Wed Mar 13 14:17:22 2019 +
Commit: Caolán McNamara 
CommitDate: Thu Mar 14 11:22:58 2019 +0100

weld SdActionDlg

Change-Id: I2d43c1fc65e8cfed1e252e1a16c37b907ec9f319
Reviewed-on: https://gerrit.libreoffice.org/69180
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sd/inc/sdabstdlg.hxx b/sd/inc/sdabstdlg.hxx
index adb34590569c..5ecd310d54f8 100644
--- a/sd/inc/sdabstdlg.hxx
+++ b/sd/inc/sdabstdlg.hxx
@@ -185,7 +185,7 @@ public:
 virtual VclPtr   
CreateSdPresLayoutTemplateDlg(SfxObjectShell* pDocSh, weld::Window* pParent, 
bool bBackgroundDlg, SfxStyleSheetBase& rStyleBase, PresentationObjects ePO, 
SfxStyleSheetBasePool* pSSPool) = 0;
 virtual VclPtr
CreateSdPresLayoutDlg(weld::Window* pParent, ::sd::DrawDocShell* pDocShell, 
const SfxItemSet& rInAttrs) = 0;
 virtual VclPtr   
CreateSdTabTemplateDlg(weld::Window* pParent, const SfxObjectShell* pDocShell, 
SfxStyleSheetBase& rStyleBase, SdrModel* pModel, SdrView* pView) = 0;
-virtual VclPtr  
CreatSdActionDialog(vcl::Window* pParent, const SfxItemSet* pAttr, ::sd::View* 
pView) = 0;
+virtual VclPtr  
CreatSdActionDialog(weld::Window* pParent, const SfxItemSet* pAttr, ::sd::View* 
pView) = 0;
 virtual VclPtr 
CreateSdVectorizeDlg(weld::Window* pParent, const Bitmap& rBmp, 
::sd::DrawDocShell* pDocShell) = 0;
 virtual VclPtrCreateSdPublishingDlg( 
vcl::Window* pWindow, DocumentType eDocType) = 0;
 
diff --git a/sd/qa/unit/dialogs-test.cxx b/sd/qa/unit/dialogs-test.cxx
index 7a8ea154a8c2..1b114462584a 100644
--- a/sd/qa/unit/dialogs-test.cxx
+++ b/sd/qa/unit/dialogs-test.cxx
@@ -532,7 +532,7 @@ VclPtr 
SdDialogsTest::createDialogByID(sal_uInt32 nID)
 aSet.Put(SfxBoolItem(ATTR_ACTION_SOUNDON, false));
 aSet.Put(SfxBoolItem(ATTR_ACTION_PLAYFULL, false));
 pRetval = getSdAbstractDialogFactory()->CreatSdActionDialog(
-getViewShell()->GetActiveWindow(),
+getViewShell()->GetFrameWeld(),
 ,
 getDrawView());
 break;
diff --git a/sd/source/ui/dlg/sddlgfact.cxx b/sd/source/ui/dlg/sddlgfact.cxx
index 0818046394b1..c29066beca1f 100644
--- a/sd/source/ui/dlg/sddlgfact.cxx
+++ b/sd/source/ui/dlg/sddlgfact.cxx
@@ -109,7 +109,10 @@ short AbstractSdPresLayoutDlg_Impl::Execute()
 return m_xDlg->run();
 }
 
-IMPL_ABSTDLG_BASE(SdAbstractSfxDialog_Impl);
+short SdAbstractSfxDialog_Impl::Execute()
+{
+return m_xDlg->run();
+}
 
 short AbstractSdVectorizeDlg_Impl::Execute()
 {
@@ -342,12 +345,12 @@ void AbstractSdPresLayoutDlg_Impl::GetAttr( SfxItemSet& 
rOutAttrs )
 
 const SfxItemSet* SdAbstractSfxDialog_Impl::GetOutputItemSet() const
 {
-return pDlg->GetOutputItemSet();
+return m_xDlg->GetOutputItemSet();
 }
 
 void SdAbstractSfxDialog_Impl::SetText( const OUString& rStr )
 {
-pDlg->SetText( rStr );
+m_xDlg->set_title(rStr);
 }
 
 const GDIMetaFile& AbstractSdVectorizeDlg_Impl::GetGDIMetaFile() const
@@ -455,9 +458,9 @@ VclPtr  
SdAbstractDialogFactory_Impl::CreateSdTabTemplateD
 return 
VclPtr::Create(std::make_unique(pParent,
 pDocShell, rStyleBase, pModel, pView));
 }
 
-VclPtr 
SdAbstractDialogFactory_Impl::CreatSdActionDialog(vcl::Window* pParent, const 
SfxItemSet* pAttr, ::sd::View* pView )
+VclPtr 
SdAbstractDialogFactory_Impl::CreatSdActionDialog(weld::Window* pParent, const 
SfxItemSet* pAttr, ::sd::View* pView )
 {
-return VclPtr::Create( 
VclPtr::Create( pParent, pAttr, pView ) );
+return 
VclPtr::Create(std::make_unique(pParent, 
pAttr, pView));
 }
 
 VclPtr  
SdAbstractDialogFactory_Impl::CreateSdVectorizeDlg(weld::Window* pParent, const 
Bitmap& rBmp, ::sd::DrawDocShell* pDocShell)
diff --git a/sd/source/ui/dlg/sddlgfact.hxx b/sd/source/ui/dlg/sddlgfact.hxx
index 269795b4c690..8f419d943036 100644
--- a/sd/source/ui/dlg/sddlgfact.hxx
+++ b/sd/source/ui/dlg/sddlgfact.hxx
@@ -292,9 +292,16 @@ public:
 
 class SdAbstractSfxDialog_Impl : public SfxAbstractDialog
 {
-DECL_ABSTDLG_BASE(SdAbstractSfxDialog_Impl,SfxModalDialog)
+private:
+std::unique_ptr m_xDlg;
+public:
+SdAbstractSfxDialog_Impl(std::unique_ptr 
pDlg)
+: m_xDlg(std::move(pDlg))
+{
+}
+virtual short   Execute() override;
 virtual const SfxItemSet*   

[Libreoffice-commits] core.git: sd/inc sd/qa sd/source starmath/inc starmath/source store/source svtools/source

2019-01-24 Thread Libreoffice Gerrit user
 sd/inc/customshowlist.hxx   |2 +-
 sd/qa/unit/export-tests-ooxml2.cxx  |4 ++--
 sd/source/ui/animations/CustomAnimationPane.cxx |2 +-
 sd/source/ui/dlg/sdtreelb.cxx   |2 +-
 sd/source/ui/inc/sdtreelb.hxx   |2 +-
 starmath/inc/dialog.hxx |2 +-
 starmath/source/dialog.cxx  |2 +-
 store/source/storbase.hxx   |2 +-
 svtools/source/control/ruler.cxx|2 +-
 9 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit 4085f6ca9b345c362bb286e6fb1b17b2fcf2bc4c
Author: Noel Grandin 
AuthorDate: Thu Jan 24 09:29:27 2019 +0200
Commit: Noel Grandin 
CommitDate: Thu Jan 24 11:01:34 2019 +0100

loplugin:constparams in sd..svtools

Change-Id: I50b864ffc4ed13ba801af46815988bf568b83d2e
Reviewed-on: https://gerrit.libreoffice.org/66832
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sd/inc/customshowlist.hxx b/sd/inc/customshowlist.hxx
index 666e43614ce2..c612ce4bf93e 100644
--- a/sd/inc/customshowlist.hxx
+++ b/sd/inc/customshowlist.hxx
@@ -77,7 +77,7 @@ public:
 {
 return mShows.empty() ? nullptr : mShows[mnCurPos].get();
 }
-void erase(SdCustomShow* p)
+void erase(const SdCustomShow* p)
 {
 auto it = std::find_if(mShows.begin(), mShows.end(),
 [&] (std::unique_ptr const ) { return i.get() 
== p; });
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index 503b913b1ce0..0d63f6b0f508 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -1878,7 +1878,7 @@ void SdOOXMLExportTest2::testTdf118836()
 xDocShRef->DoClose();
 }
 
-static double getAdjustmentValue( uno::Reference& xSet )
+static double getAdjustmentValue( const uno::Reference& 
xSet )
 {
 auto aGeomPropSeq = xSet->getPropertyValue( "CustomShapeGeometry" )
 .get>();
@@ -1903,7 +1903,7 @@ static double getAdjustmentValue( 
uno::Reference& xSet )
 return -1.0;
 }
 
-static bool getScaleXValue(uno::Reference& xSet)
+static bool getScaleXValue(const uno::Reference& xSet)
 {
 bool bScaleX = false;
 
diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx 
b/sd/source/ui/animations/CustomAnimationPane.cxx
index 60f052445929..384ea90559e2 100644
--- a/sd/source/ui/animations/CustomAnimationPane.cxx
+++ b/sd/source/ui/animations/CustomAnimationPane.cxx
@@ -907,7 +907,7 @@ void CustomAnimationPane::UpdateLook()
 }
 }
 
-static void addValue( std::unique_ptr& pSet, sal_Int32 
nHandle, const Any& rValue )
+static void addValue( const std::unique_ptr& pSet, sal_Int32 
nHandle, const Any& rValue )
 {
 switch( pSet->getPropertyState( nHandle ) )
 {
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index 1d7805360d79..c88a401af4ed 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -227,7 +227,7 @@ void SdPageObjsTLB::SetSdNavigator(SdNavigatorWin* 
pNavigator)
 mpNavigator = pNavigator;
 }
 
-void SdPageObjsTLB::SetViewFrame( SfxViewFrame* pViewFrame )
+void SdPageObjsTLB::SetViewFrame( const SfxViewFrame* pViewFrame )
 {
 sd::ViewShellBase* pBase = sd::ViewShellBase::GetViewShellBase(pViewFrame);
 const css::uno::Reference< css::frame::XFrame > xFrame = 
pBase->GetMainViewShell()->GetViewFrame()->GetFrame().GetFrameInterface();
diff --git a/sd/source/ui/inc/sdtreelb.hxx b/sd/source/ui/inc/sdtreelb.hxx
index cea96d1a839d..d32d23666162 100644
--- a/sd/source/ui/inc/sdtreelb.hxx
+++ b/sd/source/ui/inc/sdtreelb.hxx
@@ -189,7 +189,7 @@ public:
 virtual voidKeyInput( const KeyEvent& rKEvt ) override;
 void MouseButtonDown(const MouseEvent& rMEvt) override;
 
-voidSetViewFrame( SfxViewFrame* pViewFrame );
+voidSetViewFrame( const SfxViewFrame* pViewFrame );
 
 voidFill( const SdDrawDocument*, bool bAllPages, const 
OUString& rDocName );
 voidFill( const SdDrawDocument*, SfxMedium* 
pSfxMedium, const OUString& rDocName );
diff --git a/starmath/inc/dialog.hxx b/starmath/inc/dialog.hxx
index 63426947f059..6c1ccfb0cb80 100644
--- a/starmath/inc/dialog.hxx
+++ b/starmath/inc/dialog.hxx
@@ -272,7 +272,7 @@ public:
pDrawingArea->get_text_height() * 9);
 }
 
-void calccols(vcl::RenderContext& rRenderContext);
+void calccols(const vcl::RenderContext& rRenderContext);
 voidSelectSymbol(sal_uInt16 nSymbol);
 sal_uInt16  GetSelectSymbol() const { return nSelectSymbol; }
 void SetSymbolSet(const SymbolPtrVec_t& rSymbolSet);
diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index 528983c89e43..973bfc716e28 100644
--- a/starmath/source/dialog.cxx
+++ b/starmath/source/dialog.cxx
@@ -1065,7 +1065,7 @@ bool 

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

2018-10-18 Thread Libreoffice Gerrit user
 sd/inc/sdabstdlg.hxx  |2 
 sd/qa/unit/dialogs-test.cxx   |2 
 sd/source/ui/dlg/sddlgfact.cxx|4 
 sd/source/ui/dlg/sddlgfact.hxx|2 
 sd/source/ui/dlg/tabtempl.cxx |   67 +---
 sd/source/ui/func/futempl.cxx |2 
 sd/source/ui/inc/tabtempl.hxx |   27 -
 sd/uiconfig/simpress/ui/templatedialog.ui |  430 --
 8 files changed, 452 insertions(+), 84 deletions(-)

New commits:
commit b7d4b1dae5ad05370b8ac289ae2642aa4236111a
Author: Caolán McNamara 
AuthorDate: Thu Oct 18 11:24:13 2018 +0100
Commit: Caolán McNamara 
CommitDate: Thu Oct 18 15:09:54 2018 +0200

weld SdTabTemplateDlg

Change-Id: I3aae53844f839ff54fab85ab4649c0bf0691e6de
Reviewed-on: https://gerrit.libreoffice.org/61927
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sd/inc/sdabstdlg.hxx b/sd/inc/sdabstdlg.hxx
index da3c93f71203..6c03002c6c22 100644
--- a/sd/inc/sdabstdlg.hxx
+++ b/sd/inc/sdabstdlg.hxx
@@ -184,7 +184,7 @@ public:
 virtual VclPtr  CreateRemoteDialog( 
vcl::Window* pWindow ) = 0;
 virtual VclPtr   
CreateSdPresLayoutTemplateDlg(SfxObjectShell* pDocSh, weld::Window* pParent, 
bool bBackgroundDlg, SfxStyleSheetBase& rStyleBase, PresentationObjects ePO, 
SfxStyleSheetBasePool* pSSPool) = 0;
 virtual VclPtr
CreateSdPresLayoutDlg(weld::Window* pParent, ::sd::DrawDocShell* pDocShell, 
const SfxItemSet& rInAttrs) = 0;
-virtual VclPtr   
CreateSdTabTemplateDlg(vcl::Window* pParent, const SfxObjectShell* pDocShell, 
SfxStyleSheetBase& rStyleBase, SdrModel* pModel, SdrView* pView) = 0;
+virtual VclPtr   
CreateSdTabTemplateDlg(weld::Window* pParent, const SfxObjectShell* pDocShell, 
SfxStyleSheetBase& rStyleBase, SdrModel* pModel, SdrView* pView) = 0;
 virtual VclPtr  
CreatSdActionDialog(vcl::Window* pParent, const SfxItemSet* pAttr, ::sd::View* 
pView) = 0;
 virtual VclPtr 
CreateSdVectorizeDlg(weld::Window* pParent, const Bitmap& rBmp, 
::sd::DrawDocShell* pDocShell) = 0;
 virtual VclPtrCreateSdPublishingDlg( 
vcl::Window* pWindow, DocumentType eDocType) = 0;
diff --git a/sd/qa/unit/dialogs-test.cxx b/sd/qa/unit/dialogs-test.cxx
index 738b84dd0f7f..7f475dfa70b4 100644
--- a/sd/qa/unit/dialogs-test.cxx
+++ b/sd/qa/unit/dialogs-test.cxx
@@ -502,7 +502,7 @@ VclPtr 
SdDialogsTest::createDialogByID(sal_uInt32 nID)
 SdDrawDocument* pDrawDoc = getSdXImpressDocument()->GetDoc();
 CPPUNIT_ASSERT(pDrawDoc);
 pRetval = getSdAbstractDialogFactory()->CreateSdTabTemplateDlg(
-getViewShell()->GetActiveWindow(),
+getViewShell()->GetFrameWeld(),
 getDocShell(),
 *pStyleSheet,
 pDrawDoc,
diff --git a/sd/source/ui/dlg/sddlgfact.cxx b/sd/source/ui/dlg/sddlgfact.cxx
index 7159bdd27d58..df90897d1a89 100644
--- a/sd/source/ui/dlg/sddlgfact.cxx
+++ b/sd/source/ui/dlg/sddlgfact.cxx
@@ -475,9 +475,9 @@ VclPtr 
SdAbstractDialogFactory_Impl::CreateSdPresLayout
 return 
VclPtr::Create(o3tl::make_unique(pDocShell,
 pParent, rInAttrs));
 }
 
-VclPtr  
SdAbstractDialogFactory_Impl::CreateSdTabTemplateDlg(vcl::Window* pParent, 
const SfxObjectShell* pDocShell, SfxStyleSheetBase& rStyleBase, SdrModel* 
pModel, SdrView* pView )
+VclPtr  
SdAbstractDialogFactory_Impl::CreateSdTabTemplateDlg(weld::Window* pParent, 
const SfxObjectShell* pDocShell, SfxStyleSheetBase& rStyleBase, SdrModel* 
pModel, SdrView* pView)
 {
-return VclPtr::Create( 
VclPtr::Create( pParent, pDocShell, rStyleBase, pModel, pView 
) );
+return 
VclPtr::Create(o3tl::make_unique(pParent,
 pDocShell, rStyleBase, pModel, pView));
 }
 
 VclPtr 
SdAbstractDialogFactory_Impl::CreatSdActionDialog(vcl::Window* pParent, const 
SfxItemSet* pAttr, ::sd::View* pView )
diff --git a/sd/source/ui/dlg/sddlgfact.hxx b/sd/source/ui/dlg/sddlgfact.hxx
index 959718c4effb..001885bf7254 100644
--- a/sd/source/ui/dlg/sddlgfact.hxx
+++ b/sd/source/ui/dlg/sddlgfact.hxx
@@ -353,7 +353,7 @@ public:
 virtual VclPtr  CreateRemoteDialog( 
vcl::Window* pWindow ) override; // add for RemoteDialog
 virtual VclPtr   
CreateSdPresLayoutTemplateDlg(SfxObjectShell* pDocSh, weld::Window* pParent, 
bool bBackgroundDlg, SfxStyleSheetBase& rStyleBase, PresentationObjects ePO, 
SfxStyleSheetBasePool* pSSPool) override;
 virtual VclPtr
CreateSdPresLayoutDlg(weld::Window* pParent, ::sd::DrawDocShell* pDocShell, 
const SfxItemSet& rInAttrs) override;
-virtual VclPtr   
CreateSdTabTemplateDlg(vcl::Window* pParent, const SfxObjectShell* pDocShell, 
SfxStyleSheetBase& rStyleBase, SdrModel* pModel, SdrView* pView ) override;
+virtual VclPtr   
CreateSdTabTemplateDlg(weld::Window* pParent, const SfxObjectShell* pDocShell, 
SfxStyleSheetBase& rStyleBase, SdrModel* pModel, SdrView* pView ) override;
 

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

2018-10-12 Thread Libreoffice Gerrit user
 sd/inc/sdabstdlg.hxx |2 
 sd/qa/unit/dialogs-test.cxx  |2 
 sd/source/ui/dlg/sddlgfact.cxx   |   14 +++-
 sd/source/ui/dlg/sddlgfact.hxx   |   11 +++
 sd/source/ui/dlg/sdpreslt.cxx|   81 ++-
 sd/source/ui/func/fuprlout.cxx   |2 
 sd/source/ui/inc/sdpreslt.hxx|   23 ---
 sd/uiconfig/simpress/ui/slidedesigndialog.ui |   67 +++---
 8 files changed, 111 insertions(+), 91 deletions(-)

New commits:
commit b752a93acff31c824bcec4233a8dd9bee014ca7d
Author: Caolán McNamara 
AuthorDate: Fri Oct 12 11:35:07 2018 +0100
Commit: Caolán McNamara 
CommitDate: Fri Oct 12 14:19:47 2018 +0200

weld SdPresLayoutDlg

Change-Id: I04dddf836eccf16a6335b63c3350e97335d2fb58
Reviewed-on: https://gerrit.libreoffice.org/61710
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sd/inc/sdabstdlg.hxx b/sd/inc/sdabstdlg.hxx
index 7576c5bf70ea..152ceb9dc556 100644
--- a/sd/inc/sdabstdlg.hxx
+++ b/sd/inc/sdabstdlg.hxx
@@ -183,7 +183,7 @@ public:
  const 
std::vector , SdCustomShowList* pCSList ) = 0;
 virtual VclPtr  CreateRemoteDialog( 
vcl::Window* pWindow ) = 0;
 virtual VclPtr   CreateSdPresLayoutTemplateDlg( 
SfxObjectShell* pDocSh, vcl::Window* pParent, bool bBackgroundDlg, 
SfxStyleSheetBase& rStyleBase, PresentationObjects ePO, SfxStyleSheetBasePool* 
pSSPool ) = 0;
-virtual VclPtrCreateSdPresLayoutDlg( 
::sd::DrawDocShell* pDocShell, const SfxItemSet& rInAttrs) = 0;
+virtual VclPtr
CreateSdPresLayoutDlg(weld::Window* pParent, ::sd::DrawDocShell* pDocShell, 
const SfxItemSet& rInAttrs) = 0;
 virtual VclPtr   
CreateSdTabTemplateDlg(vcl::Window* pParent, const SfxObjectShell* pDocShell, 
SfxStyleSheetBase& rStyleBase, SdrModel* pModel, SdrView* pView) = 0;
 virtual VclPtr  
CreatSdActionDialog(vcl::Window* pParent, const SfxItemSet* pAttr, ::sd::View* 
pView) = 0;
 virtual VclPtr 
CreateSdVectorizeDlg(weld::Window* pParent, const Bitmap& rBmp, 
::sd::DrawDocShell* pDocShell) = 0;
diff --git a/sd/qa/unit/dialogs-test.cxx b/sd/qa/unit/dialogs-test.cxx
index 71f4c742537b..fd863c973eb0 100644
--- a/sd/qa/unit/dialogs-test.cxx
+++ b/sd/qa/unit/dialogs-test.cxx
@@ -482,7 +482,9 @@ VclPtr 
SdDialogsTest::createDialogByID(sal_uInt32 nID)
 case 16:
 {
 // CreateSdPresLayoutDlg(::sd::DrawDocShell* pDocShell, 
vcl::Window* pWindow, const SfxItemSet& rInAttrs) override;
+auto const parent = Application::GetDefDialogParent();
 pRetval = getSdAbstractDialogFactory()->CreateSdPresLayoutDlg(
+parent == nullptr ? nullptr : parent->GetFrameWeld(),
 getDocShell(),
 getEmptySfxItemSet());
 break;
diff --git a/sd/source/ui/dlg/sddlgfact.cxx b/sd/source/ui/dlg/sddlgfact.cxx
index 6c43e082bdef..1bf725bdce25 100644
--- a/sd/source/ui/dlg/sddlgfact.cxx
+++ b/sd/source/ui/dlg/sddlgfact.cxx
@@ -94,7 +94,11 @@ short AbstractSdStartPresDlg_Impl::Execute()
 return m_xDlg->run();
 }
 
-IMPL_ABSTDLG_BASE(AbstractSdPresLayoutDlg_Impl);
+short AbstractSdPresLayoutDlg_Impl::Execute()
+{
+return m_xDlg->run();
+}
+
 IMPL_ABSTDLG_BASE(SdAbstractSfxDialog_Impl);
 
 short AbstractSdVectorizeDlg_Impl::Execute()
@@ -344,12 +348,12 @@ bool AbstractMorphDlg_Impl::IsOrientationFade() const
 
 void AbstractSdStartPresDlg_Impl::GetAttr( SfxItemSet& rOutAttrs )
 {
-m_xDlg->GetAttr( rOutAttrs );
+m_xDlg->GetAttr(rOutAttrs);
 }
 
 void AbstractSdPresLayoutDlg_Impl::GetAttr( SfxItemSet& rOutAttrs )
 {
-pDlg->GetAttr( rOutAttrs );
+m_xDlg->GetAttr(rOutAttrs);
 }
 
 const SfxItemSet* SdAbstractSfxDialog_Impl::GetOutputItemSet() const
@@ -457,9 +461,9 @@ VclPtr  
SdAbstractDialogFactory_Impl::CreateSdPresLayoutTe
 return VclPtr::Create( 
VclPtr::Create( pDocSh, pParent, bBackgroundDlg, 
rStyleBase, ePO, pSSPool ) );
 }
 
-VclPtr  
SdAbstractDialogFactory_Impl::CreateSdPresLayoutDlg(  ::sd::DrawDocShell* 
pDocShell, const SfxItemSet& rInAttrs)
+VclPtr 
SdAbstractDialogFactory_Impl::CreateSdPresLayoutDlg(weld::Window* pParent, 
::sd::DrawDocShell* pDocShell, const SfxItemSet& rInAttrs)
 {
-return VclPtr::Create( 
VclPtr::Create( pDocShell, nullptr, rInAttrs ) );
+return 
VclPtr::Create(o3tl::make_unique(pDocShell,
 pParent, rInAttrs));
 }
 
 VclPtr  
SdAbstractDialogFactory_Impl::CreateSdTabTemplateDlg(vcl::Window* pParent, 
const SfxObjectShell* pDocShell, SfxStyleSheetBase& rStyleBase, SdrModel* 
pModel, SdrView* pView )
diff --git a/sd/source/ui/dlg/sddlgfact.hxx b/sd/source/ui/dlg/sddlgfact.hxx
index 4571aa29248c..99ad415871e5 100644
--- a/sd/source/ui/dlg/sddlgfact.hxx
+++ b/sd/source/ui/dlg/sddlgfact.hxx
@@ -277,7 +277,14 @@ public:
 class SdPresLayoutDlg;
 class 

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

2018-10-03 Thread Libreoffice Gerrit user
 sd/inc/sdabstdlg.hxx|2 
 sd/qa/unit/dialogs-test.cxx |3 
 sd/source/ui/dlg/dlgolbul.cxx   |  102 +++---
 sd/source/ui/dlg/sddlgfact.cxx  |   25 +++-
 sd/source/ui/dlg/sddlgfact.hxx  |   13 +-
 sd/source/ui/func/fuolbull.cxx  |2 
 sd/source/ui/inc/OutlineBulletDlg.hxx   |   25 +---
 sd/uiconfig/sdraw/ui/bulletsandnumbering.ui |  156 +---
 8 files changed, 222 insertions(+), 106 deletions(-)

New commits:
commit 42e5319342f436f43ada228818d928cc8fd01d5b
Author: Caolán McNamara 
AuthorDate: Wed Oct 3 11:18:01 2018 +0100
Commit: Caolán McNamara 
CommitDate: Wed Oct 3 17:12:17 2018 +0200

weld OutlineBulletDlg

Change-Id: Icfbe456a71e0febf5b7d7b6cb625217c730bb367
Reviewed-on: https://gerrit.libreoffice.org/61291
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sd/inc/sdabstdlg.hxx b/sd/inc/sdabstdlg.hxx
index f3c24d82fbf9..7576c5bf70ea 100644
--- a/sd/inc/sdabstdlg.hxx
+++ b/sd/inc/sdabstdlg.hxx
@@ -177,7 +177,7 @@ public:
 virtual VclPtr   
CreateSdInsertLayerDlg(weld::Window* pParent, const SfxItemSet& rInAttrs, bool 
bDeletable, const OUString& rStr) = 0;
 virtual VclPtr 
CreateSdInsertPagesObjsDlg(vcl::Window* pParent, const SdDrawDocument* pDoc, 
SfxMedium* pSfxMedium, const OUString& rFileName) = 0;
 virtual VclPtr   CreateMorphDlg(weld::Window* 
pParent, const SdrObject* pObj1, const SdrObject* pObj2) = 0;
-virtual VclPtr   
CreateSdOutlineBulletTabDlg(vcl::Window* pParent, const SfxItemSet* pAttr, 
::sd::View* pView) = 0;
+virtual VclPtr   
CreateSdOutlineBulletTabDlg(weld::Window* pParent, const SfxItemSet* pAttr, 
::sd::View* pView) = 0;
 virtual VclPtr   
CreateSdParagraphTabDlg(weld::Window* pWindow, const SfxItemSet* pAttr) = 0;
 virtual VclPtr 
CreateSdStartPresentationDlg(weld::Window* pWindow, const SfxItemSet& rInAttrs,
  const 
std::vector , SdCustomShowList* pCSList ) = 0;
diff --git a/sd/qa/unit/dialogs-test.cxx b/sd/qa/unit/dialogs-test.cxx
index f56e09bffcb5..96c4d6807424 100644
--- a/sd/qa/unit/dialogs-test.cxx
+++ b/sd/qa/unit/dialogs-test.cxx
@@ -409,8 +409,9 @@ VclPtr 
SdDialogsTest::createDialogByID(sal_uInt32 nID)
 case 11:
 {
 // CreateSdOutlineBulletTabDlg(const SfxItemSet* pAttr, 
::sd::View* pView = nullptr) override;
+auto const parent = Application::GetDefDialogParent();
 pRetval = 
getSdAbstractDialogFactory()->CreateSdOutlineBulletTabDlg(
-getViewShell()->GetActiveWindow(),
+parent == nullptr ? nullptr : parent->GetFrameWeld(),
 (),
 getDrawView());
 break;
diff --git a/sd/source/ui/dlg/dlgolbul.cxx b/sd/source/ui/dlg/dlgolbul.cxx
index d169853c9ac1..bbbc3fb24968 100644
--- a/sd/source/ui/dlg/dlgolbul.cxx
+++ b/sd/source/ui/dlg/dlgolbul.cxx
@@ -46,26 +46,22 @@ namespace sd {
 /**
  * Constructor of tab dialog: append pages to the dialog
  */
-OutlineBulletDlg::OutlineBulletDlg(
-vcl::Window* pParent,
-const SfxItemSet* pAttr,
-::sd::View* pView )
-: SfxTabDialog( pParent, "BulletsAndNumberingDialog",
-"modules/sdraw/ui/bulletsandnumbering.ui")
-, aInputSet( *pAttr )
-, bTitle(false)
-, pSdView(pView)
+OutlineBulletDlg::OutlineBulletDlg(weld::Window* pParent, const SfxItemSet* 
pAttr, ::sd::View* pView)
+: SfxTabDialogController(pParent, 
"modules/sdraw/ui/bulletsandnumbering.ui", "BulletsAndNumberingDialog")
+, m_aInputSet(*pAttr)
+, m_bTitle(false)
+, m_pSdView(pView)
 {
-aInputSet.MergeRange( SID_PARAM_NUM_PRESET, SID_PARAM_CUR_NUM_LEVEL );
-aInputSet.Put( *pAttr );
+m_aInputSet.MergeRange(SID_PARAM_NUM_PRESET, SID_PARAM_CUR_NUM_LEVEL);
+m_aInputSet.Put(*pAttr);
 
-pOutputSet.reset( new SfxItemSet( *pAttr ) );
-pOutputSet->ClearItem();
+m_xOutputSet.reset( new SfxItemSet( *pAttr ) );
+m_xOutputSet->ClearItem();
 
 bool bOutliner = false;
 
 // special treatment if a title object is selected
-if( pView )
+if (pView)
 {
 const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
 const size_t nCount = rMarkList.GetMarkCount();
@@ -78,7 +74,7 @@ OutlineBulletDlg::OutlineBulletDlg(
 switch(pObj->GetObjIdentifier())
 {
 case OBJ_TITLETEXT:
-bTitle = true;
+m_bTitle = true;
 break;
 case OBJ_OUTLINETEXT:
 bOutliner = true;
@@ -88,7 +84,7 @@ OutlineBulletDlg::OutlineBulletDlg(
 }
 }
 
-if( SfxItemState::SET != aInputSet.GetItemState(EE_PARA_NUMBULLET))
+if( SfxItemState::SET != m_aInputSet.GetItemState(EE_PARA_NUMBULLET))
 {
 

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

2018-09-18 Thread Libreoffice Gerrit user
 sd/inc/sdabstdlg.hxx   |2 
 sd/qa/unit/dialogs-test.cxx|2 
 sd/source/ui/dlg/paragr.cxx|   14 +--
 sd/source/ui/dlg/sddlgfact.cxx |4 
 sd/source/ui/dlg/sddlgfact.hxx |2 
 sd/source/ui/func/fuparagr.cxx |2 
 sd/source/ui/inc/paragr.hxx|8 -
 sd/uiconfig/sdraw/ui/drawparadialog.ui |  152 +
 8 files changed, 153 insertions(+), 33 deletions(-)

New commits:
commit feadf8387fb215ad0e126139c7b32af11ea2e194
Author: Caolán McNamara 
AuthorDate: Mon Sep 17 11:56:49 2018 +0100
Commit: Caolán McNamara 
CommitDate: Tue Sep 18 21:58:49 2018 +0200

weld SdParagraphDlg

Change-Id: I936b8b52c36f4e91a330020badf5ae4d7a4393da
Reviewed-on: https://gerrit.libreoffice.org/60582
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sd/inc/sdabstdlg.hxx b/sd/inc/sdabstdlg.hxx
index e8b1ed936ce1..44b6376dfed9 100644
--- a/sd/inc/sdabstdlg.hxx
+++ b/sd/inc/sdabstdlg.hxx
@@ -178,7 +178,7 @@ public:
 virtual VclPtr 
CreateSdInsertPagesObjsDlg(vcl::Window* pParent, const SdDrawDocument* pDoc, 
SfxMedium* pSfxMedium, const OUString& rFileName) = 0;
 virtual VclPtr   CreateMorphDlg(weld::Window* 
pParent, const SdrObject* pObj1, const SdrObject* pObj2) = 0;
 virtual VclPtr   
CreateSdOutlineBulletTabDlg(vcl::Window* pParent, const SfxItemSet* pAttr, 
::sd::View* pView) = 0;
-virtual VclPtr   
CreateSdParagraphTabDlg(vcl::Window* pWindow, const SfxItemSet* pAttr) = 0;
+virtual VclPtr   
CreateSdParagraphTabDlg(weld::Window* pWindow, const SfxItemSet* pAttr) = 0;
 virtual VclPtr 
CreateSdStartPresentationDlg(weld::Window* pWindow, const SfxItemSet& rInAttrs,
  const 
std::vector , SdCustomShowList* pCSList ) = 0;
 virtual VclPtr  CreateRemoteDialog( 
vcl::Window* pWindow ) = 0;
diff --git a/sd/qa/unit/dialogs-test.cxx b/sd/qa/unit/dialogs-test.cxx
index 0988949f415d..b4bd349e7e31 100644
--- a/sd/qa/unit/dialogs-test.cxx
+++ b/sd/qa/unit/dialogs-test.cxx
@@ -419,7 +419,7 @@ VclPtr 
SdDialogsTest::createDialogByID(sal_uInt32 nID)
 {
 // CreateSdParagraphTabDlg(const SfxItemSet* pAttr) override;
 pRetval = getSdAbstractDialogFactory()->CreateSdParagraphTabDlg(
-getViewShell()->GetActiveWindow(),
+getViewShell()->GetFrameWeld(),
 ());
 break;
 }
diff --git a/sd/source/ui/dlg/paragr.cxx b/sd/source/ui/dlg/paragr.cxx
index 3b7aa7698cc6..b6eb3583cbcc 100644
--- a/sd/source/ui/dlg/paragr.cxx
+++ b/sd/source/ui/dlg/paragr.cxx
@@ -160,13 +160,11 @@ IMPL_LINK_NOARG(SdParagraphNumTabPage, ImplNewStartHdl, 
Button*, void)
 m_pNewStartNF->Enable(bEnable && m_pNewStartNumberCB->IsChecked());
 }
 
-SdParagraphDlg::SdParagraphDlg( vcl::Window* pParent, const SfxItemSet* pAttr )
-   : SfxTabDialog( pParent,
-   "DrawParagraphPropertiesDialog",
-   "modules/sdraw/ui/drawparadialog.ui",
-   pAttr )
+SdParagraphDlg::SdParagraphDlg(weld::Window* pParent, const SfxItemSet* pAttr)
+: SfxTabDialogController(pParent, "modules/sdraw/ui/drawparadialog.ui",
+ "DrawParagraphPropertiesDialog", pAttr)
 {
-m_nParaStd = AddTabPage( "labelTP_PARA_STD", RID_SVXPAGE_STD_PARAGRAPH);
+AddTabPage( "labelTP_PARA_STD", RID_SVXPAGE_STD_PARAGRAPH);
 
 SvtCJKOptions aCJKOptions;
 if( aCJKOptions.IsAsianTypographyEnabled() )
@@ -185,10 +183,10 @@ SdParagraphDlg::SdParagraphDlg( vcl::Window* pParent, 
const SfxItemSet* pAttr )
   AddTabPage("labelTP_TABULATOR", RID_SVXPAGE_TABULATOR);
 }
 
-void SdParagraphDlg::PageCreated( sal_uInt16 nId, SfxTabPage  )
+void SdParagraphDlg::PageCreated(const OString& rId, SfxTabPage )
 {
 SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
-if (m_nParaStd == nId)
+if (rId == "labelTP_PARA_STD")
 {
 aSet.Put(SfxUInt32Item(SID_SVXSTDPARAGRAPHTABPAGE_ABSLINEDIST, 
MM50/2));
 rPage.PageCreated(aSet);
diff --git a/sd/source/ui/dlg/sddlgfact.cxx b/sd/source/ui/dlg/sddlgfact.cxx
index f6640e06d42b..871ec0d51f80 100644
--- a/sd/source/ui/dlg/sddlgfact.cxx
+++ b/sd/source/ui/dlg/sddlgfact.cxx
@@ -424,9 +424,9 @@ VclPtr  
SdAbstractDialogFactory_Impl::CreateSdOutlineBulle
 return VclPtr::Create( 
VclPtr<::sd::OutlineBulletDlg>::Create( pParent, pAttr, pView ) );
 }
 
-VclPtr 
SdAbstractDialogFactory_Impl::CreateSdParagraphTabDlg(vcl::Window* pParent, 
const SfxItemSet* pAttr )
+VclPtr 
SdAbstractDialogFactory_Impl::CreateSdParagraphTabDlg(weld::Window* pParent, 
const SfxItemSet* pAttr )
 {
-return VclPtr::Create( 
VclPtr::Create( pParent, pAttr ) );
+return 
VclPtr::Create(o3tl::make_unique(pParent,
 pAttr));
 }
 
 VclPtr 

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

2018-09-17 Thread Libreoffice Gerrit user
 sd/inc/sdabstdlg.hxx   |2 
 sd/qa/unit/dialogs-test.cxx|3 
 sd/source/ui/dlg/dlgpage.cxx   |   29 -
 sd/source/ui/dlg/sddlgfact.cxx |   40 
 sd/source/ui/dlg/sddlgfact.hxx |   22 ++
 sd/source/ui/func/fupage.cxx   |2 
 sd/source/ui/inc/dlgpage.hxx   |9 --
 sd/uiconfig/sdraw/ui/drawpagedialog.ui |  104 -
 8 files changed, 169 insertions(+), 42 deletions(-)

New commits:
commit a7e9db8338e93921ede5892545ce18655d08aad5
Author: Caolán McNamara 
AuthorDate: Sun Sep 16 14:24:12 2018 +0100
Commit: Caolán McNamara 
CommitDate: Mon Sep 17 16:06:08 2018 +0200

weld SdPageDlg

Change-Id: Id9c78651d3eb315bf2e982eef48ef24071bfc79b
Reviewed-on: https://gerrit.libreoffice.org/60550
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sd/inc/sdabstdlg.hxx b/sd/inc/sdabstdlg.hxx
index 332312ae77ba..f9c364c3a428 100644
--- a/sd/inc/sdabstdlg.hxx
+++ b/sd/inc/sdabstdlg.hxx
@@ -171,7 +171,7 @@ public:
 virtual VclPtrCreateCopyDlg(vcl::Window* 
pWindow, const SfxItemSet& rInAttrs, ::sd::View* pView ) = 0;
 virtual VclPtr
CreateSdCustomShowDlg(weld::Window* pWindow, SdDrawDocument& rDrawDoc) = 0;
 virtual VclPtr   
CreateSdTabCharDialog(vcl::Window* pWindow, const SfxItemSet* pAttr, 
SfxObjectShell* pDocShell) = 0;
-virtual VclPtr   
CreateSdTabPageDialog(vcl::Window* pWindow, const SfxItemSet* pAttr, 
SfxObjectShell* pDocShell, bool bAreaPage) = 0;
+virtual VclPtr   
CreateSdTabPageDialog(weld::Window* pWindow, const SfxItemSet* pAttr, 
SfxObjectShell* pDocShell, bool bAreaPage) = 0;
 virtual VclPtr   
CreateSdModifyFieldDlg(weld::Window* pWindow, const SvxFieldData* pInField, 
const SfxItemSet& rSet) = 0;
 virtual VclPtr  
CreateSdSnapLineDlg(weld::Window* pParent, const SfxItemSet& rInAttrs, 
::sd::View* pView) = 0;
 virtual VclPtr   
CreateSdInsertLayerDlg(weld::Window* pParent, const SfxItemSet& rInAttrs, bool 
bDeletable, const OUString& rStr) = 0;
diff --git a/sd/qa/unit/dialogs-test.cxx b/sd/qa/unit/dialogs-test.cxx
index dd9a6d989bec..1fe44cc04243 100644
--- a/sd/qa/unit/dialogs-test.cxx
+++ b/sd/qa/unit/dialogs-test.cxx
@@ -327,8 +327,9 @@ VclPtr 
SdDialogsTest::createDialogByID(sal_uInt32 nID)
 // CreateSdTabPageDialog(const SfxItemSet* pAttr, SfxObjectShell* 
pDocShell, bool bAreaPage = true) override;
 // needs a special SfxItemSet with merged content from page and 
other stuff, crashes without that (2nd page)
 // needs a 'SfxObjectShell* pDocShell', crashes without. Also 
sufficient: FillStyleItemSet with XFILL_NONE set
+auto const parent = getViewShell()->GetActiveWindow();
 pRetval = getSdAbstractDialogFactory()->CreateSdTabPageDialog(
-getViewShell()->GetActiveWindow(),
+parent == nullptr ? nullptr : parent->GetFrameWeld(),
 (),
 getDocShell(),
 true);
diff --git a/sd/source/ui/dlg/dlgpage.cxx b/sd/source/ui/dlg/dlgpage.cxx
index 75933ae73271..97e03977ef1a 100644
--- a/sd/source/ui/dlg/dlgpage.cxx
+++ b/sd/source/ui/dlg/dlgpage.cxx
@@ -33,12 +33,9 @@
 /**
  * Constructor of tab dialog: appends pages to the dialog
  */
-SdPageDlg::SdPageDlg( SfxObjectShell const * pDocSh, vcl::Window* pParent, 
const SfxItemSet* pAttr, bool bAreaPage ) :
-SfxTabDialog ( pParent
-  ,"DrawPageDialog"
-  ,"modules/sdraw/ui/drawpagedialog.ui"
-  , pAttr ),
-mpDocShell  ( pDocSh )
+SdPageDlg::SdPageDlg(SfxObjectShell const * pDocSh, weld::Window* pParent, 
const SfxItemSet* pAttr, bool bAreaPage)
+: SfxTabDialogController(pParent, "modules/sdraw/ui/drawpagedialog.ui", 
"DrawPageDialog", pAttr)
+, mpDocShell(pDocSh)
 {
 SvxColorListItem const * pColorListItem = mpDocShell->GetItem( 
SID_COLOR_TABLE );
 SvxGradientListItem const * pGradientListItem = mpDocShell->GetItem( 
SID_GRADIENT_LIST );
@@ -54,28 +51,28 @@ SdPageDlg::SdPageDlg( SfxObjectShell const * pDocSh, 
vcl::Window* pParent, const
 
 SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
 
-mnPage = AddTabPage( "RID_SVXPAGE_PAGE", pFact->GetTabPageCreatorFunc( 
RID_SVXPAGE_PAGE ), nullptr );
-mnArea = AddTabPage( "RID_SVXPAGE_AREA", pFact->GetTabPageCreatorFunc( 
RID_SVXPAGE_AREA ), nullptr );
-mnTransparence = AddTabPage( "RID_SVXPAGE_TRANSPARENCE", 
pFact->GetTabPageCreatorFunc( RID_SVXPAGE_TRANSPARENCE ), nullptr );
+AddTabPage("RID_SVXPAGE_PAGE", 
pFact->GetTabPageCreatorFunc(RID_SVXPAGE_PAGE), nullptr);
+AddTabPage("RID_SVXPAGE_AREA", 
pFact->GetTabPageCreatorFunc(RID_SVXPAGE_AREA), nullptr);
+AddTabPage("RID_SVXPAGE_TRANSPARENCE", 
pFact->GetTabPageCreatorFunc(RID_SVXPAGE_TRANSPARENCE), nullptr);
 
-if(!bAreaPage)  // I 

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

2018-05-27 Thread Mike Kaganski
 sd/inc/stlsheet.hxx |3 +
 sd/qa/unit/misc-tests.cxx   |   34 +++
 sd/source/core/stlsheet.cxx |  128 ++--
 3 files changed, 115 insertions(+), 50 deletions(-)

New commits:
commit 8a648b82f85d4b0eed67067ed2ddc211ad64ce72
Author: Mike Kaganski 
Date:   Sun May 27 14:02:09 2018 +0300

tdf#38225: update API name when renaming using a base class ref

... but don't update it in case it's a predefined API name

Change-Id: I20075a4e085bdeab8374860c16e7eb2a72772c33
Reviewed-on: https://gerrit.libreoffice.org/54879
Tested-by: Jenkins 
Reviewed-by: Mike Kaganski 

diff --git a/sd/inc/stlsheet.hxx b/sd/inc/stlsheet.hxx
index b86314383ca5..ae21105070a8 100644
--- a/sd/inc/stlsheet.hxx
+++ b/sd/inc/stlsheet.hxx
@@ -80,6 +80,9 @@ public:
 static void BroadcastSdStyleSheetChange(SfxStyleSheetBase const * 
pStyleSheet, PresentationObjects ePO,
 SfxStyleSheetBasePool* pSSPool);
 
+// SfxStyleSheetBase
+virtual bool SetName(const OUString& rNewName, bool bReindexNow = true) 
override;
+
 // XInterface
 virtual void SAL_CALL release(  ) throw () override;
 
diff --git a/sd/qa/unit/misc-tests.cxx b/sd/qa/unit/misc-tests.cxx
index 9125f2306bad..ace77cdcc96e 100644
--- a/sd/qa/unit/misc-tests.cxx
+++ b/sd/qa/unit/misc-tests.cxx
@@ -61,6 +61,7 @@ public:
 void testTdf99396TextEdit();
 void testFillGradient();
 void testTdf44774();
+void testTdf38225();
 
 CPPUNIT_TEST_SUITE(SdMiscTest);
 CPPUNIT_TEST(testTdf96206);
@@ -69,6 +70,7 @@ public:
 CPPUNIT_TEST(testTdf99396TextEdit);
 CPPUNIT_TEST(testFillGradient);
 CPPUNIT_TEST(testTdf44774);
+CPPUNIT_TEST(testTdf38225);
 CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -327,6 +329,38 @@ void SdMiscTest::testTdf44774()
 CPPUNIT_ASSERT_EQUAL(OUString("StyleA"), pStyle->GetParent());
 }
 
+void SdMiscTest::testTdf38225()
+{
+sd::DrawDocShellRef xDocShRef = new 
sd::DrawDocShell(SfxObjectCreateMode::EMBEDDED, false,
+DocumentType::Draw);
+const uno::Reference xLoadable(xDocShRef->GetModel(), 
uno::UNO_QUERY_THROW);
+xLoadable->initNew();
+SfxStyleSheetBasePool* pSSPool = xDocShRef->GetStyleSheetPool();
+
+// Create a new style with a name
+pSSPool->Make("StyleWithName1", SfxStyleFamily::Para, 
SfxStyleSearchBits::UserDefined);
+
+// Now save the file and reload
+xDocShRef = saveAndReload(xDocShRef.get(), ODG);
+pSSPool = xDocShRef->GetStyleSheetPool();
+
+SfxStyleSheetBase* pStyle = pSSPool->Find("StyleWithName1", 
SfxStyleFamily::Para);
+CPPUNIT_ASSERT(pStyle);
+
+// Rename the style
+CPPUNIT_ASSERT(pStyle->SetName("StyleWithName2"));
+
+// Save the file and reload again
+xDocShRef = saveAndReload(xDocShRef.get(), ODG);
+pSSPool = xDocShRef->GetStyleSheetPool();
+
+// The problem was that the style kept the old name upon reloading
+pStyle = pSSPool->Find("StyleWithName1", SfxStyleFamily::Para);
+CPPUNIT_ASSERT(!pStyle);
+pStyle = pSSPool->Find("StyleWithName2", SfxStyleFamily::Para);
+CPPUNIT_ASSERT(pStyle);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdMiscTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx
index 4f2cde188768..1b517483b7c6 100644
--- a/sd/source/core/stlsheet.cxx
+++ b/sd/source/core/stlsheet.cxx
@@ -582,56 +582,77 @@ bool SdStyleSheet::HasClearParentSupport() const
 return true;
 }
 
-void SdStyleSheet::SetHelpId( const OUString& r, sal_uLong nId )
+namespace
 {
-SfxStyleSheet::SetHelpId( r, nId );
+struct ApiNameMap
+{
+OUStringLiteral mpApiName;
+sal_uInt32 mnHelpId;
+} const pApiNameMap[]
+= { { OUStringLiteral("title"), HID_PSEUDOSHEET_TITLE },
+{ OUStringLiteral("subtitle"), HID_PSEUDOSHEET_SUBTITLE },
+{ OUStringLiteral("background"), HID_PSEUDOSHEET_BACKGROUND },
+{ OUStringLiteral("backgroundobjects"), 
HID_PSEUDOSHEET_BACKGROUNDOBJECTS },
+{ OUStringLiteral("notes"), HID_PSEUDOSHEET_NOTES },
+{ OUStringLiteral("standard"), HID_STANDARD_STYLESHEET_NAME },
+{ OUStringLiteral("objectwithoutfill"), HID_POOLSHEET_OBJWITHOUTFILL },
+{ OUStringLiteral("text"), HID_POOLSHEET_TEXT },
+{ OUStringLiteral("title"), HID_POOLSHEET_TITLE },
+{ OUStringLiteral("headline"), HID_POOLSHEET_HEADLINE },
+{ OUStringLiteral("measure"), HID_POOLSHEET_MEASURE },
+{ OUStringLiteral("Filled"), HID_POOLSHEET_FILLED },
+{ OUStringLiteral("Filled Blue"), HID_POOLSHEET_FILLED_BLUE },
+{ OUStringLiteral("Filled Green"), HID_POOLSHEET_FILLED_GREEN },
+{ OUStringLiteral("Filled Red"), HID_POOLSHEET_FILLED_RED },
+{ OUStringLiteral("Filled Yellow"), HID_POOLSHEET_FILLED_YELLOW },
+{ OUStringLiteral("Outlined"), HID_POOLSHEET_OUTLINE },
+{ 

[Libreoffice-commits] core.git: sd/inc sd/qa sd/source sd/uiconfig svx/source

2018-05-11 Thread Caolán McNamara
 sd/inc/sdabstdlg.hxx   |2 
 sd/qa/unit/dialogs-test.cxx|   13 
 sd/source/ui/dlg/PhotoAlbumDialog.cxx  |  285 ++---
 sd/source/ui/dlg/PhotoAlbumDialog.hxx  |   70 +---
 sd/source/ui/dlg/sddlgfact.cxx |   10 
 sd/source/ui/dlg/sddlgfact.hxx |   14 
 sd/source/ui/slidesorter/controller/SlsSlotManager.cxx |3 
 sd/source/ui/view/drviews2.cxx |3 
 sd/source/ui/view/outlnvs2.cxx |3 
 sd/uiconfig/simpress/ui/photoalbum.ui  |   64 +--
 svx/source/dialog/graphctl.cxx |1 
 11 files changed, 206 insertions(+), 262 deletions(-)

New commits:
commit 850995b2c22db7c3ddbcc8ebfad5bcbc0b01f029
Author: Caolán McNamara 
Date:   Fri May 11 13:56:03 2018 +0100

weld SdPhotoAlbumDialog

Change-Id: I46cca94bb43e1b1cd9757b22baad9bb3f61bc15d
Reviewed-on: https://gerrit.libreoffice.org/54132
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sd/inc/sdabstdlg.hxx b/sd/inc/sdabstdlg.hxx
index babfe9d84baf..27fb17ddd9ed 100644
--- a/sd/inc/sdabstdlg.hxx
+++ b/sd/inc/sdabstdlg.hxx
@@ -206,7 +206,7 @@ public:
 virtual CreateTabPage   GetSdOptionsMiscTabPageCreatorFunc() = 
0;
 virtual CreateTabPage   GetSdOptionsSnapTabPageCreatorFunc() = 
0;
 
-virtual VclPtr CreateSdPhotoAlbumDialog( vcl::Window* 
pWindow, SdDrawDocument* pDoc) = 0;
+virtual VclPtr CreateSdPhotoAlbumDialog(weld::Window* 
pWindow, SdDrawDocument* pDoc) = 0;
 
 protected:
 ~SdAbstractDialogFactory() {}
diff --git a/sd/qa/unit/dialogs-test.cxx b/sd/qa/unit/dialogs-test.cxx
index f926f0be7948..8a2d6603ac55 100644
--- a/sd/qa/unit/dialogs-test.cxx
+++ b/sd/qa/unit/dialogs-test.cxx
@@ -278,7 +278,7 @@ VclPtr 
SdDialogsTest::createDialogByID(sal_uInt32 nID)
 }
 case 1:
 {
-// CreateBreakDlg(vcl::Window* pWindow, ::sd::DrawView* pDrView, 
::sd::DrawDocShell* pShell, sal_uLong nSumActionCount, sal_uLong nObjCount) 
override;
+// CreateBreakDlg(weld::Window* pWindow, ::sd::DrawView* pDrView, 
::sd::DrawDocShell* pShell, sal_uLong nSumActionCount, sal_uLong nObjCount) 
override;
 // this dialog requires pDrawView. It does not show much when
 // there is no object selected that can be broken up. For better
 // results it might be necessary to add/select an object that
@@ -397,7 +397,7 @@ VclPtr 
SdDialogsTest::createDialogByID(sal_uInt32 nID)
 }
 case 10:
 {
-// CreateMorphDlg(vcl::Window* pParent, const SdrObject* pObj1, 
const SdrObject* pObj2) override;
+// CreateMorphDlg(weld::Window* pParent, const SdrObject* pObj1, 
const SdrObject* pObj2) override;
 SdDrawDocument* pDrawDoc = getSdXImpressDocument()->GetDoc();
 CPPUNIT_ASSERT(pDrawDoc);
 SdPage* pSdPage = pDrawDoc->GetSdPage(0, PageKind::Standard);
@@ -542,7 +542,7 @@ VclPtr 
SdDialogsTest::createDialogByID(sal_uInt32 nID)
 }
 case 19:
 {
-// CreateSdVectorizeDlg(vcl::Window* pParent, const Bitmap& rBmp, 
::sd::DrawDocShell* pDocShell) override;
+// CreateSdVectorizeDlg(weld::Window* pParent, const Bitmap& rBmp, 
::sd::DrawDocShell* pDocShell) override;
 // works well with empty Bitmap, but my be nicer with setting one
 Bitmap aEmptyBitmap;
 auto const parent = Application::GetDefDialogParent();
@@ -554,17 +554,18 @@ VclPtr 
SdDialogsTest::createDialogByID(sal_uInt32 nID)
 }
 case 20:
 {
-// CreateSdPhotoAlbumDialog(vcl::Window* pWindow, SdDrawDocument* 
pDoc) override;
+// CreateSdPhotoAlbumDialog(weld::Window* pWindow, SdDrawDocument* 
pDoc) override;
 SdDrawDocument* pDrawDoc = getSdXImpressDocument()->GetDoc();
 CPPUNIT_ASSERT(pDrawDoc);
+auto const parent = Application::GetDefDialogParent();
 pRetval = getSdAbstractDialogFactory()->CreateSdPhotoAlbumDialog(
-Application::GetDefDialogParent(),
+parent == nullptr ? nullptr : parent->GetFrameWeld(),
 pDrawDoc);
 break;
 }
 case 21:
 {
-// CreateMasterLayoutDialog(vcl::Window* pParent, SdDrawDocument* 
pDoc, SdPage*) override;
+// CreateMasterLayoutDialog(weld::Window* pParent, SdDrawDocument* 
pDoc, SdPage*) override;
 SdDrawDocument* pDrawDoc = getSdXImpressDocument()->GetDoc();
 CPPUNIT_ASSERT(pDrawDoc);
 SdPage* pSdPage = pDrawDoc->GetSdPage(0, PageKind::Standard);
diff --git a/sd/source/ui/dlg/PhotoAlbumDialog.cxx 
b/sd/source/ui/dlg/PhotoAlbumDialog.cxx
index 

[Libreoffice-commits] core.git: sd/inc sd/qa sd/source sd/uiconfig vcl/unx

2018-05-10 Thread Caolán McNamara
 sd/inc/sdabstdlg.hxx |2 
 sd/qa/unit/dialogs-test.cxx  |3 
 sd/source/ui/dlg/custsdlg.cxx|  362 ++-
 sd/source/ui/dlg/sddlgfact.cxx   |   15 
 sd/source/ui/dlg/sddlgfact.hxx   |   11 
 sd/source/ui/func/fucushow.cxx   |3 
 sd/source/ui/inc/custsdlg.hxx|   76 ++--
 sd/uiconfig/simpress/ui/customslideshows.ui  |   46 ++
 sd/uiconfig/simpress/ui/definecustomslideshow.ui |   94 +
 vcl/unx/gtk3/gtk3gtkinst.cxx |   20 -
 10 files changed, 351 insertions(+), 281 deletions(-)

New commits:
commit 5e245445200c5d094bb7eef76d8df3077b799ac5
Author: Caolán McNamara 
Date:   Thu May 10 11:27:36 2018 +0100

weld SdCustomShowDlg and SdDefineCustomShowDlg

Change-Id: I44d40a286eb5d70982284a270f340653858d38cf
Reviewed-on: https://gerrit.libreoffice.org/54076
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sd/inc/sdabstdlg.hxx b/sd/inc/sdabstdlg.hxx
index 65cfb1afeadc..1cd4f51d11e7 100644
--- a/sd/inc/sdabstdlg.hxx
+++ b/sd/inc/sdabstdlg.hxx
@@ -180,7 +180,7 @@ public:
 
 virtual VclPtr  CreateBreakDlg(weld::Window* 
pWindow, ::sd::DrawView* pDrView, ::sd::DrawDocShell* pShell, sal_uLong 
nSumActionCount, sal_uLong nObjCount ) = 0;
 virtual VclPtrCreateCopyDlg(vcl::Window* 
pWindow, const SfxItemSet& rInAttrs, ::sd::View* pView ) = 0;
-virtual VclPtr
CreateSdCustomShowDlg(vcl::Window* pWindow, SdDrawDocument& rDrawDoc) = 0;
+virtual VclPtr
CreateSdCustomShowDlg(weld::Window* pWindow, SdDrawDocument& rDrawDoc) = 0;
 virtual VclPtr   
CreateSdTabCharDialog(vcl::Window* pWindow, const SfxItemSet* pAttr, 
SfxObjectShell* pDocShell) = 0;
 virtual VclPtr   
CreateSdTabPageDialog(vcl::Window* pWindow, const SfxItemSet* pAttr, 
SfxObjectShell* pDocShell, bool bAreaPage) = 0;
 virtual VclPtr   
CreateSdModifyFieldDlg(vcl::Window* pWindow, const SvxFieldData* pInField, 
const SfxItemSet& rSet) = 0;
diff --git a/sd/qa/unit/dialogs-test.cxx b/sd/qa/unit/dialogs-test.cxx
index a30643293ed1..a4a0a049bd7a 100644
--- a/sd/qa/unit/dialogs-test.cxx
+++ b/sd/qa/unit/dialogs-test.cxx
@@ -307,8 +307,9 @@ VclPtr 
SdDialogsTest::createDialogByID(sal_uInt32 nID)
 SdDrawDocument* pDrawDoc = getSdXImpressDocument()->GetDoc();
 CPPUNIT_ASSERT(pDrawDoc);
 
+auto const parent = getViewShell()->GetActiveWindow();
 pRetval = getSdAbstractDialogFactory()->CreateSdCustomShowDlg(
-getViewShell()->GetActiveWindow(),
+parent == nullptr ? nullptr : parent->GetFrameWeld(),
 *pDrawDoc);
 break;
 }
diff --git a/sd/source/ui/dlg/custsdlg.cxx b/sd/source/ui/dlg/custsdlg.cxx
index 66fe0686076c..060f314c74a6 100644
--- a/sd/source/ui/dlg/custsdlg.cxx
+++ b/sd/source/ui/dlg/custsdlg.cxx
@@ -32,36 +32,34 @@
 #include 
 
 // SdCustomShowDlg
-SdCustomShowDlg::SdCustomShowDlg( vcl::Window* pWindow,
-SdDrawDocument& rDrawDoc ) :
-ModalDialog ( pWindow, "CustomSlideShows", 
"modules/simpress/ui/customslideshows.ui" ),
-rDoc( rDrawDoc ),
-pCustomShowList ( nullptr ),
-pCustomShow ( nullptr ),
-bModified   ( false )
+SdCustomShowDlg::SdCustomShowDlg(weld::Window* pWindow, SdDrawDocument& 
rDrawDoc)
+: GenericDialogController(pWindow, 
"modules/simpress/ui/customslideshows.ui", "CustomSlideShows")
+, rDoc(rDrawDoc)
+, pCustomShowList(nullptr)
+, pCustomShow(nullptr)
+, bModified(false)
+, m_xLbCustomShows(m_xBuilder->weld_tree_view("customshowlist"))
+, m_xCbxUseCustomShow(m_xBuilder->weld_check_button("usecustomshows"))
+, m_xBtnNew(m_xBuilder->weld_button("new"))
+, m_xBtnEdit(m_xBuilder->weld_button("edit"))
+, m_xBtnRemove(m_xBuilder->weld_button("delete"))
+, m_xBtnCopy(m_xBuilder->weld_button("copy"))
+, m_xBtnHelp(m_xBuilder->weld_button("help"))
+, m_xBtnStartShow(m_xBuilder->weld_button("startshow"))
+, m_xBtnOK(m_xBuilder->weld_button("ok"))
 {
-get( m_pBtnNew, "new" );
-get( m_pBtnEdit, "edit" );
-get( m_pBtnRemove, "delete" );
-get( m_pBtnCopy, "copy" );
-get( m_pBtnHelp, "help" );
-get( m_pBtnStartShow, "startshow" );
-get( m_pBtnOK, "ok" );
-get( m_pLbCustomShows, "customshowlist");
-get( m_pCbxUseCustomShow, "usecustomshows" );
-
-
m_pLbCustomShows->set_width_request(m_pLbCustomShows->approximate_char_width() 
* 32);
-m_pLbCustomShows->SetDropDownLineCount(8);
-
-Link aLink( LINK( this, SdCustomShowDlg, ClickButtonHdl ) );
-m_pBtnNew->SetClickHdl( aLink );
-m_pBtnEdit->SetClickHdl( aLink );
-m_pBtnRemove->SetClickHdl( aLink );
-

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

2018-04-30 Thread Caolán McNamara
 sd/inc/sdabstdlg.hxx |2 -
 sd/qa/unit/dialogs-test.cxx  |3 +
 sd/source/ui/dlg/layeroptionsdlg.cxx |   66 +--
 sd/source/ui/dlg/sddlgfact.cxx   |   15 +--
 sd/source/ui/dlg/sddlgfact.hxx   |   11 -
 sd/source/ui/inc/layeroptionsdlg.hxx |   28 ++
 sd/source/ui/view/drviews2.cxx   |6 ++-
 sd/uiconfig/sdraw/ui/insertlayer.ui  |   16 ++--
 8 files changed, 77 insertions(+), 70 deletions(-)

New commits:
commit 58c07ae9829c1d40f0a851d379c126933243fce3
Author: Caolán McNamara 
Date:   Mon Apr 30 10:30:31 2018 +0100

weld SdInsertLayerDlg

Change-Id: I1f298fe6bf1bbd1dc8edc6386bf4466d5ac1e05a
Reviewed-on: https://gerrit.libreoffice.org/53651
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sd/inc/sdabstdlg.hxx b/sd/inc/sdabstdlg.hxx
index 571d8369e2d7..8587d9dc256e 100644
--- a/sd/inc/sdabstdlg.hxx
+++ b/sd/inc/sdabstdlg.hxx
@@ -185,7 +185,7 @@ public:
 virtual VclPtr   
CreateSdTabPageDialog(vcl::Window* pWindow, const SfxItemSet* pAttr, 
SfxObjectShell* pDocShell, bool bAreaPage) = 0;
 virtual VclPtr   
CreateSdModifyFieldDlg(vcl::Window* pWindow, const SvxFieldData* pInField, 
const SfxItemSet& rSet) = 0;
 virtual VclPtr  
CreateSdSnapLineDlg(vcl::Window* pParent, const SfxItemSet& rInAttrs, 
::sd::View* pView) = 0;
-virtual VclPtr   
CreateSdInsertLayerDlg(vcl::Window* pParent, const SfxItemSet& rInAttrs, bool 
bDeletable, const OUString& aStr) = 0;
+virtual VclPtr   
CreateSdInsertLayerDlg(weld::Window* pParent, const SfxItemSet& rInAttrs, bool 
bDeletable, const OUString& rStr) = 0;
 virtual VclPtr 
CreateSdInsertPagesObjsDlg(vcl::Window* pParent, const SdDrawDocument* pDoc, 
SfxMedium* pSfxMedium, const OUString& rFileName) = 0;
 virtual VclPtr   CreateMorphDlg(weld::Window* 
pParent, const SdrObject* pObj1, const SdrObject* pObj2) = 0;
 virtual VclPtr   
CreateSdOutlineBulletTabDlg(vcl::Window* pParent, const SfxItemSet* pAttr, 
::sd::View* pView) = 0;
diff --git a/sd/qa/unit/dialogs-test.cxx b/sd/qa/unit/dialogs-test.cxx
index 89e036af3442..260b22ce7fc0 100644
--- a/sd/qa/unit/dialogs-test.cxx
+++ b/sd/qa/unit/dialogs-test.cxx
@@ -372,8 +372,9 @@ VclPtr 
SdDialogsTest::createDialogByID(sal_uInt32 nID)
 aNewAttr.Put(makeSdAttrLayerPrintable());
 aNewAttr.Put(makeSdAttrLayerLocked());
 aNewAttr.Put(makeSdAttrLayerThisPage());
+auto const parent = getViewShell()->GetActiveWindow();
 pRetval = getSdAbstractDialogFactory()->CreateSdInsertLayerDlg(
-getViewShell()->GetActiveWindow(),
+parent == nullptr ? nullptr : parent->GetFrameWeld(),
 aNewAttr,
 true, // alternative: false
 SdResId(STR_INSERTLAYER) /* alternative: STR_MODIFYLAYER */);
diff --git a/sd/source/ui/dlg/layeroptionsdlg.cxx 
b/sd/source/ui/dlg/layeroptionsdlg.cxx
index 4c966ab0bea5..2530f3cbdace 100644
--- a/sd/source/ui/dlg/layeroptionsdlg.cxx
+++ b/sd/source/ui/dlg/layeroptionsdlg.cxx
@@ -18,60 +18,46 @@
  */
 
 #include 
-#include 
 
 #include 
 #include 
 
-SdInsertLayerDlg::SdInsertLayerDlg( vcl::Window* pWindow, const SfxItemSet& 
rInAttrs,
-bool bDeletable, const OUString& rStr )
-: ModalDialog(pWindow, "InsertLayerDialog", 
"modules/sdraw/ui/insertlayer.ui")
+SdInsertLayerDlg::SdInsertLayerDlg(weld::Window* pWindow, const SfxItemSet& 
rInAttrs,
+bool bDeletable, const OUString& rStr)
+: GenericDialogController(pWindow, "modules/sdraw/ui/insertlayer.ui", 
"InsertLayerDialog")
 , mrOutAttrs(rInAttrs)
+, m_xEdtName(m_xBuilder->weld_entry("name"))
+, m_xEdtTitle(m_xBuilder->weld_entry("title"))
+, m_xEdtDesc(m_xBuilder->weld_text_view("textview"))
+, m_xCbxVisible(m_xBuilder->weld_check_button("visible"))
+, m_xCbxPrintable(m_xBuilder->weld_check_button("printable"))
+, m_xCbxLocked(m_xBuilder->weld_check_button("locked"))
+, m_xNameFrame(m_xBuilder->weld_widget("nameframe"))
 {
-SetText(rStr);
-
-get(m_pEdtName, "name");
-get(m_pEdtTitle, "title");
-get(m_pEdtDesc, "textview");
-get(m_pCbxVisible, "visible");
-get(m_pCbxPrintable, "printable");
-get(m_pCbxLocked, "locked");
-
-m_pEdtName->SetText( static_cast( mrOutAttrs.Get( 
ATTR_LAYER_NAME ) ).GetValue() );
-m_pEdtTitle->SetText( static_cast( mrOutAttrs.Get( 
ATTR_LAYER_TITLE ) ).GetValue() );
-m_pEdtDesc->SetText( static_cast( mrOutAttrs.Get( 
ATTR_LAYER_DESC ) ).GetValue() );
-m_pEdtDesc->set_height_request(4 * m_pEdtDesc->GetTextHeight());
-m_pCbxVisible->Check( static_cast( mrOutAttrs.Get( 
ATTR_LAYER_VISIBLE ) ).GetValue() );
-m_pCbxPrintable->Check( static_cast( mrOutAttrs.Get( 
ATTR_LAYER_PRINTABLE ) ).GetValue() );
-m_pCbxLocked->Check( 

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

2018-04-30 Thread Caolán McNamara
 sd/inc/sdabstdlg.hxx|2 -
 sd/qa/unit/dialogs-test.cxx |3 +-
 sd/source/ui/dlg/morphdlg.cxx   |   35 ++--
 sd/source/ui/dlg/sddlgfact.cxx  |   19 ++---
 sd/source/ui/dlg/sddlgfact.hxx  |   11 --
 sd/source/ui/func/fumorph.cxx   |2 -
 sd/source/ui/inc/morphdlg.hxx   |   27 
 sd/uiconfig/sdraw/ui/crossfadedialog.ui |   11 --
 8 files changed, 55 insertions(+), 55 deletions(-)

New commits:
commit 8d2fe4c81c6f6bde3571beaa02abc0a9eba038e8
Author: Caolán McNamara 
Date:   Sun Apr 29 21:29:13 2018 +0100

weld MorphDlg

Change-Id: I6f47606e8d66c9bf9a32d221f223d734397b8570
Reviewed-on: https://gerrit.libreoffice.org/53636
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sd/inc/sdabstdlg.hxx b/sd/inc/sdabstdlg.hxx
index 0f96f96ea62e..571d8369e2d7 100644
--- a/sd/inc/sdabstdlg.hxx
+++ b/sd/inc/sdabstdlg.hxx
@@ -187,7 +187,7 @@ public:
 virtual VclPtr  
CreateSdSnapLineDlg(vcl::Window* pParent, const SfxItemSet& rInAttrs, 
::sd::View* pView) = 0;
 virtual VclPtr   
CreateSdInsertLayerDlg(vcl::Window* pParent, const SfxItemSet& rInAttrs, bool 
bDeletable, const OUString& aStr) = 0;
 virtual VclPtr 
CreateSdInsertPagesObjsDlg(vcl::Window* pParent, const SdDrawDocument* pDoc, 
SfxMedium* pSfxMedium, const OUString& rFileName) = 0;
-virtual VclPtr   CreateMorphDlg(vcl::Window* 
pParent, const SdrObject* pObj1, const SdrObject* pObj2) = 0;
+virtual VclPtr   CreateMorphDlg(weld::Window* 
pParent, const SdrObject* pObj1, const SdrObject* pObj2) = 0;
 virtual VclPtr   
CreateSdOutlineBulletTabDlg(vcl::Window* pParent, const SfxItemSet* pAttr, 
::sd::View* pView) = 0;
 virtual VclPtr   
CreateSdParagraphTabDlg(vcl::Window* pWindow, const SfxItemSet* pAttr) = 0;
 virtual VclPtr CreateSdStartPresentationDlg( 
vcl::Window* pWindow, const SfxItemSet& rInAttrs,
diff --git a/sd/qa/unit/dialogs-test.cxx b/sd/qa/unit/dialogs-test.cxx
index 3fac39df3ed5..89e036af3442 100644
--- a/sd/qa/unit/dialogs-test.cxx
+++ b/sd/qa/unit/dialogs-test.cxx
@@ -402,8 +402,9 @@ VclPtr 
SdDialogsTest::createDialogByID(sal_uInt32 nID)
 SdrObject* pSdrObj = pSdPage->GetObj(0);
 // using one SdrObject is okay, none crashes
 CPPUNIT_ASSERT(pSdrObj);
+auto const parent = Application::GetDefDialogParent();
 pRetval = getSdAbstractDialogFactory()->CreateMorphDlg(
-Application::GetDefDialogParent(),
+parent == nullptr ? nullptr : parent->GetFrameWeld(),
 pSdrObj,
 pSdrObj);
 break;
diff --git a/sd/source/ui/dlg/morphdlg.cxx b/sd/source/ui/dlg/morphdlg.cxx
index df12096702e1..434a57d7f034 100644
--- a/sd/source/ui/dlg/morphdlg.cxx
+++ b/sd/source/ui/dlg/morphdlg.cxx
@@ -33,14 +33,12 @@ using namespace com::sun::star;
 
 namespace sd {
 
-MorphDlg::MorphDlg( vcl::Window* pParent, const SdrObject* pObj1, const 
SdrObject* pObj2 )
-: ModalDialog(pParent, "CrossFadeDialog",
-"modules/sdraw/ui/crossfadedialog.ui")
+MorphDlg::MorphDlg(weld::Window* pParent, const SdrObject* pObj1, const 
SdrObject* pObj2 )
+: GenericDialogController(pParent, "modules/sdraw/ui/crossfadedialog.ui", 
"CrossFadeDialog")
+, m_xMtfSteps(m_xBuilder->weld_spin_button("increments"))
+, m_xCbxAttributes(m_xBuilder->weld_check_button("attributes"))
+, m_xCbxOrientation(m_xBuilder->weld_check_button("orientation"))
 {
-get(m_pMtfSteps, "increments");
-get(m_pCbxAttributes, "attributes");
-get(m_pCbxOrientation, "orientation");
-
 LoadSettings();
 
 SfxItemPool &   rPool = pObj1->GetObjectItemPool();
@@ -58,21 +56,12 @@ MorphDlg::MorphDlg( vcl::Window* pParent, const SdrObject* 
pObj1, const SdrObjec
 if ( ( ( eLineStyle1 == drawing::LineStyle_NONE ) || ( eLineStyle2 == 
drawing::LineStyle_NONE ) ) &&
  ( ( eFillStyle1 != drawing::FillStyle_SOLID ) || ( eFillStyle2 != 
drawing::FillStyle_SOLID ) ) )
 {
-m_pCbxAttributes->Disable();
+m_xCbxAttributes->set_sensitive(false);
 }
 }
 
 MorphDlg::~MorphDlg()
 {
-disposeOnce();
-}
-
-void MorphDlg::dispose()
-{
-m_pMtfSteps.clear();
-m_pCbxAttributes.clear();
-m_pCbxOrientation.clear();
-ModalDialog::dispose();
 }
 
 void MorphDlg::LoadSettings()
@@ -94,9 +83,9 @@ void MorphDlg::LoadSettings()
 bOrient = bAttrib = true;
 }
 
-m_pMtfSteps->SetValue( nSteps );
-m_pCbxOrientation->Check( bOrient );
-m_pCbxAttributes->Check( bAttrib );
+m_xMtfSteps->set_value(nSteps);
+m_xCbxOrientation->set_active(bOrient);
+m_xCbxAttributes->set_active(bAttrib);
 }
 
 void MorphDlg::SaveSettings() const
@@ -108,9 +97,9 @@ void 

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

2018-04-30 Thread Caolán McNamara
 sd/inc/sdabstdlg.hxx   |4 --
 sd/qa/unit/dialogs-test.cxx|3 +
 sd/source/ui/dlg/masterlayoutdlg.cxx   |   54 +++--
 sd/source/ui/dlg/sddlgfact.cxx |   15 ++--
 sd/source/ui/dlg/sddlgfact.hxx |   16 ++--
 sd/source/ui/inc/masterlayoutdlg.hxx   |   22 ---
 sd/source/ui/view/drviews3.cxx |3 +
 sd/uiconfig/simpress/ui/masterlayoutdlg.ui |3 +
 8 files changed, 62 insertions(+), 58 deletions(-)

New commits:
commit 5fa87d266ef2a593b9b948787781200600f4f3da
Author: Caolán McNamara 
Date:   Mon Apr 30 10:12:31 2018 +0100

weld MasterLayoutDialog

Change-Id: Iab0a2c1565f109886596a1c15179fdf497633752
Reviewed-on: https://gerrit.libreoffice.org/53650
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sd/inc/sdabstdlg.hxx b/sd/inc/sdabstdlg.hxx
index 35b7233eea73..0f96f96ea62e 100644
--- a/sd/inc/sdabstdlg.hxx
+++ b/sd/inc/sdabstdlg.hxx
@@ -200,9 +200,7 @@ public:
 virtual VclPtr CreateSdVectorizeDlg( 
vcl::Window* pParent, const Bitmap& rBmp, ::sd::DrawDocShell* pDocShell ) = 0;
 virtual VclPtrCreateSdPublishingDlg( 
vcl::Window* pWindow, DocumentType eDocType) = 0;
 
-virtual VclPtr  CreateMasterLayoutDialog( 
vcl::Window* pParent,
-  
SdDrawDocument* pDoc,
-  SdPage* ) = 
0;
+virtual VclPtr  
CreateMasterLayoutDialog(weld::Window* pParent, SdDrawDocument* pDoc, SdPage*) 
= 0;
 
 virtual VclPtr CreateHeaderFooterDialog( 
sd::ViewShell* pViewShell,
   vcl::Window* 
pParent,
diff --git a/sd/qa/unit/dialogs-test.cxx b/sd/qa/unit/dialogs-test.cxx
index 478f91b324e8..3fac39df3ed5 100644
--- a/sd/qa/unit/dialogs-test.cxx
+++ b/sd/qa/unit/dialogs-test.cxx
@@ -563,8 +563,9 @@ VclPtr 
SdDialogsTest::createDialogByID(sal_uInt32 nID)
 CPPUNIT_ASSERT(pDrawDoc);
 SdPage* pSdPage = pDrawDoc->GetSdPage(0, PageKind::Standard);
 CPPUNIT_ASSERT(pSdPage);
+auto const parent = Application::GetDefDialogParent();
 pRetval = getSdAbstractDialogFactory()->CreateMasterLayoutDialog(
-Application::GetDefDialogParent(),
+parent == nullptr ? nullptr : parent->GetFrameWeld(),
 pDrawDoc,
 pSdPage);
 break;
diff --git a/sd/source/ui/dlg/masterlayoutdlg.cxx 
b/sd/source/ui/dlg/masterlayoutdlg.cxx
index a0ec4298f54c..83d8d38c8c8e 100644
--- a/sd/source/ui/dlg/masterlayoutdlg.cxx
+++ b/sd/source/ui/dlg/masterlayoutdlg.cxx
@@ -24,17 +24,16 @@
 
 using namespace ::sd;
 
-MasterLayoutDialog::MasterLayoutDialog( vcl::Window* pParent, SdDrawDocument* 
pDoc, SdPage* pCurrentPage )
-: ModalDialog(pParent, "MasterLayoutDialog", 
"modules/simpress/ui/masterlayoutdlg.ui")
+MasterLayoutDialog::MasterLayoutDialog(weld::Window* pParent, SdDrawDocument* 
pDoc, SdPage* pCurrentPage)
+: GenericDialogController(pParent, 
"modules/simpress/ui/masterlayoutdlg.ui", "MasterLayoutDialog")
 , mpDoc(pDoc)
 , mpCurrentPage(pCurrentPage)
+, mxCBDate(m_xBuilder->weld_check_button("datetime"))
+, mxCBPageNumber(m_xBuilder->weld_check_button("pagenumber"))
+, mxCBSlideNumber(m_xBuilder->weld_check_button("slidenumber"))
+, mxCBHeader(m_xBuilder->weld_check_button("header"))
+, mxCBFooter(m_xBuilder->weld_check_button("footer"))
 {
-get(mpCBDate, "datetime");
-get(mpCBPageNumber, "pagenumber");
-get(mpCBSlideNumber, "slidenumber");
-get(mpCBHeader, "header");
-get(mpCBFooter, "footer");
-
 if( mpCurrentPage && !mpCurrentPage->IsMasterPage() )
 {
 mpCurrentPage = 
static_cast(&(mpCurrentPage->TRG_GetMasterPage()));
@@ -50,8 +49,8 @@ MasterLayoutDialog::MasterLayoutDialog( vcl::Window* pParent, 
SdDrawDocument* pD
 {
 case PageKind::Standard:
 {
-mpCBHeader->Enable(false);
-mpCBPageNumber->SetText(mpCBSlideNumber->GetText());
+mxCBHeader->set_sensitive(false);
+mxCBPageNumber->set_label(mxCBSlideNumber->get_label());
 break;
 }
 case PageKind::Notes:
@@ -65,39 +64,28 @@ MasterLayoutDialog::MasterLayoutDialog( vcl::Window* 
pParent, SdDrawDocument* pD
 mbOldFooter = mpCurrentPage->GetPresObj( PRESOBJ_FOOTER ) != nullptr;
 mbOldPageNumber = mpCurrentPage->GetPresObj( PRESOBJ_SLIDENUMBER ) != 
nullptr;
 
-mpCBHeader->Check( mbOldHeader );
-mpCBDate->Check( mbOldDate );
-mpCBFooter->Check( mbOldFooter );
-mpCBPageNumber->Check( mbOldPageNumber );
+mxCBHeader->set_active( mbOldHeader );
+mxCBDate->set_active( mbOldDate );
+

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

2018-02-15 Thread Vasily Melenchuk
 sd/inc/sdpage.hxx|1 -
 sd/qa/unoapi/knownissues.xcl |5 +
 sd/source/core/sdpage.cxx|   38 +++---
 sd/source/core/sdpage2.cxx   |7 +++
 4 files changed, 19 insertions(+), 32 deletions(-)

New commits:
commit 3462a55f0696ae06ea6714723c54eb7c67c2cbaa
Author: Vasily Melenchuk 
Date:   Tue Jan 30 10:26:27 2018 +0300

tdf#115345: removed slide orientation setting method.

Slide orientation is dependent value and can be easily calculated
based on slide dimensions.

Also modification of slide orientation without changing of page
dimensions brings page in inconsistent state.

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

diff --git a/sd/inc/sdpage.hxx b/sd/inc/sdpage.hxx
index dcef647fb59e..42af131102c0 100644
--- a/sd/inc/sdpage.hxx
+++ b/sd/inc/sdpage.hxx
@@ -122,7 +122,6 @@ friend class sd::UndoAttrObject;
 boolmbBackgroundFullSize; ///< Background object to represent the 
whole page.
 rtl_TextEncoding meCharSet;   ///< Text encoding
 sal_uInt16  mnPaperBin;   ///< PaperBin
-Orientation meOrientation;///< Print orientation.
 SdPageLink* mpPageLink;   ///< Page link (at left sides only)
 
 sd::AnnotationVectormaAnnotations;
diff --git a/sd/qa/unoapi/knownissues.xcl b/sd/qa/unoapi/knownissues.xcl
index a7ec4216100a..d9e0690013a1 100644
--- a/sd/qa/unoapi/knownissues.xcl
+++ b/sd/qa/unoapi/knownissues.xcl
@@ -16,6 +16,11 @@
 #   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 #
 
+### tdf#115345 - not useful to set Orientation ###
+sd.SdDrawPage::com::sun::star::drawing::GenericDrawPage
+sd.SdGenericDrawPage::com::sun::star::drawing::GenericDrawPage
+sd.SdMasterPage::com::sun::star::drawing::GenericDrawPage
+
 ### i84994 ###
 sd.SdXImpressDocument::com::sun::star::view::XPrintable
 # -> disabled in sd.sce
diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx
index 6e4c3dffbfee..867c4df6c3c0 100644
--- a/sd/source/core/sdpage.cxx
+++ b/sd/source/core/sdpage.cxx
@@ -129,16 +129,6 @@ SdPage::SdPage(SdDrawDocument& rNewDoc, bool bMasterPage)
 // presentation template of the outline objects. Therefore, it already
 // contains the designator for the outline (STR_LAYOUT_OUTLINE).
 maLayoutName = SdResId(STR_LAYOUT_DEFAULT_NAME)+ SD_LT_SEPARATOR 
STR_LAYOUT_OUTLINE;
-Size aPageSize(GetSize());
-
-if (aPageSize.Width() > aPageSize.Height())
-{
-meOrientation = Orientation::Landscape;
-}
-else
-{
-meOrientation = Orientation::Portrait;
-}
 }
 
 namespace
@@ -1757,20 +1747,6 @@ void SdPage::SetSize(const Size& aSize)
 if (aSize != aOldSize)
 {
 FmFormPage::SetSize(aSize);
-
-if (aOldSize.Height() == 10 && aOldSize.Width() == 10)
-{
-// this page gets a valid size for the first time. Therefore
-// we initialize the orientation.
-if (aSize.Width() > aSize.Height())
-{
-meOrientation = Orientation::Landscape;
-}
-else
-{
-meOrientation = Orientation::Portrait;
-}
-}
 }
 }
 
@@ -2614,14 +2590,22 @@ const OUString& SdPage::GetName() const
 return maCreatedPageName;
 }
 
-void SdPage::SetOrientation( Orientation eOrient)
+void SdPage::SetOrientation( Orientation /*eOrient*/)
 {
-meOrientation = eOrient;
+// Do nothing
 }
 
 Orientation SdPage::GetOrientation() const
 {
-return meOrientation;
+Size aSize = GetSize();
+if ( aSize.getWidth() > aSize.getHeight() )
+{
+return Orientation::Landscape;
+}
+else
+{
+return Orientation::Portrait;
+}
 }
 
 /*
diff --git a/sd/source/core/sdpage2.cxx b/sd/source/core/sdpage2.cxx
index 21903145ea61..deab43fa74fa 100644
--- a/sd/source/core/sdpage2.cxx
+++ b/sd/source/core/sdpage2.cxx
@@ -397,7 +397,6 @@ SdPage::SdPage(const SdPage& rSrcPage)
 mbBackgroundFullSize = rSrcPage.mbBackgroundFullSize;
 meCharSet= rSrcPage.meCharSet;
 mnPaperBin   = rSrcPage.mnPaperBin;
-meOrientation= rSrcPage.meOrientation;
 
 mpPageLink   = nullptr;// is set when inserting via 
ConnectLink()
 
@@ -573,9 +572,9 @@ bool SdPage::Equals(const SdPage& rOtherPage) const
 mbLoopSound == rOtherPage.mbLoopSound && mbStopSound == 
rOtherPage.mbStopSound &&
 maBookmarkName == rOtherPage.maBookmarkName && mbScaleObjects == 
rOtherPage.mbScaleObjects &&
 mbBackgroundFullSize == rOtherPage.mbBackgroundFullSize && 
meCharSet == rOtherPage.meCharSet &&
-mnPaperBin == 

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

2017-06-27 Thread Henry Castro
 sd/inc/undo/undomanager.hxx  |5 --
 sd/qa/unit/tiledrendering/tiledrendering.cxx |   38 
 sd/source/core/undo/undomanager.cxx  |   49 ---
 sd/source/ui/view/viewshe3.cxx   |   10 -
 sd/source/ui/view/viewshel.cxx   |   35 +++
 5 files changed, 57 insertions(+), 80 deletions(-)

New commits:
commit 9f3814af7264ce90685a82cbf4eb015a38f22bf7
Author: Henry Castro 
Date:   Tue Jun 27 14:35:58 2017 -0400

sd lok: fix Undo/Redo Document Repair

REPAIRPACKAGE is sent to enable Undo/Redo actions when two views
have conflicts.

Change-Id: I58133f5b9006c41a297711c52ed0acfce3c19f92
Reviewed-on: https://gerrit.libreoffice.org/39325
Tested-by: Jenkins 
Reviewed-by: Henry Castro 

diff --git a/sd/inc/undo/undomanager.hxx b/sd/inc/undo/undomanager.hxx
index c053e9b8cabb..b22ea929ad82 100644
--- a/sd/inc/undo/undomanager.hxx
+++ b/sd/inc/undo/undomanager.hxx
@@ -37,9 +37,6 @@ public:
 virtual voidEnterListAction(const OUString , const 
OUString& rRepeatComment, sal_uInt16 nId, ViewShellId nViewShellId) override;
 
 virtual voidAddUndoAction( SfxUndoAction *pAction, bool 
bTryMerg=false ) override;
-size_t GetUndoActionCount(const bool bCurrentLevel = true) const override;
-size_t GetRedoActionCount(const bool bCurrentLevel = true) const override;
-void SetViewShell(SfxViewShell* pViewShell);
 
 /** Set or reset the undo manager linked with the called undo manager.
 */
@@ -53,8 +50,6 @@ private:
 synchronize the undo managers.
 */
 ::svl::IUndoManager* mpLinkedUndoManager;
-/// Return undo/redo info for this view.
-SfxViewShell* mpViewShell;
 
 /** Call ClearRedo() at the linked undo manager, when present.
 
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 499b7f0a5641..628c72afef30 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -1174,31 +1174,37 @@ void SdTiledRenderingTest::testUndoLimiting()
 
 // Create the first view.
 SdXImpressDocument* pXImpressDocument = createDoc("title-shape.odp");
-SfxViewShell& rViewShell1 = 
pXImpressDocument->GetDocShell()->GetViewShell()->GetViewShellBase();
+sd::ViewShell* pViewShell1 = 
pXImpressDocument->GetDocShell()->GetViewShell();
+int nView1 = SfxLokHelper::getView();
 SfxLokHelper::createView();
-
pXImpressDocument->initializeForTiledRendering(uno::Sequence());
-SfxViewShell& rViewShell2 = 
pXImpressDocument->GetDocShell()->GetViewShell()->GetViewShellBase();
+sd::ViewShell* pViewShell2 = 
pXImpressDocument->GetDocShell()->GetViewShell();
+CPPUNIT_ASSERT(pViewShell1 != pViewShell2);
 
 // Begin text edit on the only object on the slide.
-sd::ViewShell* pViewShell = 
pXImpressDocument->GetDocShell()->GetViewShell();
-SdrView* pView = pViewShell->GetView();
+SfxLokHelper::setView(nView1);
 pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::TAB);
 pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::TAB);
 pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 'x', 0);
 pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 'x', 0);
 Scheduler::ProcessEventsToIdle();
-CPPUNIT_ASSERT(pView->IsTextEdit());
+CPPUNIT_ASSERT(pViewShell1->GetView()->IsTextEdit());
 
-// Now check what views see the undo action.
-SdDrawDocument* pDocument = pXImpressDocument->GetDoc();
-sd::UndoManager* pUndoManager = pDocument->GetUndoManager();
-pUndoManager->SetViewShell();
-// This was 1, undo action was visible to the first view, even if the
-// action belongs to the second view.
-CPPUNIT_ASSERT_EQUAL(static_cast(0), 
pUndoManager->GetUndoActionCount());
-pUndoManager->SetViewShell();
-CPPUNIT_ASSERT_EQUAL(static_cast(1), 
pUndoManager->GetUndoActionCount());
-pUndoManager->SetViewShell(nullptr);
+// Now check view2 cannot undo actions.
+{
+SfxRequest aReq2(SID_UNDO, SfxCallMode::SLOT, 
pXImpressDocument->GetDocShell()->GetDoc()->GetPool());
+aReq2.AppendItem(SfxUInt16Item(SID_UNDO, 1));
+pViewShell2->ExecuteSlot(aReq2);
+CPPUNIT_ASSERT(dynamic_cast< const SfxUInt32Item* 
>(aReq2.GetReturnValue()));
+CPPUNIT_ASSERT_EQUAL(static_cast< sal_uInt32 >(SID_REPAIRPACKAGE), 
dynamic_cast< const SfxUInt32Item * >(aReq2.GetReturnValue())->GetValue());
+}
+
+// Now check view1 can undo action
+{
+SfxRequest aReq1(SID_UNDO, SfxCallMode::SLOT, 
pXImpressDocument->GetDocShell()->GetDoc()->GetPool());
+aReq1.AppendItem(SfxUInt16Item(SID_UNDO, 1));
+pViewShell1->ExecuteSlot(aReq1);
+CPPUNIT_ASSERT(aReq1.IsDone());
+}
 
 mxComponent->dispose();
 

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

2017-02-21 Thread Pranav Kant
 sd/inc/Annotation.hxx  |2 ++
 sd/qa/unit/tiledrendering/tiledrendering.cxx   |4 
 sd/source/core/annotations/Annotation.cxx  |8 
 sd/source/ui/annotations/annotationmanager.cxx |4 +++-
 sd/source/ui/unoidl/unomodel.cxx   |1 +
 5 files changed, 18 insertions(+), 1 deletion(-)

New commits:
commit ede35e5c693a287f31e3c02d8afd33580e827380
Author: Pranav Kant 
Date:   Tue Feb 21 15:20:45 2017 +0530

sd lok: Include parthash in annotation list and callbacks

... and update the tests accordingly.

Change-Id: Id11f2d19274e743b0e2a0bbeb0c21936f12b

diff --git a/sd/inc/Annotation.hxx b/sd/inc/Annotation.hxx
index 39e746c..27f1d51 100644
--- a/sd/inc/Annotation.hxx
+++ b/sd/inc/Annotation.hxx
@@ -37,6 +37,8 @@ SdrUndoAction* CreateUndoInsertOrRemoveAnnotation( const 
css::uno::Reference< cs
 
 sal_uInt32 getAnnotationId(const css::uno::Reference 
& xAnnotation);
 
+const SdPage* getAnnotationPage(const 
css::uno::Reference& xAnnotation);
+
 }
 
 #endif
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index c70bdd5..d142921 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -1618,6 +1618,8 @@ void SdTiledRenderingTest::testCommentCallbacks()
 CPPUNIT_ASSERT_EQUAL(std::string("LOK User1"), 
aView2.m_aCommentCallbackResult.get("author"));
 CPPUNIT_ASSERT_EQUAL(std::string("Comment"), 
aView1.m_aCommentCallbackResult.get("text"));
 CPPUNIT_ASSERT_EQUAL(std::string("Comment"), 
aView2.m_aCommentCallbackResult.get("text"));
+
CPPUNIT_ASSERT(!aView1.m_aCommentCallbackResult.get("parthash").empty());
+
CPPUNIT_ASSERT(!aView2.m_aCommentCallbackResult.get("parthash").empty());
 
 // Reply to a just added comment
 SfxLokHelper::setView(nView2);
@@ -1642,6 +1644,8 @@ void SdTiledRenderingTest::testCommentCallbacks()
 CPPUNIT_ASSERT(aReplyTextView1.endsWith("Reply to comment"));
 CPPUNIT_ASSERT(aReplyTextView2.startsWith("Reply to LOK User1"));
 CPPUNIT_ASSERT(aReplyTextView2.endsWith("Reply to comment"));
+
CPPUNIT_ASSERT(!aView1.m_aCommentCallbackResult.get("parthash").empty());
+
CPPUNIT_ASSERT(!aView2.m_aCommentCallbackResult.get("parthash").empty());
 
 // Delete the comment
 aArgs = comphelper::InitPropertySequence(
diff --git a/sd/source/core/annotations/Annotation.cxx 
b/sd/source/core/annotations/Annotation.cxx
index fcc0a60..6d2cdeb 100644
--- a/sd/source/core/annotations/Annotation.cxx
+++ b/sd/source/core/annotations/Annotation.cxx
@@ -379,6 +379,14 @@ sal_uInt32 getAnnotationId(const Reference& 
xAnnotation)
 return nId;
 }
 
+const SdPage* getAnnotationPage(const Reference& xAnnotation)
+{
+Annotation* pAnnotation = dynamic_cast(xAnnotation.get());
+if (pAnnotation)
+return pAnnotation->GetPage();
+return nullptr;
+}
+
 UndoInsertOrRemoveAnnotation::UndoInsertOrRemoveAnnotation( Annotation& 
rAnnotation, bool bInsert )
 : SdrUndoAction( *rAnnotation.GetModel() )
 , mxAnnotation(  )
diff --git a/sd/source/ui/annotations/annotationmanager.cxx 
b/sd/source/ui/annotations/annotationmanager.cxx
index 8d8c883..e4d593f 100644
--- a/sd/source/ui/annotations/annotationmanager.cxx
+++ b/sd/source/ui/annotations/annotationmanager.cxx
@@ -122,13 +122,15 @@ namespace {
(nType == CommentNotificationType::Remove ? 
"Remove" :
 (nType == CommentNotificationType::Modify 
? "Modify" : "???";
 aAnnotation.put("id", sd::getAnnotationId(rxAnnotation));
-if (nType != CommentNotificationType::Remove)
+if (nType != CommentNotificationType::Remove && rxAnnotation.is())
 {
 aAnnotation.put("id", sd::getAnnotationId(rxAnnotation));
 aAnnotation.put("author", rxAnnotation->getAuthor());
 aAnnotation.put("dateTime", 
utl::toISO8601(rxAnnotation->getDateTime()));
 uno::Reference xText(rxAnnotation->getTextRange());
 aAnnotation.put("text", xText->getString());
+const SdPage* pPage = sd::getAnnotationPage(rxAnnotation);
+aAnnotation.put("parthash", pPage ? 
OString::number(pPage->GetHashCode()) : OString());
 }
 
 boost::property_tree::ptree aTree;
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index 27ed31db..ec701f0 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -2387,6 +2387,7 @@ OUString SdXImpressDocument::getPostIts()
 aAnnotation.put("dateTime", 
utl::toISO8601(xAnnotation->getDateTime()));
 uno::Reference xText(xAnnotation->getTextRange());
 aAnnotation.put("text", xText->getString());
+aAnnotation.put("parthash", 
OUString::number(pPage->GetHashCode()));
 
 

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

2016-11-17 Thread Noel Grandin
 sd/inc/glob.hrc|3 +++
 sd/qa/unit/misc-tests.cxx  |   22 ++
 sd/source/core/glob.src|9 +
 sd/source/ui/func/futext.cxx   |2 ++
 sd/source/ui/inc/DrawViewShell.hxx |2 +-
 5 files changed, 33 insertions(+), 5 deletions(-)

New commits:
commit 90646b4966c73637ddf592acd05b3091fb3fa41f
Author: Noel Grandin 
Date:   Wed Nov 16 13:34:07 2016 +0200

tdf#103950 Undo does not revert bundled font size changes for table cells

Change-Id: Id41b739bfa93610f955e6c31f8bb979b8e2c
Reviewed-on: https://gerrit.libreoffice.org/30902
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/sd/inc/glob.hrc b/sd/inc/glob.hrc
index b950a51..9f221b9 100644
--- a/sd/inc/glob.hrc
+++ b/sd/inc/glob.hrc
@@ -139,6 +139,9 @@
 #define STR_MASTERSLIDE_NAMERID_GLOB_START+230
 #define STR_MASTERPAGE_NAME RID_GLOB_START+231
 
+#define STR_SHRINK_FONT_SIZERID_GLOB_START+232
+#define STR_GROW_FONT_SIZE  RID_GLOB_START+233
+
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/qa/unit/misc-tests.cxx b/sd/qa/unit/misc-tests.cxx
index b926c0d..d7027f9 100644
--- a/sd/qa/unit/misc-tests.cxx
+++ b/sd/qa/unit/misc-tests.cxx
@@ -16,6 +16,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 
@@ -37,6 +38,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 using namespace ::com::sun::star;
@@ -176,17 +178,16 @@ void SdMiscTest::testTdf99396TextEdit()
 sd::DrawDocShellRef xDocSh = 
Load(m_directories.getURLFromSrc("/sd/qa/unit/data/tdf99396.odp"), ODP);
 sd::ViewShell* pViewShell = xDocSh->GetViewShell();
 SdPage* pPage = pViewShell->GetActualPage();
-SdrObject* pObject = pPage->GetObj(0);
-auto pTableObject = dynamic_cast(pObject);
+auto pTableObject = 
dynamic_cast(pPage->GetObj(0));
 CPPUNIT_ASSERT(pTableObject);
 SdrView* pView = pViewShell->GetView();
-pView->MarkObj(pObject, pView->GetSdrPageView());
+pView->MarkObj(pTableObject, pView->GetSdrPageView());
 
 // Make sure that the undo stack is empty.
 CPPUNIT_ASSERT_EQUAL(static_cast(0), 
xDocSh->GetDoc()->GetUndoManager()->GetUndoActionCount());
 
 // Set horizontal and vertical adjustment during text edit.
-pView->SdrBeginTextEdit(pObject);
+pView->SdrBeginTextEdit(pTableObject);
 CPPUNIT_ASSERT(pView->GetTextEditObject());
 {
 SfxRequest aRequest(pViewShell->GetViewFrame(), 
SID_ATTR_PARA_ADJUST_RIGHT);
@@ -238,6 +239,19 @@ void SdMiscTest::testTdf99396TextEdit()
 CPPUNIT_ASSERT_EQUAL(SVX_ADJUST_CENTER, pAdjust->GetAdjust());
 }
 
+
+/*
+ * now test tdf#103950 - Undo does not revert bundled font size changes 
for table cells
+ */
+pTableObject = dynamic_cast(pPage->GetObj(0));
+pView->MarkObj(pTableObject, pView->GetSdrPageView()); // select table
+{
+SfxRequest aRequest(pViewShell->GetViewFrame(), SID_GROW_FONT_SIZE);
+static_cast(pViewShell)->ExecChar(aRequest);
+}
+CPPUNIT_ASSERT_EQUAL(static_cast(2), 
xDocSh->GetDoc()->GetUndoManager()->GetUndoActionCount());
+
+
 xDocSh->DoClose();
 }
 
diff --git a/sd/source/core/glob.src b/sd/source/core/glob.src
index 8e7fe18..8cb0270 100644
--- a/sd/source/core/glob.src
+++ b/sd/source/core/glob.src
@@ -399,4 +399,13 @@ String STR_DEAUTHORISE_CLIENT
 Text [ en-US ] = "Remove client authorisation";
 };
 
+String STR_SHRINK_FONT_SIZE
+{
+Text [ en-US ] = "Shrink font size";
+};
+String STR_GROW_FONT_SIZE
+{
+Text [ en-US ] = "Grow font size";
+};
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx
index 07bcdc8..f020d4e 100644
--- a/sd/source/ui/func/futext.cxx
+++ b/sd/source/ui/func/futext.cxx
@@ -1370,6 +1370,7 @@ void FuText::ChangeFontSize( bool bGrow, OutlinerView* 
pOLV, const FontList* pFo
 else
 {
 
+pView->BegUndo(SD_RESSTR(bGrow ? STR_GROW_FONT_SIZE : 
STR_SHRINK_FONT_SIZE));
 const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
 for( size_t nMark = 0; nMark < rMarkList.GetMarkCount(); ++nMark )
 {
@@ -1411,6 +1412,7 @@ void FuText::ChangeFontSize( bool bGrow, OutlinerView* 
pOLV, const FontList* pFo
 }
 }
 }
+pView->EndUndo();
 }
 }
 
diff --git a/sd/source/ui/inc/DrawViewShell.hxx 
b/sd/source/ui/inc/DrawViewShell.hxx
index a0de364..a752df7 100644
--- a/sd/source/ui/inc/DrawViewShell.hxx
+++ b/sd/source/ui/inc/DrawViewShell.hxx
@@ -219,7 +219,7 @@ public:
 voidExecGoToLastPage (SfxRequest& rReq);
 voidGetStateGoToLastPage (SfxItemSet& rSet);
 
-void

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

2016-11-15 Thread Stephan Bergmann
 sd/inc/sdattr.hxx|   56 +--
 sd/qa/unit/dialogs-test.cxx  |   14 
 sd/source/ui/dlg/layeroptionsdlg.cxx |   24 +++
 sd/source/ui/view/drviews2.cxx   |   52 
 4 files changed, 66 insertions(+), 80 deletions(-)

New commits:
commit 40c44ed643acde1d3b9ab0177a09bdb8b3083dea
Author: Stephan Bergmann 
Date:   Tue Nov 15 16:47:02 2016 +0100

Replace some trivial Sfx*Item derivations with make* functions

...as the trivial derivations (used to offer "convenience ctors") didn't
override Clone(), so -fsanitize=vptr would cause warnings like

> sd/source/ui/dlg/layeroptionsdlg.cxx:42:26: runtime error: downcast of 
address 0x603001dff830 which does not point to an object of type 'const 
SdAttrLayerName'
> 0x603001dff830: note: object is of type 'SfxStringItem'
>  61 05 80 1e  70 d6 f7 22 67 7f 00 00  01 00 00 00 4e 6e 00 be  60 f8 df 
01 30 60 00 00  02 00 00 00
>   ^~~
>   vptr for 'SfxStringItem'
> #0 0x7f66931db4b0 in SdInsertLayerDlg::SdInsertLayerDlg(vcl::Window*, 
SfxItemSet const&, bool, rtl::OUString const&) 
sd/source/ui/dlg/layeroptionsdlg.cxx:42:26

when doing "Insert - Layer..." in Draw.

Change-Id: I54ade09027daecc8bbf6f4789a8b5318bbe8d22d

diff --git a/sd/inc/sdattr.hxx b/sd/inc/sdattr.hxx
index 710a072..b91d857 100644
--- a/sd/inc/sdattr.hxx
+++ b/sd/inc/sdattr.hxx
@@ -32,54 +32,40 @@
 #include "diadef.h"
 
 // layer attributes
-class SdAttrLayerName : public SfxStringItem
+inline SfxStringItem makeSdAttrLayerName( const OUString& aStr )
 {
-public:
-SdAttrLayerName( const OUString& aStr ) :
-SfxStringItem( ATTR_LAYER_NAME, aStr ) {}
-};
+return SfxStringItem( ATTR_LAYER_NAME, aStr );
+}
 
-class SdAttrLayerTitle : public SfxStringItem
+inline SfxStringItem makeSdAttrLayerTitle( const OUString& aStr = OUString() )
 {
-public:
-SdAttrLayerTitle() : SfxStringItem( ATTR_LAYER_TITLE, OUString()) {}
-SdAttrLayerTitle( const OUString& aStr ) : SfxStringItem( 
ATTR_LAYER_TITLE, aStr ) {}
-};
+return SfxStringItem( ATTR_LAYER_TITLE, aStr );
+}
 
-class SdAttrLayerDesc : public SfxStringItem
+inline SfxStringItem makeSdAttrLayerDesc( const OUString& aStr = OUString() )
 {
-public:
-SdAttrLayerDesc() : SfxStringItem( ATTR_LAYER_DESC, OUString()) {}
-SdAttrLayerDesc( const OUString& aStr ) : SfxStringItem( ATTR_LAYER_DESC, 
aStr ) {}
-};
+return SfxStringItem( ATTR_LAYER_DESC, aStr );
+}
 
-class SdAttrLayerVisible : public SfxBoolItem
+inline SfxBoolItem makeSdAttrLayerVisible( bool bValue = true )
 {
-public:
-SdAttrLayerVisible( bool bValue = true ) :
-SfxBoolItem( ATTR_LAYER_VISIBLE, bValue ) {}
-};
+return SfxBoolItem( ATTR_LAYER_VISIBLE, bValue );
+}
 
-class SdAttrLayerPrintable : public SfxBoolItem
+inline SfxBoolItem makeSdAttrLayerPrintable( bool bValue = true )
 {
-public:
-SdAttrLayerPrintable( bool bValue = true ) :
-SfxBoolItem( ATTR_LAYER_PRINTABLE, bValue ) {}
-};
+return SfxBoolItem( ATTR_LAYER_PRINTABLE, bValue );
+}
 
-class SdAttrLayerLocked : public SfxBoolItem
+inline SfxBoolItem makeSdAttrLayerLocked( bool bValue = false )
 {
-public:
-SdAttrLayerLocked( bool bValue = false ) :
-SfxBoolItem( ATTR_LAYER_LOCKED, bValue ) {}
-};
+return SfxBoolItem( ATTR_LAYER_LOCKED, bValue );
+}
 
-class SdAttrLayerThisPage : public SfxBoolItem
+inline SfxBoolItem makeSdAttrLayerThisPage()
 {
-public:
-SdAttrLayerThisPage( bool bValue = false ) :
-SfxBoolItem( ATTR_LAYER_THISPAGE, bValue ) {}
-};
+return SfxBoolItem( ATTR_LAYER_THISPAGE, false );
+}
 
 class DiaEffectItem : public SfxEnumItem
 {
diff --git a/sd/qa/unit/dialogs-test.cxx b/sd/qa/unit/dialogs-test.cxx
index d5e6cad..37104a4 100644
--- a/sd/qa/unit/dialogs-test.cxx
+++ b/sd/qa/unit/dialogs-test.cxx
@@ -363,13 +363,13 @@ VclPtr 
SdDialogsTest::createDialogByID(sal_uInt32 nID)
 CPPUNIT_ASSERT(pDrawDoc);
 SfxItemSet aNewAttr(pDrawDoc->GetItemPool(), ATTR_LAYER_START, 
ATTR_LAYER_END);
 const OUString aLayerName = SD_RESSTR(STR_LAYER); // + 
OUString::number(2);
-aNewAttr.Put(SdAttrLayerName(aLayerName));
-aNewAttr.Put(SdAttrLayerTitle());
-aNewAttr.Put(SdAttrLayerDesc());
-aNewAttr.Put(SdAttrLayerVisible());
-aNewAttr.Put(SdAttrLayerPrintable());
-aNewAttr.Put(SdAttrLayerLocked());
-aNewAttr.Put(SdAttrLayerThisPage());
+aNewAttr.Put(makeSdAttrLayerName(aLayerName));
+aNewAttr.Put(makeSdAttrLayerTitle());
+aNewAttr.Put(makeSdAttrLayerDesc());
+aNewAttr.Put(makeSdAttrLayerVisible());
+aNewAttr.Put(makeSdAttrLayerPrintable());
+aNewAttr.Put(makeSdAttrLayerLocked());
+aNewAttr.Put(makeSdAttrLayerThisPage());

[Libreoffice-commits] core.git: sd/inc sd/qa sd/source sfx2/source slideshow/source

2016-10-24 Thread Noel Grandin
 sd/inc/sdpage.hxx |2 +-
 sd/qa/unit/filters-test.cxx   |2 +-
 sd/qa/unit/sdmodeltestbase.hxx|2 +-
 sd/source/filter/ppt/pptin.cxx|2 +-
 sd/source/ui/animations/CustomAnimationDialog.hxx |2 +-
 sd/source/ui/inc/DrawDocShell.hxx |   10 +-
 sd/source/ui/inc/DrawViewShell.hxx|4 ++--
 sd/source/ui/inc/GraphicDocShell.hxx  |6 +++---
 sd/source/ui/inc/GraphicViewShell.hxx |2 +-
 sd/source/ui/inc/OutlineViewShell.hxx |2 +-
 sd/source/ui/inc/PresentationViewShell.hxx|2 +-
 sd/source/ui/inc/dlgpage.hxx  |2 +-
 sd/source/ui/inc/optsitem.hxx |8 
 sd/source/ui/inc/unomodel.hxx |4 ++--
 sd/source/ui/view/sdview3.cxx |2 +-
 sfx2/source/appl/newhelp.hxx  |2 +-
 sfx2/source/inc/templdgi.hxx  |2 +-
 slideshow/source/engine/transitions/spiralwipe.hxx|2 +-
 slideshow/source/engine/transitions/waterfallwipe.hxx |2 +-
 19 files changed, 30 insertions(+), 30 deletions(-)

New commits:
commit 1aa69bd5d4bdc8513892fb88760312fee52c310b
Author: Noel Grandin 
Date:   Mon Oct 24 10:43:29 2016 +0200

loplugin:countusersofdefaultparams in sd..slideshow

Change-Id: Iaf10935d8f231676333018a5954d97defe35acf6

diff --git a/sd/inc/sdpage.hxx b/sd/inc/sdpage.hxx
index 65d6cbd..dc23fed 100644
--- a/sd/inc/sdpage.hxx
+++ b/sd/inc/sdpage.hxx
@@ -151,7 +151,7 @@ protected:
 
 public:
 
-SdPage(SdDrawDocument& rNewDoc, bool bMasterPage=false);
+SdPage(SdDrawDocument& rNewDoc, bool bMasterPage);
 virtual ~SdPage() override;
 virtual SdrPage* Clone() const override;
 virtual SdrPage* Clone(SdrModel* pNewModel) const override;
diff --git a/sd/qa/unit/filters-test.cxx b/sd/qa/unit/filters-test.cxx
index 961fae0..08babce 100644
--- a/sd/qa/unit/filters-test.cxx
+++ b/sd/qa/unit/filters-test.cxx
@@ -69,7 +69,7 @@ bool SdFiltersTest::load(const OUString , const 
OUString ,
 rUserData, OUString() ));
 const_cast(pFilter.get())->SetVersion(nFilterVersion);
 
-::sd::DrawDocShellRef xDocShRef = new ::sd::DrawDocShell();
+::sd::DrawDocShellRef xDocShRef = new 
::sd::DrawDocShell(SfxObjectCreateMode::EMBEDDED, false);
 SfxMedium* pSrcMed = new SfxMedium(rURL, StreamMode::STD_READ);
 pSrcMed->SetFilter(pFilter);
 bool bLoaded = xDocShRef->DoLoad(pSrcMed);
diff --git a/sd/qa/unit/sdmodeltestbase.hxx b/sd/qa/unit/sdmodeltestbase.hxx
index 5b933c1..c0ed88e 100644
--- a/sd/qa/unit/sdmodeltestbase.hxx
+++ b/sd/qa/unit/sdmodeltestbase.hxx
@@ -134,7 +134,7 @@ protected:
 pFilter->SetVersion(SOFFICE_FILEFORMAT_CURRENT);
 std::shared_ptr pFilt(pFilter);
 
-::sd::DrawDocShellRef xDocShRef = new ::sd::DrawDocShell();
+::sd::DrawDocShellRef xDocShRef = new 
::sd::DrawDocShell(SfxObjectCreateMode::EMBEDDED, false);
 SfxMedium* pSrcMed = new SfxMedium(rURL, StreamMode::STD_READ, pFilt, 
pParams);
 if ( !xDocShRef->DoLoad(pSrcMed) || !xDocShRef.Is() )
 {
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index d6a7d6d..3b22b8c 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -2772,7 +2772,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL 
TestImportPPT(const OUString 
 xDocStream->SetVersion(xStorage->GetVersion());
 xDocStream->SetCryptMaskKey(xStorage->GetKey());
 
-::sd::DrawDocShellRef xDocShRef = new ::sd::DrawDocShell();
+::sd::DrawDocShellRef xDocShRef = new 
::sd::DrawDocShell(SfxObjectCreateMode::EMBEDDED, false);
 SdDrawDocument *pDoc = xDocShRef->GetDoc();
 
 bool bRet = ImportPPT(pDoc, *xDocStream, *xStorage, aSrcMed);
diff --git a/sd/source/ui/animations/CustomAnimationDialog.hxx 
b/sd/source/ui/animations/CustomAnimationDialog.hxx
index 6ccbddd..5244965 100644
--- a/sd/source/ui/animations/CustomAnimationDialog.hxx
+++ b/sd/source/ui/animations/CustomAnimationDialog.hxx
@@ -142,7 +142,7 @@ class STLPropertySet;
 class CustomAnimationDialog : public TabDialog
 {
 public:
-CustomAnimationDialog(vcl::Window* pParent, STLPropertySet* pSet, const 
OString& Page = OString());
+CustomAnimationDialog(vcl::Window* pParent, STLPropertySet* pSet, const 
OString& Page);
 virtual ~CustomAnimationDialog() override;
 virtual void dispose() override;
 
diff --git a/sd/source/ui/inc/DrawDocShell.hxx 
b/sd/source/ui/inc/DrawDocShell.hxx
index 89d9991..8d1ad05 100644
--- a/sd/source/ui/inc/DrawDocShell.hxx
+++ b/sd/source/ui/inc/DrawDocShell.hxx
@@ -58,19 +58,19 @@ private:
 
 public:
 DrawDocShell (
-SfxObjectCreateMode eMode = SfxObjectCreateMode::EMBEDDED,
-

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

2016-08-16 Thread Miklos Vajna
 sd/inc/undo/undomanager.hxx  |   10 -
 sd/qa/unit/tiledrendering/tiledrendering.cxx |   39 +
 sd/source/core/undo/undomanager.cxx  |   50 +++
 sd/source/ui/view/viewshe3.cxx   |   11 +
 4 files changed, 109 insertions(+), 1 deletion(-)

New commits:
commit e0a3269183bf145511361a3968dca07824923dd4
Author: Miklos Vajna 
Date:   Wed Aug 17 07:53:16 2016 +0200

sd lok: limit undo/redo access to undo actions created by the same view

Unlike in Writer, the state and the exec method of .uno:Undo is
different codepath so for now ignore the Repair argument of the command,
assuming that the command is only dispatched if the command is enabled.

Change-Id: I3bfe8d72522f32efe436e21c383c99b3612eab6b

diff --git a/sd/inc/undo/undomanager.hxx b/sd/inc/undo/undomanager.hxx
index a020038..5c3a082 100644
--- a/sd/inc/undo/undomanager.hxx
+++ b/sd/inc/undo/undomanager.hxx
@@ -22,11 +22,14 @@
 
 #include 
 #include 
+#include "sddllapi.h"
+
+class SfxViewShell;
 
 namespace sd
 {
 
-class UndoManager : public SdrUndoManager
+class SD_DLLPUBLIC UndoManager : public SdrUndoManager
 {
 public:
 UndoManager( sal_uInt16 nMaxUndoActionCount = 20 );
@@ -34,6 +37,9 @@ public:
 virtual voidEnterListAction(const OUString , const 
OUString& rRepeatComment, sal_uInt16 nId, sal_Int32 nViewShellId) override;
 
 virtual voidAddUndoAction( SfxUndoAction *pAction, bool 
bTryMerg=false ) override;
+size_t GetUndoActionCount(const bool bCurrentLevel = true) const override;
+size_t GetRedoActionCount(const bool bCurrentLevel = true) const override;
+void SetViewShell(SfxViewShell* pViewShell);
 
 /** Set or reset the undo manager linked with the called undo manager.
 */
@@ -47,6 +53,8 @@ private:
 synchronize the undo managers.
 */
 ::svl::IUndoManager* mpLinkedUndoManager;
+/// Return undo/redo info for this view.
+SfxViewShell* mpViewShell;
 
 /** Call ClearRedo() at the linked undo manager, when present.
 
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 391366a..b5de222 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -69,6 +69,7 @@ public:
 void testViewCursorParts();
 void testCursorViews();
 void testViewLock();
+void testUndoLimiting();
 
 CPPUNIT_TEST_SUITE(SdTiledRenderingTest);
 CPPUNIT_TEST(testRegisterCallback);
@@ -93,6 +94,7 @@ public:
 CPPUNIT_TEST(testViewCursorParts);
 CPPUNIT_TEST(testCursorViews);
 CPPUNIT_TEST(testViewLock);
+CPPUNIT_TEST(testUndoLimiting);
 CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -1071,6 +1073,43 @@ void SdTiledRenderingTest::testViewLock()
 comphelper::LibreOfficeKit::setActive(false);
 }
 
+void SdTiledRenderingTest::testUndoLimiting()
+{
+comphelper::LibreOfficeKit::setActive();
+
+// Create the first view.
+SdXImpressDocument* pXImpressDocument = createDoc("title-shape.odp");
+SfxViewShell& rViewShell1 = 
pXImpressDocument->GetDocShell()->GetViewShell()->GetViewShellBase();
+SfxLokHelper::createView();
+
pXImpressDocument->initializeForTiledRendering(uno::Sequence());
+SfxViewShell& rViewShell2 = 
pXImpressDocument->GetDocShell()->GetViewShell()->GetViewShellBase();
+
+// Begin text edit on the only object on the slide.
+sd::ViewShell* pViewShell = 
pXImpressDocument->GetDocShell()->GetViewShell();
+SdrView* pView = pViewShell->GetView();
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::TAB);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, awt::Key::TAB);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 'x', 0);
+pXImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 'x', 0);
+Scheduler::ProcessEventsToIdle();
+CPPUNIT_ASSERT(pView->IsTextEdit());
+
+// Now check what views see the undo action.
+SdDrawDocument* pDocument = pXImpressDocument->GetDoc();
+sd::UndoManager* pUndoManager = pDocument->GetUndoManager();
+pUndoManager->SetViewShell();
+// This was 1, undo action was visible to the first view, even if the
+// action belongs to the second view.
+CPPUNIT_ASSERT_EQUAL(static_cast(0), 
pUndoManager->GetUndoActionCount());
+pUndoManager->SetViewShell();
+CPPUNIT_ASSERT_EQUAL(static_cast(1), 
pUndoManager->GetUndoActionCount());
+pUndoManager->SetViewShell(nullptr);
+
+mxComponent->dispose();
+mxComponent.clear();
+comphelper::LibreOfficeKit::setActive(false);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdTiledRenderingTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sd/source/core/undo/undomanager.cxx 
b/sd/source/core/undo/undomanager.cxx
index bbf2069..b0b9b68 100644
--- a/sd/source/core/undo/undomanager.cxx
+++ b/sd/source/core/undo/undomanager.cxx
@@ -17,6 +17,8 

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

2016-08-03 Thread Miklos Vajna
 sd/inc/sdundo.hxx|6 --
 sd/qa/unit/tiledrendering/tiledrendering.cxx |   23 +++
 sd/source/core/undo/undoobjects.cxx  |   18 ++
 3 files changed, 45 insertions(+), 2 deletions(-)

New commits:
commit f6283cf6b4342a0492f1127c2d7a8597255a75c3
Author: Miklos Vajna 
Date:   Wed Aug 3 17:01:02 2016 +0200

sd: track view shell id in SdUndoAction

This helps in case of e.g. setting the page size of an Impress slide
from the sidebar.

Change-Id: I6247d6efcc59f2c6311dcd33d0f989a39fd7b3f9
Reviewed-on: https://gerrit.libreoffice.org/27827
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/sd/inc/sdundo.hxx b/sd/inc/sdundo.hxx
index 84b81a3..661f354 100644
--- a/sd/inc/sdundo.hxx
+++ b/sd/inc/sdundo.hxx
@@ -28,17 +28,19 @@ class SdDrawDocument;
 class SD_DLLPUBLIC SdUndoAction : public SfxUndoAction
 {
 public:
-SdUndoAction(SdDrawDocument* pSdDrawDocument)
-: mpDoc(pSdDrawDocument)  {}
+SdUndoAction(SdDrawDocument* pSdDrawDocument);
 virtual ~SdUndoAction() {}
 
 voidSetComment(const OUString& rStr) { maComment = 
rStr; }
 virtual OUStringGetComment() const override { return maComment; }
 virtual SdUndoAction*   Clone() const { return nullptr; }
+/// See SfxUndoAction::GetViewShellId().
+sal_Int32 GetViewShellId() const override;
 
 protected:
 SdDrawDocument* mpDoc;
 OUString maComment;
+sal_Int32 mnViewShellId;
 };
 
 #endif // INCLUDED_SD_INC_SDUNDO_HXX
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index c8dc993..d3bcd88f 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -53,6 +53,7 @@ public:
 void testSetTextSelection();
 void testGetTextSelection();
 void testSetGraphicSelection();
+void testUndoShells();
 void testResetSelection();
 void testSearch();
 void testSearchAll();
@@ -76,6 +77,7 @@ public:
 CPPUNIT_TEST(testSetTextSelection);
 CPPUNIT_TEST(testGetTextSelection);
 CPPUNIT_TEST(testSetGraphicSelection);
+CPPUNIT_TEST(testUndoShells);
 CPPUNIT_TEST(testResetSelection);
 CPPUNIT_TEST(testSearch);
 CPPUNIT_TEST(testSearchAll);
@@ -431,6 +433,27 @@ void SdTiledRenderingTest::testSetGraphicSelection()
 CPPUNIT_ASSERT(aShapeBefore.getHeight() < aShapeAfter.getHeight());
 }
 
+void SdTiledRenderingTest::testUndoShells()
+{
+// Load a document and set the page size.
+SdXImpressDocument* pXImpressDocument = createDoc("shape.odp");
+uno::Sequence 
aPropertyValues(comphelper::InitPropertySequence(
+{
+{"AttributePageSize.Width", 
uno::makeAny(static_cast(1))},
+{"AttributePageSize.Height", 
uno::makeAny(static_cast(1))},
+}));
+comphelper::dispatchCommand(".uno:AttributePageSize", aPropertyValues);
+Scheduler::ProcessEventsToIdle();
+
+// Assert that view shell ID tracking works for SdUndoAction subclasses.
+SdDrawDocument* pDocument = pXImpressDocument->GetDoc();
+sd::UndoManager* pUndoManager = pDocument->GetUndoManager();
+CPPUNIT_ASSERT_EQUAL(static_cast(1), 
pUndoManager->GetUndoActionCount());
+sal_Int32 nView1 = SfxLokHelper::getView();
+// This was -1, SdUndoGroup did not track what view shell created it.
+CPPUNIT_ASSERT_EQUAL(nView1, 
pUndoManager->GetUndoAction()->GetViewShellId());
+}
+
 void SdTiledRenderingTest::testResetSelection()
 {
 SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp");
diff --git a/sd/source/core/undo/undoobjects.cxx 
b/sd/source/core/undo/undoobjects.cxx
index c8017f3..84eced5 100644
--- a/sd/source/core/undo/undoobjects.cxx
+++ b/sd/source/core/undo/undoobjects.cxx
@@ -22,9 +22,27 @@
 #include "CustomAnimationEffect.hxx"
 #include "drawdoc.hxx"
 #include "undoanim.hxx"
+#include "../../ui/inc/ViewShell.hxx"
+#include "../../ui/inc/ViewShellBase.hxx"
+#include "../../ui/inc/DrawDocShell.hxx"
 
 using namespace sd;
 
+SdUndoAction::SdUndoAction(SdDrawDocument* pSdDrawDocument)
+: mpDoc(pSdDrawDocument),
+  mnViewShellId(-1)
+{
+sd::DrawDocShell* pDocShell = pSdDrawDocument ? 
pSdDrawDocument->GetDocSh() : nullptr;
+sd::ViewShell* pViewShell = pDocShell ? pDocShell->GetViewShell() : 
nullptr;
+if (pViewShell)
+mnViewShellId = pViewShell->GetViewShellBase().GetViewShellId();
+}
+
+sal_Int32 SdUndoAction::GetViewShellId() const
+{
+return mnViewShellId;
+}
+
 UndoRemovePresObjectImpl::UndoRemovePresObjectImpl( SdrObject& rObject )
 : mpUndoUsercall(nullptr)
 , mpUndoAnimation(nullptr)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org