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

2023-11-29 Thread Andrea Gelmini (via logerrit)
 sd/source/ui/slideshow/slideshowimpl.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 828f3b9a2432ab9d1d2c11a7aaabebe112d20f13
Author: Andrea Gelmini 
AuthorDate: Wed Nov 29 14:28:51 2023 +0100
Commit: Julien Nabet 
CommitDate: Wed Nov 29 14:56:37 2023 +0100

Fix typo

Change-Id: Ib7a9d442c90f628b9d82e7e714c1c59dc576b891
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160091
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 

diff --git a/sd/source/ui/slideshow/slideshowimpl.hxx 
b/sd/source/ui/slideshow/slideshowimpl.hxx
index 5211e73dc163..155cdc329f03 100644
--- a/sd/source/ui/slideshow/slideshowimpl.hxx
+++ b/sd/source/ui/slideshow/slideshowimpl.hxx
@@ -198,7 +198,7 @@ public:
 /// ends the presentation async
 void endPresentation();
 
-// possibly triggered from events @SlideshowImpl::Notify if needed, but 
asynchron to
+// possibly triggered from events @SlideshowImpl::Notify if needed, but 
make it asynchronous to
 // allow the noted event to completely finish in the core
 void AsyncNotifyEvent(const css::uno::Reference< css::drawing::XDrawPage 
>&, const SdrHintKind);
 


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

2023-11-29 Thread Balazs Varga (via logerrit)
 sd/source/ui/dlg/prntopts.cxx |   76 +-
 sd/source/ui/inc/prntopts.hxx |2 +
 2 files changed, 55 insertions(+), 23 deletions(-)

New commits:
commit 05f60be48a51a64ce99a7a7b62ae030002b16a14
Author: Balazs Varga 
AuthorDate: Tue Nov 28 14:06:09 2023 +0100
Commit: Balazs Varga 
CommitDate: Wed Nov 29 11:00:41 2023 +0100

tdf#158245 - UI: Part 46 - Unify lockdown behavior of Options dialog

for Draw - Print Page.

Change-Id: I9c5004253b0b871a14fe92475339cdad598491a6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160027
Tested-by: Jenkins
Reviewed-by: Balazs Varga 

diff --git a/sd/source/ui/dlg/prntopts.cxx b/sd/source/ui/dlg/prntopts.cxx
index 6a608932adce..0349fe688919 100644
--- a/sd/source/ui/dlg/prntopts.cxx
+++ b/sd/source/ui/dlg/prntopts.cxx
@@ -23,12 +23,14 @@
 #include 
 #include 
 #include 
+#include 
 
 /**
  *  dialog to adjust print options
  */
 SdPrintOptions::SdPrintOptions(weld::Container* pPage, weld::DialogController* 
pController, const SfxItemSet& rInAttrs)
 : SfxTabPage(pPage, pController, "modules/simpress/ui/prntopts.ui", 
"prntopts", )
+, m_bDrawMode(false)
 , m_xFrmContent(m_xBuilder->weld_frame("contentframe"))
 , m_xCbxDraw(m_xBuilder->weld_check_button("drawingcb"))
 , m_xCbxNotes(m_xBuilder->weld_check_button("notecb"))
@@ -200,41 +202,59 @@ void SdPrintOptions::Reset( const SfxItemSet* rAttrs )
 m_xRbtBlackWhite->set_active(true);
 }
 
-bool bReadOnly = 
officecfg::Office::Impress::Print::Page::PageSize::isReadOnly() ||
-officecfg::Office::Impress::Print::Page::PageTile::isReadOnly() ||
-officecfg::Office::Impress::Print::Page::Booklet::isReadOnly();
+bool bReadOnly = false;
+if (m_bDrawMode)
+{
+bReadOnly = 
officecfg::Office::Draw::Print::Page::PageSize::isReadOnly() ||
+officecfg::Office::Draw::Print::Page::PageTile::isReadOnly() ||
+officecfg::Office::Draw::Print::Page::Booklet::isReadOnly();
+}
+else
+{
+bReadOnly = 
officecfg::Office::Impress::Print::Page::PageSize::isReadOnly() ||
+officecfg::Office::Impress::Print::Page::PageTile::isReadOnly() ||
+officecfg::Office::Impress::Print::Page::Booklet::isReadOnly();
+}
 m_xGridPageOpt->set_sensitive(!bReadOnly);
 m_xRbtPageOptImg->set_visible(bReadOnly);
 
-bReadOnly = 
officecfg::Office::Impress::Print::Page::BookletFront::isReadOnly();
+bReadOnly = m_bDrawMode ? 
officecfg::Office::Draw::Print::Page::BookletFront::isReadOnly() :
+officecfg::Office::Impress::Print::Page::BookletFront::isReadOnly();
 m_xCbxFront->set_sensitive(!bReadOnly);
 m_xCbxFrontImg->set_visible(bReadOnly);
 
-bReadOnly = 
officecfg::Office::Impress::Print::Page::BookletBack::isReadOnly();
+bReadOnly = m_bDrawMode ? 
officecfg::Office::Draw::Print::Page::BookletBack::isReadOnly() :
+officecfg::Office::Impress::Print::Page::BookletBack::isReadOnly();
 m_xCbxBack->set_sensitive(!bReadOnly);
 m_xCbxBackImg->set_visible(bReadOnly);
 
-bReadOnly = 
officecfg::Office::Impress::Print::Other::FromPrinterSetup::isReadOnly();
+bReadOnly = m_bDrawMode ? 
officecfg::Office::Draw::Print::Other::FromPrinterSetup::isReadOnly() :
+
officecfg::Office::Impress::Print::Other::FromPrinterSetup::isReadOnly();
 m_xCbxPaperbin->set_sensitive(!bReadOnly);
 m_xCbxPaperbinImg->set_visible(bReadOnly);
 
-bReadOnly = 
officecfg::Office::Impress::Print::Other::PageName::isReadOnly();
+bReadOnly = m_bDrawMode ? 
officecfg::Office::Draw::Print::Other::PageName::isReadOnly() :
+officecfg::Office::Impress::Print::Other::PageName::isReadOnly();
 m_xCbxPagename->set_sensitive(!bReadOnly);
 m_xCbxPagenameImg->set_visible(bReadOnly);
 
-bReadOnly = officecfg::Office::Impress::Print::Other::Date::isReadOnly();
+bReadOnly = m_bDrawMode ? 
officecfg::Office::Draw::Print::Other::Date::isReadOnly() :
+officecfg::Office::Impress::Print::Other::Date::isReadOnly();
 m_xCbxDate->set_sensitive(!bReadOnly);
 m_xCbxDateImg->set_visible(bReadOnly);
 
-bReadOnly = officecfg::Office::Impress::Print::Other::Time::isReadOnly();
+bReadOnly = m_bDrawMode ? 
officecfg::Office::Draw::Print::Other::Time::isReadOnly() :
+officecfg::Office::Impress::Print::Other::Time::isReadOnly();
 m_xCbxTime->set_sensitive(!bReadOnly);
 m_xCbxTimeImg->set_visible(bReadOnly);
 
-bReadOnly = 
officecfg::Office::Impress::Print::Other::HiddenPage::isReadOnly();
+bReadOnly = m_bDrawMode ? 
officecfg::Office::Draw::Print::Other::HiddenPage::isReadOnly() :
+officecfg::Office::Impress::Print::Other::HiddenPage::isReadOnly();
 m_xCbxHiddenPages->set_sensitive(!bReadOnly);
 m_xCbxHiddenPagesImg->set_visible(bReadOnly);
 
-bReadOnly = 
officecfg::Office::Impress::Print::Other::Quality::isReadOnly();
+bReadOnly = 

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

2023-11-29 Thread Balazs Varga (via logerrit)
 sd/source/ui/app/sdmod2.cxx   |7 +++
 sd/source/ui/dlg/tpoption.cxx |   24 
 sd/source/ui/inc/tpoption.hxx |5 +
 3 files changed, 32 insertions(+), 4 deletions(-)

New commits:
commit 34d3f383b62ebd87f842e48e6627dbf5ed369667
Author: Balazs Varga 
AuthorDate: Mon Nov 27 14:03:20 2023 +0100
Commit: Balazs Varga 
CommitDate: Wed Nov 29 09:45:40 2023 +0100

tdf#158243 - UI: Part 44 - Unify lockdown behavior of Options dialog

for Draw - View Page.

Change-Id: If06945482e5a441903d6eb44b66242bd8806bcd6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159995
Tested-by: Jenkins
Reviewed-by: Balazs Varga 

diff --git a/sd/source/ui/app/sdmod2.cxx b/sd/source/ui/app/sdmod2.cxx
index cccf425172bc..8a6424d16263 100644
--- a/sd/source/ui/app/sdmod2.cxx
+++ b/sd/source/ui/app/sdmod2.cxx
@@ -736,7 +736,14 @@ std::unique_ptr SdModule::CreateTabPage( 
sal_uInt16 nId, weld::Conta
 {
 ::CreateTabPage fnCreatePage = 
pFact->GetSdOptionsContentsTabPageCreatorFunc();
 if( fnCreatePage )
+{
 xRet = (*fnCreatePage)( pPage, pController,  );
+if (SID_SD_TP_CONTENTS == nId)
+aSet.Put(SfxUInt32Item(SID_SDMODE_FLAG, SD_DRAW_MODE));
+else
+aSet.Put(SfxUInt32Item(SID_SDMODE_FLAG, SD_IMPRESS_MODE));
+xRet->PageCreated(aSet);
+}
 }
 break;
 case SID_SD_TP_SNAP:
diff --git a/sd/source/ui/dlg/tpoption.cxx b/sd/source/ui/dlg/tpoption.cxx
index f6f5b4f5aa7e..8c5416c9cb09 100644
--- a/sd/source/ui/dlg/tpoption.cxx
+++ b/sd/source/ui/dlg/tpoption.cxx
@@ -148,6 +148,7 @@ std::unique_ptr SdTpOptionsSnap::Create( 
weld::Container* pPage, wel
 \/
 SdTpOptionsContents::SdTpOptionsContents(weld::Container* pPage, 
weld::DialogController* pController, const SfxItemSet& rInAttrs)
 : SfxTabPage(pPage, pController, "modules/simpress/ui/sdviewpage.ui", 
"SdViewPage", )
+, m_bDrawMode(false)
 , m_xCbxRuler(m_xBuilder->weld_check_button("ruler"))
 , m_xCbxRulerImg(m_xBuilder->weld_widget("lockruler"))
 , m_xCbxDragStripes(m_xBuilder->weld_check_button("dragstripes"))
@@ -216,19 +217,23 @@ void SdTpOptionsContents::Reset( const SfxItemSet* rAttrs 
)
 m_xCbxDragStripes->set_active( 
aLayoutItem.GetOptionsLayout().IsDragStripes() );
 m_xCbxHandlesBezier->set_active( 
aLayoutItem.GetOptionsLayout().IsHandlesBezier() );
 
-bool bReadOnly = 
officecfg::Office::Impress::Layout::Display::Ruler::isReadOnly();
+bool bReadOnly = m_bDrawMode ? 
officecfg::Office::Draw::Layout::Display::Ruler::isReadOnly() :
+officecfg::Office::Impress::Layout::Display::Ruler::isReadOnly();
 m_xCbxRuler->set_sensitive(!bReadOnly);
 m_xCbxRulerImg->set_visible(bReadOnly);
 
-bReadOnly = 
officecfg::Office::Impress::Layout::Display::Contour::isReadOnly();
+bReadOnly = m_bDrawMode ? 
officecfg::Office::Draw::Layout::Display::Contour::isReadOnly() :
+officecfg::Office::Impress::Layout::Display::Contour::isReadOnly();
 m_xCbxMoveOutline->set_sensitive(!bReadOnly);
 m_xCbxMoveOutlineImg->set_visible(bReadOnly);
 
-bReadOnly = 
officecfg::Office::Impress::Layout::Display::Guide::isReadOnly();
+bReadOnly = m_bDrawMode ? 
officecfg::Office::Draw::Layout::Display::Guide::isReadOnly() :
+officecfg::Office::Impress::Layout::Display::Guide::isReadOnly();
 m_xCbxDragStripes->set_sensitive(!bReadOnly);
 m_xCbxDragStripesImg->set_visible(bReadOnly);
 
-bReadOnly = 
officecfg::Office::Impress::Layout::Display::Bezier::isReadOnly();
+bReadOnly = m_bDrawMode ? 
officecfg::Office::Draw::Layout::Display::Bezier::isReadOnly() :
+officecfg::Office::Impress::Layout::Display::Bezier::isReadOnly();
 m_xCbxHandlesBezier->set_sensitive(!bReadOnly);
 m_xCbxHandlesBezierImg->set_visible(bReadOnly);
 
@@ -244,6 +249,17 @@ std::unique_ptr SdTpOptionsContents::Create( 
weld::Container* pPage,
 return std::make_unique(pPage, pController, *rAttrs);
 }
 
+void SdTpOptionsContents::PageCreated( const SfxAllItemSet& aSet )
+{
+const SfxUInt32Item* pFlagItem = 
aSet.GetItem(SID_SDMODE_FLAG, false);
+if (pFlagItem)
+{
+sal_uInt32 nFlags = pFlagItem->GetValue();
+if ((nFlags & SD_DRAW_MODE) == SD_DRAW_MODE)
+SetDrawMode();
+}
+}
+
 /*
 |*
 |*  TabPage to adjust the misc options
diff --git a/sd/source/ui/inc/tpoption.hxx b/sd/source/ui/inc/tpoption.hxx
index e53c55284cf0..e1065eb28b1b 100644
--- a/sd/source/ui/inc/tpoption.hxx
+++ b/sd/source/ui/inc/tpoption.hxx
@@ -42,6 +42,7 @@ public:
 class SdTpOptionsContents final : public SfxTabPage
 {
 private:
+bool m_bDrawMode;
 std::unique_ptr m_xCbxRuler;
 std::unique_ptr m_xCbxRulerImg;
 

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

2023-11-28 Thread Andrea Gelmini (via logerrit)
 sd/source/ui/slideshow/slideshowimpl.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 1ca6f51567ec35f88652d0adcc0d26478bb0aad9
Author: Andrea Gelmini 
AuthorDate: Tue Nov 28 15:09:03 2023 +0100
Commit: Julien Nabet 
CommitDate: Tue Nov 28 15:54:48 2023 +0100

Fix typo

Change-Id: I834d1e296e19af269853bb1d8e73f754eebe2fb9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160028
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 

diff --git a/sd/source/ui/slideshow/slideshowimpl.hxx 
b/sd/source/ui/slideshow/slideshowimpl.hxx
index 9c0ae75dd5e9..5211e73dc163 100644
--- a/sd/source/ui/slideshow/slideshowimpl.hxx
+++ b/sd/source/ui/slideshow/slideshowimpl.hxx
@@ -198,7 +198,7 @@ public:
 /// ends the presentation async
 void endPresentation();
 
-// possibly triggered from events @SlideshowImpl::Notify if needed, but 
asychron to
+// possibly triggered from events @SlideshowImpl::Notify if needed, but 
asynchron to
 // allow the noted event to completely finish in the core
 void AsyncNotifyEvent(const css::uno::Reference< css::drawing::XDrawPage 
>&, const SdrHintKind);
 


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

2023-11-28 Thread Armin Le Grand (allotropia) (via logerrit)
 sd/source/ui/slideshow/slideshowimpl.cxx |   96 ---
 sd/source/ui/slideshow/slideshowimpl.hxx |6 +
 2 files changed, 94 insertions(+), 8 deletions(-)

New commits:
commit 878b4ffc3e2c80c7f65b75c35fea26b978b71daf
Author: Armin Le Grand (allotropia) 
AuthorDate: Fri Nov 24 16:02:17 2023 +0100
Commit: Armin Le Grand 
CommitDate: Tue Nov 28 11:52:04 2023 +0100

Update SlideShow on DrawModel changes II

Change-Id: Idfbbb7744cc7b2182647b45f509399535a2d4df2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159930
Tested-by: Jenkins
Reviewed-by: Armin Le Grand 

diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx 
b/sd/source/ui/slideshow/slideshowimpl.cxx
index 97216f9bec79..7619624544b4 100644
--- a/sd/source/ui/slideshow/slideshowimpl.cxx
+++ b/sd/source/ui/slideshow/slideshowimpl.cxx
@@ -517,6 +517,8 @@ SlideshowImpl::SlideshowImpl( const Reference< 
XPresentation2 >& xPresentation,
 , mdUserPaintStrokeWidth ( 150.0 )
 , mnEndShowEvent(nullptr)
 , mnContextMenuEvent(nullptr)
+, mnEventObjectChange(nullptr)
+, mnEventPageOrderChange(nullptr)
 , mxPresentation( xPresentation )
 {
 if( mpViewShell )
@@ -598,6 +600,10 @@ void 
SlideshowImpl::disposing(std::unique_lock&)
 Application::RemoveUserEvent( mnEndShowEvent );
 if( mnContextMenuEvent )
 Application::RemoveUserEvent( mnContextMenuEvent );
+if( mnEventObjectChange )
+Application::RemoveUserEvent( mnEventObjectChange );
+if( mnEventPageOrderChange )
+Application::RemoveUserEvent( mnEventPageOrderChange );
 
 maInputFreezeTimer.Stop();
 
@@ -3094,16 +3100,19 @@ namespace
 {
 SlideshowImpl* pSlideshowImpl;
 uno::Reference< css::drawing::XDrawPage > XCurrentSlide;
+SdrHintKind eHintKind;
 };
 
-static void AsyncUpdateSlideshow(
+static ImplSVEvent* AsyncUpdateSlideshow(
 SlideshowImpl* pSlideshowImpl,
-uno::Reference< css::drawing::XDrawPage >& rXCurrentSlide)
+uno::Reference< css::drawing::XDrawPage >& rXCurrentSlide,
+SdrHintKind eHintKind)
 {
 AsyncUpdateSlideshowData* pNew(new AsyncUpdateSlideshowData);
 pNew->pSlideshowImpl = pSlideshowImpl;
 pNew->XCurrentSlide = rXCurrentSlide;
-Application::PostUserEvent(LINK(nullptr, 
AsyncUpdateSlideshow_Impl, Update), pNew);
+pNew->eHintKind = eHintKind;
+return Application::PostUserEvent(LINK(nullptr, 
AsyncUpdateSlideshow_Impl, Update), pNew);
 // coverity[leaked_storage] - pDisruptor takes care of its own 
destruction at idle time
 }
 
@@ -3113,11 +3122,64 @@ namespace
 IMPL_STATIC_LINK(AsyncUpdateSlideshow_Impl, Update, void*, pData, void)
 {
 AsyncUpdateSlideshowData* 
pSlideData(static_cast(pData));
-pSlideData->pSlideshowImpl->gotoSlide(pSlideData->XCurrentSlide);
+
pSlideData->pSlideshowImpl->AsyncNotifyEvent(pSlideData->XCurrentSlide, 
pSlideData->eHintKind);
 delete pSlideData;
 }
 }
 
+void SlideshowImpl::AsyncNotifyEvent(
+const uno::Reference< css::drawing::XDrawPage >& rXCurrentSlide,
+const SdrHintKind eHintKind)
+{
+if (SdrHintKind::ObjectChange == eHintKind)
+{
+mnEventObjectChange = nullptr;
+
+// refresh single slide
+gotoSlide(rXCurrentSlide);
+}
+else if (SdrHintKind::PageOrderChange == eHintKind)
+{
+mnEventPageOrderChange = nullptr;
+
+// order of pages (object pages or master pages) changed 
(Insert/Remove/ChangePos)
+// rXCurrentSlide is the current slide before the change.
+Reference< XDrawPagesSupplier > xDrawPages( mpDoc->getUnoModel(), 
UNO_QUERY_THROW );
+Reference< XIndexAccess > xSlides( xDrawPages->getDrawPages(), 
UNO_QUERY_THROW );
+const sal_Int32 nNewSlideCount(xSlides.is() ? xSlides->getCount() : 0);
+
+if (nNewSlideCount != mpSlideController->getSlideNumberCount())
+{
+// need to reinitialize AnimationSlideController
+OUString aPresSlide( maPresSettings.maPresPage );
+createSlideList( maPresSettings.mbAll, aPresSlide );
+}
+
+// Check if current slide before change is still valid (maybe removed)
+const sal_Int32 nSlideCount(mpSlideController->getSlideNumberCount());
+bool bSlideStillValid(false);
+
+for (sal_Int32 nSlide(0); !bSlideStillValid && nSlide < nSlideCount; 
nSlide++)
+{
+if (rXCurrentSlide == mpSlideController->getSlideByNumber(nSlide))
+{
+bSlideStillValid = true;
+}
+}
+
+if(bSlideStillValid)
+{
+// stay on that slide
+gotoSlide(rXCurrentSlide);
+}
+else
+{
+// not possible to stay on that slide, go to 1st slide (kinda 
restart)
+gotoFirstSlide();
+  

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

2023-11-27 Thread Michael Stahl (via logerrit)
 sd/source/ui/remotecontrol/Transmitter.cxx |   49 ++---
 1 file changed, 31 insertions(+), 18 deletions(-)

New commits:
commit 58594eaa9f4df52f919cf5b9c43959bcb9c2c452
Author: Michael Stahl 
AuthorDate: Fri Nov 24 12:20:33 2023 +0100
Commit: Michael Stahl 
CommitDate: Mon Nov 27 10:15:33 2023 +0100

sd: remote: release Transmitter mutex when sending

The Bluetooth communication appears to be astonishingly slow on my
system; the socket is deliberately cleared of O_NONBLOCK and what's even
worse is that the Mutex that is held while sending prevents the main
thread from adding new messages to the queues.

It looks like there should be no issue with releasing the Mutex while
sending, and if a separate Transmitter thread is used in the first place
it makes no sense to hold the Mutex while doing so.

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

diff --git a/sd/source/ui/remotecontrol/Transmitter.cxx 
b/sd/source/ui/remotecontrol/Transmitter.cxx
index cca6a3bee460..7992e5b94bd6 100644
--- a/sd/source/ui/remotecontrol/Transmitter.cxx
+++ b/sd/source/ui/remotecontrol/Transmitter.cxx
@@ -27,29 +27,42 @@ void SAL_CALL Transmitter::run()
 {
 mProcessingRequired.wait();
 
-::osl::MutexGuard aGuard( mMutex );
+OString aMessage;
+bool isHighPrio = {};
 
-if ( mFinishRequested ) {
-return;
-}
-if ( !mHighPriority.empty() )
-{
-OString aMessage( mHighPriority.front() );
-mHighPriority.pop();
-SAL_INFO( "sdremote.bluetooth", "write high prio line '" << 
aMessage << "'" );
-pStreamSocket->write( aMessage.getStr(), aMessage.getLength() );
-}
-else if ( !mLowPriority.empty() )
 {
-OString aMessage( mLowPriority.front() );
-mLowPriority.pop();
-SAL_INFO( "sdremote.bluetooth", "write normal line '" << aMessage 
<< "'" );
-pStreamSocket->write( aMessage.getStr(), aMessage.getLength() );
+::osl::MutexGuard aGuard(mMutex);
+
+if (mFinishRequested) {
+return;
+}
+if (!mHighPriority.empty())
+{
+aMessage = mHighPriority.front();
+mHighPriority.pop();
+isHighPrio = true;
+}
+else if (!mLowPriority.empty())
+{
+aMessage = mLowPriority.front();
+mLowPriority.pop();
+isHighPrio = false;
+}
 }
 
-if ( mLowPriority.empty() && mHighPriority.empty())
+SAL_INFO("sdremote.bluetooth", "write " << (isHighPrio ? "high prio" : 
"normal") << " line '" << aMessage << "'");
+// pStreamSocket is owned by Communicator, which joins this thread
+// before destroying pStreamSocket so it can't die here.
+// Sending is SLOW and blocks!
+pStreamSocket->write( aMessage.getStr(), aMessage.getLength() );
+
 {
-mProcessingRequired.reset();
+::osl::MutexGuard aGuard(mMutex);
+
+if (mLowPriority.empty() && mHighPriority.empty())
+{
+mProcessingRequired.reset();
+}
 }
 }
 }


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

2023-11-26 Thread Balazs Varga (via logerrit)
 sd/source/ui/dlg/tpoption.cxx|   59 ++-
 sd/source/ui/inc/tpoption.hxx|3 +
 sd/uiconfig/simpress/ui/optimpressgeneralpage.ui |   53 +++-
 3 files changed, 92 insertions(+), 23 deletions(-)

New commits:
commit 60969b81dd710f26e50f3428f5544ae368010d79
Author: Balazs Varga 
AuthorDate: Fri Nov 24 18:00:44 2023 +0100
Commit: Balazs Varga 
CommitDate: Mon Nov 27 08:49:18 2023 +0100

tdf#158241 - UI: Part 43 - Unify lockdown behavior of Options dialog

for Draw - General Page.

Change-Id: Ib17d638580011362cde5c2adea7e7e2d6e7d0eb0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159936
Tested-by: Jenkins
Reviewed-by: Balazs Varga 

diff --git a/sd/source/ui/dlg/tpoption.cxx b/sd/source/ui/dlg/tpoption.cxx
index 300b5caedd71..f6f5b4f5aa7e 100644
--- a/sd/source/ui/dlg/tpoption.cxx
+++ b/sd/source/ui/dlg/tpoption.cxx
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -255,6 +256,7 @@ SdTpOptionsMisc::SdTpOptionsMisc(weld::Container* pPage, 
weld::DialogController*
 : SfxTabPage(pPage, pController, 
"modules/simpress/ui/optimpressgeneralpage.ui", "OptSavePage", )
 , nWidth(0)
 , nHeight(0)
+, m_bDrawMode(false)
 , m_xCbxQuickEdit(m_xBuilder->weld_check_button("qickedit"))
 , m_xCbxQuickEditImg(m_xBuilder->weld_widget("lockqickedit"))
 , m_xCbxPickThrough(m_xBuilder->weld_check_button("textselected"))
@@ -276,6 +278,7 @@ SdTpOptionsMisc::SdTpOptionsMisc(weld::Container* pPage, 
weld::DialogController*
 , m_xCbxCompatibilityImg(m_xBuilder->weld_widget("lockcbCompatibility"))
 , m_xScaleFrame(m_xBuilder->weld_frame("scaleframe"))
 , m_xCbScale(m_xBuilder->weld_combo_box("scaleBox"))
+, m_xCbScaleImg(m_xBuilder->weld_widget("lockscaleBox"))
 , m_xNewDocLb(m_xBuilder->weld_label("newdoclbl"))
 , m_xFiInfo1(m_xBuilder->weld_label("info1"))
 , 
m_xMtrFldOriginalWidth(m_xBuilder->weld_metric_spin_button("metricWidthFields", 
FieldUnit::MM))
@@ -284,6 +287,7 @@ SdTpOptionsMisc::SdTpOptionsMisc(weld::Container* pPage, 
weld::DialogController*
 , m_xFiInfo2(m_xBuilder->weld_label("info2"))
 , 
m_xMtrFldOriginalHeight(m_xBuilder->weld_metric_spin_button("metricHeightFields",
 FieldUnit::MM))
 , m_xCbxDistort(m_xBuilder->weld_check_button("distortcb"))
+, m_xCbxDistortImg(m_xBuilder->weld_widget("lockdistortcb"))
 , m_xMtrFldInfo1(m_xBuilder->weld_metric_spin_button("metricInfo1Fields", 
FieldUnit::MM))
 , m_xMtrFldInfo2(m_xBuilder->weld_metric_spin_button("metricInfo2Fields", 
FieldUnit::MM))
 {
@@ -500,42 +504,54 @@ void SdTpOptionsMisc::Reset( const SfxItemSet* rAttrs )
 {
 SdOptionsMiscItem aOptsItem( rAttrs->Get( ATTR_OPTIONS_MISC ) );
 
-bool bReadOnly = 
officecfg::Office::Impress::Misc::NewDoc::AutoPilot::isReadOnly();
+bool bReadOnly = m_bDrawMode ? false : 
officecfg::Office::Impress::Misc::NewDoc::AutoPilot::isReadOnly();
 m_xCbxStartWithTemplate->set_active( 
aOptsItem.GetOptionsMisc().IsStartWithTemplate() );
 m_xCbxStartWithTemplate->set_sensitive(!bReadOnly);
 m_xCbxStartWithTemplateImg->set_visible(bReadOnly);
 
-bReadOnly = officecfg::Office::Impress::Misc::ObjectMoveable::isReadOnly();
+bReadOnly = m_bDrawMode ? 
officecfg::Office::Draw::Misc::ObjectMoveable::isReadOnly() :
+officecfg::Office::Impress::Misc::ObjectMoveable::isReadOnly();
 m_xCbxMarkedHitMovesAlways->set_active( 
aOptsItem.GetOptionsMisc().IsMarkedHitMovesAlways() );
 m_xCbxMarkedHitMovesAlways->set_sensitive(!bReadOnly);
 m_xCbxMarkedHitMovesAlwaysImg->set_visible(bReadOnly);
 
-bReadOnly = 
officecfg::Office::Impress::Misc::TextObject::QuickEditing::isReadOnly();
+bReadOnly = m_bDrawMode ? 
officecfg::Office::Draw::Misc::TextObject::QuickEditing::isReadOnly() :
+
officecfg::Office::Impress::Misc::TextObject::QuickEditing::isReadOnly();
 m_xCbxQuickEdit->set_active( aOptsItem.GetOptionsMisc().IsQuickEdit() );
 m_xCbxQuickEdit->set_sensitive(!bReadOnly);
 m_xCbxQuickEditImg->set_visible(bReadOnly);
 
-bReadOnly = 
officecfg::Office::Impress::Misc::TextObject::Selectable::isReadOnly();
+bReadOnly = m_bDrawMode ? 
officecfg::Office::Draw::Misc::TextObject::Selectable::isReadOnly() :
+officecfg::Office::Impress::Misc::TextObject::Selectable::isReadOnly();
 m_xCbxPickThrough->set_active( aOptsItem.GetOptionsMisc().IsPickThrough() 
);
 m_xCbxPickThrough->set_sensitive(!bReadOnly);
 m_xCbxPickThroughImg->set_visible(bReadOnly);
 
-bReadOnly = 
officecfg::Office::Impress::Misc::BackgroundCache::isReadOnly();
+bReadOnly = m_bDrawMode ? 
officecfg::Office::Draw::Misc::BackgroundCache::isReadOnly() :
+officecfg::Office::Impress::Misc::BackgroundCache::isReadOnly();
 m_xCbxMasterPageCache->set_active( 
aOptsItem.GetOptionsMisc().IsMasterPagePaintCaching() );
 

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

2023-11-24 Thread Oliver Specht (via logerrit)
 sd/source/ui/view/sdview3.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 418af212a7f506784d88f5a7a7800140f4f9dd30
Author: Oliver Specht 
AuthorDate: Mon Nov 20 11:09:45 2023 +0100
Commit: Thorsten Behrens 
CommitDate: Fri Nov 24 15:55:34 2023 +0100

tdf#157363 remove HTML prefix always

when pasting simple HTML the prefix has to removed also if content is pasted
without an active drawing object

Change-Id: I038771c3d0338f16b74bd45275f4637eab00cfdf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159738
Tested-by: Jenkins
Tested-by: Gabor Kelemen 
Reviewed-by: Thorsten Behrens 

diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx
index 3656f6481242..ddd0ad28ece5 100644
--- a/sd/source/ui/view/sdview3.cxx
+++ b/sd/source/ui/view/sdview3.cxx
@@ -1504,6 +1504,7 @@ bool View::InsertData( const TransferableDataHelper& 
rDataHelper,
 
 OutlinerView* pOLV = GetTextEditOutlinerView();
 MSE40HTMLClipFormatObj aMSE40HTMLClipFormatObj;
+SvStream* pHtmlStream = aMSE40HTMLClipFormatObj.IsValid(*xStm);
 
 if (pOLV)
 {
@@ -1513,7 +1514,6 @@ bool View::InsertData( const TransferableDataHelper& 
rDataHelper,
 if (aRect.Contains(aPos) || (!bDrag && IsTextEdit()))
 {
 // mba: clipboard always must contain absolute URLs 
(could be from alien source)
-SvStream* pHtmlStream = 
aMSE40HTMLClipFormatObj.IsValid(*xStm);
 pOLV->Read(*pHtmlStream, EETextFormat::Html, 
mpDocSh->GetHeaderAttributes());
 bReturn = true;
 }
@@ -1521,7 +1521,7 @@ bool View::InsertData( const TransferableDataHelper& 
rDataHelper,
 
 if (!bReturn)
 // mba: clipboard always must contain absolute URLs (could 
be from alien source)
-bReturn = SdrView::Paste(*xStm, EETextFormat::Html, 
maDropPos, pPage, nPasteOptions);
+bReturn = SdrView::Paste(*pHtmlStream, EETextFormat::Html, 
maDropPos, pPage, nPasteOptions);
 }
 }
 }


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

2023-11-24 Thread Balazs Varga (via logerrit)
 sd/source/ui/dlg/prntopts.cxx   |   63 ++
 sd/source/ui/inc/prntopts.hxx   |   10 +
 sd/uiconfig/simpress/ui/prntopts.ui |  335 
 3 files changed, 293 insertions(+), 115 deletions(-)

New commits:
commit 6f32acbbf8e2f42dd926b42d7718056db5bbee94
Author: Balazs Varga 
AuthorDate: Fri Nov 24 14:15:46 2023 +0100
Commit: Balazs Varga 
CommitDate: Fri Nov 24 15:17:12 2023 +0100

tdf#158240 - UI: Part 42 - Unify lockdown behavior of Options dialog

for Impress - Print Page.

Change-Id: I96e90ab09ee4bc80b097799970a5b1c56fc47048
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159927
Tested-by: Jenkins
Reviewed-by: Balazs Varga 

diff --git a/sd/source/ui/dlg/prntopts.cxx b/sd/source/ui/dlg/prntopts.cxx
index 8b17ae6d59ab..6a608932adce 100644
--- a/sd/source/ui/dlg/prntopts.cxx
+++ b/sd/source/ui/dlg/prntopts.cxx
@@ -22,6 +22,7 @@
 #include 
 #include 
 #include 
+#include 
 
 /**
  *  dialog to adjust print options
@@ -36,17 +37,27 @@ SdPrintOptions::SdPrintOptions(weld::Container* pPage, 
weld::DialogController* p
 , m_xRbtColor(m_xBuilder->weld_radio_button("defaultrb"))
 , m_xRbtGrayscale(m_xBuilder->weld_radio_button("grayscalerb"))
 , m_xRbtBlackWhite(m_xBuilder->weld_radio_button("blackwhiterb"))
+, m_xRbQualityImg(m_xBuilder->weld_widget("lockquality"))
 , m_xCbxPagename(m_xBuilder->weld_check_button("pagenmcb"))
+, m_xCbxPagenameImg(m_xBuilder->weld_widget("lockpagenmcb"))
 , m_xCbxDate(m_xBuilder->weld_check_button("datecb"))
+, m_xCbxDateImg(m_xBuilder->weld_widget("lockdatecb"))
 , m_xCbxTime(m_xBuilder->weld_check_button("timecb"))
+, m_xCbxTimeImg(m_xBuilder->weld_widget("locktimecb"))
 , m_xCbxHiddenPages(m_xBuilder->weld_check_button("hiddenpgcb"))
+, m_xCbxHiddenPagesImg(m_xBuilder->weld_widget("lockhiddenpgcb"))
 , m_xRbtDefault(m_xBuilder->weld_radio_button("pagedefaultrb"))
 , m_xRbtPagesize(m_xBuilder->weld_radio_button("fittopgrb"))
 , m_xRbtPagetile(m_xBuilder->weld_radio_button("tilepgrb"))
 , m_xRbtBooklet(m_xBuilder->weld_radio_button("brouchrb"))
+, m_xGridPageOpt(m_xBuilder->weld_widget("pageoptions"))
+, m_xRbtPageOptImg(m_xBuilder->weld_widget("lockpageoptions"))
 , m_xCbxFront(m_xBuilder->weld_check_button("frontcb"))
+, m_xCbxFrontImg(m_xBuilder->weld_widget("lockfrontcb"))
 , m_xCbxBack(m_xBuilder->weld_check_button("backcb"))
+, m_xCbxBackImg(m_xBuilder->weld_widget("lockbackcb"))
 , m_xCbxPaperbin(m_xBuilder->weld_check_button("papertryfrmprntrcb"))
+, m_xCbxPaperbinImg(m_xBuilder->weld_widget("lockpapertryfrmprntrcb"))
 {
 Link aLink = LINK( this, SdPrintOptions, 
ClickBookletHdl );
 m_xRbtDefault->connect_toggled( aLink );
@@ -188,6 +199,47 @@ void SdPrintOptions::Reset( const SfxItemSet* rAttrs )
 else
 m_xRbtBlackWhite->set_active(true);
 }
+
+bool bReadOnly = 
officecfg::Office::Impress::Print::Page::PageSize::isReadOnly() ||
+officecfg::Office::Impress::Print::Page::PageTile::isReadOnly() ||
+officecfg::Office::Impress::Print::Page::Booklet::isReadOnly();
+m_xGridPageOpt->set_sensitive(!bReadOnly);
+m_xRbtPageOptImg->set_visible(bReadOnly);
+
+bReadOnly = 
officecfg::Office::Impress::Print::Page::BookletFront::isReadOnly();
+m_xCbxFront->set_sensitive(!bReadOnly);
+m_xCbxFrontImg->set_visible(bReadOnly);
+
+bReadOnly = 
officecfg::Office::Impress::Print::Page::BookletBack::isReadOnly();
+m_xCbxBack->set_sensitive(!bReadOnly);
+m_xCbxBackImg->set_visible(bReadOnly);
+
+bReadOnly = 
officecfg::Office::Impress::Print::Other::FromPrinterSetup::isReadOnly();
+m_xCbxPaperbin->set_sensitive(!bReadOnly);
+m_xCbxPaperbinImg->set_visible(bReadOnly);
+
+bReadOnly = 
officecfg::Office::Impress::Print::Other::PageName::isReadOnly();
+m_xCbxPagename->set_sensitive(!bReadOnly);
+m_xCbxPagenameImg->set_visible(bReadOnly);
+
+bReadOnly = officecfg::Office::Impress::Print::Other::Date::isReadOnly();
+m_xCbxDate->set_sensitive(!bReadOnly);
+m_xCbxDateImg->set_visible(bReadOnly);
+
+bReadOnly = officecfg::Office::Impress::Print::Other::Time::isReadOnly();
+m_xCbxTime->set_sensitive(!bReadOnly);
+m_xCbxTimeImg->set_visible(bReadOnly);
+
+bReadOnly = 
officecfg::Office::Impress::Print::Other::HiddenPage::isReadOnly();
+m_xCbxHiddenPages->set_sensitive(!bReadOnly);
+m_xCbxHiddenPagesImg->set_visible(bReadOnly);
+
+bReadOnly = 
officecfg::Office::Impress::Print::Other::Quality::isReadOnly();
+m_xRbtColor->set_sensitive(!bReadOnly);
+m_xRbtGrayscale->set_sensitive(!bReadOnly);
+m_xRbtBlackWhite->set_sensitive(!bReadOnly);
+m_xRbQualityImg->set_visible(bReadOnly);
+
 m_xCbxDraw->save_state();
 m_xCbxNotes->save_state();
 m_xCbxHandout->save_state();
@@ -229,13 +281,14 @@ IMPL_LINK_NOARG(SdPrintOptions, ClickBookletHdl, 
weld::Toggleable&, 

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

2023-11-24 Thread Balazs Varga (via logerrit)
 sd/source/ui/dlg/tpoption.cxx |   20 
 sd/source/ui/inc/tpoption.hxx |4 +
 sd/uiconfig/simpress/ui/sdviewpage.ui |   78 +++---
 3 files changed, 87 insertions(+), 15 deletions(-)

New commits:
commit b1a866caccb322ec6e88eac67710310160e72b58
Author: Balazs Varga 
AuthorDate: Thu Nov 23 11:39:09 2023 +0100
Commit: Balazs Varga 
CommitDate: Fri Nov 24 14:18:23 2023 +0100

tdf#158238 - UI: Part 40 - Unify lockdown behavior of Options dialog

for Impress - View Page.

Change-Id: Icc3c4fc9dd3800ef454cbddb06e569e03c08967a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159856
Tested-by: Jenkins
Reviewed-by: Balazs Varga 

diff --git a/sd/source/ui/dlg/tpoption.cxx b/sd/source/ui/dlg/tpoption.cxx
index b177c8e94064..fabf76255bd7 100644
--- a/sd/source/ui/dlg/tpoption.cxx
+++ b/sd/source/ui/dlg/tpoption.cxx
@@ -110,9 +110,13 @@ std::unique_ptr SdTpOptionsSnap::Create( 
weld::Container* pPage, wel
 SdTpOptionsContents::SdTpOptionsContents(weld::Container* pPage, 
weld::DialogController* pController, const SfxItemSet& rInAttrs)
 : SfxTabPage(pPage, pController, "modules/simpress/ui/sdviewpage.ui", 
"SdViewPage", )
 , m_xCbxRuler(m_xBuilder->weld_check_button("ruler"))
+, m_xCbxRulerImg(m_xBuilder->weld_widget("lockruler"))
 , m_xCbxDragStripes(m_xBuilder->weld_check_button("dragstripes"))
+, m_xCbxDragStripesImg(m_xBuilder->weld_widget("lockdragstripes"))
 , m_xCbxHandlesBezier(m_xBuilder->weld_check_button("handlesbezier"))
+, m_xCbxHandlesBezierImg(m_xBuilder->weld_widget("lockhandlesbezier"))
 , m_xCbxMoveOutline(m_xBuilder->weld_check_button("moveoutline"))
+, m_xCbxMoveOutlineImg(m_xBuilder->weld_widget("lockmoveoutline"))
 {
 }
 
@@ -173,6 +177,22 @@ void SdTpOptionsContents::Reset( const SfxItemSet* rAttrs )
 m_xCbxDragStripes->set_active( 
aLayoutItem.GetOptionsLayout().IsDragStripes() );
 m_xCbxHandlesBezier->set_active( 
aLayoutItem.GetOptionsLayout().IsHandlesBezier() );
 
+bool bReadOnly = 
officecfg::Office::Impress::Layout::Display::Ruler::isReadOnly();
+m_xCbxRuler->set_sensitive(!bReadOnly);
+m_xCbxRulerImg->set_visible(bReadOnly);
+
+bReadOnly = 
officecfg::Office::Impress::Layout::Display::Contour::isReadOnly();
+m_xCbxMoveOutline->set_sensitive(!bReadOnly);
+m_xCbxMoveOutlineImg->set_visible(bReadOnly);
+
+bReadOnly = 
officecfg::Office::Impress::Layout::Display::Guide::isReadOnly();
+m_xCbxDragStripes->set_sensitive(!bReadOnly);
+m_xCbxDragStripesImg->set_visible(bReadOnly);
+
+bReadOnly = 
officecfg::Office::Impress::Layout::Display::Bezier::isReadOnly();
+m_xCbxHandlesBezier->set_sensitive(!bReadOnly);
+m_xCbxHandlesBezierImg->set_visible(bReadOnly);
+
 m_xCbxRuler->save_state();
 m_xCbxMoveOutline->save_state();
 m_xCbxDragStripes->save_state();
diff --git a/sd/source/ui/inc/tpoption.hxx b/sd/source/ui/inc/tpoption.hxx
index 4184cd7400d5..79735e6a3f81 100644
--- a/sd/source/ui/inc/tpoption.hxx
+++ b/sd/source/ui/inc/tpoption.hxx
@@ -43,9 +43,13 @@ class SdTpOptionsContents final : public SfxTabPage
 {
 private:
 std::unique_ptr m_xCbxRuler;
+std::unique_ptr m_xCbxRulerImg;
 std::unique_ptr m_xCbxDragStripes;
+std::unique_ptr m_xCbxDragStripesImg;
 std::unique_ptr m_xCbxHandlesBezier;
+std::unique_ptr m_xCbxHandlesBezierImg;
 std::unique_ptr m_xCbxMoveOutline;
+std::unique_ptr m_xCbxMoveOutlineImg;
 
 public:
 SdTpOptionsContents(weld::Container* pPage, weld::DialogController* 
pController, const SfxItemSet& rInAttrs);
diff --git a/sd/uiconfig/simpress/ui/sdviewpage.ui 
b/sd/uiconfig/simpress/ui/sdviewpage.ui
index 52193b075c1e..608114e88fa9 100644
--- a/sd/uiconfig/simpress/ui/sdviewpage.ui
+++ b/sd/uiconfig/simpress/ui/sdviewpage.ui
@@ -10,13 +10,13 @@
 0
 none
 
-  
+  
+  
 True
 False
 12
 6
-vertical
-6
+6
 
   
 _Rulers visible
@@ -32,9 +32,8 @@
 
   
   
-False
-True
-0
+1
+0
   
 
 
@@ -52,9 +51,8 @@
 
   
   
-False
-True
-1
+1
+1
   
 
 
@@ -72,9 +70,8 @@
 
   
   
-False
-True
-2
+1
+2
   
 
 
@@ -92,9 +89,60 @@
 
   
   
-False
-True
-3
+1
+3
+  
+
+
+  
+False
+True
+center
+center
+res/lock.png
+  
+  
+0
+0
+  
+
+
+  
+False
+True
+   

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

2023-11-24 Thread Balazs Varga (via logerrit)
 sd/source/ui/dlg/tpoption.cxx|   55 -
 sd/source/ui/inc/tpoption.hxx|9 +
 sd/uiconfig/simpress/ui/optimpressgeneralpage.ui |  140 +--
 3 files changed, 193 insertions(+), 11 deletions(-)

New commits:
commit 256ec735299e95f03f87a1356a30147c67388d24
Author: Balazs Varga 
AuthorDate: Thu Nov 23 10:45:24 2023 +0100
Commit: Balazs Varga 
CommitDate: Fri Nov 24 14:17:47 2023 +0100

tdf#158222 - UI: Part 39 - Unify lockdown behavior of Options dialog

for Impress - General Page.

Change-Id: Idd7240b6c0ccfec8929e2f224a63ec5c0a8ad331
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159854
Tested-by: Jenkins
Reviewed-by: Balazs Varga 

diff --git a/sd/source/ui/dlg/tpoption.cxx b/sd/source/ui/dlg/tpoption.cxx
index c7ee0843a42b..b177c8e94064 100644
--- a/sd/source/ui/dlg/tpoption.cxx
+++ b/sd/source/ui/dlg/tpoption.cxx
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -197,15 +198,24 @@ SdTpOptionsMisc::SdTpOptionsMisc(weld::Container* pPage, 
weld::DialogController*
 , nWidth(0)
 , nHeight(0)
 , m_xCbxQuickEdit(m_xBuilder->weld_check_button("qickedit"))
+, m_xCbxQuickEditImg(m_xBuilder->weld_widget("lockqickedit"))
 , m_xCbxPickThrough(m_xBuilder->weld_check_button("textselected"))
+, m_xCbxPickThroughImg(m_xBuilder->weld_widget("locktextselected"))
 , m_xNewDocumentFrame(m_xBuilder->weld_frame("newdocumentframe"))
 , m_xCbxStartWithTemplate(m_xBuilder->weld_check_button("startwithwizard"))
+, 
m_xCbxStartWithTemplateImg(m_xBuilder->weld_widget("lockstartwithwizard"))
 , m_xCbxMasterPageCache(m_xBuilder->weld_check_button("backgroundback"))
+, m_xCbxMasterPageCacheImg(m_xBuilder->weld_widget("lockbackgroundback"))
 , m_xCbxCopy(m_xBuilder->weld_check_button("copywhenmove"))
+, m_xCbxCopyImg(m_xBuilder->weld_widget("lockcopywhenmove"))
 , m_xCbxMarkedHitMovesAlways(m_xBuilder->weld_check_button("objalwymov"))
+, m_xCbxMarkedHitMovesAlwaysImg(m_xBuilder->weld_widget("lockobjalwymov"))
 , m_xLbMetric(m_xBuilder->weld_combo_box("units"))
+, m_xLbMetricImg(m_xBuilder->weld_widget("lockunits"))
 , m_xMtrFldTabstop(m_xBuilder->weld_metric_spin_button("metricFields", 
FieldUnit::MM))
+, m_xMtrFldTabstopImg(m_xBuilder->weld_widget("locktabstop"))
 , m_xCbxCompatibility(m_xBuilder->weld_check_button("cbCompatibility"))
+, m_xCbxCompatibilityImg(m_xBuilder->weld_widget("lockcbCompatibility"))
 , m_xScaleFrame(m_xBuilder->weld_frame("scaleframe"))
 , m_xCbScale(m_xBuilder->weld_combo_box("scaleBox"))
 , m_xNewDocLb(m_xBuilder->weld_label("newdoclbl"))
@@ -432,13 +442,41 @@ void SdTpOptionsMisc::Reset( const SfxItemSet* rAttrs )
 {
 SdOptionsMiscItem aOptsItem( rAttrs->Get( ATTR_OPTIONS_MISC ) );
 
+bool bReadOnly = 
officecfg::Office::Impress::Misc::NewDoc::AutoPilot::isReadOnly();
 m_xCbxStartWithTemplate->set_active( 
aOptsItem.GetOptionsMisc().IsStartWithTemplate() );
+m_xCbxStartWithTemplate->set_sensitive(!bReadOnly);
+m_xCbxStartWithTemplateImg->set_visible(bReadOnly);
+
+bReadOnly = officecfg::Office::Impress::Misc::ObjectMoveable::isReadOnly();
 m_xCbxMarkedHitMovesAlways->set_active( 
aOptsItem.GetOptionsMisc().IsMarkedHitMovesAlways() );
+m_xCbxMarkedHitMovesAlways->set_sensitive(!bReadOnly);
+m_xCbxMarkedHitMovesAlwaysImg->set_visible(bReadOnly);
+
+bReadOnly = 
officecfg::Office::Impress::Misc::TextObject::QuickEditing::isReadOnly();
 m_xCbxQuickEdit->set_active( aOptsItem.GetOptionsMisc().IsQuickEdit() );
+m_xCbxQuickEdit->set_sensitive(!bReadOnly);
+m_xCbxQuickEditImg->set_visible(bReadOnly);
+
+bReadOnly = 
officecfg::Office::Impress::Misc::TextObject::Selectable::isReadOnly();
 m_xCbxPickThrough->set_active( aOptsItem.GetOptionsMisc().IsPickThrough() 
);
+m_xCbxPickThrough->set_sensitive(!bReadOnly);
+m_xCbxPickThroughImg->set_visible(bReadOnly);
+
+bReadOnly = 
officecfg::Office::Impress::Misc::BackgroundCache::isReadOnly();
 m_xCbxMasterPageCache->set_active( 
aOptsItem.GetOptionsMisc().IsMasterPagePaintCaching() );
+m_xCbxMasterPageCache->set_sensitive(!bReadOnly);
+m_xCbxMasterPageCacheImg->set_visible(bReadOnly);
+
+bReadOnly = 
officecfg::Office::Impress::Misc::CopyWhileMoving::isReadOnly();
 m_xCbxCopy->set_active( aOptsItem.GetOptionsMisc().IsDragWithCopy() );
+m_xCbxCopy->set_sensitive(!bReadOnly);
+m_xCbxCopyImg->set_visible(bReadOnly);
+
+bReadOnly = 
officecfg::Office::Impress::Misc::Compatibility::AddBetween::isReadOnly();
 m_xCbxCompatibility->set_active( 
aOptsItem.GetOptionsMisc().IsSummationOfParagraphs() );
+m_xCbxCompatibility->set_sensitive(!bReadOnly);
+m_xCbxCompatibilityImg->set_visible(bReadOnly);
+
 m_xCbxDistort->set_active( 
aOptsItem.GetOptionsMisc().IsCrookNoContortion() );
 

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

2023-11-24 Thread Michael Stahl (via logerrit)
 sd/source/ui/dlg/RemoteDialog.cxx  |2 
 sd/source/ui/dlg/RemoteDialogClientBox.cxx |4 -
 sd/source/ui/inc/RemoteServer.hxx  |   41 ++---
 sd/source/ui/remotecontrol/BluetoothServer.cxx |   20 +++-
 sd/source/ui/remotecontrol/Server.cxx  |   58 -
 5 files changed, 74 insertions(+), 51 deletions(-)

New commits:
commit 7d7d84c07b1ed01a5cd51b43c5712eab19d3f729
Author: Michael Stahl 
AuthorDate: Tue Nov 21 14:48:03 2023 +0100
Commit: Michael Stahl 
CommitDate: Fri Nov 24 10:22:49 2023 +0100

sd: remote: disentangle class RemoteServer

RemoteServer was both an object and a thread instantiated for the IP
server, and a bunch of static methods and data used by all servers.

Split out a class IPRemoteServer.

Move Bluetooth setup to SdDLL::RegisterRemotes().

Also the BluetoothServer was accessing RemoteServer::sCommunicators but
never locked the corresponding RemoteServer::sDataMutex.

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

diff --git a/sd/source/ui/dlg/RemoteDialog.cxx 
b/sd/source/ui/dlg/RemoteDialog.cxx
index 411e4ea621bc..6a66c2acfda2 100644
--- a/sd/source/ui/dlg/RemoteDialog.cxx
+++ b/sd/source/ui/dlg/RemoteDialog.cxx
@@ -31,7 +31,7 @@ IMPL_LINK_NOARG(RemoteDialog, HandleConnectButton, 
weld::Button&, void)
 if (!xEntry)
 return;
 OUString aPin = xEntry->m_xPinBox->get_text();
-if (RemoteServer::connectClient(xEntry->m_xClientInfo, aPin))
+if (IPRemoteServer::connectClient(xEntry->m_xClientInfo, aPin))
 m_xDialog->response(RET_OK);
 #endif
 }
diff --git a/sd/source/ui/dlg/RemoteDialogClientBox.cxx 
b/sd/source/ui/dlg/RemoteDialogClientBox.cxx
index 3d5979c4317d..44e2c6f65064 100644
--- a/sd/source/ui/dlg/RemoteDialogClientBox.cxx
+++ b/sd/source/ui/dlg/RemoteDialogClientBox.cxx
@@ -104,7 +104,7 @@ void ClientBox::populateEntries()
 #ifdef ENABLE_SDREMOTE
 RemoteServer::ensureDiscoverable();
 
-std::vector< std::shared_ptr< ClientInfo > > aClients( 
RemoteServer::getClients() );
+std::vector> const 
aClients(IPRemoteServer::getClients());
 
 for ( const auto& rxClient : aClients )
 {
@@ -117,7 +117,7 @@ void ClientBox::populateEntries()
 IMPL_LINK_NOARG(ClientBoxEntry, DeauthoriseHdl, weld::Button&, void)
 {
 #ifdef ENABLE_SDREMOTE
-RemoteServer::deauthoriseClient(m_xClientInfo);
+IPRemoteServer::deauthoriseClient(m_xClientInfo);
 #endif
 m_pClientBox->populateEntries();
 }
diff --git a/sd/source/ui/inc/RemoteServer.hxx 
b/sd/source/ui/inc/RemoteServer.hxx
index aa42ffb7d03e..70eed9aa8d52 100644
--- a/sd/source/ui/inc/RemoteServer.hxx
+++ b/sd/source/ui/inc/RemoteServer.hxx
@@ -47,23 +47,14 @@ namespace sd
 
 struct ClientInfoInternal;
 
-class RemoteServer final : public salhelper::Thread
+class RemoteServer final
 {
 public:
-// Internal setup
-static void setup();
-
 // For slideshowimpl to inform us.
 static void presentationStarted( const css::uno::Reference<
 css::presentation::XSlideShowController >  );
 static void presentationStopped();
 
-// For the control dialog
-SD_DLLPUBLIC static std::vector< std::shared_ptr< ClientInfo > > 
getClients();
-SD_DLLPUBLIC static bool connectClient( const std::shared_ptr< 
ClientInfo >& pClient,
-std::u16string_view aPin );
-SD_DLLPUBLIC static void deauthoriseClient( const std::shared_ptr< 
ClientInfo >& pClient );
-
 /// ensure that discoverability (eg. for Bluetooth) is enabled
 SD_DLLPUBLIC static void ensureDiscoverable();
 /// restore the state of discoverability from before 
ensureDiscoverable
@@ -71,18 +62,36 @@ namespace sd
 
 // For the communicator
 static void removeCommunicator( Communicator const * pCommunicator 
);
-private:
-RemoteServer();
-virtual ~RemoteServer() override;
-static RemoteServer *spServer;
+//private:
+// these are public because 3 classes and a function need access
 static ::osl::Mutex sDataMutex;
 static ::std::vector sCommunicators;
-osl::AcceptorSocket mSocket;
+};
 
-::std::vector< std::shared_ptr< ClientInfoInternal > > 
mAvailableClients;
+class IPRemoteServer final : public salhelper::Thread
+{
+public:
+// Internal setup
+static void setup();
+
+// For the control dialog
+SD_DLLPUBLIC static std::vector> 
getClients();
+SD_DLLPUBLIC static bool connectClient(const 
std::shared_ptr& pClient,
+   

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

2023-11-20 Thread Andrea Gelmini (via logerrit)
 sd/source/ui/slideshow/slideshowimpl.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a57f2ec591e6081ae32d6e4efb75768321494912
Author: Andrea Gelmini 
AuthorDate: Mon Nov 20 12:49:41 2023 +0100
Commit: Julien Nabet 
CommitDate: Mon Nov 20 13:36:58 2023 +0100

Fix typo

Change-Id: I411a422fbfaf9a798bcec5bccce4138ff8431497
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159739
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 

diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx 
b/sd/source/ui/slideshow/slideshowimpl.cxx
index de62af1ac9e5..531e8b09bcb6 100644
--- a/sd/source/ui/slideshow/slideshowimpl.cxx
+++ b/sd/source/ui/slideshow/slideshowimpl.cxx
@@ -3138,7 +3138,7 @@ void SlideshowImpl::Notify(SfxBroadcaster& /*rBC*/, const 
SfxHint& rHint)
 // Refresh current slide. Need to do that asynchronous, else e.g.
 // text edit changes EditEngine/Outliner are not progressed far
 // enough (ObjectChanged broadcast which we are in here seems
-// to early for some cases)
+// too early for some cases)
 AsyncUpdateSlideshow_Impl::AsyncUpdateSlideshow(this, XCurrentSlide);
 }
 else if (SdrHintKind::PageOrderChange == eHintKind)


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

2023-11-20 Thread Armin Le Grand (allotropia) (via logerrit)
 sd/source/ui/slideshow/slideshowimpl.cxx |  106 +++
 sd/source/ui/slideshow/slideshowimpl.hxx |5 +
 2 files changed, 110 insertions(+), 1 deletion(-)

New commits:
commit 7da04200f9f7ac6ed3e573107282da8428ef65e6
Author: Armin Le Grand (allotropia) 
AuthorDate: Wed Nov 15 15:23:20 2023 +0100
Commit: Armin Le Grand 
CommitDate: Mon Nov 20 11:28:54 2023 +0100

Update SlideShow on DrawModel changes

It may happen that DrawModel changes while a SlideShow is running,
e.g. from EditView/Scripts/UNO API. We can try to suppress these
as we already try with EditView in that mode. As an alternative
it is also possible to react to these changes in the SLideShow
in a useful manner.
This is the 2nd try, main change is to do all of this directly
in SlideShow, so no chechs/tests in common code are needed.

Change-Id: Iaa393d78af1fc40003c83d896508abe31cd790d5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159447
Tested-by: Jenkins
Reviewed-by: Armin Le Grand 

diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx 
b/sd/source/ui/slideshow/slideshowimpl.cxx
index f4f4bfe77019..de62af1ac9e5 100644
--- a/sd/source/ui/slideshow/slideshowimpl.cxx
+++ b/sd/source/ui/slideshow/slideshowimpl.cxx
@@ -61,6 +61,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include "slideshowimpl.hxx"
@@ -545,10 +546,19 @@ SlideshowImpl::SlideshowImpl( const Reference< 
XPresentation2 >& xPresentation,
 mnUserPaintColor = pOptions->GetPresentationPenColor();
 mdUserPaintStrokeWidth = pOptions->GetPresentationPenWidth();
 }
+
+// to be able to react on various changes in the DrawModel, this class
+// is now derived from SfxListener and registers itself at the DrawModel
+if (nullptr != mpDoc)
+StartListening(*mpDoc);
 }
 
 SlideshowImpl::~SlideshowImpl()
 {
+// stop listening to DrawModel (see above)
+if (nullptr != mpDoc)
+EndListening(*mpDoc);
+
 SdModule *pModule = SD_MOD();
 //rhbz#806663 SlideshowImpl can outlive SdModule
 SdOptions* pOptions = pModule ?
@@ -3045,6 +3055,102 @@ sal_Bool SAL_CALL SlideshowImpl::hasElements(  )
 return getSlideCount() != 0;
 }
 
+namespace
+{
+class AsyncUpdateSlideshow_Impl
+{
+public:
+struct AsyncUpdateSlideshowData
+{
+SlideshowImpl* pSlideshowImpl;
+uno::Reference< css::drawing::XDrawPage > XCurrentSlide;
+};
+
+static void AsyncUpdateSlideshow(
+SlideshowImpl* pSlideshowImpl,
+uno::Reference< css::drawing::XDrawPage >& rXCurrentSlide)
+{
+AsyncUpdateSlideshowData* pNew(new AsyncUpdateSlideshowData);
+pNew->pSlideshowImpl = pSlideshowImpl;
+pNew->XCurrentSlide = rXCurrentSlide;
+Application::PostUserEvent(LINK(nullptr, 
AsyncUpdateSlideshow_Impl, Update), pNew);
+// coverity[leaked_storage] - pDisruptor takes care of its own 
destruction at idle time
+}
+
+DECL_STATIC_LINK(AsyncUpdateSlideshow_Impl, Update, void*, void);
+};
+
+IMPL_STATIC_LINK(AsyncUpdateSlideshow_Impl, Update, void*, pData, void)
+{
+AsyncUpdateSlideshowData* 
pSlideData(static_cast(pData));
+pSlideData->pSlideshowImpl->gotoSlide(pSlideData->XCurrentSlide);
+delete pSlideData;
+}
+}
+
+void SlideshowImpl::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint)
+{
+if (SfxHintId::ThisIsAnSdrHint != rHint.GetId())
+// nothing to do for non-SdrHints
+return;
+
+if (nullptr == mpDoc)
+// better do nothing when no DrawModel (should not happen)
+return;
+
+const SdrHintKind eHintKind(static_cast(rHint).GetKind());
+
+if (SdrHintKind::ObjectChange == eHintKind)
+{
+// Object changed, object & involved page included in rHint.
+uno::Reference< css::drawing::XDrawPage > 
XCurrentSlide(getCurrentSlide());
+if (!XCurrentSlide.is())
+return;
+
+SdrPage* pCurrentSlide(GetSdrPageFromXDrawPage(XCurrentSlide));
+if (nullptr == pCurrentSlide)
+return;
+
+const SdrPage* pHintPage(static_cast(rHint).GetPage());
+if (nullptr == pHintPage)
+return;
+
+bool bCurrentSlideIsInvolved(false);
+
+if (pHintPage->IsMasterPage())
+{
+if (pCurrentSlide->TRG_HasMasterPage())
+{
+// current slide uses MasterPage on which the change happened
+bCurrentSlideIsInvolved = (pHintPage == 
>TRG_GetMasterPage());
+}
+}
+else
+{
+// object on current slide was changed
+bCurrentSlideIsInvolved = (pHintPage == pCurrentSlide);
+}
+
+if (!bCurrentSlideIsInvolved)
+// nothing to do when current slide is not involved
+return;
+
+// Refresh current slide. 

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

2023-11-20 Thread Samuel Mehrbrodt (via logerrit)
 sd/source/ui/dlg/tpoption.cxx |2 --
 sd/source/ui/inc/tpoption.hxx |1 -
 2 files changed, 3 deletions(-)

New commits:
commit a09092f20455ea68a22f815a8b086fc4c4c5100d
Author: Samuel Mehrbrodt 
AuthorDate: Mon Nov 20 09:17:29 2023 +0100
Commit: Samuel Mehrbrodt 
CommitDate: Mon Nov 20 10:56:23 2023 +0100

presentationframe is no more

Since 7ca9c5bd2e2e3cda5686b7b8f5b657161eb52cdd

This fixes a crash when navigating to the Draw Options page

Change-Id: Id0d39b7c0b1effe22eae407903b1becfd4ad0da9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159732
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 

diff --git a/sd/source/ui/dlg/tpoption.cxx b/sd/source/ui/dlg/tpoption.cxx
index a028d0e08d58..c7ee0843a42b 100644
--- a/sd/source/ui/dlg/tpoption.cxx
+++ b/sd/source/ui/dlg/tpoption.cxx
@@ -203,7 +203,6 @@ SdTpOptionsMisc::SdTpOptionsMisc(weld::Container* pPage, 
weld::DialogController*
 , m_xCbxMasterPageCache(m_xBuilder->weld_check_button("backgroundback"))
 , m_xCbxCopy(m_xBuilder->weld_check_button("copywhenmove"))
 , m_xCbxMarkedHitMovesAlways(m_xBuilder->weld_check_button("objalwymov"))
-, m_xPresentationFrame(m_xBuilder->weld_frame("presentationframe"))
 , m_xLbMetric(m_xBuilder->weld_combo_box("units"))
 , m_xMtrFldTabstop(m_xBuilder->weld_metric_spin_button("metricFields", 
FieldUnit::MM))
 , m_xCbxCompatibility(m_xBuilder->weld_check_button("cbCompatibility"))
@@ -524,7 +523,6 @@ void SdTpOptionsMisc::SetDrawMode()
 m_xCbxCompatibility->hide();
 m_xNewDocLb->hide();
 m_xCbScale->show();
-m_xPresentationFrame->hide();
 m_xMtrFldInfo1->hide();
 m_xMtrFldInfo2->hide();
 m_xWidthLb->hide();
diff --git a/sd/source/ui/inc/tpoption.hxx b/sd/source/ui/inc/tpoption.hxx
index c974ccda07e6..5ba80c3842ed 100644
--- a/sd/source/ui/inc/tpoption.hxx
+++ b/sd/source/ui/inc/tpoption.hxx
@@ -83,7 +83,6 @@ private:
 std::unique_ptr m_xCbxMasterPageCache;
 std::unique_ptr m_xCbxCopy;
 std::unique_ptr m_xCbxMarkedHitMovesAlways;
-std::unique_ptr m_xPresentationFrame;
 
 std::unique_ptr m_xLbMetric;
 std::unique_ptr m_xMtrFldTabstop;


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

2023-11-17 Thread Michael Stahl (via logerrit)
 sd/source/ui/remotecontrol/Receiver.cxx |   21 +
 1 file changed, 21 insertions(+)

New commits:
commit 8d87164be230e1e0ad5ac51bf645744165a2
Author: Michael Stahl 
AuthorDate: Fri Nov 17 15:22:37 2023 +0100
Commit: Michael Stahl 
CommitDate: Fri Nov 17 19:36:38 2023 +0100

sd: remote: check that received commands have expected arguments

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

diff --git a/sd/source/ui/remotecontrol/Receiver.cxx 
b/sd/source/ui/remotecontrol/Receiver.cxx
index 48d79e437d44..0846f5bbbe94 100644
--- a/sd/source/ui/remotecontrol/Receiver.cxx
+++ b/sd/source/ui/remotecontrol/Receiver.cxx
@@ -77,6 +77,12 @@ void Receiver::executeCommand( const std::vector 
 )
 {
 }
 
+if (aCommand.empty())
+{
+SAL_WARN("sdremote", "Receiver::executeCommand: no command");
+return;
+}
+
 if ( aCommand[0] ==  "transition_next" )
 {
 if ( xSlideShowController.is() )
@@ -89,6 +95,11 @@ void Receiver::executeCommand( const std::vector 
 )
 }
 else if ( aCommand[0] == "goto_slide" )
 {
+if (aCommand.size() < 2)
+{
+SAL_WARN("sdremote", "Receiver::executeCommand: invalid 
goto_slide");
+return;
+}
 // FIXME: if 0 returned, then not a valid number
 sal_Int32 aSlide = aCommand[1].toInt32();
 if ( xSlideShowController.is() &&
@@ -121,6 +132,11 @@ void Receiver::executeCommand( const std::vector 
 )
 }
 else if (aCommand[0] == "pointer_started" )
 {
+if (aCommand.size() < 3)
+{
+SAL_WARN("sdremote", "Receiver::executeCommand: invalid 
pointer_started");
+return;
+}
 // std::cerr << "pointer_started" << std::endl;
 float x = aCommand[1].toFloat();
 float y = aCommand[2].toFloat();
@@ -175,6 +191,11 @@ void Receiver::executeCommand( const std::vector 
 )
 }
 else if (aCommand[0] == "pointer_coordination" )
 {
+if (aCommand.size() < 3)
+{
+SAL_WARN("sdremote", "Receiver::executeCommand: invalid 
pointer_coordination");
+return;
+}
 float x = aCommand[1].toFloat();
 float y = aCommand[2].toFloat();
 


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

2023-11-15 Thread Justin Luth (via logerrit)
 sd/source/ui/inc/DrawViewShell.hxx |5 -
 sd/source/ui/view/drviews4.cxx |   14 --
 sd/source/ui/view/drviews7.cxx |   14 +++---
 3 files changed, 3 insertions(+), 30 deletions(-)

New commits:
commit 023a2de2a8ef4bdcd9877e60f8739366de3a763c
Author: Justin Luth 
AuthorDate: Mon Nov 6 08:57:20 2023 -0500
Commit: Justin Luth 
CommitDate: Wed Nov 15 20:04:16 2023 +0100

tdf#158031 Revert "Resolves: tdf#137445 use the DisableEditHyperlink state

... as of menu launch time"

This code is now obsolete from generic changes for bug 158031,
so revert 7.1 commit eb395e21a7b1f15de664c4b207dc9e130aa635cf.

It was a fine idea, but overly complex, dependent on invalidations,
and hard to re-implement everywhere it would be needed.

Instead, just also check before cursor for a field.

Change-Id: I08354e32fefb66ff051458097d3bd07946198a4f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159014
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/sd/source/ui/inc/DrawViewShell.hxx 
b/sd/source/ui/inc/DrawViewShell.hxx
index d1e9b74af198..3043ba007bf2 100644
--- a/sd/source/ui/inc/DrawViewShell.hxx
+++ b/sd/source/ui/inc/DrawViewShell.hxx
@@ -456,11 +456,6 @@ private:
 VclPtr  maTabControl;
 EditModemeEditMode;
 PageKindmePageKind;
-// tdf#137445 at context menu popup time set if the EditHyperlink entry
-// should be disabled and use that state if queried about it if
-// EditHyperlink is dispatched from the menu. So ignoring where the mouse
-// currently happens to be when the menu was dismissed.
-std::optional moAtContextMenu_DisableEditHyperlink;
 boolmbZoomOnPage;
 boolmbIsRulerDrag;
 sal_uLong   mnLockCount;
diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx
index 986aec295bea..4226f0e4e8d8 100644
--- a/sd/source/ui/view/drviews4.cxx
+++ b/sd/source/ui/view/drviews4.cxx
@@ -804,10 +804,6 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, 
::sd::Window* pWin)
 {
 GetActiveWindow()->ReleaseMouse();
 
-// tdf#137445 at this context menu popup time get what the
-// DisableEditHyperlink would be for this position
-bool bShouldDisableEditHyperlink = ShouldDisableEditHyperlink();
-
 if(rCEvt.IsMouseEvent())
 GetViewFrame()->GetDispatcher()->ExecutePopup( aPopupId );
 else
@@ -839,16 +835,6 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, 
::sd::Window* pWin)
 //open context menu at that point
 GetViewFrame()->GetDispatcher()->ExecutePopup( aPopupId, 
GetActiveWindow(),  );
 }
-
-if (!bShouldDisableEditHyperlink)
-{
-SfxBindings& rBindings = GetViewFrame()->GetBindings();
-// tdf#137445 set what the menu popup state for this was
-moAtContextMenu_DisableEditHyperlink = 
bShouldDisableEditHyperlink;
-// ensure moAtContextMenu_DisableEditHyperlink will be cleared
-// in the case that EditHyperlink is not dispatched by the menu
-rBindings.Invalidate(SID_EDIT_HYPERLINK);
-}
 }
 }
 else
diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx
index 3bace958df28..223493fb29e0 100644
--- a/sd/source/ui/view/drviews7.cxx
+++ b/sd/source/ui/view/drviews7.cxx
@@ -293,7 +293,8 @@ bool DrawViewShell::ShouldDisableEditHyperlink() const
 bool bDisableEditHyperlink = true;
 if( mpDrawView->IsTextEdit() )
 {
-if 
(URLFieldHelper::IsCursorAtURLField(mpDrawView->GetTextEditOutlinerView()))
+if 
(URLFieldHelper::IsCursorAtURLField(mpDrawView->GetTextEditOutlinerView(),
+   /*AlsoCheckBeforeCursor=*/true))
 bDisableEditHyperlink = false;
 }
 else
@@ -1479,16 +1480,7 @@ void DrawViewShell::GetMenuState( SfxItemSet  )
 
 // Menuoption: Edit->Hyperlink
 // Disable, if there is no hyperlink
-bool bDisableEditHyperlink;
-if (!moAtContextMenu_DisableEditHyperlink.has_value())
-bDisableEditHyperlink = ShouldDisableEditHyperlink();
-else
-{
-// tdf#137445 if a popup menu was active, use the state as of when the 
popup was launched and then drop
-// moAtContextMenu_DisableEditHyperlink
-bDisableEditHyperlink = *moAtContextMenu_DisableEditHyperlink;
-moAtContextMenu_DisableEditHyperlink.reset();
-}
+bool bDisableEditHyperlink = ShouldDisableEditHyperlink();
 
 //highlight selected custom shape
 {


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

2023-11-14 Thread Caolán McNamara (via logerrit)
 sd/source/ui/inc/optsitem.hxx |6 --
 1 file changed, 6 deletions(-)

New commits:
commit 550e8b278082c39d61ec5a4efbf0fbca145614ab
Author: Caolán McNamara 
AuthorDate: Tue Nov 14 11:16:01 2023 +
Commit: Caolán McNamara 
CommitDate: Tue Nov 14 13:11:56 2023 +0100

cid#1550047 Uninitialized scalar field

left overs since:

commit 7ca9c5bd2e2e3cda5686b7b8f5b657161eb52cdd
Date:   Thu Nov 2 15:49:49 2023 +0100

Move "Enable Impress Remote" setting to presentation settings

commit e0334e1a77ec080b38952ea64b394c8652af851c
Date:   Thu Nov 2 13:43:38 2023 +0100

tdf#157788 Move "Show navigation panel" back to Presentation settings

Change-Id: I8e33930a8c44b9de6ccf7424a169628008556acb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159408
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sd/source/ui/inc/optsitem.hxx b/sd/source/ui/inc/optsitem.hxx
index e406f2692e60..9ec3d4a1b58b 100644
--- a/sd/source/ui/inc/optsitem.hxx
+++ b/sd/source/ui/inc/optsitem.hxx
@@ -195,8 +195,6 @@ private:
 boolbPickThrough: 1;// Misc/TextObject/Selectable
 boolbDoubleClickTextEdit: 1;// Misc/DclickTextedit
 boolbClickChangeRotation: 1;// Misc/RotateClick
-boolbEnableSdremote : 1;// Misc/Start/EnableSdremote
-boolbPresenterScreenFullScreen  : 1;// 
Misc/Start/PresenterScreenFullScreen
 boolbSolidDragging  : 1;// Misc/ModifyWithAttributes
 boolbSummationOfParagraphs  : 1;// misc/SummationOfParagraphs
 boolbTabBarVisible  : 1;// Misc/TabBarVisible
@@ -247,8 +245,6 @@ public:
 boolIsPickThrough() const { Init(); return bPickThrough; }
 boolIsDoubleClickTextEdit() const { Init(); return 
bDoubleClickTextEdit; }
 boolIsClickChangeRotation() const { Init(); return 
bClickChangeRotation; }
-boolIsEnableSdremote() const { Init(); return bEnableSdremote; }
-boolIsPresenterScreenFullScreen() const { Init(); return 
bPresenterScreenFullScreen; }
 boolIsSolidDragging() const { Init(); return bSolidDragging; }
 boolIsSummationOfParagraphs() const { Init(); return 
bSummationOfParagraphs; };
 boolIsTabBarVisible() const { Init(); return bTabBarVisible; };
@@ -290,8 +286,6 @@ public:
 voidSetPickThrough( bool bOn ) { if( bPickThrough != bOn ) { 
OptionsChanged(); bPickThrough = bOn; } }
 voidSetDoubleClickTextEdit( bool bOn ) { if( bDoubleClickTextEdit != 
bOn ) { OptionsChanged(); bDoubleClickTextEdit = bOn; } }
 voidSetClickChangeRotation( bool bOn ) { if( bClickChangeRotation != 
bOn ) { OptionsChanged(); bClickChangeRotation = bOn; } }
-voidSetEnableSdremote( bool bOn ) { if( bEnableSdremote != bOn ) { 
OptionsChanged(); bEnableSdremote = bOn; } }
-voidSetPresenterScreenFullScreen( bool bOn ) { if ( 
bPresenterScreenFullScreen != bOn) { OptionsChanged(); 
bPresenterScreenFullScreen = bOn; } }
 voidSetSummationOfParagraphs( bool bOn ){ if ( bOn != 
bSummationOfParagraphs ) { OptionsChanged(); bSummationOfParagraphs = bOn; } }
 voidSetTabBarVisible( bool bOn ){ if ( bOn != bTabBarVisible ) { 
OptionsChanged(); bTabBarVisible = bOn; } }
 /** Set the printer independent layout mode.


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

2023-11-13 Thread Oliver Specht (via logerrit)
 sd/source/ui/view/sdview3.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 5ed0646dffab1563337ef4c1ae34a4ebfa69bdbe
Author: Oliver Specht 
AuthorDate: Mon Nov 13 11:01:39 2023 +0100
Commit: Thorsten Behrens 
CommitDate: Mon Nov 13 13:17:01 2023 +0100

tdf#157363 remove pre text when pasting simple HTML

appends to https://gerrit.libreoffice.org/c/core/+/158659
handling of pre text didn't make it into sd code

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

diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx
index 3288fed35114..3656f6481242 100644
--- a/sd/source/ui/view/sdview3.cxx
+++ b/sd/source/ui/view/sdview3.cxx
@@ -29,6 +29,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1502,6 +1503,7 @@ bool View::InsertData( const TransferableDataHelper& 
rDataHelper,
 xStm->Seek(0);
 
 OutlinerView* pOLV = GetTextEditOutlinerView();
+MSE40HTMLClipFormatObj aMSE40HTMLClipFormatObj;
 
 if (pOLV)
 {
@@ -1511,7 +1513,8 @@ bool View::InsertData( const TransferableDataHelper& 
rDataHelper,
 if (aRect.Contains(aPos) || (!bDrag && IsTextEdit()))
 {
 // mba: clipboard always must contain absolute URLs 
(could be from alien source)
-pOLV->Read(*xStm, EETextFormat::Html, 
mpDocSh->GetHeaderAttributes());
+SvStream* pHtmlStream = 
aMSE40HTMLClipFormatObj.IsValid(*xStm);
+pOLV->Read(*pHtmlStream, EETextFormat::Html, 
mpDocSh->GetHeaderAttributes());
 bReturn = true;
 }
 }


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

2023-11-10 Thread Andrea Gelmini (via logerrit)
 sd/source/ui/annotations/annotationmanager.cxx |4 ++--
 sd/source/ui/unoidl/unopage.cxx|2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 53a48cce9f02232d595539e016f2bf3ad66ce7e3
Author: Andrea Gelmini 
AuthorDate: Thu Nov 9 08:55:14 2023 +0100
Commit: Julien Nabet 
CommitDate: Fri Nov 10 11:39:27 2023 +0100

Fix typo

Change-Id: I6e0bd6560f3dbc289da3e3e7ae65514600a4ac58
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159202
Reviewed-by: Julien Nabet 
Tested-by: Jenkins

diff --git a/sd/source/ui/annotations/annotationmanager.cxx 
b/sd/source/ui/annotations/annotationmanager.cxx
index 339aefa7c576..dbd9768b554c 100644
--- a/sd/source/ui/annotations/annotationmanager.cxx
+++ b/sd/source/ui/annotations/annotationmanager.cxx
@@ -366,7 +366,7 @@ void 
AnnotationManagerImpl::ExecuteDeleteAnnotation(SfxRequest const & rReq)
 if (static_cast(pPoolItem)->GetValue() >>= xTmpAnnotation)
 {
 xAnnotation = 
dynamic_cast(xTmpAnnotation.get());
-assert(bool(xAnnotation) == bool(xTmpAnnotation) && 
"must be of concrete type sd::Annoation");
+assert(bool(xAnnotation) == bool(xTmpAnnotation) && 
"must be of concrete type sd::Annotation");
 }
 }
 if( SfxItemState::SET == pArgs->GetItemState( 
SID_ATTR_POSTIT_ID, true,  ) )
@@ -555,7 +555,7 @@ void AnnotationManagerImpl::ExecuteReplyToAnnotation( 
SfxRequest const & rReq )
 if (static_cast(pPoolItem)->GetValue() >>= 
xTmpAnnotation)
 {
 xAnnotation = dynamic_cast(xTmpAnnotation.get());
-assert(bool(xAnnotation) == bool(xTmpAnnotation) && "must be 
of concrete type sd::Annoation");
+assert(bool(xAnnotation) == bool(xTmpAnnotation) && "must be 
of concrete type sd::Annotation");
 }
 }
 
diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx
index 6676eac3d1b7..1462e08e369e 100644
--- a/sd/source/ui/unoidl/unopage.cxx
+++ b/sd/source/ui/unoidl/unopage.cxx
@@ -2532,7 +2532,7 @@ Reference< XAnnotation > SAL_CALL 
SdGenericDrawPage::createAndInsertAnnotation()
 void SAL_CALL SdGenericDrawPage::removeAnnotation(const Reference< XAnnotation 
> & annotation)
 {
 rtl::Reference xSdAnnotation = 
dynamic_cast(annotation.get());
-assert(bool(annotation) == bool(xSdAnnotation) && "must be of concrete 
type sd::Annoation");
+assert(bool(annotation) == bool(xSdAnnotation) && "must be of concrete 
type sd::Annotation");
 GetPage()->removeAnnotation(xSdAnnotation);
 }
 


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

2023-11-08 Thread Noel Grandin (via logerrit)
 sd/source/ui/accessibility/AccessibleOutlineView.cxx |4 ++--
 sd/source/ui/docshell/docshell.cxx   |1 +
 sd/source/ui/func/fubullet.cxx   |2 +-
 sd/source/ui/inc/OutlineView.hxx |4 ++--
 sd/source/ui/view/drtxtob.cxx|2 +-
 sd/source/ui/view/outlnvs2.cxx   |1 +
 sd/source/ui/view/outlnvsh.cxx   |1 +
 sd/source/ui/view/outlview.cxx   |8 
 sd/source/ui/view/viewshel.cxx   |1 +
 9 files changed, 14 insertions(+), 10 deletions(-)

New commits:
commit f843c4b57f82b282cadc8eca2d80ed15d15993eb
Author: Noel Grandin 
AuthorDate: Wed Nov 8 10:52:58 2023 +0200
Commit: Noel Grandin 
CommitDate: Thu Nov 9 06:24:07 2023 +0100

loplugin:fieldcast in sd::OutlineView

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

diff --git a/sd/source/ui/accessibility/AccessibleOutlineView.cxx 
b/sd/source/ui/accessibility/AccessibleOutlineView.cxx
index 6f5ef764f12e..9d2e82c1b12a 100644
--- a/sd/source/ui/accessibility/AccessibleOutlineView.cxx
+++ b/sd/source/ui/accessibility/AccessibleOutlineView.cxx
@@ -31,7 +31,7 @@
 #include 
 #include 
 #include 
-
+#include 
 #include 
 
 using namespace ::com::sun::star;
@@ -63,7 +63,7 @@ AccessibleOutlineView::AccessibleOutlineView (
 return;
 
 OutlinerView* pOutlineView = pShellView->GetViewByWindow( pSdWindow );
-SdrOutliner& rOutliner = pShellView->GetOutliner();
+SdOutliner& rOutliner = pShellView->GetOutliner();
 
 if( pOutlineView )
 {
diff --git a/sd/source/ui/docshell/docshell.cxx 
b/sd/source/ui/docshell/docshell.cxx
index 705e293974b2..5ac592f80be3 100644
--- a/sd/source/ui/docshell/docshell.cxx
+++ b/sd/source/ui/docshell/docshell.cxx
@@ -62,6 +62,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace sd;
 #define ShellClass_DrawDocShell
diff --git a/sd/source/ui/func/fubullet.cxx b/sd/source/ui/func/fubullet.cxx
index 843215c24660..f37770e587d4 100644
--- a/sd/source/ui/func/fubullet.cxx
+++ b/sd/source/ui/func/fubullet.cxx
@@ -37,7 +37,7 @@
 #include 
 #include 
 #include 
-
+#include 
 #include 
 #include 
 
diff --git a/sd/source/ui/inc/OutlineView.hxx b/sd/source/ui/inc/OutlineView.hxx
index 06561a6e051e..43dadf038664 100644
--- a/sd/source/ui/inc/OutlineView.hxx
+++ b/sd/source/ui/inc/OutlineView.hxx
@@ -79,7 +79,7 @@ public:
 virtual void DeleteDeviceFromPaintView(OutputDevice& rDev) override;
 
 OutlinerView*   GetViewByWindow(vcl::Window const * pWin) const;
-SdrOutliner&GetOutliner() { return mrOutliner; }
+SdOutliner& GetOutliner() { return mrOutliner; }
 
 Paragraph*  GetPrevTitle(const Paragraph* pPara);
 Paragraph*  GetNextTitle(const Paragraph* pPara);
@@ -166,7 +166,7 @@ private:
 void UpdateDocument();
 
 OutlineViewShell&   mrOutlineViewShell;
-SdrOutliner&mrOutliner;
+SdOutliner& mrOutliner;
 std::unique_ptr mpOutlinerViews[MAX_OUTLINERVIEWS];
 
 std::vector maOldParaOrder;
diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx
index 94864cb56cb9..db2161c247f9 100644
--- a/sd/source/ui/view/drtxtob.cxx
+++ b/sd/source/ui/view/drtxtob.cxx
@@ -56,7 +56,7 @@
 #include 
 #include 
 #include 
-
+#include 
 
 #define ShellClass_TextObjectBar
 using namespace sd;
diff --git a/sd/source/ui/view/outlnvs2.cxx b/sd/source/ui/view/outlnvs2.cxx
index 2a890cec1b41..003a4c1f927a 100644
--- a/sd/source/ui/view/outlnvs2.cxx
+++ b/sd/source/ui/view/outlnvs2.cxx
@@ -18,6 +18,7 @@
  */
 
 #include 
+#include 
 
 #include 
 #include 
diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx
index 8bb39efc4bb0..71de36c10206 100644
--- a/sd/source/ui/view/outlnvsh.cxx
+++ b/sd/source/ui/view/outlnvsh.cxx
@@ -18,6 +18,7 @@
  */
 
 #include 
+#include 
 
 #include 
 #include 
diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx
index ab994e235813..2f68a6f8d9d2 100644
--- a/sd/source/ui/view/outlview.cxx
+++ b/sd/source/ui/view/outlview.cxx
@@ -1200,7 +1200,7 @@ Paragraph* OutlineView::GetParagraphForPage( ::Outliner 
const & rOutl, SdPage co
 /** selects the paragraph for the given page at the outliner view*/
 void OutlineView::SetActualPage( SdPage const * pActual )
 {
-if( pActual && 
dynamic_cast(mrOutliner).GetIgnoreCurrentPageChangesLevel()==0 && 
!mbFirstPaint)
+if( pActual && mrOutliner.GetIgnoreCurrentPageChangesLevel()==0 && 
!mbFirstPaint)
 {
 // if we found a paragraph, select its text at the outliner view
 Paragraph* pPara = GetParagraphForPage( mrOutliner, pActual );
@@ -1364,7 +1364,7 @@ IMPL_LINK(OutlineView, EventMultiplexerListener, 
::sd::tools::EventMultiplexerEv
 break;
 
 case 

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

2023-11-06 Thread Samuel Mehrbrodt (via logerrit)
 sd/source/ui/app/optsitem.cxx|   18 ++
 sd/source/ui/dlg/present.cxx |4 
 sd/source/ui/dlg/tpoption.cxx|   10 ++
 sd/source/ui/inc/optsitem.hxx|7 ---
 sd/source/ui/inc/present.hxx |2 ++
 sd/source/ui/inc/tpoption.hxx|2 --
 sd/source/ui/slideshow/slideshowimpl.cxx |4 ++--
 sd/uiconfig/simpress/ui/optimpressgeneralpage.ui |   21 +
 sd/uiconfig/simpress/ui/presentationdialog.ui|   13 -
 9 files changed, 25 insertions(+), 56 deletions(-)

New commits:
commit e0334e1a77ec080b38952ea64b394c8652af851c
Author: Samuel Mehrbrodt 
AuthorDate: Thu Nov 2 13:43:38 2023 +0100
Commit: Samuel Mehrbrodt 
CommitDate: Mon Nov 6 09:43:28 2023 +0100

tdf#157788 Move "Show navigation panel" back to Presentation settings

Instead of hiding it in the general options dialog.

As written in https://bugs.documentfoundation.org/show_bug.cgi?id=157788#c4
"The options in Slide Show Settings should all apply to the workstation";
the options which are saved per user/workstation and not per document, 
should not be moved
away from that dialog.
Instead the other options should also be saved per user/workstation.

Change-Id: I720c949f08877abb8ef8f94dbcfa6c85f349631d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158808
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 

diff --git a/sd/source/ui/app/optsitem.cxx b/sd/source/ui/app/optsitem.cxx
index e02618ca8f18..74e410383c00 100644
--- a/sd/source/ui/app/optsitem.cxx
+++ b/sd/source/ui/app/optsitem.cxx
@@ -418,7 +418,6 @@ SdOptionsMisc::SdOptionsMisc( bool bImpress, bool 
bUseConfig ) :
 bPreviewNewEffects( true ),
 bPreviewChangedEffects( false ),
 bPreviewTransitions( true ),
-bShowNavigationPanel( false ),
 mnDisplay( 0 ),
 mnPenColor( 0xff ),
 mnPenWidth( 150.0 ),
@@ -460,9 +459,7 @@ bool SdOptionsMisc::operator==( const SdOptionsMisc& rOpt ) 
const
 IsShowComments() == rOpt.IsShowComments() &&
 GetPresentationPenColor() == rOpt.GetPresentationPenColor() &&
 GetPresentationPenWidth() == rOpt.GetPresentationPenWidth() &&
-GetDragThresholdPixels() == rOpt.GetDragThresholdPixels() &&
-
-IsShowNavigationPanel() == rOpt.IsShowNavigationPanel()
+GetDragThresholdPixels() == rOpt.GetDragThresholdPixels()
 );
 }
 
@@ -503,8 +500,7 @@ void SdOptionsMisc::GetPropNameArray( const char**& 
ppNames, sal_uLong& rCount )
 "PenColor",
 "PenWidth",
 "Start/EnableSdremote",
-"TabBarVisible",
-"Start/ShowNavigationPanel"
+"TabBarVisible"
 };
 
 rCount = ( IsImpress() ? SAL_N_ELEMENTS(aPropNames) : 16 );
@@ -568,9 +564,6 @@ bool SdOptionsMisc::ReadData( const Any* pValues )
 if( pValues[26].hasValue() ) {
 SetTabBarVisible( *o3tl::doAccess(pValues[ 26 ]) );
 }
-if( pValues[27].hasValue() )
-SetShowNavigationPanel( *o3tl::doAccess(pValues[ 27 ]) );
-
 }
 
 return true;
@@ -613,9 +606,6 @@ bool SdOptionsMisc::WriteData( Any* pValues ) const
 pValues[ 24 ] <<= GetPresentationPenWidth();
 pValues[ 25 ] <<= IsEnableSdremote();
 pValues[ 26 ] <<= IsTabBarVisible();
-
-pValues[ 27 ] <<= IsShowNavigationPanel();
-
 }
 
 return true;
@@ -657,8 +647,6 @@ SdOptionsMiscItem::SdOptionsMiscItem( SdOptions const * 
pOpts, ::sd::FrameView c
 
 maOptionsMisc.SetPresentationPenColor(pOpts->GetPresentationPenColor() 
);
 maOptionsMisc.SetPresentationPenWidth(pOpts->GetPresentationPenWidth() 
);
-
-maOptionsMisc.SetShowNavigationPanel( pOpts->IsShowNavigationPanel() );
 }
 
 if( pView )
@@ -741,8 +729,6 @@ void SdOptionsMiscItem::SetOptions( SdOptions* pOpts ) const
 pOpts->SetPresentationPenWidth( maOptionsMisc.GetPresentationPenWidth() );
 
 pOpts->SetDragThreshold( maOptionsMisc.GetDragThresholdPixels() );
-
-pOpts->SetShowNavigationPanel( maOptionsMisc.IsShowNavigationPanel() );
 }
 
 /*
diff --git a/sd/source/ui/dlg/present.cxx b/sd/source/ui/dlg/present.cxx
index 6eaedbfae48b..34b0befd2a7f 100644
--- a/sd/source/ui/dlg/present.cxx
+++ b/sd/source/ui/dlg/present.cxx
@@ -65,6 +65,7 @@ SdStartPresentationDlg::SdStartPresentationDlg(weld::Window* 
pWindow, const SfxI
 , 
m_xCbxAnimationAllowed(m_xBuilder->weld_check_button("animationsallowed"))
 , m_xCbxChangePage(m_xBuilder->weld_check_button("changeslidesbyclick"))
 , m_xCbxAlwaysOnTop(m_xBuilder->weld_check_button("alwaysontop"))
+, 
m_xCbxShowNavigationButton(m_xBuilder->weld_check_button("shownavigationbutton"))
 , m_xLbConsole(m_xBuilder->weld_combo_box("console_cb"))
 , 

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

2023-11-06 Thread Samuel Mehrbrodt (via logerrit)
 sd/source/ui/app/optsitem.cxx|   30 +++-
 sd/source/ui/dlg/present.cxx |   39 +
 sd/source/ui/dlg/tpoption.cxx|   15 
 sd/source/ui/inc/optsitem.hxx|3 -
 sd/source/ui/inc/present.hxx |3 +
 sd/source/ui/inc/tpoption.hxx|2 -
 sd/uiconfig/simpress/ui/optimpressgeneralpage.ui |   42 +--
 sd/uiconfig/simpress/ui/presentationdialog.ui|   34 ++
 8 files changed, 84 insertions(+), 84 deletions(-)

New commits:
commit 496f324b8f038d81fe7a14eb424680e9acab1a3c
Author: Samuel Mehrbrodt 
AuthorDate: Thu Nov 2 12:35:16 2023 +0100
Commit: Samuel Mehrbrodt 
CommitDate: Mon Nov 6 09:43:04 2023 +0100

tdf#135089 Move Presenter console settings to Slide Show settings

Change-Id: I0aeb180ee132bff359d46d963985196f5a24610f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158798
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 

diff --git a/sd/source/ui/app/optsitem.cxx b/sd/source/ui/app/optsitem.cxx
index 0492be483658..e02618ca8f18 100644
--- a/sd/source/ui/app/optsitem.cxx
+++ b/sd/source/ui/app/optsitem.cxx
@@ -409,8 +409,6 @@ SdOptionsMisc::SdOptionsMisc( bool bImpress, bool 
bUseConfig ) :
 bDoubleClickTextEdit( true ),
 bClickChangeRotation( false ),
 bEnableSdremote( false ),
-bEnablePresenterScreen( true ),
-bPresenterScreenFullScreen( true ),
 bSolidDragging( true ),
 bSummationOfParagraphs( false ),
 bTabBarVisible( true ),
@@ -446,8 +444,6 @@ bool SdOptionsMisc::operator==( const SdOptionsMisc& rOpt ) 
const
 IsDoubleClickTextEdit() == rOpt.IsDoubleClickTextEdit() &&
 IsClickChangeRotation() == rOpt.IsClickChangeRotation() &&
 IsEnableSdremote() == rOpt.IsEnableSdremote() &&
-IsEnablePresenterScreen() == rOpt.IsEnablePresenterScreen() &&
-IsPresenterScreenFullScreen() == 
rOpt.IsPresenterScreenFullScreen() &&
 IsSummationOfParagraphs() == rOpt.IsSummationOfParagraphs() &&
 IsTabBarVisible() == rOpt.IsTabBarVisible() &&
 IsSolidDragging() == rOpt.IsSolidDragging() &&
@@ -507,8 +503,6 @@ void SdOptionsMisc::GetPropNameArray( const char**& 
ppNames, sal_uLong& rCount )
 "PenColor",
 "PenWidth",
 "Start/EnableSdremote",
-"Start/EnablePresenterScreen",
-"Start/PresenterScreenFullScreen",
 "TabBarVisible",
 "Start/ShowNavigationPanel"
 };
@@ -571,17 +565,11 @@ bool SdOptionsMisc::ReadData( const Any* pValues )
 if( pValues[25].hasValue() )
 SetEnableSdremote( *o3tl::doAccess(pValues[ 25 ]) );
 
-if( pValues[26].hasValue() )
-SetEnablePresenterScreen( *o3tl::doAccess(pValues[ 26 ]) );
-
-if (pValues[27].hasValue() )
-SetPresenterScreenFullScreen( *o3tl::doAccess(pValues[ 27 ]) 
);
-
-if( pValues[28].hasValue() ) {
-SetTabBarVisible( *o3tl::doAccess(pValues[ 28 ]) );
+if( pValues[26].hasValue() ) {
+SetTabBarVisible( *o3tl::doAccess(pValues[ 26 ]) );
 }
-if( pValues[29].hasValue() )
-SetShowNavigationPanel( *o3tl::doAccess(pValues[ 29 ]) );
+if( pValues[27].hasValue() )
+SetShowNavigationPanel( *o3tl::doAccess(pValues[ 27 ]) );
 
 }
 
@@ -624,11 +612,9 @@ bool SdOptionsMisc::WriteData( Any* pValues ) const
 pValues[ 23 ] <<= GetPresentationPenColor();
 pValues[ 24 ] <<= GetPresentationPenWidth();
 pValues[ 25 ] <<= IsEnableSdremote();
-pValues[ 26 ] <<= IsEnablePresenterScreen();
-pValues[ 27 ] <<= IsPresenterScreenFullScreen();
-pValues[ 28 ] <<= IsTabBarVisible();
+pValues[ 26 ] <<= IsTabBarVisible();
 
-pValues[ 29 ] <<= IsShowNavigationPanel();
+pValues[ 27 ] <<= IsShowNavigationPanel();
 
 }
 
@@ -655,8 +641,6 @@ SdOptionsMiscItem::SdOptionsMiscItem( SdOptions const * 
pOpts, ::sd::FrameView c
 {
 maOptionsMisc.SetStartWithTemplate( pOpts->IsStartWithTemplate() );
 maOptionsMisc.SetEnableSdremote( pOpts->IsEnableSdremote() );
-maOptionsMisc.SetEnablePresenterScreen( 
pOpts->IsEnablePresenterScreen() );
-maOptionsMisc.SetPresenterScreenFullScreen( 
pOpts->IsPresenterScreenFullScreen() );
 maOptionsMisc.SetSummationOfParagraphs( 
pOpts->IsSummationOfParagraphs() );
 maOptionsMisc.SetTabBarVisible( pOpts->IsTabBarVisible() );
 maOptionsMisc.SetShowUndoDeleteWarning( 
pOpts->IsShowUndoDeleteWarning() );
@@ -737,8 +721,6 @@ void SdOptionsMiscItem::SetOptions( SdOptions* pOpts ) const
 pOpts->SetDoubleClickTextEdit( maOptionsMisc.IsDoubleClickTextEdit() );
 pOpts->SetClickChangeRotation( maOptionsMisc.IsClickChangeRotation() );
 pOpts->SetEnableSdremote( maOptionsMisc.IsEnableSdremote() );
-

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

2023-11-01 Thread Justin Luth (via logerrit)
 sd/source/ui/view/drviewse.cxx |   37 -
 1 file changed, 24 insertions(+), 13 deletions(-)

New commits:
commit c1c1fb5e1d6055459a8b393114ecfbc31f822d45
Author: Justin Luth 
AuthorDate: Wed Nov 1 11:27:51 2023 -0400
Commit: Justin Luth 
CommitDate: Wed Nov 1 19:14:14 2023 +0100

tdf#112131 sd: check if SdrObjKind::UNO accepts hyperlink props

This fixes a form control's hyperlink being set by Insert - Hyperlink.

Calc and Writer do something similar - checking for ButtonType.

Change-Id: Ia36b216c8f749bc2a5dfba448a4771d9d7d50256
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158765
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx
index 5c74a0f50b10..3f0a5792dc5f 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -1547,30 +1547,41 @@ void DrawViewShell::InsertURLButton(const OUString& 
rURL, const OUString& rText,
 if( pMarkedObj ) try
 {
 // change first marked object
-if( SdrInventor::FmForm == pMarkedObj->GetObjInventor() && 
pMarkedObj->GetObjIdentifier() == SdrObjKind::FormButton )
+if (SdrInventor::FmForm == pMarkedObj->GetObjInventor())
 {
-bNewObj = false;
-
 SdrUnoObj* pUnoCtrl = static_cast< SdrUnoObj* >( pMarkedObj );
 
 Reference< awt::XControlModel > xControlModel( 
pUnoCtrl->GetUnoControlModel(), UNO_SET_THROW );
 Reference< beans::XPropertySet > xPropSet( xControlModel, 
UNO_QUERY_THROW );
 
-xPropSet->setPropertyValue("Label" , Any( rText ) );
-xPropSet->setPropertyValue("TargetURL" , Any( sTargetURL ) );
+bool bIsButton = pMarkedObj->GetObjIdentifier() == 
SdrObjKind::FormButton;
+if (!bIsButton && pMarkedObj->GetObjIdentifier() == 
SdrObjKind::UNO)
+{
+const Reference 
xInfo(xPropSet->getPropertySetInfo());
+bIsButton = xInfo.is() && 
xInfo->hasPropertyByName("ButtonType")
+&& xInfo->hasPropertyByName("Label")
+&& xInfo->hasPropertyByName("TargetURL");
+}
+if (bIsButton)
+{
+bNewObj = false;
+
+xPropSet->setPropertyValue("Label", Any(rText));
+xPropSet->setPropertyValue("TargetURL", Any(sTargetURL));
 
-if( !rTarget.isEmpty() )
-xPropSet->setPropertyValue("TargetFrame" , Any( rTarget ) 
);
+if (!rTarget.isEmpty())
+xPropSet->setPropertyValue("TargetFrame", 
Any(rTarget));
 
-xPropSet->setPropertyValue( "ButtonType" , Any( 
form::FormButtonType_URL ) );
+xPropSet->setPropertyValue("ButtonType", 
Any(form::FormButtonType_URL));
 #if HAVE_FEATURE_AVMEDIA
-if ( ::avmedia::MediaWindow::isMediaURL( rURL, ""/*TODO?*/ ) )
-{
-xPropSet->setPropertyValue( "DispatchURLInternal" , Any( 
true ) );
-}
+if (::avmedia::MediaWindow::isMediaURL(rURL, ""/*TODO?*/))
+{
+xPropSet->setPropertyValue("DispatchURLInternal", 
Any(true));
+}
 #endif
+}
 }
-else
+if (bNewObj)
 {
 // add url as interaction for first selected shape
 bNewObj = false;


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

2023-11-01 Thread Noel Grandin (via logerrit)
 sd/source/ui/view/drviewsa.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 5d7d7eb55a3833ff12c61b1a03a296bb0bf4e640
Author: Noel Grandin 
AuthorDate: Wed Nov 1 10:20:56 2023 +0200
Commit: Noel Grandin 
CommitDate: Wed Nov 1 10:42:20 2023 +0100

reduce log noise

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

diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx
index 9bc5c0030f76..5d5cfe613245 100644
--- a/sd/source/ui/view/drviewsa.cxx
+++ b/sd/source/ui/view/drviewsa.cxx
@@ -344,6 +344,10 @@ void DrawViewShell::Construct(DrawDocShell* pDocSh, 
PageKind eInitialPageKind)
 
 mxScannerListener = new ScannerEventListener( this );
 }
+catch (DeploymentException const &)
+{
+SAL_INFO("sd", "Scanner manager not available");
+}
 catch (Exception const &)
 {
 // Eat the exception and log it


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

2023-10-23 Thread Andreas Heinisch (via logerrit)
 sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit ea574f7929d4c226d56273178779ef38ca2ce5c9
Author: Andreas Heinisch 
AuthorDate: Fri Oct 6 09:27:10 2023 +0200
Commit: Andreas Heinisch 
CommitDate: Mon Oct 23 18:44:30 2023 +0200

tdf#111737 - Add new (master) page depending on the edit mode

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

diff --git a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx 
b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx
index f8376ec409fd..1af2abcabfc7 100644
--- a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx
@@ -377,8 +377,11 @@ bool SelectionFunction::KeyInput (const KeyEvent& rEvent)
 }
 else if (pViewShell->GetDispatcher() != nullptr)
 {
+// tdf#111737 - add new (master) page depending on the 
edit mode
 pViewShell->GetDispatcher()->Execute(
-SID_INSERTPAGE,
+mrSlideSorter.GetModel().GetEditMode() == 
EditMode::Page
+? SID_INSERTPAGE
+: SID_INSERT_MASTER_PAGE,
 SfxCallMode::ASYNCHRON | SfxCallMode::RECORD);
 }
 bResult = true;


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

2023-10-22 Thread Caolán McNamara (via logerrit)
 sd/source/ui/sidebar/LayoutMenu.cxx |   14 --
 1 file changed, 8 insertions(+), 6 deletions(-)

New commits:
commit 1eda97c39237f0244faccb220b3bdd692340e013
Author: Caolán McNamara 
AuthorDate: Sun Oct 22 11:10:33 2023 +0100
Commit: Caolán McNamara 
CommitDate: Sun Oct 22 13:17:37 2023 +0200

cid#1548028 silence Explicit null dereferenced

Change-Id: I9f20b9b6febd94e85095dc018908cfa5011741d5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158326
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sd/source/ui/sidebar/LayoutMenu.cxx 
b/sd/source/ui/sidebar/LayoutMenu.cxx
index 9022609df7d7..b32cd8f358d8 100644
--- a/sd/source/ui/sidebar/LayoutMenu.cxx
+++ b/sd/source/ui/sidebar/LayoutMenu.cxx
@@ -529,21 +529,23 @@ void LayoutMenu::Fill()
 }
 
 Clear();
-for (size_t i = 0; i < pInfo.size(); i++)
+sal_uInt16 id = 1;
+for (const auto& elem : pInfo)
 {
-if ((WritingMode_TB_RL != pInfo[i].meWritingMode) || bVertical)
+if ((WritingMode_TB_RL != elem.meWritingMode) || bVertical)
 {
-Image aImg(OUString::Concat("private:graphicrepository/") + 
pInfo[i].msBmpResId);
+Image aImg(OUString::Concat("private:graphicrepository/") + 
elem.msBmpResId);
 
-if (bRightToLeft && (WritingMode_TB_RL != pInfo[i].meWritingMode))
+if (bRightToLeft && (WritingMode_TB_RL != elem.meWritingMode))
 { // FIXME: avoid interpolating RTL layouts.
 BitmapEx aRTL = aImg.GetBitmapEx();
 aRTL.Mirror(BmpMirrorFlags::Horizontal);
 aImg = Image(aRTL);
 }
 
-mxLayoutValueSet->InsertItem(i + 1, aImg, 
SdResId(pInfo[i].mpStrResId));
-mxLayoutValueSet->SetItemData(i + 1, new 
AutoLayout(pInfo[i].maAutoLayout));
+mxLayoutValueSet->InsertItem(id, aImg, SdResId(elem.mpStrResId));
+mxLayoutValueSet->SetItemData(id, new 
AutoLayout(elem.maAutoLayout));
+++id;
 }
 }
 }


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

2023-10-20 Thread Noel Grandin (via logerrit)
 sd/source/ui/accessibility/AccessibleSlideSorterView.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 25286bc04142741b7731dae50891c1dde47b78c4
Author: Noel Grandin 
AuthorDate: Fri Oct 20 11:00:25 2023 +0200
Commit: Noel Grandin 
CommitDate: Fri Oct 20 12:40:47 2023 +0200

set accessible IndexHint in sd

to avoid some more spurious SAL_WARN

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

diff --git a/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx 
b/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx
index 4c197a71279a..7ab8b0d03360 100644
--- a/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx
+++ b/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx
@@ -143,6 +143,7 @@ void AccessibleSlideSorterView::FireAccessibleEvent (
 aEventObject.EventId = nEventId;
 aEventObject.NewValue = rNewValue;
 aEventObject.OldValue = rOldValue;
+aEventObject.IndexHint = -1;
 
 comphelper::AccessibleEventNotifier::addEvent (mnClientId, 
aEventObject);
 }


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

2023-10-19 Thread Mike Kaganski (via logerrit)
 sd/source/ui/sidebar/LayoutMenu.cxx |   23 +++
 1 file changed, 7 insertions(+), 16 deletions(-)

New commits:
commit 29691361002154a34c3a617e75682af4cbc19048
Author: Mike Kaganski 
AuthorDate: Thu Oct 19 09:59:15 2023 +0300
Commit: Mike Kaganski 
CommitDate: Thu Oct 19 12:31:16 2023 +0200

Use std::span instead of sentinel elements

Change-Id: Idcde4728f4db5b878c126c29c1953dff7c47f05a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158139
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/sd/source/ui/sidebar/LayoutMenu.cxx 
b/sd/source/ui/sidebar/LayoutMenu.cxx
index bf3ff1257e99..9022609df7d7 100644
--- a/sd/source/ui/sidebar/LayoutMenu.cxx
+++ b/sd/source/ui/sidebar/LayoutMenu.cxx
@@ -82,13 +82,10 @@ struct snew_slide_value_info
 
 }
 
-constexpr std::u16string_view EMPTY = u"";
-
 constexpr snew_slide_value_info notes[] =
 {
 {BMP_SLIDEN_01, STR_AUTOLAYOUT_NOTES, WritingMode_LR_TB,
  AUTOLAYOUT_NOTES},
-{EMPTY, {}, WritingMode_LR_TB, AUTOLAYOUT_NONE},
 };
 
 constexpr snew_slide_value_info handout[] =
@@ -105,7 +102,6 @@ constexpr snew_slide_value_info handout[] =
  AUTOLAYOUT_HANDOUT6},
 {BMP_SLIDEH_09, STR_AUTOLAYOUT_HANDOUT9, WritingMode_LR_TB,
  AUTOLAYOUT_HANDOUT9},
-{EMPTY, {}, WritingMode_LR_TB, AUTOLAYOUT_NONE},
 };
 
 constexpr snew_slide_value_info standard[] =
@@ -128,7 +124,6 @@ constexpr snew_slide_value_info standard[] =
 {BMP_LAYOUT_VERTICAL01, STR_AL_VERT_TITLE_VERT_OUTLINE, WritingMode_TB_RL, 
AUTOLAYOUT_VTITLE_VCONTENT},
 {BMP_LAYOUT_HEAD02, STR_AL_TITLE_VERT_OUTLINE, WritingMode_TB_RL, 
AUTOLAYOUT_TITLE_VCONTENT},
 {BMP_LAYOUT_HEAD02A, STR_AL_TITLE_VERT_OUTLINE_CLIPART,   
WritingMode_TB_RL, AUTOLAYOUT_TITLE_2VTEXT},
-{EMPTY, {}, WritingMode_LR_TB, AUTOLAYOUT_NONE}
 };
 
 class LayoutValueSet : public ValueSet
@@ -518,7 +513,7 @@ void LayoutMenu::Fill()
 catch (RuntimeException&)
 {}
 
-const snew_slide_value_info* pInfo = nullptr;
+std::span pInfo;
 if (sCenterPaneViewName == framework::FrameworkHelper::msNotesViewURL)
 {
 pInfo = notes;
@@ -532,27 +527,23 @@ void LayoutMenu::Fill()
 {
 pInfo = standard;
 }
-else
-{
-pInfo = nullptr;
-}
 
 Clear();
-for (sal_uInt16 i=1; pInfo!=nullptr && pInfo->mpStrResId; i++, pInfo++)
+for (size_t i = 0; i < pInfo.size(); i++)
 {
-if ((WritingMode_TB_RL != pInfo->meWritingMode) || bVertical)
+if ((WritingMode_TB_RL != pInfo[i].meWritingMode) || bVertical)
 {
-Image aImg(OUString::Concat("private:graphicrepository/") + 
pInfo->msBmpResId);
+Image aImg(OUString::Concat("private:graphicrepository/") + 
pInfo[i].msBmpResId);
 
-if (bRightToLeft && (WritingMode_TB_RL != pInfo->meWritingMode))
+if (bRightToLeft && (WritingMode_TB_RL != pInfo[i].meWritingMode))
 { // FIXME: avoid interpolating RTL layouts.
 BitmapEx aRTL = aImg.GetBitmapEx();
 aRTL.Mirror(BmpMirrorFlags::Horizontal);
 aImg = Image(aRTL);
 }
 
-mxLayoutValueSet->InsertItem(i, aImg, SdResId(pInfo->mpStrResId));
-mxLayoutValueSet->SetItemData (i, new 
AutoLayout(pInfo->maAutoLayout));
+mxLayoutValueSet->InsertItem(i + 1, aImg, 
SdResId(pInfo[i].mpStrResId));
+mxLayoutValueSet->SetItemData(i + 1, new 
AutoLayout(pInfo[i].maAutoLayout));
 }
 }
 }


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

2023-10-19 Thread Stephan Bergmann (via logerrit)
 sd/source/ui/sidebar/LayoutMenu.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 37298c29e775c0715c779e7d2be3902290556d17
Author: Stephan Bergmann 
AuthorDate: Wed Oct 18 20:52:41 2023 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Oct 19 08:47:14 2023 +0200

Use std::u16string_view instead of OUStringLiteral

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

diff --git a/sd/source/ui/sidebar/LayoutMenu.cxx 
b/sd/source/ui/sidebar/LayoutMenu.cxx
index fd6bc32c58bf..bf3ff1257e99 100644
--- a/sd/source/ui/sidebar/LayoutMenu.cxx
+++ b/sd/source/ui/sidebar/LayoutMenu.cxx
@@ -82,7 +82,7 @@ struct snew_slide_value_info
 
 }
 
-constexpr OUStringLiteral EMPTY = u"";
+constexpr std::u16string_view EMPTY = u"";
 
 constexpr snew_slide_value_info notes[] =
 {


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

2023-10-19 Thread Noel Grandin (via logerrit)
 sd/source/core/drawdoc2.cxx |6 ++
 sd/source/core/drawdoc3.cxx |   18 +-
 sd/source/core/drawdoc4.cxx |   12 
 sd/source/core/sdpage.cxx   |   11 +--
 sd/source/core/sdpage2.cxx  |   13 -
 sd/source/filter/html/htmlex.cxx|   19 ---
 sd/source/filter/xml/sdtransform.cxx|9 ++---
 sd/source/ui/app/sdxfer.cxx |5 +
 sd/source/ui/dlg/animobjs.cxx   |3 +--
 sd/source/ui/docshell/docshel3.cxx  |8 ++--
 sd/source/ui/tools/GraphicSizeCheck.cxx |   10 +++---
 sd/source/ui/uitest/uiobject.cxx|   18 +-
 sd/source/ui/unoidl/unopage.cxx |4 +---
 sd/source/ui/view/DocumentRenderer.cxx  |   16 
 sd/source/ui/view/drawview.cxx  |   16 
 sd/source/ui/view/drviews2.cxx  |   10 --
 sd/source/ui/view/outlview.cxx  |   12 
 slideshow/source/engine/box2dtools.cxx  |6 ++
 18 files changed, 69 insertions(+), 127 deletions(-)

New commits:
commit f3e010829ab9d6b0b0ef48b67661774dd19f6de0
Author: Noel Grandin 
AuthorDate: Wed Oct 18 13:59:22 2023 +0200
Commit: Noel Grandin 
CommitDate: Thu Oct 19 08:09:38 2023 +0200

use more SdrObjList::begin/end in sd

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

diff --git a/sd/source/core/drawdoc2.cxx b/sd/source/core/drawdoc2.cxx
index d591113fcca9..de82a8b95306 100644
--- a/sd/source/core/drawdoc2.cxx
+++ b/sd/source/core/drawdoc2.cxx
@@ -244,10 +244,8 @@ void SdDrawDocument::UpdatePageObjectsInNotes(sal_uInt16 
nStartPos)
 // number
 if (pPage && pPage->GetPageKind() == PageKind::Notes)
 {
-const size_t nObjCount = pPage->GetObjCount();
-for (size_t nObj = 0; nObj < nObjCount; ++nObj)
+for (const rtl::Reference& pObj : *pPage)
 {
-SdrObject* pObj = pPage->GetObj(nObj);
 if (pObj->GetObjIdentifier() == SdrObjKind::Page &&
 pObj->GetObjInventor() == SdrInventor::Default)
 {
@@ -257,7 +255,7 @@ void SdDrawDocument::UpdatePageObjectsInNotes(sal_uInt16 
nStartPos)
 SAL_WARN_IF(nPage <= 1, "sd", "Page object must not be a 
handout.");
 
 if (nStartPos > 0 && nPage > 1)
-
static_cast(pObj)->SetReferencedPage(GetPage(nPage - 1));
+
static_cast(pObj.get())->SetReferencedPage(GetPage(nPage - 1));
 }
 }
 }
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index 357858f46222..b3c6e0595c8a 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -927,17 +927,17 @@ bool SdDrawDocument::InsertBookmarkAsPage(
 {
 for(sal_uInt32 p = nInsertPos; p < sal_uInt32(nInsertPos) + 
sal_uInt32(nBMSdPageCount); p++)
 {
-SdPage *pPg = static_cast( GetPage(p) );
-for(size_t i = 0; pPg && (i < pPg->GetObjCount()); ++i)
-{
-if(pPg->GetObj(i)->GetStyleSheet())
+if (SdPage *pPg = static_cast( GetPage(p) ))
+for (const rtl::Reference& pObj : *pPg)
 {
-OUString aStyleName = 
pPg->GetObj(i)->GetStyleSheet()->GetName();
-SfxStyleSheet *pSheet = 
lcl_findStyle(aNewGraphicStyles, Concat2View(aStyleName + aRenameStr));
-if(pSheet != nullptr)
-pPg->GetObj(i)->SetStyleSheet(pSheet, true);
+if(pObj->GetStyleSheet())
+{
+OUString aStyleName = 
pObj->GetStyleSheet()->GetName();
+SfxStyleSheet *pSheet = 
lcl_findStyle(aNewGraphicStyles, Concat2View(aStyleName + aRenameStr));
+if(pSheet != nullptr)
+pObj->SetStyleSheet(pSheet, true);
+}
 }
-}
 }
 }
 catch(...)
diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx
index 91c4dc600703..577859d957bc 100644
--- a/sd/source/core/drawdoc4.cxx
+++ b/sd/source/core/drawdoc4.cxx
@@ -1067,10 +1067,8 @@ void SdDrawDocument::RenameLayoutTemplate(const 
OUString& rOldLayoutName, const
 {
 pPage->SetLayoutName(aPageLayoutName);
 
-for (size_t nObj = 0; nObj < pPage->GetObjCount(); ++nObj)
+for (const rtl::Reference& pObj : *pPage)
 {
-SdrObject* pObj = pPage->GetObj(nObj);
-
 if (pObj->GetObjInventor() == SdrInventor::Default)
 

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

2023-10-15 Thread Stephan Bergmann (via logerrit)
 sd/source/ui/sidebar/LayoutMenu.cxx |   11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

New commits:
commit aae50af8076ae2b4592598c25acb2709687dec08
Author: Stephan Bergmann 
AuthorDate: Fri Oct 13 23:21:45 2023 +0200
Commit: Stephan Bergmann 
CommitDate: Sun Oct 15 18:34:11 2023 +0200

Improve snew_slide_value_info

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

diff --git a/sd/source/ui/sidebar/LayoutMenu.cxx 
b/sd/source/ui/sidebar/LayoutMenu.cxx
index aa7bc7b3e9b7..fd6bc32c58bf 100644
--- a/sd/source/ui/sidebar/LayoutMenu.cxx
+++ b/sd/source/ui/sidebar/LayoutMenu.cxx
@@ -58,6 +58,7 @@
 #include 
 #include 
 
+#include 
 #include 
 
 using namespace ::com::sun::star;
@@ -73,7 +74,7 @@ namespace {
 
 struct snew_slide_value_info
 {
-rtl::OUStringConstExpr msBmpResId;
+std::u16string_view msBmpResId;
 TranslateId mpStrResId;
 WritingMode meWritingMode;
 AutoLayout maAutoLayout;
@@ -83,14 +84,14 @@ struct snew_slide_value_info
 
 constexpr OUStringLiteral EMPTY = u"";
 
-const snew_slide_value_info notes[] =
+constexpr snew_slide_value_info notes[] =
 {
 {BMP_SLIDEN_01, STR_AUTOLAYOUT_NOTES, WritingMode_LR_TB,
  AUTOLAYOUT_NOTES},
 {EMPTY, {}, WritingMode_LR_TB, AUTOLAYOUT_NONE},
 };
 
-const snew_slide_value_info handout[] =
+constexpr snew_slide_value_info handout[] =
 {
 {BMP_SLIDEH_01, STR_AUTOLAYOUT_HANDOUT1, WritingMode_LR_TB,
  AUTOLAYOUT_HANDOUT1},
@@ -107,7 +108,7 @@ const snew_slide_value_info handout[] =
 {EMPTY, {}, WritingMode_LR_TB, AUTOLAYOUT_NONE},
 };
 
-const snew_slide_value_info standard[] =
+constexpr snew_slide_value_info standard[] =
 {
 {BMP_LAYOUT_EMPTY, STR_AUTOLAYOUT_NONE, WritingMode_LR_TB,
AUTOLAYOUT_NONE},
 {BMP_LAYOUT_HEAD03, STR_AUTOLAYOUT_TITLE, WritingMode_LR_TB,   
AUTOLAYOUT_TITLE},
@@ -541,7 +542,7 @@ void LayoutMenu::Fill()
 {
 if ((WritingMode_TB_RL != pInfo->meWritingMode) || bVertical)
 {
-Image aImg("private:graphicrepository/" + static_cast(pInfo->msBmpResId));
+Image aImg(OUString::Concat("private:graphicrepository/") + 
pInfo->msBmpResId);
 
 if (bRightToLeft && (WritingMode_TB_RL != pInfo->meWritingMode))
 { // FIXME: avoid interpolating RTL layouts.


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

2023-10-05 Thread Heiko Tietze (via logerrit)
 sd/source/ui/table/tablefunction.cxx |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 86eb7ad2b4488dcd29c21ae3fc525056b681e199
Author: Heiko Tietze 
AuthorDate: Wed Oct 4 18:51:21 2023 +0200
Commit: Heiko Tietze 
CommitDate: Thu Oct 5 09:36:13 2023 +0200

Resolves tdf#156685 - "Object without fill" style for tables

The "Default Drawing Style" uses Tango Sky Blue for the background,
which is treated as dark since commit
Ia5e405fc05613726b5011174c8d00ca204eb31b2. This ends up in unreadable
white font color on white backgrounds for tables. The new style
"Object without fill" has a clear background.

Change-Id: I6b2f701e4a8cce6200fd2a5e86037e9a36b32833
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157568
Tested-by: Heiko Tietze 
Reviewed-by: Heiko Tietze 

diff --git a/sd/source/ui/table/tablefunction.cxx 
b/sd/source/ui/table/tablefunction.cxx
index 67196e864b39..b28f89c896e2 100644
--- a/sd/source/ui/table/tablefunction.cxx
+++ b/sd/source/ui/table/tablefunction.cxx
@@ -44,6 +44,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 
@@ -147,7 +149,11 @@ static void InsertTableImpl(const DrawViewShell* pShell,
 aRect,
 nColumns,
 nRows);
-pObj->NbcSetStyleSheet( pShell->GetDoc()->GetDefaultStyleSheet(), true );
+//tables must not use default background tango sky blue tdf#156685
+SfxStyleSheet* pStyleSheet = static_cast(
+pShell->GetDoc()->GetStyleSheetPool()->Find(
+SdResId(STR_POOLSHEET_OBJWITHOUTFILL), SfxStyleFamily::Para));
+pObj->NbcSetStyleSheet( pStyleSheet, true );
 apply_table_style( pObj.get(), pShell->GetDoc(), sTableStyle );
 SdrPageView* pPV = pView->GetSdrPageView();
 


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

2023-10-02 Thread Caolán McNamara (via logerrit)
 sd/source/ui/unoidl/unopool.cxx  |2 +-
 sw/source/uibase/uno/unodefaults.hxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 0083083c8cd269446d0f2955ffe2f17bbc3bf22b
Author: Caolán McNamara 
AuthorDate: Sun Oct 1 20:02:34 2023 +0100
Commit: Caolán McNamara 
CommitDate: Mon Oct 2 09:34:11 2023 +0200

these can be final

like ScDrawDefaultsObj is

related to

cid#1545815 API usage error
and
cid#1546386 API usage error

Change-Id: Ib015a6c6c2e4b6425f218b603a41a8a0027e4a92
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157474
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sd/source/ui/unoidl/unopool.cxx b/sd/source/ui/unoidl/unopool.cxx
index 6a4124bcfe62..72c006241611 100644
--- a/sd/source/ui/unoidl/unopool.cxx
+++ b/sd/source/ui/unoidl/unopool.cxx
@@ -44,7 +44,7 @@ static LanguageType SdUnoGetLanguage( const lang::Locale& 
rLocale )
 
 namespace {
 
-class SdUnoDrawPool : public SvxUnoDrawPool
+class SdUnoDrawPool final : public SvxUnoDrawPool
 {
 public:
 explicit SdUnoDrawPool(SdDrawDocument* pModel);
diff --git a/sw/source/uibase/uno/unodefaults.hxx 
b/sw/source/uibase/uno/unodefaults.hxx
index 5c14c1726008..3e01205950cf 100644
--- a/sw/source/uibase/uno/unodefaults.hxx
+++ b/sw/source/uibase/uno/unodefaults.hxx
@@ -22,7 +22,7 @@
 
 class SwDoc;
 
-class SwSvxUnoDrawPool : public SvxUnoDrawPool
+class SwSvxUnoDrawPool final : public SvxUnoDrawPool
 {
 SwDoc& m_rDoc;
 


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

2023-09-01 Thread Andrea Gelmini (via logerrit)
 sd/source/core/ThemeColorChanger.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b4545be2829e7184697718713fe505090d13872f
Author: Andrea Gelmini 
AuthorDate: Fri Sep 1 18:19:16 2023 +0200
Commit: Julien Nabet 
CommitDate: Fri Sep 1 18:44:57 2023 +0200

Fix typo

Change-Id: I02772f9b9ace5c1fe955bd0039c5e6d8ce2cc4eb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156450
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 

diff --git a/sd/source/core/ThemeColorChanger.cxx 
b/sd/source/core/ThemeColorChanger.cxx
index d187ee36c0a1..b475aa6f6060 100644
--- a/sd/source/core/ThemeColorChanger.cxx
+++ b/sd/source/core/ThemeColorChanger.cxx
@@ -157,7 +157,7 @@ void 
ThemeColorChanger::apply(std::shared_ptr const& pColorSet)
 // TODO - for now change all the objects regardless to which master 
page it belongs to.
 // Currently we don't have a concept of master slide with a group of 
layouts as in MSO, but we always only
 // have master pages, which aren't grouped together. In MSO the theme 
is defined per master slide, so when
-// changing a theme, all the layouts get the new theme, as layouts are 
synonomus to master pages in LibreOffice,
+// changing a theme, all the layouts get the new theme, as layouts are 
synonymous to master pages in LibreOffice,
 // this is not possible to do and we would need to change the theme 
for each master page separately, which
 // is just annoying for the user.
 


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

2023-09-01 Thread Andrea Gelmini (via logerrit)
 sd/source/core/ThemeColorChanger.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 89e2f268771ecb07948d3e67d220e28b2ae82e20
Author: Andrea Gelmini 
AuthorDate: Fri Sep 1 18:18:41 2023 +0200
Commit: Julien Nabet 
CommitDate: Fri Sep 1 18:41:02 2023 +0200

Fix typo

Change-Id: If259a049d38f82210819a5adbf458eae1651cfaf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156429
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 

diff --git a/sd/source/core/ThemeColorChanger.cxx 
b/sd/source/core/ThemeColorChanger.cxx
index 3a5c7804ae57..d187ee36c0a1 100644
--- a/sd/source/core/ThemeColorChanger.cxx
+++ b/sd/source/core/ThemeColorChanger.cxx
@@ -157,7 +157,7 @@ void 
ThemeColorChanger::apply(std::shared_ptr const& pColorSet)
 // TODO - for now change all the objects regardless to which master 
page it belongs to.
 // Currently we don't have a concept of master slide with a group of 
layouts as in MSO, but we always only
 // have master pages, which aren't grouped together. In MSO the theme 
is defined per master slide, so when
-// changing a theme, all the layouts get the new theme, as layouts are 
synonomus to master pages in LibreOffise,
+// changing a theme, all the layouts get the new theme, as layouts are 
synonomus to master pages in LibreOffice,
 // this is not possible to do and we would need to change the theme 
for each master page separately, which
 // is just annoying for the user.
 


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

2023-08-31 Thread Tomaž Vajngerl (via logerrit)
 sd/source/core/ThemeColorChanger.cxx |   42 ++-
 svx/source/theme/ThemeColorChangerCommon.cxx |   17 +-
 2 files changed, 32 insertions(+), 27 deletions(-)

New commits:
commit 70663f464b24f223c4174681b9a469d9f554bcee
Author: Tomaž Vajngerl 
AuthorDate: Thu Aug 31 08:11:18 2023 +0200
Commit: Tomaž Vajngerl 
CommitDate: Fri Sep 1 07:29:02 2023 +0200

sd: set the theme for all master pages

It can be annoying for the user to set the theme one by one for
each master page. The reason for this is that in MSO the master
slide (which contains the theme) has multiple layouts, which are
converted to master pages in LO. As LO doesn't group master pages
together the theme is defined on each master page, so it is needed
to change each master page one by one.

Change-Id: I94d75246ca012005ab376446c0941b8f57ca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156361
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/sd/source/core/ThemeColorChanger.cxx 
b/sd/source/core/ThemeColorChanger.cxx
index adfacb6a47ac..3a5c7804ae57 100644
--- a/sd/source/core/ThemeColorChanger.cxx
+++ b/sd/source/core/ThemeColorChanger.cxx
@@ -154,31 +154,35 @@ void 
ThemeColorChanger::apply(std::shared_ptr const& pColorSet)
 {
 SdrPage* pCurrentPage = rModel.GetPage(nPage);
 
-// Skip pages that are using a different master page
-if (!pCurrentPage->TRG_HasMasterPage()
-|| >TRG_GetMasterPage() != mpMasterPage)
-continue;
-
-for (size_t nObject = 0; nObject < pCurrentPage->GetObjCount(); 
++nObject)
+// TODO - for now change all the objects regardless to which master 
page it belongs to.
+// Currently we don't have a concept of master slide with a group of 
layouts as in MSO, but we always only
+// have master pages, which aren't grouped together. In MSO the theme 
is defined per master slide, so when
+// changing a theme, all the layouts get the new theme, as layouts are 
synonomus to master pages in LibreOffise,
+// this is not possible to do and we would need to change the theme 
for each master page separately, which
+// is just annoying for the user.
+
+// if (!pCurrentPage->TRG_HasMasterPage() || 
>TRG_GetMasterPage() != mpMasterPage)
+// continue;
+
+SdrObjListIter aIter(pCurrentPage, SdrIterMode::DeepWithGroups);
+while (aIter.IsMore())
 {
-SdrObject* pObject = pCurrentPage->GetObj(nObject);
-svx::theme::updateSdrObject(*pColorSet, pObject, pView, 
pUndoManager);
-
-// update child objects
-SdrObjList* pList = pObject->GetSubList();
-if (pList)
-{
-SdrObjListIter aIter(pList, SdrIterMode::DeepWithGroups);
-while (aIter.IsMore())
-{
-svx::theme::updateSdrObject(*pColorSet, aIter.Next(), 
pView, pUndoManager);
-}
-}
+svx::theme::updateSdrObject(*pColorSet, aIter.Next(), pView, 
pUndoManager);
 }
 }
 
 changeThemeColors(mpDocShell, mpMasterPage, pColorSet);
 
+// See the TODO comment a couple of line above for the explanation - need 
to change the ThemeColors for all master
+// pages for now, but the following code will need to be changed in the 
future when we have the concept similar to
+// master slide and layouts
+for (sal_uInt16 nPage = 0; nPage < rModel.GetPageCount(); ++nPage)
+{
+SdrPage* pCurrentPage = rModel.GetPage(nPage);
+if (pCurrentPage->IsMasterPage() && pCurrentPage != mpMasterPage)
+changeThemeColors(mpDocShell, pCurrentPage, pColorSet);
+}
+
 pUndoManager->LeaveListAction();
 }
 
diff --git a/svx/source/theme/ThemeColorChangerCommon.cxx 
b/svx/source/theme/ThemeColorChangerCommon.cxx
index 44f041f5f3b0..446943100101 100644
--- a/svx/source/theme/ThemeColorChangerCommon.cxx
+++ b/svx/source/theme/ThemeColorChangerCommon.cxx
@@ -104,13 +104,8 @@ bool updateEditEngTextSections(model::ColorSet const& 
rColorSet, SdrObject* pObj
 bool updateObjectAttributes(model::ColorSet const& rColorSet, SdrObject& 
rObject,
 SfxUndoManager* pUndoManager)
 {
-if (pUndoManager)
-{
-pUndoManager->AddUndoAction(
-
rObject.getSdrModelFromSdrObject().GetSdrUndoFactory().CreateUndoAttrObject(
-rObject, true, true));
-}
 bool bChanged = false;
+
 auto aItemSet = rObject.GetMergedItemSet();
 
 if (const XFillColorItem* pItem = aItemSet.GetItemIfSet(XATTR_FILLCOLOR, 
false))
@@ -151,6 +146,13 @@ bool updateObjectAttributes(model::ColorSet const& 
rColorSet, SdrObject& rObject
 }
 if (bChanged)
 {
+const bool bUndo = pUndoManager && pUndoManager->IsInListAction();
+if (bUndo)
+{
+

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

2023-08-31 Thread Noel Grandin (via logerrit)
 sd/source/core/stlsheet.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit cffc470c31062cd35f715bc45a53080735ff3356
Author: Noel Grandin 
AuthorDate: Thu Aug 31 14:43:45 2023 +0200
Commit: Noel Grandin 
CommitDate: Thu Aug 31 18:56:33 2023 +0200

ignore UnknownPropertyException in SdStyleSheet::setPropertyValues

reduce log noise

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

diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx
index 2038604861df..3084d494b454 100644
--- a/sd/source/core/stlsheet.cxx
+++ b/sd/source/core/stlsheet.cxx
@@ -1253,7 +1253,7 @@ void SAL_CALL SdStyleSheet::setPropertyValues(const 
css::uno::Sequence
 }
 catch (const css::beans::UnknownPropertyException&)
 {
-DBG_UNHANDLED_EXCEPTION("sd");
+// ignore this, some code likes to liberally sprinkle properties 
all over stuff that doesn't support those properties
 }
 }
 


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

2023-08-26 Thread Tomaž Vajngerl (via logerrit)
 sd/source/ui/view/drviewsf.cxx |   18 +-
 1 file changed, 17 insertions(+), 1 deletion(-)

New commits:
commit a535bacb2adeb491e919992a38e891945ca248f0
Author: Tomaž Vajngerl 
AuthorDate: Sun Aug 20 12:53:31 2023 +0200
Commit: Tomaž Vajngerl 
CommitDate: Sat Aug 26 21:05:00 2023 +0200

sd: disable ThemeDialog when not in a master page

Change-Id: Ic6ea74c877415f337d81d92bdef869c5fb61d239
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156122
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/sd/source/ui/view/drviewsf.cxx b/sd/source/ui/view/drviewsf.cxx
index 08d75842a187..83832f7ba561 100644
--- a/sd/source/ui/view/drviewsf.cxx
+++ b/sd/source/ui/view/drviewsf.cxx
@@ -37,12 +37,13 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
-
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -468,6 +469,21 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet )
 }
 break;
 
+case SID_THEME_DIALOG:
+{
+bool bDisable = true;
+SdrPageView* pPageView = mpDrawView->GetSdrPageView();
+if (pPageView)
+{
+SdPage* pPage = 
dynamic_cast(pPageView->GetPage());
+if (pPage && pPage->IsMasterPage())
+bDisable = false;
+}
+if (bDisable)
+rSet.DisableItem(nWhich);
+}
+break;
+
 case SID_STYLE_FAMILY2:
 case SID_STYLE_FAMILY3:
 case SID_STYLE_FAMILY5:


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

2023-08-26 Thread Andrea Gelmini (via logerrit)
 sd/source/core/ThemeColorChanger.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f8e35551f8e860bdfbf869b983909e483ac296d1
Author: Andrea Gelmini 
AuthorDate: Fri Aug 25 18:55:45 2023 +0200
Commit: Julien Nabet 
CommitDate: Sat Aug 26 11:20:09 2023 +0200

Fix typo

Change-Id: Ie3c298535db35219e46b1d6229d2079230b6b4c8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156120
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/sd/source/core/ThemeColorChanger.cxx 
b/sd/source/core/ThemeColorChanger.cxx
index 163e51e091f9..a506762708f1 100644
--- a/sd/source/core/ThemeColorChanger.cxx
+++ b/sd/source/core/ThemeColorChanger.cxx
@@ -141,7 +141,7 @@ void 
ThemeColorChanger::apply(std::shared_ptr const& pColorSet)
 {
 SdrPage* pCurrentPage = rModel.GetPage(nPage);
 
-// Skip pages that are usign a different master page
+// Skip pages that are using a different master page
 if (!pCurrentPage->TRG_HasMasterPage()
 || >TRG_GetMasterPage() != mpMasterPage)
 continue;


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

2023-08-22 Thread Jim Raykowski (via logerrit)
 sd/source/ui/dlg/sdtreelb.cxx |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 6761b79e7b48a5885adecf445f0206f141888613
Author: Jim Raykowski 
AuthorDate: Sat Aug 19 17:41:02 2023 -0800
Commit: Jim Raykowski 
CommitDate: Tue Aug 22 19:46:29 2023 +0200

tdf#156610 tdf#139633 SdNavigator: Fix object not selected

for entry that context menu is shown for, GtkInstance only

Commit fdb504add8e21c137a37fde48fedb93638e8ee97 introduced a hack to
make inplace editing work for the SalInstance of the treeview that,
for Gtk3, breaks object selection before the entry popup menu is
displayed which causes the menu item Rename... not to always work as
expected. Sal doesn't notice this because the mouse pressed signal is
seen when there is a popup menu handler set. Gtk3 does not fire the
mouse pressed signal when a popup menu handler set. This patch makes
object selection always happen before the popup menu is shown.

Change-Id: I562ddf99bd15a48631170a7d70821021a4139295
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155867
Tested-by: Jenkins
Reviewed-by: Jim Raykowski 

diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index e6e72c8884e0..63c26bc5635c 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -301,6 +301,7 @@ IMPL_LINK(SdPageObjsTLV, CommandHdl, const CommandEvent&, 
rCEvt, bool)
 
 if (rCEvt.GetCommand() == CommandEventId::ContextMenu)
 {
+m_bMouseReleased = false;
 m_xTreeView->grab_focus();
 
 // select clicked entry
@@ -314,7 +315,9 @@ IMPL_LINK(SdPageObjsTLV, CommandHdl, const CommandEvent&, 
rCEvt, bool)
 Select();
 }
 
-return m_aPopupMenuHdl.Call(rCEvt);
+bool bRet = m_aPopupMenuHdl.Call(rCEvt);
+m_bMouseReleased = true;
+return bRet;
 }
 
 return false;
@@ -842,7 +845,7 @@ void SdPageObjsTLV::Select()
 {
 m_nSelectEventId = nullptr;
 
-// hack to make inplace editing work for x11
+// m_bMouseReleased is a hack to make inplace editing work for X11
 if (m_bMouseReleased)
 return;
 


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

2023-08-21 Thread Noel Grandin (via logerrit)
 sd/source/filter/html/buttonset.cxx |   55 +++-
 sd/source/filter/html/buttonset.hxx |   11 +--
 2 files changed, 14 insertions(+), 52 deletions(-)

New commits:
commit 84b12cd3ea96ee9b02365b5239f391af242f7303
Author: Noel Grandin 
AuthorDate: Sun Aug 20 20:41:12 2023 +0200
Commit: Noel Grandin 
CommitDate: Mon Aug 21 09:22:24 2023 +0200

remove pimpl in ButtonSet

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

diff --git a/sd/source/filter/html/buttonset.cxx 
b/sd/source/filter/html/buttonset.cxx
index d79dfa38e69f..078485334ba1 100644
--- a/sd/source/filter/html/buttonset.cxx
+++ b/sd/source/filter/html/buttonset.cxx
@@ -22,7 +22,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include 
@@ -48,8 +47,6 @@ using namespace ::com::sun::star::io;
 using namespace ::com::sun::star::beans;
 using namespace ::com::sun::star::lang;
 
-namespace {
-
 class ButtonsImpl
 {
 public:
@@ -65,8 +62,6 @@ private:
 Reference< XStorage > mxStorage;
 };
 
-}
-
 ButtonsImpl::ButtonsImpl( const OUString& rURL )
 {
 try
@@ -139,25 +134,7 @@ bool ButtonsImpl::copyGraphic( const OUString& rName, 
const OUString& rPath )
 return false;
 }
 
-class ButtonSetImpl
-{
-public:
-ButtonSetImpl();
-
-int getCount() const;
-
-bool getPreview( int nSet, const std::vector< OUString >& rButtons, Image& 
rImage );
-bool exportButton( int nSet, const OUString& rPath, const OUString& rName 
);
-
-void scanForButtonSets( const OUString& rPath );
-
-Reference< XGraphicProvider > const & getGraphicProvider();
-
-std::vector< std::shared_ptr< ButtonsImpl > >  maButtons;
-Reference< XGraphicProvider > mxGraphicProvider;
-};
-
-ButtonSetImpl::ButtonSetImpl()
+ButtonSet::ButtonSet()
 {
 static const char sSubPath[] = "/wizard/web/buttons" ;
 
@@ -170,7 +147,7 @@ ButtonSetImpl::ButtonSetImpl()
 scanForButtonSets( sUserPath );
 }
 
-void ButtonSetImpl::scanForButtonSets( const OUString& rPath )
+void ButtonSet::scanForButtonSets( const OUString& rPath )
 {
 osl::Directory aDirectory( rPath );
 if( aDirectory.open() != osl::FileBase::E_None )
@@ -189,12 +166,12 @@ void ButtonSetImpl::scanForButtonSets( const OUString& 
rPath )
 }
 }
 
-int ButtonSetImpl::getCount() const
+int ButtonSet::getCount() const
 {
 return maButtons.size();
 }
 
-bool ButtonSetImpl::getPreview( int nSet, const std::vector< OUString >& 
rButtons, Image& rImage )
+bool ButtonSet::getPreview( int nSet, const std::vector< OUString >& rButtons, 
Image& rImage )
 {
 if( (nSet >= 0) && (o3tl::make_unsigned(nSet) < maButtons.size()))
 {
@@ -242,7 +219,7 @@ bool ButtonSetImpl::getPreview( int nSet, const 
std::vector< OUString >& rButton
 return false;
 }
 
-bool ButtonSetImpl::exportButton( int nSet, const OUString& rPath, const 
OUString& rName )
+bool ButtonSet::exportButton( int nSet, const OUString& rPath, const OUString& 
rName )
 {
 if( (nSet >= 0) && (o3tl::make_unsigned(nSet) < maButtons.size()))
 {
@@ -253,7 +230,7 @@ bool ButtonSetImpl::exportButton( int nSet, const OUString& 
rPath, const OUStrin
 return false;
 }
 
-Reference< XGraphicProvider > const & ButtonSetImpl::getGraphicProvider()
+Reference< XGraphicProvider > const & ButtonSet::getGraphicProvider()
 {
 if( !mxGraphicProvider.is() )
 {
@@ -263,28 +240,8 @@ Reference< XGraphicProvider > const & 
ButtonSetImpl::getGraphicProvider()
 return mxGraphicProvider;
 }
 
-ButtonSet::ButtonSet()
-: mpImpl( new ButtonSetImpl() )
-{
-}
-
 ButtonSet::~ButtonSet()
 {
 }
 
-int ButtonSet::getCount() const
-{
-return mpImpl->getCount();
-}
-
-bool ButtonSet::getPreview( int nSet, const std::vector< OUString >& rButtons, 
Image& rImage )
-{
-return mpImpl->getPreview( nSet, rButtons, rImage );
-}
-
-bool ButtonSet::exportButton( int nSet, const OUString& rPath, const OUString& 
rName )
-{
-return mpImpl->exportButton( nSet, rPath, rName );
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/filter/html/buttonset.hxx 
b/sd/source/filter/html/buttonset.hxx
index 4289c10e9805..9891496a05c2 100644
--- a/sd/source/filter/html/buttonset.hxx
+++ b/sd/source/filter/html/buttonset.hxx
@@ -20,13 +20,13 @@
 #pragma once
 
 #include 
-
+#include 
 #include 
 #include 
 #include 
 
 class Image;
-class ButtonSetImpl;
+class ButtonsImpl;
 
 class SD_DLLPUBLIC ButtonSet
 {
@@ -40,7 +40,12 @@ public:
 bool exportButton(int nSet, const OUString& rPath, const OUString& rName);
 
 private:
-std::unique_ptr mpImpl;
+void scanForButtonSets(const OUString& rPath);
+
+css::uno::Reference const& 
getGraphicProvider();
+
+std::vector> maButtons;
+css::uno::Reference mxGraphicProvider;
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2023-08-17 Thread Rafael Lima (via logerrit)
 sd/source/ui/view/ToolBarManager.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 188cff995830d52f4b04ee4d2ffcabeff5d17b27
Author: Rafael Lima 
AuthorDate: Wed Aug 9 01:30:25 2023 +0200
Commit: Rafael Lima 
CommitDate: Thu Aug 17 14:16:32 2023 +0200

tdf#142489 Do not show the table toolbar when Notebookbar is active

When the Notebookbar UI is being used, all the commands are already 
accessible via the "Table" tab in the notebookbar, so showing the toolbar 
duplicates the commands on the screen.

Therefore, this patch disables showing this toolbar when the Notebookbar UI 
is being used. Obviously, it can be enabled manually via View - Toolbars.

Change-Id: I115effbd94f61df518ff90411a45431fefa9e844
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155473
Tested-by: Jenkins
Tested-by: Heiko Tietze 
Reviewed-by: Heiko Tietze 

diff --git a/sd/source/ui/view/ToolBarManager.cxx 
b/sd/source/ui/view/ToolBarManager.cxx
index b3ea6ee8ded2..4be073bac612 100644
--- a/sd/source/ui/view/ToolBarManager.cxx
+++ b/sd/source/ui/view/ToolBarManager.cxx
@@ -1129,7 +1129,9 @@ void ToolBarRules::SubShellAdded (
 break;
 
 case ToolbarId::Draw_Table_Toolbox:
-mpToolBarManager->AddToolBar(eGroup, 
ToolBarManager::msTableObjectBar);
+// tdf#142489 Do not show the table toolbar when the Notebookbar 
UI is active
+if (!sfx2::SfxNotebookBar::IsActive(true))
+mpToolBarManager->AddToolBar(eGroup, 
ToolBarManager::msTableObjectBar);
 break;
 
 default:


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

2023-08-16 Thread Jim Raykowski (via logerrit)
 sd/source/ui/dlg/navigatr.cxx |   14 --
 sd/source/ui/dlg/sdtreelb.cxx |6 +-
 sd/source/ui/inc/sdtreelb.hxx |1 +
 3 files changed, 18 insertions(+), 3 deletions(-)

New commits:
commit b363a689bf5b434113648373f98ee46aa00c09d7
Author: Jim Raykowski 
AuthorDate: Sat Aug 12 21:54:57 2023 -0800
Commit: Jim Raykowski 
CommitDate: Wed Aug 16 08:01:37 2023 +0200

tdf#156610 tdf#139633 SDNavigator: Fix object naming/renaming

implementation

This patch makes the Rename... menu item open the Name dialog and
makes name editing start in the tree when a selected entry is left-
clicked on and released without moving the mouse pointer to begin a
drag operation.

Change-Id: I8d8b93895b797d7e1be860a17a5c1fe6d82e474e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155647
Tested-by: Jenkins
Reviewed-by: Jim Raykowski 

diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx
index ca6bc100cad9..f1a4a66c1e5f 100644
--- a/sd/source/ui/dlg/navigatr.cxx
+++ b/sd/source/ui/dlg/navigatr.cxx
@@ -264,8 +264,18 @@ IMPL_LINK(SdNavigatorWin, CommandHdl, const CommandEvent&, 
rCEvt, bool)
 
 void SdNavigatorWin::ExecuteContextMenuAction(std::u16string_view 
rSelectedPopupEntry)
 {
-if (rSelectedPopupEntry == u"rename")
-GetObjects().start_editing();
+if (rSelectedPopupEntry == u"rename" && mpBindings)
+{
+weld::TreeView& rTreeView = GetObjects().get_treeview();
+std::unique_ptr xIter(rTreeView.make_iterator());
+if (rTreeView.get_selected(xIter.get()))
+{
+if (rTreeView.get_iter_depth(*xIter) > 0)
+mpBindings->Execute(SID_NAME_GROUP);
+else
+mpBindings->Execute(SID_RENAMEPAGE);
+}
+}
 }
 
 IMPL_LINK(SdNavigatorWin, SelectToolboxHdl, const OUString&, rCommand, void)
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index 56e93bd7dfe0..e6e72c8884e0 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -354,6 +354,7 @@ IMPL_LINK(SdPageObjsTLV, KeyInputHdl, const KeyEvent&, 
rKEvt, bool)
 
 IMPL_LINK(SdPageObjsTLV, MousePressHdl, const MouseEvent&, rMEvt, bool)
 {
+m_bMouseReleased = false;
 m_bEditing = false;
 m_bSelectionHandlerNavigates = rMEvt.GetClicks() == 1;
 m_bNavigationGrabsFocus = rMEvt.GetClicks() != 1;
@@ -362,6 +363,7 @@ IMPL_LINK(SdPageObjsTLV, MousePressHdl, const MouseEvent&, 
rMEvt, bool)
 
 IMPL_LINK_NOARG(SdPageObjsTLV, MouseReleaseHdl, const MouseEvent&, bool)
 {
+m_bMouseReleased = true;
 if (m_aMouseReleaseHdl.IsSet() && m_aMouseReleaseHdl.Call(MouseEvent()))
 return false;
 
@@ -758,6 +760,7 @@ 
SdPageObjsTLV::SdPageObjsTLV(std::unique_ptr xTreeView)
 
 m_xTreeView->set_size_request(m_xTreeView->get_approximate_digit_width() * 
28,
   m_xTreeView->get_text_height() * 8);
+m_xTreeView->set_column_editables({true});
 }
 
 IMPL_LINK(SdPageObjsTLV, EditEntryAgain, void*, p, void)
@@ -839,7 +842,8 @@ void SdPageObjsTLV::Select()
 {
 m_nSelectEventId = nullptr;
 
-if (IsEditingActive())
+// hack to make inplace editing work for x11
+if (m_bMouseReleased)
 return;
 
 m_bLinkableSelected = true;
diff --git a/sd/source/ui/inc/sdtreelb.hxx b/sd/source/ui/inc/sdtreelb.hxx
index 38255a66e16f..712a6ebf3860 100644
--- a/sd/source/ui/inc/sdtreelb.hxx
+++ b/sd/source/ui/inc/sdtreelb.hxx
@@ -102,6 +102,7 @@ private:
  */
 bool m_bNavigationGrabsFocus;
 
+bool m_bMouseReleased = true; // hack for x11 inplace editing
 bool m_bEditing = false;
 
 SelectionMode m_eSelectionMode;


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

2023-07-17 Thread Justin Luth (via logerrit)
 sd/source/ui/view/ToolBarManager.cxx |   66 +++
 1 file changed, 36 insertions(+), 30 deletions(-)

New commits:
commit e58e251756ecb0312cb6891d4df23e17ef8f6fcb
Author: Justin Luth 
AuthorDate: Mon Jul 17 15:43:39 2023 -0400
Commit: Justin Luth 
CommitDate: Tue Jul 18 02:33:24 2023 +0200

tdf#126095 sd notebookbar: don't force table/media toolbar

Perhaps the entire function could return early
in case the notebookbar is active, but only if all of them
have a context notebookbar tab.
Some of them I can't check since I don't know how to trigger them.

Images, media, and tables all do have a context bar.
(Media's bar is missing useful things like location, mute,
and even file-location path.
(Those will come separately in another commit.)

Change-Id: Ic4623a1cab3abc1ac1f83622cbd11e549d2b0b98
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154559
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/sd/source/ui/view/ToolBarManager.cxx 
b/sd/source/ui/view/ToolBarManager.cxx
index edd39c73110b..0db84b25a3b4 100644
--- a/sd/source/ui/view/ToolBarManager.cxx
+++ b/sd/source/ui/view/ToolBarManager.cxx
@@ -31,6 +31,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1043,42 +1044,47 @@ void ToolBarRules::SelectionHasChanged (
 
 mpToolBarManager->ResetToolBars(ToolBarManager::ToolBarGroup::Function);
 
-switch (rView.GetContext())
+if (!sfx2::SfxNotebookBar::IsActive())
 {
-case SdrViewContext::Graphic:
-if( !bTextEdit )
-
mpToolBarManager->SetToolBarShell(ToolBarManager::ToolBarGroup::Function, 
ToolbarId::Draw_Graf_Toolbox);
-break;
+switch (rView.GetContext())
+{
+case SdrViewContext::Graphic:
+if (!bTextEdit)
+
mpToolBarManager->SetToolBarShell(ToolBarManager::ToolBarGroup::Function,
+  
ToolbarId::Draw_Graf_Toolbox);
+break;
 
-case SdrViewContext::Media:
-if( !bTextEdit )
-
mpToolBarManager->SetToolBarShell(ToolBarManager::ToolBarGroup::Function, 
ToolbarId::Draw_Media_Toolbox);
-break;
+case SdrViewContext::Media:
+if (!bTextEdit)
+
mpToolBarManager->SetToolBarShell(ToolBarManager::ToolBarGroup::Function,
+  
ToolbarId::Draw_Media_Toolbox);
+break;
 
-case SdrViewContext::Table:
-
mpToolBarManager->SetToolBarShell(ToolBarManager::ToolBarGroup::Function, 
ToolbarId::Draw_Table_Toolbox);
-bTextEdit = true;
-break;
+case SdrViewContext::Table:
+
mpToolBarManager->SetToolBarShell(ToolBarManager::ToolBarGroup::Function,
+  
ToolbarId::Draw_Table_Toolbox);
+bTextEdit = true;
+break;
 
-case SdrViewContext::Standard:
-default:
-if( !bTextEdit )
-{
-switch(rViewShell.GetShellType())
+case SdrViewContext::Standard:
+default:
+if (!bTextEdit)
 {
-case ::sd::ViewShell::ST_IMPRESS:
-case ::sd::ViewShell::ST_DRAW:
-case ::sd::ViewShell::ST_NOTES:
-case ::sd::ViewShell::ST_HANDOUT:
-mpToolBarManager->SetToolBar(
-ToolBarManager::ToolBarGroup::Function,
-ToolBarManager::msDrawingObjectToolBar);
-break;
-default:
-break;
+switch(rViewShell.GetShellType())
+{
+case ::sd::ViewShell::ST_IMPRESS:
+case ::sd::ViewShell::ST_DRAW:
+case ::sd::ViewShell::ST_NOTES:
+case ::sd::ViewShell::ST_HANDOUT:
+
mpToolBarManager->SetToolBar(ToolBarManager::ToolBarGroup::Function,
+ 
ToolBarManager::msDrawingObjectToolBar);
+break;
+default:
+break;
+}
+break;
 }
-break;
-}
+}
 }
 
 if( bTextEdit )


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

2023-07-13 Thread Justin Luth (via logerrit)
 sd/source/ui/func/futext.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 0c421a9aa3210d3bafdc8bb5e0d79cc1b58b4b33
Author: Justin Luth 
AuthorDate: Wed Jul 5 19:09:57 2023 -0400
Commit: Justin Luth 
CommitDate: Thu Jul 13 23:20:26 2023 +0200

tdf#153446 sd FuText: handle mouse-up without mouse-down

This is a follow-up to the previous commit which did the same
thing to all of the other FuConstruct elements.
It isn't essential to have for FuText, just nice for consistency.

FuText is much more complex than the other FuConstructs,
and has been this complex since initial import.

In patchset1, I removed a large chunk of code that I assume
is now obsolete with my change, but now I just left it in.
Without any documentation or unit tests, it is hard to know
for sure why this function creates a textbox on mouse-up.
So I chickened out and did the smart thing of just leaving
stuff I don't know anything at all about alone.

Change-Id: I105178e6af343eed505a803c6c3642eec073f6a7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154083
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx
index 5639d424b8b1..48c166792e70 100644
--- a/sd/source/ui/func/futext.cxx
+++ b/sd/source/ui/func/futext.cxx
@@ -604,6 +604,9 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt)
 }
 }
 
+if (rMEvt.IsLeft() && !mxTextObj.get().is() && 
IsIgnoreUnexpectedMouseButtonUp())
+return false;
+
 if( mpView && mpView->IsDragObj())
 {
 // object was moved


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

2023-07-12 Thread Justin Luth (via logerrit)
 sd/source/ui/func/fucon3d.cxx  |3 +++
 sd/source/ui/func/fuconarc.cxx |3 +++
 sd/source/ui/func/fuconbez.cxx |3 +++
 sd/source/ui/func/fuconcs.cxx  |3 +++
 sd/source/ui/func/fuconrec.cxx |3 +++
 sd/source/ui/func/fuconstr.cxx |   13 +
 sd/source/ui/func/fuconuno.cxx |3 +++
 sd/source/ui/inc/fuconstr.hxx  |3 +++
 8 files changed, 34 insertions(+)

New commits:
commit 634e13e9d6d9bbe2d051978538c02926f764e51b
Author: Justin Luth 
AuthorDate: Wed Jul 5 12:19:27 2023 -0400
Commit: Justin Luth 
CommitDate: Wed Jul 12 20:50:24 2023 +0200

tdf#153446 sd fuconstruct: handle mouse-up without mouse-down

The situation where this was happening occurred when the notebookbar
had a pop-out of additional functions available. This pop-out removed
the focus from the draw window, so the mouse-down was used
to regain focus in Draw. The mouse-up just needed to be absorbed
or else the "drag the shape to create" would be changed into a select.

I checked as many "situations" as I could possibly have conceived of
after reviewing the code in this area. The ones I know I need are !bMBDown
and !IsAction(). The rest are just to try to avoid getting me into trouble.

[FuText also could benefit from this,
 but that function is much more complex,
 and so I don't dare to interfere.

 It already does BegCreateObj on a mouse-up,
 but the textbox it creates is hard to notice.]

Change-Id: I4ed2564e81d8a7ce82e7edec43e4e9acc6e97760
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154069
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/sd/source/ui/func/fucon3d.cxx b/sd/source/ui/func/fucon3d.cxx
index a2f76b8d8df9..812a8e705cd7 100644
--- a/sd/source/ui/func/fucon3d.cxx
+++ b/sd/source/ui/func/fucon3d.cxx
@@ -353,6 +353,9 @@ bool FuConstruct3dObject::MouseButtonDown(const MouseEvent& 
rMEvt)
 
 bool FuConstruct3dObject::MouseButtonUp(const MouseEvent& rMEvt)
 {
+if (rMEvt.IsLeft() && IsIgnoreUnexpectedMouseButtonUp())
+return false;
+
 bool bReturn = false;
 
 if ( mpView->IsCreateObj() && rMEvt.IsLeft() )
diff --git a/sd/source/ui/func/fuconarc.cxx b/sd/source/ui/func/fuconarc.cxx
index 35b2c33b4ad7..b69eb0cadee1 100644
--- a/sd/source/ui/func/fuconarc.cxx
+++ b/sd/source/ui/func/fuconarc.cxx
@@ -130,6 +130,9 @@ bool FuConstructArc::MouseButtonDown( const MouseEvent& 
rMEvt )
 
 bool FuConstructArc::MouseButtonUp( const MouseEvent& rMEvt )
 {
+if (rMEvt.IsLeft() && IsIgnoreUnexpectedMouseButtonUp())
+return false;
+
 bool bReturn = false;
 bool bCreated = false;
 
diff --git a/sd/source/ui/func/fuconbez.cxx b/sd/source/ui/func/fuconbez.cxx
index 319c8b1b9adb..881f27343d5d 100644
--- a/sd/source/ui/func/fuconbez.cxx
+++ b/sd/source/ui/func/fuconbez.cxx
@@ -190,6 +190,9 @@ bool FuConstructBezierPolygon::MouseButtonDown(const 
MouseEvent& rMEvt)
 
 bool FuConstructBezierPolygon::MouseButtonUp(const MouseEvent& rMEvt )
 {
+if (rMEvt.IsLeft() && IsIgnoreUnexpectedMouseButtonUp())
+return false;
+
 bool bReturn = false;
 bool bCreated = false;
 
diff --git a/sd/source/ui/func/fuconcs.cxx b/sd/source/ui/func/fuconcs.cxx
index 7fbecef5d00d..d8df8c699b9a 100644
--- a/sd/source/ui/func/fuconcs.cxx
+++ b/sd/source/ui/func/fuconcs.cxx
@@ -115,6 +115,9 @@ bool FuConstructCustomShape::MouseButtonDown(const 
MouseEvent& rMEvt)
 
 bool FuConstructCustomShape::MouseButtonUp(const MouseEvent& rMEvt)
 {
+if (rMEvt.IsLeft() && IsIgnoreUnexpectedMouseButtonUp())
+return false;
+
 bool bReturn(false);
 
 if(mpView->IsCreateObj() && rMEvt.IsLeft())
diff --git a/sd/source/ui/func/fuconrec.cxx b/sd/source/ui/func/fuconrec.cxx
index 3561a6eb8c47..5d7aeb173bcc 100644
--- a/sd/source/ui/func/fuconrec.cxx
+++ b/sd/source/ui/func/fuconrec.cxx
@@ -282,6 +282,9 @@ bool FuConstructRectangle::MouseButtonDown(const 
MouseEvent& rMEvt)
 
 bool FuConstructRectangle::MouseButtonUp(const MouseEvent& rMEvt)
 {
+if (rMEvt.IsLeft() && IsIgnoreUnexpectedMouseButtonUp())
+return false;
+
 bool bReturn(false);
 
 if(mpView->IsCreateObj() && rMEvt.IsLeft())
diff --git a/sd/source/ui/func/fuconstr.cxx b/sd/source/ui/func/fuconstr.cxx
index fd93a3ce7c94..a3ccf35d4f40 100644
--- a/sd/source/ui/func/fuconstr.cxx
+++ b/sd/source/ui/func/fuconstr.cxx
@@ -230,6 +230,19 @@ void FuConstruct::Deactivate()
 mpView->SetEditMode(SdrViewEditMode::Edit);
 }
 
+bool FuConstruct::IsIgnoreUnexpectedMouseButtonUp()
+{
+// tdf#153446 if there is a MouseButtonUp without a previous 
MouseButtonDown event,
+// the MouseButtonDown was probably swallowed by a gain-focus action,
+// and then this MouseButtonUp should be ignored
+
+if (bMBDown || bIsInDragMode)
+return false;
+
+// Don't ignore if there are pending mouse-initiated tasks to complete.
+return !mpView->IsDragObj() && !mpWindow->IsMouseCaptured() && 

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

2023-07-05 Thread Justin Luth (via logerrit)
 sd/source/ui/func/futext.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 71358fa5ebbb086bac822ddbfcd3500dce09ae63
Author: Justin Luth 
AuthorDate: Wed Jul 5 14:42:32 2023 -0400
Commit: Justin Luth 
CommitDate: Wed Jul 5 23:26:52 2023 +0200

simplify sd: already asked if mxTextObj.get().is()

Change-Id: Ibb303cf53722684b0f98f0195ec6d55376bcfd1b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154073
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx
index 559846aeb5f0..5639d424b8b1 100644
--- a/sd/source/ui/func/futext.cxx
+++ b/sd/source/ui/func/futext.cxx
@@ -590,7 +590,7 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt)
 if (rMarkList.GetMarkCount() == 1
 && ( rMarkList.GetMark(0)->GetMarkedSdrObj() == 
mxTextObj.get().get()) )
 {
-if( mxTextObj.get().is() && 
!GetTextObj()->GetOutlinerParaObject() )
+if (!GetTextObj()->GetOutlinerParaObject() )
 bEmptyTextObj = true;
 else
 bFirstObjCreated = true;


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

2023-07-03 Thread Paris Oplopoios (via logerrit)
 sd/source/ui/inc/DrawViewShell.hxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 7f1012806f5cf2cd53e52d8f2a95c09a2215efbc
Author: Paris Oplopoios 
AuthorDate: Mon Jul 3 00:24:27 2023 +0300
Commit: Paris Oplopoios 
CommitDate: Mon Jul 3 11:03:17 2023 +0200

Delete DrawViewShell copy constructors

DrawViewShell does not get copied so best to set these to deleted to
highlight this.

Change-Id: I3d35d3a47137b15346d54a08d3d7af480b0872bb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153864
Tested-by: Jenkins
Reviewed-by: Paris Oplopoios 

diff --git a/sd/source/ui/inc/DrawViewShell.hxx 
b/sd/source/ui/inc/DrawViewShell.hxx
index bf20af800f7e..319afe1386d3 100644
--- a/sd/source/ui/inc/DrawViewShell.hxx
+++ b/sd/source/ui/inc/DrawViewShell.hxx
@@ -397,6 +397,9 @@ protected:
 voidGetMenuStateSel(SfxItemSet& rSet);
 
 private:
+DrawViewShell(const DrawViewShell&) = delete;
+DrawViewShell& operator=(const DrawViewShell&) = delete;
+
 void Construct (DrawDocShell* pDocSh, PageKind ePageKind);
 
 void ImplDestroy();


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

2023-06-29 Thread Mike Kaganski (via logerrit)
 sd/source/core/stlsheet.cxx |   14 ++
 1 file changed, 14 insertions(+)

New commits:
commit 4e20f95cf6744ca85bc8c090b926031729addc89
Author: Mike Kaganski 
AuthorDate: Thu Jun 29 23:58:32 2023 +0300
Commit: Mike Kaganski 
CommitDate: Fri Jun 30 01:03:29 2023 +0200

tdf#156091: handle OWN_ATTR_TEXTCOLUMNS in 
SdStyleSheet::getPropertyValue_Impl

Somehow I failed to implement this from start. In commit
95ebd24a629b4c8cd62cc20c0701683512cc8fa0 (editengine-columns:
ODF support [API CHANGE], 2021-06-08), I implemented its
support in SdStyleSheet::getPropertyState; then, in commit
f2ea39c70da3f82bb39f8b51b5484172360b1fc2 (Avoid crash getting
default item for OWN_ATTR_TEXTCOLUMNS, 2021-06-22), I added
its support in SdStyleSheet::setPropertyValue; and finally,
the time has come to support getting its value. Better late
than never.

Change-Id: Ifa1f933f00336bf6d01a5c71d0c92baf846ccabb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153777
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx
index fe981d8bca45..4ea270b4f38e 100644
--- a/sd/source/core/stlsheet.cxx
+++ b/sd/source/core/stlsheet.cxx
@@ -51,6 +51,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1146,6 +1147,19 @@ css::uno::Any SdStyleSheet::getPropertyValue_Impl(const 
OUString& PropertyName)
 {
 aAny <<= IsHidden( );
 }
+else if (pEntry->nWID == OWN_ATTR_TEXTCOLUMNS)
+{
+const SfxItemSet& rStyleSet = GetItemSet();
+
+auto xIf = SvxXTextColumns_createInstance();
+css::uno::Reference xCols(xIf, 
css::uno::UNO_QUERY_THROW);
+
xCols->setColumnCount(rStyleSet.Get(SDRATTR_TEXTCOLUMNS_NUMBER).GetValue());
+css::uno::Reference xProp(xIf, 
css::uno::UNO_QUERY_THROW);
+xProp->setPropertyValue(
+"AutomaticDistance",
+
css::uno::Any(rStyleSet.Get(SDRATTR_TEXTCOLUMNS_SPACING).GetValue()));
+aAny <<= xIf;
+}
 else
 {
 SfxItemSet aSet( GetPool()->GetPool(), pEntry->nWID, pEntry->nWID);


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

2023-06-27 Thread Regina Henschel (via logerrit)
 sd/source/ui/sidebar/SlideBackground.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 9321f8602ec903e1e311b831da0504826e1e4f90
Author: Regina Henschel 
AuthorDate: Tue Jun 27 10:50:23 2023 +0200
Commit: Regina Henschel 
CommitDate: Tue Jun 27 14:20:20 2023 +0200

tdf#145130 Keep existing gradient geometry using sidebar

When setting the start or end color of a gradient of a slide using the
sidebar, the new colors were set to a default gradient instead of using
the existing one.

Change-Id: I0212d2d88e7eb144334308dedd057958ae0a8287
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153634
Tested-by: Jenkins
Reviewed-by: Regina Henschel 

diff --git a/sd/source/ui/sidebar/SlideBackground.cxx 
b/sd/source/ui/sidebar/SlideBackground.cxx
index ebdbf0977505..6cd8d6b4c858 100644
--- a/sd/source/ui/sidebar/SlideBackground.cxx
+++ b/sd/source/ui/sidebar/SlideBackground.cxx
@@ -1133,7 +1133,8 @@ IMPL_LINK_NOARG(SlideBackground, FillColorHdl, 
ColorListBox&, void)
 break;
 case drawing::FillStyle_GRADIENT:
 {
-basegfx::BGradient aGradient(createColorStops());
+basegfx::BGradient aGradient = GetGradientSetOrDefault();
+aGradient.SetColorStops(createColorStops());
 
 // the name doesn't really matter, it'll be converted to unique 
one eventually,
 // but it has to be non-empty


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

2023-06-26 Thread Caolán McNamara (via logerrit)
 sd/source/filter/ppt/pptin.cxx |   18 +-
 sd/source/filter/ppt/pptin.hxx |2 +-
 2 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit db90a3838f9cdd4866a0add4a5b5f5859d78e0d7
Author: Caolán McNamara 
AuthorDate: Sun Jun 25 19:45:21 2023 +0100
Commit: Caolán McNamara 
CommitDate: Mon Jun 26 09:56:45 2023 +0200

FillSdAnimationInfo is never passed a null

Change-Id: Iaf292fc3476fbbc21fede3856a50864951c1db8f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153568
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index 0cdc7f8fb59b..53d28a3c46ea 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -2081,27 +2081,27 @@ OUString ImplSdPPTImport::ReadMedia( sal_uInt32 
nMediaRef ) const
 }
 
 // import of objects
-void ImplSdPPTImport::FillSdAnimationInfo( SdAnimationInfo* pInfo, 
PptInteractiveInfoAtom const * pIAtom, const OUString& aMacroName )
+void ImplSdPPTImport::FillSdAnimationInfo(SdAnimationInfo* pInfo, const 
PptInteractiveInfoAtom& rIAtom, const OUString& rMacroName)
 {
 // set local information into pInfo
-if( pIAtom->nSoundRef )
+if( rIAtom.nSoundRef )
 {
-pInfo->SetBookmark( ReadSound( pIAtom->nSoundRef ) );   // path to 
sound file in MS DOS notation
+pInfo->SetBookmark( ReadSound( rIAtom.nSoundRef ) );   // path to 
sound file in MS DOS notation
 pInfo->meClickAction = css::presentation::ClickAction_SOUND;   
// RunProgramAction
 }
 
-switch ( pIAtom->nAction )
+switch ( rIAtom.nAction )
 {
 
 case 0x02 : // RunProgramAction
 {
 pInfo->meClickAction = css::presentation::ClickAction_PROGRAM;
-pInfo->SetBookmark( aMacroName );   // program 
name in aBookmark
+pInfo->SetBookmark(rMacroName);   // program name 
in aBookmark
 }
 break;
 case 0x03 : // JumpAction
 {
-switch( pIAtom->nJump )
+switch( rIAtom.nJump )
 {
 case 0x01 :
 pInfo->meClickAction = 
css::presentation::ClickAction_NEXTPAGE;// Next slide
@@ -2131,14 +2131,14 @@ void ImplSdPPTImport::FillSdAnimationInfo( 
SdAnimationInfo* pInfo, PptInteractiv
 {
 SdHyperlinkEntry* pPtr = nullptr;
 for (SdHyperlinkEntry & entry : m_aHyperList) {
-if ( entry.nIndex == pIAtom->nExHyperlinkId ) {
+if ( entry.nIndex == rIAtom.nExHyperlinkId ) {
 pPtr = 
 break;
 }
 }
 if ( pPtr )
 {
-switch( pIAtom->nHyperlinkType )
+switch( rIAtom.nHyperlinkType )
 {
 case 9:
 case 8: // 
hyperlink : URL
@@ -2691,7 +2691,7 @@ rtl::Reference ImplSdPPTImport::ProcessObj( 
SvStream& rSt, DffObjData
 // interactive object
 SdAnimationInfo* pInfo = 
SdDrawDocument::GetShapeUserData(*pObj, true);
 
-FillSdAnimationInfo( pInfo, 
, aMacroName );
+FillSdAnimationInfo(pInfo, 
aInteractiveInfoAtom, aMacroName);
 if ( aInteractiveInfoAtom.nAction == 6 ) // Sj 
-> media action
 {
 rHdClientData.SeekToContent( rStCtrl );
diff --git a/sd/source/filter/ppt/pptin.hxx b/sd/source/filter/ppt/pptin.hxx
index 6dc02652cc76..c0d239fd23c5 100644
--- a/sd/source/filter/ppt/pptin.hxx
+++ b/sd/source/filter/ppt/pptin.hxx
@@ -58,7 +58,7 @@ class ImplSdPPTImport : public SdrPowerPointImport
 voidSetHeaderFooterPageSettings( SdPage* pPage, const 
PptSlidePersistEntry* pMasterPersist );
 voidImportPageEffect( SdPage* pPage, const bool 
bNewAnimationsUsed );
 
-voidFillSdAnimationInfo( SdAnimationInfo* pInfo, 
PptInteractiveInfoAtom const * pIAtom, const OUString& aMacroName );
+voidFillSdAnimationInfo(SdAnimationInfo* pInfo, const 
PptInteractiveInfoAtom& rIAtom, const OUString& rMacroName);
 
 virtual rtl::Reference ProcessObj( SvStream& rSt, 
DffObjData& rData, SvxMSDffClientData& rClientData, ::tools::Rectangle& 
rTextRect, SdrObject* pObj ) override;
 virtual SdrObject* ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* 
pText, SdPageCapsule pPage,


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

2023-06-21 Thread Pranam Lashkari (via logerrit)
 sd/source/ui/unoidl/unomodel.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3924368f4837332bba640906be9a9d2e2e6b22cf
Author: Pranam Lashkari 
AuthorDate: Wed Jun 7 03:59:31 2023 +0700
Commit: Pranam Lashkari 
CommitDate: Wed Jun 21 14:01:49 2023 +0200

sd: send correct slide visibility status

The term visible may be a bit aambiguous here,
we try trying to send info about if the slide is hidden or
visible in the slide show.
The correct property for that is "exclude"

Change-Id: Ic505036181b71686656bd2338b9d0329c12d9e74
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152688
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Pranam Lashkari 
(cherry picked from commit fe79008f70e7a790e4f78c1714c27ea223512327)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152988
Tested-by: Jenkins

diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index e05aee0f91c0..1f2f76d11d1b 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -2355,7 +2355,7 @@ OUString SdXImpressDocument::getPartInfo(int nPart)
 if (!pViewSh)
 return OUString();
 
-const bool bIsVisible = pViewSh->IsVisible(nPart);
+const bool bIsVisible = !pViewSh->GetDoc()->GetSdPage(nPart, 
pViewSh->GetPageKind())->IsExcluded();
 const bool bIsSelected = pViewSh->IsSelected(nPart);
 const sal_Int16 nMasterPageCount= 
pViewSh->GetDoc()->GetMasterSdPageCount(pViewSh->GetPageKind());
 


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

2023-06-20 Thread Justin Luth (via logerrit)
 sd/source/ui/view/drviews1.cxx |3 +++
 sfx2/source/control/shell.cxx  |2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

New commits:
commit e321d85089fc1dd73cd1f1443a53226a25695194
Author: Justin Luth 
AuthorDate: Tue Jun 20 13:37:19 2023 -0400
Commit: Justin Luth 
CommitDate: Wed Jun 21 01:01:10 2023 +0200

tdf#122270 sd: refresh notebookbar after switch to/from master view

Although the state of the uno items was changing,
the notebookbar was not refreshing to display the new state.

Change-Id: Ifda5e6dcfa1d569ba75d0c94cdf0bc94c63977d5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153360
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx
index 2be9dad20226..e41e87b08d55 100644
--- a/sd/source/ui/view/drviews1.cxx
+++ b/sd/source/ui/view/drviews1.cxx
@@ -506,6 +506,9 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool 
bIsLayerModeActive)
 Invalidate( SID_HANDOUT_MASTER_MODE );
 InvalidateWindows();
 
+if (sfx2::SfxNotebookBar::IsActive())
+UIFeatureChanged();
+
 SetContextName(GetSidebarContextName());
 
 }
diff --git a/sfx2/source/control/shell.cxx b/sfx2/source/control/shell.cxx
index 84828b0eff25..aeba636a491f 100644
--- a/sfx2/source/control/shell.cxx
+++ b/sfx2/source/control/shell.cxx
@@ -671,7 +671,7 @@ void SfxShell::UIFeatureChanged()
 if ( pFrame && pFrame->IsVisible() )
 {
 // Also force an update, if dispatcher is already updated otherwise
-// something my get stuck in the bunkered tools. Asynchronous call to
+// something may get stuck in the bunkered tools. Asynchronous call to
 // prevent recursion.
 if ( !pImpl->pUpdater )
 pImpl->pUpdater.reset( new svtools::AsynchronLink( 
Link( this, DispatcherUpdate_Impl ) ) );


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

2023-06-20 Thread Justin Luth (via logerrit)
 sd/source/ui/view/drviews1.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 1ff817faad79952e6271bab178d41cae2a0d9ecd
Author: Justin Luth 
AuthorDate: Mon Jun 19 16:35:05 2023 -0400
Commit: Justin Luth 
CommitDate: Tue Jun 20 16:48:22 2023 +0200

tdf#126095 impress notebookbar: don't force Master/Presentation toolbars

When in the notebookbar mode, non-notebookbar toolbars should
not be enabled automatically by the application.

The user still has the ability to turn them on.


Change-Id: Ib601b63390a8d806604b68ed2ea198198f4318ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153303
Tested-by: Justin Luth 
Reviewed-by: Justin Luth 

diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx
index bff9f67872bd..2be9dad20226 100644
--- a/sd/source/ui/view/drviews1.cxx
+++ b/sd/source/ui/view/drviews1.cxx
@@ -33,6 +33,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -471,7 +472,7 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool 
bIsLayerModeActive)
 
 // If the master view toolbar is to be shown we turn it on after the
 // edit mode has been changed.
-if (::sd::ViewShell::mpImpl->mbIsInitialized
+if (::sd::ViewShell::mpImpl->mbIsInitialized && 
!sfx2::SfxNotebookBar::IsActive()
 && IsMainViewShell())
 {
 if (bShowMasterViewToolbar)


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

2023-06-20 Thread Daniel Lohmann (via logerrit)
 sd/source/ui/slideshow/slideshowimpl.cxx |9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

New commits:
commit ca90149fa3f7c8161393490d4c0149c1cbcc3c28
Author: Daniel Lohmann 
AuthorDate: Mon Jun 19 21:50:15 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue Jun 20 13:46:19 2023 +0200

tdf#155920: next effect in END mode should no resume show

When starting a presentation and moving over the last slide into the END
mode the next effect should not resume the presentation. Instead it
should exit the presentation. Furthermore, when hitting then the back
key it should show again the last slide (only resuming the presentation,
not directly resuming and moving back to the slide before the last.

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

diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx 
b/sd/source/ui/slideshow/slideshowimpl.cxx
index a9f16b86b8d4..01165afaecd7 100644
--- a/sd/source/ui/slideshow/slideshowimpl.cxx
+++ b/sd/source/ui/slideshow/slideshowimpl.cxx
@@ -2758,7 +2758,7 @@ void SAL_CALL SlideshowImpl::gotoNextEffect(  )
 if( !(mxShow.is() && mpSlideController && mpShowWindow) )
 return;
 
-if( mbIsPaused )
+if( mbIsPaused && mpShowWindow->GetShowWindowMode() != SHOWWINDOWMODE_END )
 resume();
 
 const ShowWindowMode eMode = mpShowWindow->GetShowWindowMode();
@@ -2784,13 +2784,10 @@ void SAL_CALL SlideshowImpl::gotoPreviousEffect(  )
 if( !(mxShow.is() && mpSlideController && mpShowWindow) )
 return;
 
-if( mbIsPaused )
-resume();
-
 const ShowWindowMode eMode = mpShowWindow->GetShowWindowMode();
-if( (eMode == SHOWWINDOWMODE_PAUSE) || (eMode == SHOWWINDOWMODE_BLANK) )
+if( (eMode == SHOWWINDOWMODE_PAUSE) || (eMode == SHOWWINDOWMODE_BLANK) || 
mbIsPaused )
 {
-mpShowWindow->RestartShow();
+resume();
 }
 else
 {


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

2023-06-20 Thread Tomaž Vajngerl (via logerrit)
 sd/source/filter/eppt/pptx-epptooxml.cxx |   22 +-
 1 file changed, 17 insertions(+), 5 deletions(-)

New commits:
commit b13733de130e2f1ca029315e977dc01bd196b05b
Author: Tomaž Vajngerl 
AuthorDate: Tue Jun 20 17:39:40 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Tue Jun 20 13:14:48 2023 +0200

sd: fix setting theme for notes master

Notes master also needs a theme set or the document will not load
properly. For now we don't save the theme for the notes master on
import, so we can only set the default "LibreOffice" theme instead.

Change-Id: Ia9e5db53d4e1a4ca06b10d147cc879475166dfd9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153314
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx 
b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 8d0a85b16b5a..8c0e7f740437 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -66,6 +66,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -2044,12 +2045,23 @@ void PowerPointExport::WriteNotesMaster()
  
"application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml");
 // write theme per master
 
-WriteTheme(mnMasterPages, nullptr);
+// TODO: Need to implement theme support for note master, so the
+// note master has his own theme associated.
 
-// add implicit relation to the presentation theme
-addRelation(pFS->getOutputStream(),
-oox::getRelationship(Relationship::THEME),
-Concat2View("../theme/theme" + OUString::number(mnMasterPages 
+ 1) + ".xml"));
+// For now just use the default theme
+auto const* pDefaultColorSet = 
svx::ColorSets::get().getColorSet(u"LibreOffice");
+if (pDefaultColorSet)
+{
+auto pTheme = std::make_shared("Office Theme");
+
pTheme->setColorSet(std::make_shared(*pDefaultColorSet));
+
+WriteTheme(mnMasterPages, pTheme.get());
+
+// add implicit relation to the presentation theme
+addRelation(pFS->getOutputStream(),
+oox::getRelationship(Relationship::THEME),
+Concat2View("../theme/theme" + 
OUString::number(mnMasterPages + 1) + ".xml"));
+}
 
 pFS->startElementNS(XML_p, XML_notesMaster, PNMSS);
 


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

2023-06-15 Thread Luigi Iucci (via logerrit)
 sd/source/ui/unoidl/unomodel.cxx |   13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

New commits:
commit c183934835a6ab5e74643a671b65e9468592d216
Author: Luigi Iucci 
AuthorDate: Fri May 26 11:49:59 2023 +0200
Commit: Miklos Vajna 
CommitDate: Thu Jun 15 08:38:45 2023 +0200

sd: fix crash deleting 2 slides during paintTile

pPageView was null in SdXImpressDocument::paintTile while trying
to paint form controls, which is a corner case in most cases
then we skip painting in order to avoid a crash

Change-Id: I6c166035220c058fac276f2b7746a8ebc9651f81
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152379
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index dd2c897b4930..e05aee0f91c0 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -2306,11 +2306,14 @@ void SdXImpressDocument::paintTile( VirtualDevice& 
rDevice,
 // Draw Form controls
 SdrView* pDrawView = pViewSh->GetDrawView();
 SdrPageView* pPageView = pDrawView->GetSdrPageView();
-SdrPage* pPage = pPageView->GetPage();
-::sd::Window* pActiveWin = pViewSh->GetActiveWindow();
-::tools::Rectangle aTileRect(Point(nTilePosX, nTilePosY), Size(nTileWidth, 
nTileHeight));
-Size aOutputSize(nOutputWidth, nOutputHeight);
-LokControlHandler::paintControlTile(pPage, pDrawView, *pActiveWin, 
rDevice, aOutputSize, aTileRect);
+if (pPageView != nullptr)
+{
+SdrPage* pPage = pPageView->GetPage();
+::sd::Window* pActiveWin = pViewSh->GetActiveWindow();
+::tools::Rectangle aTileRect(Point(nTilePosX, nTilePosY), 
Size(nTileWidth, nTileHeight));
+Size aOutputSize(nOutputWidth, nOutputHeight);
+LokControlHandler::paintControlTile(pPage, pDrawView, *pActiveWin, 
rDevice, aOutputSize, aTileRect);
+}
 
 comphelper::LibreOfficeKit::setTiledPainting(false);
 }


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

2023-06-13 Thread Jim Raykowski (via logerrit)
 sd/source/ui/dlg/sdtreelb.cxx |   22 ++
 1 file changed, 2 insertions(+), 20 deletions(-)

New commits:
commit ec60d354359067f8c5c686ef2239ee705916de43
Author: Jim Raykowski 
AuthorDate: Sat Jun 10 17:16:29 2023 -0800
Commit: Jim Raykowski 
CommitDate: Wed Jun 14 03:54:21 2023 +0200

SdNavigator: Improve unique name detection

Commit ace75043781b5fe36546ec75574a14617f4feb30 added the ability to
rename page and object names from the Navigator. An approach that
searches entry names in the tree was used to check for unique naming.
This does not guarantee uniquess as the name may already be used
for an object in another view, for example, Notes view. This
patch guarantees name uniqueness by checking the document model to
see if an object with the name already exists.

Change-Id: Iad419420d6010b94380c55b7dc71a8d4abbec784
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152843
Tested-by: Jenkins
Reviewed-by: Jim Raykowski 

diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index 45b078df0cb0..56e93bd7dfe0 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -783,27 +783,9 @@ IMPL_LINK(SdPageObjsTLV, EditedEntryHdl, const 
IterString&, rIterString, bool)
 return true;
 
 // If the new name is empty or not unique, start editing again.
-bool bUniqueName = true;
-std::unique_ptr xEntry(m_xTreeView->make_iterator());
-if (!rIterString.second.isEmpty())
-{
-if (m_xTreeView->get_iter_first(*xEntry))
-{
-do
-{
-// skip self!
-if (m_xTreeView->iter_compare(*xEntry, rIterString.first) != 0 
&&
-m_xTreeView->get_text(*xEntry) == rIterString.second)
-{
-bUniqueName = false;
-break;
-}
-} while(m_xTreeView->iter_next(*xEntry));
-}
-}
-if (rIterString.second.isEmpty() || !bUniqueName)
+if (rIterString.second.isEmpty() || m_pDoc->GetObj(rIterString.second))
 {
-m_xTreeView->copy_iterator(rIterString.first, *xEntry);
+std::unique_ptr 
xEntry(m_xTreeView->make_iterator());
 Application::PostUserEvent(LINK(this, SdPageObjsTLV, EditEntryAgain), 
xEntry.release());
 return false;
 }


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

2023-06-12 Thread Henry Castro (via logerrit)
 sd/source/ui/app/sddll.cxx |   24 ++--
 1 file changed, 18 insertions(+), 6 deletions(-)

New commits:
commit 5b35703d11089975d625fede2605ce3bc449b294
Author: Henry Castro 
AuthorDate: Wed Feb 15 11:25:19 2023 -0400
Commit: Henry Castro 
CommitDate: Mon Jun 12 17:33:28 2023 +0200

sd: lok: only register supported views

The Presentation ViewShells:

SlideSorter,
Outline,
Presentation

They are not supported in tiled rendering case,
so switch to default view.

Signed-off-by: Henry Castro 
Change-Id: I33b255e0ca530734af6490d14fe48a2512272afc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147095
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152900
Tested-by: Jenkins

diff --git a/sd/source/ui/app/sddll.cxx b/sd/source/ui/app/sddll.cxx
index c195869b790e..b4734310a39b 100644
--- a/sd/source/ui/app/sddll.cxx
+++ b/sd/source/ui/app/sddll.cxx
@@ -91,12 +91,24 @@ void SdDLL::RegisterFactorys()
 {
 ::sd::ImpressViewShellBase::RegisterFactory (
 ::sd::IMPRESS_FACTORY_ID);
-::sd::SlideSorterViewShellBase::RegisterFactory (
-::sd::SLIDE_SORTER_FACTORY_ID);
-::sd::OutlineViewShellBase::RegisterFactory (
-::sd::OUTLINE_FACTORY_ID);
-::sd::PresentationViewShellBase::RegisterFactory (
-::sd::PRESENTATION_FACTORY_ID);
+if (comphelper::LibreOfficeKit::isActive())
+{
+::sd::ImpressViewShellBase::RegisterFactory (
+::sd::SLIDE_SORTER_FACTORY_ID);
+::sd::ImpressViewShellBase::RegisterFactory (
+::sd::OUTLINE_FACTORY_ID);
+::sd::ImpressViewShellBase::RegisterFactory (
+::sd::PRESENTATION_FACTORY_ID);
+}
+else
+{
+::sd::SlideSorterViewShellBase::RegisterFactory (
+::sd::SLIDE_SORTER_FACTORY_ID);
+::sd::OutlineViewShellBase::RegisterFactory (
+::sd::OUTLINE_FACTORY_ID);
+::sd::PresentationViewShellBase::RegisterFactory (
+::sd::PRESENTATION_FACTORY_ID);
+}
 }
 if (!utl::ConfigManager::IsFuzzing() && SvtModuleOptions().IsDraw())
 {


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

2023-05-30 Thread Jim Raykowski (via logerrit)
 sd/source/ui/dlg/navigatr.cxx |1 +
 sd/source/ui/dlg/sdtreelb.cxx |   35 ---
 2 files changed, 33 insertions(+), 3 deletions(-)

New commits:
commit 60e32969a98cad348cf8e55e8f93abc3d6e9c70c
Author: Jim Raykowski 
AuthorDate: Sun May 21 15:39:11 2023 -0800
Commit: Jim Raykowski 
CommitDate: Tue May 30 21:06:26 2023 +0200

tdf#155393 SdNavigator: Enhancement to navigate in Notes view

Change-Id: Icea71217fa5ffadc637bd7d9b8cae2fa18ec93bc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152075
Tested-by: Jenkins
Reviewed-by: Stéphane Guillou 
Reviewed-by: Heiko Tietze 
Reviewed-by: Jim Raykowski 

diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx
index 2bdfaefde410..ca6bc100cad9 100644
--- a/sd/source/ui/dlg/navigatr.cxx
+++ b/sd/source/ui/dlg/navigatr.cxx
@@ -778,6 +778,7 @@ void 
SdNavigatorControllerItem::StateChangedAtToolBoxControl( sal_uInt16 nSId,
 static_cast<::sd::DrawViewShell 
*>(pDrawDocShell->GetViewShell());
 if (pDrawViewShell)
 {
+pNavigatorWin->FreshTree(pDrawDocShell->GetDoc());
 bool bEditModePage(pDrawViewShell->GetEditMode() == 
EditMode::Page);
 pNavigatorWin->mxToolbox->set_sensitive(bEditModePage);
 pNavigatorWin->mxLbDocs->set_sensitive(bEditModePage);
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index e39099a61675..45b078df0cb0 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -56,9 +56,21 @@
 #include 
 
 #include 
+#include 
 
 using namespace com::sun::star;
 
+namespace {
+
+sd::DrawViewShell* lcl_getDrawViewShell(const SdDrawDocument* pDoc)
+{
+if (!pDoc || !pDoc->GetDocSh())
+return nullptr;
+return static_cast(pDoc->GetDocSh()->GetViewShell());
+}
+
+}
+
 bool SdPageObjsTLV::bIsInDrag = false;
 
 bool SdPageObjsTLV::IsInDrag()
@@ -251,6 +263,13 @@ bool SdPageObjsTLV::IsEqualToDoc( const SdDrawDocument* 
pInDoc )
 if( !m_pDoc )
 return false;
 
+sd::DrawViewShell* pDrawViewShell = lcl_getDrawViewShell(m_pDoc);
+if (!pDrawViewShell)
+return false;
+PageKind eDrawViewShellPageKind = pDrawViewShell->GetPageKind();
+if (eDrawViewShellPageKind != PageKind::Standard && eDrawViewShellPageKind 
!= PageKind::Notes)
+return false;
+
 std::unique_ptr xEntry(m_xTreeView->make_iterator());
 if (!m_xTreeView->get_iter_first(*xEntry))
 xEntry.reset();
@@ -262,7 +281,7 @@ bool SdPageObjsTLV::IsEqualToDoc( const SdDrawDocument* 
pInDoc )
 while( nPage < nMaxPages )
 {
 const SdPage* pPage = static_cast( m_pDoc->GetPage( 
nPage ) );
-if( pPage->GetPageKind() == PageKind::Standard )
+if (pPage->GetPageKind() == eDrawViewShellPageKind)
 {
 bool bRet = IsEqualToShapeList(xEntry, *pPage, pPage->GetName());
 if (!bRet)
@@ -1247,11 +1266,21 @@ void SdPageObjsTLV::Fill(const SdDrawDocument* pInDoc, 
bool bAllPages, const OUS
 sal_uInt16 nPage = 0;
 const sal_uInt16 nMaxPages = m_pDoc->GetPageCount();
 
+sd::DrawViewShell* pDrawViewShell = lcl_getDrawViewShell(m_pDoc);
+if (!pDrawViewShell)
+return;
+PageKind eDrawViewShellPageKind = pDrawViewShell->GetPageKind();
+
 while( nPage < nMaxPages )
 {
 const SdPage* pPage = static_cast( m_pDoc->GetPage( 
nPage ) );
-if(  (m_bShowAllPages || pPage->GetPageKind() == PageKind::Standard)
- && (pPage->GetPageKind() != PageKind::Handout)   ) //#94954# 
never list the normal handout page ( handout-masterpage is used instead )
+PageKind ePagePageKind = pPage->GetPageKind();
+if ((m_bShowAllPages ||
+ (ePagePageKind == PageKind::Standard &&
+  eDrawViewShellPageKind == PageKind::Standard) ||
+ (ePagePageKind == PageKind::Notes &&
+  eDrawViewShellPageKind == PageKind::Notes)) &&
+ePagePageKind != PageKind::Handout) //#94954# never list the 
normal handout page ( handout-masterpage is used instead )
 {
 bool bPageExcluded = pPage->IsExcluded();
 


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

2023-05-23 Thread Miklos Vajna (via logerrit)
 sd/source/ui/unoidl/unomodel.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit ef76718e7146b9c7c878d598d2e9b5125b278d69
Author: Miklos Vajna 
AuthorDate: Mon May 22 09:15:50 2023 +0200
Commit: Miklos Vajna 
CommitDate: Tue May 23 15:37:52 2023 +0200

sd: fix crash in SdXImpressDocument::postMouseEvent()

Crashreport signature:

program/libsdlo.so
  SdXImpressDocument::postMouseEvent(int, int, int, int, int, int)
  sd/source/ui/unoidl/unomodel.cxx:2615
program/libmergedlo.so
  doc_postMouseEvent
  desktop/source/lib/init.cxx:5007

Change-Id: I321f39b284f5917048925bf45c9a6417ac9cb2ad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152138
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index f53144d14775..3ff5fd0de266 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -2623,6 +2623,11 @@ void SdXImpressDocument::postMouseEvent(int nType, int 
nX, int nY, int nCount, i
 SdrPageView* pPageView = pDrawView->GetSdrPageView();
 SdrPage* pPage = pPageView->GetPage();
 ::sd::Window* pActiveWin = pViewShell->GetActiveWindow();
+if (!pActiveWin)
+{
+return;
+}
+
 if (LokControlHandler::postMouseEvent(pPage, pDrawView, *pActiveWin, 
nType, aPointHMM, nCount, nButtons, nModifier))
 return;
 


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

2023-05-15 Thread Attila Szűcs (via logerrit)
 sd/source/ui/view/drviews2.cxx  |   29 -
 sfx2/source/sidebar/ResourceManager.cxx |3 +--
 sfx2/source/view/viewfrm.cxx|   11 +++
 vcl/jsdialog/enabled.cxx|6 +++---
 vcl/jsdialog/jsdialogbuilder.cxx|9 ++---
 5 files changed, 41 insertions(+), 17 deletions(-)

New commits:
commit 4ad89dd8166fac837d7ed6887c17f9255f06285e
Author: Attila Szűcs 
AuthorDate: Wed May 3 04:24:35 2023 +0200
Commit: Szymon Kłos 
CommitDate: Mon May 15 09:03:04 2023 +0200

LOK: Navi-1 open/close on sidebar

Enabling Navigator sidebar in case of LOKit.

Change-Id: I3a656fa12822e5866c2cd4fbf82627a88f26903a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151307
Tested-by: Szymon Kłos 
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151704
Tested-by: Jenkins

diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 7f1b762d6e48..5c5aa56e960d 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -3343,16 +3343,27 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
 
 case SID_NAVIGATOR:
 {
-if ( rReq.GetArgs() )
-GetViewFrame()->SetChildWindow(SID_NAVIGATOR,
-static_cast(rReq.GetArgs()->
-Get(SID_NAVIGATOR)).GetValue());
-else
-GetViewFrame()->ToggleChildWindow( SID_NAVIGATOR );
+if (comphelper::LibreOfficeKit::isActive())
+{
+GetViewFrame()->ShowChildWindow(SID_SIDEBAR);
+OUString panelId = "SdNavigatorPanel";
+::sfx2::sidebar::Sidebar::TogglePanel(
+panelId, GetViewFrame()->GetFrame().GetFrameInterface());
 
-GetViewFrame()->GetBindings().Invalidate(SID_NAVIGATOR);
-Cancel();
-rReq.Ignore ();
+Cancel();
+rReq.Done();
+} else {
+if ( rReq.GetArgs() )
+GetViewFrame()->SetChildWindow(SID_NAVIGATOR,
+static_cast(rReq.GetArgs()->
+Get(SID_NAVIGATOR)).GetValue());
+else
+GetViewFrame()->ToggleChildWindow( SID_NAVIGATOR );
+
+GetViewFrame()->GetBindings().Invalidate(SID_NAVIGATOR);
+Cancel();
+rReq.Ignore ();
+}
 }
 break;
 
diff --git a/sfx2/source/sidebar/ResourceManager.cxx 
b/sfx2/source/sidebar/ResourceManager.cxx
index cfc5437037cc..5974e20af488 100644
--- a/sfx2/source/sidebar/ResourceManager.cxx
+++ b/sfx2/source/sidebar/ResourceManager.cxx
@@ -260,8 +260,7 @@ void ResourceManager::ReadDeckList()
 if (comphelper::LibreOfficeKit::isActive())
 {
 // Hide these decks in LOK as they aren't fully functional.
-if (aDeckName == "GalleryDeck" || aDeckName == "NavigatorDeck"
-|| aDeckName == "StyleListDeck")
+if (aDeckName == "GalleryDeck" || aDeckName == "StyleListDeck")
 continue;
 }
 
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index d62090bad118..bf42fc5de078 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -3414,6 +3414,17 @@ void SfxViewFrame::ChildWindowExecute( SfxRequest  )
 rReq.Done();
 return;
 }
+if (nSID == SID_NAVIGATOR)
+{
+if (comphelper::LibreOfficeKit::isActive())
+{
+ShowChildWindow(SID_SIDEBAR);
+OUString panelId = "SdNavigatorPanel";
+::sfx2::sidebar::Sidebar::TogglePanel(panelId, 
GetFrame().GetFrameInterface());
+rReq.Done();
+return;
+}
+}
 
 bool bHasChild = HasChildWindow(nSID);
 bool bShow = pShowItem ? pShowItem->GetValue() : !bHasChild;
diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx
index 73a4eedf96b4..36707140b927 100644
--- a/vcl/jsdialog/enabled.cxx
+++ b/vcl/jsdialog/enabled.cxx
@@ -299,7 +299,7 @@ bool isBuilderEnabledForSidebar(std::u16string_view rUIFile)
 {
 if (// scalc
 rUIFile == u"modules/scalc/ui/functionpanel.ui"
-//|| rUIFile == u"modules/scalc/ui/navigatorpanel.ui"
+|| rUIFile == u"modules/scalc/ui/navigatorpanel.ui"
 || rUIFile == u"modules/scalc/ui/sidebaralignment.ui"
 || rUIFile == u"modules/scalc/ui/sidebarcellappearance.ui"
 || rUIFile == u"modules/scalc/ui/sidebarnumberformat.ui"
@@ -316,7 +316,7 @@ bool isBuilderEnabledForSidebar(std::u16string_view rUIFile)
 || rUIFile == u"modules/simpress/ui/masterpagepanel.ui"
 || rUIFile == u"modules/simpress/ui/masterpagepanelall.ui"
 || rUIFile == u"modules/simpress/ui/masterpagepanelrecent.ui"
-

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

2023-05-05 Thread Maxim Monastirsky (via logerrit)
 sd/source/ui/view/sdview3.cxx |   18 --
 1 file changed, 8 insertions(+), 10 deletions(-)

New commits:
commit 86b48c757906c3ef647f3d5e2579ac1fef1bf55b
Author: Maxim Monastirsky 
AuthorDate: Fri May 5 11:12:36 2023 +0300
Commit: Maxim Monastirsky 
CommitDate: Fri May 5 13:23:27 2023 +0200

tdf#155144 sd: Don't reset table styles on RTF pasting

Regression of daab698b346e5e40b67f1e15c796c4e399ccaf8a
("sd: replace hardcoded table styles with xml file").

The problem is with the temp SdDrawDocument reusing the
document's DrawDocShell. Before the mentioned commit we used
to insert the default table styles directly into the style
sheets pool, and that didn't affect the dest document as each
SdDrawDocument maintains its own pool. However, after that
commit we go through ODF import which use the document model
which happens to be the dest document. This results with all
the default table styles being replaced, with all their
formatting being reset, and all existing tables being reset
to the default style following the disposal of the original
styles. At the same time, this leaves the temp SdDrawDocument
with no table styles in its pool, and so the newly inserted
table ends up with no style assigned.

Change-Id: I9bebae929ec3d54e0139dd212ad0ad1dfe815caa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151417
Tested-by: Jenkins
Reviewed-by: Maxim Monastirsky 

diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx
index 6a1b776f4ead..06f07048455e 100644
--- a/sd/source/ui/view/sdview3.cxx
+++ b/sd/source/ui/view/sdview3.cxx
@@ -1568,19 +1568,17 @@ bool View::InsertData( const TransferableDataHelper& 
rDataHelper,
 
 bool View::PasteRTFTable( const ::tools::SvRef& xStm, SdrPage* 
pPage, SdrInsertFlags nPasteOptions )
 {
-SdDrawDocument aModel( DocumentType::Impress, mpDocSh );
-aModel.NewOrLoadCompleted(DocCreationMode::New);
-aModel.GetItemPool().SetDefaultMetric(MapUnit::Map100thMM);
-aModel.InsertPage(aModel.AllocPage(false).get());
+DrawDocShellRef xShell = new DrawDocShell(SfxObjectCreateMode::INTERNAL, 
false, DocumentType::Impress);
+xShell->DoInitNew();
 
-Reference< XComponent > xComponent( new SdXImpressDocument( , true 
) );
-aModel.setUnoModel( Reference< XInterface >::query( xComponent ) );
+SdDrawDocument* pModel = xShell->GetDoc();
+pModel->GetItemPool().SetDefaultMetric(MapUnit::Map100thMM);
+pModel->InsertPage(pModel->AllocPage(false).get());
 
-CreateTableFromRTF( *xStm,  );
-bool bRet = Paste(aModel, maDropPos, pPage, nPasteOptions);
+CreateTableFromRTF(*xStm, pModel);
+bool bRet = Paste(*pModel, maDropPos, pPage, nPasteOptions);
 
-xComponent->dispose();
-xComponent.clear();
+xShell->DoClose();
 
 return bRet;
 }


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

2023-04-27 Thread Caolán McNamara (via logerrit)
 sd/source/ui/dlg/sdtreelb.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit bb28a0e8b914edf1fe2aac0cd1a876b976f61300
Author: Caolán McNamara 
AuthorDate: Thu Apr 27 13:04:39 2023 +0100
Commit: Caolán McNamara 
CommitDate: Thu Apr 27 17:30:36 2023 +0200

cid#1528189 Uninitialized pointer field

Change-Id: I9c66ee7d147cf9082b9f065601a87ef5d2fc01d8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151098
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index 68e794c21d5d..e39099a61675 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -468,6 +468,7 @@ void SdPageObjsTLV::OnDragFinished()
 SdPageObjsTLVDropTarget::SdPageObjsTLVDropTarget(weld::TreeView& rTreeView)
 : DropTargetHelper(rTreeView.get_drop_target())
 , m_rTreeView(rTreeView)
+, m_pSdrView(nullptr)
 {
 }
 
@@ -552,7 +553,7 @@ sal_Int8 SdPageObjsTLVDropTarget::ExecuteDrop( const 
ExecuteDropEvent& rEvt )
 if (pTargetObject == reinterpret_cast(1))
 pTargetObject = nullptr;
 
-if (pTargetObject != nullptr && pSourceObject != nullptr)
+if (pTargetObject != nullptr && pSourceObject != nullptr && m_pSdrView)
 {
 SdrPage* pObjectList = pSourceObject->getSdrPageFromSdrObject();
 


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

2023-04-26 Thread Caolán McNamara (via logerrit)
 sd/source/ui/inc/DrawViewShell.hxx |2 ++
 sd/source/ui/view/drviewsa.cxx |5 +
 2 files changed, 7 insertions(+)

New commits:
commit f5dd0ffdae83d3e9a568d54719ca82cf53693c4a
Author: Caolán McNamara 
AuthorDate: Wed Apr 26 09:19:20 2023 +0100
Commit: Caolán McNamara 
CommitDate: Wed Apr 26 17:57:56 2023 +0200

cid#1401342 Uncaught exception

Change-Id: I50a2a4b1763749ae6117e38c982808b514e876d4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151037
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/sd/source/ui/inc/DrawViewShell.hxx 
b/sd/source/ui/inc/DrawViewShell.hxx
index a8e48c723d2e..15f1dc9888c3 100644
--- a/sd/source/ui/inc/DrawViewShell.hxx
+++ b/sd/source/ui/inc/DrawViewShell.hxx
@@ -398,6 +398,8 @@ protected:
 private:
 void Construct (DrawDocShell* pDocSh, PageKind ePageKind);
 
+void ImplDestroy();
+
 /** Depending on the given request create a new page or duplicate an
 existing one.  See ViewShell::CreateOrDuplicatePage() for more
 information.
diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx
index 34324d3aa93f..dbc410ca2545 100644
--- a/sd/source/ui/view/drviewsa.cxx
+++ b/sd/source/ui/view/drviewsa.cxx
@@ -132,6 +132,11 @@ DrawViewShell::DrawViewShell( ViewShellBase& 
rViewShellBase, vcl::Window* pParen
 }
 
 DrawViewShell::~DrawViewShell()
+{
+suppress_fun_call_w_exception(ImplDestroy());
+}
+
+void DrawViewShell::ImplDestroy()
 {
 SD_MOD()->GetColorConfig().RemoveListener(this);
 


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

2023-04-25 Thread Jim Raykowski (via logerrit)
 sd/source/ui/dlg/navigatr.cxx |9 
 sd/source/ui/dlg/sdtreelb.cxx |   12 +-
 sd/source/ui/inc/sdtreelb.hxx |   13 ++-
 sd/uiconfig/simpress/ui/navigatorpanel.ui |   33 ++
 4 files changed, 64 insertions(+), 3 deletions(-)

New commits:
commit a8493ee3d7dac611286a75516f24dd6e451f9718
Author: Jim Raykowski 
AuthorDate: Sat Apr 22 11:23:48 2023 -0800
Commit: Jim Raykowski 
CommitDate: Tue Apr 25 19:50:06 2023 +0200

tdf#154604 SdNavigator: Support listing in front-to-back z order

Enhancement patch to provide the option to list objects in front-to-
back or back-to-front z order

Change-Id: I2194cace08736d948002548887661314834cef89
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150893
Tested-by: Jenkins
Reviewed-by: Jim Raykowski 

diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx
index ff0bc85d9b85..be0f5919afa9 100644
--- a/sd/source/ui/dlg/navigatr.cxx
+++ b/sd/source/ui/dlg/navigatr.cxx
@@ -309,6 +309,9 @@ IMPL_LINK(SdNavigatorWin, DropdownClickToolBoxHdl, const 
OUString&, rCommand, vo
 bool bAll = mxTlbObjects->GetShowAllShapes();
 mxShapeMenu->set_active("named", !bAll);
 mxShapeMenu->set_active("all", bAll);
+bool bOrderFrontToBack = mxTlbObjects->GetOrderFrontToBack();
+mxShapeMenu->set_active("fronttoback", bOrderFrontToBack);
+mxShapeMenu->set_active("backtofront", !bOrderFrontToBack);
 }
 }
 
@@ -501,13 +504,19 @@ IMPL_LINK(SdNavigatorWin, MenuSelectHdl, const OUString&, 
rIdent, void)
 IMPL_LINK( SdNavigatorWin, ShapeFilterCallback, const OUString&, rIdent, void )
 {
 bool bShowAllShapes(mxTlbObjects->GetShowAllShapes());
+bool bOrderFrontToBack(mxTlbObjects->GetOrderFrontToBack());
 if (rIdent == "named")
 bShowAllShapes = false;
 else if (rIdent == "all")
 bShowAllShapes = true;
+else if (rIdent == "fronttoback")
+bOrderFrontToBack = true;
+else if (rIdent == "backtofront")
+bOrderFrontToBack = false;
 else
 OSL_FAIL("SdNavigatorWin::ShapeFilterCallback called for unknown menu 
entry");
 
+mxTlbObjects->SetOrderFrontToBack(bOrderFrontToBack);
 mxTlbObjects->SetShowAllShapes(bShowAllShapes, true);
 
 // Remember the selection in the FrameView.
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index efb027c2119c..68e794c21d5d 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -182,6 +182,11 @@ void SdPageObjsTLV::SetShowAllShapes (
 }
 }
 
+void SdPageObjsTLV::SetOrderFrontToBack(const bool bOrderFrontToBack)
+{
+m_bOrderFrontToBack = bOrderFrontToBack;
+}
+
 bool SdPageObjsTLV::IsEqualToShapeList(std::unique_ptr& 
rEntry, const SdrObjList& rList,
std::u16string_view rListName)
 {
@@ -416,6 +421,7 @@ bool SdPageObjsTLV::DoDrag()
 }
 
 m_xDropTargetHelper->SetDrawView(pViewShell->GetDrawView());
+m_xDropTargetHelper->SetOrderFrontToBack(m_bOrderFrontToBack);
 bIsInDrag = true;
 
 std::unique_ptr xEntry = m_xTreeView->make_iterator();
@@ -562,7 +568,7 @@ sal_Int8 SdPageObjsTLVDropTarget::ExecuteDrop( const 
ExecuteDropEvent& rEvt )
 m_rTreeView.iter_previous_sibling(*xTarget);
 m_rTreeView.set_cursor(*xTarget);
 
-// Remove and insert are required for moving objects in to and out of 
groups.
+// Remove and insert are required for moving objects into and out of 
groups.
 // PutMarked... by itself would suffice if this wasn't allowed.
 
 // Remove the source object from source parent list and insert it in 
the target parent list.
@@ -595,7 +601,8 @@ sal_Int8 SdPageObjsTLVDropTarget::ExecuteDrop( const 
ExecuteDropEvent& rEvt )
 pList->NbcInsertObject(rSourceObject.get());
 }
 
-m_pSdrView->PutMarkedBehindObj(pTargetObject);
+m_bOrderFrontToBack ? m_pSdrView->PutMarkedInFrontOfObj(pTargetObject) 
:
+  m_pSdrView->PutMarkedBehindObj(pTargetObject);
 }
 
 return DND_ACTION_NONE;
@@ -710,6 +717,7 @@ 
SdPageObjsTLV::SdPageObjsTLV(std::unique_ptr xTreeView)
 , m_pOwnMedium(nullptr)
 , m_bLinkableSelected(false)
 , m_bShowAllShapes(false)
+, m_bOrderFrontToBack(false)
 , m_bShowAllPages(false)
 , m_bSelectionHandlerNavigates(false)
 , m_bNavigationGrabsFocus(true)
diff --git a/sd/source/ui/inc/sdtreelb.hxx b/sd/source/ui/inc/sdtreelb.hxx
index 07e79c566df9..38255a66e16f 100644
--- a/sd/source/ui/inc/sdtreelb.hxx
+++ b/sd/source/ui/inc/sdtreelb.hxx
@@ -56,6 +56,7 @@ class SdPageObjsTLVDropTarget final : public DropTargetHelper
 private:
 weld::TreeView& m_rTreeView;
 SdrView* m_pSdrView;
+bool m_bOrderFrontToBack = false;
 
 virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ) override;
 virtual sal_Int8 ExecuteDrop( const 

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

2023-04-24 Thread Jim Raykowski (via logerrit)
 sd/source/ui/dlg/sdtreelb.cxx |   13 -
 sd/source/ui/inc/sdtreelb.hxx |4 
 2 files changed, 12 insertions(+), 5 deletions(-)

New commits:
commit eebd13c97ecef1e39aa054701a6e6618227d7ae0
Author: Jim Raykowski 
AuthorDate: Sat Apr 22 11:23:48 2023 -0800
Commit: Jim Raykowski 
CommitDate: Mon Apr 24 21:00:48 2023 +0200

tdf#145359 related: Fix SdNavigator dnd z ordering

Makes the object dnd z order follow the current behavior of bring
forward and send back actions. Object placement top to bottom in the
Navigator is wrt object z order back to front.

Change-Id: I42e0902eabe7a2758a075a5f4357868994825a51
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150810
Tested-by: Jenkins
Reviewed-by: Jim Raykowski 

diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index 87780bada9aa..efb027c2119c 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -55,6 +55,8 @@
 
 #include 
 
+#include 
+
 using namespace com::sun::star;
 
 bool SdPageObjsTLV::bIsInDrag = false;
@@ -413,6 +415,7 @@ bool SdPageObjsTLV::DoDrag()
 return true;
 }
 
+m_xDropTargetHelper->SetDrawView(pViewShell->GetDrawView());
 bIsInDrag = true;
 
 std::unique_ptr xEntry = m_xTreeView->make_iterator();
@@ -559,8 +562,8 @@ sal_Int8 SdPageObjsTLVDropTarget::ExecuteDrop( const 
ExecuteDropEvent& rEvt )
 m_rTreeView.iter_previous_sibling(*xTarget);
 m_rTreeView.set_cursor(*xTarget);
 
-if (m_rTreeView.iter_compare(*xSourceParent, *xTargetParent) == 0 && 
nIterCompare < 0)
-nTargetPos = m_rTreeView.get_iter_index_in_parent(*xTarget);
+// Remove and insert are required for moving objects in to and out of 
groups.
+// PutMarked... by itself would suffice if this wasn't allowed.
 
 // Remove the source object from source parent list and insert it in 
the target parent list.
 SdrObject* pSourceParentObject = 
weld::fromId(m_rTreeView.get_id(*xSourceParent));
@@ -585,14 +588,14 @@ sal_Int8 SdPageObjsTLVDropTarget::ExecuteDrop( const 
ExecuteDropEvent& rEvt )
 if (pTargetParentObject == reinterpret_cast(1))
 {
 pObjectList->NbcInsertObject(rSourceObject.get());
-pObjectList->SetObjectNavigationPosition(*rSourceObject, 
nTargetPos);
 }
 else
 {
 SdrObjList* pList = pTargetParentObject->GetSubList();
-pList->NbcInsertObject(rSourceObject.get(), nTargetPos);
-pList->SetObjectNavigationPosition(*rSourceObject, nTargetPos);
+pList->NbcInsertObject(rSourceObject.get());
 }
+
+m_pSdrView->PutMarkedBehindObj(pTargetObject);
 }
 
 return DND_ACTION_NONE;
diff --git a/sd/source/ui/inc/sdtreelb.hxx b/sd/source/ui/inc/sdtreelb.hxx
index 81a535c19a05..07e79c566df9 100644
--- a/sd/source/ui/inc/sdtreelb.hxx
+++ b/sd/source/ui/inc/sdtreelb.hxx
@@ -28,6 +28,7 @@
 #include 
 #include 
 
+class SdrView;
 class SdDrawDocument;
 class SfxMedium;
 class SfxViewFrame;
@@ -54,12 +55,15 @@ class SdPageObjsTLVDropTarget final : public 
DropTargetHelper
 {
 private:
 weld::TreeView& m_rTreeView;
+SdrView* m_pSdrView;
 
 virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ) override;
 virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ) override;
 
 public:
 SdPageObjsTLVDropTarget(weld::TreeView& rTreeView);
+
+void SetDrawView(SdrView* pSdrView) { m_pSdrView = pSdrView; }
 };
 
 class SD_DLLPUBLIC SdPageObjsTLV


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

2023-04-24 Thread Caolán McNamara (via logerrit)
 sd/source/ui/inc/FormShellManager.hxx  |3 +++
 sd/source/ui/view/FormShellManager.cxx |9 +++--
 2 files changed, 10 insertions(+), 2 deletions(-)

New commits:
commit 9d77abfa4fd0f352a7a30f3140ab0adfed71bd85
Author: Caolán McNamara 
AuthorDate: Mon Apr 24 08:56:37 2023 +0100
Commit: Caolán McNamara 
CommitDate: Mon Apr 24 12:59:15 2023 +0200

cid#1401342 silence Uncaught exception

Change-Id: I1ff8deeb07c13cc7dee6e5d86f004f840723f056
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150903
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sd/source/ui/inc/FormShellManager.hxx 
b/sd/source/ui/inc/FormShellManager.hxx
index 8b4a773ae5bd..08e31b98ff2f 100644
--- a/sd/source/ui/inc/FormShellManager.hxx
+++ b/sd/source/ui/inc/FormShellManager.hxx
@@ -132,6 +132,9 @@ private:
 (and may be removed in the future.)
 */
 virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override;
+
+/** dtor body */
+void ImplDestroy();
 };
 
 } // end of namespace sd
diff --git a/sd/source/ui/view/FormShellManager.cxx 
b/sd/source/ui/view/FormShellManager.cxx
index bfd1808342ab..d2cb6ebfee21 100644
--- a/sd/source/ui/view/FormShellManager.cxx
+++ b/sd/source/ui/view/FormShellManager.cxx
@@ -64,9 +64,9 @@ FormShellManager::FormShellManager (ViewShellBase& rBase)
 RegisterAtCenterPane();
 }
 
-FormShellManager::~FormShellManager()
+void FormShellManager::ImplDestroy()
 {
-suppress_fun_call_w_exception(SetFormShell(nullptr));
+SetFormShell(nullptr);
 UnregisterAtCenterPane();
 
 // Unregister from the EventMultiplexer.
@@ -81,6 +81,11 @@ FormShellManager::~FormShellManager()
 }
 }
 
+FormShellManager::~FormShellManager()
+{
+suppress_fun_call_w_exception(ImplDestroy());
+}
+
 void FormShellManager::SetFormShell (FmFormShell* pFormShell)
 {
 if (mpFormShell == pFormShell)


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

2023-04-21 Thread Patrick Luby (via logerrit)
 sd/source/console/PresenterProtocolHandler.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit b3f3d1447477428669a6d96dc2d6421de61204ba
Author: Patrick Luby 
AuthorDate: Sun Apr 16 10:10:35 2023 -0400
Commit: Patrick Luby 
CommitDate: Fri Apr 21 19:08:10 2023 +0200

tdf#154546 skip dispatch when presenter controller is not set

mpPresenterController is sometimes unset and this will cause a
crash when pressing the presenter console's Exchange button.

Change-Id: Ibfc866d573ce0c535df5c8fdbd6d358353784854
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150456
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
Reviewed-by: Patrick Luby 

diff --git a/sd/source/console/PresenterProtocolHandler.cxx 
b/sd/source/console/PresenterProtocolHandler.cxx
index 8064f56597c4..ddfb4340c09b 100644
--- a/sd/source/console/PresenterProtocolHandler.cxx
+++ b/sd/source/console/PresenterProtocolHandler.cxx
@@ -307,7 +307,10 @@ Reference SAL_CALL 
PresenterProtocolHandler::queryDispatch (
 
 Reference xDispatch;
 
-if (rURL.Protocol == "vnd.org.libreoffice.presenterscreen:")
+// tdf#154546 skip dispatch when presenter controller is not set
+// mpPresenterController is sometimes unset and this will cause a
+// crash when pressing the presenter console's Exchange button.
+if (rURL.Protocol == "vnd.org.libreoffice.presenterscreen:" && 
mpPresenterController.is())
 {
 xDispatch.set(Dispatch::Create(rURL.Path, mpPresenterController));
 }


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

2023-04-18 Thread Maxim Monastirsky (via logerrit)
 sd/source/ui/table/TableDesignPane.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 61b41646c5a93ca24f2c9f143cdb0da2c9258989
Author: Maxim Monastirsky 
AuthorDate: Tue Apr 18 20:33:38 2023 +0300
Commit: Maxim Monastirsky 
CommitDate: Wed Apr 19 00:53:40 2023 +0200

tdf#154883 Set doc as modified on applying table style

Change-Id: I2a20f35f8b6730f256216cea718ac9020347f119
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150584
Tested-by: Jenkins
Reviewed-by: Maxim Monastirsky 

diff --git a/sd/source/ui/table/TableDesignPane.cxx 
b/sd/source/ui/table/TableDesignPane.cxx
index 216cf09b3b59..c5f20588397b 100644
--- a/sd/source/ui/table/TableDesignPane.cxx
+++ b/sd/source/ui/table/TableDesignPane.cxx
@@ -475,6 +475,7 @@ void TableDesignWidget::ApplyStyle()
 pBindings->Invalidate( SID_REDO );
 }
 }
+setDocumentModified();
 }
 else
 {
@@ -530,6 +531,7 @@ void TableDesignWidget::ApplyOptions()
 pBindings->Invalidate( SID_REDO );
 }
 }
+setDocumentModified();
 }
 
 void TableDesignWidget::onSelectionChanged()


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

2023-04-17 Thread Bayram Çiçek (via logerrit)
 sd/source/ui/func/futext.cxx |  104 +--
 sd/source/ui/inc/futext.hxx  |1 
 2 files changed, 22 insertions(+), 83 deletions(-)

New commits:
commit 059f1e8f291404addeba9341d2c4989976af
Author: Bayram Çiçek 
AuthorDate: Fri Apr 14 00:34:52 2023 +0300
Commit: Maxim Monastirsky 
CommitDate: Tue Apr 18 01:18:57 2023 +0200

tdf#90253: Impress: make TextBox retain its height

- [Impress] drawing a new Text Box and Vertical Text
minimize itself to the height of one line.

- This behavior has changed and inserting a
new TextBox/VerticalText does not shrink itself to
height of one line.

- Unified some common Draw and Impress codes

- removed unnecessary ImpSetAttributesFitCommon(pText)
function, as ImpSetAttributesForNewTextObject(pText)
takes care of the Text Box creations.

- SID_ATTR_CHAR (.uno:Text)
- SID_ATTR_CHAR_VERTICAL (.uno:VerticalText)

Change-Id: Ia944c2b64d5b1fa6970f6afabf41d36bf1643efa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150377
Tested-by: Jenkins
Reviewed-by: Maxim Monastirsky 

diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx
index 60e36e2674b3..f01851668f76 100644
--- a/sd/source/ui/func/futext.cxx
+++ b/sd/source/ui/func/futext.cxx
@@ -509,59 +509,34 @@ bool FuText::MouseMove(const MouseEvent& rMEvt)
 
 void FuText::ImpSetAttributesForNewTextObject(SdrTextObj* pTxtObj)
 {
-if(mpDoc->GetDocumentType() == DocumentType::Impress)
+if( nSlotId == SID_ATTR_CHAR )
 {
-if( nSlotId == SID_ATTR_CHAR )
-{
-/* Create Impress text object (rescales to line height)
-   We get the correct height during the subsequent creation of the
-   object, otherwise we draw too much */
-SfxItemSet aSet(mpViewShell->GetPool());
-aSet.Put(makeSdrTextMinFrameHeightItem(0));
-aSet.Put(makeSdrTextAutoGrowWidthItem(false));
-aSet.Put(makeSdrTextAutoGrowHeightItem(true));
-pTxtObj->SetMergedItemSet(aSet);
-pTxtObj->AdjustTextFrameWidthAndHeight();
-
aSet.Put(makeSdrTextMaxFrameHeightItem(pTxtObj->GetLogicRect().GetSize().Height()));
-pTxtObj->SetMergedItemSet(aSet);
-const SfxViewShell* pCurrentViewShell = SfxViewShell::Current();
-if (pCurrentViewShell && (pCurrentViewShell->isLOKMobilePhone() || 
pCurrentViewShell->isLOKTablet()))
-pTxtObj->SetText(SdResId(STR_PRESOBJ_TEXT_EDIT_MOBILE));
-}
-else if( nSlotId == SID_ATTR_CHAR_VERTICAL )
-{
-SfxItemSet aSet(mpViewShell->GetPool());
-aSet.Put(makeSdrTextMinFrameWidthItem(0));
-aSet.Put(makeSdrTextAutoGrowWidthItem(true));
-aSet.Put(makeSdrTextAutoGrowHeightItem(false));
-
-// Needs to be set since default is SDRTEXTHORZADJUST_BLOCK
-aSet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_RIGHT));
-pTxtObj->SetMergedItemSet(aSet);
-pTxtObj->AdjustTextFrameWidthAndHeight();
-
aSet.Put(makeSdrTextMaxFrameWidthItem(pTxtObj->GetLogicRect().GetSize().Width()));
-pTxtObj->SetMergedItemSet(aSet);
-}
+SfxItemSet aSet(mpViewShell->GetPool());
+aSet.Put(makeSdrTextAutoGrowWidthItem(false));
+aSet.Put(makeSdrTextAutoGrowHeightItem(true));
+pTxtObj->SetMergedItemSet(aSet);
+pTxtObj->AdjustTextFrameWidthAndHeight();
+const SfxViewShell* pCurrentViewShell = SfxViewShell::Current();
+if (pCurrentViewShell && (pCurrentViewShell->isLOKMobilePhone() || 
pCurrentViewShell->isLOKTablet()))
+pTxtObj->SetText(SdResId(STR_PRESOBJ_TEXT_EDIT_MOBILE));
 }
-else
+else if( nSlotId == SID_ATTR_CHAR_VERTICAL )
 {
-if( nSlotId == SID_ATTR_CHAR_VERTICAL )
-{
-// draw text object, needs to be initialized when vertical text is 
used
-SfxItemSet aSet(mpViewShell->GetPool());
+// draw text object, needs to be initialized when vertical text is used
+SfxItemSet aSet(mpViewShell->GetPool());
 
-aSet.Put(makeSdrTextAutoGrowWidthItem(true));
-aSet.Put(makeSdrTextAutoGrowHeightItem(false));
+aSet.Put(makeSdrTextAutoGrowWidthItem(true));
+aSet.Put(makeSdrTextAutoGrowHeightItem(false));
 
-// Set defaults for vertical click-n'drag text object, pool 
defaults are:
-// SdrTextVertAdjustItem: SDRTEXTVERTADJUST_TOP
-// SdrTextHorzAdjustItem: SDRTEXTHORZADJUST_BLOCK
-// Analog to that:
-aSet.Put(SdrTextVertAdjustItem(SDRTEXTVERTADJUST_BLOCK));
-aSet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_RIGHT));
+// Set defaults for vertical click-n'drag text object, pool defaults 
are:
+// SdrTextVertAdjustItem: SDRTEXTVERTADJUST_TOP
+// 

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

2023-04-06 Thread Xisco Fauli (via logerrit)
 sd/source/ui/view/drviews3.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 681c08523cee2dfedb10130eb0120788e1656b2c
Author: Xisco Fauli 
AuthorDate: Thu Apr 6 12:55:50 2023 +0200
Commit: Xisco Fauli 
CommitDate: Thu Apr 6 14:07:37 2023 +0200

sd: fix crash in DrawViewShell::ExecCtrl

See 
https://crashreport.libreoffice.org/stats/signature/sd::DrawViewShell::ExecCtrl(SfxRequest%20&)

I believe this crash is triggered with some basic code while
slideshow is running.
Anyway, if I delete the previous SlideShow::IsRunning(GetViewShellBase())
check, launch Impress and add a new slide, LibreOfice also crashes.

Change-Id: Iba40f37485a4a6815729a1a26c380b6c3fdedfd4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150097
Reviewed-by: Caolán McNamara 
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx
index 5c3a80bdf96e..2a3b778531c1 100644
--- a/sd/source/ui/view/drviews3.cxx
+++ b/sd/source/ui/view/drviews3.cxx
@@ -140,8 +140,8 @@ void  DrawViewShell::ExecCtrl(SfxRequest& rReq)
 // switch page in running slide show
 if(SlideShow::IsRunning(GetViewShellBase()) && rReq.GetArgs())
 {
-const SfxUInt32Item* pWhatPage = 
rReq.GetArg(ID_VAL_WHATPAGE);
-
SlideShow::GetSlideShow(GetViewShellBase())->jumpToPageNumber(static_cast((pWhatPage->GetValue()-1)>>1));
+if (const SfxUInt32Item* pWhatPage = 
rReq.GetArg(ID_VAL_WHATPAGE))
+
SlideShow::GetSlideShow(GetViewShellBase())->jumpToPageNumber(static_cast((pWhatPage->GetValue()-1)>>1));
 }
 else
 {


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

2023-04-05 Thread Stephan Bergmann (via logerrit)
 sd/source/ui/sidebar/PanelFactory.cxx |   13 +
 sd/source/ui/sidebar/PanelFactory.hxx |7 ++-
 2 files changed, 19 insertions(+), 1 deletion(-)

New commits:
commit e489200756d08fd647d3c3ce5ae4f620c3f4baa7
Author: Stephan Bergmann 
AuthorDate: Wed Apr 5 22:58:11 2023 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Apr 6 07:45:20 2023 +0200

Missing XServiceInfo

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

diff --git a/sd/source/ui/sidebar/PanelFactory.cxx 
b/sd/source/ui/sidebar/PanelFactory.cxx
index 752f3db7f1ac..1e39b2ee9c79 100644
--- a/sd/source/ui/sidebar/PanelFactory.cxx
+++ b/sd/source/ui/sidebar/PanelFactory.cxx
@@ -35,6 +35,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 using namespace css;
@@ -128,6 +129,18 @@ Reference SAL_CALL 
PanelFactory::createUIElement (
 aLayoutSize);
 }
 
+OUString PanelFactory::getImplementationName() {
+return "org.openoffice.comp.Draw.framework.PanelFactory";
+}
+
+sal_Bool PanelFactory::supportsService(OUString const & ServiceName) {
+return cppu::supportsService(this, ServiceName);
+}
+
+css::uno::Sequence PanelFactory::getSupportedServiceNames() {
+return {"com.sun.star.drawing.framework.PanelFactory"};
+}
+
 } // end of namespace sd::sidebar
 
 
diff --git a/sd/source/ui/sidebar/PanelFactory.hxx 
b/sd/source/ui/sidebar/PanelFactory.hxx
index 77fc17dbcd35..3462aef11f00 100644
--- a/sd/source/ui/sidebar/PanelFactory.hxx
+++ b/sd/source/ui/sidebar/PanelFactory.hxx
@@ -20,12 +20,13 @@
 
 #include 
 
+#include 
 #include 
 
 namespace sd::sidebar {
 
 typedef comphelper::WeakComponentImplHelper <
-css::ui::XUIElementFactory
+css::ui::XUIElementFactory, css::lang::XServiceInfo
 > PanelFactoryInterfaceBase;
 
 class PanelFactory final
@@ -42,6 +43,10 @@ public:
 css::uno::Reference SAL_CALL createUIElement (
 const OUString& rsResourceURL,
 const css::uno::Sequence& rArguments) 
override;
+
+OUString SAL_CALL getImplementationName() override;
+sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override;
+css::uno::Sequence SAL_CALL getSupportedServiceNames() override;
 };
 
 } // end of namespace sd::sidebar


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

2023-03-22 Thread Michael Stahl (via logerrit)
 sd/source/ui/unoidl/unomodel.cxx |   13 -
 1 file changed, 12 insertions(+), 1 deletion(-)

New commits:
commit fb93cf7e3f70cf711742c5b492d520d9d49c3c5e
Author: Michael Stahl 
AuthorDate: Fri Mar 17 16:39:01 2023 +0100
Commit: Michael Stahl 
CommitDate: Wed Mar 22 09:41:44 2023 +

sd: PDF export: produce annotations for shapes before painting shapes

This is the same order as sw SwEnhancedPDFExportHelper and required to
connect media shape Annot to its StructElem.

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

diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index 61189ca9deaa..3a89e7728e89 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -1944,8 +1944,8 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 
nRenderer, const uno::Any& r
 // hint value if screen display. Only then the AutoColor 
mechanisms shall be applied
 rOutl.SetBackgroundColor( pPage->GetPageBackgroundColor( pPV, 
bScreenDisplay ) );
 }
-aView.SdrPaintView::CompleteRedraw( pOut, aRegion, 
 );
 
+// produce link annots for media shapes before painting them
 if ( pPDFExtOutDevData && pPage )
 {
 try
@@ -2092,7 +2092,18 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 
nRenderer, const uno::Any& r
 }
 }
 }
+}
+catch (const uno::Exception&)
+{
+}
+}
 
+aView.SdrPaintView::CompleteRedraw(pOut, aRegion, 
);
+
+if (pPDFExtOutDevData && pPage)
+{
+try
+{
 SizeaPageSize( mpDoc->GetSdPage( 0, PageKind::Standard 
)->GetSize() );
 Point aPoint( 0, 0 );
 ::tools::Rectangle   aPageRect( aPoint, aPageSize );


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

2023-03-14 Thread Miklos Vajna (via logerrit)
 sd/source/ui/view/ViewTabBar.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit a224948ef44eadfb32aee002d5f0e9f10c9e47de
Author: Miklos Vajna 
AuthorDate: Wed Mar 8 08:58:52 2023 +0100
Commit: Miklos Vajna 
CommitDate: Tue Mar 14 10:14:54 2023 +

sd: fix crash in ViewTabBar::dispose()

Crashreport signature:

program/libsdlo.so
sd::ViewTabBar::disposing()
sd/source/ui/view/ViewTabBar.cxx:113 (discriminator 1)
program/libuno_cppuhelpergcc3.so.3
cppu::WeakComponentImplHelperBase::dispose()
cppuhelper/source/implbase.cxx:104
program/libuno_cppuhelpergcc3.so.3
cppu::WeakComponentImplHelperBase::release()
cppuhelper/source/implbase.cxx:84
program/libsdlo.so

sd::ViewTabBar::ViewTabBar(com::sun::star::uno::Reference
 const&, com::sun::star::uno::Reference 
const&) [clone .cold]
include/cppuhelper/compbase.hxx:65
program/libsdlo.so

sd::framework::BasicToolBarFactory::createResource(com::sun::star::uno::Reference
 const&)
sd/source/ui/framework/factories/BasicToolBarFactory.cxx:129 
(discriminator 2)

I.e. the ViewTabBar got deleted by a smart pointer before its ctor
finished, guard against this.

Change-Id: I3d6ccc21167355047e3752316c8d0b9b02470f57
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148838
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/sd/source/ui/view/ViewTabBar.cxx b/sd/source/ui/view/ViewTabBar.cxx
index d612d7560d32..99b78f27c31f 100644
--- a/sd/source/ui/view/ViewTabBar.cxx
+++ b/sd/source/ui/view/ViewTabBar.cxx
@@ -66,6 +66,9 @@ ViewTabBar::ViewTabBar (
   mpViewShellBase(nullptr),
   mnNoteBookWidthPadding(0)
 {
+// Do this manually instead of via uno::Reference, so we don't delete 
ourselves.
+osl_atomic_increment(_refCount);
+
 // Tunnel through the controller and use the ViewShellBase to obtain the
 // view frame.
 if (mxController)
@@ -92,6 +95,8 @@ ViewTabBar::ViewTabBar (
 {
 mpViewShellBase->SetViewTabBar(this);
 }
+
+osl_atomic_decrement(_refCount);
 }
 
 ViewTabBar::~ViewTabBar()


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

2023-03-09 Thread Julien Nabet (via logerrit)
 sd/source/filter/ppt/propread.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit ee19ca22866c99be6422abd7c6ad2ffe51020b5e
Author: Julien Nabet 
AuthorDate: Tue Mar 7 22:04:45 2023 +0100
Commit: Julien Nabet 
CommitDate: Thu Mar 9 12:48:06 2023 +

Wrong value for VT_UI4 (sd/propread)

9 instead of 19
see 
https://learn.microsoft.com/en-us/windows/win32/api/wtypes/ne-wtypes-varenum

Change-Id: I00283e117a2a2fd2d5165047bf7dcad82ffc18ca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148446
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
Reviewed-by: Julien Nabet 

diff --git a/sd/source/filter/ppt/propread.hxx 
b/sd/source/filter/ppt/propread.hxx
index 402a046241c4..d5521a6020d5 100644
--- a/sd/source/filter/ppt/propread.hxx
+++ b/sd/source/filter/ppt/propread.hxx
@@ -52,7 +52,6 @@
 #define VT_CY   6
 #define VT_DATE 7
 #define VT_BSTR 8
-#define VT_UI4  9
 #define VT_ERROR10
 #define VT_BOOL 11
 #define VT_VARIANT  12
@@ -60,6 +59,7 @@
 #define VT_I1   16
 #define VT_UI1  17
 #define VT_UI2  18
+#define VT_UI4  19
 #define VT_I8   20
 #define VT_UI8  21
 #define VT_INT  22


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

2023-03-03 Thread Caolán McNamara (via logerrit)
 sd/source/ui/app/sdxfer.cxx   |9 +
 sd/source/ui/dlg/sdtreelb.cxx |9 +
 2 files changed, 2 insertions(+), 16 deletions(-)

New commits:
commit 4f45d7bb863a991e70adcea4848377a3c65f7194
Author: Caolán McNamara 
AuthorDate: Fri Mar 3 10:56:54 2023 +
Commit: Caolán McNamara 
CommitDate: Fri Mar 3 17:19:37 2023 +

Related: tdf#94319 object pasted in draw/impress is always centered

this is a recent problem since:

commit d60722e29a0dde6282915188e5ff7e24890a14d3
Date:   Thu Jan 12 16:25:40 2023 +0200

XUnoTunnel->dynamic_cast in TransferableHelper

Change-Id: I764b62d7a395d01f8e86174ce8e4d30dfeb80ead
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148171
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sd/source/ui/app/sdxfer.cxx b/sd/source/ui/app/sdxfer.cxx
index e7fb0ff357f9..2e048542f9b6 100644
--- a/sd/source/ui/app/sdxfer.cxx
+++ b/sd/source/ui/app/sdxfer.cxx
@@ -729,14 +729,7 @@ const css::uno::Sequence< sal_Int8 >& 
SdTransferable::getUnoTunnelId()
 
 SdTransferable* SdTransferable::getImplementation( const Reference< XInterface 
>& rxData ) noexcept
 {
-try
-{
-return comphelper::getFromUnoTunnel(rxData);
-}
-catch( const css::uno::Exception& )
-{
-}
-return nullptr;
+return dynamic_cast(rxData.get());
 }
 
 void SdTransferable::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index 5b2d092cb105..87780bada9aa 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -118,14 +118,7 @@ void SdPageObjsTLV::SdPageObjsTransferable::DragFinished( 
sal_Int8 nDropAction )
 SdPageObjsTLV::SdPageObjsTransferable* 
SdPageObjsTLV::SdPageObjsTransferable::getImplementation( const 
css::uno::Reference< css::uno::XInterface >& rxData )
 noexcept
 {
-try
-{
-return 
comphelper::getFromUnoTunnel(rxData);
-}
-catch( const css::uno::Exception& )
-{
-}
-return nullptr;
+return dynamic_cast(rxData.get());
 }
 
 SotClipboardFormatId 
SdPageObjsTLV::SdPageObjsTransferable::GetListBoxDropFormatId()


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

2023-03-02 Thread Noel Grandin (via logerrit)
 sd/source/ui/accessibility/AccessibleSlideSorterView.cxx |   21 +++
 sd/source/ui/inc/AccessibleSlideSorterView.hxx   |   10 ---
 2 files changed, 17 insertions(+), 14 deletions(-)

New commits:
commit 4cd6cba3edcba6497220924acc6716ea6027e559
Author: Noel Grandin 
AuthorDate: Fri Mar 3 08:45:45 2023 +0200
Commit: Noel Grandin 
CommitDate: Fri Mar 3 07:58:05 2023 +

Revert "BaseMutex->std::mutex in AccessibleSlideSorterView"

This reverts commit 64c19da4c924c45df037c075ef88d1f01a5abbe9, which
is causing deadlock when loading
 https://bugs.documentfoundation.org/attachment.cgi?id=180272
in gtk3

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

diff --git a/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx 
b/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx
index ae9a45ea73f4..4c197a71279a 100644
--- a/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx
+++ b/sd/source/ui/accessibility/AccessibleSlideSorterView.cxx
@@ -113,7 +113,8 @@ private:
 AccessibleSlideSorterView::AccessibleSlideSorterView(
 ::sd::slidesorter::SlideSorter& rSlideSorter,
 vcl::Window* pContentWindow)
-: mrSlideSorter(rSlideSorter),
+: AccessibleSlideSorterViewBase(m_aMutex),
+  mrSlideSorter(rSlideSorter),
   mnClientId(0),
   mpContentWindow(pContentWindow)
 {
@@ -147,7 +148,7 @@ void AccessibleSlideSorterView::FireAccessibleEvent (
 }
 }
 
-void AccessibleSlideSorterView::disposing(std::unique_lock& 
/*rGuard*/)
+void SAL_CALL AccessibleSlideSorterView::disposing()
 {
 if (mnClientId != 0)
 {
@@ -161,7 +162,7 @@ AccessibleSlideSorterObject* 
AccessibleSlideSorterView::GetAccessibleChildImplem
 sal_Int32 nIndex)
 {
 AccessibleSlideSorterObject* pResult = nullptr;
-std::unique_lock aGuard (m_aMutex);
+::osl::MutexGuard aGuard (m_aMutex);
 
 if (nIndex>=0 && nIndexGetVisibleChildCount())
 pResult = mpImpl->GetVisibleChild(nIndex);
@@ -171,7 +172,7 @@ AccessibleSlideSorterObject* 
AccessibleSlideSorterView::GetAccessibleChildImplem
 
 void AccessibleSlideSorterView::Destroyed()
 {
-std::unique_lock aGuard (m_aMutex);
+::osl::MutexGuard aGuard (m_aMutex);
 
 // Send a disposing to all listeners.
 if (mnClientId != 0)
@@ -195,7 +196,7 @@ Reference SAL_CALL
 sal_Int64 SAL_CALL AccessibleSlideSorterView::getAccessibleChildCount()
 {
 ThrowIfDisposed();
-std::unique_lock aGuard (m_aMutex);
+::osl::MutexGuard aGuard (m_aMutex);
 return mpImpl->GetVisibleChildCount();
 }
 
@@ -203,7 +204,7 @@ Reference SAL_CALL
 AccessibleSlideSorterView::getAccessibleChild (sal_Int64 nIndex)
 {
 ThrowIfDisposed();
-std::unique_lock aGuard (m_aMutex);
+::osl::MutexGuard aGuard (m_aMutex);
 
 if (nIndex<0 || nIndex>=mpImpl->GetVisibleChildCount())
 throw lang::IndexOutOfBoundsException();
@@ -322,9 +323,9 @@ void SAL_CALL 
AccessibleSlideSorterView::addAccessibleEventListener(
 if (!rxListener.is())
 return;
 
-std::unique_lock aGuard(m_aMutex);
+const osl::MutexGuard aGuard(m_aMutex);
 
-if (m_bDisposed)
+if (rBHelper.bDisposed || rBHelper.bInDispose)
 {
 uno::Reference x (static_cast(this), uno::UNO_QUERY);
 rxListener->disposing (lang::EventObject (x));
@@ -344,7 +345,7 @@ void SAL_CALL 
AccessibleSlideSorterView::removeAccessibleEventListener(
 if (!rxListener.is())
 return;
 
-std::unique_lock aGuard(m_aMutex);
+const osl::MutexGuard aGuard(m_aMutex);
 
 if (mnClientId == 0)
 return;
@@ -622,7 +623,7 @@ uno::Sequence< OUString> SAL_CALL
 
 void AccessibleSlideSorterView::ThrowIfDisposed()
 {
-if (m_bDisposed)
+if (rBHelper.bDisposed || rBHelper.bInDispose)
 {
 SAL_WARN("sd", "Calling disposed object. Throwing exception:");
 throw lang::DisposedException ("object has been already disposed",
diff --git a/sd/source/ui/inc/AccessibleSlideSorterView.hxx 
b/sd/source/ui/inc/AccessibleSlideSorterView.hxx
index 66bcc8b5ced0..0cbaf62ed586 100644
--- a/sd/source/ui/inc/AccessibleSlideSorterView.hxx
+++ b/sd/source/ui/inc/AccessibleSlideSorterView.hxx
@@ -19,7 +19,8 @@
 
 #pragma once
 
-#include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -37,7 +38,7 @@ namespace accessibility {
 
 class AccessibleSlideSorterObject;
 
-typedef ::comphelper::WeakComponentImplHelper<
+typedef ::cppu::WeakComponentImplHelper<
 css::accessibility::XAccessible,
 css::accessibility::XAccessibleEventBroadcaster,
 css::accessibility::XAccessibleContext,
@@ -51,7 +52,8 @@ typedef ::comphelper::WeakComponentImplHelper<
 accessible.
 */
 class AccessibleSlideSorterView
-: public AccessibleSlideSorterViewBase
+: public cppu::BaseMutex,
+  public AccessibleSlideSorterViewBase
 {
 public:
 

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

2023-02-24 Thread Noel Grandin (via logerrit)
 sd/source/ui/inc/tools/PropertySet.hxx |   11 +++
 sd/source/ui/tools/PropertySet.cxx |   11 +++
 2 files changed, 6 insertions(+), 16 deletions(-)

New commits:
commit e0f05df76177174fce1d662b211b3047237debae
Author: Noel Grandin 
AuthorDate: Thu Feb 23 15:31:34 2023 +0200
Commit: Noel Grandin 
CommitDate: Fri Feb 24 08:10:25 2023 +

BaseMutex->std::mutex in sd::tools::PropertySet

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

diff --git a/sd/source/ui/inc/tools/PropertySet.hxx 
b/sd/source/ui/inc/tools/PropertySet.hxx
index c432783da394..04727be0dbe4 100644
--- a/sd/source/ui/inc/tools/PropertySet.hxx
+++ b/sd/source/ui/inc/tools/PropertySet.hxx
@@ -19,15 +19,14 @@
 
 #pragma once
 
-#include 
-#include 
+#include 
 #include 
 #include 
 #include 
 
 namespace sd::tools {
 
-typedef ::cppu::WeakComponentImplHelper <
+typedef ::comphelper::WeakComponentImplHelper <
 css::beans::XPropertySet
 > PropertySetInterfaceBase;
 
@@ -38,16 +37,12 @@ typedef ::cppu::WeakComponentImplHelper <
 In order to use it you have to derive from this class and implement the
 GetPropertyValue() and SetPropertyValue() methods.
 */
-class PropertySet
-: protected ::cppu::BaseMutex,
-  public PropertySetInterfaceBase
+class PropertySet : public PropertySetInterfaceBase
 {
 public:
 explicit PropertySet();
 virtual ~PropertySet() override;
 
-virtual void SAL_CALL disposing() override;
-
 // XPropertySet
 
 virtual css::uno::Reference
diff --git a/sd/source/ui/tools/PropertySet.cxx 
b/sd/source/ui/tools/PropertySet.cxx
index 057b7dd96ce3..c50a617de1b0 100644
--- a/sd/source/ui/tools/PropertySet.cxx
+++ b/sd/source/ui/tools/PropertySet.cxx
@@ -26,8 +26,7 @@ using namespace ::com::sun::star::uno;
 namespace sd::tools {
 
 PropertySet::PropertySet()
-: PropertySetInterfaceBase(m_aMutex),
-  mpChangeListeners(new ChangeListenerContainer)
+: mpChangeListeners(new ChangeListenerContainer)
 {
 }
 
@@ -35,10 +34,6 @@ PropertySet::~PropertySet()
 {
 }
 
-void SAL_CALL PropertySet::disposing()
-{
-}
-
 //- XPropertySet --
 
 Reference SAL_CALL PropertySet::getPropertySetInfo()
@@ -83,7 +78,7 @@ void SAL_CALL PropertySet::addPropertyChangeListener (
 if ( ! rxListener.is())
 throw lang::IllegalArgumentException();
 
-if (rBHelper.bDisposed || rBHelper.bInDispose)
+if (m_bDisposed)
 return;
 
 mpChangeListeners->emplace(rsPropertyName, rxListener);
@@ -145,7 +140,7 @@ void PropertySet::CallListeners (
 
 void PropertySet::ThrowIfDisposed()
 {
-if (rBHelper.bDisposed || rBHelper.bInDispose)
+if (m_bDisposed)
 {
 throw lang::DisposedException (
 "PropertySet object has already been disposed",


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

2023-02-21 Thread Noel Grandin (via logerrit)
 sd/source/console/PresenterTimer.cxx |8 
 sd/source/console/PresenterTimer.hxx |4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 3a1a303291ef5500932cac4981d910f9aebfb606
Author: Noel Grandin 
AuthorDate: Tue Feb 21 12:45:10 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue Feb 21 17:18:17 2023 +

osl::Mutex->std::mutex in PresenterTimer

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

diff --git a/sd/source/console/PresenterTimer.cxx 
b/sd/source/console/PresenterTimer.cxx
index b9a4b62815c4..ed7be4cbc9c1 100644
--- a/sd/source/console/PresenterTimer.cxx
+++ b/sd/source/console/PresenterTimer.cxx
@@ -468,7 +468,7 @@ PresenterClockTimer::~PresenterClockTimer()
 
 void PresenterClockTimer::AddListener (const SharedListener& rListener)
 {
-osl::MutexGuard aGuard (maMutex);
+std::unique_lock aGuard (maMutex);
 
 maListeners.push_back(rListener);
 
@@ -485,7 +485,7 @@ void PresenterClockTimer::AddListener (const 
SharedListener& rListener)
 
 void PresenterClockTimer::RemoveListener (const SharedListener& rListener)
 {
-osl::MutexGuard aGuard (maMutex);
+std::unique_lock aGuard (maMutex);
 
 ListenerContainer::iterator iListener (::std::find(
 maListeners.begin(),
@@ -519,7 +519,7 @@ void PresenterClockTimer::CheckCurrentTime (const 
TimeValue& rCurrentTime)
 css::uno::Reference xRequestCallback;
 css::uno::Reference xCallback;
 {
-osl::MutexGuard aGuard (maMutex);
+std::unique_lock aGuard (maMutex);
 
 TimeValue aCurrentTime (rCurrentTime);
 oslDateTime aDateTime;
@@ -554,7 +554,7 @@ void SAL_CALL PresenterClockTimer::notify (const 
css::uno::Any&)
 ListenerContainer aListenerCopy;
 
 {
-osl::MutexGuard aGuard (maMutex);
+std::unique_lock aGuard (maMutex);
 
 mbIsCallbackPending = false;
 
diff --git a/sd/source/console/PresenterTimer.hxx 
b/sd/source/console/PresenterTimer.hxx
index 1c2b6530b759..8cba60a22346 100644
--- a/sd/source/console/PresenterTimer.hxx
+++ b/sd/source/console/PresenterTimer.hxx
@@ -24,13 +24,13 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
 
 #include 
 #include 
+#include 
 #include 
 
 namespace com::sun::star::uno { class XComponentContext; }
@@ -99,7 +99,7 @@ public:
 private:
 static ::rtl::Reference mpInstance;
 
-::osl::Mutex maMutex;
+std::mutex maMutex;
 typedef ::std::vector ListenerContainer;
 ListenerContainer maListeners;
 oslDateTime maDateTime;


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

2023-02-15 Thread Caolán McNamara (via logerrit)
 sd/source/ui/app/sdmod1.cxx |9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit af35aac915019d0199c8628211e709b395e88735
Author: Caolán McNamara 
AuthorDate: Wed Feb 15 09:26:16 2023 +
Commit: Caolán McNamara 
CommitDate: Wed Feb 15 11:31:39 2023 +

crashreporter: apparent null dereference

Change-Id: I83f0765311ffdb34a0c08aaf616fdbde4e5110a7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147048
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sd/source/ui/app/sdmod1.cxx b/sd/source/ui/app/sdmod1.cxx
index 927b37ae830e..573ee853069b 100644
--- a/sd/source/ui/app/sdmod1.cxx
+++ b/sd/source/ui/app/sdmod1.cxx
@@ -493,9 +493,12 @@ SfxFrame* SdModule::ExecuteNewDocument( SfxRequest const & 
rReq )
 // was open
 if (pFrame && SfxApplication::IsTipOfTheDayDue() && 
!SfxApplication::IsHeadlessOrUITest())
 {
-// tdf#127946 pass in argument for dialog parent
-SfxUnoFrameItem aDocFrame(SID_FILLFRAME, 
pFrame->GetFrameInterface());
-GetDispatcher()->ExecuteList(SID_TIPOFTHEDAY, 
SfxCallMode::SLOT, {}, {  });
+if (SfxDispatcher* pDispatcher = GetDispatcher())
+{
+// tdf#127946 pass in argument for dialog parent
+SfxUnoFrameItem aDocFrame(SID_FILLFRAME, 
pFrame->GetFrameInterface());
+pDispatcher->ExecuteList(SID_TIPOFTHEDAY, 
SfxCallMode::SLOT, {}, {  });
+}
 }
 }
 }


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

2023-02-11 Thread Rafael Lima (via logerrit)
 sd/source/ui/view/drviewse.cxx |   11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

New commits:
commit c96e1ec61835bc01e2969ec97fce9a1674fbf6d7
Author: Rafael Lima 
AuthorDate: Sat Feb 11 16:36:00 2023 -0300
Commit: Jim Raykowski 
CommitDate: Sat Feb 11 21:07:31 2023 +

tdf#45705 Make SID_ZOOM_IN and SID_ZOOM_OUT smoother in Impress

As reported in the bug ticket, the commands SID_ZOOM_IN and SID_ZOOM_OUT 
are not smooth and increase/decrease zoom at too big steps.

This patch uses basegfx::zoomtools to zoom in and out, making it smoother.

Change-Id: I801fa6123bf0696046e5d45c7a6b309e7cc3312e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146825
Tested-by: Jenkins
Reviewed-by: Jim Raykowski 

diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx
index b3183397a084..5a6a7577951e 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -95,6 +95,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -1189,8 +1190,11 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
 
 case SID_ZOOM_OUT:  // BASIC
 {
+const sal_uInt16 nOldZoom = GetActiveWindow()->GetZoom();
+const sal_uInt16 nNewZoom = basegfx::zoomtools::zoomOut(nOldZoom);
+SetZoom(nNewZoom);
+
 mbZoomOnPage = false;
-SetZoom( std::max<::tools::Long>( GetActiveWindow()->GetZoom() / 
2, GetActiveWindow()->GetMinZoom() ) );
 ::tools::Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( 
::tools::Rectangle( Point(0,0),
   
GetActiveWindow()->GetOutputSizePixel()) );
 mpZoomList->InsertZoomRect(aVisAreaWin);
@@ -1203,8 +1207,11 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
 
 case SID_ZOOM_IN:
 {
+const sal_uInt16 nOldZoom = GetActiveWindow()->GetZoom();
+const sal_uInt16 nNewZoom = basegfx::zoomtools::zoomIn(nOldZoom);
+SetZoom(nNewZoom);
+
 mbZoomOnPage = false;
-SetZoom( std::min<::tools::Long>( GetActiveWindow()->GetZoom() * 
2, GetActiveWindow()->GetMaxZoom() ) );
 ::tools::Rectangle aVisAreaWin = GetActiveWindow()->PixelToLogic( 
::tools::Rectangle( Point(0,0),
   
GetActiveWindow()->GetOutputSizePixel()) );
 mpZoomList->InsertZoomRect(aVisAreaWin);


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

2023-02-05 Thread Noel Grandin (via logerrit)
 sd/source/ui/framework/tools/FrameworkHelper.cxx |4 ++--
 sd/source/ui/inc/framework/FrameworkHelper.hxx   |3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 90a043f2589a70f6e035ba350ff7f673ae677f2e
Author: Noel Grandin 
AuthorDate: Thu Feb 2 09:41:48 2023 +0200
Commit: Noel Grandin 
CommitDate: Sun Feb 5 09:54:31 2023 +

osl::Mutex->std::mutex in sd::framework::FrameworkHelper

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

diff --git a/sd/source/ui/framework/tools/FrameworkHelper.cxx 
b/sd/source/ui/framework/tools/FrameworkHelper.cxx
index 1b227d7ca6fd..4fd911574abf 100644
--- a/sd/source/ui/framework/tools/FrameworkHelper.cxx
+++ b/sd/source/ui/framework/tools/FrameworkHelper.cxx
@@ -279,11 +279,11 @@ public:
 FrameworkHelper::ViewURLMap FrameworkHelper::maViewURLMap;
 
 FrameworkHelper::InstanceMap FrameworkHelper::maInstanceMap;
-osl::Mutex FrameworkHelper::maInstanceMapMutex;
+std::mutex FrameworkHelper::maInstanceMapMutex;
 
 ::std::shared_ptr FrameworkHelper::Instance (ViewShellBase& 
rBase)
 {
-::osl::MutexGuard aGuard(maInstanceMapMutex);
+std::unique_lock aGuard(maInstanceMapMutex);
 
 InstanceMap::const_iterator iHelper (maInstanceMap.find());
 if (iHelper != maInstanceMap.end())
diff --git a/sd/source/ui/inc/framework/FrameworkHelper.hxx 
b/sd/source/ui/inc/framework/FrameworkHelper.hxx
index 4d8278d90ed0..57de645de100 100644
--- a/sd/source/ui/inc/framework/FrameworkHelper.hxx
+++ b/sd/source/ui/inc/framework/FrameworkHelper.hxx
@@ -26,6 +26,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace com::sun::star::drawing::framework { class XConfigurationController; 
}
 namespace com::sun::star::drawing::framework { class XResourceId; }
@@ -293,7 +294,7 @@ private:
 static InstanceMap maInstanceMap;
 class ViewURLMap;
 static ViewURLMap maViewURLMap;
-static osl::Mutex maInstanceMapMutex;
+static std::mutex maInstanceMapMutex;
 
 ViewShellBase& mrBase;
 css::uno::Reference


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

2023-02-01 Thread Noel Grandin (via logerrit)
 sd/source/ui/unoidl/randomnode.cxx |   71 +
 1 file changed, 34 insertions(+), 37 deletions(-)

New commits:
commit 63b4126116ee0c92f8dbf2b54a2afacf8eed74cf
Author: Noel Grandin 
AuthorDate: Wed Feb 1 14:19:21 2023 +0200
Commit: Noel Grandin 
CommitDate: Thu Feb 2 06:59:51 2023 +

osl::Mutex->std::mutex in sd::RandomAnimationNode

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

diff --git a/sd/source/ui/unoidl/randomnode.cxx 
b/sd/source/ui/unoidl/randomnode.cxx
index a87ae1783721..08c0e9fda594 100644
--- a/sd/source/ui/unoidl/randomnode.cxx
+++ b/sd/source/ui/unoidl/randomnode.cxx
@@ -34,12 +34,9 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
-
-using ::osl::Mutex;
-using ::osl::Guard;
+#include 
 
 using ::com::sun::star::uno::Reference;
 using ::com::sun::star::uno::Sequence;
@@ -139,7 +136,7 @@ public:
 
 private:
 // our first, last and only protection from multi-threads!
-Mutex maMutex;
+std::mutex maMutex;
 
 sal_Int16 mnPresetClass;
 WeakReference mxParent;
@@ -227,215 +224,215 @@ void SAL_CALL RandomAnimationNode::initialize( const 
Sequence< Any >& aArguments
 // XAnimationNode
 sal_Int16 SAL_CALL RandomAnimationNode::getType()
 {
-Guard< Mutex > aGuard( maMutex );
+std::unique_lock aGuard( maMutex );
 return css::animations::AnimationNodeType::PAR;
 }
 
 // XAnimationNode
 Any SAL_CALL RandomAnimationNode::getBegin()
 {
-Guard< Mutex > aGuard( maMutex );
+std::unique_lock aGuard( maMutex );
 return maBegin;
 }
 
 // XAnimationNode
 void SAL_CALL RandomAnimationNode::setBegin( const Any& _begin )
 {
-Guard< Mutex > aGuard( maMutex );
+std::unique_lock aGuard( maMutex );
 maBegin = _begin;
 }
 
 // XAnimationNode
 Any SAL_CALL RandomAnimationNode::getDuration()
 {
-Guard< Mutex > aGuard( maMutex );
+std::unique_lock aGuard( maMutex );
 return maDuration;
 }
 
 // XAnimationNode
 void SAL_CALL RandomAnimationNode::setDuration( const Any& _duration )
 {
-Guard< Mutex > aGuard( maMutex );
+std::unique_lock aGuard( maMutex );
 maDuration = _duration;
 }
 
 // XAnimationNode
 Any SAL_CALL RandomAnimationNode::getEnd()
 {
-Guard< Mutex > aGuard( maMutex );
+std::unique_lock aGuard( maMutex );
 return maEnd;
 }
 
 // XAnimationNode
 void SAL_CALL RandomAnimationNode::setEnd( const Any& _end )
 {
-Guard< Mutex > aGuard( maMutex );
+std::unique_lock aGuard( maMutex );
 maEnd = _end;
 }
 
 // XAnimationNode
 Any SAL_CALL RandomAnimationNode::getEndSync()
 {
-Guard< Mutex > aGuard( maMutex );
+std::unique_lock aGuard( maMutex );
 return maEndSync;
 }
 
 // XAnimationNode
 void SAL_CALL RandomAnimationNode::setEndSync( const Any& _endsync )
 {
-Guard< Mutex > aGuard( maMutex );
+std::unique_lock aGuard( maMutex );
 maEndSync = _endsync;
 }
 
 // XAnimationNode
 Any SAL_CALL RandomAnimationNode::getRepeatCount()
 {
-Guard< Mutex > aGuard( maMutex );
+std::unique_lock aGuard( maMutex );
 return maRepeatCount;
 }
 
 // XAnimationNode
 void SAL_CALL RandomAnimationNode::setRepeatCount( const Any& _repeatcount )
 {
-Guard< Mutex > aGuard( maMutex );
+std::unique_lock aGuard( maMutex );
 maRepeatCount = _repeatcount;
 }
 
 // XAnimationNode
 Any SAL_CALL RandomAnimationNode::getRepeatDuration()
 {
-Guard< Mutex > aGuard( maMutex );
+std::unique_lock aGuard( maMutex );
 return maRepeatDuration;
 }
 
 // XAnimationNode
 void SAL_CALL RandomAnimationNode::setRepeatDuration( const Any& 
_repeatduration )
 {
-Guard< Mutex > aGuard( maMutex );
+std::unique_lock aGuard( maMutex );
 maRepeatDuration = _repeatduration;
 }
 
 // XAnimationNode
 sal_Int16 SAL_CALL RandomAnimationNode::getFill()
 {
-Guard< Mutex > aGuard( maMutex );
+std::unique_lock aGuard( maMutex );
 return mnFill;
 }
 
 // XAnimationNode
 void SAL_CALL RandomAnimationNode::setFill( sal_Int16 _fill )
 {
-Guard< Mutex > aGuard( maMutex );
+std::unique_lock aGuard( maMutex );
 mnFill = _fill;
 }
 
 // XAnimationNode
 sal_Int16 SAL_CALL RandomAnimationNode::getFillDefault()
 {
-Guard< Mutex > aGuard( maMutex );
+std::unique_lock aGuard( maMutex );
 return mnFillDefault;
 }
 
 // XAnimationNode
 void SAL_CALL RandomAnimationNode::setFillDefault( sal_Int16 _filldefault )
 {
-Guard< Mutex > aGuard( maMutex );
+std::unique_lock aGuard( maMutex );
 mnFillDefault = _filldefault;
 }
 
 // XAnimationNode
 sal_Int16 SAL_CALL RandomAnimationNode::getRestart()
 {
-Guard< Mutex > aGuard( maMutex );
+std::unique_lock aGuard( maMutex );
 return mnRestart;
 }
 
 // XAnimationNode
 void SAL_CALL RandomAnimationNode::setRestart( sal_Int16 _restart )
 {
-Guard< Mutex > aGuard( maMutex );
+std::unique_lock aGuard( maMutex );
 

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

2023-01-31 Thread Mike Kaganski (via logerrit)
 sd/source/ui/app/sdxfer.cxx   |2 +-
 svx/source/customshapes/EnhancedCustomShape3d.cxx |7 ---
 svx/source/svdraw/svdmodel.cxx|2 +-
 svx/source/svdraw/svdograf.cxx|   12 ++--
 svx/source/svdraw/svdotext.cxx|6 +-
 svx/source/svdraw/svdxcgv.cxx |   18 +-
 6 files changed, 10 insertions(+), 37 deletions(-)

New commits:
commit f4804a8fb60cc999c9b08bf451732749b44eb355
Author: Mike Kaganski 
AuthorDate: Tue Jan 31 09:42:50 2023 +0300
Commit: Mike Kaganski 
CommitDate: Tue Jan 31 09:30:16 2023 +

Some simplification after 743dd1d3c1142c1c99b0844cc26dd0be91a1de40

MapMode ctor taking origin and scales sets mbSimple to false, so
avoid calling it when these are the defaults.

Some calculations become unneeded when the fraction is (1, 1).

Change-Id: I19a98ad2cac0a66b9bd7b72620180addb3f7fec4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146375
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/sd/source/ui/app/sdxfer.cxx b/sd/source/ui/app/sdxfer.cxx
index 95d9e9aa1cee..e7fb0ff357f9 100644
--- a/sd/source/ui/app/sdxfer.cxx
+++ b/sd/source/ui/app/sdxfer.cxx
@@ -251,7 +251,7 @@ void SdTransferable::CreateData()
 CreateObjectReplacement( pPage->GetObj( 0 ) );
 
 mpVDev = VclPtr::Create( 
*Application::GetDefaultDevice() );
-mpVDev->SetMapMode(MapMode(mpSdDrawDocumentIntern->GetScaleUnit(), 
Point(), Fraction(1,1), Fraction(1,1)));
+mpVDev->SetMapMode(MapMode(mpSdDrawDocumentIntern->GetScaleUnit()));
 mpSdViewIntern = new ::sd::View( *mpSdDrawDocumentIntern, mpVDev );
 mpSdViewIntern->EndListening(*mpSdDrawDocumentIntern );
 mpSdViewIntern->hideMarkHandles();
diff --git a/svx/source/customshapes/EnhancedCustomShape3d.cxx 
b/svx/source/customshapes/EnhancedCustomShape3d.cxx
index 9a0ef6bebf92..468a1c66fa93 100644
--- a/svx/source/customshapes/EnhancedCustomShape3d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape3d.cxx
@@ -238,13 +238,6 @@ rtl::Reference 
EnhancedCustomShape3d::Create3DObject(
 rtl::Reference pRet;
 const SdrCustomShapeGeometryItem& 
rGeometryItem(rSdrObjCustomShape.GetMergedItem(SDRATTR_CUSTOMSHAPE_GEOMETRY));
 double fMap(1.0), *pMap = nullptr;
-Fraction aFraction(1, 1);
-
-if ( aFraction.GetNumerator() != 1 || aFraction.GetDenominator() != 1 )
-{
-fMap *= double(aFraction);
-pMap = 
-}
 
 if ( rSdrObjCustomShape.getSdrModelFromSdrObject().GetScaleUnit() != 
MapUnit::Map100thMM )
 {
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index 73d99b29d5ad..eb971b7f6b30 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -682,7 +682,7 @@ void SdrModel::ImpSetOutlinerDefaults( SdrOutliner* 
pOutliner, bool bInit )
 
 if ( !GetRefDevice() )
 {
-MapMode aMapMode(m_eObjUnit, Point(0,0), Fraction(1,1), Fraction(1,1));
+MapMode aMapMode(m_eObjUnit);
 pOutliner->SetRefMapMode(aMapMode);
 }
 }
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index 9ac5536c5716..d9becdfdb80d 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -387,11 +387,7 @@ Graphic SdrGrafObj::GetTransformedGraphic( 
SdrGrafObjTransformsAttrs nTransformF
 {
 // Refactored most of the code to GraphicObject, where
 // everybody can use e.g. the cropping functionality
-MapMode aDestMap(
-getSdrModelFromSdrObject().GetScaleUnit(),
-Point(),
-Fraction(1,1),
-Fraction(1,1));
+MapMode aDestMap(getSdrModelFromSdrObject().GetScaleUnit());
 const Size aDestSize( GetLogicRect().GetSize() );
 GraphicAttr aActAttr = GetGraphicAttr(nTransformFlags);
 
@@ -869,11 +865,7 @@ GDIMetaFile 
SdrGrafObj::getMetafileFromEmbeddedVectorGraphicData() const
 {
 ScopedVclPtrInstance< VirtualDevice > pOut;
 const tools::Rectangle aBoundRect(GetCurrentBoundRect());
-const MapMode aMap(
-getSdrModelFromSdrObject().GetScaleUnit(),
-Point(),
-Fraction(1,1),
-Fraction(1,1));
+const MapMode aMap(getSdrModelFromSdrObject().GetScaleUnit());
 
 pOut->EnableOutput(false);
 pOut->SetMapMode(aMap);
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index ad27f101c6cb..078e067aa14e 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -1324,11 +1324,7 @@ void SdrTextObj::UpdateOutlinerFormatting( SdrOutliner& 
rOutl, tools::Rectangle&
 Fraction aFitXCorrection(1,1);
 
 const bool bContourFrame(IsContourTextFrame());
-const MapMode aMapMode(
-getSdrModelFromSdrObject().GetScaleUnit(),
-Point(0,0),
-Fraction(1,1),
-Fraction(1,1));
+const MapMode 

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

2023-01-28 Thread Mark Hung (via logerrit)
 sd/source/filter/eppt/pptx-animations-nodectx.cxx |   27 
 sd/source/filter/eppt/pptx-animations-nodectx.hxx |5 ++
 sd/source/filter/eppt/pptx-animations.cxx |   47 +++---
 3 files changed, 40 insertions(+), 39 deletions(-)

New commits:
commit f640a0c5d295368e5c0e3247b3039054cccad7da
Author: Mark Hung 
AuthorDate: Sat Jan 28 00:32:21 2023 +0800
Commit: Noel Grandin 
CommitDate: Sun Jan 29 05:59:50 2023 +

sd/filter/pptx-animations: store condition in NodeContext.

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

diff --git a/sd/source/filter/eppt/pptx-animations-nodectx.cxx 
b/sd/source/filter/eppt/pptx-animations-nodectx.cxx
index 0d5cabd49343..957301a5afd8 100644
--- a/sd/source/filter/eppt/pptx-animations-nodectx.cxx
+++ b/sd/source/filter/eppt/pptx-animations-nodectx.cxx
@@ -56,6 +56,29 @@ bool IsAudioURL(const OUString& rURL)
 
 /// Returns if rURL has an extension which is a video format.
 bool IsVideoURL(const OUString& rURL) { return 
rURL.endsWithIgnoreAsciiCase(".mp4"); }
+
+void initCondList(const Any& rAny, std::vector& rList, bool 
bIsMainSeqChild)
+{
+if (!rAny.hasValue())
+return;
+
+Sequence aCondSeq;
+if (rAny >>= aCondSeq)
+{
+for (const auto& rCond : std::as_const(aCondSeq))
+{
+Cond aCond(rCond, bIsMainSeqChild);
+if (aCond.isValid())
+rList.push_back(aCond);
+}
+}
+else
+{
+Cond aCond(rAny, bIsMainSeqChild);
+if (aCond.isValid())
+rList.push_back(aCond);
+}
+}
 }
 
 NodeContext::NodeContext(const Reference& xNode, bool 
bMainSeqChild,
@@ -71,6 +94,10 @@ NodeContext::NodeContext(const Reference& 
xNode, bool bMainSeqCh
 initUserData();
 
 initValid(initChildNodes(), bIsIterateChild);
+
+initCondList(getNodeForCondition()->getBegin(), maBeginCondList, 
mbMainSeqChild);
+
+initCondList(getNodeForCondition()->getEnd(), maEndCondList, 
mbMainSeqChild);
 }
 
 void NodeContext::initUserData()
diff --git a/sd/source/filter/eppt/pptx-animations-nodectx.hxx 
b/sd/source/filter/eppt/pptx-animations-nodectx.hxx
index 46a97c5a40cc..e9f884063c2e 100644
--- a/sd/source/filter/eppt/pptx-animations-nodectx.hxx
+++ b/sd/source/filter/eppt/pptx-animations-nodectx.hxx
@@ -11,6 +11,7 @@
 #include 
 #include 
 #include 
+#include "pptx-animations-cond.hxx"
 
 namespace oox::core
 {
@@ -24,6 +25,8 @@ class NodeContext
 const bool mbMainSeqChild;
 
 std::vector maChildNodes;
+std::vector maBeginCondList;
+std::vector maEndCondList;
 // if the node has valid target or contains at least one valid target.
 bool mbValid;
 
@@ -55,5 +58,7 @@ public:
 bool isValid() const { return mbValid; }
 const std::vector& getChildNodes() const { return 
maChildNodes; };
 const css::uno::Reference& 
getNodeForCondition() const;
+const std::vector& getBeginCondList() const { return 
maBeginCondList; }
+const std::vector& getEndCondList() const { return maEndCondList; }
 };
 }
diff --git a/sd/source/filter/eppt/pptx-animations.cxx 
b/sd/source/filter/eppt/pptx-animations.cxx
index bfe1079885e9..0cb6a5c72319 100644
--- a/sd/source/filter/eppt/pptx-animations.cxx
+++ b/sd/source/filter/eppt/pptx-animations.cxx
@@ -490,9 +490,8 @@ class PPTXAnimationExport
 void WriteAnimationNodeMedia();
 void WriteAnimationNodeCommonPropsStart();
 void WriteAnimationTarget(const Any& rTarget);
-void WriteAnimationCondList(const Any& rAny, sal_Int32 nToken);
+void WriteAnimationCondList(const std::vector& rList, sal_Int32 
nToken);
 void WriteAnimationCond(const Cond& rCond);
-bool isMainSeqChild() const;
 const Reference& getCurrentNode() const;
 
 PowerPointExport& mrPowerPointExport;
@@ -535,12 +534,6 @@ PPTXAnimationExport::PPTXAnimationExport(PowerPointExport& 
rExport, const FSHelp
 {
 }
 
-bool PPTXAnimationExport::isMainSeqChild() const
-{
-assert(mpContext);
-return mpContext->isMainSeqChild();
-}
-
 const Reference& PPTXAnimationExport::getCurrentNode() const
 {
 assert(mpContext);
@@ -589,37 +582,13 @@ void PPTXAnimationExport::WriteAnimationTarget(const Any& 
rTarget)
 mpFS->endElementNS(XML_p, XML_tgtEl);
 }
 
-void PPTXAnimationExport::WriteAnimationCondList(const Any& rAny, sal_Int32 
nToken)
+void PPTXAnimationExport::WriteAnimationCondList(const std::vector& 
rList, sal_Int32 nToken)
 {
-if (!rAny.hasValue())
-return;
-
-std::vector aList;
-
-bool bIsMainSeqChild = isMainSeqChild();
-
-Sequence aCondSeq;
-if (rAny >>= aCondSeq)
-{
-for (const auto& rCond : std::as_const(aCondSeq))
-{
-Cond aCond(rCond, bIsMainSeqChild);
-if (aCond.isValid())
-aList.push_back(aCond);
-}
-}
-else
-{
-Cond 

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

2023-01-26 Thread Caolán McNamara (via logerrit)
 sd/source/ui/framework/configuration/ConfigurationController.cxx |2 +-
 sd/source/ui/inc/framework/ConfigurationController.hxx   |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit abe13104486d9c360c5624c4710c06c19482f410
Author: Caolán McNamara 
AuthorDate: Thu Jan 26 14:06:25 2023 +
Commit: Caolán McNamara 
CommitDate: Thu Jan 26 16:01:12 2023 +

cid#1520593 Uncaught exception

Change-Id: I14f412e9dda71863036cd99bc29f86d31b947163
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146177
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sd/source/ui/framework/configuration/ConfigurationController.cxx 
b/sd/source/ui/framework/configuration/ConfigurationController.cxx
index 7e44e9025115..15daf362f906 100644
--- a/sd/source/ui/framework/configuration/ConfigurationController.cxx
+++ b/sd/source/ui/framework/configuration/ConfigurationController.cxx
@@ -102,7 +102,7 @@ ConfigurationController::Lock::~Lock()
 
 //= ConfigurationController ===
 
-ConfigurationController::ConfigurationController(const 
rtl::Reference<::sd::DrawController>& rxController) noexcept
+ConfigurationController::ConfigurationController(const 
rtl::Reference<::sd::DrawController>& rxController)
 : ConfigurationControllerInterfaceBase(m_aMutex)
 , mbIsDisposed(false)
 {
diff --git a/sd/source/ui/inc/framework/ConfigurationController.hxx 
b/sd/source/ui/inc/framework/ConfigurationController.hxx
index d56ca84770e0..74b60d3bb215 100644
--- a/sd/source/ui/inc/framework/ConfigurationController.hxx
+++ b/sd/source/ui/inc/framework/ConfigurationController.hxx
@@ -53,7 +53,7 @@ class ConfigurationController
   public ConfigurationControllerInterfaceBase
 {
 public:
-ConfigurationController(const rtl::Reference<::sd::DrawController>& 
rxController) noexcept;
+ConfigurationController(const rtl::Reference<::sd::DrawController>& 
rxController);
 virtual ~ConfigurationController() noexcept override;
 ConfigurationController(const ConfigurationController&) = delete;
 ConfigurationController& operator=(const ConfigurationController&) = 
delete;


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

2023-01-26 Thread Noel Grandin (via logerrit)
 sd/source/console/PresenterController.cxx|9 -
 sd/source/console/PresenterController.hxx|6 --
 sd/source/console/PresenterHelpView.cxx  |7 +++
 sd/source/console/PresenterHelpView.hxx  |2 +-
 sd/source/console/PresenterNotesView.cxx |7 +++
 sd/source/console/PresenterNotesView.hxx |4 +++-
 sd/source/console/PresenterPaneFactory.cxx   |9 -
 sd/source/console/PresenterPaneFactory.hxx   |6 --
 sd/source/console/PresenterScreen.cxx|   12 ++--
 sd/source/console/PresenterScreen.hxx|4 +++-
 sd/source/console/PresenterSlideShowView.cxx |7 +++
 sd/source/console/PresenterSlideShowView.hxx |4 ++--
 sd/source/console/PresenterSlideSorter.cxx   |   10 --
 sd/source/console/PresenterSlideSorter.hxx   |2 +-
 sd/source/console/PresenterToolBar.cxx   |7 +++
 sd/source/console/PresenterToolBar.hxx   |2 +-
 sd/source/console/PresenterViewFactory.cxx   |   21 ++---
 sd/source/console/PresenterViewFactory.hxx   |   11 +++
 sd/source/ui/inc/DrawController.hxx  |3 ++-
 19 files changed, 68 insertions(+), 65 deletions(-)

New commits:
commit 4b1d750f9cf953f6483f13e0a4d1901800d417ce
Author: Noel Grandin 
AuthorDate: Wed Jan 25 15:20:21 2023 +0200
Commit: Noel Grandin 
CommitDate: Thu Jan 26 10:05:41 2023 +

use more concrete types in sd console

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

diff --git a/sd/source/console/PresenterController.cxx 
b/sd/source/console/PresenterController.cxx
index e9831ac749d5..39ed5506960d 100644
--- a/sd/source/console/PresenterController.cxx
+++ b/sd/source/console/PresenterController.cxx
@@ -32,6 +32,7 @@
 #include "PresenterTheme.hxx"
 #include "PresenterViewFactory.hxx"
 #include "PresenterWindowManager.hxx"
+#include 
 
 #include 
 #include 
@@ -41,7 +42,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -85,7 +85,7 @@ PresenterController::InstanceContainer 
PresenterController::maInstances;
 PresenterController::PresenterController (
 unotools::WeakReference xScreen,
 const Reference& rxContext,
-const Reference& rxController,
+const rtl::Reference<::sd::DrawController>& rxController,
 const Reference& rxSlideShowController,
 rtl::Reference xPaneContainer,
 const Reference& rxMainPaneId)
@@ -113,8 +113,7 @@ PresenterController::PresenterController (
 new PresenterCurrentSlideObserver(this,rxSlideShowController);
 
 // Listen for configuration changes.
-Reference xCM (mxController, UNO_QUERY_THROW);
-mxConfigurationController = xCM->getConfigurationController();
+mxConfigurationController = mxController->getConfigurationController();
 if (mxConfigurationController.is())
 {
 mxConfigurationController->addConfigurationChangeListener(
@@ -772,7 +771,7 @@ void SAL_CALL 
PresenterController::notifyConfigurationChange (
 void SAL_CALL PresenterController::disposing (
 const lang::EventObject& rEvent)
 {
-if (rEvent.Source == mxController)
+if (rEvent.Source.get() == 
static_cast(mxController.get()))
 mxController = nullptr;
 else if (rEvent.Source == mxConfigurationController)
 mxConfigurationController = nullptr;
diff --git a/sd/source/console/PresenterController.hxx 
b/sd/source/console/PresenterController.hxx
index f29970c6903d..a4d7993eecda 100644
--- a/sd/source/console/PresenterController.hxx
+++ b/sd/source/console/PresenterController.hxx
@@ -42,6 +42,8 @@
 #include 
 #include 
 
+namespace sd { class DrawController; }
+
 namespace sdext::presenter {
 
 class PresenterCanvasHelper;
@@ -85,7 +87,7 @@ public:
 PresenterController (
 unotools::WeakReference xScreen,
 const css::uno::Reference& rxContext,
-const css::uno::Reference& rxController,
+const rtl::Reference<::sd::DrawController>& rxController,
 const css::uno::Reference& 
rxSlideShowController,
 rtl::Reference xPaneContainer,
 const css::uno::Reference& 
rxMainPaneId);
@@ -176,7 +178,7 @@ private:
 unotools::WeakReference mxScreen;
 css::uno::Reference mxComponentContext;
 css::uno::Reference mxCanvas;
-css::uno::Reference mxController;
+rtl::Reference<::sd::DrawController> mxController;
 css::uno::Reference
 mxConfigurationController;
 css::uno::Reference 
mxSlideShowController;
diff --git a/sd/source/console/PresenterHelpView.cxx 
b/sd/source/console/PresenterHelpView.cxx
index bdfa1ab37fb9..b4f3477e33be 100644
--- a/sd/source/console/PresenterHelpView.cxx
+++ b/sd/source/console/PresenterHelpView.cxx
@@ -23,10 +23,10 @@
 #include "PresenterButton.hxx"
 #include "PresenterCanvasHelper.hxx"
 #include "PresenterGeometryHelper.hxx"
+#include 
 #include 
 #include 
 

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

2023-01-26 Thread Noel Grandin (via logerrit)
 sd/source/ui/inc/ViewTabBar.hxx  |7 ---
 sd/source/ui/view/ViewTabBar.cxx |   35 ++-
 2 files changed, 14 insertions(+), 28 deletions(-)

New commits:
commit 6b1f83880372868fb61c84dbe3230910cdbb386f
Author: Noel Grandin 
AuthorDate: Wed Jan 25 10:29:12 2023 +0200
Commit: Noel Grandin 
CommitDate: Thu Jan 26 08:32:42 2023 +

use more concrete types in sd

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

diff --git a/sd/source/ui/inc/ViewTabBar.hxx b/sd/source/ui/inc/ViewTabBar.hxx
index 61670cc1432b..36c2aa6f84a7 100644
--- a/sd/source/ui/inc/ViewTabBar.hxx
+++ b/sd/source/ui/inc/ViewTabBar.hxx
@@ -35,6 +35,7 @@ namespace com::sun::star::frame { class XController; }
 namespace vcl { class Window; }
 
 namespace sd {
+class DrawController;
 class ViewShellBase;
 class ViewTabBar;
 }
@@ -72,7 +73,7 @@ class ViewTabBar final
 public:
 ViewTabBar (
 const css::uno::Reference< css::drawing::framework::XResourceId>& 
rxViewTabBarId,
-const css::uno::Reference< css::frame::XController>& rxController);
+const rtl::Reference< ::sd::DrawController>& rxController);
 virtual ~ViewTabBar() override;
 
 virtual void disposing(std::unique_lock&) override;
@@ -148,7 +149,7 @@ public:
 
 private:
 VclPtr mpTabControl;
-css::uno::Reference mxController;
+rtl::Reference<::sd::DrawController> mxController;
 css::uno::Reference 
mxConfigurationController;
 typedef ::std::vector 
TabBarButtonList;
 TabBarButtonList maTabBarButtons;
@@ -168,7 +169,7 @@ private:
 */
 static vcl::Window* GetAnchorWindow(
 const css::uno::Reference& 
rxViewTabBarId,
-const css::uno::Reference& rxController);
+const rtl::Reference<::sd::DrawController>& rxController);
 };
 
 } // end of namespace sd
diff --git a/sd/source/ui/view/ViewTabBar.cxx b/sd/source/ui/view/ViewTabBar.cxx
index 09925e32d37b..81f71b12638e 100644
--- a/sd/source/ui/view/ViewTabBar.cxx
+++ b/sd/source/ui/view/ViewTabBar.cxx
@@ -59,7 +59,7 @@ bool IsEqual (const TabBarButton& rButton1, const 
TabBarButton& rButton2)
 
 ViewTabBar::ViewTabBar (
 const Reference& rxViewTabBarId,
-const Reference& rxController)
+const rtl::Reference<::sd::DrawController>& rxController)
 : 
mpTabControl(VclPtr::Create(GetAnchorWindow(rxViewTabBarId,rxController),
 this)),
   mxController(rxController),
   mxViewTabBarId(rxViewTabBarId),
@@ -68,20 +68,13 @@ ViewTabBar::ViewTabBar (
 {
 // Tunnel through the controller and use the ViewShellBase to obtain the
 // view frame.
-try
-{
-if (auto pController = 
dynamic_cast(mxController.get()))
-mpViewShellBase = pController->GetViewShellBase();
-}
-catch (const RuntimeException&)
-{
-}
+if (mxController)
+mpViewShellBase = mxController->GetViewShellBase();
 
 // Register as listener at XConfigurationController.
-Reference xControllerManager (mxController, UNO_QUERY);
-if (xControllerManager.is())
+if (mxController.is())
 {
-mxConfigurationController = 
xControllerManager->getConfigurationController();
+mxConfigurationController = mxController->getConfigurationController();
 if (mxConfigurationController.is())
 {
 mxConfigurationController->addConfigurationChangeListener(
@@ -139,21 +132,15 @@ void ViewTabBar::disposing(std::unique_lock&)
 
 vcl::Window* ViewTabBar::GetAnchorWindow(
 const Reference& rxViewTabBarId,
-const Reference& rxController)
+const rtl::Reference<::sd::DrawController>& rxController)
 {
 vcl::Window* pWindow = nullptr;
 ViewShellBase* pBase = nullptr;
 
 // Tunnel through the controller and use the ViewShellBase to obtain the
 // view frame.
-try
-{
-if (auto pController = 
dynamic_cast(rxController.get()))
-pBase = pController->GetViewShellBase();
-}
-catch (const RuntimeException&)
-{
-}
+if (rxController)
+pBase = rxController->GetViewShellBase();
 
 // The ViewTabBar supports at the moment only the center pane.
 if (rxViewTabBarId.is()
@@ -170,9 +157,8 @@ vcl::Window* ViewTabBar::GetAnchorWindow(
 Reference xPane;
 try
 {
-Reference xControllerManager (rxController, 
UNO_QUERY_THROW);
 Reference xCC (
-xControllerManager->getConfigurationController());
+rxController->getConfigurationController());
 if (xCC.is())
 xPane.set(xCC->getResource(rxViewTabBarId->getAnchor()), 
UNO_QUERY);
 }
@@ -269,9 +255,8 @@ bool ViewTabBar::ActivatePage(size_t nIndex)
 {
 try
 {
-Reference xControllerManager 
(mxController,UNO_QUERY_THROW);
 Reference xConfigurationController (
-  

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

2023-01-20 Thread Noel Grandin (via logerrit)
 sd/source/ui/framework/factories/PresentationFactory.cxx |4 +---
 sd/source/ui/framework/module/ModuleController.cxx   |2 +-
 sd/source/ui/inc/framework/PresentationFactory.hxx   |   11 ++-
 3 files changed, 4 insertions(+), 13 deletions(-)

New commits:
commit c92060d20c30c7a90c2c2e63fd98cb4d185bb402
Author: Noel Grandin 
AuthorDate: Fri Jan 20 14:00:15 2023 +0200
Commit: Noel Grandin 
CommitDate: Fri Jan 20 17:41:56 2023 +

PresentationFactoryProvider can just be a static method

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

diff --git a/sd/source/ui/framework/factories/PresentationFactory.cxx 
b/sd/source/ui/framework/factories/PresentationFactory.cxx
index 6603f5db5159..60ebb6efd11c 100644
--- a/sd/source/ui/framework/factories/PresentationFactory.cxx
+++ b/sd/source/ui/framework/factories/PresentationFactory.cxx
@@ -129,9 +129,7 @@ void PresentationFactory::ThrowIfDisposed() const
 }
 }
 
-//= PresentationFactoryProvider ===
-
-PresentationFactoryProvider::PresentationFactoryProvider (const 
Reference& rxController)
+void PresentationFactory::install(const Reference& 
rxController)
 {
 try
 {
diff --git a/sd/source/ui/framework/module/ModuleController.cxx 
b/sd/source/ui/framework/module/ModuleController.cxx
index 066f25ba70e1..a703c48ca27c 100644
--- a/sd/source/ui/framework/module/ModuleController.cxx
+++ b/sd/source/ui/framework/module/ModuleController.cxx
@@ -127,7 +127,7 @@ void ModuleController::InstantiateStartupServices()
 // at the configuration controller.
 Reference xContext =
 ::comphelper::getProcessComponentContext();
-rtl::Reference<::sd::framework::PresentationFactoryProvider> x = new 
sd::framework::PresentationFactoryProvider(mxController);
+sd::framework::PresentationFactory::install(mxController);
 }
 catch (Exception&)
 {
diff --git a/sd/source/ui/inc/framework/PresentationFactory.hxx 
b/sd/source/ui/inc/framework/PresentationFactory.hxx
index bf3523c4bcb3..261e6fd26332 100644
--- a/sd/source/ui/inc/framework/PresentationFactory.hxx
+++ b/sd/source/ui/inc/framework/PresentationFactory.hxx
@@ -44,6 +44,8 @@ public:
 const css::uno::Reference& rxController);
 virtual ~PresentationFactory() override;
 
+static void install(const css::uno::Reference& 
rxController);
+
 // XResourceFactory
 
 virtual css::uno::Reference
@@ -72,15 +74,6 @@ private:
 void ThrowIfDisposed() const;
 };
 
-typedef comphelper::WeakComponentImplHelper<> 
PresentationFactoryProviderInterfaceBase;
-
-class PresentationFactoryProvider
-: public PresentationFactoryProviderInterfaceBase
-{
-public:
-PresentationFactoryProvider(const 
css::uno::Reference& rxController);
-};
-
 } // end of namespace sd::framework
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2023-01-19 Thread Stephan Bergmann (via logerrit)
 sd/source/ui/inc/unopage.hxx|6 ++
 sd/source/ui/unoidl/unopage.cxx |   18 +++---
 2 files changed, 21 insertions(+), 3 deletions(-)

New commits:
commit ede696562a38a8ffe5c27b397108ee1f59716ae3
Author: Stephan Bergmann 
AuthorDate: Thu Jan 19 08:41:32 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Jan 19 09:38:57 2023 +

Fix SdGenericDrawPage et al queryAggregation

The base SvxDrawPage uses WeakAggImplHelper7, so (for better or worse) 
derives
from XAggregation, but SdGenericDrawPage and its derived classes 
(SdDrawPage,
SdMasterPage) failed to properly implement the XAggregation protocol.

When fixing this, it became apparent that SdGenericDrawPage::queryInterface 
had
erroneously delegated to SvxDrawPage::queryInterface rather than to the
intermediary SvxFmDrawPage::queryInterface, so that querying for e.g.
XFormsSupplier had only worked by accident:  
SdGenericDrawPage::queryInterface
didn't support it, so delegated to SvxDrawPage::queryInterface, which didn't
support it, so delegated to WeakAggImplHelper7::queryInterface, which didn't
support it, so delegated to OWeakAggObject::queryInterface, which (as there 
was
no delegator set) delegated to the most derived 
SvxFmDrawPage::queryAggregation,
which supports it.

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

diff --git a/sd/source/ui/inc/unopage.hxx b/sd/source/ui/inc/unopage.hxx
index 1eb3cb6d83b1..b6a6f0d6d9b6 100644
--- a/sd/source/ui/inc/unopage.hxx
+++ b/sd/source/ui/inc/unopage.hxx
@@ -112,6 +112,8 @@ public:
 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & 
rType ) override;
 virtual void SAL_CALL release() noexcept override;
 
+css::uno::Any SAL_CALL queryAggregation(css::uno::Type const & rType) 
override;
+
 // XShapeCombiner
 virtual css::uno::Reference< css::drawing::XShape > SAL_CALL combine( 
const css::uno::Reference< css::drawing::XShapes >& xShapes ) override;
 virtual void SAL_CALL split( const css::uno::Reference< 
css::drawing::XShape >& xGroup ) override;
@@ -179,6 +181,8 @@ public:
 virtual void SAL_CALL acquire() noexcept override;
 virtual void SAL_CALL release() noexcept override;
 
+css::uno::Any SAL_CALL queryAggregation(css::uno::Type const & rType) 
override;
+
 // XTypeProvider
 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() 
override;
@@ -236,6 +240,8 @@ public:
 virtual void SAL_CALL acquire() noexcept override;
 virtual void SAL_CALL release() noexcept override;
 
+css::uno::Any SAL_CALL queryAggregation(css::uno::Type const & rType) 
override;
+
 // XTypeProvider
 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() 
override;
diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx
index 4831b29bb53d..ae05e5ce79ed 100644
--- a/sd/source/ui/unoidl/unopage.cxx
+++ b/sd/source/ui/unoidl/unopage.cxx
@@ -509,6 +509,10 @@ rtl::Reference 
SdGenericDrawPage::CreateSdrObject_( const Reference<
 // XInterface
 Any SAL_CALL SdGenericDrawPage::queryInterface( const uno::Type & rType )
 {
+return SvxFmDrawPage::queryInterface(rType);
+}
+
+css::uno::Any SdGenericDrawPage::queryAggregation(css::uno::Type const & 
rType) {
 Any aAny;
 
 if (rType == cppu::UnoType::get())
@@ -555,7 +559,7 @@ Any SAL_CALL SdGenericDrawPage::queryInterface( const 
uno::Type & rType )
 return Any( Reference< XAnimationNodeSupplier >( this ) );
 }
 else
-return SvxDrawPage::queryInterface( rType );
+return SvxFmDrawPage::queryAggregation( rType );
 
 return aAny;
 }
@@ -2041,6 +2045,10 @@ SdDrawPage::~SdDrawPage() noexcept
 // XInterface
 Any SAL_CALL SdDrawPage::queryInterface( const uno::Type & rType )
 {
+return SdGenericDrawPage::queryInterface(rType);
+}
+
+css::uno::Any SdDrawPage::queryAggregation(css::uno::Type const & rType) {
 if( rType == cppu::UnoType::get() )
 {
 return Any( Reference< drawing::XMasterPageTarget >( this ) );
@@ -2055,7 +2063,7 @@ Any SAL_CALL SdDrawPage::queryInterface( const uno::Type 
& rType )
 }
 }
 
-return SdGenericDrawPage::queryInterface( rType );
+return SdGenericDrawPage::queryAggregation( rType );
 }
 
 void SAL_CALL SdDrawPage::acquire() noexcept
@@ -2638,6 +2646,10 @@ SdMasterPage::~SdMasterPage() noexcept
 // XInterface
 Any SAL_CALL SdMasterPage::queryInterface( const uno::Type & rType )
 {
+return SdGenericDrawPage::queryInterface(rType);
+}
+
+css::uno::Any SdMasterPage::queryAggregation(css::uno::Type const & rType) {
 ::SolarMutexGuard aGuard;
 
 

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

2023-01-17 Thread Noel Grandin (via logerrit)
 sd/source/ui/framework/factories/BasicPaneFactory.cxx|3 +--
 sd/source/ui/framework/factories/BasicViewFactory.cxx|3 +--
 sd/source/ui/framework/factories/PresentationFactory.cxx |2 +-
 sd/source/ui/framework/module/CenterViewFocusModule.cxx  |   12 +---
 sd/source/ui/framework/module/CenterViewFocusModule.hxx  |5 +++--
 sd/source/ui/framework/module/DrawModule.cxx |3 ++-
 sd/source/ui/framework/module/ImpressModule.cxx  |3 ++-
 sd/source/ui/framework/module/PresentationModule.cxx |2 +-
 sd/source/ui/framework/module/ShellStackGuard.cxx|   11 ---
 sd/source/ui/framework/module/ShellStackGuard.hxx|4 +++-
 sd/source/ui/framework/module/ToolBarModule.cxx  |   12 +---
 sd/source/ui/framework/module/ToolBarModule.hxx  |4 +++-
 sd/source/ui/inc/DrawController.hxx  |   10 +-
 sd/source/ui/inc/framework/DrawModule.hxx|7 ++-
 sd/source/ui/inc/framework/ImpressModule.hxx |7 ++-
 sd/source/ui/inc/framework/PresentationModule.hxx|7 ++-
 sd/source/ui/sidebar/PanelFactory.cxx|2 +-
 sd/source/ui/slidesorter/shell/SlideSorterService.cxx|3 +--
 sd/source/ui/unoidl/DrawController.cxx   |   13 -
 sd/source/ui/view/GraphicViewShellBase.cxx   |3 ++-
 sd/source/ui/view/ImpressViewShellBase.cxx   |5 +++--
 sd/source/ui/view/PresentationViewShellBase.cxx  |4 ++--
 sd/source/ui/view/ViewTabBar.cxx |6 ++
 23 files changed, 61 insertions(+), 70 deletions(-)

New commits:
commit 5355f52b14d7237ba0f9fdd910eca579292242bd
Author: Noel Grandin 
AuthorDate: Mon Jan 16 15:55:28 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue Jan 17 12:40:28 2023 +

XUnoTunnel->dynamic_cast in sd::DrawController

Just past the concrete type down through a couple of layers, rather than
using a generic type and then casting

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

diff --git a/sd/source/ui/framework/factories/BasicPaneFactory.cxx 
b/sd/source/ui/framework/factories/BasicPaneFactory.cxx
index c01d315a3d9c..64cec425ad54 100644
--- a/sd/source/ui/framework/factories/BasicPaneFactory.cxx
+++ b/sd/source/ui/framework/factories/BasicPaneFactory.cxx
@@ -132,8 +132,7 @@ void SAL_CALL BasicPaneFactory::initialize (const 
Sequence& aArguments)
 // Tunnel through the controller to obtain access to the ViewShellBase.
 try
 {
-Reference xTunnel (xController, UNO_QUERY_THROW);
-if (auto pController = 
comphelper::getFromUnoTunnel(xTunnel))
+if (auto pController = 
dynamic_cast(xController.get()))
 mpViewShellBase = pController->GetViewShellBase();
 }
 catch(RuntimeException&)
diff --git a/sd/source/ui/framework/factories/BasicViewFactory.cxx 
b/sd/source/ui/framework/factories/BasicViewFactory.cxx
index 5e862c6aebc2..6a6b8065e180 100644
--- a/sd/source/ui/framework/factories/BasicViewFactory.cxx
+++ b/sd/source/ui/framework/factories/BasicViewFactory.cxx
@@ -237,8 +237,7 @@ void SAL_CALL BasicViewFactory::initialize (const 
Sequence& aArguments)
 Reference xController (aArguments[0], 
UNO_QUERY_THROW);
 
 // Tunnel through the controller to obtain a ViewShellBase.
-Reference xTunnel (xController, UNO_QUERY_THROW);
-::sd::DrawController* pController = 
comphelper::getFromUnoTunnel(xTunnel);
+::sd::DrawController* pController = 
dynamic_cast(xController.get());
 if (pController != nullptr)
 mpBase = pController->GetViewShellBase();
 
diff --git a/sd/source/ui/framework/factories/PresentationFactory.cxx 
b/sd/source/ui/framework/factories/PresentationFactory.cxx
index c1d408856187..73c2d4bdb732 100644
--- a/sd/source/ui/framework/factories/PresentationFactory.cxx
+++ b/sd/source/ui/framework/factories/PresentationFactory.cxx
@@ -113,7 +113,7 @@ void SAL_CALL PresentationFactory::releaseResource (
 {
 ThrowIfDisposed();
 
-auto pController = 
comphelper::getFromUnoTunnel(mxController);
+auto pController = dynamic_cast(mxController.get());
 if (pController != nullptr)
 {
 ViewShellBase* pBase = pController->GetViewShellBase();
diff --git a/sd/source/ui/framework/module/CenterViewFocusModule.cxx 
b/sd/source/ui/framework/module/CenterViewFocusModule.cxx
index f5de61ca65d6..2c799e04bbb1 100644
--- a/sd/source/ui/framework/module/CenterViewFocusModule.cxx
+++ b/sd/source/ui/framework/module/CenterViewFocusModule.cxx
@@ -39,20 +39,18 @@ namespace sd::framework {
 
 //= CenterViewFocusModule 

 
-CenterViewFocusModule::CenterViewFocusModule 

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

2023-01-17 Thread Tünde Tóth (via logerrit)
 sd/source/ui/docshell/sdclient.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit fdf95de18ef1891862bdce26669d1ce2c6f24764
Author: Tünde Tóth 
AuthorDate: Fri Jan 13 09:54:00 2023 +0100
Commit: László Németh 
CommitDate: Tue Jan 17 10:00:46 2023 +

tdf#152991 sd: fix oversized rectangle of edited embedded object

The embedded object became unusably oversized after editing,
because it was not possible to minimize it by the mouse. Now
the object keeps its original size to avoid of the UX problem.

Note: losing the original zoom of the OLE content is still a problem.

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

diff --git a/sd/source/ui/docshell/sdclient.cxx 
b/sd/source/ui/docshell/sdclient.cxx
index 02521c2575ad..c7f79c3ea813 100644
--- a/sd/source/ui/docshell/sdclient.cxx
+++ b/sd/source/ui/docshell/sdclient.cxx
@@ -143,6 +143,13 @@ void Client::ViewChanged()
 if (!pView)
 return;
 
+// Do not recalculate the visareasize if the embedded object is opening in 
a new window.
+if (!IsObjectInPlaceActive())
+{
+pSdrOle2Obj->BroadcastObjectChange();
+return;
+}
+
 ::tools::Rectangle aLogicRect( pSdrOle2Obj->GetLogicRect() );
 Size aLogicSize( aLogicRect.GetWidth(), aLogicRect.GetHeight() );
 


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

2023-01-16 Thread Noel Grandin (via logerrit)
 sd/source/ui/framework/factories/ViewShellWrapper.cxx   |   13 -
 sd/source/ui/framework/module/CenterViewFocusModule.cxx |2 +-
 sd/source/ui/framework/tools/FrameworkHelper.cxx|3 +--
 sd/source/ui/inc/framework/ViewShellWrapper.hxx |   14 +++---
 4 files changed, 5 insertions(+), 27 deletions(-)

New commits:
commit 2dd86a1a062973ef3b1a3c312b98e9b9dcbaeeb1
Author: Noel Grandin 
AuthorDate: Mon Jan 16 16:18:17 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue Jan 17 06:43:34 2023 +

XUnoTunnel->dynamic_cast in ViewShellWrapper

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

diff --git a/sd/source/ui/framework/factories/ViewShellWrapper.cxx 
b/sd/source/ui/framework/factories/ViewShellWrapper.cxx
index 8f0fcd976537..294b7a550f60 100644
--- a/sd/source/ui/framework/factories/ViewShellWrapper.cxx
+++ b/sd/source/ui/framework/factories/ViewShellWrapper.cxx
@@ -206,19 +206,6 @@ sal_Bool SAL_CALL ViewShellWrapper::relocateToAnchor (
 return bResult;
 }
 
-//- XUnoTunnel 
-
-const Sequence& ViewShellWrapper::getUnoTunnelId()
-{
-static const comphelper::UnoIdInit theViewShellWrapperUnoTunnelId;
-return theViewShellWrapperUnoTunnelId.getSeq();
-}
-
-sal_Int64 SAL_CALL ViewShellWrapper::getSomething (const Sequence& 
rId)
-{
-return comphelper::getSomethingImpl(rId, this);
-}
-
 //= awt::XWindowListener ==
 
 void SAL_CALL ViewShellWrapper::windowResized (const awt::WindowEvent&)
diff --git a/sd/source/ui/framework/module/CenterViewFocusModule.cxx 
b/sd/source/ui/framework/module/CenterViewFocusModule.cxx
index e36f95e33d9c..f5de61ca65d6 100644
--- a/sd/source/ui/framework/module/CenterViewFocusModule.cxx
+++ b/sd/source/ui/framework/module/CenterViewFocusModule.cxx
@@ -124,7 +124,7 @@ void CenterViewFocusModule::HandleNewView (
 xView.set( 
mxConfigurationController->getResource(xViewIds[0]),UNO_QUERY);
 if (mpBase!=nullptr)
 {
-auto pViewShellWrapper = 
comphelper::getFromUnoTunnel(xView);
+auto pViewShellWrapper = dynamic_cast(xView.get());
 if (pViewShellWrapper != nullptr)
 {
 std::shared_ptr pViewShell = 
pViewShellWrapper->GetViewShell();
diff --git a/sd/source/ui/framework/tools/FrameworkHelper.cxx 
b/sd/source/ui/framework/tools/FrameworkHelper.cxx
index 2a10ead3f674..1b227d7ca6fd 100644
--- a/sd/source/ui/framework/tools/FrameworkHelper.cxx
+++ b/sd/source/ui/framework/tools/FrameworkHelper.cxx
@@ -199,8 +199,7 @@ namespace
 ::std::shared_ptr< ViewShell > pViewShell;
 try
 {
-Reference xViewTunnel( i_rViewShellWrapper, 
UNO_QUERY_THROW );
-if (auto pWrapper = 
comphelper::getFromUnoTunnel(xViewTunnel))
+if (auto pWrapper = 
dynamic_cast(i_rViewShellWrapper.get()))
 pViewShell = pWrapper->GetViewShell();
 }
 catch( const Exception& )
diff --git a/sd/source/ui/inc/framework/ViewShellWrapper.hxx 
b/sd/source/ui/inc/framework/ViewShellWrapper.hxx
index 43dca4d6754a..fc944623a75a 100644
--- a/sd/source/ui/inc/framework/ViewShellWrapper.hxx
+++ b/sd/source/ui/inc/framework/ViewShellWrapper.hxx
@@ -23,7 +23,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include 
@@ -34,15 +33,14 @@ namespace com::sun::star::awt { class XWindow; }
 
 namespace sd::framework {
 
-typedef comphelper::WeakComponentImplHelper<   css::lang::XUnoTunnel
-,   css::awt::XWindowListener
+typedef comphelper::WeakComponentImplHelper<   css::awt::XWindowListener
 ,   css::view::XSelectionSupplier
 ,   
css::drawing::framework::XRelocatableResource
 ,   css::drawing::framework::XView
 >   ViewShellWrapperInterfaceBase;
 
 /** This class wraps ViewShell objects and makes them look like an XView.
-Most importantly it provides a tunnel to the ViewShell implementation.
+Most importantly it provides access to the ViewShell implementation.
 Then it forwards size changes of the pane window to the view shell.
 */
 class ViewShellWrapper final : public ViewShellWrapperInterfaceBase
@@ -68,18 +66,12 @@ public:
 virtual void disposing(std::unique_lock&) override;
 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & 
rType ) override;
 
-static const css::uno::Sequence& getUnoTunnelId();
-
-/** This method is typically used together with the XUnoTunnel interface
+/** This method is typically used
 to obtain a pointer to the wrapped ViewShell object for a given
 XView object.
 

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

2023-01-11 Thread Noel Grandin (via logerrit)
 sd/source/ui/sidebar/MasterPageObserver.cxx |   34 +---
 1 file changed, 7 insertions(+), 27 deletions(-)

New commits:
commit 244803ee2bcdfd4c4244f0c8a0654dab25fbc34d
Author: Noel Grandin 
AuthorDate: Wed Jan 11 15:02:59 2023 +0200
Commit: Noel Grandin 
CommitDate: Thu Jan 12 06:53:29 2023 +

tsan:lock-order-inversion in MasterPageObserver

simply the initialisation using a function local static

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

diff --git a/sd/source/ui/sidebar/MasterPageObserver.cxx 
b/sd/source/ui/sidebar/MasterPageObserver.cxx
index 017a0bcdf991..724b7b5e8f86 100644
--- a/sd/source/ui/sidebar/MasterPageObserver.cxx
+++ b/sd/source/ui/sidebar/MasterPageObserver.cxx
@@ -38,11 +38,6 @@ class MasterPageObserver::Implementation
 : public SfxListener
 {
 public:
-/** The single instance of this class.  It is created on demand when
-Instance() is called for the first time.
-*/
-static MasterPageObserver* mpInstance;
-
 /** The master page observer will listen to events of this document and
 detect changes of the use of master pages.
 */
@@ -91,33 +86,18 @@ private:
 void SendEvent (MasterPageObserverEvent& rEvent);
 };
 
-MasterPageObserver* MasterPageObserver::Implementation::mpInstance = nullptr;
-
 //= MasterPageObserver 
 
 MasterPageObserver&  MasterPageObserver::Instance()
 {
-if (Implementation::mpInstance == nullptr)
+static MasterPageObserver* gInstance = []()
 {
-::osl::GetGlobalMutex aMutexFunctor;
-::osl::MutexGuard aGuard (aMutexFunctor());
-if (Implementation::mpInstance == nullptr)
-{
-MasterPageObserver* pInstance = new MasterPageObserver ();
-SdGlobalResourceContainer::Instance().AddResource (
-::std::unique_ptr(pInstance));
-OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
-Implementation::mpInstance = pInstance;
-}
-}
-else
-{
-OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
-}
-
-DBG_ASSERT(Implementation::mpInstance!=nullptr,
-"MasterPageObserver::Instance(): instance is NULL");
-return *Implementation::mpInstance;
+MasterPageObserver* pInstance = new MasterPageObserver ();
+SdGlobalResourceContainer::Instance().AddResource (
+::std::unique_ptr(pInstance));
+return pInstance;
+}();
+return *gInstance;
 }
 
 void MasterPageObserver::RegisterDocument (SdDrawDocument& rDocument)


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

2022-12-16 Thread Caolán McNamara (via logerrit)
 sd/source/ui/sidebar/SlideBackground.cxx |   28 
 1 file changed, 20 insertions(+), 8 deletions(-)

New commits:
commit f9d106a8ecd58f94e48140f8516bc250c1b5e248
Author: Caolán McNamara 
AuthorDate: Thu Dec 15 21:21:44 2022 +
Commit: Caolán McNamara 
CommitDate: Fri Dec 16 08:52:22 2022 +

likely fix for frequent mpGradientItem->GetName() crash

crash report id: ec5a64d7-b354-457e-92a3-1bd51208e7c7

Change-Id: Ie64993190baa5e3ea9228214bea1ee4d82044c51
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144282
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sd/source/ui/sidebar/SlideBackground.cxx 
b/sd/source/ui/sidebar/SlideBackground.cxx
index bcd564e7bbc1..11f49dff67eb 100644
--- a/sd/source/ui/sidebar/SlideBackground.cxx
+++ b/sd/source/ui/sidebar/SlideBackground.cxx
@@ -1023,30 +1023,42 @@ IMPL_LINK_NOARG(SlideBackground, FillStyleModifyHdl, 
weld::ComboBox&, void)
 
 case SOLID:
 {
-const XFillColorItem aItem( OUString(), 
mpColorItem->GetColorValue() );
-GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_COLOR, 
SfxCallMode::RECORD, {  });
+if (mpColorItem)
+{
+const XFillColorItem aItem( OUString(), 
mpColorItem->GetColorValue() );
+
GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_COLOR, 
SfxCallMode::RECORD, {  });
+}
 }
 break;
 
 case GRADIENT:
 {
-const XFillGradientItem aItem( mpGradientItem->GetName(), 
mpGradientItem->GetGradientValue() );
-
GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_GRADIENT, 
SfxCallMode::RECORD, {  });
+if (mpGradientItem)
+{
+const XFillGradientItem aItem( mpGradientItem->GetName(), 
mpGradientItem->GetGradientValue() );
+
GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_GRADIENT, 
SfxCallMode::RECORD, {  });
+}
 }
 break;
 
 case HATCH:
 {
-const XFillHatchItem aItem( mpHatchItem->GetName(), 
mpHatchItem->GetHatchValue() );
-GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_HATCH, 
SfxCallMode::RECORD, {  });
+if (mpHatchItem)
+{
+const XFillHatchItem aItem( mpHatchItem->GetName(), 
mpHatchItem->GetHatchValue() );
+
GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_HATCH, 
SfxCallMode::RECORD, {  });
+}
 }
 break;
 
 case BITMAP:
 case PATTERN:
 {
-const XFillBitmapItem aItem( mpBitmapItem->GetName(), 
mpBitmapItem->GetGraphicObject() );
-GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_BITMAP, 
SfxCallMode::RECORD, {  });
+if (mpBitmapItem)
+{
+const XFillBitmapItem aItem( mpBitmapItem->GetName(), 
mpBitmapItem->GetGraphicObject() );
+
GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_BITMAP, 
SfxCallMode::RECORD, {  });
+}
 }
 break;
 


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

2022-12-15 Thread Xisco Fauli (via logerrit)
 sd/source/ui/view/unmodpg.cxx |   16 
 1 file changed, 12 insertions(+), 4 deletions(-)

New commits:
commit f9c857563f2a8837c6ec83851369badbcfa22185
Author: Xisco Fauli 
AuthorDate: Thu Dec 15 17:20:20 2022 +0100
Commit: Caolán McNamara 
CommitDate: Thu Dec 15 19:36:17 2022 +

sd: fix null deref in ModifyPageUndoAction::Undo/Redo

See 
https://crashreport.libreoffice.org/stats/signature/SfxViewFrame::GetDispatcher()

Change-Id: Iaf14ad8fd5dab878ea5e3d6997371c2d8a4beac6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144241
Reviewed-by: Caolán McNamara 
Tested-by: Jenkins

diff --git a/sd/source/ui/view/unmodpg.cxx b/sd/source/ui/view/unmodpg.cxx
index 2fdfbd13a9bb..afd454a5f183 100644
--- a/sd/source/ui/view/unmodpg.cxx
+++ b/sd/source/ui/view/unmodpg.cxx
@@ -118,8 +118,12 @@ void ModifyPageUndoAction::Undo()
 }
 
 // Redisplay
-SfxViewFrame::Current()->GetDispatcher()->Execute(
-SID_SWITCHPAGE, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD );
+SfxViewFrame* pCurrent = SfxViewFrame::Current();
+if( pCurrent )
+{
+pCurrent->GetDispatcher()->Execute(
+SID_SWITCHPAGE, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD );
+}
 }
 
 void ModifyPageUndoAction::Redo()
@@ -161,8 +165,12 @@ void ModifyPageUndoAction::Redo()
 }
 
 // Redisplay
-SfxViewFrame::Current()->GetDispatcher()->Execute(
-SID_SWITCHPAGE, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD );
+SfxViewFrame* pCurrent = SfxViewFrame::Current();
+if( pCurrent )
+{
+pCurrent->GetDispatcher()->Execute(
+SID_SWITCHPAGE, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD );
+}
 }
 
 ModifyPageUndoAction::~ModifyPageUndoAction()


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

2022-12-14 Thread Povilas Kanapickas (via logerrit)
 sd/source/ui/inc/ViewShell.hxx |1 +
 sd/source/ui/view/viewshel.cxx |7 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 45d861a38d7cd3031bd577fd954b11e5d7a99f8d
Author: Povilas Kanapickas 
AuthorDate: Wed Dec 7 03:13:24 2022 +0200
Commit: Tomaž Vajngerl 
CommitDate: Wed Dec 14 13:41:17 2022 +

sd: Improve reaction to slow zoom gestures in ViewShell

The current implementation will ignore slow zoom gestures because each
event may result in zoom change of less than 1% which will be truncated
to zero during floating-point -> integer conversion.

Storing accumulated amount and changing the zoom level once a whole
integer quantity is accumulated solves this problem.

Change-Id: If27a88d7695d0eed241dada5a09b25b2cb577841
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143751
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/sd/source/ui/inc/ViewShell.hxx b/sd/source/ui/inc/ViewShell.hxx
index a7b24ef57759..d9fd8564edd0 100644
--- a/sd/source/ui/inc/ViewShell.hxx
+++ b/sd/source/ui/inc/ViewShell.hxx
@@ -456,6 +456,7 @@ protected:
 rtl::Reference   mxOldFunction;
 std::unique_ptr mpZoomList;
 double mfLastZoomScale;
+double mfAccumulatedZoom = 0;
 
 Point   maViewPos;
 SizemaViewSize;
diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx
index 0cfc4b185b49..e12f65236dd9 100644
--- a/sd/source/ui/view/viewshel.cxx
+++ b/sd/source/ui/view/viewshel.cxx
@@ -776,7 +776,12 @@ bool ViewShell::HandleScrollCommand(const CommandEvent& 
rCEvt, ::sd::Window* pWi
 ::tools::Long nNewZoom;
 Point aOldMousePos = 
GetActiveWindow()->PixelToLogic(rCEvt.GetMousePosPixel());
 
-nNewZoom = nOldZoom + deltaBetweenEvents * 100;
+// Accumulate fractional zoom to avoid small zoom changes 
from being ignored
+mfAccumulatedZoom += deltaBetweenEvents;
+int nZoomChangePercent = mfAccumulatedZoom * 100;
+mfAccumulatedZoom -= nZoomChangePercent / 100.0;
+
+nNewZoom = nOldZoom + nZoomChangePercent;
 nNewZoom = std::max<::tools::Long>(pWin->GetMinZoom(), 
nNewZoom);
 nNewZoom = std::min<::tools::Long>(pWin->GetMaxZoom(), 
nNewZoom);
 


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

2022-12-07 Thread Rafael Lima (via logerrit)
 sd/source/ui/table/tablefunction.cxx|2 +-
 sd/uiconfig/sdraw/toolbar/tableobjectbar.xml|1 -
 sd/uiconfig/simpress/toolbar/tableobjectbar.xml |1 -
 3 files changed, 1 insertion(+), 3 deletions(-)

New commits:
commit e0e51cc5441669f6297383d8d50bfde2854be874
Author: Rafael Lima 
AuthorDate: Fri Dec 2 10:39:32 2022 +
Commit: Rafael Lima 
CommitDate: Wed Dec 7 11:03:06 2022 +

tdf#151185 Make Table Design button toggle-able

Change-Id: I86dfc7a6567b24cc6e9a20203625eeb09c17536c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143574
Tested-by: Jenkins
Reviewed-by: Heiko Tietze 

diff --git a/sd/source/ui/table/tablefunction.cxx 
b/sd/source/ui/table/tablefunction.cxx
index 352ffb37abfe..d3a26e41a872 100644
--- a/sd/source/ui/table/tablefunction.cxx
+++ b/sd/source/ui/table/tablefunction.cxx
@@ -235,7 +235,7 @@ void DrawViewShell::FuTable(SfxRequest& rReq)
 {
 // First make sure that the sidebar is visible
 GetViewFrame()->ShowChildWindow(SID_SIDEBAR);
-::sfx2::sidebar::Sidebar::ShowPanel(
+::sfx2::sidebar::Sidebar::TogglePanel(
 u"SdTableDesignPanel",
 GetViewFrame()->GetFrame().GetFrameInterface());
 
diff --git a/sd/uiconfig/sdraw/toolbar/tableobjectbar.xml 
b/sd/uiconfig/sdraw/toolbar/tableobjectbar.xml
index 87655aafe2f5..f2f821273c5d 100644
--- a/sd/uiconfig/sdraw/toolbar/tableobjectbar.xml
+++ b/sd/uiconfig/sdraw/toolbar/tableobjectbar.xml
@@ -46,6 +46,5 @@
  
  
  
- 
  
 
diff --git a/sd/uiconfig/simpress/toolbar/tableobjectbar.xml 
b/sd/uiconfig/simpress/toolbar/tableobjectbar.xml
index 87655aafe2f5..f2f821273c5d 100644
--- a/sd/uiconfig/simpress/toolbar/tableobjectbar.xml
+++ b/sd/uiconfig/simpress/toolbar/tableobjectbar.xml
@@ -46,6 +46,5 @@
  
  
  
- 
  
 


  1   2   3   4   5   6   7   8   9   10   >