core.git: sfx2/source svl/source

2024-10-31 Thread Armin Le Grand (allotropia) (via logerrit)
 sfx2/source/control/bindings.cxx |2 +
 sfx2/source/control/statcach.cxx |   46 +--
 sfx2/source/inc/statcach.hxx |2 -
 svl/source/items/voiditem.cxx|5 
 4 files changed, 47 insertions(+), 8 deletions(-)

New commits:
commit 288d720e4940d8fdd71715e6d339765e90716931
Author: Armin Le Grand (allotropia) 
AuthorDate: Thu Oct 31 13:38:30 2024 +0100
Commit: Armin Le Grand 
CommitDate: Thu Oct 31 17:22:09 2024 +0100

tdf#162666 Make SfxStateCache handle Items correctly

SfxStateCache had problems processing the extra Item
states disabled/invalid. Note that due to not using a
Pool here it is not possible to use an ItemSet or an
ItemHolder, those would automatically handle these
cases correctly.
In this cache, this currently needs to be done
handish. Also note that because of that this may break
again when changes in the Item/ItemSet/ItemHolder
mechanism may be done.

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

diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx
index af9129e455c1..718df9bd9887 100644
--- a/sfx2/source/control/bindings.cxx
+++ b/sfx2/source/control/bindings.cxx
@@ -1207,6 +1207,8 @@ void SfxBindings::UpdateControllers_Impl
   SfxItemPool::IsSlot(rFound.nWhichId) )
 {
 // no Status or Default but without Pool
+// tdf#162666 note that use DISABLED_POOL_ITEM needs to be
+// handled correctly in the cache, see comments there
 rCache.SetState( SfxItemState::UNKNOWN, DISABLED_POOL_ITEM );
 }
 else if ( SfxItemState::DISABLED == eState )
diff --git a/sfx2/source/control/statcach.cxx b/sfx2/source/control/statcach.cxx
index 037a38253a31..4432f0bc37e6 100644
--- a/sfx2/source/control/statcach.cxx
+++ b/sfx2/source/control/statcach.cxx
@@ -127,6 +127,8 @@ void SAL_CALL  BindDispatch_Impl::statusChanged( const 
css::frame::FeatureStateE
 pItem->PutValue( aAny, 0 );
 }
 else
+// tdf#162666 nId should not be zero. This will now create
+// a SAL_INFO in SfxVoidItem::SfxVoidItem
 pItem.reset( new SfxVoidItem( nId ) );
 }
 pArg = pItem.get();
@@ -203,8 +205,13 @@ SfxStateCache::SfxStateCache( sal_uInt16 nFuncId ):
 SfxStateCache::~SfxStateCache()
 {
 DBG_ASSERT( pController == nullptr && pInternalController == nullptr, 
"there are still Controllers registered" );
-if ( !IsInvalidItem(pLastItem) )
+
+if ( !IsInvalidItem(pLastItem) && !IsDisabledItem(pLastItem) )
+{
+// tdf#162666 only delete if it *was* cloned
 delete pLastItem;
+}
+
 if ( mxDispatch.is() )
 mxDispatch->Release();
 }
@@ -424,15 +431,40 @@ void SfxStateCache::SetState_Impl
 static_cast(pInternalController)->StateChanged( nId, eState, pState, &aSlotServ );
 
 // Remember new value
-if ( !IsInvalidItem(pLastItem) )
+if (!IsInvalidItem(pLastItem) && !IsDisabledItem(pLastItem))
 {
+// tdf#162666 only delete if it *was* cloned
 delete pLastItem;
-pLastItem = nullptr;
 }
-if ( pState && !IsInvalidItem(pState) )
-pLastItem = pState->Clone();
-else
-pLastItem = nullptr;
+
+// always reset to nullptr
+pLastItem = nullptr;
+
+if ( nullptr != pState)
+{
+if (IsInvalidItem(pState))
+{
+// tdf#162666 if invalid, use INVALID_POOL_ITEM
+pLastItem = INVALID_POOL_ITEM;
+}
+else if (IsDisabledItem(pState))
+{
+// tdf#162666 if disabled, use DISABLED_POOL_ITEM
+pLastItem = DISABLED_POOL_ITEM;
+}
+else
+{
+// tdf#162666 in all other cases, clone the Item. Note that
+// due to not using a Pool here it is not possible to use a
+// ItemSet or a ItemHolder, those would automatically handle
+// these cases correctly. In this cache, this currently needs
+// to be done handish. Also note that this may break again
+// when changes in the Item/ItemSet/ItemHolder mechanism may
+// be done
+pLastItem = pState->Clone();
+}
+}
+
 eLastState = eState;
 bItemDirty = false;
 }
diff --git a/sfx2/source/inc/statcach.hxx b/sfx2/source/inc/statcach.hxx
index 388e184f6653..2e648bd4b7fb 100644
--- a/sfx2/source/inc/statcach.hxx
+++ b/sfx2/source/inc/statcach.hxx
@@ -67,7 +67,7 @@ friend class BindDispatch_Impl;
 css::uno::Reference < css::frame::XDispatch > xMyDispatch;
 SfxControllerItem*  

core.git: sfx2/source

2024-10-28 Thread Andreas Heinisch (via logerrit)
 sfx2/source/control/thumbnailview.cxx |  139 +-
 1 file changed, 72 insertions(+), 67 deletions(-)

New commits:
commit 100743f8ad5a2328810af8b2ee19e535850ec901
Author: Andreas Heinisch 
AuthorDate: Sat Oct 26 16:56:28 2024 +0200
Commit: Andreas Heinisch 
CommitDate: Mon Oct 28 19:31:16 2024 +0100

tdf#162510 - Consider pinned items for the scroll bar in the start center

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

diff --git a/sfx2/source/control/thumbnailview.cxx 
b/sfx2/source/control/thumbnailview.cxx
index a54fb990e91a..8156d841d10f 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -371,9 +371,28 @@ void ThumbnailView::CalculateItemPositions(bool 
bScrollBarUsed)
 if (nVItemSpace == -1) // auto, split up extra space to use as vertical 
spacing
 nVItemSpace = nVSpace / (mnVisLines+1);
 
+// tdf#162510 - calculate maximum number of rows
+size_t nItemCountPinned = 0;
+#if !ENABLE_WASM_STRIP_RECENT
+bool bPinnedItems = true;
+for (size_t i = 0; bPinnedItems && i < nItemCount; ++i)
+{
+ThumbnailViewItem& rItem = *mFilteredItemList[i];
+if (auto const pRecentDocsItem = 
dynamic_cast(&rItem))
+{
+if (pRecentDocsItem->isPinned())
+++nItemCountPinned;
+else
+bPinnedItems = false;
+}
+}
+#endif
+
 // calculate maximum number of rows
 // Floor( (M+N-1)/N )==Ceiling( M/N )
-mnLines = (static_cast(nItemCount)+mnCols-1) / mnCols;
+mnLines = (static_cast(nItemCount - nItemCountPinned) + 
mnCols - 1) / mnCols;
+// tdf#162510 - add pinned items to number of lines
+mnLines += (static_cast(nItemCountPinned) + mnCols - 1) / 
mnCols;
 
 if ( !mnLines )
 mnLines = 1;
@@ -407,87 +426,73 @@ void ThumbnailView::CalculateItemPositions(bool 
bScrollBarUsed)
 size_t nFirstItem = (bScrollBarUsed ? nHiddenLines : mnFirstLine) * mnCols;
 size_t nLastItem = nFirstItem + (mnVisLines + 1) * mnCols;
 
-// If want also draw parts of items in the last line,
-// then we add one more line if parts of this line are visible
-
-#if !ENABLE_WASM_STRIP_RECENT
-bool bPinnedItems = true;
-#endif
-size_t nCurCount = 0;
-for ( size_t i = 0; i < nItemCount; i++ )
+// tdf#162510 - helper for in order to handle accessibility events
+auto handleAccessibleEvent = [&](ThumbnailViewItem& rItem, bool bIsVisible)
 {
-ThumbnailViewItem& rItem = *mFilteredItemList[i];
-
-#if !ENABLE_WASM_STRIP_RECENT
-// tdf#38742 - show pinned items in a separate line
-if (auto const pRecentDocsItem = 
dynamic_cast(&rItem))
+if (ImplHasAccessibleListeners())
 {
-if (bPinnedItems && !pRecentDocsItem->isPinned())
-{
-bPinnedItems = false;
-// Start a new line only if the entire line is not filled
-if (nCurCount % mnCols && nCurCount > nFirstItem)
-{
-x = nStartX;
-y += mnItemHeight + nVItemSpace;
-}
-nCurCount = 0;
-}
+css::uno::Any aOldAny, aNewAny;
+if (bIsVisible)
+aNewAny <<= 
css::uno::Reference(
+rItem.GetAccessible(false));
+else
+aOldAny <<= 
css::uno::Reference(
+rItem.GetAccessible(false));
+
ImplFireAccessibleEvent(css::accessibility::AccessibleEventId::CHILD, aOldAny, 
aNewAny);
 }
-#endif
+};
 
-if ((nCurCount >= nFirstItem) && (nCurCount < nLastItem))
+// tdf#162510 - helper to set visibility and update layout
+auto updateItemLayout = [&](ThumbnailViewItem& rItem, bool bIsVisible, 
size_t& nVisibleCount)
+{
+if (bIsVisible != rItem.isVisible())
 {
-if( !rItem.isVisible())
-{
-if ( ImplHasAccessibleListeners() )
-{
-css::uno::Any aOldAny, aNewAny;
-
-aNewAny <<= 
css::uno::Reference(rItem.GetAccessible( false 
));
-ImplFireAccessibleEvent( 
css::accessibility::AccessibleEventId::CHILD, aOldAny, aNewAny );
-}
-
-rItem.show(true);
-
-maItemStateHdl.Call(&rItem);
-}
+handleAccessibleEvent(rItem, bIsVisible);
+rItem.show(bIsVisible);
+maItemStateHdl.Call(&rItem);
+}
 
-rItem.setDrawArea(::tools::Rectangle( Point(x,y), 
Size(mnItemWidth, mnItemHeight) ));
-
rItem.calculateItemsPosition(mnThumbnailHeight,mnItemPadding,mpItemAttrs->nMaxTextLength,mpItemAttrs.get());
+if (bIsVisible)
+{
+rItem.setDrawArea(::

core.git: sfx2/source

2024-10-24 Thread Ilmari Lauhakangas (via logerrit)
 sfx2/source/appl/sfxhelp.cxx |   10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

New commits:
commit 624f01b02569f0a514b357a4d591b8526c3f73f2
Author: Ilmari Lauhakangas 
AuthorDate: Wed Oct 23 08:22:52 2024 +0300
Commit: Ilmari Lauhakangas 
CommitDate: Thu Oct 24 06:10:05 2024 +0200

tdf#163580 Open online Help, if warn option is not checked

Change-Id: I438032955f399a8b4737d100bee8a3db54427525
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175468
Reviewed-by: Rafael Lima 
Tested-by: Jenkins

diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index 47411f419f12..de9c54d90e5b 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -1101,13 +1101,12 @@ bool SfxHelp::Start_Impl(const OUString& rURL, const 
vcl::Window* pWindow)
 xChanges->commit();
 aBusy.decBusy();
 }
-
 // Checks whether the user clicked "Read Help Online" (RET_OK) or 
"Information on downloading offline help" (RET_YES)
-if(retOnlineHelpBox == RET_OK || retOnlineHelpBox == RET_YES)
+if(!bShowOfflineHelpPopUp || retOnlineHelpBox == RET_OK || 
retOnlineHelpBox == RET_YES)
 {
 bool bTopicExists;
 
-if (retOnlineHelpBox == RET_OK)
+if (!bShowOfflineHelpPopUp || retOnlineHelpBox == RET_OK)
 {
 bTopicExists = impl_showOnlineHelp(aHelpURL, pWeldWindow);
 }
@@ -1288,13 +1287,12 @@ bool SfxHelp::Start_Impl(const OUString& rURL, 
weld::Widget* pWidget, const OUSt
 xChanges->commit();
 aBusy.decBusy();
 }
-
 // Checks whether the user clicked "Read Help Online" (RET_OK) or 
"Information on downloading offline help" (RET_YES)
-if(retOnlineHelpBox == RET_OK || retOnlineHelpBox == RET_YES)
+if(!bShowOfflineHelpPopUp || retOnlineHelpBox == RET_OK || 
retOnlineHelpBox == RET_YES)
 {
 bool bTopicExists;
 
-if (retOnlineHelpBox == RET_OK)
+if (!bShowOfflineHelpPopUp || retOnlineHelpBox == RET_OK)
 {
 bTopicExists = impl_showOnlineHelp(aHelpURL, pWidget);
 }


core.git: sfx2/source

2024-10-22 Thread Miklos Vajna (via logerrit)
 sfx2/source/doc/objserv.cxx |   11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

New commits:
commit 4aa8d30c095e08825bc983c699e11f2e88182124
Author: Miklos Vajna 
AuthorDate: Tue Oct 22 14:02:57 2024 +0200
Commit: Miklos Vajna 
CommitDate: Tue Oct 22 17:21:27 2024 +0200

cool#9992 lok doc sign: never remember previous .uno:Signature params

Do this explicitly, so it can't happen that .uno:Signature with params
gets dispatched, then .uno:Signature without params still has the old
XCertificate.

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

diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index ff628d18059a..190b87ef2e1b 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -620,10 +620,15 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
 }
 SfxViewFrame* pFrame = GetFrame();
 SfxViewShell* pViewShell = pFrame ? pFrame->GetViewShell() : 
nullptr;
-if (!aSignatureCert.empty() && !aSignatureKey.empty() && 
pViewShell)
+if (pViewShell)
 {
-xCertificate = 
SfxLokHelper::getSigningCertificate(aSignatureCert, aSignatureKey);
-pViewShell->SetSigningCertificate(xCertificate);
+uno::Reference xSigningCertificate;
+if (!aSignatureCert.empty() && !aSignatureKey.empty())
+{
+xSigningCertificate = 
SfxLokHelper::getSigningCertificate(aSignatureCert, aSignatureKey);
+}
+// Always set the signing certificate, to clear data from 
a previous dispatch.
+pViewShell->SetSigningCertificate(xSigningCertificate);
 }
 
 // Async, all code before return has to go into the callback.


core.git: sfx2/source

2024-10-22 Thread Bogdan Buzea (via logerrit)
 sfx2/source/doc/objserv.cxx |8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

New commits:
commit 92bc85c42211fcfc6d2bfdeeaa1eb2d5c40ab6e1
Author: Bogdan Buzea 
AuthorDate: Sun Oct 20 21:26:54 2024 +0200
Commit: Xisco Fauli 
CommitDate: Tue Oct 22 11:57:36 2024 +0200

tdf#163486: PVS: Identical branches

V1037 Two or more case-branches perform the same actions. Check lines: 
1413, 1553

Change-Id: I6b28e9d7055bdf120759dff38d869d1cb1e70cc1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175271
Reviewed-by: Xisco Fauli 
Tested-by: Jenkins

diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 2de634bc452c..ff628d18059a 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -1430,13 +1430,6 @@ void SfxObjectShell::GetState_Impl(SfxItemSet &rSet)
 {
 switch ( nWhich )
 {
-case SID_DOCTEMPLATE :
-{
-if ( isExportLocked())
-rSet.DisableItem( nWhich );
-break;
-}
-
 case SID_CHECKOUT:
 {
 bool bShow = false;
@@ -1563,6 +1556,7 @@ void SfxObjectShell::GetState_Impl(SfxItemSet &rSet)
 break;
 }
 
+case SID_DOCTEMPLATE:
 case SID_EXPORTDOC:
 case SID_EXPORTDOCASPDF:
 case SID_DIRECTEXPORTDOCASPDF:


core.git: sfx2/source

2024-10-21 Thread Xisco Fauli (via logerrit)
 sfx2/source/view/viewprn.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a2bed2a09185b2cb1a5aaf926544475a4cc4a2b0
Author: Xisco Fauli 
AuthorDate: Mon Oct 21 12:53:03 2024 +0200
Commit: Xisco Fauli 
CommitDate: Mon Oct 21 15:27:02 2024 +0200

sfx2: check mpViewShell in another place

After
commit 3cc367f426506e3165dda06feeb20e0a9b4c6194
Author: Xisco Fauli 
Date:   Fri Oct 18 16:40:05 2024 +0200

tdf#163486: PVS: check mpViewShell

Kudos to M. Kaganski

Change-Id: Id1cfed6f199394720336581c87d11125cd147734
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175328
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx
index 319ecafbb7c8..bc885e5670c7 100644
--- a/sfx2/source/view/viewprn.cxx
+++ b/sfx2/source/view/viewprn.cxx
@@ -341,7 +341,7 @@ void SfxPrinterController::jobFinished( 
css::view::PrintableState nState )
 {
 // "real" problem (not simply printing cancelled by user)
 OUString aMsg( SfxResId(STR_NOSTARTPRINTER) );
-if ( !m_bApi )
+if ( !m_bApi && mpViewShell )
 {
 std::unique_ptr 
xBox(Application::CreateMessageDialog(mpViewShell->GetFrameWeld(),
  
VclMessageType::Warning, VclButtonsType::Ok,


core.git: sfx2/source

2024-10-21 Thread Caolán McNamara (via logerrit)
 sfx2/source/dialog/StyleList.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 04921e20b4d3d08a4b78dbafe26c983075fe5630
Author: Caolán McNamara 
AuthorDate: Fri Oct 18 09:00:42 2024 +0100
Commit: Caolán McNamara 
CommitDate: Mon Oct 21 10:29:16 2024 +0200

cid#1633189 silence Unchecked return value

and

cid#1633190 Unchecked return value
cid#1633191 Unchecked return value

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

diff --git a/sfx2/source/dialog/StyleList.cxx b/sfx2/source/dialog/StyleList.cxx
index 3d133d831efc..b5970461bd6a 100644
--- a/sfx2/source/dialog/StyleList.cxx
+++ b/sfx2/source/dialog/StyleList.cxx
@@ -788,14 +788,14 @@ static void FillBox_Impl(weld::TreeView& rBox, 
StyleTreeArr_Impl& rTreeArray,
 
 std::unique_ptr xChildParentIter = 
rBox.make_iterator(pParent);
 if (!pParent)
-rBox.get_iter_first(*xChildParentIter);
+(void)rBox.get_iter_first(*xChildParentIter);
 else
-rBox.iter_children(*xChildParentIter);
+(void)rBox.iter_children(*xChildParentIter);
 for (size_t i = 0; i < rTreeArray.size(); ++i)
 {
 FillBox_Impl(rBox, rTreeArray[i]->getChildren(), eStyleFamily, 
xChildParentIter.get(),
  blcl_insert, pViewShell, pStyleSheetPool);
-rBox.iter_next_sibling(*xChildParentIter);
+(void)rBox.iter_next_sibling(*xChildParentIter);
 }
 }
 


core.git: sfx2/source

2024-10-21 Thread Caolán McNamara (via logerrit)
 sfx2/source/dialog/StyleList.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit a0f024b43217ea5fbf932bb36683966b7334711d
Author: Caolán McNamara 
AuthorDate: Fri Oct 18 08:58:14 2024 +0100
Commit: Noel Grandin 
CommitDate: Mon Oct 21 09:57:53 2024 +0200

a little more natural to unconditional iterate after use

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

diff --git a/sfx2/source/dialog/StyleList.cxx b/sfx2/source/dialog/StyleList.cxx
index 775ebc8db551..3d133d831efc 100644
--- a/sfx2/source/dialog/StyleList.cxx
+++ b/sfx2/source/dialog/StyleList.cxx
@@ -793,10 +793,9 @@ static void FillBox_Impl(weld::TreeView& rBox, 
StyleTreeArr_Impl& rTreeArray,
 rBox.iter_children(*xChildParentIter);
 for (size_t i = 0; i < rTreeArray.size(); ++i)
 {
-if (i != 0)
-rBox.iter_next_sibling(*xChildParentIter);
 FillBox_Impl(rBox, rTreeArray[i]->getChildren(), eStyleFamily, 
xChildParentIter.get(),
  blcl_insert, pViewShell, pStyleSheetPool);
+rBox.iter_next_sibling(*xChildParentIter);
 }
 }
 


core.git: sfx2/source

2024-10-20 Thread Xisco Fauli (via logerrit)
 sfx2/source/dialog/dinfdlg.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 41db41a3aac2e465b074ef9a75c9d557b8d9ff6a
Author: Xisco Fauli 
AuthorDate: Sun Oct 20 20:34:53 2024 +0200
Commit: Xisco Fauli 
CommitDate: Sun Oct 20 22:24:56 2024 +0200

tdf#163486: PVS: identical sub-expressions

Since
commit 0deea02b1da1001fa497dc5afa5e43207af491d5
Author: Sarper Akdemir 
Date:   Sat Aug 19 17:18:50 2023 +0300

tdf#138792: PDF export: add batch of dublin core attributes

V501There are identical sub-expressions 'bKeywordsMod' to the left and 
to the right of the '||' operator.
V501There are identical sub-expressions 'bThemeMod' to the left and to 
the right of the '||' operator.
V501There are identical sub-expressions 'bTitleMod' to the left and to 
the right of the '||' operator.

Change-Id: I438e0284a190241bf86b0e127de2f12f4a1a68b7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175287
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 5ae79ea15eb1..7d433aa7329e 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -662,7 +662,7 @@ bool SfxDocumentDescPage::FillItemSet(SfxItemSet *rSet)
 const bool bSourceMod = m_xSourceEd->get_value_changed_from_saved();
 const bool bTypeMod = m_xTypeEd->get_value_changed_from_saved();
 const bool bCommentMod = m_xCommentEd->get_value_changed_from_saved();
-if (!(bTitleMod || bThemeMod || bKeywordsMod || bTitleMod || bThemeMod || 
bKeywordsMod
+if (!(bTitleMod || bThemeMod || bKeywordsMod
   || bContributorMod || bCoverageMod || bIdentifierMod || 
bPublisherMod || bRelationMod
   || bRightsMod || bSourceMod || bTypeMod || bCommentMod))
 {


core.git: sfx2/source

2024-10-19 Thread Mike Kaganski (via logerrit)
 sfx2/source/dialog/tabdlg.cxx |   93 ++
 1 file changed, 40 insertions(+), 53 deletions(-)

New commits:
commit 341f3618866c622fa511f153a1b48621e04ddd17
Author: Mike Kaganski 
AuthorDate: Sat Oct 19 18:01:31 2024 +0200
Commit: Mike Kaganski 
CommitDate: Sat Oct 19 22:14:52 2024 +0200

tdf#163486: PVS: Numeric Truncation Error. Return value of the 'size' 
function is written to the 16-bit variable.

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

diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index f9ffe206ec59..ec1e8dbcefa6 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -106,22 +106,10 @@ struct TabDlg_Impl
 }
 };
 
-static Data_Impl* Find( const SfxTabDlgData_Impl& rArr, std::u16string_view 
rId, sal_uInt16* pPos = nullptr)
+static auto Find(const SfxTabDlgData_Impl& rArr, std::u16string_view rId)
 {
-const sal_uInt16 nCount = rArr.size();
-
-for ( sal_uInt16 i = 0; i < nCount; ++i )
-{
-Data_Impl* pObj = rArr[i];
-
-if ( pObj->sId == rId )
-{
-if ( pPos )
-*pPos = i;
-return pObj;
-}
-}
-return nullptr;
+return std::find_if(rArr.begin(), rArr.end(),
+[rId](const auto& item) { return item->sId == rId; });
 }
 
 void SfxTabPage::SetFrame(const css::uno::Reference< css::frame::XFrame >& 
xFrame)
@@ -430,19 +418,19 @@ IMPL_LINK_NOARG(SfxTabDialogController, ResetHdl, 
weld::Button&, void)
 */
 
 {
-Data_Impl* pDataObject = Find(m_pImpl->aData, 
m_xTabCtrl->get_current_page_ident());
-assert(pDataObject && "Id not known");
+auto it = Find(m_pImpl->aData, m_xTabCtrl->get_current_page_ident());
+assert(it != m_pImpl->aData.end() && "Id not known");
 
-pDataObject->xTabPage->Reset(m_pSet.get());
+(*it)->xTabPage->Reset(m_pSet.get());
 // Also reset relevant items of ExampleSet and OutSet to initial state
-if (!pDataObject->fnGetRanges)
+if (!(*it)->fnGetRanges)
 return;
 
 if (!m_xExampleSet)
 m_xExampleSet.reset(new SfxItemSet(*m_pSet));
 
 const SfxItemPool* pPool = m_pSet->GetPool();
-const WhichRangesContainer& pTmpRanges = (pDataObject->fnGetRanges)();
+const WhichRangesContainer& pTmpRanges = ((*it)->fnGetRanges)();
 
 for (const auto & rPair : pTmpRanges)
 {
@@ -485,17 +473,17 @@ IMPL_LINK_NOARG(SfxTabDialogController, BaseFmtHdl, 
weld::Button&, void)
 {
 m_bStandardPushed = true;
 
-Data_Impl* pDataObject = Find(m_pImpl->aData, 
m_xTabCtrl->get_current_page_ident());
-assert(pDataObject && "Id not known");
+auto it = Find(m_pImpl->aData, m_xTabCtrl->get_current_page_ident());
+assert(it != m_pImpl->aData.end() && "Id not known");
 
-if (!pDataObject->fnGetRanges)
+if (!(*it)->fnGetRanges)
 return;
 
 if (!m_xExampleSet)
 m_xExampleSet.reset(new SfxItemSet(*m_pSet));
 
 const SfxItemPool* pPool = m_pSet->GetPool();
-const WhichRangesContainer& pTmpRanges = (pDataObject->fnGetRanges)();
+const WhichRangesContainer& pTmpRanges = ((*it)->fnGetRanges)();
 SfxItemSet aTmpSet(*m_xExampleSet);
 
 for (const auto& rPair : pTmpRanges)
@@ -523,9 +511,9 @@ IMPL_LINK_NOARG(SfxTabDialogController, BaseFmtHdl, 
weld::Button&, void)
 }
 }
 // Set all Items as new  -> the call the current Page Reset()
-assert(pDataObject->xTabPage && "the Page is gone");
-pDataObject->xTabPage->Reset( &aTmpSet );
-pDataObject->xTabPage->mpImpl->mbStandard = true;
+assert((*it)->xTabPage && "the Page is gone");
+(*it)->xTabPage->Reset(&aTmpSet);
+(*it)->xTabPage->mpImpl->mbStandard = true;
 }
 
 IMPL_LINK(SfxTabDialogController, ActivatePageHdl, const OUString&, rPage, 
void)
@@ -543,20 +531,20 @@ void SfxTabDialogController::ActivatePage(const OUString& 
rPage)
 
 {
 assert(!m_pImpl->aData.empty() && "no Pages registered");
-Data_Impl* pDataObject = Find(m_pImpl->aData, rPage);
-if (!pDataObject)
+auto it = Find(m_pImpl->aData, rPage);
+if (it == m_pImpl->aData.end())
 {
 SAL_WARN("sfx.dialog", "Tab Page ID '" << rPage << "' not known, this 
is pretty serious and needs investigation");
 return;
 }
 
-SfxTabPage* pTabPage = pDataObject->xTabPage.get();
+SfxTabPage* pTabPage = (*it)->xTabPage.get();
 if (!pTabPage)
 return;
 
-if (pDataObject->bRefresh)
+if ((*it)->bRefresh)
 pTabPage->Reset(m_pSet.get());
-pDataObject->bRefresh = false;
+(*it)->bRefresh = false;
 
 if (m_xExampleSet)
 pTabPage->ActivatePage(*m_xExampleSet);
@@ -584,14 +572,14 @@ bool 
SfxTabDialogController::DeactivatePage(std::u16string_view aPage)
 
 {
 assert(!m_pImpl->aData.empty() && "no Pages registered");
-Data_

core.git: sfx2/source

2024-10-18 Thread Xisco Fauli (via logerrit)
 sfx2/source/view/viewprn.cxx |   13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

New commits:
commit 3cc367f426506e3165dda06feeb20e0a9b4c6194
Author: Xisco Fauli 
AuthorDate: Fri Oct 18 16:40:05 2024 +0200
Commit: Xisco Fauli 
CommitDate: Fri Oct 18 21:46:19 2024 +0200

tdf#163486: PVS: check mpViewShell

V595The 'mpViewShell' pointer was utilized before it was verified 
against nullptr. Check lines: 368, 380.

Change-Id: I5e8d53d3503ade1814d7436e89f0f407f1d9ccfb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175164
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx
index e1bc2c4ec915..319ecafbb7c8 100644
--- a/sfx2/source/view/viewprn.cxx
+++ b/sfx2/source/view/viewprn.cxx
@@ -365,11 +365,14 @@ void SfxPrinterController::jobFinished( 
css::view::PrintableState nState )
 case view::PrintableState_JOB_SPOOLED :
 case view::PrintableState_JOB_COMPLETED :
 {
-SfxBindings& rBind = mpViewShell->GetViewFrame().GetBindings();
-rBind.Invalidate( SID_PRINTDOC );
-rBind.Invalidate( SID_PRINTDOCDIRECT );
-rBind.Invalidate( SID_SETUPPRINTER );
-bCopyJobSetup = ! m_bTempPrinter;
+if (mpViewShell)
+{
+SfxBindings& rBind = mpViewShell->GetViewFrame().GetBindings();
+rBind.Invalidate( SID_PRINTDOC );
+rBind.Invalidate( SID_PRINTDOCDIRECT );
+rBind.Invalidate( SID_SETUPPRINTER );
+bCopyJobSetup = ! m_bTempPrinter;
+}
 break;
 }
 


core.git: sfx2/source

2024-10-04 Thread Ilmari Lauhakangas (via logerrit)
 sfx2/source/control/recentdocsviewitem.cxx |8 
 sfx2/source/control/recentdocsviewitem.hxx |2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit f37542a29121ce64a306abb2c7e4d572cf245e35
Author: Ilmari Lauhakangas 
AuthorDate: Fri Oct 4 18:18:07 2024 +0300
Commit: Andreas Heinisch 
CommitDate: Fri Oct 4 19:48:29 2024 +0200

Make Start Center pin icon highlight behave as intended

After
commit 9a37652b79001bf5208841b9221dee851b9b6d0f
Author: Andreas Heinisch 
Date:   Wed Sep 6 17:03:26 2023 +0200

tdf#156959 - Remove pinned icons from thumbnail view item

Remove pinned icons from thumbnail view item and pushed it down
to the recent documents view item. This avoids that the pinned
icon will be shown in a simple thumbnail view, e.g., in the
thumbnail view of the side pane in base.

In addition, fixed an error with the number of elements in the
thumbnail view in the start center when items are pinned, i.e.,
removed a spurious new line.

... the pin icon stopped changing its state to highlighted.

I believe my commit makes it work like Andreas intended.

Also fix a typo in a member name to prevent accidents in the future.

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

diff --git a/sfx2/source/control/recentdocsviewitem.cxx 
b/sfx2/source/control/recentdocsviewitem.cxx
index d5ae52e297d8..e557c66fdb77 100644
--- a/sfx2/source/control/recentdocsviewitem.cxx
+++ b/sfx2/source/control/recentdocsviewitem.cxx
@@ -134,7 +134,7 @@ RecentDocsViewItem::RecentDocsViewItem(sfx2::RecentDocsView 
&rView, const OUStri
   m_bPinned(isPinned),
   m_bPinnedIconHighlighted(false),
   m_aPinnedDocumentBitmap(BMP_PIN_DOC),
-  m_aPinnedDocumentBitmapHiglighted(BMP_PIN_DOC_HIGHLIGHTED)
+  m_aPinnedDocumentBitmapHighlighted(BMP_PIN_DOC_HIGHLIGHTED)
 {
 OUString aTitle(rTitle);
 INetURLObject aURLObj(rURL);
@@ -311,7 +311,8 @@ void 
RecentDocsViewItem::Paint(drawinglayer::processor2d::BaseProcessor2D *pProc
 // tdf#38742 - draw pinned icon
 const Point aPinnedIconPos(getPinnedIconArea().TopLeft());
 aSeq.push_back(new DiscreteBitmapPrimitive2D(
-m_aPinnedDocumentBitmap, B2DPoint(aPinnedIconPos.X(), 
aPinnedIconPos.Y(;
+m_bPinnedIconHighlighted ? m_aPinnedDocumentBitmapHighlighted : 
m_aPinnedDocumentBitmap,
+B2DPoint(aPinnedIconPos.X(), aPinnedIconPos.Y(;
 
 pProcessor->process(aSeq);
 }
@@ -321,8 +322,7 @@ void 
RecentDocsViewItem::Paint(drawinglayer::processor2d::BaseProcessor2D *pProc
 const Point aPinnedIconPos(getPinnedIconArea().TopLeft());
 drawinglayer::primitive2d::Primitive2DContainer aSeq {
 new DiscreteBitmapPrimitive2D(
-m_bPinnedIconHighlighted ? m_aPinnedDocumentBitmapHiglighted : 
m_aPinnedDocumentBitmap,
-B2DPoint(aPinnedIconPos.X(), aPinnedIconPos.Y())) };
+m_aPinnedDocumentBitmap, B2DPoint(aPinnedIconPos.X(), 
aPinnedIconPos.Y())) };
 
 pProcessor->process(aSeq);
 }
diff --git a/sfx2/source/control/recentdocsviewitem.hxx 
b/sfx2/source/control/recentdocsviewitem.hxx
index 9fd1b760b08f..3c5a5a6973f3 100644
--- a/sfx2/source/control/recentdocsviewitem.hxx
+++ b/sfx2/source/control/recentdocsviewitem.hxx
@@ -68,7 +68,7 @@ private:
 bool m_bPinned;
 bool m_bPinnedIconHighlighted;
 BitmapEx m_aPinnedDocumentBitmap;
-BitmapEx m_aPinnedDocumentBitmapHiglighted;
+BitmapEx m_aPinnedDocumentBitmapHighlighted;
 };
 
 #endif // INCLUDED_SFX2_RECENTDOCSVIEWITEM_HXX


core.git: sfx2/source

2024-10-04 Thread Xisco Fauli (via logerrit)
 sfx2/source/doc/templatedlg.cxx |6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

New commits:
commit df54f8a4bd8970cf13e6a6aaf9056afccf2cc758
Author: Xisco Fauli 
AuthorDate: Fri Oct 4 14:08:03 2024 +0200
Commit: Xisco Fauli 
CommitDate: Fri Oct 4 15:30:03 2024 +0200

related tdf#163291: revert workaround for tdf#137922

It's no longer needed after bb0e5aa97965b2710200da677db032289c373afe
"tdf#163291 Fix AdditionsDialog in start center"

This reverts commit 63b0565ad137e5d81932f1fabba732ba40f6cb70

Change-Id: Ib89ddaf9a9654220ade6f40a6c48933763ca4a30
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174477
Reviewed-by: Xisco Fauli 
Tested-by: Jenkins

diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index f0f0322a14d9..e32445fcbcfa 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -206,11 +206,7 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg(weld::Window 
*pParent)
 mxLocalViewWeld->set_size_request(TEMPLATE_ITEM_MAX_WIDTH * 5, 
TEMPLATE_ITEM_MAX_HEIGHT_SUB * 3);
 
 mxOKButton->connect_clicked(LINK(this, SfxTemplateManagerDlg, OkClickHdl));
-// FIXME: rather than disabling make 
dispatchCommand(".uno:AdditionsDialog") work in start center
-if ( !SfxModule::GetActiveModule() )
-mxActionBar->set_item_sensitive(MNI_ACTION_EXTENSIONS, false);
-else
-mxActionBar->set_item_sensitive(MNI_ACTION_EXTENSIONS, true);
+mxActionBar->set_item_sensitive(MNI_ACTION_EXTENSIONS, true);
 mxListViewButton->connect_toggled(LINK(this, SfxTemplateManagerDlg, 
ListViewHdl));
 mxThumbnailViewButton->connect_toggled(LINK(this, SfxTemplateManagerDlg, 
ThumbnailViewHdl));
 


core.git: sfx2/source

2024-10-02 Thread Miklos Vajna (via logerrit)
 sfx2/source/doc/objserv.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 1c7f6188eb5b2a2bbf0cf589843d644306e40d6d
Author: Miklos Vajna 
AuthorDate: Wed Oct 2 08:42:26 2024 +0200
Commit: Miklos Vajna 
CommitDate: Wed Oct 2 09:49:04 2024 +0200

cool#9992 lok doc sign: avoid storing the sign cert in the model after sign

Open the signatures dialog in LOK mode, add a signature, close it, you
get a (non-async) popup asking if you want to automatically re-sign the
document on each save in the future.

This makes sense when only one user edits the document, but the LOK mode
stores the signing certificates in the view, so this would mean user A
can enable this mode, then user B could edit + save, which is not
wanted.

Fix the problem by just not offering this functionality in LOK mode,
where we assume that certificates are per-view and the save works on the
model.

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

diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index a6ac42734c17..12c28f4e614d 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -538,6 +538,12 @@ void SetDocProperties(const 
uno::Reference& xDP,
 
 void SfxObjectShell::AfterSignContent(bool bHaveWeSigned, weld::Window* 
pDialogParent)
 {
+if (comphelper::LibreOfficeKit::isActive())
+{
+// LOK signing certificates are per-view, don't store them in the 
model.
+return;
+}
+
 if ( bHaveWeSigned && HasValidSignatures() )
 {
 std::unique_ptr 
xBox(Application::CreateMessageDialog( pDialogParent,


core.git: sfx2/source

2024-09-28 Thread Noel Grandin (via logerrit)
 sfx2/source/doc/docinf.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 8535d6741ec9bd5d6105181af28f0500148d034f
Author: Noel Grandin 
AuthorDate: Sat Sep 28 20:16:04 2024 +0200
Commit: Noel Grandin 
CommitDate: Sat Sep 28 21:22:16 2024 +0200

cid#1607100 Overflowed constant

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

diff --git a/sfx2/source/doc/docinf.cxx b/sfx2/source/doc/docinf.cxx
index 4e8e3663707f..8a4558760ed2 100644
--- a/sfx2/source/doc/docinf.cxx
+++ b/sfx2/source/doc/docinf.cxx
@@ -116,6 +116,7 @@ ErrCode LoadOlePropertySet(
  && aDateTime.Day == 0 && aDateTime.Month == 0
  && aDateTime.Year == 0) )
 {
+assert(aDateTime.Day <= 31);
 // subtract offset 1601-01-01
 aDateTime.Year  -= 1601;
 aDateTime.Month -= 1;


core.git: sfx2/source

2024-09-22 Thread Patrick Luby (via logerrit)
 sfx2/source/control/recentdocsviewitem.cxx |   15 +++
 1 file changed, 15 insertions(+)

New commits:
commit 13a42d5c2d433da6c2c69159bfc6df0e3764
Author: Patrick Luby 
AuthorDate: Sat Sep 21 21:09:33 2024 -0400
Commit: Patrick Luby 
CommitDate: Sun Sep 22 17:14:19 2024 +0200

tdf#163086 downscale excessively large pinned document icons

For some unknown reason to me, some of the SVG icon sets have their
pinned document icons set to a viewport of 64x64. So downscale such
icons to more closely match the size of the pinned document icons
in the PNG icon sets.

Change-Id: Ic7e51ff194968e09d13a5bff341ccbbf80cfb26a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173765
Tested-by: Jenkins
Reviewed-by: Patrick Luby 

diff --git a/sfx2/source/control/recentdocsviewitem.cxx 
b/sfx2/source/control/recentdocsviewitem.cxx
index d5ae52e297d8..f422a2ad40d7 100644
--- a/sfx2/source/control/recentdocsviewitem.cxx
+++ b/sfx2/source/control/recentdocsviewitem.cxx
@@ -147,6 +147,21 @@ 
RecentDocsViewItem::RecentDocsViewItem(sfx2::RecentDocsView &rView, const OUStri
 if (aTitle.isEmpty())
 aTitle = 
aURLObj.GetLastName(INetURLObject::DecodeMechanism::WithCharset);
 
+// tdf#163086 downscale excessively large pinned document icons
+// For some unknown reason to me, some of the SVG icon sets have their
+// pinned document icons set to a viewport of 64x64. So downscale such
+// icons to more closely match the size of the pinned document icons
+// in the PNG icon sets.
+const double nMaxWidthAndHeight = 24;
+const Size aPinnedBmpSize(m_aPinnedDocumentBitmap.GetSizePixel());
+const double nPinnedBmpMaxWidthAndHeight = 
std::max(aPinnedBmpSize.Width(), aPinnedBmpSize.Height());
+if (nPinnedBmpMaxWidthAndHeight > nMaxWidthAndHeight)
+{
+const double fScale = nMaxWidthAndHeight / nPinnedBmpMaxWidthAndHeight;
+m_aPinnedDocumentBitmap.Scale(fScale, fScale);
+m_aPinnedDocumentBitmapHiglighted.Scale(fScale, fScale);
+}
+
 BitmapEx aThumbnail;
 
 //fdo#74834: only load thumbnail if the corresponding option is not 
disabled in the configuration


core.git: sfx2/source

2024-09-12 Thread Andrea Gelmini (via logerrit)
 sfx2/source/doc/guisaveas.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 128b19c33088dcd3dab55074a70a545e4b47a190
Author: Andrea Gelmini 
AuthorDate: Thu Sep 12 17:13:19 2024 +0200
Commit: Julien Nabet 
CommitDate: Thu Sep 12 22:32:26 2024 +0200

Fix typo

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

diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index add52df2bc44..435657928d71 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -1939,7 +1939,7 @@ bool 
SfxStoringHelper::FinishGUIStoreModel(::comphelper::SequenceAsHashMap::cons
 if (!bFoundCert)
 {
 // couldn't find the specified default signing certificate!
-// alert the user the document won't be singed
+// alert the user the document won't be signed
 std::unique_ptr 
xBox(Application::CreateMessageDialog(
 SfxStoringHelper::GetModelWindow(aModelData.GetModel()),
 VclMessageType::Error, VclButtonsType::Ok,


core.git: sfx2/source xmlsecurity/source

2024-09-11 Thread Miklos Vajna (via logerrit)
 sfx2/source/doc/docfile.cxx|2 
 sfx2/source/doc/objserv.cxx|3 -
 xmlsecurity/source/component/documentdigitalsignatures.cxx |   33 +
 3 files changed, 17 insertions(+), 21 deletions(-)

New commits:
commit 482c7c585160681b263c6245a745c21df70e7507
Author: Miklos Vajna 
AuthorDate: Wed Sep 11 08:26:02 2024 +0200
Commit: Miklos Vajna 
CommitDate: Wed Sep 11 12:34:13 2024 +0200

cool#9992 lok doc sign: async read-write DigitalSignaturesDialog

This finally allows removing the hack for the LOK case in
SfxObjectShell::CheckIsReadonly() to show the signatures dialog
read-only.

Also fix a case while signing PDFs where the file stream was on the
stack, but now that we finish signing in an async callback, signing
crashed due to a use-after-free.

Fix that by giving the std::unique_ptr to the utl::OStreamWrapper ctor,
which knows to take over ownership in this case, and that wrapper is
reference-counted.

Next problem is that the add/remove buttons in the dialog are still
hidden in the LOK case, that's not yet fixed here.

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

diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index ff0380f72b6a..acef518d97f9 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -4525,7 +4525,7 @@ void SfxMedium::SignContents_Impl(weld::Window* 
pDialogParent,
 {
 // Something not ZIP based: e.g. PDF.
 std::unique_ptr 
pStream(utl::UcbStreamHelper::CreateStream(GetName(), StreamMode::READ | 
StreamMode::WRITE));
-uno::Reference xStream(new 
utl::OStreamWrapper(*pStream));
+uno::Reference xStream(new 
utl::OStreamWrapper(std::move(pStream)));
 
xModelSigner->SignDocumentContentAsync(uno::Reference(), 
xStream, [onSignDocumentContentFinished](bool bRet) {
 onSignDocumentContentFinished(bRet);
 });
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 786c03d9593c..1973ba4f29da 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -2067,8 +2067,7 @@ void SfxObjectShell::AfterSigning(bool bSignSuccess, bool 
bSignScriptingContent)
 
 bool SfxObjectShell::CheckIsReadonly(bool bSignScriptingContent, weld::Window* 
pDialogParent)
 {
-// in LOK case we support only viewer / readonly mode so far
-if (GetMedium()->IsOriginallyReadOnly() || 
comphelper::LibreOfficeKit::isActive())
+if (GetMedium()->IsOriginallyReadOnly())
 {
 // If the file is physically read-only, we just show the existing 
signatures
 try
diff --git a/xmlsecurity/source/component/documentdigitalsignatures.cxx 
b/xmlsecurity/source/component/documentdigitalsignatures.cxx
index 9e3810edcb68..5cd2e6e5bb44 100644
--- a/xmlsecurity/source/component/documentdigitalsignatures.cxx
+++ b/xmlsecurity/source/component/documentdigitalsignatures.cxx
@@ -445,28 +445,25 @@ void DocumentDigitalSignatures::ImplViewSignatures(
 
 xSignaturesDialog->SetSignatureStream( xSignStream );
 
-if (bReadOnly)
-{
-xSignaturesDialog->beforeRun();
-weld::DialogController::runAsync(xSignaturesDialog, [] (sal_Int32) 
{});
-rCallback(false);
-return;
-}
-else if (xSignaturesDialog->run() == RET_OK)
-{
-if (xSignaturesDialog->SignaturesChanged())
+xSignaturesDialog->beforeRun();
+weld::DialogController::runAsync(xSignaturesDialog, 
[xSignaturesDialog, rxStorage, xSignStream, rCallback] (sal_Int32 nRet) {
+if (nRet == RET_OK)
 {
-bChanges = true;
-// If we have a storage and no stream, we are responsible for 
commit
-if ( rxStorage.is() && !xSignStream.is() )
+bool bChanged = false;
+if (xSignaturesDialog->SignaturesChanged())
 {
-uno::Reference< embed::XTransactedObject > xTrans( 
rxStorage, uno::UNO_QUERY );
-xTrans->commit();
+bChanged = true;
+// If we have a storage and no stream, we are responsible 
for commit
+if ( rxStorage.is() && !xSignStream.is() )
+{
+uno::Reference< embed::XTransactedObject > xTrans( 
rxStorage, uno::UNO_QUERY );
+xTrans->commit();
+}
 }
+rCallback(bChanged);
 }
-rCallback(bChanges);
-return;
-}
+});
+return;
 }
 else
 {


core.git: sfx2/source sfx2/uiconfig

2024-09-09 Thread Caolán McNamara (via logerrit)
 sfx2/source/dialog/backingwindow.cxx |   18 +++--
 sfx2/source/dialog/backingwindow.hxx |3 +-
 sfx2/uiconfig/ui/startcenter.ui  |   47 +++
 3 files changed, 59 insertions(+), 9 deletions(-)

New commits:
commit 6ca8cf32d2f879dbead2f402eeef60edd3f0266e
Author: Caolán McNamara 
AuthorDate: Mon Sep 9 13:33:47 2024 +0100
Commit: Caolán McNamara 
CommitDate: Mon Sep 9 21:06:43 2024 +0200

tdf#162732 force centered alignment for donate button text

bit of a bodge, gtk defaults to baseline alignment here, so force
what we want instead in a separate "Donate" button.

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

diff --git a/sfx2/source/dialog/backingwindow.cxx 
b/sfx2/source/dialog/backingwindow.cxx
index 3c90d1ea2ade..b16a0abce44a 100644
--- a/sfx2/source/dialog/backingwindow.cxx
+++ b/sfx2/source/dialog/backingwindow.cxx
@@ -170,6 +170,7 @@ BackingWindow::BackingWindow(vcl::Window* i_pParent)
 , mxBrandImageWeld(new weld::CustomWeld(*m_xBuilder, u"daBrand"_ustr, 
*mxBrandImage))
 , mxHelpButton(m_xBuilder->weld_button(u"help"_ustr))
 , mxExtensionsButton(m_xBuilder->weld_button(u"extensions"_ustr))
+, mxDonateButton(m_xBuilder->weld_button(u"donate"_ustr))
 , mxAllButtonsBox(m_xBuilder->weld_container(u"all_buttons_box"_ustr))
 , mxButtonsBox(m_xBuilder->weld_container(u"buttons_box"_ustr))
 , mxSmallButtonsBox(m_xBuilder->weld_container(u"small_buttons_box"_ustr))
@@ -193,17 +194,19 @@ BackingWindow::BackingWindow(vcl::Window* i_pParent)
 mxHelpButton->set_label(mxAltHelpLabel->get_label());
 mxHelpButton->connect_clicked(LINK(this, BackingWindow, ClickHelpHdl));
 
-// tdf#161796 make the extension button show the donation page
+// tdf#161796 replace the extension button with a donate button
 if (officecfg::Office::Common::Misc::ShowDonation::get())
 {
-mxExtensionsButton->set_from_icon_name(BMP_DONATE); // icon first 
needed on gtk3 to apply the label
+mxExtensionsButton->hide();
+mxDonateButton->show();
+mxDonateButton->set_from_icon_name(BMP_DONATE);
 OUString sDonate(SfxResId(STR_DONATE_BUTTON));
 if (sDonate.getLength() > 8)
 {
-mxExtensionsButton->set_tooltip_text(sDonate);
+mxDonateButton->set_tooltip_text(sDonate);
 sDonate = OUString::Concat(sDonate.subView(0, 7)) + "...";
 }
-mxExtensionsButton->set_label(sDonate);
+mxDonateButton->set_label(sDonate);
 }
 
 mxDropTarget = mxAllRecentThumbnails->GetDropTarget();
@@ -266,6 +269,7 @@ void BackingWindow::dispose()
 mxBrandImageWeld.reset();
 mxBrandImage.reset();
 mxHelpButton.reset();
+mxDonateButton.reset();
 mxExtensionsButton.reset();
 mxAllButtonsBox.reset();
 mxButtonsBox.reset();
@@ -321,6 +325,7 @@ void BackingWindow::initControls()
 checkInstalledModules();
 
 mxExtensionsButton->connect_clicked(LINK(this, BackingWindow, 
ExtLinkClickHdl));
+mxDonateButton->connect_clicked(LINK(this, BackingWindow, 
ExtLinkClickHdl));
 
 mxOpenButton->connect_clicked(LINK(this, BackingWindow, ClickHdl));
 
@@ -543,11 +548,8 @@ void BackingWindow::setOwningFrame( const 
css::uno::Reference< css::frame::XFram
 xFramesSupplier->setActiveFrame(mxFrame);
 }
 
-IMPL_LINK(BackingWindow, ExtLinkClickHdl, weld::Button&, rButton,void)
+IMPL_STATIC_LINK_NOARG(BackingWindow, ExtLinkClickHdl, weld::Button&, void)
 {
-if (&rButton != mxExtensionsButton.get())
-   return;
-
 try
 {
 OUString sURL;
diff --git a/sfx2/source/dialog/backingwindow.hxx 
b/sfx2/source/dialog/backingwindow.hxx
index 9fda28572c92..e8ac74f6a143 100644
--- a/sfx2/source/dialog/backingwindow.hxx
+++ b/sfx2/source/dialog/backingwindow.hxx
@@ -68,6 +68,7 @@ class BackingWindow : public InterimItemWindow
 
 std::unique_ptr mxHelpButton;
 std::unique_ptr mxExtensionsButton;
+std::unique_ptr mxDonateButton;
 
 std::unique_ptr mxAllButtonsBox;
 std::unique_ptr mxButtonsBox;
@@ -95,7 +96,7 @@ class BackingWindow : public InterimItemWindow
 DECL_LINK(ClickHdl, weld::Button&, void);
 DECL_LINK(ClickHelpHdl, weld::Button&, void);
 DECL_LINK(MenuSelectHdl, const OUString&, void);
-DECL_LINK(ExtLinkClickHdl, weld::Button&, void);
+DECL_STATIC_LINK(BackingWindow, ExtLinkClickHdl, weld::Button&, void);
 DECL_LINK(CreateContextMenuHdl, ThumbnailViewItem*, void);
 DECL_LINK(OpenTemplateHdl, ThumbnailViewItem*, void);
 DECL_LINK(EditTemplateHdl, ThumbnailViewItem*, void);
diff --git a/sfx2/uiconfig/ui/startcenter.ui b/sfx2/uiconfig/ui/startcenter.ui
index 657b1984006f..ea407c1a2df8 100644
--- a/sfx2/uiconfig/ui/startcenter.ui
+++ b/sfx2/uiconfig/ui/startcenter.ui
@@ -444,6 +444,53 @@
 1
   

core.git: sfx2/source sfx2/uiconfig

2024-09-05 Thread Heiko Tietze (via logerrit)
 sfx2/source/dialog/dinfdlg.cxx  |1 
 sfx2/uiconfig/ui/descriptioninfopage.ui |  791 
 2 files changed, 404 insertions(+), 388 deletions(-)

New commits:
commit 5c64b81b4d5bd347e57ba156bb0c34d09fb6aa5b
Author: Heiko Tietze 
AuthorDate: Thu Sep 5 09:35:12 2024 +0200
Commit: Heiko Tietze 
CommitDate: Thu Sep 5 12:22:47 2024 +0200

Resolves tdf#160937 - Minimize document properties dialog size

* Scrolled view behind Description items
* Width for preferred image resolution set to 5 chars

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

diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 438a31753f31..b6dd32b13b3f 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -823,6 +823,7 @@ SfxDocumentPage::SfxDocumentPage(weld::Container* pPage, 
weld::DialogController*
 
 m_aMultiSignedStr = m_xSignedValFt->get_label();
 m_xSignedValFt->set_label(OUString());
+m_xImagePreferredDpiComboBox->set_entry_width_chars(5); // "width in 
chars" in Glade not effective
 
 ImplUpdateSignatures();
 ImplCheckPasswordState();
diff --git a/sfx2/uiconfig/ui/descriptioninfopage.ui 
b/sfx2/uiconfig/ui/descriptioninfopage.ui
index 5f809140651b..2a88fd2ee268 100644
--- a/sfx2/uiconfig/ui/descriptioninfopage.ui
+++ b/sfx2/uiconfig/ui/descriptioninfopage.ui
@@ -1,410 +1,425 @@
 
-
+
 
   
-  
-  
+  
 True
 False
 True
 True
 6
-6
-12
+in
 
-  
+  
 True
 False
-_Title:
-True
-title
-1
-  
-  
-0
-0
-  
-
-
-  
-True
-False
-_Subject:
-True
-subject
-1
-  
-  
-0
-1
-  
-
-
-  
-True
-False
-_Keywords:
-True
-keywords
-1
-  
-  
-0
-2
-  
-
-
-  
-True
-False
-start
-Co_ntributor:
-True
-contributor
-1
-  
-  
-0
-3
-  
-
-
-  
-True
-False
-start
-Co_verage:
-True
-coverage
-1
-  
-  
-0
-4
-  
-
-
-  
-True
-False
-start
-_Identifier:
-True
-identifier
-1
-  
-  
-0
-5
-  
-
-
-  
-True
-False
-start
-_Publisher:
-True
-publisher
-1
-  
-  
-0
-6
-  
-
-
-  
-True
-False
-start
-R_elation:
-True
-relation
-1
-  
-  
-0
-7
-  
-
-
-  
-True
-False
-start
-Ri_ghts:
-True
-rights
-1
-  
-  
-0
-8
-  
-
-
-  
-True
-False
-start
-So_urce:
-True
-source
-1
-  
-  
-0
-9
-  
-
-
-  
-True
-False
-start
-T_ype:
-True
-type
-1
-  
-  
-0
-10
-  
-
-
-  
-True
-False
-start
-_Comments:
-True
-comments
-1
-  
-  
-0
-11
-  
-
-
-  
-True
-True
-True
-True
-
-  
-Enter a 
title for the document.
-  
-
-  
-  
-1
-0
-  
-
-
-  
-True
-True
-True
-True
-
-  
-Enter a 
subject for the document. You can use a subject to group documents with similar 
contents.
-  
-
-  
-  
-1
-1
-  
-
-
-  
-True
-True
-True
-True
-
-  
-Enter 
the words that you want to use to index the content of your document. Keywords 
must be separated by commas. A keyword can contain white space characters or 
semicolons.
-  
-
-  
-  
-1
-2
-  
-
-
-  
-True
-True
-True
-True
-
-  
-Enter 
the names of the people, organizations, or other entities that have made 
contributions to the document.
-  
-
-  
-  
-1
-3
-  
-
-
-  
-True
-True
-True
-True
-
-  
-Enter 
the time, place, or jurisdiction that the document is relevant to.
-  

core.git: sfx2/source

2024-08-30 Thread Darshan-upadhyay1110 (via logerrit)
 sfx2/source/control/unoctitm.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 1eadf17f4bdcbc18d7b9488fd47a4bf8fb12eb58
Author: Darshan-upadhyay1110 
AuthorDate: Mon Jul 1 19:26:27 2024 +0530
Commit: Miklos Vajna 
CommitDate: Fri Aug 30 17:13:53 2024 +0200

Send statechange info after .uno:TableCellBackgroundColor

- statechange information should be send to online after we change table 
background color.

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

diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 431c68cbd953..f39132c708ff 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -1161,6 +1161,7 @@ constexpr auto handlers = 
frozen::make_unordered_map

core.git: sfx2/source

2024-08-29 Thread Andrea Gelmini (via logerrit)
 sfx2/source/doc/docfile.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2c8610f51ef704187ee88226d631ecdf2dd85272
Author: Andrea Gelmini 
AuthorDate: Wed Aug 28 21:57:53 2024 +0200
Commit: Julien Nabet 
CommitDate: Thu Aug 29 10:54:12 2024 +0200

Fix typo

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

diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 3a5fa149d786..286495b7918f 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -345,7 +345,7 @@ CheckReadOnlyTaskTerminateListener::notifyTermination(const 
css::lang::EventObje
 mCond.notify_one();
 }
 
-/// Temporary file wrapper to handle tmp file lifecyle
+/// Temporary file wrapper to handle tmp file lifecycle
 /// for lok fork a background saving worker issues.
 class MediumTempFile : public ::utl::TempFileNamed
 {


core.git: sfx2/source svtools/source

2024-08-28 Thread Skyler Grey (via logerrit)
 sfx2/source/appl/appserv.cxx   |1 
 svtools/source/config/colorcfg.cxx |   51 ++---
 2 files changed, 42 insertions(+), 10 deletions(-)

New commits:
commit 4e04e96334a841865914c1629202912e343c4cb2
Author: Skyler Grey 
AuthorDate: Tue Jul 30 10:17:31 2024 +
Commit: Miklos Vajna 
CommitDate: Wed Aug 28 09:41:18 2024 +0200

fix(invert): Avoid spurious LOK invalidations

Using the same mechanism as with theme changes, we can avoid LOK getting
invalidations if we have an invert-background change that doesn't apply.

The trouble is that this method of inverting the background causes *lots
of* properties to change, so there's no single "If we inverted the
background" to check...

To get there, I've checked if all of the following are true
- We didn't change the color scheme
- We didn't have any new colors after this change
- All of the properties we were changing should have been within this
  color scheme

While they don't necessarily mean "there was a background inversion",
they do mean "something changed in your theme but no action is needed
from you" - which should only be a background inversion - and if we
added anything else that could fit in that category, it should also
avoid LOK invalidations

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

diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index 603b1b90648f..5d94b1d5786f 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -754,7 +754,6 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
 }
 
 svtools::ColorConfigValue aValue;
-aValue.bIsVisible = true;
 
 if(aNewTheme == "Dark")
 aValue.nColor = aDefDarkColor;
diff --git a/svtools/source/config/colorcfg.cxx 
b/svtools/source/config/colorcfg.cxx
index 46b796e5e226..699dfde0f3aa 100644
--- a/svtools/source/config/colorcfg.cxx
+++ b/svtools/source/config/colorcfg.cxx
@@ -255,25 +255,58 @@ void ColorConfig_Impl::Load(const OUString& rScheme)
 
 void ColorConfig_Impl::Notify(const uno::Sequence& rProperties)
 {
-const bool bOnlyChangingCurrentColorScheme = rProperties.getLength() == 1 
&& rProperties[0] == "CurrentColorScheme";
 const OUString sOldLoadedScheme = m_sLoadedScheme;
 
-//loading via notification always uses the default setting
+ColorConfigValue aOldConfigValues[ColorConfigEntryCount];
+std::copy( m_aConfigValues, m_aConfigValues + ColorConfigEntryCount, 
aOldConfigValues );
+
+// loading via notification always uses the default setting
 Load(OUString());
 
+const bool bNoColorSchemeChange = sOldLoadedScheme == m_sLoadedScheme;
+
 // If the name of the scheme hasn't changed, then there is no change to the
 // global color scheme name, but Kit deliberately only changed the then
 // current document when it last changed, so there are typically a mixture
 // of documents with the original 'light' color scheme and the last changed
 // color scheme 'dark'. Kit then tries to set the color scheme again to the
 // last changed color scheme 'dark' to try and update a 'light' document
-// that had opted out of the last change to 'dark'. So tag such an apparent
-// null change attempt with 'OnlyCurrentDocumentColorScheme' to allow it to
-// go through, but identify what that change is for, so the other color
-// config listeners for whom it doesn't matter, can ignore it as an
-// optimization.
-const bool bOnlyCurrentDocumentColorScheme = 
bOnlyChangingCurrentColorScheme && sOldLoadedScheme == m_sLoadedScheme &&
- 
comphelper::LibreOfficeKit::isActive();
+// that had opted out of the last change to 'dark'...
+const bool bEmptyColorSchemeNotify =
+rProperties.getLength() == 1
+&& rProperties[0] == "CurrentColorScheme"
+&& bNoColorSchemeChange;
+
+// ...We can get into a similar situation with inverted backgrounds, for
+// similar reasons, so even if we are only changing the current color 
scheme
+// we need to make sure that something actually changed...
+bool bNoConfigChange = true;
+for (int i = 0; i < ColorConfigEntryCount; ++i) {
+if (aOldConfigValues[i] != m_aConfigValues[i]) {
+bNoConfigChange = false;
+break;
+}
+}
+
+// ...and if something from a different color scheme changes, our config
+// values wouldn't change anyway, so we need to make sure that if something
+// changed it was this color scheme...
+const OUString sCurrentSchemePropertyPrefix = 
"ColorSchemes/org.openoffice.Office.UI:ColorScheme['" + m_sLoadedScheme + "']/";
+bool bOnlyCurrentSchemeChanges = true;
+for (in

core.git: sfx2/source

2024-08-26 Thread Jim Raykowski (via logerrit)
 sfx2/source/sidebar/TabBar.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit d80363beb10fd43045913bb4b54268b1df26737a
Author: Jim Raykowski 
AuthorDate: Mon Aug 26 16:47:03 2024 -0800
Commit: Jim Raykowski 
CommitDate: Tue Aug 27 07:06:20 2024 +0200

Resolves: tdf#120748 Using the mouse wheel to change tabs in the

sidebar tabbar leaves the key input focus in a control that is not
visible

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

diff --git a/sfx2/source/sidebar/TabBar.cxx b/sfx2/source/sidebar/TabBar.cxx
index 9ce9778a711b..eb495f58578b 100644
--- a/sfx2/source/sidebar/TabBar.cxx
+++ b/sfx2/source/sidebar/TabBar.cxx
@@ -218,6 +218,7 @@ bool TabBar::EventNotify(NotifyEvent& rEvent)
 try
 {
 (*pItem)->maDeckActivationFunctor((*pItem)->msDeckId);
+GrabFocusToDocument();
 }
 catch(const css::uno::Exception&) {};
 return true;


core.git: sfx2/source

2024-08-26 Thread Caolán McNamara (via logerrit)
 sfx2/source/control/thumbnailviewacc.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit a2cbcb061d50cd8ac455a8eec2f1dafe0b46573a
Author: Caolán McNamara 
AuthorDate: Mon Aug 26 17:45:21 2024 +0100
Commit: Caolán McNamara 
CommitDate: Mon Aug 26 21:13:37 2024 +0200

cid#1607636 Data race condition

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

diff --git a/sfx2/source/control/thumbnailviewacc.cxx 
b/sfx2/source/control/thumbnailviewacc.cxx
index 0e9f68b38cad..bd321118e899 100644
--- a/sfx2/source/control/thumbnailviewacc.cxx
+++ b/sfx2/source/control/thumbnailviewacc.cxx
@@ -513,7 +513,9 @@ void ThumbnailViewAcc::FireAccessibleEvent( short nEventId, 
const uno::Any& rOld
 if( !nEventId )
 return;
 
+std::unique_lock aGuard(m_aMutex);
 ::std::vector< uno::Reference< accessibility::XAccessibleEventListener > > 
aTmpListeners( mxEventListeners );
+aGuard.unlock();
 accessibility::AccessibleEventObject aEvtObject;
 
 aEvtObject.EventId = nEventId;


core.git: sfx2/source

2024-08-23 Thread Julien Nabet (via logerrit)
 sfx2/source/dialog/splitwin.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 73884e28faeb457c01b80051a701c073112ad564
Author: Julien Nabet 
AuthorDate: Fri Aug 23 10:56:27 2024 +0200
Commit: Julien Nabet 
CommitDate: Fri Aug 23 13:46:49 2024 +0200

-Werror=maybe-uninitialized in sfx2

/home/julien/lo/libo_perf/sfx2/source/dialog/splitwin.cxx: In member 
function ‘void SfxSplitWindow::InsertWindow(SfxDockingWindow*, const Size&)’:
/home/julien/lo/libo_perf/sfx2/source/dialog/splitwin.cxx:462:23: error: 
‘nL’ may be used uninitialized [-Werror=maybe-uninitialized]
  462 | nLine = static_cast(nL);
  | ~~^~~~
/home/julien/lo/libo_perf/sfx2/source/dialog/splitwin.cxx:433:16: note: 
‘nL’ was declared here
  433 | sal_uInt16 nL;
  |^~
/home/julien/lo/libo_perf/sfx2/source/dialog/splitwin.cxx: In member 
function ‘void SfxSplitWindow::MoveWindow(SfxDockingWindow*, const Size&, 
sal_uInt16, sal_uInt16, bool)’:
/home/julien/lo/libo_perf/sfx2/source/dialog/splitwin.cxx:552:21: error: 
‘nL’ may be used uninitialized [-Werror=maybe-uninitialized]
  552 | if ( nLine > nL && GetItemCount( GetItemId( nL ) ) == 1 )
  |  ~~~^~~
/home/julien/lo/libo_perf/sfx2/source/dialog/splitwin.cxx:548:16: note: 
‘nL’ was declared here
  548 | sal_uInt16 nL, nP;
  |^~

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

diff --git a/sfx2/source/dialog/splitwin.cxx b/sfx2/source/dialog/splitwin.cxx
index b9597eacfc79..fcdb5a548817 100644
--- a/sfx2/source/dialog/splitwin.cxx
+++ b/sfx2/source/dialog/splitwin.cxx
@@ -430,7 +430,6 @@ void SfxSplitWindow::InsertWindow( SfxDockingWindow* 
pDockWin, const Size& rSize
 */
 {
 short nLine = -1;  // so that the first window cab set nline to 0
-sal_uInt16 nL;
 sal_uInt16 nPos = 0;
 bool bNewLine = true;
 bool bSaveConfig = false;
@@ -457,6 +456,7 @@ void SfxSplitWindow::InsertWindow( SfxDockingWindow* 
pDockWin, const Size& rSize
 if ( bNewLine && !pFoundDock )
 {
 // Not known until now in which real line it is located
+sal_uInt16 nL = 0;
 [[maybe_unused]] auto const ok = GetWindowPos( rDock.pWin, nL, 
nPos );
 assert(ok);
 nLine = static_cast(nL);
@@ -545,7 +545,8 @@ void SfxSplitWindow::MoveWindow( SfxDockingWindow* 
pDockWin, const Size& rSize,
 */
 
 {
-sal_uInt16 nL, nP;
+sal_uInt16 nL = 0;
+sal_uInt16 nP = 0;
 [[maybe_unused]] auto const ok = GetWindowPos( pDockWin, nL, nP );
 assert(ok);
 


core.git: sfx2/source

2024-08-15 Thread Heiko Tietze (via logerrit)
 sfx2/source/sidebar/TabBar.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 836abb5b367f438f18ab58953a6f3d5b4bc903e4
Author: Heiko Tietze 
AuthorDate: Thu Aug 15 10:15:54 2024 +0200
Commit: Heiko Tietze 
CommitDate: Thu Aug 15 13:43:43 2024 +0200

Resolves tdf#162450 - Hide sidebar tab button

Change-Id: I568976e2f6c8ca03f1aeea35d7607fdd5ea53649
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171887
Reviewed-by: Caolán McNamara 
Tested-by: Jenkins
Reviewed-by: Heiko Tietze 

diff --git a/sfx2/source/sidebar/TabBar.cxx b/sfx2/source/sidebar/TabBar.cxx
index c9a68edcf840..6f51faadeab1 100644
--- a/sfx2/source/sidebar/TabBar.cxx
+++ b/sfx2/source/sidebar/TabBar.cxx
@@ -143,7 +143,7 @@ void TabBar::SetDecks(const 
ResourceManager::DeckContextDescriptorContainer& rDe
 xItem->mbIsHidden = !xDescriptor->mbIsEnabled;
 xItem->mbIsHiddenByDefault = xItem->mbIsHidden; // the default is the 
state while creating
 
-xItem->mxButton->set_sensitive(deck.mbIsEnabled);
+xItem->mxButton->set_visible(deck.mbIsEnabled);
 }
 
 UpdateButtonIcons();
@@ -371,7 +371,7 @@ void TabBar::UpdateMenus()
 OUString sIdent("select" + OUString::number(nIndex));
 const bool bCurrentDeck = 
rItem->mxButton->get_item_active(u"toggle"_ustr);
 const bool bActive = !rItem->mbIsHidden;
-const bool bEnabled = rItem->mxButton->get_sensitive();
+const bool bEnabled = rItem->mxButton->get_visible();
 mxMainMenu->insert(nIndex, sIdent, sDisplayName, nullptr, nullptr, 
nullptr, TRISTATE_FALSE);
 mxMainMenu->set_active(sIdent, bCurrentDeck);
 mxMainMenu->set_sensitive(sIdent, bEnabled && bActive);


core.git: sfx2/source sot/source svx/source

2024-08-14 Thread Noel Grandin (via logerrit)
 sfx2/source/dialog/dinfdlg.cxx  |   11 +++-
 sfx2/source/dialog/documentfontsdialog.cxx  |   41 +++--
 sfx2/source/doc/DocumentSigner.cxx  |9 ++-
 sfx2/source/doc/docfile.cxx |   15 +++---
 sfx2/source/doc/doctemplates.cxx|   13 +++--
 sfx2/source/doc/guisaveas.cxx   |   24 +-
 sfx2/source/doc/objserv.cxx |5 +-
 sfx2/source/doc/objstor.cxx |   46 
 sot/source/unoolestorage/xolesimplestorage.cxx  |5 +-
 svx/source/smarttags/SmartTagMgr.cxx|   22 ++---
 svx/source/tbxctrls/StylesPreviewToolBoxControl.cxx |   15 +++---
 svx/source/tbxctrls/tbcontrl.cxx|5 +-
 svx/source/xml/xmleohlp.cxx |   14 +++---
 svx/source/xml/xmlxtimp.cxx |5 +-
 14 files changed, 140 insertions(+), 90 deletions(-)

New commits:
commit ece0729e18b4b306933439d1a329df192fc504d3
Author: Noel Grandin 
AuthorDate: Tue Aug 13 13:43:25 2024 +0200
Commit: Noel Grandin 
CommitDate: Wed Aug 14 18:05:59 2024 +0200

use less exception throwing for flow control

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

diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 537206b3f98c..d752920ac490 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -1294,10 +1294,13 @@ void SfxDocumentPage::Reset( const SfxItemSet* rSet )
 {
 try
 {
-uno::Reference< lang::XMultiServiceFactory > xFac( 
pDocSh->GetModel(), uno::UNO_QUERY_THROW );
-uno::Reference< beans::XPropertySet > xProps( 
xFac->createInstance(u"com.sun.star.document.Settings"_ustr), 
uno::UNO_QUERY_THROW );
-
-xProps->getPropertyValue(u"ImagePreferredDPI"_ustr) >>= 
nImagePreferredDPI;
+uno::Reference< lang::XMultiServiceFactory > xFac( 
pDocSh->GetModel(), uno::UNO_QUERY );
+if (xFac)
+{
+uno::Reference< beans::XPropertySet > xProps( 
xFac->createInstance(u"com.sun.star.document.Settings"_ustr), uno::UNO_QUERY );
+if (xProps)
+xProps->getPropertyValue(u"ImagePreferredDPI"_ustr) >>= 
nImagePreferredDPI;
+}
 }
 catch( uno::Exception& )
 {
diff --git a/sfx2/source/dialog/documentfontsdialog.cxx 
b/sfx2/source/dialog/documentfontsdialog.cxx
index 281baf5278ed..73918ca059d8 100644
--- a/sfx2/source/dialog/documentfontsdialog.cxx
+++ b/sfx2/source/dialog/documentfontsdialog.cxx
@@ -60,14 +60,19 @@ void SfxDocumentFontsPage::Reset( const SfxItemSet* )
 {
 try
 {
-uno::Reference< lang::XMultiServiceFactory > xFac( 
pDocSh->GetModel(), uno::UNO_QUERY_THROW );
-uno::Reference< beans::XPropertySet > xProps( 
xFac->createInstance(u"com.sun.star.document.Settings"_ustr), 
uno::UNO_QUERY_THROW );
-
-xProps->getPropertyValue(u"EmbedFonts"_ustr) >>= bEmbedFonts;
-xProps->getPropertyValue(u"EmbedOnlyUsedFonts"_ustr) >>= 
bEmbedUsedFonts;
-xProps->getPropertyValue(u"EmbedLatinScriptFonts"_ustr) >>= 
bEmbedLatinScriptFonts;
-xProps->getPropertyValue(u"EmbedAsianScriptFonts"_ustr) >>= 
bEmbedAsianScriptFonts;
-xProps->getPropertyValue(u"EmbedComplexScriptFonts"_ustr) >>= 
bEmbedComplexScriptFonts;
+uno::Reference< lang::XMultiServiceFactory > xFac( 
pDocSh->GetModel(), uno::UNO_QUERY );
+if (xFac)
+{
+uno::Reference< beans::XPropertySet > xProps( 
xFac->createInstance(u"com.sun.star.document.Settings"_ustr), uno::UNO_QUERY);
+if (xProps)
+{
+xProps->getPropertyValue(u"EmbedFonts"_ustr) >>= 
bEmbedFonts;
+xProps->getPropertyValue(u"EmbedOnlyUsedFonts"_ustr) >>= 
bEmbedUsedFonts;
+xProps->getPropertyValue(u"EmbedLatinScriptFonts"_ustr) 
>>= bEmbedLatinScriptFonts;
+xProps->getPropertyValue(u"EmbedAsianScriptFonts"_ustr) 
>>= bEmbedAsianScriptFonts;
+xProps->getPropertyValue(u"EmbedComplexScriptFonts"_ustr) 
>>= bEmbedComplexScriptFonts;
+}
+}
 }
 catch( uno::Exception& )
 {
@@ -95,13 +100,19 @@ bool SfxDocumentFontsPage::FillItemSet( SfxItemSet* )
 {
 try
 {
-uno::Reference< lang::XMultiServiceFactory > xFac( 
pDocSh->GetModel(), uno::UNO_QUERY_THROW );
-uno::Reference< beans::XPropertySet > xProps( 
xFac->createInstance(u"com.sun.star.document.Settings"_ustr), 
uno::UNO_QUERY_THROW );
-xProps->setPropertyValue(u"EmbedFonts"_ustr, 
uno::Any(bEmbedFonts));
- 

core.git: sfx2/source vcl/source vcl/unx

2024-08-14 Thread Caolán McNamara (via logerrit)
 sfx2/source/dialog/dinfdlg.cxx |2 +-
 sfx2/source/doc/doctempl.cxx   |2 +-
 vcl/source/bitmap/bitmap.cxx   |4 ++--
 vcl/source/gdi/pdfwriter_impl.cxx  |2 +-
 vcl/source/gdi/pdfwriter_impl2.cxx |2 +-
 vcl/source/window/winproc.cxx  |2 +-
 vcl/unx/generic/printer/printerinfomanager.cxx |2 +-
 7 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 63b4b3f097c18ed9c1413373b49679f8b37cb9b0
Author: Caolán McNamara 
AuthorDate: Wed Aug 14 12:38:27 2024 +0100
Commit: Caolán McNamara 
CommitDate: Wed Aug 14 15:47:25 2024 +0200

cid#1557708 COPY_INSTEAD_OF_MOVE

and

cid#1557707 COPY_INSTEAD_OF_MOVE
cid#1557706 COPY_INSTEAD_OF_MOVE
cid#1557705 COPY_INSTEAD_OF_MOVE
cid#1557704 COPY_INSTEAD_OF_MOVE

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

diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index a5b3d15ff572..537206b3f98c 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -1186,7 +1186,7 @@ void SfxDocumentPage::Reset( const SfxItemSet* rSet )
 aURL.SetSmartURL( aFile);
 if ( aURL.GetProtocol() == INetProtocol::File )
 {
-INetURLObject aPath( aURL );
+INetURLObject aPath(std::move(aURL));
 aPath.setFinalSlash();
 aPath.removeSegment();
 // we know it's a folder -> don't need the final slash, but it's 
better for WB_PATHELLIPSIS
diff --git a/sfx2/source/doc/doctempl.cxx b/sfx2/source/doc/doctempl.cxx
index 6a6b1baed8a8..e28d550963ea 100644
--- a/sfx2/source/doc/doctempl.cxx
+++ b/sfx2/source/doc/doctempl.cxx
@@ -867,7 +867,7 @@ bool SfxDocumentTemplates::CopyFrom
 
 if( aTitle.isEmpty() )
 {
-INetURLObject aURL( aTemplURL );
+INetURLObject aURL(std::move(aTemplURL));
 aURL.CutExtension();
 aTitle = aURL.getName( INetURLObject::LAST_SEGMENT, true,
 
INetURLObject::DecodeMechanism::WithCharset );
diff --git a/vcl/source/bitmap/bitmap.cxx b/vcl/source/bitmap/bitmap.cxx
index 4122052ee00e..267a34323c2d 100644
--- a/vcl/source/bitmap/bitmap.cxx
+++ b/vcl/source/bitmap/bitmap.cxx
@@ -313,7 +313,7 @@ BitmapChecksum Bitmap::GetChecksum() const
 if (xNewImpBmp->Create(*mxSalBmp, getPixelFormat()))
 {
 Bitmap* pThis = const_cast(this);
-pThis->mxSalBmp = xNewImpBmp;
+pThis->mxSalBmp = std::move(xNewImpBmp);
 nRet = mxSalBmp->GetChecksum();
 }
 }
@@ -1449,7 +1449,7 @@ bool Bitmap::Dither()
 pWriteAcc.reset();
 const MapMode aMap( maPrefMapMode );
 const Size aPrefSize( maPrefSize );
-*this = aNewBmp;
+*this = std::move(aNewBmp);
 maPrefMapMode = aMap;
 maPrefSize = aPrefSize;
 return true;
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx 
b/vcl/source/gdi/pdfwriter_impl.cxx
index 99f528c84572..bf6c2c94e404 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -1743,7 +1743,7 @@ void PDFWriterImpl::endPage()
 aFont.SetFontSize( Size( 0, 12 ) );
 
 m_aCurrentPDFState = m_aGraphicsStack.front();
-m_aGraphicsStack.front().m_aFont =  aFont;
+m_aGraphicsStack.front().m_aFont = std::move(aFont);
 
 for (auto & bitmap : m_aBitmaps)
 {
diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx 
b/vcl/source/gdi/pdfwriter_impl2.cxx
index c675564d5759..12c98cc72937 100644
--- a/vcl/source/gdi/pdfwriter_impl2.cxx
+++ b/vcl/source/gdi/pdfwriter_impl2.cxx
@@ -651,7 +651,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& 
i_rMtf, vcl::PDFExtOutDevDa
 aInfo.m_fMiterLimit = 0.0;
 break;
 }
-aInfo.m_aDashArray = aDashArray;
+aInfo.m_aDashArray = std::move(aDashArray);
 
 if(SvtGraphicStroke::joinNone == 
aStroke.getJoinType()
 && fStrokeWidth > 0.0)
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index e2e47160e97f..64c101a8c911 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -791,7 +791,7 @@ bool ImplHandleMouseEvent( const VclPtr& 
xWindow, NotifyEventType n
 *   Yield stack.
 */
 ContextMenuEvent* pEv = new ContextMenuEvent;
-pEv->pWindow = pChild;
+pEv->pWindow = std::move(pChild);
 pEv->aChildPos = aChildPos;
 Applicat

core.git: sfx2/source

2024-07-25 Thread Stephan Bergmann (via logerrit)
 sfx2/source/doc/guisaveas.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit ebada44e9bac76d6ccbdc387ed673d938830bfd0
Author: Stephan Bergmann 
AuthorDate: Thu Jul 25 09:13:23 2024 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Jul 25 12:30:38 2024 +0200

Read of uninitialized bool

after 426c641976688e3e4d1ce66f76b27ccbd2dca55a "tdf#159040: add sign with
default certificate to save dialog", causing

> /sfx2/source/doc/guisaveas.cxx:307:54: runtime error: load of value 190, 
which is not a valid value for type 'bool'
> #0 0x7f1ab45ca7d6 in ModelData_Impl::IsSignWithDefaultSignature() 
const /sfx2/source/doc/guisaveas.cxx:307:54
> #1 0x7f1ab45957de in 
SfxStoringHelper::FinishGUIStoreModel(__gnu_debug::_Safe_iterator, false, true>, 
std::__debug::unordered_map > >, std::forward_iterator_tag>&, ModelData_Impl&, 
bool, short, 
com::sun::star::uno::Sequence&, bool, 
bool, bool, std::basic_string_view >, 
std::basic_string_view >, 
com::sun::star::uno::Sequence&, 
rtl::OUString) /sfx2/source/doc/guisaveas.cxx:1896:20
> #2 0x7f1ab45b49b0 in 
SfxStoringHelper::GUIStoreModel(com::sun::star::uno::Reference
 const&, std::basic_string_view >, 
com::sun::star::uno::Sequence&, bool, 
SignatureState, bool) /sfx2/source/doc/guisaveas.cxx:1626:12
> #3 0x7f1ab46b6ac3 in SfxObjectShell::ExecFile_Impl(SfxRequest&) 
/sfx2/source/doc/objserv.cxx:1096:26
> #4 0x7f1ab46a2ea4 in SfxStubSfxObjectShellExecFile_Impl(SfxShell*, 
SfxRequest&) /workdir/SdiTarget/sfx2/sdi/sfxslots.hxx:221:1
> #5 0x7f1ab343ae1e in SfxDispatcher::Call_Impl(SfxShell&, SfxSlot 
const&, SfxRequest&, bool) /sfx2/source/control/dispatch.cxx:254:9
> #6 0x7f1ab3450745 in SfxDispatcher::Execute_(SfxShell&, SfxSlot 
const&, SfxRequest&, SfxCallMode) /sfx2/source/control/dispatch.cxx:753:9
> #7 0x7f1ab34515ab in SfxDispatcher::Execute(unsigned short, 
SfxCallMode, SfxItemSet const*, SfxItemSet const*, unsigned short) 
/sfx2/source/control/dispatch.cxx:812:9
> #8 0x7f1ab3861c1b in 
SfxDispatchController_Impl::dispatch(com::sun::star::util::URL const&, 
com::sun::star::uno::Sequence const&, 
com::sun::star::uno::Reference 
const&) /sfx2/source/control/unoctitm.cxx:675:46
> #9 0x7f1ab3864f41 in 
SfxOfficeDispatch::dispatchWithNotification(com::sun::star::util::URL const&, 
com::sun::star::uno::Sequence const&, 
com::sun::star::uno::Reference 
const&) /sfx2/source/control/unoctitm.cxx:270:16
> #10 0x7f1a86be9616 in 
framework::DispatchHelper::executeDispatch(com::sun::star::uno::Reference
 const&, com::sun::star::util::URL const&, bool, 
com::sun::star::uno::Sequence const&) 
/framework/source/services/dispatchhelper.cxx:164:30
> #11 0x7f1a86be84eb in 
framework::DispatchHelper::executeDispatch(com::sun::star::uno::Reference
 const&, rtl::OUString const&, rtl::OUString const&, int, 
com::sun::star::uno::Sequence const&) 
/framework/source/services/dispatchhelper.cxx:121:16
> #12 0x7f1a86be9ec4 in non-virtual thunk to 
framework::DispatchHelper::executeDispatch(com::sun::star::uno::Reference
 const&, rtl::OUString const&, rtl::OUString const&, int, 
com::sun::star::uno::Sequence const&) 
/framework/source/services/dispatchhelper.cxx
> #13 0x7f1aaea0e879 in 
unotest::MacrosTest::dispatchCommand(com::sun::star::uno::Reference
 const&, rtl::OUString const&, 
com::sun::star::uno::Sequence const&) 
/unotest/source/cpp/macros_test.cxx:94:33
> #14 0x7f1ad66c521e in 
ScPDFExportTest::exportToPDFWithUnoCommands(rtl::OUString const&) 
/sc/qa/extras/scpdfexport.cxx:196:5
> #15 0x7f1ad66d1e94 in ScPDFExportTest::testUnoCommands_Tdf120161() 
/sc/qa/extras/scpdfexport.cxx:376:9

during CppunitTest_sc_pdf_export
()

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

diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index eee91ba06a38..dc88659e6b1e 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -356,6 +356,7 @@ ModelData_Impl::ModelData_Impl( SfxStoringHelper& aOwner,
 , m_xModel(std::move( xModel ))
 , m_aMediaDescrHM( aMediaDescr )
 , m_bRecommendReadOnly( false )
+, m_bSignWithDefaultSignature( false )
 {
 CheckInteractionHandler();
 }


core.git: sfx2/source

2024-07-15 Thread Rafael Lima (via logerrit)
 sfx2/source/sidebar/FocusManager.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 6113d5dc45232b602bee0e68cf7560d0b8656546
Author: Rafael Lima 
AuthorDate: Thu Jun 27 22:59:47 2024 +0200
Commit: Rafael Lima 
CommitDate: Mon Jul 15 20:57:43 2024 +0200

tdf#161782 Focus document when Esc is pressed in the Gallery/Navigator

When Esc is pressed on a Panel that has no visible title, move focus to the 
document.

Change-Id: Ib5571dbd9f8a37017e21d2e01e7b546eb2330751
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169668
Reviewed-by: Jim Raykowski 
Reviewed-by: Rafael Lima 
Tested-by: Jenkins

diff --git a/sfx2/source/sidebar/FocusManager.cxx 
b/sfx2/source/sidebar/FocusManager.cxx
index e86de2b7de6a..806ac3d3a823 100644
--- a/sfx2/source/sidebar/FocusManager.cxx
+++ b/sfx2/source/sidebar/FocusManager.cxx
@@ -298,10 +298,12 @@ bool FocusManager::HandleKeyEvent(
 }
 case PC_PanelContent:
 // Return focus to tab bar sidebar settings button or 
panel title.
-if (!IsDeckTitleVisible() && maPanels.size() == 1)
+if ((!IsDeckTitleVisible() && maPanels.size() == 1) ||
+
(!maPanels[aLocation.mnIndex]->GetTitleBar()->GetVisible()))
 FocusButton(0);
 else
 FocusPanel(aLocation.mnIndex, true);
+
 bConsumed = true;
 break;
 default:


core.git: sfx2/source

2024-07-15 Thread Moritz Duge (via logerrit)
 sfx2/source/dialog/filedlghelper.cxx |   36 +++
 sfx2/source/dialog/filedlgimpl.hxx   |3 ++
 2 files changed, 39 insertions(+)

New commits:
commit 76f4e6d9764048d98f3fdd1620b0e0a6787385c1
Author: Moritz Duge 
AuthorDate: Thu May 23 18:12:34 2024 +0200
Commit: Thorsten Behrens 
CommitDate: Mon Jul 15 20:45:16 2024 +0200

tdf#121140: GPG checkbox only for file formats with GPGENCRYPTION flag

Only ODF-1.2 and ODF 1.3 support GPG encryption.
Flat ODF and other formats do NOT, so lets not offer an option that
subsequent code path ignores.

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

diff --git a/sfx2/source/dialog/filedlghelper.cxx 
b/sfx2/source/dialog/filedlghelper.cxx
index 70199c8dffd0..a9a7fb0c65c2 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -282,6 +282,7 @@ void FileDialogHelper_Impl::handleControlStateChanged( 
const FilePickerEvent& aE
 case CommonFilePickerElementIds::LISTBOX_FILTER:
 updateFilterOptionsBox();
 enablePasswordBox( false );
+enableGpgEncrBox( false );
 updateSelectionBox();
 // only use it for export and with our own dialog
 if ( mbExport && !mbSystemPicker )
@@ -538,6 +539,37 @@ void FileDialogHelper_Impl::enablePasswordBox( bool bInit )
 }
 }
 
+void FileDialogHelper_Impl::enableGpgEncrBox( bool bInit )
+{
+if ( ! mbHasPassword )  // CHECKBOX_GPGENCRYPTION is visible if 
CHECKBOX_PASSWORD is visible
+return;
+
+// in case of initialization assume previous state to be false
+bool bWasEnabled = !bInit && mbIsGpgEncrEnabled;
+
+std::shared_ptr pCurrentFilter = getCurrentSfxFilter();
+mbIsGpgEncrEnabled = updateExtendedControl(
+ExtendedFilePickerElementIds::CHECKBOX_GPGENCRYPTION,
+pCurrentFilter && ( pCurrentFilter->GetFilterFlags() & 
SfxFilterFlags::GPGENCRYPTION )
+);
+
+if( !bWasEnabled && mbIsGpgEncrEnabled )
+{
+uno::Reference< XFilePickerControlAccess > xCtrlAccess( mxFileDlg, 
UNO_QUERY );
+if( mbGpgCheckBoxState )
+xCtrlAccess->setValue( 
ExtendedFilePickerElementIds::CHECKBOX_GPGENCRYPTION, 0, Any( true ) );
+}
+else if( bWasEnabled && !mbIsGpgEncrEnabled )
+{
+// remember user settings until checkbox is enabled
+uno::Reference< XFilePickerControlAccess > xCtrlAccess( mxFileDlg, 
UNO_QUERY );
+Any aValue = xCtrlAccess->getValue( 
ExtendedFilePickerElementIds::CHECKBOX_GPGENCRYPTION, 0 );
+bool bGpgEncryption = false;
+mbGpgCheckBoxState = ( aValue >>= bGpgEncryption ) && bGpgEncryption;
+xCtrlAccess->setValue( 
ExtendedFilePickerElementIds::CHECKBOX_GPGENCRYPTION, 0, Any( false ) );
+}
+}
+
 void FileDialogHelper_Impl::updatePreviewState( bool _bUpdatePreviewWindow )
 {
 if ( !mbHasPreview )
@@ -888,6 +920,7 @@ FileDialogHelper_Impl::FileDialogHelper_Impl(
 mbHasPassword   = false;
 m_bHaveFilterOptions= false;
 mbIsPwdEnabled  = true;
+mbIsGpgEncrEnabled  = true;
 mbHasVersions   = false;
 mbHasPreview= false;
 mbShowPreview   = false;
@@ -898,6 +931,7 @@ FileDialogHelper_Impl::FileDialogHelper_Impl(
 mbExport= bool(nFlags & FileDialogFlags::Export);
 mbIsSaveDlg = false;
 mbPwdCheckBoxState  = false;
+mbGpgCheckBoxState  = false;
 mbSelection = false;
 mbSelectionEnabled  = true;
 mbHasSelectionBox   = false;
@@ -1220,6 +1254,7 @@ IMPL_LINK_NOARG( FileDialogHelper_Impl, InitControls, 
void*, void )
 {
 mnPostUserEventId = nullptr;
 enablePasswordBox( true );
+enableGpgEncrBox( true );
 updateFilterOptionsBox( );
 updateSelectionBox( );
 }
@@ -1243,6 +1278,7 @@ void FileDialogHelper_Impl::preExecute()
 // However, the macOS implementation's pickers run modally in execute and 
so the event doesn't
 // get through in time... so we call the methods directly
 enablePasswordBox( true );
+enableGpgEncrBox( true );
 updateFilterOptionsBox( );
 updateSelectionBox( );
 #endif
diff --git a/sfx2/source/dialog/filedlgimpl.hxx 
b/sfx2/source/dialog/filedlgimpl.hxx
index fe9e8f7a99a5..60fb312e2b17 100644
--- a/sfx2/source/dialog/filedlgimpl.hxx
+++ b/sfx2/source/dialog/filedlgimpl.hxx
@@ -76,6 +76,7 @@ namespace sfx2
 
 boolmbHasPassword   : 1;  // checkbox is 
visible
 boolmbIsPwdEnabled  : 1;  // password 
checkbox is not grayed out
+boolmbIsGpgEncrEnabled  : 1;  // GPG checkbox 
is not grayed out
 boolm_bHaveFilterOptions: 1;
 boolmbHasV

core.git: sfx2/source

2024-07-15 Thread Moritz Duge (via logerrit)
 sfx2/source/dialog/filedlghelper.cxx |   15 +++
 1 file changed, 3 insertions(+), 12 deletions(-)

New commits:
commit 86276a0ae8ae86fdafcf2af48df1054f8d8ad3c4
Author: Moritz Duge 
AuthorDate: Thu May 23 18:10:00 2024 +0200
Commit: Thorsten Behrens 
CommitDate: Mon Jul 15 20:43:38 2024 +0200

Simplify boolean logic locally for mbIsPwdEnabled.

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

diff --git a/sfx2/source/dialog/filedlghelper.cxx 
b/sfx2/source/dialog/filedlghelper.cxx
index 08cdccc65a83..70199c8dffd0 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -512,7 +512,8 @@ void FileDialogHelper_Impl::enablePasswordBox( bool bInit )
 if ( ! mbHasPassword )
 return;
 
-bool bWasEnabled = mbIsPwdEnabled;
+// in case of initialization assume previous state to be false
+bool bWasEnabled = !bInit && mbIsPwdEnabled;
 
 std::shared_ptr pCurrentFilter = getCurrentSfxFilter();
 mbIsPwdEnabled = updateExtendedControl(
@@ -520,17 +521,7 @@ void FileDialogHelper_Impl::enablePasswordBox( bool bInit )
 pCurrentFilter && ( pCurrentFilter->GetFilterFlags() & 
SfxFilterFlags::ENCRYPTION )
 );
 
-if( bInit )
-{
-// in case of initialization previous state is not interesting
-if( mbIsPwdEnabled )
-{
-uno::Reference< XFilePickerControlAccess > xCtrlAccess( mxFileDlg, 
UNO_QUERY );
-if( mbPwdCheckBoxState )
-xCtrlAccess->setValue( 
ExtendedFilePickerElementIds::CHECKBOX_PASSWORD, 0, Any( true ) );
-}
-}
-else if( !bWasEnabled && mbIsPwdEnabled )
+if( !bWasEnabled && mbIsPwdEnabled )
 {
 uno::Reference< XFilePickerControlAccess > xCtrlAccess( mxFileDlg, 
UNO_QUERY );
 if( mbPwdCheckBoxState )


core.git: sfx2/source

2024-07-11 Thread Heiko Tietze (via logerrit)
 sfx2/source/dialog/backingwindow.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit dd4d32797c7c4cb915f1f81ad92abb195985afb5
Author: Heiko Tietze 
AuthorDate: Wed Jul 10 17:39:17 2024 +0200
Commit: Heiko Tietze 
CommitDate: Thu Jul 11 12:50:52 2024 +0200

Fix to temporary variable name

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

diff --git a/sfx2/source/dialog/backingwindow.cxx 
b/sfx2/source/dialog/backingwindow.cxx
index ee2e4459cf63..009c1acea6bc 100644
--- a/sfx2/source/dialog/backingwindow.cxx
+++ b/sfx2/source/dialog/backingwindow.cxx
@@ -196,9 +196,8 @@ BackingWindow::BackingWindow(vcl::Window* i_pParent)
 // tdf#161796 make the extension button show the donation page
 if (officecfg::Office::Common::Misc::ShowDonation::get())
 {
-OUString test = SfxResId(STR_DONATE_BUTTON);
 mxExtensionsButton->set_from_icon_name(BMP_DONATE); // icon first 
needed on gtk3 to apply the label
-mxExtensionsButton->set_label(test);
+mxExtensionsButton->set_label(SfxResId(STR_DONATE_BUTTON));
 }
 
 mxDropTarget = mxAllRecentThumbnails->GetDropTarget();


core.git: sfx2/source

2024-06-26 Thread Michael Weghorn (via logerrit)
 sfx2/source/sidebar/TabBar.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 879bcc88759d7dd033e0ee667daee0d2a743cf06
Author: Michael Weghorn 
AuthorDate: Wed Jun 26 09:12:55 2024 +0200
Commit: Michael Weghorn 
CommitDate: Wed Jun 26 17:59:37 2024 +0200

tdf#159835 sfx2: Skip sidebar menu update for gtk4 to work around crash

After

commit daed96f0818b1baae5de8b74b866009d7d89f853
Author: Michael Weghorn 
Date:   Wed Jun 19 13:08:34 2024 +0200

tdf#159835 sfx2: Keep sidebar menu up to date

, starting LO Writer with the gtk4 VCL plugin resulted
in a crash (backtrace below) due to the current menu
implementation for the gtk4 VCL plugin being
incomplete/broken.

For now, until the underlying issue has been fixed,
at least avoid crashing by skipping the menu update
when using gtk4.

This effectively reverts back to the old behavior
for gtk4, where before the above commit,
`mxMenuButton->get_active()` in `TabBar::OnToolboxClicked`
would always return false when clicking the menu button
in the sidebar, so the code path triggering the crash
wouldn't be hit, thus not triggering the
pre-existing underlying issue.

Backtrace of the crash:

Thread 1 "soffice.bin" received signal SIGSEGV, Segmentation fault.
0x7fffe9d25afe in g_atomic_ref_count_inc () from 
/lib/x86_64-linux-gnu/libglib-2.0.so.0
#0  0x7fffe9d25afe in g_atomic_ref_count_inc () at 
/lib/x86_64-linux-gnu/libglib-2.0.so.0
#1  0x7fffe9cfb3b6 in g_hash_table_ref () at 
/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x7fffe90ff92e in  () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
#3  0x7fffe90feaf4 in  () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
#4  0x7fffe90fef2c in g_menu_model_get_item_attribute () at 
/lib/x86_64-linux-gnu/libgio-2.0.so.0
#5  0x7fffe44fd500 in (anonymous 
namespace)::MenuHelper::get_item_id(int) const (this=0x5c78dbf0, pos=0) at 
vcl/unx/gtk4/../gtk3/gtkinst.cxx:5748
#6  0x7fffe44fc976 in (anonymous 
namespace)::GtkInstanceMenu::get_id(int) const (this=0x5c78dbf0, pos=0) at 
vcl/unx/gtk4/../gtk3/gtkinst.cxx:11711
#7  0x7fffe44fcd40 in virtual thunk to (anonymous 
namespace)::GtkInstanceMenu::get_id(int) const () at 
vcl/unx/gtk4/../gtk3/gtkinst.cxx:11745
#8  0x73fae52b in sfx2::sidebar::TabBar::UpdateMenus() 
(this=0x5c7ce530) at .../libreoffice/sfx2/source/sidebar/TabBar.cxx:342
#9  0x73faf86a in sfx2::sidebar::TabBar::TabBar(vcl::Window*, 
com::sun::star::uno::Reference const&, 
std::function, std::function, sfx2::sidebar::SidebarController&) (this=0x5c7ce530, 
pParentWindow=0x5c62cea0, rxFrame=..., aDeckActivationFunctor=..., 
aPopupMenuSignalConnectFunction=..., rParentSidebarController=...) at 
.../libreoffice/sfx2/source/sidebar/TabBar.cxx:76
#10 0x73f1c84d in 
VclPtr::Create&,
 com::sun::star::uno::Reference&, 
sfx2::sidebar::SidebarController::SidebarController(sfx2::sidebar::SidebarDockingWindow*,
 SfxViewFrame const*)::$_3, 
sfx2::sidebar::SidebarController::$_3(sfx2::sidebar::SidebarDockingWindow*, 
SfxViewFrame const*)::$_4, 
sfx2::sidebar::SidebarController&>(VclPtr&,
 com::sun::star::uno::Reference&, 
sfx2::sidebar::SidebarController::SidebarController(sfx2::sidebar::SidebarDockingWindow*,
 SfxViewFrame const*)::$_3&&, 
sfx2::sidebar::SidebarController::$_3(sfx2::sidebar::SidebarDockingWindow*, 
SfxViewFrame const*)::$_4&&, sfx2::sidebar::SidebarController&) (arg=..., 
arg=..., arg=..., arg=..., arg=...) at include/vcl/vclptr.hxx:129
#11 0x73f1cc86 in 
sfx2::sidebar::SidebarController::SidebarController(sfx2::sidebar::SidebarDockingWindow*,
 SfxViewFrame const*) (this=0x5c6f1fc0, pParentWindow=0x5c62cea0, 
pViewFrame=0x5abb87a0) at 
.../libreoffice/sfx2/source/sidebar/SidebarController.cxx:119
#12 0x73f1d59f in 
sfx2::sidebar::SidebarController::create(sfx2::sidebar::SidebarDockingWindow*, 
SfxViewFrame const*) (pParentWindow=0x5c62cea0, pViewFrame=0x5abb87a0) 
at .../libreoffice/sfx2/source/sidebar/SidebarController.cxx:147
#13 0x73f1a997 in 
sfx2::sidebar::SidebarDockingWindow::GetOrCreateSidebarController() 
(this=0x5c62cea0) at 
.../libreoffice/sfx2/source/sidebar/SidebarDockingWindow.cxx:64
#14 0x73f1ac24 in 
sfx2::sidebar::SidebarDockingWindow::SidebarDockingWindow(SfxBindings*, 
sfx2::sidebar::SidebarChildWindow&, vcl::Window*, long) (this=0x5c62cea0, 
pSfxBindings=0x5abdafe0, rChildWindow=..., pParentWindow=0x5abdb6a0, 
nBits=137975825761) at 
.../libreoffice/sfx2/source/sidebar/SidebarDockingWindow.cxx:55
#15 0x73f19e79 in 
VclPtr::Create(SfxBindings*&, 
sfx2::sidebar::SidebarChildWindow&, vcl::Window*&, long&&) 
(arg=@0x7fff45f8: 0x5abdafe0, arg=..., arg

core.git: sfx2/source

2024-06-20 Thread Szymon Kłos (via logerrit)
 sfx2/source/view/lokhelper.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 494161a9c8a9acca4d200d06c44ef6db794c0bea
Author: Szymon Kłos 
AuthorDate: Tue Apr 16 17:59:25 2024 +0200
Commit: Szymon Kłos 
CommitDate: Thu Jun 20 10:57:18 2024 +0200

cool#9309 lok: sync language in comphelper::LibreOfficeKit on view creation

If new view is created using createViewWithOptions API call
we pass language of that view. We do a setup of that language
in SfxLokHelper::setViewLanguage but it was only set inside
ViewShell.

Unfortunately just after we create the view we call setView which
later checks if comphelper::LibreOfficeKit::getLanguageTag()
has matching value with ViewShell field.
It was showing warning in the logs:
warn:lok:31748:31654:sfx2/source/view/lokhelper.cxx:206: LANGUAGE mismatch 
at setView! ... old (wrong) lang:de new lang:fr

Let's check if the view we try to modify is the current one and
in that case synchronize value we can get using global
comphelper::LibreOfficeKit function.

Signed-off-by: Szymon Kłos 
Change-Id: Icddfda003522dda661066c4d1c43ca1dec9e5c55
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169107
(cherry picked from commit 800d8580ec8d99f5c610727a9d53ab143019c014)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169144
Tested-by: Jenkins

diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index 549f43906908..131561504e1b 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -338,6 +338,10 @@ void SfxLokHelper::setViewLanguage(int nId, const 
OUString& rBcp47LanguageTag)
 if (pViewShell->GetViewShellId() == ViewShellId(nId))
 {
 pViewShell->SetLOKLanguageTag(rBcp47LanguageTag);
+// sync also global getter if we are the current view
+bool bIsCurrShell = (pViewShell == SfxViewShell::Current());
+if (bIsCurrShell)
+
comphelper::LibreOfficeKit::setLanguageTag(LanguageTag(rBcp47LanguageTag));
 return;
 }
 }


core.git: sfx2/source

2024-06-17 Thread Bogdan Buzea (via logerrit)
 sfx2/source/doc/guisaveas.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit eefa6c05b40d8ecbccfdd4563b0bcc7b6de4980d
Author: Bogdan Buzea 
AuthorDate: Tue Jun 18 04:34:44 2024 +0200
Commit: Julien Nabet 
CommitDate: Tue Jun 18 08:27:24 2024 +0200

Remove duplicated include

Was added in https://gerrit.libreoffice.org/c/core/+/140403

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

diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 401f486dff2b..ce31ee2da6f7 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -57,7 +57,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 


core.git: sfx2/source

2024-06-16 Thread Mike Kaganski (via logerrit)
 sfx2/source/control/unoctitm.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit a14ec822c9c571a32eb0565158f1976b2d0dbf28
Author: Mike Kaganski 
AuthorDate: Sun Jun 16 16:02:40 2024 +0500
Commit: Mike Kaganski 
CommitDate: Sun Jun 16 20:47:33 2024 +0200

LOK: Send view modes status change notifications

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

diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 6dd55fc06a2d..7e82656ab178 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -940,7 +940,9 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 nSID, 
SfxViewFrame* pViewFra
 aEvent.FeatureURL.Path == "SpacePara15" ||
 aEvent.FeatureURL.Path == "SpacePara2" ||
 aEvent.FeatureURL.Path == "DataFilterAutoFilter" ||
-aEvent.FeatureURL.Path == "CellProtection")
+aEvent.FeatureURL.Path == "CellProtection" ||
+aEvent.FeatureURL.Path == "NormalMultiPaneGUI" ||
+aEvent.FeatureURL.Path == "NotesMode")
 {
 bool bTemp = false;
 aEvent.State >>= bTemp;


core.git: sfx2/source

2024-06-06 Thread Michael Stahl (via logerrit)
 sfx2/source/doc/objmisc.cxx |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 3e7478ef9706e74ac551c1f94090e163e74c7fd8
Author: Michael Stahl 
AuthorDate: Wed Jun 5 18:53:05 2024 +0200
Commit: Michael Stahl 
CommitDate: Thu Jun 6 10:15:38 2024 +0200

tdf#157931 sfx2: fix modified status of Base forms

The problem is that when a Base form is not in design mode, it's not
expected that it will be stored.

There are checks for m_bOpenInDesign in ODocumentDefinition::save() and
ODocumentDefinition::saveAs() that were added in commit
9cfe62966ff1e0039d95a07d0c613675a53e3075 "CWS dba201b" but removing
these runs into another check in OCommonEmbeddedObject::storeOwn()
of m_bReadOnly and then it still fails, presumably because the storage
was opened readonly.

Let's restore SfxObjectShell::IsEnableSetModified() to check
IsReadOnly(), but only for Base form documents, which seems simplest.

(regression from commit bde746141f9b382156a5ce79ebf82c5e32fc455b)

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

diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 6d60e683770a..397b13c6bccc 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -258,7 +258,13 @@ bool SfxObjectShell::IsEnableSetModified() const
 // which the user didn't load or activate to modified.
 return pImpl->m_bEnableSetModified && !IsPreview()
 && eCreateMode != SfxObjectCreateMode::ORGANIZER
-&& eCreateMode != SfxObjectCreateMode::INTERNAL;
+&& eCreateMode != SfxObjectCreateMode::INTERNAL
+// tdf#157931 form documents only in design mode
+&& ((pImpl->pBaseModel
+&& !pImpl->pBaseModel->impl_isDisposed()
+&& pImpl->pBaseModel->IsInitialized()
+&& pImpl->pBaseModel->getIdentifier() != 
"com.sun.star.sdb.FormDesign")
+|| !IsReadOnly());
 }
 
 


core.git: sfx2/source

2024-06-05 Thread Tomaž Vajngerl (via logerrit)
 sfx2/source/dialog/StyleList.cxx |   34 +-
 1 file changed, 25 insertions(+), 9 deletions(-)

New commits:
commit c32d97c5a5d6f94713feaf7867abb1ce11cf9a14
Author: Tomaž Vajngerl 
AuthorDate: Wed May 1 10:49:17 2024 +0900
Commit: Tomaž Vajngerl 
CommitDate: Thu Jun 6 04:26:48 2024 +0200

sfx2: more diverse colors from string hash creation

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

diff --git a/sfx2/source/dialog/StyleList.cxx b/sfx2/source/dialog/StyleList.cxx
index dac770663388..f7bafd382469 100644
--- a/sfx2/source/dialog/StyleList.cxx
+++ b/sfx2/source/dialog/StyleList.cxx
@@ -65,6 +65,7 @@
 
 #include 
 #include 
+#include 
 
 using namespace css;
 using namespace css::beans;
@@ -98,19 +99,34 @@ namespace
 {
 Color ColorHash(std::u16string_view rString)
 {
-static std::vector aSaturationArray{ 0.90, 0.75, 0.60 };
-static std::vector aLightnessArray = aSaturationArray;
+constexpr auto aSaturationArray = std::to_array({ 90, 75, 60 
});
+constexpr auto aBrightnessArray = std::to_array({ 100, 80, 60 
});
+constexpr auto aTintOrShadeArray
+= std::to_array({ 1'500, 3'000, 4'500, 6'500, 7'500 });
 
 sal_uInt32 nStringHash = rtl_ustr_hashCode_WithLength(rString.data(), 
rString.length());
 
-double nHue = nStringHash % 359;
-double nSaturation = aSaturationArray[nStringHash / 360 % 
aSaturationArray.size()];
-double nLightness
-= aLightnessArray[nStringHash / 360 / aSaturationArray.size() % 
aLightnessArray.size()];
+// Twist the hash number with a RNG twister so we can get very different 
number even when the string hash
+// differs only slightly. For example "Heading 1" and "Heading 2" are very 
close, so we would get a color
+// that is very similar and with number quantization could result in the 
same color.
+std::mt19937 twister;
+twister.seed(nStringHash); // setting the hash for
+nStringHash = twister();
 
-basegfx::BColor aHSLColor(nHue, nSaturation, nLightness);
+double fHue = (nStringHash % 60) * 6;
+nStringHash = nStringHash / 60;
 
-return Color(basegfx::utils::hsl2rgb(aHSLColor));
+double fSaturation = aSaturationArray[nStringHash % 
aSaturationArray.size()];
+nStringHash = nStringHash / aSaturationArray.size();
+
+double fBrightness = aBrightnessArray[nStringHash % 
aBrightnessArray.size()];
+nStringHash = nStringHash / aBrightnessArray.size();
+
+auto aColor = Color::HSBtoRGB(fHue, fSaturation, fBrightness);
+double fTintOrShade = aTintOrShadeArray[nStringHash % 
aTintOrShadeArray.size()];
+aColor.ApplyTintOrShade(fTintOrShade);
+
+return aColor;
 }
 
 // used to disallow the default character style in the styles highlighter 
character styles color map
@@ -694,7 +710,7 @@ static bool IsExpanded_Impl(const std::vector& 
rEntries, std::u16strin
 static void lcl_Insert(weld::TreeView& rTreeView, const OUString& rName, 
SfxStyleFamily eFam,
const weld::TreeIter* pParent, weld::TreeIter* pRet, 
SfxViewShell* pViewSh)
 {
-Color aColor(ColorHash(rName));
+Color aColor = ColorHash(rName);
 
 int nColor;
 if (eFam == SfxStyleFamily::Para)


core.git: sfx2/source

2024-05-31 Thread Mike Kaganski (via logerrit)
 sfx2/source/doc/sfxbasemodel.cxx |   11 +++
 1 file changed, 3 insertions(+), 8 deletions(-)

New commits:
commit 5995f21774754d306ead2763e1bf4ef357f5a23b
Author: Mike Kaganski 
AuthorDate: Fri May 31 12:56:37 2024 +0200
Commit: Mike Kaganski 
CommitDate: Fri May 31 20:13:07 2024 +0200

Avoid race

There are reports that RuntimeUID may be some unexpected value like
1206137128392, in unclear cases. This is a blind shot at that.

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

diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index cd00bff1a4f7..d52c3cbe7a86 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -198,7 +198,7 @@ void SAL_CALL SfxDocInfoListener_Impl::disposing( const 
lang::EventObject& )
 struct IMPL_SfxBaseModel_DataContainer : public ::sfx2::IModifiableDocument
 {
 // counter for SfxBaseModel instances created.
-static sal_Int64   
g_nInstanceCounter   ;
+inline static std::atomic   
g_nInstanceCounter = 0   ;
 SfxObjectShellRef  m_pObjectShell  
 ;
 OUString   m_sURL  
 ;
 OUString   m_sRuntimeUID   
 ;
@@ -256,10 +256,8 @@ struct IMPL_SfxBaseModel_DataContainer : public 
::sfx2::IModifiableDocument
 ,   m_bExternalTitle( false )
 ,   m_bDisposing( false )
 {
-// increase global instance counter.
-++g_nInstanceCounter;
-// set own Runtime UID
-m_sRuntimeUID = OUString::number( g_nInstanceCounter );
+// increase global instance counter, and set own Runtime UID
+m_sRuntimeUID = OUString::number(++g_nInstanceCounter);
 }
 
 virtual ~IMPL_SfxBaseModel_DataContainer()
@@ -340,9 +338,6 @@ struct IMPL_SfxBaseModel_DataContainer : public 
::sfx2::IModifiableDocument
 }
 };
 
-// static member initialization.
-sal_Int64 IMPL_SfxBaseModel_DataContainer::g_nInstanceCounter = 0;
-
 namespace {
 
 // Listener that forwards notifications from the PrintHelper to the "real" 
listeners


core.git: sfx2/source

2024-05-31 Thread Andrea Gelmini (via logerrit)
 sfx2/source/doc/objstor.cxx |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 72b5eb77aa3388dc0832ca4f94a8122bb9f66694
Author: Andrea Gelmini 
AuthorDate: Fri May 31 13:06:38 2024 +0200
Commit: Julien Nabet 
CommitDate: Fri May 31 17:32:49 2024 +0200

Fix typos

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

diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index cee4847022ed..6816b7c29613 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -1022,7 +1022,7 @@ void SfxObjectShell::DetectCsvSeparators(SvStream& 
stream, rtl_TextEncoding& eCh
 
 nLinesCount ++;
 
-// For each character count the lines that contain it and different 
number of occurences.
+// For each character count the lines that contain it and different 
number of occurrences.
 // And the global maximum for the first statistic.
 for (auto aCurLineChar=aCharsCount.cbegin(); aCurLineChar != 
aCharsCount.cend(); aCurLineChar++)
 {
@@ -1041,7 +1041,7 @@ void SfxObjectShell::DetectCsvSeparators(SvStream& 
stream, rtl_TextEncoding& eCh
 break;
 }
 if (aPrevLineChar == aLinesCharsCount.cend())
-aCurStats->second.second ++;// Increment number of 
different number of occurences.
+aCurStats->second.second ++;// Increment number of 
different number of occurrences.
 
 // Update the maximum of number of lines that contain the same 
character. This is a global value.
 if (nMaxLinesSameChar < aCurStats->second.first)
@@ -1053,14 +1053,14 @@ void SfxObjectShell::DetectCsvSeparators(SvStream& 
stream, rtl_TextEncoding& eCh
 aLinesCharsCount[aLinesCharsCount.size() - 1].swap(aCharsCount);
 }
 
-// Compute the global minimum of different number of occurences.
+// Compute the global minimum of different number of occurrences.
 // But only for characters which occur in a maximum number of lines 
(previously computed).
 for (auto it=aStats.cbegin(); it != aStats.cend(); it++)
 if (it->second.first == nMaxLinesSameChar && nMinDiffs > 
it->second.second)
 nMinDiffs = it->second.second;
 
-// Compute the initial list of separators: those with the maximum lines of 
occurence and
-// the minimum of different number of occurences.
+// Compute the initial list of separators: those with the maximum lines of 
occurrence and
+// the minimum of different number of occurrences.
 for (auto it=aStats.cbegin(); it != aStats.cend(); it++)
 if (it->second.first == nMaxLinesSameChar && it->second.second == 
nMinDiffs)
 sInitSeps += OUStringChar(it->first);


core.git: sfx2/source

2024-05-26 Thread Thorsten Behrens (via logerrit)
 sfx2/source/view/viewfrm.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 9f55ef05d6ed0732217729d90f79a57ab0a21ff0
Author: Thorsten Behrens 
AuthorDate: Sun May 26 21:23:10 2024 +0200
Commit: Thorsten Behrens 
CommitDate: Mon May 27 00:00:53 2024 +0200

Fix WASM build

Wrong line for closing brace, after 1bd9747a126a3e82b6093c2b4af3b3a74774a3e9

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

diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index cb93b9c000de..59a31cf55d87 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -1746,12 +1746,11 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, 
const SfxHint& rHint )
 
officecfg::Setup::Product::LastTimeDonateShown::set(nNow, batch);
 batch->commit();
 }
+}
 #else
 (void) bIsInfobarShown;
 #endif
 
-}
-
 break;
 }
 default: break;


core.git: sfx2/source

2024-05-18 Thread Caolán McNamara (via logerrit)
 sfx2/source/doc/objxtor.cxx  |6 +++---
 sfx2/source/view/viewfrm.cxx |8 
 sfx2/source/view/viewsh.cxx  |8 
 3 files changed, 11 insertions(+), 11 deletions(-)

New commits:
commit fe599b2e081aa671d19ccbcea922c201f66eb955
Author: Caolán McNamara 
AuthorDate: Fri May 17 17:01:47 2024 +0100
Commit: Caolán McNamara 
CommitDate: Sat May 18 11:34:09 2024 +0200

drop SAL_RET_MAYBENULL from bodies

looks like we can get away without it and its tidier for us
if we don't need to do it

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

diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index deb64e6186ac..592b1e7468a5 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -458,7 +458,7 @@ OUString SfxObjectShell::CreateShellID( const 
SfxObjectShell* pShell )
 
 // returns a pointer the first SfxDocument of specified type
 
-SAL_RET_MAYBENULL SfxObjectShell* SfxObjectShell::GetFirst
+SfxObjectShell* SfxObjectShell::GetFirst
 (
 const std::function& isObjectShell,
 bool  bOnlyVisible
@@ -483,7 +483,7 @@ SAL_RET_MAYBENULL SfxObjectShell* SfxObjectShell::GetFirst
 
 // returns a pointer to the next SfxDocument of specified type behind *pDoc
 
-SAL_RET_MAYBENULL SfxObjectShell* SfxObjectShell::GetNext
+SfxObjectShell* SfxObjectShell::GetNext
 (
 const SfxObjectShell&   rPrev,
 const std::function& isObjectShell,
@@ -512,7 +512,7 @@ SAL_RET_MAYBENULL SfxObjectShell* SfxObjectShell::GetNext
 return nullptr;
 }
 
-SAL_RET_MAYBENULL SfxObjectShell* SfxObjectShell::Current()
+SfxObjectShell* SfxObjectShell::Current()
 {
 SfxViewFrame *pFrame = SfxViewFrame::Current();
 return pFrame ? pFrame->GetObjectShell() : nullptr;
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 1838700e9cb1..c77de75697fc 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -2067,14 +2067,14 @@ void SfxViewFrame::KillDispatcher_Impl()
 }
 }
 
-SAL_RET_MAYBENULL SfxViewFrame* SfxViewFrame::Current()
+SfxViewFrame* SfxViewFrame::Current()
 {
 SfxApplication* pApp = SfxApplication::Get();
 return pApp ? pApp->Get_Impl()->pViewFrame : nullptr;
 }
 
 // returns the first window of spec. type viewing the specified doc.
-SAL_RET_MAYBENULL SfxViewFrame* SfxViewFrame::GetFirst
+SfxViewFrame* SfxViewFrame::GetFirst
 (
 const SfxObjectShell*   pDoc,
 boolbOnlyIfVisible
@@ -2097,7 +2097,7 @@ SAL_RET_MAYBENULL SfxViewFrame* SfxViewFrame::GetFirst
 }
 
 // returns the next window of spec. type viewing the specified doc.
-SAL_RET_MAYBENULL SfxViewFrame* SfxViewFrame::GetNext
+SfxViewFrame* SfxViewFrame::GetNext
 (
 const SfxViewFrame& rPrev,
 const SfxObjectShell*   pDoc,
@@ -2448,7 +2448,7 @@ SfxViewFrame* SfxViewFrame::DisplayNewDocument( 
SfxObjectShell const & i_rDoc, c
 );
 }
 
-SAL_RET_MAYBENULL SfxViewFrame* SfxViewFrame::Get( const Reference< 
XController>& i_rController, const SfxObjectShell* i_pDoc )
+SfxViewFrame* SfxViewFrame::Get( const Reference< XController>& i_rController, 
const SfxObjectShell* i_pDoc )
 {
 if ( !i_rController.is() )
 return nullptr;
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 5204f8306c67..df122f41054f 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -2835,7 +2835,7 @@ bool SfxViewShell::PrepareClose
 return true;
 }
 
-SAL_RET_MAYBENULL SfxViewShell* SfxViewShell::Current()
+SfxViewShell* SfxViewShell::Current()
 {
 SfxViewFrame *pCurrent = SfxViewFrame::Current();
 return pCurrent ? pCurrent->GetViewShell() : nullptr;
@@ -2849,7 +2849,7 @@ bool SfxViewShell::IsCurrentLokViewReadOnly()
 return pCurrent && pCurrent->IsLokReadOnlyView();
 }
 
-SAL_RET_MAYBENULL SfxViewShell* SfxViewShell::Get( const Reference< 
XController>& i_rController )
+SfxViewShell* SfxViewShell::Get( const Reference< XController>& i_rController )
 {
 if ( !i_rController.is() )
 return nullptr;
@@ -3009,7 +3009,7 @@ void SfxViewShell::WriteUserDataSequence ( uno::Sequence 
< beans::PropertyValue
 
 
 // returns the first shell of spec. type viewing the specified doc.
-SAL_RET_MAYBENULL SfxViewShell* SfxViewShell::GetFirst
+SfxViewShell* SfxViewShell::GetFirst
 (
 bool  bOnlyVisible,
 const std::function< bool ( const SfxViewShell& ) >& isViewShell
@@ -3038,7 +3038,7 @@ SAL_RET_MAYBENULL SfxViewShell* SfxViewShell::GetFirst
 }
 
 // returns the next shell of spec. type viewing the specified doc.
-SAL_RET_MAYBENULL SfxViewShell* SfxViewShell::GetNext
+SfxViewShell* SfxViewShell::GetNext
 (
 const SfxViewShell& rPrev,
 boolbOnlyVisible,


core.git: sfx2/source

2024-05-16 Thread Caolán McNamara (via logerrit)
 sfx2/source/doc/objstor.cxx |   19 +--
 1 file changed, 13 insertions(+), 6 deletions(-)

New commits:
commit a2007364e77aebbbc45fa8fab2c58f95a821dd18
Author: Caolán McNamara 
AuthorDate: Thu May 16 14:37:52 2024 +0100
Commit: Caolán McNamara 
CommitDate: Thu May 16 17:36:55 2024 +0200

always restore existing interaction handler after save

In an error case we end up removing any existing interaction handler.
So in all cases leave with the same interaction handler that
existed before the save attempt.

See also:

commit 3b294f6139028014e72379ebe8eda24a2bd32195
Date:   Thu Jun 8 20:53:16 2023 +0100

restore, not clear, existing interaction handler after save

where the same problem can be reproduced of every change is a
full-document invalidation once someone else joins a document which has
had a save-fail.

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

diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index b3a7f8847e2e..cee4847022ed 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -3046,17 +3046,21 @@ bool SfxObjectShell::DoSave_Impl( const SfxItemSet* 
pArgs )
 if (pImpl->bPreserveVersions)
 pMediumTmp->TransferVersionList_Impl( *pRetrMedium );
 
+// Save the original interaction handler
+Any aOriginalInteract;
+if (const SfxUnoAnyItem *pItem = 
pRetrMedium->GetItemSet().GetItemIfSet(SID_INTERACTIONHANDLER, false))
+{
+aOriginalInteract = pItem->GetValue();
+// The original pRetrMedium and potential replacement pMediumTmp have 
the same interaction handler at this point
+assert(pMediumTmp->GetItemSet().GetItemIfSet(SID_INTERACTIONHANDLER, 
false)->GetValue() == aOriginalInteract);
+}
+
 // an interaction handler here can acquire only in case of GUI Saving
 // and should be removed after the saving is done
-Any aOriginalInteract;
 css::uno::Reference< XInteractionHandler > xInteract;
 const SfxUnoAnyItem* pxInteractionItem = 
SfxItemSet::GetItem(pArgs, SID_INTERACTIONHANDLER, false);
 if ( pxInteractionItem && ( pxInteractionItem->GetValue() >>= xInteract ) 
&& xInteract.is() )
-{
-if (const SfxUnoAnyItem *pItem = 
pMediumTmp->GetItemSet().GetItemIfSet(SID_INTERACTIONHANDLER, false))
-aOriginalInteract = pItem->GetValue();
 pMediumTmp->GetItemSet().Put( SfxUnoAnyItem( SID_INTERACTIONHANDLER, 
Any( xInteract ) ) );
-}
 
 const SfxBoolItem* pNoFileSync = 
pArgs->GetItem(SID_NO_FILE_SYNC, false);
 if (pNoFileSync && pNoFileSync->GetValue())
@@ -3096,7 +3100,10 @@ bool SfxObjectShell::DoSave_Impl( const SfxItemSet* 
pArgs )
 // reconnect to object storage
 DoSaveCompleted();
 
-pRetrMedium->GetItemSet().ClearItem( SID_INTERACTIONHANDLER );
+if (aOriginalInteract.hasValue())
+
pRetrMedium->GetItemSet().Put(SfxUnoAnyItem(SID_INTERACTIONHANDLER, 
aOriginalInteract));
+else
+pRetrMedium->GetItemSet().ClearItem(SID_INTERACTIONHANDLER);
 pRetrMedium->GetItemSet().ClearItem( SID_PROGRESS_STATUSBAR_CONTROL );
 
 delete pMediumTmp;


core.git: sfx2/source

2024-05-14 Thread Gabor Kelemen (via logerrit)
 sfx2/source/dialog/backingwindow.cxx |   30 +-
 1 file changed, 9 insertions(+), 21 deletions(-)

New commits:
commit ad7e95531d791e9c16a38aeeeb17ecaea44d69e3
Author: Gabor Kelemen 
AuthorDate: Mon May 13 09:14:06 2024 +0200
Commit: Gabor Kelemen 
CommitDate: Wed May 15 08:58:04 2024 +0200

Drop unnecessary ConfigurationAccess

Change-Id: I8ae3273ab048df66fa6a7006cb00af7a4958e337
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167569
Reviewed-by: Gabor Kelemen 
Tested-by: Jenkins

diff --git a/sfx2/source/dialog/backingwindow.cxx 
b/sfx2/source/dialog/backingwindow.cxx
index 0cb8bc258023..e3761327ee60 100644
--- a/sfx2/source/dialog/backingwindow.cxx
+++ b/sfx2/source/dialog/backingwindow.cxx
@@ -62,8 +62,6 @@ using namespace ::com::sun::star::frame;
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::document;
 
-constexpr OUStringLiteral SERVICENAME_CFGREADACCESS = 
u"com.sun.star.configuration.ConfigurationAccess";
-
 class BrandImage final : public weld::CustomWidgetController
 {
 private:
@@ -535,26 +533,16 @@ IMPL_LINK(BackingWindow, ExtLinkClickHdl, weld::Button&, 
rButton,void)
 
 try
 {
-uno::Sequence args(comphelper::InitAnyPropertySequence(
-{
-{"nodepath", 
uno::Any(u"/org.openoffice.Office.Common/Help/StartCenter"_ustr)}
-}));
+OUString sURL(officecfg::Office::Common::Menus::ExtensionsURL::get() +
+"?LOvers=" + utl::ConfigManager::getProductVersion() +
+"&LOlocale=" + 
LanguageTag(utl::ConfigManager::getUILocale()).getBcp47() );
 
-Reference xConfig = 
configuration::theDefaultProvider::get( 
comphelper::getProcessComponentContext() );
-Reference 
xNameAccess(xConfig->createInstanceWithArguments(SERVICENAME_CFGREADACCESS, 
args), UNO_QUERY);
-if (xNameAccess.is())
-{
-OUString 
sURL(officecfg::Office::Common::Menus::ExtensionsURL::get() +
-"?LOvers=" + utl::ConfigManager::getProductVersion() +
-"&LOlocale=" + 
LanguageTag(utl::ConfigManager::getUILocale()).getBcp47() );
-
-Reference const
-xSystemShellExecute(
-css::system::SystemShellExecute::create(
-::comphelper::getProcessComponentContext()));
-xSystemShellExecute->execute(sURL, OUString(),
-css::system::SystemShellExecuteFlags::URIS_ONLY);
-}
+Reference const
+xSystemShellExecute(
+css::system::SystemShellExecute::create(
+::comphelper::getProcessComponentContext()));
+xSystemShellExecute->execute(sURL, OUString(),
+css::system::SystemShellExecuteFlags::URIS_ONLY);
 }
 catch (const Exception&)
 {


core.git: sfx2/source

2024-05-13 Thread Caolán McNamara (via logerrit)
 sfx2/source/bastyp/fltfnc.cxx  |3 +++
 sfx2/source/view/lokhelper.cxx |1 +
 2 files changed, 4 insertions(+)

New commits:
commit 5e6d9c38a7ef4027734064b83ca328df258a575c
Author: Caolán McNamara 
AuthorDate: Mon May 13 14:18:25 2024 +0100
Commit: Caolán McNamara 
CommitDate: Mon May 13 20:25:14 2024 +0200

WaE: C6011 Dereferencing NULL pointer warnings

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

diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx
index 8234b10f95e5..3b0fbdcd9478 100644
--- a/sfx2/source/bastyp/fltfnc.cxx
+++ b/sfx2/source/bastyp/fltfnc.cxx
@@ -1047,7 +1047,10 @@ void SfxFilterContainer::ReadSingleFilter_Impl(
 void SfxFilterContainer::ReadFilters_Impl( bool bUpdate )
 {
 if ( !pFilterArr )
+{
 CreateFilterArr();
+assert(pFilterArr);
+}
 
 bFirstRead = false;
 SfxFilterList_Impl& rList = *pFilterArr;
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index d94ef124b0b5..756fda428273 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -190,6 +190,7 @@ void SfxLokHelper::setView(int nId)
 return;
 
 const SfxViewShell* pViewShell = *itViewShell;
+assert(pViewShell);
 DisableCallbacks dc;
 
 bool bIsCurrShell = (pViewShell == SfxViewShell::Current());


core.git: sfx2/source

2024-05-09 Thread Hubert Figuière (via logerrit)
 sfx2/source/control/unoctitm.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit fd0a249ad1f4a55677e97bd6355e5316a863f9e6
Author: Hubert Figuière 
AuthorDate: Wed May 8 17:34:47 2024 -0400
Commit: Caolán McNamara 
CommitDate: Thu May 9 17:13:37 2024 +0200

lokit: Properly handle state update for .uno:ToggleSheetGrid

This is a follow up on cool#8066

Signed-off-by: Hubert Figuière 
Change-Id: I7d6ce4c9dfe7c2e9a2dda110e587c8c825c4df2f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167370
Reviewed-by: Szymon Kłos 
Tested-by: Jenkins CollaboraOffice 
(cherry picked from commit 9bbe40cc2d39f89ffcae57875d4c7ef7688d83d7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167317
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 7d518f435d81..6fb25977796e 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -940,8 +940,7 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 nSID, 
SfxViewFrame* pViewFra
 aEvent.FeatureURL.Path == "SpacePara15" ||
 aEvent.FeatureURL.Path == "SpacePara2" ||
 aEvent.FeatureURL.Path == "DataFilterAutoFilter" ||
-aEvent.FeatureURL.Path == "CellProtection" ||
-aEvent.FeatureURL.Path == "ToggleSheetGrid")
+aEvent.FeatureURL.Path == "CellProtection")
 {
 bool bTemp = false;
 aEvent.State >>= bTemp;
@@ -1222,7 +1221,8 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 nSID, 
SfxViewFrame* pViewFra
 }
 }
 else if (aEvent.FeatureURL.Path == "ToggleMergeCells" ||
- aEvent.FeatureURL.Path == "SheetRightToLeft")
+ aEvent.FeatureURL.Path == "SheetRightToLeft" ||
+ aEvent.FeatureURL.Path == "ToggleSheetGrid")
 {
 bool aBool;
 


core.git: sfx2/source

2024-05-06 Thread Balazs Varga (via logerrit)
 sfx2/source/dialog/backingwindow.cxx |   10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

New commits:
commit 2fdcdad742bc26be509dde53f061f96a9620fd0a
Author: Balazs Varga 
AuthorDate: Fri May 3 11:10:57 2024 +0200
Commit: Samuel Mehrbrodt 
CommitDate: Mon May 6 21:56:58 2024 +0200

tdf#160961: hide open remote file button from startcenter if the

.uno:OpenRemote command is not available (e.g disabled in a config file).
We also hide the Open remote file (and other) buttons in the Menubar
if they are settled to disable.

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

diff --git a/sfx2/source/dialog/backingwindow.cxx 
b/sfx2/source/dialog/backingwindow.cxx
index efa18f452d51..b1eb7a31f7e9 100644
--- a/sfx2/source/dialog/backingwindow.cxx
+++ b/sfx2/source/dialog/backingwindow.cxx
@@ -28,6 +28,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -307,7 +308,14 @@ void BackingWindow::initControls()
 mxExtensionsButton->connect_clicked(LINK(this, BackingWindow, 
ExtLinkClickHdl));
 
 mxOpenButton->connect_clicked(LINK(this, BackingWindow, ClickHdl));
-mxRemoteButton->connect_clicked(LINK(this, BackingWindow, ClickHdl));
+
+// Hide OpenRemote button on startpage if the OpenRemote uno command is 
not available
+SvtCommandOptions aCmdOptions;
+if (SvtCommandOptions().HasEntriesDisabled() && 
aCmdOptions.LookupDisabled("OpenRemote"))
+mxRemoteButton->set_visible(false);
+else
+mxRemoteButton->connect_clicked(LINK(this, BackingWindow, ClickHdl));
+
 mxWriterAllButton->connect_clicked(LINK(this, BackingWindow, ClickHdl));
 mxDrawAllButton->connect_clicked(LINK(this, BackingWindow, ClickHdl));
 mxCalcAllButton->connect_clicked(LINK(this, BackingWindow, ClickHdl));


core.git: sfx2/source

2024-05-03 Thread Noel Grandin (via logerrit)
 sfx2/source/appl/workwin.cxx |  114 +--
 1 file changed, 57 insertions(+), 57 deletions(-)

New commits:
commit d19b79e4b4998eddd1baa1ab6a42c4f557889a60
Author: Noel Grandin 
AuthorDate: Thu May 2 13:18:08 2024 +0200
Commit: Noel Grandin 
CommitDate: Fri May 3 15:57:46 2024 +0200

replace createFromAscii with OUString literals in sfx2

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

diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx
index 5414f69c34c3..48eaa6a8226e 100644
--- a/sfx2/source/appl/workwin.cxx
+++ b/sfx2/source/appl/workwin.cxx
@@ -63,66 +63,66 @@ namespace {
 struct ResIdToResName
 {
 ToolbarId   eId;
-const char* pName;
+OUString pName;
 };
 
 }
 
-const ResIdToResName pToolBarResToName[] =
-{
-{ ToolbarId::FullScreenToolbox,   "fullscreenbar"},
-{ ToolbarId::EnvToolbox,  "standardbar", },
-{ ToolbarId::SvxTbx_Form_Navigation,  "formsnavigationbar"   },
-{ ToolbarId::SvxTbx_Form_Filter,  "formsfilterbar"   },
-{ ToolbarId::SvxTbx_Text_Control_Attributes, "formtextobjectbar"},
-{ ToolbarId::SvxTbx_Controls, "formcontrols" },
-{ ToolbarId::SvxTbx_FormDesign,   "formdesign"   },
-{ ToolbarId::Math_Toolbox,"toolbar"  },  //math
-{ ToolbarId::Text_Toolbox_Sc, "textobjectbar"},  //calc
-{ ToolbarId::Draw_Objectbar,  "drawobjectbar"},
-{ ToolbarId::Graphic_Objectbar,   "graphicobjectbar" },
-{ ToolbarId::Objectbar_Format,"formatobjectbar"  },
-{ ToolbarId::Objectbar_Preview,   "previewbar"   },
-{ ToolbarId::Objectbar_Tools, "toolbar"  },  //calc
-{ ToolbarId::Bezier_Toolbox_Sd,   "bezierobjectbar"  },  
//draw/impress
-{ ToolbarId::Gluepoints_Toolbox,  "gluepointsobjectbar"  },
-{ ToolbarId::Draw_Graf_Toolbox,   "graphicobjectbar" },
-{ ToolbarId::Draw_Obj_Toolbox,"drawingobjectbar" },  
//impress
-{ ToolbarId::Draw_Text_Toolbox_Sd,"textobjectbar"},  
//impress
-{ ToolbarId::Draw_Toolbox_Sd, "toolbar"  },  
//impress
-{ ToolbarId::Draw_Options_Toolbox,"optionsbar"   },
-{ ToolbarId::Draw_CommonTask_Toolbox, "commontaskbar"},
-{ ToolbarId::Graphic_Obj_Toolbox, "drawingobjectbar" },  //draw
-{ ToolbarId::Outline_Toolbox, "outlinetoolbar"   },  
//impress
-{ ToolbarId::Slide_Toolbox,   "slideviewtoolbar" },
-{ ToolbarId::Slide_Obj_Toolbox,   "slideviewobjectbar"   },
-{ ToolbarId::Bezier_Toolbox_Sw,   "bezierobjectbar"  },
-{ ToolbarId::Draw_Toolbox_Sw, "drawingobjectbar" },
-{ ToolbarId::Draw_Text_Toolbox_Sw,"drawtextobjectbar"},
-{ ToolbarId::Frame_Toolbox,   "frameobjectbar"   },
-{ ToolbarId::Grafik_Toolbox,  "graphicobjectbar" },
-{ ToolbarId::Num_Toolbox, "numobjectbar" },
-{ ToolbarId::Ole_Toolbox, "oleobjectbar" },
-{ ToolbarId::Table_Toolbox,   "tableobjectbar"   },
-{ ToolbarId::Text_Toolbox_Sw, "textobjectbar"},
-{ ToolbarId::PView_Toolbox,   "previewobjectbar" },  
//writer
-{ ToolbarId::Webtools_Toolbox,"toolbar"  },  //web
-{ ToolbarId::Webtext_Toolbox, "textobjectbar"},
-{ ToolbarId::Tools_Toolbox,   "toolbar"  },  
//writer
-{ ToolbarId::Webframe_Toolbox,"frameobjectbar"   },  //web
-{ ToolbarId::Webgraphic_Toolbox,  "graphicobjectbar" },
-{ ToolbarId::Webole_Toolbox,  "oleobjectbar" },
-{ ToolbarId::Basicide_Objectbar,  "macrobar" },
-{ ToolbarId::Svx_Fontwork_Bar,"fontworkobjectbar"},  
//global
-{ ToolbarId::Svx_Extrusion_Bar,   "extrusionobjectbar"   },
-{ ToolbarId::FormLayer_Toolbox,   "formsobjectbar"   },
-{ ToolbarId::Module_Toolbox,  "viewerbar"},  
//writer (plugin)
-{ ToolbarId::Objectbar_App,   "viewerbar"},  
//calc   (plugin)
-{ ToolbarId::Draw_Viewer_Toolbox, "viewerbar"},  
//impress(plugin)
-{ ToolbarId::Draw_Media_Toolbox,  "mediaobjectbar"   },  
//draw/impress
-{ ToolbarId::Media_Objectbar, "mediaobjectbar"   },  //calc
-{ ToolbarId::Media_Toolbox,   "mediaobjectbar"   },  
//writer
-{ ToolbarId::None,   "" }
+constexpr ResIdToResName pToolBarResToName[] =
+{
+{ ToolbarId::Ful

core.git: sfx2/source

2024-04-30 Thread Noel Grandin (via logerrit)
 sfx2/source/doc/syspathw32.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 62ee743d3c39e45d7fc6e0bdfa51a80e51af0c03
Author: Noel Grandin 
AuthorDate: Tue Apr 30 13:11:26 2024 +0200
Commit: Noel Grandin 
CommitDate: Tue Apr 30 16:00:25 2024 +0200

fix non-PCH windows build

after
commit a7f8882e4975e4194732506e4ffb9f7af6eb9c72
Author: Noel Grandin 
Date:   Mon Apr 29 14:31:15 2024 +0200
convert HeapAlloc to make_unique

Change-Id: Idb2e67285018eeb3373ba11c464df5a00b54a87b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166925
Tested-by: Noel Grandin 
Reviewed-by: Noel Grandin 

diff --git a/sfx2/source/doc/syspathw32.cxx b/sfx2/source/doc/syspathw32.cxx
index 38243e2ce7ac..9aa02b51b64e 100644
--- a/sfx2/source/doc/syspathw32.cxx
+++ b/sfx2/source/doc/syspathw32.cxx
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #ifdef _WIN32
 


core.git: sfx2/source

2024-04-29 Thread Caolán McNamara (via logerrit)
 sfx2/source/doc/graphhelp.cxx |   41 +
 1 file changed, 21 insertions(+), 20 deletions(-)

New commits:
commit e5c988821db31f285cdd207e2a2ac849c0f1c099
Author: Caolán McNamara 
AuthorDate: Fri Apr 26 11:11:44 2024 +0100
Commit: Caolán McNamara 
CommitDate: Mon Apr 29 09:30:48 2024 +0200

WaE: C6011 Derefencing NULL pointer 'pMF'

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

diff --git a/sfx2/source/doc/graphhelp.cxx b/sfx2/source/doc/graphhelp.cxx
index 7cfdf76fe60f..9d7600ae2da7 100644
--- a/sfx2/source/doc/graphhelp.cxx
+++ b/sfx2/source/doc/graphhelp.cxx
@@ -128,28 +128,29 @@ void* GraphicHelper::getWinMetaFileFromGDI_Impl( const 
GDIMetaFile* pGDIMeta, co
 
 if ( hMemory )
 {
-METAFILEPICT* pMF = 
static_cast(GlobalLock( hMemory ));
-
-pMF->hMF = hMeta;
-pMF->mm = MM_ANISOTROPIC;
-
-MapMode aWinMode( MapUnit::Map100thMM );
-
-if ( aWinMode == pGDIMeta->GetPrefMapMode() )
+if (METAFILEPICT* pMF = 
static_cast(GlobalLock(hMemory)))
 {
-pMF->xExt = aMetaSize.Width();
-pMF->yExt = aMetaSize.Height();
+pMF->hMF = hMeta;
+pMF->mm = MM_ANISOTROPIC;
+
+MapMode aWinMode( MapUnit::Map100thMM );
+
+if ( aWinMode == pGDIMeta->GetPrefMapMode() )
+{
+pMF->xExt = aMetaSize.Width();
+pMF->yExt = aMetaSize.Height();
+}
+else
+{
+Size aWinSize = OutputDevice::LogicToLogic( 
Size( aMetaSize.Width(), aMetaSize.Height() ),
+
pGDIMeta->GetPrefMapMode(),
+
aWinMode );
+pMF->xExt = aWinSize.Width();
+pMF->yExt = aWinSize.Height();
+}
+
+GlobalUnlock(hMemory);
 }
-else
-{
-Size aWinSize = OutputDevice::LogicToLogic( Size( 
aMetaSize.Width(), aMetaSize.Height() ),
-
pGDIMeta->GetPrefMapMode(),
-
aWinMode );
-pMF->xExt = aWinSize.Width();
-pMF->yExt = aWinSize.Height();
-}
-
-GlobalUnlock( hMemory );
 pResult = static_cast(hMemory);
 }
 else


core.git: sfx2/source

2024-04-29 Thread Caolán McNamara (via logerrit)
 sfx2/source/appl/shutdowniconw32.cxx |   15 ---
 sfx2/source/doc/syspathw32.cxx   |   21 +++--
 2 files changed, 19 insertions(+), 17 deletions(-)

New commits:
commit a70a8f55973ec3e71f65335be75699f1d2a73d62
Author: Caolán McNamara 
AuthorDate: Fri Apr 26 11:42:35 2024 +0100
Commit: Caolán McNamara 
CommitDate: Mon Apr 29 09:30:26 2024 +0200

Unchecked HeapAlloc

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

diff --git a/sfx2/source/appl/shutdowniconw32.cxx 
b/sfx2/source/appl/shutdowniconw32.cxx
index 2fb7cd2b7875..a237aac13547 100644
--- a/sfx2/source/appl/shutdowniconw32.cxx
+++ b/sfx2/source/appl/shutdowniconw32.cxx
@@ -681,15 +681,16 @@ static OUString SHGetSpecialFolder( int nFolderID )
 
 if( hHdl == NOERROR )
 {
-WCHAR *lpFolderA;
-lpFolderA = ALLOC( WCHAR, 16000 );
-
-SHGetPathFromIDListW( pidl, lpFolderA );
-aFolder = o3tl::toU( lpFolderA );
+if (WCHAR *lpFolderA = ALLOC(WCHAR, 16000))
+{
+SHGetPathFromIDListW(pidl, lpFolderA);
+aFolder = o3tl::toU(lpFolderA);
 
-FREE( lpFolderA );
-SHFree_( pidl );
+FREE(lpFolderA);
+SHFree_(pidl);
+}
 }
+
 return aFolder;
 }
 
diff --git a/sfx2/source/doc/syspathw32.cxx b/sfx2/source/doc/syspathw32.cxx
index f60f459829d7..dce19e3625c0 100644
--- a/sfx2/source/doc/syspathw32.cxx
+++ b/sfx2/source/doc/syspathw32.cxx
@@ -37,17 +37,18 @@ static bool SHGetSpecialFolderW32( int nFolderID, WCHAR* 
pszFolder, int nSize )
 
 if( hHdl == NOERROR )
 {
-WCHAR *lpFolder = static_cast< WCHAR* >( HeapAlloc( GetProcessHeap(), 
0, 16000 ));
-
-SHGetPathFromIDListW( pidl, lpFolder );
-wcsncpy( pszFolder, lpFolder, nSize );
-
-HeapFree( GetProcessHeap(), 0, lpFolder );
-IMalloc *pMalloc;
-if( NOERROR == SHGetMalloc(&pMalloc) )
+if (WCHAR *lpFolder = static_cast(HeapAlloc(GetProcessHeap(), 
0, 16000)))
 {
-pMalloc->Free( pidl );
-pMalloc->Release();
+SHGetPathFromIDListW( pidl, lpFolder );
+wcsncpy( pszFolder, lpFolder, nSize );
+
+HeapFree( GetProcessHeap(), 0, lpFolder );
+IMalloc *pMalloc;
+if( NOERROR == SHGetMalloc(&pMalloc) )
+{
+pMalloc->Free( pidl );
+pMalloc->Release();
+}
 }
 }
 return true;


core.git: sfx2/source

2024-04-29 Thread Caolán McNamara (via logerrit)
 sfx2/source/control/dispatch.cxx |5 +++--
 sfx2/source/dialog/basedlgs.cxx  |   13 +
 sfx2/source/dialog/tabdlg.cxx|   12 +---
 sfx2/source/doc/guisaveas.cxx|   10 ++
 sfx2/source/view/viewsh.cxx  |6 +++---
 5 files changed, 30 insertions(+), 16 deletions(-)

New commits:
commit 064b335cf721db96fe556c78b15d0abe0edec70d
Author: Caolán McNamara 
AuthorDate: Fri Apr 26 10:23:55 2024 +0100
Commit: Caolán McNamara 
CommitDate: Mon Apr 29 09:28:32 2024 +0200

call SfxViewShell::Current() just once

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

diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index 300f0179b064..c761cb17830e 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -1125,10 +1125,11 @@ void SfxDispatcher::Update_Impl( bool bForce )
 if ( xLayoutManager.is() )
 xLayoutManager->unlock();
 
-if ( SfxViewShell::Current() && SfxViewShell::Current()->GetDispatcher() )
+const SfxViewShell* pViewShell = SfxViewShell::Current();
+if (pViewShell && pViewShell->GetDispatcher())
 {
 SfxPoolItemHolder aItem;
-SfxViewShell::Current()->GetDispatcher()->QueryState(SID_NOTEBOOKBAR, 
aItem);
+pViewShell->GetDispatcher()->QueryState(SID_NOTEBOOKBAR, aItem);
 }
 }
 
diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx
index 29f0cf6532cb..fb7c95e3cc32 100644
--- a/sfx2/source/dialog/basedlgs.cxx
+++ b/sfx2/source/dialog/basedlgs.cxx
@@ -200,12 +200,17 @@ void SfxModelessDialogController::Close()
 SfxDialogController::Close();
 }
 
+static bool isLOKMobilePhone()
+{
+if (!comphelper::LibreOfficeKit::isActive())
+return false;
+const SfxViewShell* pCurrentShell = SfxViewShell::Current();
+return pCurrentShell && pCurrentShell->isLOKMobilePhone();
+}
+
 SfxDialogController::SfxDialogController(weld::Widget* pParent, const 
OUString& rUIFile,
  const OUString& rDialogId)
-: GenericDialogController(pParent, rUIFile, rDialogId,
-comphelper::LibreOfficeKit::isActive()
-&& SfxViewShell::Current()
-&& 
SfxViewShell::Current()->isLOKMobilePhone())
+: GenericDialogController(pParent, rUIFile, rDialogId, isLOKMobilePhone())
 {
 m_xDialog->SetInstallLOKNotifierHdl(LINK(this, SfxDialogController, 
InstallLOKNotifierHdl));
 m_xDialog->connect_container_focus_changed(LINK(this, SfxDialogController, 
FocusChangeHdl));
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index 01d6c0e440cf..d38be362dbea 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -137,10 +137,16 @@ css::uno::Reference< css::frame::XFrame > 
SfxTabPage::GetFrame() const
 return css::uno::Reference< css::frame::XFrame >();
 }
 
+static bool isLOKMobilePhone()
+{
+if (!comphelper::LibreOfficeKit::isActive())
+return false;
+const SfxViewShell* pCurrentShell = SfxViewShell::Current();
+return pCurrentShell && pCurrentShell->isLOKMobilePhone();
+}
+
 SfxTabPage::SfxTabPage(weld::Container* pPage, weld::DialogController* 
pController, const OUString& rUIXMLDescription, const OUString& rID, const 
SfxItemSet *rAttrSet)
-: BuilderPage(pPage, pController, rUIXMLDescription, rID,
-comphelper::LibreOfficeKit::isActive() && 
SfxViewShell::Current()
-&& SfxViewShell::Current()->isLOKMobilePhone())
+: BuilderPage(pPage, pController, rUIXMLDescription, rID, 
isLOKMobilePhone())
 , mpSet(rAttrSet)
 , mbHasExchangeSupport(false)
 , mpImpl(new TabPageImpl)
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 974aef7384d9..af5057b93beb 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -674,10 +674,12 @@ void SfxStoringHelper::CallFinishGUIStoreModel()
 
 IMPL_LINK( ModelData_Impl, OptionsDialogClosedHdl, 
css::ui::dialogs::DialogClosedEvent*, pEvt, void )
 {
+SfxViewShell* pNotifier = comphelper::LibreOfficeKit::isActive() ? 
SfxViewShell::Current() : nullptr;
+
 if (pEvt->DialogResult == RET_OK && m_xFilterProperties)
 {
-if ( comphelper::LibreOfficeKit::isActive() && SfxViewShell::Current() 
)
-SfxViewShell::Current()->libreOfficeKitViewCallback( 
LOK_CALLBACK_EXPORT_FILE, "PENDING"_ostr );
+if (pNotifier)
+pNotifier->libreOfficeKitViewCallback( LOK_CALLBACK_EXPORT_FILE, 
"PENDING"_ostr );
 
 const uno::Sequence< beans::PropertyValue > aPropsFromDialog = 
m_xFilterProperties->getPropertyValues();
 for ( const auto& rProp : aPropsFromDialog )
@@ -685,9 +687,9 @@ IMPL_LINK( ModelData_Impl, OptionsDia

core.git: sfx2/source

2024-04-29 Thread Caolán McNamara (via logerrit)
 sfx2/source/appl/appopen.cxx   |5 +++--
 sfx2/source/doc/objserv.cxx|6 +-
 sfx2/source/notebookbar/SfxNotebookBar.cxx |   14 +-
 3 files changed, 17 insertions(+), 8 deletions(-)

New commits:
commit 95d3e0d478686c7fa84f0bb8c466a1082333a47b
Author: Caolán McNamara 
AuthorDate: Fri Apr 26 10:20:56 2024 +0100
Commit: Caolán McNamara 
CommitDate: Mon Apr 29 09:27:38 2024 +0200

SfxViewFrame::Current() dereferenced without null check

found with msvc -analyze and _Ret_maybenull_

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

diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index 03ad8039be7b..7ea6fca57d8d 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -1044,9 +1044,10 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
 if( aFileName.startsWith("#") ) // Mark without URL
 {
 SfxViewFrame *pView = pTargetFrame ? 
pTargetFrame->GetCurrentViewFrame() : nullptr;
-if ( !pView )
+if (!pView)
 pView = SfxViewFrame::Current();
-pView->GetViewShell()->JumpToMark( aFileName.copy(1) );
+if (pView)
+pView->GetViewShell()->JumpToMark( aFileName.copy(1) );
 rReq.SetReturnValue( SfxViewFrameItem( pView ) );
 return;
 }
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 9e0b2697cd74..d721458beb3b 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -452,6 +452,10 @@ static void sendErrorToLOK(ErrCodeMsg error)
 if (error.GetCode().GetClass() == ErrCodeClass::NONE)
 return;
 
+SfxViewShell* pNotifier = SfxViewShell::Current();
+if (!pNotifier)
+return;
+
 boost::property_tree::ptree aTree;
 aTree.put("code", error);
 aTree.put("kind", "");
@@ -464,7 +468,7 @@ static void sendErrorToLOK(ErrCodeMsg error)
 std::stringstream aStream;
 boost::property_tree::write_json(aStream, aTree);
 
-SfxViewShell::Current()->libreOfficeKitViewCallback(LOK_CALLBACK_ERROR, 
OString(aStream.str()));
+pNotifier->libreOfficeKitViewCallback(LOK_CALLBACK_ERROR, 
OString(aStream.str()));
 }
 
 namespace
diff --git a/sfx2/source/notebookbar/SfxNotebookBar.cxx 
b/sfx2/source/notebookbar/SfxNotebookBar.cxx
index 41ae9c3c2666..42f11191d057 100644
--- a/sfx2/source/notebookbar/SfxNotebookBar.cxx
+++ b/sfx2/source/notebookbar/SfxNotebookBar.cxx
@@ -480,6 +480,9 @@ bool SfxNotebookBar::StateMethod(SystemWindow* pSysWindow,
 
 if (bIsLOK)
 {
+if (!pViewShell)
+return false;
+
 // Notebookbar was loaded too early what caused:
 //   * in LOK: Paste Special feature was incorrectly 
initialized
 // Skip first request so Notebookbar will be initialized after 
document was loaded
@@ -672,11 +675,12 @@ void SfxNotebookBar::ToggleMenubar()
 
 void SfxNotebookBar::ReloadNotebookBar(std::u16string_view sUIPath)
 {
-if (SfxNotebookBar::IsActive())
-{
-SfxViewShell* pViewShell = SfxViewShell::Current();
-
sfx2::SfxNotebookBar::StateMethod(pViewShell->GetViewFrame().GetBindings(), 
sUIPath, true);
-}
+if (!SfxNotebookBar::IsActive())
+return;
+SfxViewShell* pViewShell = SfxViewShell::Current();
+if (!pViewShell)
+return;
+
sfx2::SfxNotebookBar::StateMethod(pViewShell->GetViewFrame().GetBindings(), 
sUIPath, true);
 }
 
 IMPL_STATIC_LINK(SfxNotebookBar, VclDisposeHdl, const SfxViewShell*, 
pViewShell, void)


core.git: sfx2/source

2024-04-28 Thread Julien Nabet (via logerrit)
 sfx2/source/doc/objstor.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 45d2d90d2354a6a32297cde52c0041915499b19b
Author: Julien Nabet 
AuthorDate: Sun Apr 28 13:16:59 2024 +0200
Commit: Julien Nabet 
CommitDate: Sun Apr 28 20:10:30 2024 +0200

tdf#160827: fix crash when retrieving _MarkAsFinal value (docx) (take 2)

Change-Id: I3f2ad56a205877be54b0dbfe361b76db3436f5ca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166798
Reviewed-by: Noel Grandin 
Reviewed-by: Julien Nabet 
Tested-by: Jenkins

diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 720e939e3885..e7538813cfdd 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -2741,7 +2741,11 @@ bool SfxObjectShell::ImportFrom(SfxMedium& rMedium,
 uno::Reference xPropertySetInfo = 
xPropertySet->getPropertySetInfo();
 if (xPropertySetInfo.is() && 
xPropertySetInfo->hasPropertyByName("_MarkAsFinal"))
 {
-if 
(xPropertySet->getPropertyValue("_MarkAsFinal").get())
+Any anyMarkAsFinal = 
xPropertySet->getPropertyValue("_MarkAsFinal");
+if (
+   ( (anyMarkAsFinal.getValueType() == 
cppu::UnoType::get()) && (anyMarkAsFinal.get()) ) ||
+   ( (anyMarkAsFinal.getValueType() == 
cppu::UnoType::get()) && (anyMarkAsFinal.get() == "true") )
+)
 {
 uno::Reference< lang::XMultiServiceFactory > 
xFactory(GetModel(), uno::UNO_QUERY);
 uno::Reference< beans::XPropertySet > 
xSettings(xFactory->createInstance("com.sun.star.document.Settings"), 
uno::UNO_QUERY);


core.git: sfx2/source

2024-04-28 Thread Julien Nabet (via logerrit)
 sfx2/source/doc/objstor.cxx |8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

New commits:
commit 5158104b9294ab85ab7a675b5b627469e303c345
Author: Julien Nabet 
AuthorDate: Sun Apr 28 13:09:34 2024 +0200
Commit: Julien Nabet 
CommitDate: Sun Apr 28 13:11:21 2024 +0200

Revert "tdf#160827: fix crash when retrieving _MarkAsFinal value (docx)"

As Noel advised in https://gerrit.libreoffice.org/c/core/+/166724, it's 
better to test type this way:
getValueType() == cppu::UnoType::get()

This reverts commit f49d74edf76097d014ed891d0025cb2e9b197c5a.

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

diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 441641d1c65c..720e939e3885 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -2741,13 +2741,7 @@ bool SfxObjectShell::ImportFrom(SfxMedium& rMedium,
 uno::Reference xPropertySetInfo = 
xPropertySet->getPropertySetInfo();
 if (xPropertySetInfo.is() && 
xPropertySetInfo->hasPropertyByName("_MarkAsFinal"))
 {
-Any anyMarkAsFinal = 
xPropertySet->getPropertyValue("_MarkAsFinal");
-const OUString strValueTypeName = 
anyMarkAsFinal.getValueTypeName();
-
-if (
-   ( (strValueTypeName == "boolean") && 
(anyMarkAsFinal.get()) ) ||
-   ( (strValueTypeName == "string") && 
(anyMarkAsFinal.get() == "true") )
-)
+if 
(xPropertySet->getPropertyValue("_MarkAsFinal").get())
 {
 uno::Reference< lang::XMultiServiceFactory > 
xFactory(GetModel(), uno::UNO_QUERY);
 uno::Reference< beans::XPropertySet > 
xSettings(xFactory->createInstance("com.sun.star.document.Settings"), 
uno::UNO_QUERY);


core.git: sfx2/source

2024-04-28 Thread Julien Nabet (via logerrit)
 sfx2/source/doc/objstor.cxx |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit f49d74edf76097d014ed891d0025cb2e9b197c5a
Author: Julien Nabet 
AuthorDate: Fri Apr 26 23:20:31 2024 +0200
Commit: Julien Nabet 
CommitDate: Sun Apr 28 11:39:38 2024 +0200

tdf#160827: fix crash when retrieving _MarkAsFinal value (docx)

xPropertySet->getPropertyValue("_MarkAsFinal") can retrieve an Any
containing a boolean or a string

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

diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 720e939e3885..441641d1c65c 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -2741,7 +2741,13 @@ bool SfxObjectShell::ImportFrom(SfxMedium& rMedium,
 uno::Reference xPropertySetInfo = 
xPropertySet->getPropertySetInfo();
 if (xPropertySetInfo.is() && 
xPropertySetInfo->hasPropertyByName("_MarkAsFinal"))
 {
-if 
(xPropertySet->getPropertyValue("_MarkAsFinal").get())
+Any anyMarkAsFinal = 
xPropertySet->getPropertyValue("_MarkAsFinal");
+const OUString strValueTypeName = 
anyMarkAsFinal.getValueTypeName();
+
+if (
+   ( (strValueTypeName == "boolean") && 
(anyMarkAsFinal.get()) ) ||
+   ( (strValueTypeName == "string") && 
(anyMarkAsFinal.get() == "true") )
+)
 {
 uno::Reference< lang::XMultiServiceFactory > 
xFactory(GetModel(), uno::UNO_QUERY);
 uno::Reference< beans::XPropertySet > 
xSettings(xFactory->createInstance("com.sun.star.document.Settings"), 
uno::UNO_QUERY);


core.git: sfx2/source

2024-04-16 Thread Miklos Vajna (via logerrit)
 sfx2/source/control/unoctitm.cxx |   35 +--
 1 file changed, 13 insertions(+), 22 deletions(-)

New commits:
commit 875d99c6e5286b9d56bba32a3abbc37068df61c1
Author: Miklos Vajna 
AuthorDate: Mon Apr 15 16:47:59 2024 +0200
Commit: Miklos Vajna 
CommitDate: Tue Apr 16 11:25:51 2024 +0200

sfx2 lok: simplify error handling in InterceptLOKStateChangeEvent()

The whole function is pointless without a viewshell, move the check &
short-circuit to the top of the function, and drop all the duplicate
checks.

Also drop two calls to SfxViewShell::Current(): getting it from the view
frame is better than getting some global state.

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

diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 9cbd29034a46..0691a6bad444 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -893,7 +893,8 @@ void 
SfxDispatchController_Impl::StateChangedAtToolBoxControl( sal_uInt16 nSID,
 
 static void InterceptLOKStateChangeEvent(sal_uInt16 nSID, SfxViewFrame* 
pViewFrame, const css::frame::FeatureStateEvent& aEvent, const SfxPoolItem* 
pState)
 {
-if (!comphelper::LibreOfficeKit::isActive())
+const SfxViewShell* pViewShell = pViewFrame->GetViewShell();
+if (!comphelper::LibreOfficeKit::isActive() || !pViewShell)
 return;
 
 OUStringBuffer aBuffer(aEvent.FeatureURL.Complete + "=");
@@ -1121,17 +1122,13 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 
nSID, SfxViewFrame* pViewFra
 else if (aEvent.FeatureURL.Path == "ParaLeftToRight" ||
  aEvent.FeatureURL.Path == "ParaRightToLeft")
 {
-const SfxViewShell* pViewShell = SfxViewShell::Current();
-if (pViewShell)
-{
-tools::JsonWriter aTree;
-bool bTemp = false;
-aEvent.State >>= bTemp;
-aTree.put("commandName", aEvent.FeatureURL.Complete);
-aTree.put("disabled", !aEvent.IsEnabled);
-aTree.put("state", bTemp ? "true" : "false");
-pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, 
aTree.finishAndGetAsOString());
-}
+tools::JsonWriter aTree;
+bool bTemp = false;
+aEvent.State >>= bTemp;
+aTree.put("commandName", aEvent.FeatureURL.Complete);
+aTree.put("disabled", !aEvent.IsEnabled);
+aTree.put("state", bTemp ? "true" : "false");
+pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, 
aTree.finishAndGetAsOString());
 return;
 }
 else if (aEvent.FeatureURL.Path == "AssignLayout" ||
@@ -1152,8 +1149,7 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 nSID, 
SfxViewFrame* pViewFra
  aEvent.FeatureURL.Path == "TransformWidth" ||
  aEvent.FeatureURL.Path == "TransformHeight")
 {
-const SfxViewShell* pViewShell = SfxViewShell::Current();
-if (aEvent.IsEnabled && pViewShell && pViewShell->isLOKMobilePhone())
+if (aEvent.IsEnabled && pViewShell->isLOKMobilePhone())
 {
 boost::property_tree::ptree aTree;
 boost::property_tree::ptree aState;
@@ -1198,11 +1194,7 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 
nSID, SfxViewFrame* pViewFra
 aTree.put("state", aString);
 std::stringstream aStream;
 boost::property_tree::write_json(aStream, aTree);
-const SfxViewShell* pShell = pViewFrame->GetViewShell();
-if (pShell)
-{
-pShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, 
OString(aStream.str()));
-}
+pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, 
OString(aStream.str()));
 return;
 }
 else if (aEvent.FeatureURL.Path == "StateTableCell")
@@ -1316,14 +1308,13 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 
nSID, SfxViewFrame* pViewFra
 else
 {
 // Try to send JSON state version
-SfxLokHelper::sendUnoStatus(pViewFrame->GetViewShell(), pState);
+SfxLokHelper::sendUnoStatus(pViewShell, pState);
 
 return;
 }
 
 OUString payload = aBuffer.makeStringAndClear();
-if (const SfxViewShell* pViewShell = pViewFrame->GetViewShell())
-pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, 
payload.toUtf8());
+pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, 
payload.toUtf8());
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


core.git: sfx2/source

2024-04-13 Thread Mike Kaganski (via logerrit)
 sfx2/source/appl/appmisc.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 707f59019a5edafb4278a5591f8f6578041f1a3c
Author: Mike Kaganski 
AuthorDate: Sat Apr 13 23:38:03 2024 +0500
Commit: Mike Kaganski 
CommitDate: Sun Apr 14 08:58:56 2024 +0200

Use more o3tl::convert

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

diff --git a/sfx2/source/appl/appmisc.cxx b/sfx2/source/appl/appmisc.cxx
index 01b278b16506..cb793022a62f 100644
--- a/sfx2/source/appl/appmisc.cxx
+++ b/sfx2/source/appl/appmisc.cxx
@@ -170,7 +170,7 @@ bool SfxApplication::loadBrandSvg(const char *pName, 
BitmapEx &rBitmap, int nWid
 // cancel out rasterize's mm2pixel conversion
 // see fFactor100th_mmToInch in
 // drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
-const double fFakeDPI=2.54 * 1000.0;
+constexpr double fFakeDPI = o3tl::convert(1.0, o3tl::Length::in, 
o3tl::Length::mm100);
 
 geometry::RealRectangle2D aRealRect(
 0, 0,


core.git: sfx2/source

2024-04-13 Thread Miklos Vajna (via logerrit)
 sfx2/source/control/unoctitm.cxx |   18 +++---
 1 file changed, 11 insertions(+), 7 deletions(-)

New commits:
commit 1e605412df2ca9aab895b34f256ccd5a8dfdc83d
Author: Miklos Vajna 
AuthorDate: Fri Apr 12 08:52:43 2024 +0200
Commit: Caolán McNamara 
CommitDate: Sat Apr 13 16:52:50 2024 +0200

sfx2: fix crash in InterceptLOKStateChangeEvent()

Notice how e.g. the TransformPosX case already performed the same null
pointer check.

Crashreport backtrace:

> program/libmergedlo.so
>   InterceptLOKStateChangeEvent
>   sfx2/source/control/unoctitm.cxx:1143
> program/libmergedlo.so
>   SfxStateCache::SetState_Impl(SfxItemState, SfxPoolItem const*, bool)
>   sfx2/source/control/statcach.cxx:432
> program/libmergedlo.so
>   SfxBindings::Update_Impl(SfxStateCache&)
>   
/opt/rh/devtoolset-10/root/usr/include/c++/10/bits/stl_vector.h:919 
(discriminator 2)
> program/libmergedlo.so
>   SfxBindings::NextJob_Impl(Timer const*)
>   
/opt/rh/devtoolset-10/root/usr/include/c++/10/bits/unique_ptr.h:173

Change-Id: I141d4f9ec50d0ce7a0eeaba69752c31390a1f9ba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166027
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166046
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 333879c24d0f..f49dc2d7336f 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -1118,13 +1118,17 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 
nSID, SfxViewFrame* pViewFra
 else if (aEvent.FeatureURL.Path == "ParaLeftToRight" ||
  aEvent.FeatureURL.Path == "ParaRightToLeft")
 {
-tools::JsonWriter aTree;
-bool bTemp = false;
-aEvent.State >>= bTemp;
-aTree.put("commandName", aEvent.FeatureURL.Complete);
-aTree.put("disabled", !aEvent.IsEnabled);
-aTree.put("state", bTemp ? "true" : "false");
-
SfxViewShell::Current()->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, 
aTree.finishAndGetAsOString());
+const SfxViewShell* pViewShell = SfxViewShell::Current();
+if (pViewShell)
+{
+tools::JsonWriter aTree;
+bool bTemp = false;
+aEvent.State >>= bTemp;
+aTree.put("commandName", aEvent.FeatureURL.Complete);
+aTree.put("disabled", !aEvent.IsEnabled);
+aTree.put("state", bTemp ? "true" : "false");
+pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, 
aTree.finishAndGetAsOString());
+}
 return;
 }
 else if (aEvent.FeatureURL.Path == "AssignLayout" ||


core.git: sfx2/source

2024-04-08 Thread Armin Le Grand (allotropia) (via logerrit)
 sfx2/source/control/request.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit b4626d809b50f1d5c1aa8a9644dd3913f5b15503
Author: Armin Le Grand (allotropia) 
AuthorDate: Mon Apr 8 11:03:00 2024 +0200
Commit: Armin Le Grand 
CommitDate: Mon Apr 8 17:16:49 2024 +0200

tdf#159719 reset SfxPoolItemHolder when Pool changes

Change-Id: Ic2724c6e03acaa8cfc74dc2aadfac6b13d8561c0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165883
Tested-by: Jenkins
Tested-by: Ilmari Lauhakangas 
Reviewed-by: Ilmari Lauhakangas 
Reviewed-by: Armin Le Grand 

diff --git a/sfx2/source/control/request.cxx b/sfx2/source/control/request.cxx
index 9406ce8b9fd3..e58475c325f1 100644
--- a/sfx2/source/control/request.cxx
+++ b/sfx2/source/control/request.cxx
@@ -109,7 +109,12 @@ void SfxRequest_Impl::SetPool( SfxItemPool *pNewPool )
 {
 if ( pPool )
 EndListening( pPool->BC() );
+
+// tdf#159719 reset SfxPoolItemHolder
+aRetVal = SfxPoolItemHolder();
+
 pPool = pNewPool;
+
 if ( pNewPool )
 StartListening( pNewPool->BC() );
 }


core.git: sfx2/source

2024-04-04 Thread Moritz Duge (via logerrit)
 sfx2/source/dialog/backingwindow.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 30c6e51fc9cb0fa864e1755271343d847fcced25
Author: Moritz Duge 
AuthorDate: Wed Apr 3 21:45:09 2024 +0200
Commit: Thorsten Behrens 
CommitDate: Thu Apr 4 23:23:56 2024 +0200

Remove duplicate code.

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

diff --git a/sfx2/source/dialog/backingwindow.cxx 
b/sfx2/source/dialog/backingwindow.cxx
index 9e30572d12d3..efa18f452d51 100644
--- a/sfx2/source/dialog/backingwindow.cxx
+++ b/sfx2/source/dialog/backingwindow.cxx
@@ -354,7 +354,6 @@ void BackingWindow::ApplyStyleSettings()
 
 // setup larger fonts
 setLargerFont(mxOpenButton, aButtonFont);
-setLargerFont(mxOpenButton, aButtonFont);
 setLargerFont(mxRemoteButton, aButtonFont);
 setLargerFont(mxRecentButton, aButtonFont);
 setLargerFont(mxTemplateButton, aButtonFont);


core.git: sfx2/source

2024-04-04 Thread Stephan Bergmann (via logerrit)
 sfx2/source/dialog/splitwin.cxx |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 219dd67d6ad96e1c05e92e36583391946143dba6
Author: Stephan Bergmann 
AuthorDate: Thu Apr 4 09:53:34 2024 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Apr 4 14:14:26 2024 +0200

-Werror=maybe-uninitialized

...as reported at least with some recent GCC 14 trunk.  Lets assume that 
those
calls to GetWindowPos are never meant to fail.  (If it turns out that they 
can
fail after all, the code would presumably need some modifications to 
mitigate
the uninitialized reads from nL/nP.)

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

diff --git a/sfx2/source/dialog/splitwin.cxx b/sfx2/source/dialog/splitwin.cxx
index 210a9dbeaaff..b9597eacfc79 100644
--- a/sfx2/source/dialog/splitwin.cxx
+++ b/sfx2/source/dialog/splitwin.cxx
@@ -36,6 +36,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -456,7 +457,8 @@ void SfxSplitWindow::InsertWindow( SfxDockingWindow* 
pDockWin, const Size& rSize
 if ( bNewLine && !pFoundDock )
 {
 // Not known until now in which real line it is located
-GetWindowPos( rDock.pWin, nL, nPos );
+[[maybe_unused]] auto const ok = GetWindowPos( rDock.pWin, nL, 
nPos );
+assert(ok);
 nLine = static_cast(nL);
 }
 
@@ -544,7 +546,8 @@ void SfxSplitWindow::MoveWindow( SfxDockingWindow* 
pDockWin, const Size& rSize,
 
 {
 sal_uInt16 nL, nP;
-GetWindowPos( pDockWin, nL, nP );
+[[maybe_unused]] auto const ok = GetWindowPos( pDockWin, nL, nP );
+assert(ok);
 
 if ( nLine > nL && GetItemCount( GetItemId( nL ) ) == 1 )
 {


core.git: sfx2/source

2024-04-03 Thread Gökay Şatır (via logerrit)
 sfx2/source/control/dispatch.cxx |3 +
 sfx2/source/control/unoctitm.cxx |   83 ---
 2 files changed, 3 insertions(+), 83 deletions(-)

New commits:
commit fb471194d04607eb7706f8650f0c92c6e5b8
Author: Gökay Şatır 
AuthorDate: Mon Mar 25 16:49:08 2024 +0300
Commit: Caolán McNamara 
CommitDate: Wed Apr 3 13:07:37 2024 +0200

Use sdi properties for checking uno commands'a availability.

Signed-off-by: Gökay Şatır 
Change-Id: Ie70851756d1a4272876b07fefb876d7e6f8d4d81
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165287
Reviewed-by: Michael Meeks 
Tested-by: Jenkins CollaboraOffice 
(cherry picked from commit 68422af88576a799b22e472c303ed924c360784b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165734
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index ef59094293b9..6ae4d71a6db9 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -1590,6 +1590,9 @@ bool SfxDispatcher::FindServer_(sal_uInt16 nSlot, 
SfxSlotServer& rServer)
 
 bool bReadOnly = ( SfxSlotFilterState::ENABLED_READONLY != nSlotEnableMode 
&& xImp->bReadOnly );
 
+if (!bReadOnly && comphelper::LibreOfficeKit::isActive())
+bReadOnly = xImp->pFrame && xImp->pFrame->GetViewShell() && 
xImp->pFrame->GetViewShell()->IsLokReadOnlyView();
+
 // search through all the shells of the chained dispatchers
 // from top to bottom
 sal_uInt16 nFirstShell = 0;
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 23a370a4240f..333879c24d0f 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -520,83 +520,6 @@ void collectUIInformation(const util::URL& rURL, const 
css::uno::Sequence< css::
 
 }
 
-// Checks if LOK is active and uno command is allowed for the current LOK view.
-static bool isCommandAllowedForViewType(const OUString& command)
-{
-if (SfxViewShell::IsCurrentLokViewReadOnly())
-{
-// This is a sublist of "sUnoCommands".
-constexpr OUString allowedCommandList[] = {
-u"Copy"_ustr,
-u"SelectAll"_ustr,
-u"SelectColumn"_ustr,
-u"SelectRow"_ustr,
-u"EntireRow"_ustr,
-u"EntireColumn"_ustr,
-u"EntireCell"_ustr,
-u"RowColSelCount"_ustr,
-u"SpellOnline"_ustr,
-u"StatePageNumber"_ustr,
-u"StateWordCount"_ustr,
-u"StateTableCell"_ustr,
-u"SelectionMode"_ustr,
-u"PageStatus"_ustr,
-u"LayoutStatus"_ustr,
-u"ToolbarMode"_ustr,
-u"ChangeTheme"_ustr,
-u"CopyHyperlinkLocation"_ustr,
-u"ExportDirectToPDF"_ustr,
-u"ExportToPDF"_ustr,
-u"ExportToEPUB"_ustr,
-u"CharRightSel"_ustr,
-u"CharLeftSel"_ustr,
-u"WordRightSel"_ustr,
-u"WordLeftSel"_ustr,
-u"EndOfParaSel"_ustr,
-u"StartOfParaSel"_ustr,
-u"GoRight"_ustr,
-u"GoLeft"_ustr,
-u"GoToNextWord"_ustr,
-u"GoToPrevWord"_ustr,
-u"GoToNextPara"_ustr,
-u"GoToStartOfPara"_ustr,
-u"GoUp"_ustr,
-u"GoDown"_ustr,
-u"GoRightSel"_ustr,
-u"GoLeftSel"_ustr,
-u"GoUpSel"_ustr,
-u"GoDownSel"_ustr,
-u"GoLeftToStartOfData"_ustr,
-u"GoRightToEndOfData"_ustr,
-u"GoToStart"_ustr,
-u"GoToEndOfData"_ustr,
-u"GoUpToStartOfData"_ustr,
-u"GoDownToEndOfData"_ustr,
-u"GoLeftToStartOfDataSel"_ustr,
-u"GoRightToEndOfDataSel"_ustr,
-u"GoUpToStartOfDataSel"_ustr,
-u"GoDownToEndOfDataSel"_ustr
-};
-
-bool allowed = std::find(std::begin(allowedCommandList), 
std::end(allowedCommandList), command) != std::end(allowedCommandList);
-
-if (!allowed && SfxViewShell::Current() && 
SfxViewShell::Current()->IsAllowChangeComments())
-{
-constexpr OUString allowedCommentCommandList[] = {
-u"InsertAnnotation"_ustr,
-u"DeleteComment"_ustr,
-u"DeleteAnnotation"_ustr,
-u"EditAnnotation"_ustr
-};
-allowed = std::find(std::begin(allowedCommentCommandList), 
std::end(allowedCommentCommandList), command) != 
std::end(allowedCommentCommandList);
-}
-
-return allowed;
-}
-
-return true;
-}
-
 void SfxDispatchController_Impl::dispatch( const css::util::URL& aURL,
 const css::uno::Sequence< css::beans::PropertyValue >& aArgs,
 const css::uno::Reference< css::frame::XDispatchResultListener >& 
rListener )
@@ -623,12 +546,6 @@ void SfxDispatchController_Impl::dispatch( const 
css::util::URL& aU

core.git: sfx2/source

2024-04-03 Thread Gökay Şatır (via logerrit)
 sfx2/source/control/unoctitm.cxx |   30 +-
 1 file changed, 29 insertions(+), 1 deletion(-)

New commits:
commit 5266c1b215263029fe9b35e5365df65d116edf64
Author: Gökay Şatır 
AuthorDate: Fri Mar 22 13:34:38 2024 +0300
Commit: Caolán McNamara 
CommitDate: Wed Apr 3 12:48:41 2024 +0200

Allow more uno commands in readonly view mode.

So user can use keyboard for selection.

Signed-off-by: Gökay Şatır 
Change-Id: Ic7812c88110da9fbefe86d145f921e48360b4f34
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165157
Reviewed-by: Michael Meeks 
Tested-by: Jenkins CollaboraOffice 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165733
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index d81b191d8623..23a370a4240f 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -547,7 +547,35 @@ static bool isCommandAllowedForViewType(const OUString& 
command)
 u"CopyHyperlinkLocation"_ustr,
 u"ExportDirectToPDF"_ustr,
 u"ExportToPDF"_ustr,
-u"ExportToEPUB"_ustr
+u"ExportToEPUB"_ustr,
+u"CharRightSel"_ustr,
+u"CharLeftSel"_ustr,
+u"WordRightSel"_ustr,
+u"WordLeftSel"_ustr,
+u"EndOfParaSel"_ustr,
+u"StartOfParaSel"_ustr,
+u"GoRight"_ustr,
+u"GoLeft"_ustr,
+u"GoToNextWord"_ustr,
+u"GoToPrevWord"_ustr,
+u"GoToNextPara"_ustr,
+u"GoToStartOfPara"_ustr,
+u"GoUp"_ustr,
+u"GoDown"_ustr,
+u"GoRightSel"_ustr,
+u"GoLeftSel"_ustr,
+u"GoUpSel"_ustr,
+u"GoDownSel"_ustr,
+u"GoLeftToStartOfData"_ustr,
+u"GoRightToEndOfData"_ustr,
+u"GoToStart"_ustr,
+u"GoToEndOfData"_ustr,
+u"GoUpToStartOfData"_ustr,
+u"GoDownToEndOfData"_ustr,
+u"GoLeftToStartOfDataSel"_ustr,
+u"GoRightToEndOfDataSel"_ustr,
+u"GoUpToStartOfDataSel"_ustr,
+u"GoDownToEndOfDataSel"_ustr
 };
 
 bool allowed = std::find(std::begin(allowedCommandList), 
std::end(allowedCommandList), command) != std::end(allowedCommandList);


core.git: sfx2/source

2024-04-01 Thread Gabor Kelemen (via logerrit)
 sfx2/source/appl/appbas.cxx|1 -
 sfx2/source/appl/appbaslib.cxx |1 -
 sfx2/source/appl/appcfg.cxx|2 --
 sfx2/source/appl/appmisc.cxx   |1 -
 sfx2/source/appl/newhelp.cxx   |1 -
 sfx2/source/appl/opengrf.cxx   |1 -
 sfx2/source/appl/sfxhelp.cxx   |2 --
 sfx2/source/appl/sfxpicklist.cxx   |2 --
 sfx2/source/bastyp/helper.cxx  |1 -
 sfx2/source/control/recentdocsview.cxx |2 --
 sfx2/source/control/thumbnailview.cxx  |1 -
 sfx2/source/dialog/mailmodel.cxx   |1 -
 sfx2/source/doc/objmisc.cxx|1 -
 sfx2/source/doc/objserv.cxx|1 -
 sfx2/source/doc/objstor.cxx|1 -
 sfx2/source/doc/templatedlg.cxx|1 -
 sfx2/source/inet/inettbc.cxx   |1 -
 sfx2/source/sidebar/ControllerItem.cxx |1 -
 sfx2/source/sidebar/Deck.cxx   |1 -
 sfx2/source/toolbox/tbxitem.cxx|3 ---
 sfx2/source/view/frame2.cxx|2 --
 sfx2/source/view/viewfrm2.cxx  |2 --
 sfx2/source/view/viewsh.cxx|1 -
 23 files changed, 31 deletions(-)

New commits:
commit b77ad21d445783d77697470796be5c43f9fc5cd3
Author: Gabor Kelemen 
AuthorDate: Fri Mar 29 14:07:48 2024 +0100
Commit: Gabor Kelemen 
CommitDate: Tue Apr 2 08:32:20 2024 +0200

tdf#146619 Drop unused 'using namespace' in: sfx2/

Change-Id: I3748612644c9c4eb88d7fb6e2d512954de9c1002
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165538
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen 

diff --git a/sfx2/source/appl/appbas.cxx b/sfx2/source/appl/appbas.cxx
index d26f9577ee27..8929ccf908cf 100644
--- a/sfx2/source/appl/appbas.cxx
+++ b/sfx2/source/appl/appbas.cxx
@@ -48,7 +48,6 @@
 #include 
 
 using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::script;
 
 using ::basic::BasicManagerRepository;
diff --git a/sfx2/source/appl/appbaslib.cxx b/sfx2/source/appl/appbaslib.cxx
index bfeafa1b1b60..2d32e59ee9bc 100644
--- a/sfx2/source/appl/appbaslib.cxx
+++ b/sfx2/source/appl/appbaslib.cxx
@@ -28,7 +28,6 @@
 #include 
 
 using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
 using namespace ::com::sun::star::script;
 using namespace ::com::sun::star::embed;
 
diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx
index f18b93792236..074ad93b6f74 100644
--- a/sfx2/source/appl/appcfg.cxx
+++ b/sfx2/source/appl/appcfg.cxx
@@ -52,8 +52,6 @@
 #include "shutdownicon.hxx"
 
 using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::util;
-using namespace ::com::sun::star::beans;
 
 namespace {
 
diff --git a/sfx2/source/appl/appmisc.cxx b/sfx2/source/appl/appmisc.cxx
index 948a1de40fd0..01b278b16506 100644
--- a/sfx2/source/appl/appmisc.cxx
+++ b/sfx2/source/appl/appmisc.cxx
@@ -52,7 +52,6 @@ using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::util;
 using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::container;
 
 SFX_IMPL_INTERFACE(SfxApplication,SfxShell)
 
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index 7e51602371c1..925ed3a808ad 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -104,7 +104,6 @@ using namespace ::com::sun::star::text;
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::util;
 using namespace ::com::sun::star::view;
-using namespace ::com::sun::star::ui;
 
 using namespace ::comphelper;
 
diff --git a/sfx2/source/appl/opengrf.cxx b/sfx2/source/appl/opengrf.cxx
index 3c94ca7ffbc5..16e0731f310b 100644
--- a/sfx2/source/appl/opengrf.cxx
+++ b/sfx2/source/appl/opengrf.cxx
@@ -44,7 +44,6 @@ using namespace ::com::sun::star;
 using namespace ::com::sun::star::lang;
 using namespace ::com::sun::star::ui::dialogs;
 using namespace ::com::sun::star::uno;
-using namespace ::cppu;
 
 static TranslateId SvxOpenGrfErr2ResId( ErrCode err )
 {
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index b297c27578dd..85d60828d2ba 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -83,8 +83,6 @@
 using namespace ::com::sun::star::beans;
 using namespace ::com::sun::star::frame;
 using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::util;
-using namespace ::com::sun::star::lang;
 
 namespace {
 
diff --git a/sfx2/source/appl/sfxpicklist.cxx b/sfx2/source/appl/sfxpicklist.cxx
index 9453d8ee8b2c..bd7a0a091189 100644
--- a/sfx2/source/appl/sfxpicklist.cxx
+++ b/sfx2/source/appl/sfxpicklist.cxx
@@ -42,8 +42,6 @@
 
 
 using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::util;
 
 class SfxPickListImpl : public SfxListener
 {
diff --git a/sfx2/source/bastyp/helper.cxx b/sfx2/source/bastyp/helper.cxx
index 272bffcbae66..cd296331b

core.git: sfx2/source

2024-03-30 Thread Noel Grandin (via logerrit)
 sfx2/source/doc/SfxDocumentMetaData.cxx |  391 
 1 file changed, 197 insertions(+), 194 deletions(-)

New commits:
commit 35fbe29161871b107f0aabf810a2537df378374d
Author: Noel Grandin 
AuthorDate: Sat Mar 30 21:11:09 2024 +0200
Commit: Noel Grandin 
CommitDate: Sun Mar 31 08:21:20 2024 +0200

Convert SfxDocumentMetaData to comphelper::WeakComponentImplHelper

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

diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx 
b/sfx2/source/doc/SfxDocumentMetaData.cxx
index 35f769dd14a5..7ebd0842e092 100644
--- a/sfx2/source/doc/SfxDocumentMetaData.cxx
+++ b/sfx2/source/doc/SfxDocumentMetaData.cxx
@@ -20,7 +20,7 @@
 #include 
 #include 
 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -67,7 +67,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -122,7 +121,7 @@ namespace {
 typedef std::vector > >
 AttrVector;
 
-typedef ::cppu::WeakComponentImplHelper<
+typedef ::comphelper::WeakComponentImplHelper<
 css::lang::XServiceInfo,
 css::document::XDocumentProperties2,
 css::lang::XInitialization,
@@ -132,7 +131,6 @@ typedef ::cppu::WeakComponentImplHelper<
 SfxDocumentMetaData_Base;
 
 class SfxDocumentMetaData:
-private ::cppu::BaseMutex,
 public SfxDocumentMetaData_Base
 {
 public:
@@ -149,7 +147,7 @@ public:
 getSupportedServiceNames() override;
 
 // css::lang::XComponent:
-virtual void SAL_CALL dispose() override;
+virtual void disposing(std::unique_lock& rGuard) override;
 
 // css::document::XDocumentProperties:
 virtual OUString SAL_CALL getAuthor() override;
@@ -257,7 +255,7 @@ protected:
 const css::uno::Reference< css::uno::XComponentContext > m_xContext;
 
 /// for notification
-::comphelper::OInterfaceContainerHelper3 
m_NotifyListeners;
+::comphelper::OInterfaceContainerHelper4 
m_NotifyListeners;
 /// flag: false means not initialized yet, or disposed
 bool m_isInitialized;
 /// flag
@@ -284,38 +282,42 @@ protected:
 OUString m_DefaultTarget;
 
 /// check if we are initialized properly
-void checkInit() const;
+void checkInit(std::unique_lock& rGuard) const;
 /// initialize state from given DOM tree
-void init(const css::uno::Reference& i_xDom);
+void init(std::unique_lock& rGuard, const 
css::uno::Reference& i_xDom);
 /// update element in DOM tree
-void updateElement(const OUString & i_name,
+void updateElement(std::unique_lock& rGuard,
+const OUString & i_name,
 std::vector >* i_pAttrs = nullptr);
 /// update user-defined meta data and attributes in DOM tree
-void updateUserDefinedAndAttributes();
+void updateUserDefinedAndAttributes(std::unique_lock& rGuard);
 /// create empty DOM tree (XDocument)
 css::uno::Reference createDOM() const;
 /// extract base URL (necessary for converting relative links)
 css::uno::Reference getURLProperties(
+std::unique_lock& rGuard,
 const css::uno::Sequence & i_rMedium) const;
 /// get text of standard meta data element
-OUString getMetaText(const char* i_name) const;
+OUString getMetaText(std::unique_lock& rGuard, const char* 
i_name) const;
 /// set text of standard meta data element iff not equal to existing text
-bool setMetaText(const OUString& i_name,
+bool setMetaText(std::unique_lock& g, const OUString& i_name,
 const OUString & i_rValue);
 /// set text of standard meta data element iff not equal to existing text
 void setMetaTextAndNotify(const OUString& i_name,
 const OUString & i_rValue);
 /// get text of standard meta data element's attribute
-OUString getMetaAttr(const OUString& i_name,
+OUString getMetaAttr(std::unique_lock& rGuard,
+const OUString& i_name,
 const OUString& i_attr) const;
 /// get text of a list of standard meta data elements (multiple occ.)
 css::uno::Sequence< OUString > getMetaList(
+std::unique_lock& rGuard,
 const char* i_name) const;
 /// set text of a list of standard meta data elements (multiple occ.)
-bool setMetaList(const OUString& i_name,
+bool setMetaList(std::unique_lock& rGuard, const OUString& 
i_name,
 const css::uno::Sequence< OUString > & i_rValue,
 AttrVector const*);
-void createUserDefined();
+void createUserDefined(std::unique_lock& rGuard);
 };
 
 typedef ::cppu::ImplInheritanceHelper< SfxDocumentMetaData, 
css::document::XCompatWriterDocProperties > CompatWriterDocPropsImpl_BASE;
@@ -606,6 +608,7 @@ OUString durationToText(sal_Int32 i_value) noexcept
 // extract base URL (necessary for converting relative links)
 css::uno::Reference< css::beans::XPropertySet >
 SfxDocumentMetaData::getURLProperties(
+std::uniq

core.git: sfx2/source

2024-03-28 Thread Caolán McNamara (via logerrit)
 sfx2/source/sidebar/SidebarDockingWindow.cxx |  117 +--
 1 file changed, 60 insertions(+), 57 deletions(-)

New commits:
commit d4d923f9db926d8b0b6eb3bb7b62f5a7a520c00d
Author: Caolán McNamara 
AuthorDate: Thu Mar 28 11:23:56 2024 +
Commit: Caolán McNamara 
CommitDate: Thu Mar 28 15:53:08 2024 +0100

null deref of mpSidebarController

follow the pattern used in the rest of this and skip the branch
that depends on mpSidebarController existing

git show -w

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

diff --git a/sfx2/source/sidebar/SidebarDockingWindow.cxx 
b/sfx2/source/sidebar/SidebarDockingWindow.cxx
index 23c3b459c3be..d0edf8066332 100644
--- a/sfx2/source/sidebar/SidebarDockingWindow.cxx
+++ b/sfx2/source/sidebar/SidebarDockingWindow.cxx
@@ -136,75 +136,78 @@ SfxChildAlignment SidebarDockingWindow::CheckAlignment (
 
 bool SidebarDockingWindow::EventNotify(NotifyEvent& rEvent)
 {
-NotifyEventType nType = rEvent.GetType();
-if (NotifyEventType::KEYINPUT == nType)
+if (mpSidebarController)
 {
-const vcl::KeyCode& rKeyCode = rEvent.GetKeyEvent()->GetKeyCode();
-switch (rKeyCode.GetCode())
+NotifyEventType nType = rEvent.GetType();
+if (NotifyEventType::KEYINPUT == nType)
 {
-case KEY_UP:
-case KEY_DOWN:
-case KEY_PAGEUP:
-case KEY_PAGEDOWN:
-case KEY_HOME:
-case KEY_END:
-case KEY_LEFT:
-case KEY_RIGHT:
-case KEY_BACKSPACE:
-case KEY_DELETE:
-case KEY_INSERT:
-case KEY_RETURN:
-case KEY_ESCAPE:
+const vcl::KeyCode& rKeyCode = rEvent.GetKeyEvent()->GetKeyCode();
+switch (rKeyCode.GetCode())
 {
+case KEY_UP:
+case KEY_DOWN:
+case KEY_PAGEUP:
+case KEY_PAGEDOWN:
+case KEY_HOME:
+case KEY_END:
+case KEY_LEFT:
+case KEY_RIGHT:
+case KEY_BACKSPACE:
+case KEY_DELETE:
+case KEY_INSERT:
+case KEY_RETURN:
+case KEY_ESCAPE:
+{
+return true;
+}
+default:
+break;
+}
+if (!mpAccel)
+{
+mpAccel = svt::AcceleratorExecute::createAcceleratorHelper();
+mpAccel->init(comphelper::getProcessComponentContext(), 
mpSidebarController->getXFrame());
+}
+const OUString 
aCommand(mpAccel->findCommand(svt::AcceleratorExecute::st_VCLKey2AWTKey(rKeyCode)));
+if (".uno:DesignerDialog" == aCommand)
+{
+std::shared_ptr xPanelDescriptor =
+
mpSidebarController->GetResourceManager()->GetPanelDescriptor( 
u"StyleListPanel" );
+if ( xPanelDescriptor && mpSidebarController->IsDeckVisible( 
xPanelDescriptor->msDeckId ) )
+Close();
+return true;
+}
+if (".uno:Undo" == aCommand || ".uno:Redo" == aCommand)
+{
+comphelper::dispatchCommand(aCommand, {});
 return true;
 }
-default:
-break;
-}
-if (!mpAccel)
-{
-mpAccel = svt::AcceleratorExecute::createAcceleratorHelper();
-mpAccel->init(comphelper::getProcessComponentContext(), 
mpSidebarController->getXFrame());
-}
-const OUString 
aCommand(mpAccel->findCommand(svt::AcceleratorExecute::st_VCLKey2AWTKey(rKeyCode)));
-if (".uno:DesignerDialog" == aCommand)
-{
-std::shared_ptr xPanelDescriptor =
-
mpSidebarController->GetResourceManager()->GetPanelDescriptor( 
u"StyleListPanel" );
-if ( xPanelDescriptor && mpSidebarController->IsDeckVisible( 
xPanelDescriptor->msDeckId ) )
-Close();
-return true;
 }
-if (".uno:Undo" == aCommand || ".uno:Redo" == aCommand)
+else if (NotifyEventType::MOUSEBUTTONDOWN == nType)
 {
-comphelper::dispatchCommand(aCommand, {});
-return true;
+const MouseEvent *mEvt = rEvent.GetMouseEvent();
+if (mEvt->IsLeft())
+{
+tools::Rectangle aGrip = 
mpSidebarController->GetDeckDragArea();
+if ( aGrip.Contains( mEvt->GetPosPixel() ) )
+mbIsReadyToDrag = true;
+}
 }
-}
-else if (NotifyEventType::MOUSEBUTTONDOWN == nType)
-{
-const MouseEvent *mEvt = rEvent.GetMouseEvent();
-if (mEvt->IsLeft())
+else if (NotifyE

core.git: sfx2/source

2024-03-28 Thread Caolán McNamara (via logerrit)
 sfx2/source/view/viewfrm.cxx |   63 ---
 1 file changed, 36 insertions(+), 27 deletions(-)

New commits:
commit 64a5509d9aef88c04dbaad7f553c2b83b23c045a
Author: Caolán McNamara 
AuthorDate: Wed Mar 27 16:42:48 2024 +
Commit: Caolán McNamara 
CommitDate: Thu Mar 28 09:54:58 2024 +0100

show this infobar regardless of the exact reason for presenting it

Change-Id: I8af248efe8f9dda868e2f126beead875e391b563
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165402
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 222eb0ff96ec..71ea0e92d4dc 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -1344,6 +1344,32 @@ void SfxViewFrame::AppendContainsMacrosInfobar()
 {
 SfxObjectShell_Impl* pObjImpl = m_xObjSh->Get_Impl();
 
+auto aResId = STR_CONTAINS_MACROS;
+if (SvtSecurityOptions::IsMacroDisabled())
+aResId = STR_MACROS_DISABLED;
+else if (pObjImpl->aMacroMode.hasUnsignedContentError())
+aResId = STR_MACROS_DISABLED_CONTENT_UNSIGNED;
+// The idea here is to always present an infobar is there was some
+// macro/script related potential hazard disabled in the source document
+auto pInfoBar = AppendInfoBar("macro", SfxResId(STR_MACROS_DISABLED_TITLE),
+  SfxResId(aResId), InfobarType::WARNING);
+if (!pInfoBar)
+return;
+
+// Then show buttons to help navigate to whatever that hazard is.  Whether
+// that is included macros, so the user could delete them.  Or events bound
+// to scripts which could be cleared.  But there are likely other cases not
+// captured here, which could be added, various blocked features where its
+// likely still worth displaying the infobar that they have been disabled,
+// even if we don't currently provide a way to indicate what exactly those
+// are and how to remove them.
+
+// No access to macro dialog when macros are disabled globally, so return
+// early without adding buttons to help explore what the 
macros/script/events
+// might be.
+if (SvtSecurityOptions::IsMacroDisabled())
+return;
+
 // what's the difference between pObjImpl->documentStorageHasMacros() and 
pObjImpl->aMacroMode.hasMacroLibrary() ?
 bool bHasDocumentMacros = pObjImpl->aMacroMode.hasMacroLibrary();
 
@@ -1380,35 +1406,18 @@ void SfxViewFrame::AppendContainsMacrosInfobar()
 }
 }
 
-if (bHasDocumentMacros || bHasBoundConfigEvents)
+if (bHasDocumentMacros)
 {
-auto aResId = STR_CONTAINS_MACROS;
-if (SvtSecurityOptions::IsMacroDisabled())
-aResId = STR_MACROS_DISABLED;
-else if (pObjImpl->aMacroMode.hasUnsignedContentError())
-aResId = STR_MACROS_DISABLED_CONTENT_UNSIGNED;
-auto pInfoBar = AppendInfoBar("macro", 
SfxResId(STR_MACROS_DISABLED_TITLE),
-  SfxResId(aResId), InfobarType::WARNING);
-if (!pInfoBar)
-return;
-
-// No access to macro dialog when macros are disabled globally.
-if (SvtSecurityOptions::IsMacroDisabled())
-return;
-
-if (bHasDocumentMacros)
-{
-weld::Button& rMacroButton = pInfoBar->addButton();
-rMacroButton.set_label(SfxResId(STR_MACROS));
-rMacroButton.connect_clicked(LINK(this, SfxViewFrame, 
MacroButtonHandler));
-}
+weld::Button& rMacroButton = pInfoBar->addButton();
+rMacroButton.set_label(SfxResId(STR_MACROS));
+rMacroButton.connect_clicked(LINK(this, SfxViewFrame, 
MacroButtonHandler));
+}
 
-if (bHasBoundConfigEvents)
-{
-weld::Button& rEventButton = pInfoBar->addButton();
-rEventButton.set_label(SfxResId(STR_EVENTS));
-rEventButton.connect_clicked(LINK(this, SfxViewFrame, 
EventButtonHandler));
-}
+if (bHasBoundConfigEvents)
+{
+weld::Button& rEventButton = pInfoBar->addButton();
+rEventButton.set_label(SfxResId(STR_EVENTS));
+rEventButton.connect_clicked(LINK(this, SfxViewFrame, 
EventButtonHandler));
 }
 }
 


core.git: sfx2/source

2024-03-27 Thread Gökay Şatır (via logerrit)
 sfx2/source/control/unoctitm.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit d5dccc8780c737c0f23164fd98669303e61ba737
Author: Gökay Şatır 
AuthorDate: Mon Mar 18 15:17:32 2024 +0300
Commit: Miklos Vajna 
CommitDate: Wed Mar 27 16:57:06 2024 +0100

Allow export commands in readonly view mode.

(cherry picked from commit 5c8c5db55e082eed3422e3fb9455943b2f285253)

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

diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index f8c62b3dae19..d81b191d8623 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -544,7 +544,10 @@ static bool isCommandAllowedForViewType(const OUString& 
command)
 u"LayoutStatus"_ustr,
 u"ToolbarMode"_ustr,
 u"ChangeTheme"_ustr,
-u"CopyHyperlinkLocation"_ustr
+u"CopyHyperlinkLocation"_ustr,
+u"ExportDirectToPDF"_ustr,
+u"ExportToPDF"_ustr,
+u"ExportToEPUB"_ustr
 };
 
 bool allowed = std::find(std::begin(allowedCommandList), 
std::end(allowedCommandList), command) != std::end(allowedCommandList);


core.git: sfx2/source

2024-03-27 Thread Darshan11 (via logerrit)
 sfx2/source/control/unoctitm.cxx |   14 --
 1 file changed, 12 insertions(+), 2 deletions(-)

New commits:
commit a69e32a0ca800642a3fb542c0a49a13ba04faecc
Author: Darshan11 
AuthorDate: Wed Mar 13 16:34:38 2024 +0530
Commit: Caolán McNamara 
CommitDate: Wed Mar 27 13:09:37 2024 +0100

Send ParaRightToLeft state messageto client side

 - Before this patch in online text in paragraph was changing according to 
uno command but client was not getting and info about is RTL true or TRL true
 - this will send message [:unoParaRightToLeft=true || 
:unoParaLeftToRight=true] at client side
 - added more properties like disabled and state information to handle both 
case at same time in online
 - which will be helpful to our existing locgic where to add or from where 
to remove selected class on element according to response
Change-Id: Ia443215342d6a81f4e60fa9237149f6b18420e16

Change-Id: I08fb7e474e099822b26c732fe1e5dac8e773c58f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164767
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164817
(cherry picked from commit fa93750070793cd548d028feb39e4d0e0e61ae5a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165324
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 1068b28e0ac8..f8c62b3dae19 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -1096,8 +1096,6 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 nSID, 
SfxViewFrame* pViewFra
  aEvent.FeatureURL.Path == "DeleteNote" ||
  aEvent.FeatureURL.Path == "AcceptChanges" ||
  aEvent.FeatureURL.Path == "SetDefault" ||
- aEvent.FeatureURL.Path == "ParaLeftToRight" ||
- aEvent.FeatureURL.Path == "ParaRightToLeft" ||
  aEvent.FeatureURL.Path == "ParaspaceIncrease" ||
  aEvent.FeatureURL.Path == "ParaspaceDecrease" ||
  aEvent.FeatureURL.Path == "TableDialog" ||
@@ -1169,6 +1167,18 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 
nSID, SfxViewFrame* pViewFra
 {
 aBuffer.append(aEvent.IsEnabled ? std::u16string_view(u"enabled") : 
std::u16string_view(u"disabled"));
 }
+else if (aEvent.FeatureURL.Path == "ParaLeftToRight" ||
+ aEvent.FeatureURL.Path == "ParaRightToLeft")
+{
+tools::JsonWriter aTree;
+bool bTemp = false;
+aEvent.State >>= bTemp;
+aTree.put("commandName", aEvent.FeatureURL.Complete);
+aTree.put("disabled", !aEvent.IsEnabled);
+aTree.put("state", bTemp ? "true" : "false");
+
SfxViewShell::Current()->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, 
aTree.finishAndGetAsOString());
+return;
+}
 else if (aEvent.FeatureURL.Path == "AssignLayout" ||
  aEvent.FeatureURL.Path == "StatusSelectionMode" ||
  aEvent.FeatureURL.Path == "Signature" ||


core.git: sfx2/source

2024-03-24 Thread Tomoyuki Kubota (via logerrit)
 sfx2/source/sidebar/DeckTitleBar.cxx |2 +-
 sfx2/source/sidebar/Panel.cxx|2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit ee2afff68ed5b22b2bf635d536584e8cba4ae2a4
Author: Tomoyuki Kubota 
AuthorDate: Sun Mar 24 12:07:07 2024 +0100
Commit: Noel Grandin 
CommitDate: Sun Mar 24 17:05:25 2024 +0100

for OSL_DEBUG_LEVEL >= 2, adapt to b55bf0cbdfdc6820

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

diff --git a/sfx2/source/sidebar/DeckTitleBar.cxx 
b/sfx2/source/sidebar/DeckTitleBar.cxx
index f425e21a92bc..f62ec6491f40 100644
--- a/sfx2/source/sidebar/DeckTitleBar.cxx
+++ b/sfx2/source/sidebar/DeckTitleBar.cxx
@@ -27,7 +27,7 @@
 #include 
 
 #if OSL_DEBUG_LEVEL >= 2
-#include 
+#include 
 #endif
 
 namespace sfx2::sidebar {
diff --git a/sfx2/source/sidebar/Panel.cxx b/sfx2/source/sidebar/Panel.cxx
index 6bc1424e7d41..1a087e177b78 100644
--- a/sfx2/source/sidebar/Panel.cxx
+++ b/sfx2/source/sidebar/Panel.cxx
@@ -28,7 +28,7 @@
 
 
 #if OSL_DEBUG_LEVEL >= 2
-#include 
+#include 
 #include 
 #endif
 


core.git: sfx2/source

2024-03-18 Thread Justin Luth (via logerrit)
 sfx2/source/doc/docfile.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 5441ed518d36ac12a6bd0c517e2cfc24aff94d50
Author: Justin Luth 
AuthorDate: Thu Mar 14 11:29:08 2024 -0400
Commit: Miklos Vajna 
CommitDate: Mon Mar 18 14:20:38 2024 +0100

tdf#40244 tdf#160192: create tempFile elsewhere if LogicBase is RO

This avoids a crash/infinite loop in specific read-only folder
situation (where the lock file already exists).

It also fixes ODF files giving three misleading/unclear
notices when attempting to save into a read-only folder.

When LO saves a file, it saves to a temporary file
and then moves that file overtop of the previous one, IIUC.

Prior to 6.1 5259ab8104cfba60c40748ed0cd59d93df038c5b
that temporary file was stored in the /tmp directory (IIUC),
but was changed to be in the same folder for easier renaming,
same filesystem etc.

Note that typically this situation would fail
since a locking file also could not be created.
However in the case where the lock file already exists,
then all the pieces are in place to actually modify the document.

By falling back to the /tmp folder if the document's folder
is read-only, we can still modify a writeable document.

Change-Id: Ie027fc05934f2c071f7a91007255801c179bff49
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164841
Tested-by: Jenkins
Reviewed-by: Justin Luth 
Reviewed-by: Miklos Vajna 

diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index c90fb794f690..b58d27c95fa4 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -4038,6 +4038,8 @@ void SfxMedium::CreateTempFile( bool bReplace )
 
 OUString aLogicBase = GetLogicBase(GetURLObject(), pImpl);
 pImpl->pTempFile.reset(new ::utl::TempFileNamed(&aLogicBase));
+if (!aLogicBase.isEmpty() && pImpl->pTempFile->GetFileName().isEmpty())
+pImpl->pTempFile.reset(new ::utl::TempFileNamed());
 pImpl->pTempFile->EnableKillingFile();
 pImpl->m_aName = pImpl->pTempFile->GetFileName();
 OUString aTmpURL = pImpl->pTempFile->GetURL();
@@ -4134,6 +4136,8 @@ void SfxMedium::CreateTempFileNoCopy()
 
 OUString aLogicBase = GetLogicBase(GetURLObject(), pImpl);
 pImpl->pTempFile.reset(new ::utl::TempFileNamed(&aLogicBase));
+if (!aLogicBase.isEmpty() && pImpl->pTempFile->GetFileName().isEmpty())
+pImpl->pTempFile.reset(new ::utl::TempFileNamed());
 pImpl->pTempFile->EnableKillingFile();
 pImpl->m_aName = pImpl->pTempFile->GetFileName();
 if ( pImpl->m_aName.isEmpty() )


core.git: sfx2/source

2024-03-15 Thread Justin Luth (via logerrit)
 sfx2/source/doc/oleprops.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c615fba780da5ac3073fe5a00848824f59ee376a
Author: Justin Luth 
AuthorDate: Thu Mar 14 12:29:25 2024 -0400
Commit: Justin Luth 
CommitDate: Fri Mar 15 21:57:44 2024 +0100

tdf#160192: avoid hang when trying to overwrite doc/lockfile in RO dir

Bug exposed with 6.1 5259ab8104cfba60c40748ed0cd59d93df038c5b
sfx2 store: create temp files next to local files

tested on .doc format, code-read suggests it affects xls/ppt too,
but they throw exceptions, apparently before hitting this section.

I was seeing an infinite loop on SfxOleSection::SaveProperty's
while((rStrm.Tell() & 3))
rStrm.WriteUChar( 0 );

because nothing checks to confirm that the tempfile
is actually created/useable.

Now, instead of an infinite loop, we get a crash...

Change-Id: I9e093432361a8ad6f928ec9b47290274b3d4ef06
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164840
Reviewed-by: Julien Nabet 
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/sfx2/source/doc/oleprops.cxx b/sfx2/source/doc/oleprops.cxx
index 891110c43780..714f58c2f1af 100644
--- a/sfx2/source/doc/oleprops.cxx
+++ b/sfx2/source/doc/oleprops.cxx
@@ -1110,7 +1110,7 @@ ErrCode const & SfxOlePropertySet::SavePropertySet( 
SotStorage* pStrg, const OUS
 if( pStrg )
 {
 rtl::Reference xStrm = pStrg->OpenSotStream( 
rStrmName, StreamMode::TRUNC | StreamMode::STD_WRITE );
-if( xStrm.is() )
+if (xStrm.is() && xStrm->IsWritable())
 Save( *xStrm );
 else
 SetError( ERRCODE_IO_ACCESSDENIED );


core.git: sfx2/source

2024-03-13 Thread Noel Grandin (via logerrit)
 sfx2/source/control/request.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 8d76c5bc29b8ed4cb616bed845acc30b96a38c77
Author: Noel Grandin 
AuthorDate: Tue Mar 12 21:23:39 2024 +0200
Commit: Noel Grandin 
CommitDate: Wed Mar 13 08:15:06 2024 +0100

remove DBG_ASSERT

this is testing the wrong thing anyway. I briefly converted it
to a real assert, but surprise surprise, real code appears to
now rely on being able to set this more than once, so just remove
it.

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

diff --git a/sfx2/source/control/request.cxx b/sfx2/source/control/request.cxx
index f6b7645fef13..9406ce8b9fd3 100644
--- a/sfx2/source/control/request.cxx
+++ b/sfx2/source/control/request.cxx
@@ -418,7 +418,6 @@ void SfxRequest::RemoveItem( sal_uInt16 nID )
 
 void SfxRequest::SetReturnValue(const SfxPoolItem &rItem)
 {
-DBG_ASSERT(!pImpl, "Set Return value multiple times?");
 DBG_ASSERT(nullptr != pImpl->pPool, "Missing SfxItemPool (!)");
 if (nullptr != pImpl->pPool)
 pImpl->aRetVal = SfxPoolItemHolder(*pImpl->pPool, &rItem);


core.git: sfx2/source svx/source sw/source

2024-03-12 Thread Jaume Pujantell (via logerrit)
 sfx2/source/appl/module.cxx |   14 +-
 sfx2/source/dialog/mgetempl.cxx |4 +---
 sfx2/source/sidebar/ControllerItem.cxx  |   12 
 svx/source/sidebar/paragraph/ParaPropertyPanel.cxx  |4 +---
 svx/source/sidebar/possize/PosSizePropertyPanel.cxx |4 +---
 sw/source/uibase/sidebar/PageFormatPanel.cxx|4 +---
 6 files changed, 25 insertions(+), 17 deletions(-)

New commits:
commit e2708fecb34fb4084f8db5f2c5ffb4d8923002ca
Author: Jaume Pujantell 
AuthorDate: Fri Mar 8 16:24:11 2024 +0100
Commit: Miklos Vajna 
CommitDate: Tue Mar 12 08:34:39 2024 +0100

lok: use locale units in dialogs and sidebar

When oepning tha same doucment with different locales, the dailogs and
sidebar show units (cm/inch) of the first locale (or the locale used in
preloading, en-US) for all the views.

This patch changes the units used according to the LOK locale.

Change-Id: I3d515873bde661f2d9048bbc405843e83134cca7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164589
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 
(cherry picked from commit 3ca938a25439d6f23bbd6830a96e5180ff94f757)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164619
Tested-by: Jenkins

diff --git a/sfx2/source/appl/module.cxx b/sfx2/source/appl/module.cxx
index 03f4fc2fa8f5..b610c2ee8e2a 100644
--- a/sfx2/source/appl/module.cxx
+++ b/sfx2/source/appl/module.cxx
@@ -32,6 +32,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #define ShellClass_SfxModule
 #include 
@@ -245,11 +247,7 @@ FieldUnit SfxModule::GetCurrentFieldUnit()
 FieldUnit eUnit = FieldUnit::INCH;
 SfxModule* pModule = GetActiveModule();
 if ( pModule )
-{
-const SfxPoolItem* pItem = pModule->GetItem( SID_ATTR_METRIC );
-if ( pItem )
-eUnit = static_cast(static_cast(pItem)->GetValue());
-}
+return pModule->GetFieldUnit();
 else
 SAL_WARN( "sfx.appl", "GetModuleFieldUnit(): no module found" );
 return eUnit;
@@ -257,6 +255,12 @@ FieldUnit SfxModule::GetCurrentFieldUnit()
 
 FieldUnit SfxModule::GetFieldUnit() const
 {
+if (comphelper::LibreOfficeKit::isActive())
+{
+MeasurementSystem eSystem
+= 
LocaleDataWrapper(comphelper::LibreOfficeKit::getLocale()).getMeasurementSystemEnum();
+return MeasurementSystem::Metric == eSystem ? FieldUnit::CM : 
FieldUnit::INCH;
+}
 FieldUnit eUnit = FieldUnit::INCH;
 const SfxPoolItem* pItem = GetItem( SID_ATTR_METRIC );
 if ( pItem )
diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx
index 977c5e8a93dd..ef97d253bd88 100644
--- a/sfx2/source/dialog/mgetempl.cxx
+++ b/sfx2/source/dialog/mgetempl.cxx
@@ -301,9 +301,7 @@ void SfxManageStyleSheetPage::SetDescriptionText_Impl()
 SfxModule* pModule = SfxModule::GetActiveModule();
 if ( pModule )
 {
-const SfxPoolItem* pPoolItem = pModule->GetItem( SID_ATTR_METRIC );
-if ( pPoolItem )
-eFieldUnit = static_cast(static_cast( pPoolItem )->GetValue());
+eFieldUnit = pModule->GetFieldUnit();
 }
 
 switch ( eFieldUnit )
diff --git a/sfx2/source/sidebar/ControllerItem.cxx 
b/sfx2/source/sidebar/ControllerItem.cxx
index e02276ec0cdd..28248710f1a6 100644
--- a/sfx2/source/sidebar/ControllerItem.cxx
+++ b/sfx2/source/sidebar/ControllerItem.cxx
@@ -20,6 +20,11 @@
 #include 
 
 #include 
+#include 
+#include 
+#include 
+#include 
+#include 
 
 using namespace css;
 using namespace css::uno;
@@ -59,6 +64,13 @@ void ControllerItem::RequestUpdate()
 {
 std::unique_ptr pState;
 const SfxItemState eState (GetBindings().QueryState(GetId(), pState));
+if (GetId() == SID_ATTR_METRIC && comphelper::LibreOfficeKit::isActive())
+{
+MeasurementSystem eSystem
+= 
LocaleDataWrapper(comphelper::LibreOfficeKit::getLocale()).getMeasurementSystemEnum();
+FieldUnit eUnit = MeasurementSystem::Metric == eSystem ? FieldUnit::CM 
: FieldUnit::INCH;
+
static_cast(pState.get())->SetValue(static_cast(eUnit));
+}
 mrItemUpdateReceiver.NotifyItemUpdate(GetId(), eState, pState.get());
 }
 
diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx 
b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
index 20e05096d6c4..8e88bdc2c656 100644
--- a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
+++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
@@ -374,9 +374,7 @@ FieldUnit ParaPropertyPanel::GetCurrentUnit( SfxItemState 
eState, const SfxPoolI
 SfxModule* pModule = pSh->GetModule();
 if ( pModule )
 {
-const SfxPoolItem* pItem = pModule->GetItem( SID_ATTR_METRIC );
-if ( pItem )
-eUnit = static_cast(static_cast(pItem)->GetValue());
+eUnit = pModule->GetFieldUnit();
 }
 

core.git: sfx2/source

2024-03-06 Thread Heiko Tietze (via logerrit)
 sfx2/source/dialog/infobar.cxx |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 06d8c1e9d8ba1d04914d1c48c94732cdb5c68846
Author: Heiko Tietze 
AuthorDate: Wed Mar 6 10:35:53 2024 +0100
Commit: Heiko Tietze 
CommitDate: Wed Mar 6 11:58:07 2024 +0100

Resolves tdf#159486 - Larger hitbox for close button on infobar

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

diff --git a/sfx2/source/dialog/infobar.cxx b/sfx2/source/dialog/infobar.cxx
index ca848813f09e..38a510a2589c 100644
--- a/sfx2/source/dialog/infobar.cxx
+++ b/sfx2/source/dialog/infobar.cxx
@@ -103,9 +103,12 @@ void SfxInfoBarWindow::SetCloseButtonImage()
 aSize = Size(aSize.Width() * 1.5, aSize.Height() * 1.5);
 
 ScopedVclPtr xDevice(m_xCloseBtn->create_virtual_device());
-xDevice->SetOutputSizePixel(aSize);
+xDevice->SetOutputSizePixel(Size(24, 24));
+xDevice->SetBackground(Color(m_aBackgroundColor));
+xDevice->Erase();
 
-Point aBtnPos(0, 0);
+const int nPos = (24 - aSize.getWidth()) / 2;
+Point aBtnPos(nPos, nPos);
 
 const ViewInformation2D aNewViewInfos;
 const std::unique_ptr pProcessor(


core.git: sfx2/source

2024-02-28 Thread Stephan Bergmann (via logerrit)
 sfx2/source/view/viewfrm.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit c39b832e85ae9e172f51c77c40d74949afcc0ac3
Author: Stephan Bergmann 
AuthorDate: Wed Feb 28 16:33:59 2024 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Feb 29 07:54:30 2024 +0100

Avoid -Werror,-Wunused-but-set-variable for ENABLE_WASM_STRIP_PINGUSER

...after 607740654f2264e13469e4da1d020448217d7222 "Resolves tdf#131550 -
Suppress Donate/Involve infobar if another is visible"

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

diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 31fd9471455c..20e56a6c4076 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -1714,6 +1714,8 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const 
SfxHint& rHint )
 officecfg::Setup::Product::LastTimeDonateShown::set(nNow, 
batch);
 batch->commit();
 }
+#else
+(void) bIsInfobarShown;
 #endif
 
 break;


core.git: sfx2/source

2024-02-25 Thread Mike Kaganski (via logerrit)
 sfx2/source/doc/guisaveas.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 5e134896f35d5c3a194090f2af1b84fbaec8b432
Author: Mike Kaganski 
AuthorDate: Sun Feb 25 19:17:53 2024 +0600
Commit: Mike Kaganski 
CommitDate: Mon Feb 26 02:24:15 2024 +0100

Use SHGetKnownFolderPath, to avoid MAX_PATH limitation

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

diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 5773fc732ea9..974aef7384d9 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -1331,14 +1331,15 @@ OUString ModelData_Impl::GetRecommendedDir( const 
OUString& aSuggestedDir )
 #ifdef _WIN32
 if( !bIsInTempPath )
 {
-wchar_t sPath[MAX_PATH+1];
-HRESULT hRes = SHGetFolderPathW( nullptr, CSIDL_INTERNET_CACHE, 
nullptr, SHGFP_TYPE_CURRENT, sPath );
+PWSTR sPath;
+HRESULT hRes = SHGetKnownFolderPath(FOLDERID_InternetCache, 0, 
nullptr, &sPath);
 if( SUCCEEDED(hRes) )
 {
 OUString sTempINetFiles;
 if( 
osl::FileBase::getFileURLFromSystemPath(OUString(o3tl::toU(sPath)), 
sTempINetFiles) == osl::FileBase::E_None )
 bIsInTempPath = !sTempINetFiles.isEmpty() && 
sLocationURL.startsWith( sTempINetFiles );
 }
+CoTaskMemFree(sPath);
 }
 #endif
 // Suggest somewhere other than the system's temp directory


core.git: sfx2/source

2024-02-21 Thread Méven Car (via logerrit)
 sfx2/source/dialog/dinfdlg.cxx |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

New commits:
commit f1a780cb6b7b860856de7ce2d8735432523c9e73
Author: Méven Car 
AuthorDate: Thu Feb 8 17:43:25 2024 +0100
Commit: Caolán McNamara 
CommitDate: Wed Feb 21 11:01:05 2024 +0100

Allow Document properties tab custom properties for LOK

Change-Id: I4860f9bad69b3db0eef7b0e98159ca2b336b4f60
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163611
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 
(cherry picked from commit f8f89de7a49db563b870dbaada6f010f2f75254f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163619
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index a5d45f322603..f103654f04a9 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -1324,10 +1324,7 @@ 
SfxDocumentInfoDialog::SfxDocumentInfoDialog(weld::Window* pParent, const SfxIte
 AddTabPage("general", SfxDocumentPage::Create, nullptr);
 AddTabPage("description", SfxDocumentDescPage::Create, nullptr);
 
-if (!comphelper::LibreOfficeKit::isActive())
-AddTabPage("customprops", SfxCustomPropertiesPage::Create, nullptr);
-else
-RemoveTabPage("customprops");
+AddTabPage("customprops", SfxCustomPropertiesPage::Create, nullptr);
 
 if (rInfoItem.isCmisDocument())
 AddTabPage("cmisprops", SfxCmisPropertiesPage::Create, nullptr);


core.git: sfx2/source

2024-02-14 Thread Julien Nabet (via logerrit)
 sfx2/source/doc/sfxbasemodel.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 7c0c8a3ae258808012c3514dadeb02fc0c6fc43b
Author: Julien Nabet 
AuthorDate: Wed Feb 14 10:21:20 2024 +0100
Commit: Xisco Fauli 
CommitDate: Wed Feb 14 14:19:47 2024 +0100

tdf#159707: fix crash when changing to edit mode (calc)

bt:
0x7f9eb4b902f2 in 
com::sun::star::uno::Reference::operator->() 
const (this=0x55b8c2b54888) at include/com/sun/star/uno/Reference.h:387
0x7f9eb4c03584 in 
ScVbaEventsHelper::notifyEvent(com::sun::star::document::EventObject const&) 
(this=0x55b8c2b54840, rEvent=...) at 
/home/julien/lo/libreoffice/sc/source/ui/vba/vbaeventshelper.cxx:605
0x7f9ef464bd3c in (anonymous 
namespace)::NotifySingleListenerIgnoreRE::operator()(com::sun::star::uno::Reference
 const&) const (this=0x7ffc5044dfc0, listener=uno::Reference to 
(ScVbaEventsHelper *) 0x55b8c2b54870) at 
/home/julien/lo/libreoffice/sfx2/source/doc/sfxbasemodel.cxx:3293
0x7f9ef463b8aa in 
comphelper::OInterfaceContainerHelper3::forEach<(anonymous
 
namespace)::NotifySingleListenerIgnoreRE >((anonymous 
namespace)::NotifySingleListenerIgnoreRE const&)
(this=0x55b8c2735c18, func=...) at 
include/comphelper/interfacecontainer3.hxx:279
0x7f9ef463b010 in SfxBaseModel::postEvent_Impl(rtl::OUString const&, 
com::sun::star::uno::Reference const&, 
com::sun::star::uno::Any const&)
(this=0x55b8c2308ae0, aName="OnUnload", xController=empty uno::Reference, 
supplement=uno::Any(void)) at 
/home/julien/lo/libreoffice/sfx2/source/doc/sfxbasemodel.cxx:3338
0x7f9ef463a089 in SfxBaseModel::Notify(SfxBroadcaster&, SfxHint const&) 
(this=0x55b8c2308ae0, rBC=..., rHint=...) at 
/home/julien/lo/libreoffice/sfx2/source/doc/sfxbasemodel.cxx:2960

See full bt here:
https://bugs.documentfoundation.org/attachment.cgi?id=192546

Regression from:

https://git.libreoffice.org/core/+/d2fccf0117a37f8aab8bb50ece419987f06af6b9%5E%21
"cool#6893 improve listeners in SfxBaseModel"

Change-Id: I372808dade20c47275ab599054d8e9572dc3da4d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163356
Reviewed-by: Julien Nabet 
Reviewed-by: Noel Grandin 
Tested-by: Jenkins

diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index b1862799b6b7..5de773ac01e2 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -2509,7 +2509,7 @@ void SAL_CALL SfxBaseModel::removeEventListener( const 
Reference< document::XEve
 {
 SfxModelGuard aGuard( *this );
 
-m_pData->m_aEventListeners.removeInterface( aListener );
+m_pData->m_aDocumentEventListeners1.removeInterface( aListener );
 }
 
 //  XShapeEventBroadcaster


core.git: sfx2/source

2024-02-08 Thread Mike Kaganski (via logerrit)
 sfx2/source/view/lokhelper.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit c170d1364be56d91fd16f255ffdc406b8e822732
Author: Mike Kaganski 
AuthorDate: Fri Feb 9 07:30:02 2024 +0100
Commit: Mike Kaganski 
CommitDate: Fri Feb 9 08:35:57 2024 +0100

Fix no-PCH build

... after commit f840a0d54d873d3003f8b624a50557f8c9872477 (lok: calc:
fix for rendering issues on in place editing, 2024-02-08)

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

diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index 4a59ffbd3322..530490686c11 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -12,6 +12,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 


core.git: sfx2/source

2024-02-08 Thread Caolán McNamara (via logerrit)
 sfx2/source/control/dispatch.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 59a86aff49ebc838c91355e98df66769b8054adc
Author: Caolán McNamara 
AuthorDate: Fri Dec 8 14:10:11 2023 +
Commit: Caolán McNamara 
CommitDate: Thu Feb 8 17:36:13 2024 +0100

kit mode is similar to !HAVE_FEATURE_DESKTOP mode wrt menubar

in that it is not used.

SfxDispatcher: :SetMenu_Impl is 3.1% of long-profiling use
Change-Id: I07bf0f130791795a49835e91ac8b8c5bec749f33
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163102
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index 3b52f7ae322e..2fa4e52c3e27 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -1009,6 +1009,9 @@ void SfxDispatcher::SetMenu_Impl()
 if ( !xImp->pFrame )
 return;
 
+if (comphelper::LibreOfficeKit::isActive())
+return;
+
 SfxViewFrame* pTop = xImp->pFrame->GetTopViewFrame();
 if ( !pTop || pTop->GetBindings().GetDispatcher() != this )
 return;


core.git: sfx2/source

2024-02-01 Thread Mike Kaganski (via logerrit)
 sfx2/source/doc/objstor.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 6bddbe51cee5c4aea023cc68771800f46a4aad2f
Author: Mike Kaganski 
AuthorDate: Thu Feb 1 13:35:43 2024 +0600
Commit: Mike Kaganski 
CommitDate: Thu Feb 1 12:19:20 2024 +0100

tdf#159496: clear mxObjectContainer in PrepareSecondTryLoad_Impl

The problem here is that the object container has own reference to the
storage object. In SfxBaseModel::load, when preparing for a second try,
the storage gets disposed, and a cleanup is performed; but previously,
the reference to the disposed storage was used in the object container,
and thus generated a failure when it was used to import the OLE.

Clearing it allows to re-create it properly, with the updated storage.

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

diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 1d9401714acf..5a300dd164ad 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -399,6 +399,7 @@ void SfxObjectShell::PrepareSecondTryLoad_Impl()
 {
 // only for internal use
 pImpl->m_xDocStorage.clear();
+pImpl->mxObjectContainer.reset();
 pImpl->m_bIsInit = false;
 ResetError();
 }


core.git: sfx2/source

2024-01-31 Thread Andrea Gelmini (via logerrit)
 sfx2/source/notebookbar/SfxNotebookBar.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 093ef8bf93adf93835ad2e2e43055d90d76a8376
Author: Andrea Gelmini 
AuthorDate: Tue Jan 30 16:46:44 2024 +0100
Commit: Julien Nabet 
CommitDate: Wed Jan 31 11:21:31 2024 +0100

Fix typo

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

diff --git a/sfx2/source/notebookbar/SfxNotebookBar.cxx 
b/sfx2/source/notebookbar/SfxNotebookBar.cxx
index c6b1cddb34ad..41ae9c3c2666 100644
--- a/sfx2/source/notebookbar/SfxNotebookBar.cxx
+++ b/sfx2/source/notebookbar/SfxNotebookBar.cxx
@@ -61,7 +61,7 @@ struct NotebookBarViewData
 };
 
 /** Notebookbar instance manager is a singleton that is used for track the
- *  per-view instances of view specifc data contained in NotebookBarViewData
+ *  per-view instances of view specific data contained in NotebookBarViewData
  *  class.
  **/
 class NotebookBarViewManager final


core.git: sfx2/source svx/source

2024-01-31 Thread Caolán McNamara (via logerrit)
 sfx2/source/view/viewsh.cxx   |6 --
 svx/source/svdraw/svdpage.cxx |   10 --
 2 files changed, 12 insertions(+), 4 deletions(-)

New commits:
commit 3a48ad467b7fbf9cbdfff1222e08c02b0ff5d544
Author: Caolán McNamara 
AuthorDate: Tue Jan 30 21:29:31 2024 +
Commit: Caolán McNamara 
CommitDate: Wed Jan 31 10:33:06 2024 +0100

use ViewShell DOCCOLOR when available

for fallback, continue to warn if the terminal fallback gets used,
but fill stub it to return the application DOCCOLOR

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

diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 06dfc49798be..8c54bd049acb 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -3316,10 +3317,11 @@ vcl::Window* 
SfxViewShell::GetEditWindowForActiveOLEObj() const
 return pEditWin;
 }
 
-::Color SfxViewShell::GetColorConfigColor(svtools::ColorConfigEntry) const
+::Color SfxViewShell::GetColorConfigColor(svtools::ColorConfigEntry eEntry) 
const
 {
 SAL_WARN("sfx.view", "SfxViewShell::GetColorConfigColor not overridden!");
-return {};
+svtools::ColorConfig aColorConfig;
+return aColorConfig.GetColorValue(eEntry).nColor;
 }
 
 void SfxViewShell::SetLOKLanguageTag(const OUString& rBcp47LanguageTag)
diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx
index 99137d28b4da..d154fd982901 100644
--- a/svx/source/svdraw/svdpage.cxx
+++ b/svx/source/svdraw/svdpage.cxx
@@ -31,6 +31,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -1768,8 +1769,13 @@ Color SdrPage::GetPageBackgroundColor( SdrPageView const 
* pView, bool bScreenDi
 
 if(bScreenDisplay && (!pView || pView->GetApplicationDocumentColor() == 
COL_AUTO))
 {
-svtools::ColorConfig aColorConfig;
-aColor = aColorConfig.GetColorValue( svtools::DOCCOLOR ).nColor;
+if (const SfxViewShell* pViewShell = SfxViewShell::Current())
+aColor = pViewShell->GetColorConfigColor(svtools::DOCCOLOR);
+else
+{
+svtools::ColorConfig aColorConfig;
+aColor = aColorConfig.GetColorValue( svtools::DOCCOLOR ).nColor;
+}
 }
 else
 {


core.git: sfx2/source

2024-01-30 Thread Caolán McNamara (via logerrit)
 sfx2/source/view/viewfrm.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 43dcd82624a26d7c3a4185469bef60f531999190
Author: Caolán McNamara 
AuthorDate: Tue Jan 30 11:47:38 2024 +
Commit: Caolán McNamara 
CommitDate: Tue Jan 30 15:20:17 2024 +0100

reuse xCurrentFrame instead of fetching it again

and use the exception safe vcl::CommandInfoProvider::GetModuleIdentifier
wrapper.

might as well skip the TOTD for the database report as we as the form.

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

diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index ab6e2ebdda0d..e2dad9605d45 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -1522,9 +1522,10 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, 
const SfxHint& rHint )
 const auto xContext = 
comphelper::getProcessComponentContext();
 const auto xModuleManager = 
css::frame::ModuleManager::create(xContext);
 switch (vcl::EnumContext::GetApplicationEnum(
-xModuleManager->identify(xCurrentFrame)))
+
vcl::CommandInfoProvider::GetModuleIdentifier(xCurrentFrame)))
 {
 case vcl::EnumContext::Application::WriterForm:
+case vcl::EnumContext::Application::WriterReport:
 bIsBaseFormOpen = true;
 break;
 default:
@@ -1533,7 +1534,7 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const 
SfxHint& rHint )
 if (!bIsBaseFormOpen)
 {
 // tdf#127946 pass in argument for dialog parent
-SfxUnoFrameItem aDocFrame(SID_FILLFRAME, 
GetFrame().GetFrameInterface());
+SfxUnoFrameItem aDocFrame(SID_FILLFRAME, 
xCurrentFrame);
 GetDispatcher()->ExecuteList(SID_TIPOFTHEDAY, 
SfxCallMode::SLOT, {},
  { &aDocFrame });
 }


core.git: sfx2/source

2024-01-30 Thread Matt K (via logerrit)
 sfx2/source/view/viewfrm.cxx |   25 ++---
 1 file changed, 22 insertions(+), 3 deletions(-)

New commits:
commit a2c09afebef70d2419823445ff92379fe3df9485
Author: Matt K 
AuthorDate: Fri Jan 19 17:05:35 2024 -0600
Commit: Caolán McNamara 
CommitDate: Tue Jan 30 12:49:42 2024 +0100

tdf#151352 Don't display tip-of-the-day in base form editor

The problem is that there is some crash with tip-of-the-day
on Linux with GTK3 when opening a base form for editing.
The fix is to avoid showing the tip-of-the-day for base
form editor, as suggested in the bug comments.

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

diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 16b41843ba31..ab6e2ebdda0d 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -78,6 +78,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -1515,9 +1516,27 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, 
const SfxHint& rHint )
 // open where SdModule::ExecuteNewDocument will launch it 
instead when that dialog is dismissed
 if (SfxApplication::IsTipOfTheDayDue() && !bIsHeadlessOrUITest 
&& !IsInModalMode())
 {
-// tdf#127946 pass in argument for dialog parent
-SfxUnoFrameItem aDocFrame(SID_FILLFRAME, 
GetFrame().GetFrameInterface());
-GetDispatcher()->ExecuteList(SID_TIPOFTHEDAY, 
SfxCallMode::SLOT, {}, { &aDocFrame });
+bool bIsBaseFormOpen = false;
+
+const auto xCurrentFrame = GetFrame().GetFrameInterface();
+const auto xContext = 
comphelper::getProcessComponentContext();
+const auto xModuleManager = 
css::frame::ModuleManager::create(xContext);
+switch (vcl::EnumContext::GetApplicationEnum(
+xModuleManager->identify(xCurrentFrame)))
+{
+case vcl::EnumContext::Application::WriterForm:
+bIsBaseFormOpen = true;
+break;
+default:
+break;
+}
+if (!bIsBaseFormOpen)
+{
+// tdf#127946 pass in argument for dialog parent
+SfxUnoFrameItem aDocFrame(SID_FILLFRAME, 
GetFrame().GetFrameInterface());
+GetDispatcher()->ExecuteList(SID_TIPOFTHEDAY, 
SfxCallMode::SLOT, {},
+ { &aDocFrame });
+}
 }
 
 // inform about the community involvement


core.git: sfx2/source

2024-01-30 Thread Caolán McNamara (via logerrit)
 sfx2/source/doc/sfxbasemodel.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit f1729753193f4f2c69f45b4377a557cceeb72070
Author: Caolán McNamara 
AuthorDate: Mon Jan 29 13:08:02 2024 +
Commit: Caolán McNamara 
CommitDate: Tue Jan 30 09:43:15 2024 +0100

just get SfxViewShell::Current once

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

diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index ad31130e514d..c25d31deb110 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -3264,8 +3264,8 @@ void SfxBaseModel::impl_store(  const   OUString& 
  sURL
 SfxGetpApp()->NotifyEvent( SfxEventHint( bSaveTo ? 
SfxEventHintId::SaveToDocFailed : SfxEventHintId::SaveAsDocFailed, 
GlobalEventConfig::GetEventName( bSaveTo ? GlobalEventId::SAVETODOCFAILED : 
GlobalEventId::SAVEASDOCFAILED),
 m_pData->m_pObjectShell.get() 
) );
 
-if ( comphelper::LibreOfficeKit::isActive() && SfxViewShell::Current() 
)
-SfxViewShell::Current()->libreOfficeKitViewCallback( 
LOK_CALLBACK_EXPORT_FILE, "ERROR"_ostr );
+if (SfxViewShell* pNotifyView = comphelper::LibreOfficeKit::isActive() 
? SfxViewShell::Current() : nullptr)
+pNotifyView->libreOfficeKitViewCallback(LOK_CALLBACK_EXPORT_FILE, 
"ERROR"_ostr);
 
 std::stringstream aErrCode;
 aErrCode << nErrCode;


core.git: sfx2/source

2024-01-29 Thread Szymon Kłos (via logerrit)
 sfx2/source/view/viewfrm.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 4eb62f0e9ca42d8e6302c04e74ee6f1e08c1419c
Author: Szymon Kłos 
AuthorDate: Fri Jan 26 16:54:14 2024 +0100
Commit: Szymon Kłos 
CommitDate: Mon Jan 29 09:51:50 2024 +0100

lok: always toggle sidebar deck

This fixes regression from:
commit 53fc5fa0fed077b7d11e39b710280f0a84b631ff
tdf#142978 Show a11y sidebar when finding issues on PDF export

LOK was unable to close sidebar

Change-Id: Icd96394523020c30e63858bc372ba136c2be8158
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162608
(cherry picked from commit 031f11bd9096fb192ced1328f9bbcd1b1903e3e7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162621
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 

diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index f50252984794..16b41843ba31 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -3406,8 +3406,11 @@ void SfxViewFrame::ChildWindowExecute( SfxRequest &rReq )
 if (pDeckIdItem)
 {
 const OUString aDeckId(pDeckIdItem->GetValue());
+// Compatibility with old LOK "toggle always"
+// TODO: check LOK with tdf#142978 Show a11y sidebar when finding 
issues on PDF export, hash: 53fc5fa
+const bool isLOK = comphelper::LibreOfficeKit::isActive();
 const SfxBoolItem* pToggleItem = 
rReq.GetArg(SID_SIDEBAR_DECK_TOGGLE);
-bool bToggle = pToggleItem && pToggleItem->GetValue();
+bool bToggle = isLOK || (pToggleItem && pToggleItem->GetValue());
 ::sfx2::sidebar::Sidebar::ShowDeck(aDeckId, this, bToggle);
 }
 rReq.Done();


core.git: sfx2/source

2024-01-24 Thread Xisco Fauli (via logerrit)
 sfx2/source/doc/guisaveas.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit ae591835dc6b2c18169c2685fbc7e9fb958bf369
Author: Xisco Fauli 
AuthorDate: Wed Jan 24 10:03:53 2024 +0100
Commit: Xisco Fauli 
CommitDate: Wed Jan 24 13:30:50 2024 +0100

sfx2: check SfxViewShell::Current()

Seen in 
https://crashreport.libreoffice.org/stats/crash_details/52df6de5-7ea8-48e4-8c45-f18b02d9a767

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

diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 7b286321c217..5773fc732ea9 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -1521,7 +1521,7 @@ bool SfxStoringHelper::GUIStoreModel( const 
uno::Reference< frame::XModel >& xMo
 }
 }
 
-if (!comphelper::LibreOfficeKit::isActive() && !( m_nStoreMode & 
EXPORT_REQUESTED ) )
+if (!comphelper::LibreOfficeKit::isActive() && !( m_nStoreMode & 
EXPORT_REQUESTED ) && SfxViewShell::Current() )
 {
 SfxObjectShell* pDocShell = SfxViewShell::Current()->GetObjectShell();
 


core.git: sfx2/source xmlsecurity/qa

2024-01-23 Thread Thorsten Behrens (via logerrit)
 sfx2/source/doc/objstor.cxx  |3 -
 xmlsecurity/qa/unit/signing/signing2.cxx |   58 ---
 2 files changed, 31 insertions(+), 30 deletions(-)

New commits:
commit d0dcd87788910e3c9f67a2b68534019c05b77bad
Author: Thorsten Behrens 
AuthorDate: Mon Jan 15 00:26:02 2024 +0100
Commit: Thorsten Behrens 
CommitDate: Tue Jan 23 21:41:03 2024 +0100

Make wholesome ODF package encryption the default

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

diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 854389ae31be..27fb68c83f87 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -170,8 +170,7 @@ bool SfxObjectShell::QuerySlotExecutable( sal_uInt16 
/*nSlotId*/ )
 
 static bool UseODFWholesomeEncryption(SvtSaveOptions::ODFSaneDefaultVersion 
const nODFVersion)
 {
-return nODFVersion == SvtSaveOptions::ODFSVER_LATEST_EXTENDED
-&& officecfg::Office::Common::Misc::ExperimentalMode::get();
+return nODFVersion == SvtSaveOptions::ODFSVER_LATEST_EXTENDED;
 }
 
 bool GetEncryptionData_Impl( const SfxItemSet* pSet, uno::Sequence< 
beans::NamedValue >& o_rEncryptionData )
diff --git a/xmlsecurity/qa/unit/signing/signing2.cxx 
b/xmlsecurity/qa/unit/signing/signing2.cxx
index 71e887df236a..dd6f9e09a83d 100644
--- a/xmlsecurity/qa/unit/signing/signing2.cxx
+++ b/xmlsecurity/qa/unit/signing/signing2.cxx
@@ -128,9 +128,21 @@ CPPUNIT_TEST_FIXTURE(SigningTest2, 
testPasswordPreserveMacroSignatureODF13)
 CPPUNIT_ASSERT_EQUAL(SignatureState::OK, 
pObjectShell->GetScriptingSignatureState());
 }
 
-saveAndReload("writer8", "password");
 {
-// test standard ODF 1.2/1.3/1.4 encryption
+// test the old, standard ODF 1.2/1.3/1.4 encryption
+Resetter resetter([]() {
+std::shared_ptr pBatch(
+comphelper::ConfigurationChanges::create());
+officecfg::Office::Common::Save::ODF::DefaultVersion::set(3, 
pBatch);
+return pBatch->commit();
+});
+std::shared_ptr pBatch(
+comphelper::ConfigurationChanges::create());
+officecfg::Office::Common::Save::ODF::DefaultVersion::set(10, pBatch);
+pBatch->commit();
+
+saveAndReload("writer8", "password");
+
 xmlDocUniquePtr pXmlDoc = parseExport("META-INF/manifest.xml");
 assertXPath(pXmlDoc, "/manifest:manifest"_ostr, "version"_ostr, "1.3");
 assertXPath(pXmlDoc, 
"/manifest:manifest/manifest:file-entry[@manifest:size != '0']"_ostr,
@@ -174,18 +186,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest2, 
testPasswordPreserveMacroSignatureODF13)
 }
 
 {
-Resetter resetter([]() {
-std::shared_ptr pBatch(
-comphelper::ConfigurationChanges::create());
-officecfg::Office::Common::Misc::ExperimentalMode::set(false, 
pBatch);
-return pBatch->commit();
-});
-std::shared_ptr pBatch(
-comphelper::ConfigurationChanges::create());
-officecfg::Office::Common::Misc::ExperimentalMode::set(true, pBatch);
-pBatch->commit();
-
-// store it experimental - reload
+// store it with new wholesome ODF extended encryption - reload
 saveAndReload("writer8", "password");
 
 // test wholesome ODF extended encryption
@@ -253,18 +254,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest2, 
testPasswordPreserveMacroSignatureODFWholesom
 }
 
 {
-Resetter resetter([]() {
-std::shared_ptr pBatch(
-comphelper::ConfigurationChanges::create());
-officecfg::Office::Common::Misc::ExperimentalMode::set(false, 
pBatch);
-return pBatch->commit();
-});
-std::shared_ptr pBatch(
-comphelper::ConfigurationChanges::create());
-officecfg::Office::Common::Misc::ExperimentalMode::set(true, pBatch);
-pBatch->commit();
-
-// store it experimental - reload
+// store it with new wholesome ODF extended encryption - reload
 saveAndReload("writer8", "password");
 
 // test wholesome ODF extended encryption
@@ -321,9 +311,21 @@ CPPUNIT_TEST_FIXTURE(SigningTest2, 
testPasswordPreserveMacroSignatureODFWholesom
 CPPUNIT_ASSERT_EQUAL(SignatureState::OK, 
pObjectShell->GetScriptingSignatureState());
 }
 
-saveAndReload("writer8", "password");
 {
-// test standard ODF 1.2/1.3/1.4 encryption
+// test the old, standard ODF 1.2/1.3/1.4 encryption
+Resetter resetter([]() {
+std::shared_ptr pBatch(
+comphelper::ConfigurationChanges::create());
+officecfg::Office::Common::Save::ODF::DefaultVersion::set(3, 
pBatch);
+return pBatch->commit();
+});
+std::shared_ptr pBatch(
+comphelper::Confi

core.git: sfx2/source

2024-01-20 Thread Andras Timar (via logerrit)
 sfx2/source/appl/sfxhelp.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 5dbb4d28b3310109ba47d02ea486299ba56e3c9f
Author: Andras Timar 
AuthorDate: Fri Jan 19 15:49:49 2024 +0100
Commit: Caolán McNamara 
CommitDate: Sat Jan 20 22:18:47 2024 +0100

LOK: disable popup bubble for hyperlinks

Change-Id: I0ca21a90561affa453bd249c86e58793618f809e
(cherry picked from commit 88fea772610a4feef018ba03fd19749841772225)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162335
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index c67f1485497f..b297c27578dd 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -666,6 +666,10 @@ OUString SfxHelp::GetHelpText(const OUString& aCommandURL, 
const weld::Widget* p
 
 OUString SfxHelp::GetURLHelpText(std::u16string_view aURL)
 {
+// hyperlinks are handled differently in Online
+if (comphelper::LibreOfficeKit::isActive())
+return OUString();
+
 bool bCtrlClickHlink = 
SvtSecurityOptions::IsOptionSet(SvtSecurityOptions::EOption::CtrlClickHyperlink);
 
 // "ctrl-click to follow link:" for not MacOS


core.git: sfx2/source

2024-01-16 Thread Andreas Heinisch (via logerrit)
 sfx2/source/doc/objstor.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 48bbdf24ebe3cf78199bf213ab5585a293dc40ae
Author: Andreas Heinisch 
AuthorDate: Mon Jan 15 22:50:45 2024 +0100
Commit: Andreas Heinisch 
CommitDate: Tue Jan 16 10:57:33 2024 +0100

tdf#53614 - Don't try to lock file after cancelling the import process

After cancelling the import process don't try to lock the file.
Otherwise, the document in use dialog will be shown which has literally
no effect.

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

diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index a7253f7a0b83..854389ae31be 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -654,7 +654,9 @@ bool SfxObjectShell::DoLoad( SfxMedium *pMed )
 
 EnableSetModified( false );
 
-pMedium->LockOrigFileOnDemand( true, false );
+// tdf#53614 - don't try to lock file after cancelling the import process
+if (GetErrorIgnoreWarning() != ERRCODE_ABORT)
+pMedium->LockOrigFileOnDemand( true, false );
 if ( GetErrorIgnoreWarning() == ERRCODE_NONE && bOwnStorageFormat && ( 
!pFilter || !( pFilter->GetFilterFlags() & SfxFilterFlags::STARONEFILTER ) ) )
 {
 uno::Reference< embed::XStorage > xStorage;


core.git: sfx2/source

2024-01-14 Thread Aron Budea (via logerrit)
 sfx2/source/view/lokhelper.cxx |   59 +++--
 1 file changed, 28 insertions(+), 31 deletions(-)

New commits:
commit 1bc6a730ecb7db289e7f72db3c9bce4812e775ed
Author: Aron Budea 
AuthorDate: Tue Jan 9 12:39:56 2024 +1030
Commit: Aron Budea 
CommitDate: Sun Jan 14 16:37:41 2024 +0100

lok: Replace loop with std::find_if(...)

Change-Id: Icfe912f7b79454b9d208c39382ba187d0a0c16c5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161810
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Attila Szűcs 
Reviewed-by: Aron Budea 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162045
Tested-by: Jenkins

diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index 02cc7fe25230..2106168f459e 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -184,44 +184,41 @@ void SfxLokHelper::setView(int nId)
 const ViewShellId nViewShellId(nId);
 std::vector& rViewArr = pApp->GetViewShells_Impl();
 
-for (const SfxViewShell* pViewShell : rViewArr)
-{
-if (pViewShell->GetViewShellId() == nViewShellId)
-{
-DisableCallbacks dc;
+const auto itViewShell = std::find_if(rViewArr.begin(), rViewArr.end(), 
[nViewShellId](SfxViewShell* pViewShell){ return pViewShell->GetViewShellId() 
== nViewShellId; });
+if (itViewShell == rViewArr.end())
+return;
 
-bool bIsCurrShell = (pViewShell == SfxViewShell::Current());
-if (bIsCurrShell && 
comphelper::LibreOfficeKit::getLanguageTag().getBcp47() == 
pViewShell->GetLOKLanguageTag().getBcp47())
-return;
+const SfxViewShell* pViewShell = *itViewShell;
+DisableCallbacks dc;
 
-if (bIsCurrShell)
-{
-// If we wanted to set the SfxViewShell that is actually set, 
we could skip it.
-// But it looks like that the language can go wrong, so we 
have to fix that.
-// This can happen, when someone sets the language or 
SfxViewShell::Current() separately.
-SAL_WARN("lok", "LANGUAGE mismatch at setView! ... old (wrong) 
lang:"
-<< 
comphelper::LibreOfficeKit::getLanguageTag().getBcp47()
-<< " new lang:" << 
pViewShell->GetLOKLanguageTag().getBcp47());
-}
+bool bIsCurrShell = (pViewShell == SfxViewShell::Current());
+if (bIsCurrShell && 
comphelper::LibreOfficeKit::getLanguageTag().getBcp47() == 
pViewShell->GetLOKLanguageTag().getBcp47())
+return;
 
-// update the current LOK language and locale for the dialog 
tunneling
-
comphelper::LibreOfficeKit::setLanguageTag(pViewShell->GetLOKLanguageTag());
-comphelper::LibreOfficeKit::setLocale(pViewShell->GetLOKLocale());
+if (bIsCurrShell)
+{
+// If we wanted to set the SfxViewShell that is actually set, we could 
skip it.
+// But it looks like that the language can go wrong, so we have to fix 
that.
+// This can happen, when someone sets the language or 
SfxViewShell::Current() separately.
+SAL_WARN("lok", "LANGUAGE mismatch at setView! ... old (wrong) lang:"
+<< 
comphelper::LibreOfficeKit::getLanguageTag().getBcp47()
+<< " new lang:" << 
pViewShell->GetLOKLanguageTag().getBcp47());
+}
 
-if (bIsCurrShell)
-return;
+// update the current LOK language and locale for the dialog tunneling
+
comphelper::LibreOfficeKit::setLanguageTag(pViewShell->GetLOKLanguageTag());
+comphelper::LibreOfficeKit::setLocale(pViewShell->GetLOKLocale());
 
-SfxViewFrame& rViewFrame = pViewShell->GetViewFrame();
-rViewFrame.MakeActive_Impl(false);
+if (bIsCurrShell)
+return;
 
-// Make comphelper::dispatchCommand() find the correct frame.
-uno::Reference xFrame = 
rViewFrame.GetFrame().GetFrameInterface();
-uno::Reference xDesktop = 
frame::Desktop::create(comphelper::getProcessComponentContext());
-xDesktop->setActiveFrame(xFrame);
-return;
-}
-}
+SfxViewFrame& rViewFrame = pViewShell->GetViewFrame();
+rViewFrame.MakeActive_Impl(false);
 
+// Make comphelper::dispatchCommand() find the correct frame.
+uno::Reference xFrame = 
rViewFrame.GetFrame().GetFrameInterface();
+uno::Reference xDesktop = 
frame::Desktop::create(comphelper::getProcessComponentContext());
+xDesktop->setActiveFrame(xFrame);
 }
 
 SfxViewShell* SfxLokHelper::getViewOfId(int nId)


core.git: sfx2/source

2024-01-11 Thread Attila Szűcs (via logerrit)
 sfx2/source/view/lokhelper.cxx |   12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

New commits:
commit f97dc9d815ad8fdd75cbcd9c18b2e585ecf39ca5
Author: Attila Szűcs 
AuthorDate: Tue Jan 9 20:23:44 2024 +0100
Commit: Caolán McNamara 
CommitDate: Thu Jan 11 20:47:30 2024 +0100

LOK: fix language warning in setView

Made the warning before the new language set.
This way we log the old (wrong) and new (good) language.

Elseway we could save the old languages to a temporal variable,
set the language, and do the warning with the saved variable, but
i think the extra variables would be a waste of memory.

Change-Id: I0b69f49d07e9130bf1538c2c8e1d0b09cf82091f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161841
Tested-by: Jenkins CollaboraOffice 
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 
(cherry picked from commit e09b3f5f4cd662a596b5d8d6ad4d5e2778e315f4)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161916
Tested-by: Jenkins

diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index 711e12209e8a..02cc7fe25230 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -194,10 +194,6 @@ void SfxLokHelper::setView(int nId)
 if (bIsCurrShell && 
comphelper::LibreOfficeKit::getLanguageTag().getBcp47() == 
pViewShell->GetLOKLanguageTag().getBcp47())
 return;
 
-// update the current LOK language and locale for the dialog 
tunneling
-
comphelper::LibreOfficeKit::setLanguageTag(pViewShell->GetLOKLanguageTag());
-comphelper::LibreOfficeKit::setLocale(pViewShell->GetLOKLocale());
-
 if (bIsCurrShell)
 {
 // If we wanted to set the SfxViewShell that is actually set, 
we could skip it.
@@ -206,9 +202,15 @@ void SfxLokHelper::setView(int nId)
 SAL_WARN("lok", "LANGUAGE mismatch at setView! ... old (wrong) 
lang:"
 << 
comphelper::LibreOfficeKit::getLanguageTag().getBcp47()
 << " new lang:" << 
pViewShell->GetLOKLanguageTag().getBcp47());
-return;
 }
 
+// update the current LOK language and locale for the dialog 
tunneling
+
comphelper::LibreOfficeKit::setLanguageTag(pViewShell->GetLOKLanguageTag());
+comphelper::LibreOfficeKit::setLocale(pViewShell->GetLOKLocale());
+
+if (bIsCurrShell)
+return;
+
 SfxViewFrame& rViewFrame = pViewShell->GetViewFrame();
 rViewFrame.MakeActive_Impl(false);
 


core.git: sfx2/source

2024-01-11 Thread Attila Szűcs (via logerrit)
 sfx2/source/view/lokhelper.cxx |   14 +-
 1 file changed, 13 insertions(+), 1 deletion(-)

New commits:
commit e78bce3c1dbef3bbc0a18d9c17e458a69c2a8e46
Author: Attila Szűcs 
AuthorDate: Fri Dec 1 15:20:58 2023 +0100
Commit: Caolán McNamara 
CommitDate: Thu Jan 11 14:54:51 2024 +0100

LOK: fix setView language problem  

Fix some mis-localization problem by checking for wrong language  
at setView(...).

setView does not change current localization, if the view we want  
to set is the current view.

But in some cases the language - view is not in a consistent state.
Maybe the language changed but the view did not, or the current view  
changed without language change (I found examples for both).

Changed setView(...) so that it checks, if the current language
matches to the current view, and if it does not, then we set
the view, even if we want to set to the current view.    

This won't fix everything, but hopefully it helps a lot.
I think we should make sure that current view - current Language  
are always changed at the same time (or at least we make sure
they always match).

Change-Id: Ie177b9b55f7befcbcf7cd1f62e402700f0e1aa60
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160219
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161915
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index f21457e1b16d..711e12209e8a 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -190,13 +190,25 @@ void SfxLokHelper::setView(int nId)
 {
 DisableCallbacks dc;
 
-if (pViewShell == SfxViewShell::Current())
+bool bIsCurrShell = (pViewShell == SfxViewShell::Current());
+if (bIsCurrShell && 
comphelper::LibreOfficeKit::getLanguageTag().getBcp47() == 
pViewShell->GetLOKLanguageTag().getBcp47())
 return;
 
 // update the current LOK language and locale for the dialog 
tunneling
 
comphelper::LibreOfficeKit::setLanguageTag(pViewShell->GetLOKLanguageTag());
 comphelper::LibreOfficeKit::setLocale(pViewShell->GetLOKLocale());
 
+if (bIsCurrShell)
+{
+// If we wanted to set the SfxViewShell that is actually set, 
we could skip it.
+// But it looks like that the language can go wrong, so we 
have to fix that.
+// This can happen, when someone sets the language or 
SfxViewShell::Current() separately.
+SAL_WARN("lok", "LANGUAGE mismatch at setView! ... old (wrong) 
lang:"
+<< 
comphelper::LibreOfficeKit::getLanguageTag().getBcp47()
+<< " new lang:" << 
pViewShell->GetLOKLanguageTag().getBcp47());
+return;
+}
+
 SfxViewFrame& rViewFrame = pViewShell->GetViewFrame();
 rViewFrame.MakeActive_Impl(false);
 


core.git: sfx2/source

2024-01-10 Thread Matt K (via logerrit)
 sfx2/source/doc/sfxbasemodel.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e004c9dd2cc0da7f27503d14bfc13975889eea77
Author: Matt K 
AuthorDate: Tue Jan 9 17:23:34 2024 -0600
Commit: Mike Kaganski 
CommitDate: Thu Jan 11 05:19:28 2024 +0100

tdf#158937 Allow cancel of password dialog during recovery

The problem is that when a user cancels the password dialog
during recovery, the code tries to do something with the
doc, but there is no doc yet because the file is password
protected and not opened, so it crashes.  The fix is just
to check for the absence of errors before using the doc
(canceling the password dialog is considered an abort/
general IO error).

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

diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index a996259f3598..3da83626a5ea 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -2026,7 +2026,7 @@ void SAL_CALL SfxBaseModel::load(   const Sequence< 
beans::PropertyValue >& seqA
 if( m_pData->m_pObjectShell->IsAbortingImport() )
 nError = ERRCODE_ABORT;
 
-if( bSalvage )
+if (bSalvage && nError == ERRCODE_NONE)
 {
 // file recovery: restore original filter
 const SfxStringItem* pFilterItem = 
pMedium->GetItemSet().GetItem(SID_FILTER_NAME, false);


core.git: sfx2/source

2024-01-10 Thread Jim Raykowski (via logerrit)
 sfx2/source/dialog/StyleList.cxx |   27 +--
 1 file changed, 21 insertions(+), 6 deletions(-)

New commits:
commit 6c0081f3cd37541f8c0fe0fba69cc38c9b0a229b
Author: Jim Raykowski 
AuthorDate: Tue Jan 9 17:44:31 2024 -0900
Commit: Jim Raykowski 
CommitDate: Wed Jan 10 16:57:24 2024 +0100

tdf#158992 Only show style spotlight for styles that are used

in order to reduce visual clutter

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

diff --git a/sfx2/source/dialog/StyleList.cxx b/sfx2/source/dialog/StyleList.cxx
index e7bdd9e3b4a3..888d03c4ee30 100644
--- a/sfx2/source/dialog/StyleList.cxx
+++ b/sfx2/source/dialog/StyleList.cxx
@@ -735,19 +735,27 @@ static void lcl_Insert(weld::TreeView& rTreeView, const 
OUString& rName, SfxStyl
 
 static void FillBox_Impl(weld::TreeView& rBox, StyleTree_Impl* pEntry,
  const std::vector& rEntries, SfxStyleFamily 
eStyleFamily,
- const weld::TreeIter* pParent, bool blcl_insert, 
SfxViewShell* pViewShell)
+ const weld::TreeIter* pParent, bool blcl_insert, 
SfxViewShell* pViewShell,
+ SfxStyleSheetBasePool* pStyleSheetPool)
 {
 std::unique_ptr xResult = rBox.make_iterator();
 const OUString& rName = pEntry->getName();
-
 if (blcl_insert)
-lcl_Insert(rBox, rName, eStyleFamily, pParent, xResult.get(), 
pViewShell);
+{
+const SfxStyleSheetBase* pStyle = nullptr;
+if (pStyleSheetPool)
+pStyle = pStyleSheetPool->Find(rName, eStyleFamily);
+if (pStyle && pStyle->IsUsed())
+lcl_Insert(rBox, rName, eStyleFamily, pParent, xResult.get(), 
pViewShell);
+else
+rBox.insert(pParent, -1, &rName, &rName, nullptr, nullptr, false, 
xResult.get());
+}
 else
 rBox.insert(pParent, -1, &rName, &rName, nullptr, nullptr, false, 
xResult.get());
 
 for (size_t i = 0; i < pEntry->getChildren().size(); ++i)
 FillBox_Impl(rBox, pEntry->getChildren()[i].get(), rEntries, 
eStyleFamily, xResult.get(),
- blcl_insert, pViewShell);
+ blcl_insert, pViewShell, pStyleSheetPool);
 }
 
 namespace SfxTemplate
@@ -1046,7 +1054,8 @@ void StyleList::FillTreeBox(SfxStyleFamily eFam)
 
 for (sal_uInt16 i = 0; i < nCount; ++i)
 {
-FillBox_Impl(*m_xTreeBox, aArr[i].get(), aEntries, eFam, nullptr, 
blcl_insert, pViewShell);
+FillBox_Impl(*m_xTreeBox, aArr[i].get(), aEntries, eFam, nullptr, 
blcl_insert, pViewShell,
+ m_pStyleSheetPool);
 aArr[i].reset();
 }
 
@@ -1241,7 +1250,13 @@ void StyleList::UpdateStyles(StyleFlags nFlags)
 || (eFam == SfxStyleFamily::Char && m_bHighlightCharStyles)))
 {
 for (nPos = 0; nPos < nCount; ++nPos)
-lcl_Insert(*m_xFmtLb, aStrings[nPos], eFam, nullptr, nullptr, 
pViewShell);
+{
+pStyle = m_pStyleSheetPool->Find(aStrings[nPos], eFam);
+if (pStyle && pStyle->IsUsed())
+lcl_Insert(*m_xFmtLb, aStrings[nPos], eFam, nullptr, nullptr, 
pViewShell);
+else
+m_xFmtLb->append(aStrings[nPos], aStrings[nPos]);
+}
 }
 else
 {


  1   2   3   4   5   6   7   8   9   10   >