core.git: sfx2/source

2026-04-16 Thread Julien Nabet (via logerrit)
 sfx2/source/dialog/backingwindow.hxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit c74d4f35aae3dc69127be4a091afc2e94bc56eaf
Author: Julien Nabet 
AuthorDate: Thu Apr 16 18:25:06 2026 +0200
Commit: Julien Nabet 
CommitDate: Thu Apr 16 20:05:05 2026 +0200

-Wunused-private-field nRand

Due to 412940ab3824048b1eea9d47f6f24fb1b4996661
Relates rdm#3867 - Donation banner with different messages

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

diff --git a/sfx2/source/dialog/backingwindow.hxx 
b/sfx2/source/dialog/backingwindow.hxx
index 3e37596baa85..af1dddb29920 100644
--- a/sfx2/source/dialog/backingwindow.hxx
+++ b/sfx2/source/dialog/backingwindow.hxx
@@ -123,7 +123,6 @@ class BackingWindow : public InterimItemWindow
 void ApplyStyleSettings();
 
 private:
-long nRand;
 void applyFilter();
 
 public:


core.git: sfx2/source

2026-04-15 Thread Xisco Fauli (via logerrit)
 sfx2/source/dialog/backingwindow.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 8adc1747cb7eddfbd0ac3102956d4d13792e59c0
Author: Xisco Fauli 
AuthorDate: Tue Apr 14 13:13:51 2026 +0200
Commit: Xisco Fauli 
CommitDate: Wed Apr 15 09:34:45 2026 +0200

cid#1690940 Calling risky function

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

diff --git a/sfx2/source/dialog/backingwindow.cxx 
b/sfx2/source/dialog/backingwindow.cxx
index 6af7dcba24aa..4926ecea2989 100644
--- a/sfx2/source/dialog/backingwindow.cxx
+++ b/sfx2/source/dialog/backingwindow.cxx
@@ -45,6 +45,7 @@
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -208,8 +209,7 @@ BackingWindow::BackingWindow(vcl::Window* i_pParent)
 assert(DONATIONBANNER_FREQ > 0 && DONATIONBANNER_HEIGHT > 0 && 
DONATIONBANNER_HEIGHT < 1);
 if (bShowDonation)
 {
-std::srand(std::time({}));
-nRand = std::rand() % std::size(STR_DONATIONBANNER);
+nRand = comphelper::rng::uniform_int_distribution(0, 
std::size(STR_DONATIONBANNER) - 1);
 
 const auto t0 = std::chrono::system_clock::now().time_since_epoch();
 const sal_Int32 nDay = 
std::chrono::duration_cast(t0).count()/24; // days since 
1970-01-01


core.git: sfx2/source

2026-04-09 Thread Michael Weghorn (via logerrit)
 sfx2/source/control/charmapcontainer.cxx |   16 
 1 file changed, 4 insertions(+), 12 deletions(-)

New commits:
commit ad57df3ac718fcea593978e484c319cfeb432cb7
Author: Michael Weghorn 
AuthorDate: Wed Apr 8 13:46:09 2026 +0200
Commit: Michael Weghorn 
CommitDate: Thu Apr 9 10:19:45 2026 +0200

sfx2, special chars: Use activated item passed as signal handler param

Make use of the new param introduced in

Change-Id: I8ca62ac32108f01e2055d5ef9301de22eb5b1931
Author: Michael Weghorn 
Date:   Wed Apr 8 12:35:25 2026 +0200

weld: Pass activated item in IconView::signal_item_activated

to simplify the existing handlers/callbacks that get
called when a favorite/recent special character is activated
in the icon views used in the special characters dialog and
popup instead of having extra logic to get the (first) currently
selected item in the icon views.

Change-Id: I24941043fc67fbe43a4f0b335cb8d96d6f4a5c07
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/203318
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/sfx2/source/control/charmapcontainer.cxx 
b/sfx2/source/control/charmapcontainer.cxx
index a2a39fbcf2dd..7d057415f1a3 100644
--- a/sfx2/source/control/charmapcontainer.cxx
+++ b/sfx2/source/control/charmapcontainer.cxx
@@ -398,25 +398,17 @@ IMPL_STATIC_LINK(SfxCharmapContainer, 
ItemViewFocusOutHdl,  weld::Widget&, rWidg
 rIconView.unselect_all();
 }
 
-IMPL_LINK_NOARG(SfxCharmapContainer, RecentItemActivatedHdl, const 
weld::TreeIter&, bool)
+IMPL_LINK(SfxCharmapContainer, RecentItemActivatedHdl, const weld::TreeIter&, 
rIter, bool)
 {
-std::unique_ptr pIter = m_xRecentIconView->get_selected();
-if (!pIter)
-return false;
-
-const int nIndex = m_xRecentIconView->get_iter_index_in_parent(*pIter);
+const int nIndex = m_xRecentIconView->get_iter_index_in_parent(rIter);
 m_aCharActivateHdl.Call(m_aRecentChars.at(nIndex));
 
 return true;
 }
 
-IMPL_LINK_NOARG(SfxCharmapContainer, FavItemActivatedHdl, const 
weld::TreeIter&, bool)
+IMPL_LINK(SfxCharmapContainer, FavItemActivatedHdl, const weld::TreeIter&, 
rIter, bool)
 {
-std::unique_ptr pIter = m_xFavIconView->get_selected();
-if (!pIter)
-return false;
-
-const int nIndex = m_xFavIconView->get_iter_index_in_parent(*pIter);
+const int nIndex = m_xFavIconView->get_iter_index_in_parent(rIter);
 m_aCharActivateHdl.Call(m_aFavChars.at(nIndex));
 
 return true;


core.git: sfx2/source

2026-04-08 Thread Paolo Benvenuto (via logerrit)
 sfx2/source/dialog/styledlg.cxx |   12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

New commits:
commit 822df5f88261cff87e079740cd4585393b710eda
Author: Paolo Benvenuto 
AuthorDate: Wed Apr 8 21:10:28 2026 +0200
Commit: Ilmari Lauhakangas 
CommitDate: Thu Apr 9 06:40:53 2026 +0200

tdf#171281: fix Ok() for List/Page styles

List and Page styles hasn't inheritance implemented.
tdf#89826 didn't distinguish them from the styles that
admit inheritance. SfxStyleDialogController::Ok()
was calling GetItemSet() unconditionally
to apply chip-invalidation resets. This call caused
user modifications to be lost.

A UITest is not included because the List (SfxStyleFamily::Pseudo) and
Page (SfxStyleFamily::Page) style edit dialogs in Writer are opened
asynchronously, and the UITest framework cannot capture them via
execute_dialog_through_action or execute_dialog_through_command.
The fix has been verified by manual testing.

Fix found with the help of Claude Sonnet 4.6 extended.

Change-Id: I456bf200df9f5cd5543752bc8ed3380dcc5a3fe8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201673
Reviewed-by: Ilmari Lauhakangas 
Tested-by: Jenkins

diff --git a/sfx2/source/dialog/styledlg.cxx b/sfx2/source/dialog/styledlg.cxx
index 489cd69a84c2..87a48bc279c0 100644
--- a/sfx2/source/dialog/styledlg.cxx
+++ b/sfx2/source/dialog/styledlg.cxx
@@ -82,10 +82,16 @@ short SfxStyleDialogController::Ok()
 {
 SfxTabDialogController::Ok();
 
-SfxItemSet& rStyleSet = m_rStyle.GetItemSet();
-for (sal_uInt16 nWhich : m_aInvalidatedWhichIds)
+// tdf#171281: Page and List (Pseudo) styles do not support inheritance
+// via property chips, so applying chip-based resets would discard the
+// user's modifications instead of restoring parent values.
+const SfxStyleFamily nFamily = m_rStyle.GetFamily();
+if (nFamily != SfxStyleFamily::Pseudo &&
+nFamily != SfxStyleFamily::Page)
 {
-rStyleSet.ClearItem(nWhich);
+SfxItemSet& rStyleSet = m_rStyle.GetItemSet();
+for (sal_uInt16 nWhich : m_aInvalidatedWhichIds)
+rStyleSet.ClearItem(nWhich);
 }
 
 return RET_OK;


core.git: sfx2/source sw/CppunitTest_sw_ooxmlimport2.mk sw/qa

2026-03-24 Thread Mike Kaganski (via logerrit)
 sfx2/source/doc/objmisc.cxx |4 
 sw/CppunitTest_sw_ooxmlimport2.mk   |4 
 sw/qa/extras/ooxmlimport/data/tdf165348_broken_package.docx |binary
 sw/qa/extras/ooxmlimport/ooxmlimport2.cxx   |   57 
 4 files changed, 65 insertions(+)

New commits:
commit 31820f4fbcdbd2bb724d41de2059db47c9f60b75
Author: Mike Kaganski 
AuthorDate: Tue Mar 24 00:24:19 2026 +0500
Commit: Mike Kaganski 
CommitDate: Tue Mar 24 09:50:11 2026 +0100

tdf#165348: release the lock on original file before clearing URL

Commit 92e7f28f9aff78907bad030be80a9ea9452a3ddc (Related: tdf#104718
Use package repair request and behavior, 2023-11-29) made repaired
documents behave like templates, requiring user to explicitly choose
a name on save.

Since switching to template mode happens in this case rather late in
the loading procedure, at this point, lock file is already created
for the original file. Switching to template mode clears media URL;
and after that, media can't remove the lockfile.

This change releases the lock (and removes the lockfile) prior to
clearing URL.

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

diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index fe0b22311c96..5e8fad152502 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -1300,6 +1300,10 @@ void SfxObjectShell::TemplateDisconnectionAfterLoad()
 }
 }
 
+// tdf#165348: release the lock on the original file before clearing the 
URL, otherwise
+// UnlockFile (called later from Close) won't know which lock file to 
remove.
+pTmpMedium->UnlockFile(false);
+
 // set medium to noname
 pTmpMedium->SetName( OUString(), true );
 pTmpMedium->Init_Impl();
diff --git a/sw/CppunitTest_sw_ooxmlimport2.mk 
b/sw/CppunitTest_sw_ooxmlimport2.mk
index 39be13e05bee..0bde88310366 100644
--- a/sw/CppunitTest_sw_ooxmlimport2.mk
+++ b/sw/CppunitTest_sw_ooxmlimport2.mk
@@ -15,6 +15,10 @@ ifneq ($(OS),MACOSX)
 $(eval $(call gb_CppunitTest_use_common_precompiled_header,sw_ooxmlimport2))
 endif
 
+$(eval $(call gb_CppunitTest_use_custom_headers,sw_ooxmlimport2,\
+officecfg/registry \
+))
+
 $(eval $(call gb_CppunitTest_add_exception_objects,sw_ooxmlimport2, \
 sw/qa/extras/ooxmlimport/ooxmlimport2 \
 ))
diff --git a/sw/qa/extras/ooxmlimport/data/tdf165348_broken_package.docx 
b/sw/qa/extras/ooxmlimport/data/tdf165348_broken_package.docx
new file mode 100644
index ..60d05ad2e9f1
Binary files /dev/null and 
b/sw/qa/extras/ooxmlimport/data/tdf165348_broken_package.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
index 2b004ad44c6f..5968057d33aa 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
@@ -20,14 +20,24 @@
 
 #include 
 #include 
+#include 
+#include 
+#include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
 
 #include 
+#include 
+#include 
+#include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -1436,6 +1446,53 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf169173)
 
CPPUNIT_ASSERT(xServiceInfo->supportsService(u"com.sun.star.text.textfield.DropDown"_ustr));
 }
 
+CPPUNIT_TEST_FIXTURE(Test, testTdf165348_lockFileOnRepair)
+{
+// Enable locking - disabled by default in the test environment
+auto setConfig = [](bool b) {
+auto xChanges = comphelper::ConfigurationChanges::create();
+officecfg::Office::Common::Misc::UseLocking::set(b, xChanges);
+officecfg::Office::Common::Misc::UseDocumentOOoLockFile::set(b, 
xChanges);
+xChanges->commit();
+};
+setConfig(true);
+comphelper::ScopeGuard restoreConfig([&] { setConfig(false); });
+
+// Copy the broken DOCX to a temp location so the lock file is in a 
writable temp directory
+createTempCopy(u"tdf165348_broken_package.docx");
+OUString aTempURL = maTempFile.GetURL();
+
+// Interaction handler that auto-approves BrokenPackageRequest (repair 
dialog)
+class ApproveRepairHandler : public 
cppu::WeakImplHelper
+{
+public:
+void SAL_CALL handle(const uno::Reference& 
xRequest) override
+{
+for (auto& xCont : xRequest->getContinuations())
+{
+if (auto xApprove = xCont.query())
+{
+xApprove->select();
+return;
+}
+}
+}
+};
+
+// Load with an interaction handler that auto-approves the repair dialog
+loadFromURL(aTempURL, { 
comphelper::makePropertyValue(u"InteractionHandler"_ustr,
+  
uno::Reference(
+   

core.git: sfx2/source sw/qa

2026-03-18 Thread shark (via logerrit)
 sfx2/source/doc/templatedlg.cxx |   19 +++
 sw/qa/uitest/writer_tests2/tdf146375.py |4 ++--
 2 files changed, 9 insertions(+), 14 deletions(-)

New commits:
commit 00fa1ef3862a8617c93883c23f3e316449e4e74a
Author: shark 
AuthorDate: Mon Feb 2 20:50:46 2026 +
Commit: Michael Weghorn 
CommitDate: Wed Mar 18 10:34:15 2026 +0100

tdf#158280 Replace InputDialog with SvxNameDialog in sfx2

Change-Id: I53d96caa782b52a8feb1c5034e429c06772a7b1b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198880
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 3c714fd3af46..afce1847bc75 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -9,8 +9,8 @@
 
 #include 
 
-#include 
 #include 
+#include 
 
 #include 
 #include 
@@ -1044,14 +1044,12 @@ void SfxTemplateManagerDlg::OnTemplateOpen ()
 
 void SfxTemplateManagerDlg::OnCategoryNew()
 {
-InputDialog dlg(m_xDialog.get(), SfxResId(STR_INPUT_NEW));
-dlg.set_title(SfxResId(STR_WINDOW_TITLE_RENAME_NEW_CATEGORY));
-int ret = dlg.run();
+SvxNameDialog dlg(m_xDialog.get(), u""_ustr, SfxResId(STR_INPUT_NEW), 
SfxResId(STR_WINDOW_TITLE_RENAME_NEW_CATEGORY));
 
-if (!ret)
+if(dlg.run() != RET_OK)
 return;
 
-OUString aName = dlg.GetEntryText();
+OUString aName = dlg.GetName();
 
 if (maLocalView.createRegion(aName))
 mxCBFolder->append_text(aName);
@@ -1068,15 +1066,12 @@ void SfxTemplateManagerDlg::OnCategoryNew()
 void SfxTemplateManagerDlg::OnCategoryRename()
 {
 OUString sCategory = mxCBFolder->get_active_text();
-InputDialog dlg(m_xDialog.get(), SfxResId(STR_INPUT_NEW));
-dlg.set_title(SfxResId(STR_WINDOW_TITLE_RENAME_CATEGORY));
-dlg.SetEntryText(sCategory);
-int ret = dlg.run();
+SvxNameDialog dlg(m_xDialog.get(), sCategory, SfxResId(STR_INPUT_NEW), 
SfxResId(STR_WINDOW_TITLE_RENAME_CATEGORY));
 
-if (!ret)
+if (dlg.run() != RET_OK)
 return;
 
-OUString aName = dlg.GetEntryText();
+OUString aName = dlg.GetName();
 
 if (maLocalView.renameRegion(sCategory, aName))
 {
diff --git a/sw/qa/uitest/writer_tests2/tdf146375.py 
b/sw/qa/uitest/writer_tests2/tdf146375.py
index 5fbc0ae9a6bc..b683052e14d4 100644
--- a/sw/qa/uitest/writer_tests2/tdf146375.py
+++ b/sw/qa/uitest/writer_tests2/tdf146375.py
@@ -33,7 +33,7 @@ class Tdf146375(UITestCase):
 # Create a new category
 with self.ui_test.execute_blocking_action(
 xActionMenu.executeAction, args=('OPENFROMLIST', 
mkPropertyValues({"POS": "0"}))) as xNameDialog:
-xEntry = xNameDialog.getChild("entry")
+xEntry = xNameDialog.getChild("name_entry")
 xEntry.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"CTRL+A"}))
 xEntry.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"BACKSPACE"}))
 xEntry.executeAction("TYPE", mkPropertyValues({"TEXT": 
categoryName}))
@@ -46,7 +46,7 @@ class Tdf146375(UITestCase):
 # Rename the category
 with self.ui_test.execute_blocking_action(
 xActionMenu.executeAction, args=('OPENFROMLIST', 
mkPropertyValues({"POS": "1"}))) as xNameDialog:
-xEntry = xNameDialog.getChild("entry")
+xEntry = xNameDialog.getChild("name_entry")
 xEntry.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"CTRL+A"}))
 xEntry.executeAction("TYPE", 
mkPropertyValues({"KEYCODE":"BACKSPACE"}))
 xEntry.executeAction("TYPE", mkPropertyValues({"TEXT": 
renamedCategory}))


core.git: sfx2/source

2026-03-10 Thread Paolo Benvenuto (via logerrit)
 sfx2/source/dialog/tabdlg.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 467af6b5443bd09221e359db4b98e1999e7a8ab9
Author: Paolo Benvenuto 
AuthorDate: Tue Mar 10 16:58:37 2026 +0100
Commit: Michael Weghorn 
CommitDate: Wed Mar 11 05:57:03 2026 +0100

tdf#89826 Translate Italian code comments to English in tabdlg.cxx

Translate remaining Italian comments introduced in
commit 52010fde0917051e043674c8da42d9a06340b571 to English:

- "Passata 1/2" → "Pass 1/2"
- "copre le tab che accedono via Get/GetItemState" →
  "covers tab pages that access items via Get/GetItemState"
- "copre le tab che accedono ItemSet interni" →
  "covers tab pages that access internal ItemSets"
- "Solo se non già classificato dal tracker" →
  "Only if not already classified by the tracker"
- "Restore delle tab page" → "Restore tab pages"

Change-Id: Ie3d6ba04f8de7561231ebc5a1a99367704377c22
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201369
Reviewed-by: Michael Weghorn 
Tested-by: Jenkins

diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index 6a0a5ed92c98..ff5b0504bfd7 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -962,7 +962,7 @@ void SfxTabDialogController::BuildWhichToTabMap()
 
 const SfxItemPool* pPool = m_pSet ? m_pSet->GetPool() : nullptr;
 
-// Passata 1: tracker (copre le tab che accedono via Get/GetItemState)
+// Pass 1: tracker (covers tab pages that access items via 
Get/GetItemState)
 for (auto const& elem : m_pImpl->aData)
 {
 if (!elem->xTabPage)
@@ -984,7 +984,7 @@ void SfxTabDialogController::BuildWhichToTabMap()
 }
 }
 
-// Passata 2: GetRanges (copre le tab che accedono ItemSet interni)
+// Pass 2: GetRanges (covers tab pages that access internal ItemSets)
 if (pPool)
 {
 for (auto const& elem : m_pImpl->aData)
@@ -998,7 +998,7 @@ void SfxTabDialogController::BuildWhichToTabMap()
 for (sal_uInt16 nSlot = rPair.first; nSlot <= rPair.second; 
++nSlot)
 {
 sal_uInt16 nWhich = pPool->GetWhichIDFromSlotID(nSlot);
-// Solo se non già classificato dal tracker
+// Only if not already classified by the tracker
 if (m_aWhichToTabMap.find(nWhich) == 
m_aWhichToTabMap.end())
 m_aWhichToTabMap[nWhich] = elem->sId;
 }
@@ -1006,7 +1006,7 @@ void SfxTabDialogController::BuildWhichToTabMap()
 }
 }
 
-// Restore delle tab page
+// Restore tab pages
 for (auto const& elem : m_pImpl->aData)
 {
 if (!elem->xTabPage)


core.git: sfx2/source

2026-03-04 Thread Michael Weghorn (via logerrit)
 sfx2/source/dialog/StyleList.cxx |   37 -
 sfx2/source/inc/StyleList.hxx|4 ++--
 2 files changed, 26 insertions(+), 15 deletions(-)

New commits:
commit 7c5de1a693da21b60378d6d270a6a4f8a7e2ba6a
Author: Michael Weghorn 
AuthorDate: Wed Mar 4 21:56:11 2026 +0100
Commit: Michael Weghorn 
CommitDate: Thu Mar 5 06:59:42 2026 +0100

tdf#170820 a11y: Only use mouse position for StyleList menu if 
mouse-triggered

The context menu can be triggered either via the mouse
or via the keyboard. So far, the logic in StyleList
was unconditionally trying to select the entry under
the current mouse position before triggering the menu.

That however doesn't make sense when the context menu
was triggered using the keyboard, in which case the
context menu should be triggered for the already
selected entry.

Therefore, make selecting the entry under the mouse
position conditional on the context menu being a
mouse-triggered event.

In case of a keyboard-triggered menu, also use the
center of the currently selected entry for the
menu position instead of the current mouse position.

Change-Id: I677e13859b0727cb7c94645551d8d74fd4b3fbe1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200988
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/sfx2/source/dialog/StyleList.cxx b/sfx2/source/dialog/StyleList.cxx
index 35e969be328e..0888068d4ae2 100644
--- a/sfx2/source/dialog/StyleList.cxx
+++ b/sfx2/source/dialog/StyleList.cxx
@@ -601,17 +601,28 @@ void StyleList::DropHdl(const OUString& rStyle, const 
OUString& rParent)
 m_bDontUpdate = false;
 }
 
-void StyleList::PrepareMenu(const Point& rPos)
+Point StyleList::PrepareMenu(const CommandEvent& rContextMenuEvent)
 {
 weld::TreeView* pTreeView = m_xTreeBox->get_visible() ? m_xTreeBox.get() : 
m_xFmtLb.get();
-std::unique_ptr xIter = 
pTreeView->get_dest_row_at_pos(rPos, false);
-if (xIter && !pTreeView->is_selected(*xIter))
+if (rContextMenuEvent.IsMouseEvent())
 {
-pTreeView->unselect_all();
-pTreeView->set_cursor(*xIter);
-pTreeView->select(*xIter);
+const Point& rPos = rContextMenuEvent.GetMousePosPixel();
+std::unique_ptr xIter = 
pTreeView->get_dest_row_at_pos(rPos, false);
+if (xIter && !pTreeView->is_selected(*xIter))
+{
+pTreeView->unselect_all();
+pTreeView->set_cursor(*xIter);
+pTreeView->select(*xIter);
+}
+FmtSelectHdl(*pTreeView);
+return rPos;
+}
+else
+{
+if (std::unique_ptr pSelected = 
pTreeView->get_selected())
+return pTreeView->get_row_area(*pSelected).Center();
+return {};
 }
-FmtSelectHdl(*pTreeView);
 }
 
 /** Internal structure for the establishment of the hierarchical view */
@@ -1582,12 +1593,12 @@ IMPL_LINK_NOARG(StyleList, Clear, void*, void)
 
 IMPL_LINK(StyleList, OnPopupEnd, const OUString&, sCommand, void) { 
MenuSelect(sCommand); }
 
-void StyleList::ShowMenu(const CommandEvent& rCEvt)
+void StyleList::ShowMenu(const Point& rPos)
 {
 CreateContextMenu();
 weld::TreeView* pTreeView = m_xTreeBox->get_visible() ? m_xTreeBox.get() : 
m_xFmtLb.get();
 mxMenu->connect_activate(LINK(this, StyleList, OnPopupEnd));
-mxMenu->popup_at_rect(pTreeView, 
tools::Rectangle(rCEvt.GetMousePosPixel(), Size(1, 1)));
+mxMenu->popup_at_rect(pTreeView, tools::Rectangle(rPos, Size(1, 1)));
 }
 
 void StyleList::MenuSelect(const OUString& rIdent)
@@ -1990,7 +2001,7 @@ IMPL_LINK(StyleList, PopupFlatMenuHdl, const 
CommandEvent&, rCEvt, bool)
 if (rCEvt.GetCommand() != CommandEventId::ContextMenu)
 return false;
 
-PrepareMenu(rCEvt.GetMousePosPixel());
+const Point aPos = PrepareMenu(rCEvt);
 
 if (m_xFmtLb->count_selected_rows() <= 0)
 {
@@ -1998,7 +2009,7 @@ IMPL_LINK(StyleList, PopupFlatMenuHdl, const 
CommandEvent&, rCEvt, bool)
 m_pParentDialog->EnableDel(false, this);
 }
 
-ShowMenu(rCEvt);
+ShowMenu(aPos);
 
 return true;
 }
@@ -2008,9 +2019,9 @@ IMPL_LINK(StyleList, PopupTreeMenuHdl, const 
CommandEvent&, rCEvt, bool)
 if (rCEvt.GetCommand() != CommandEventId::ContextMenu)
 return false;
 
-PrepareMenu(rCEvt.GetMousePosPixel());
+const Point aPos = PrepareMenu(rCEvt);
 
-ShowMenu(rCEvt);
+ShowMenu(aPos);
 
 return true;
 }
diff --git a/sfx2/source/inc/StyleList.hxx b/sfx2/source/inc/StyleList.hxx
index 737bc99e3782..f562537834ae 100644
--- a/sfx2/source/inc/StyleList.hxx
+++ b/sfx2/source/inc/StyleList.hxx
@@ -152,8 +152,8 @@ private:
 void DropHdl(const OUString& rStyle, const OUString& rParent);
 
 void MenuSelect(const OUString& rIdent);
-void PrepareMenu(const Point& rPos);
-void ShowMenu(const CommandEvent& rCEvt);
+Point PrepareMenu(const CommandEvent& rContextMenuEvent);
+void ShowMenu(const 

core.git: sfx2/source

2026-03-02 Thread Noel Grandin (via logerrit)
 sfx2/source/control/recentdocsviewitem.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 16cc2fbe405248f58d2166da0bfa4106fd65c519
Author: Noel Grandin 
AuthorDate: Mon Mar 2 12:06:55 2026 +0200
Commit: Noel Grandin 
CommitDate: Mon Mar 2 14:28:38 2026 +0100

tdf#170406 Thumbnails for some documents rendered with artifacts

regression from
  commit 07fd24a4bc2d0b0484d39b68a81fdca3c610
  Author: Noel Grandin 
  Date:   Sat Aug 2 09:15:36 2025 +0200
  BitmapEx->Bitmap in ThumbnailView

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

diff --git a/sfx2/source/control/recentdocsviewitem.cxx 
b/sfx2/source/control/recentdocsviewitem.cxx
index cad00c464128..ec913958622d 100644
--- a/sfx2/source/control/recentdocsviewitem.cxx
+++ b/sfx2/source/control/recentdocsviewitem.cxx
@@ -203,6 +203,7 @@ RecentDocsViewItem::RecentDocsViewItem(sfx2::RecentDocsView 
&rView, const OUStri
 
 // create empty, and copy the default thumbnail in
 aThumbnail = Bitmap(aThumbnailSize, vcl::PixelFormat::N32_BPP);
+aThumbnail.Erase(COL_TRANSPARENT);
 
 aThumbnail.CopyPixel(
 ::tools::Rectangle(Point((aThumbnailSize.Width() - 
aExtSize.Width()) / 2, (aThumbnailSize.Height() - aExtSize.Height()) / 2), 
aExtSize),


core.git: sfx2/source

2026-02-28 Thread Mike Kaganski (via logerrit)
 sfx2/source/dialog/filedlghelper.cxx |   13 -
 1 file changed, 4 insertions(+), 9 deletions(-)

New commits:
commit 128cd3602a29b5e6c08ef7f252a3d1ad5dca2a5e
Author: Mike Kaganski 
AuthorDate: Sat Feb 28 20:01:01 2026 +0500
Commit: Mike Kaganski 
CommitDate: Sat Feb 28 18:08:31 2026 +0100

Drop unneeded variable

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

diff --git a/sfx2/source/dialog/filedlghelper.cxx 
b/sfx2/source/dialog/filedlghelper.cxx
index e2c5f3f23d4a..67d4787654da 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -2081,7 +2081,6 @@ void SaveLastDirectory(OUString const& sContext, OUString 
const& sDirectory)
 void FileDialogHelper_Impl::saveConfig()
 {
 uno::Reference < XFilePickerControlAccess > xDlg( mxFileDlg, UNO_QUERY );
-Any aValue;
 
 if ( ! xDlg.is() )
 return;
@@ -2093,15 +2092,13 @@ void FileDialogHelper_Impl::saveConfig()
 try
 {
 // tdf#61358 - remember the last "insert as link" state
-aValue = 
xDlg->getValue(ExtendedFilePickerElementIds::CHECKBOX_LINK, 0);
 bool bLink = false;
-aValue >>= bLink;
+xDlg->getValue(ExtendedFilePickerElementIds::CHECKBOX_LINK, 0) >>= 
bLink;
 OUString aUserData(GRF_CONFIG_STR);
 SetToken(aUserData, 0, ' ', 
OUString::number(static_cast(bLink)));
 
-aValue = xDlg->getValue( 
ExtendedFilePickerElementIds::CHECKBOX_PREVIEW, 0 );
 bool bValue = false;
-aValue >>= bValue;
+xDlg->getValue(ExtendedFilePickerElementIds::CHECKBOX_PREVIEW, 0) 
>>= bValue;
 SetToken( aUserData, 1, ' ', OUString::number( 
static_cast(bValue) ) );
 
 INetURLObject aObj( getPath() );
@@ -2135,9 +2132,8 @@ void FileDialogHelper_Impl::saveConfig()
 {
 try
 {
-aValue = xDlg->getValue( 
ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION, 0 );
 bool bAutoExt = true;
-aValue >>= bAutoExt;
+
xDlg->getValue(ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION, 0) >>= 
bAutoExt;
 SetToken( aUserData, 0, ' ', OUString::number( 
static_cast(bAutoExt) ) );
 bWriteConfig = true;
 }
@@ -2158,9 +2154,8 @@ void FileDialogHelper_Impl::saveConfig()
 {
 try
 {
-aValue = xDlg->getValue( 
ExtendedFilePickerElementIds::CHECKBOX_SELECTION, 0 );
 bool bSelection = true;
-aValue >>= bSelection;
+
xDlg->getValue(ExtendedFilePickerElementIds::CHECKBOX_SELECTION, 0) >>= 
bSelection;
 if ( comphelper::string::getTokenCount(aUserData, ' ') < 3 )
 aUserData += " ";
 SetToken( aUserData, 2, ' ', OUString::number( 
static_cast(bSelection) ) );


core.git: sfx2/source

2026-02-24 Thread Michael Weghorn (via logerrit)
 sfx2/source/appl/appdde.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 5cd76b925e3b8b20bc5ab91a49d91b2d52e2e69d
Author: Michael Weghorn 
AuthorDate: Tue Feb 24 11:01:39 2026 +
Commit: Michael Weghorn 
CommitDate: Tue Feb 24 15:26:13 2026 +0100

sfx2: Add missing include for SfxPoolItemHolder

Fixes this build failure seen in a local --enable-pch=no
Windows build:


C:/Users/mwegh/development/git/libreoffice/sfx2/source/appl/appdde.cxx(148): 
error C2079: 'aResult' uses undefined class 'SfxPoolItemHolder'

C:/Users/mwegh/development/git/libreoffice/sfx2/source/appl/appdde.cxx(148): 
error C2027: use of undefined type 'SfxPoolItemHolder'

C:\Users\mwegh\development\git\libreoffice\include\sfx2/shell.hxx(53): note: 
see declaration of 'SfxPoolItemHolder'

C:/Users/mwegh/development/git/libreoffice/sfx2/source/appl/appdde.cxx(152): 
error C2737: 'item': const object must be initialized

C:/Users/mwegh/development/git/libreoffice/sfx2/source/appl/appdde.cxx(153): 
error C3536: 'item': cannot be used before it is initialized

Change-Id: I2c86c79d7381349bc24079c399b24f2df630fe07
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200174
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/sfx2/source/appl/appdde.cxx b/sfx2/source/appl/appdde.cxx
index 896aa6db0e3d..ccb6b220265f 100644
--- a/sfx2/source/appl/appdde.cxx
+++ b/sfx2/source/appl/appdde.cxx
@@ -47,6 +47,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 


core.git: sfx2/source

2026-02-24 Thread Caolán McNamara (via logerrit)
 sfx2/source/view/lokstarmathhelper.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d5131b7a5fe6f0bc1afc9bf33df2a7e423f3edb6
Author: Caolán McNamara 
AuthorDate: Mon Feb 23 20:36:05 2026 +
Commit: Caolán McNamara 
CommitDate: Tue Feb 24 09:25:45 2026 +0100

fix content all transparent in kit mode after drawing math object

commit e0d4d178caff1414a9a21fa57f06bc8d4d2c389a
Date:   Mon Jan 13 15:03:05 2025 +0200

Change alpha behavour of OutputDevice::SetFillColor

It is pretty ugly bad on several levels.

added a false argument to the similar calls for chart, etc, but not
to this one, probably because it wasn't there at the time. So this
route cleared the destination buffer.

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

diff --git a/sfx2/source/view/lokstarmathhelper.cxx 
b/sfx2/source/view/lokstarmathhelper.cxx
index 9ef0f9311665..60a108d3de27 100644
--- a/sfx2/source/view/lokstarmathhelper.cxx
+++ b/sfx2/source/view/lokstarmathhelper.cxx
@@ -221,7 +221,7 @@ void 
LokStarMathHelper::PaintAllInPlaceOnTile(VirtualDevice& rDevice, int nOutpu
 const int nPartForCurView = pCurView->getPart();
 
 // Resizes the virtual device to contain the entries context
-rDevice.SetOutputSizePixel({ nOutputWidth, nOutputHeight });
+rDevice.SetOutputSizePixel({ nOutputWidth, nOutputHeight }, /*bErase*/ 
false);
 
 auto popIt = rDevice.ScopedPush(vcl::PushFlags::MAPMODE);
 MapMode aMapMode(rDevice.GetMapMode());


core.git: sfx2/source

2026-02-17 Thread Balazs Varga (via logerrit)
 sfx2/source/dialog/passwd.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 1c2385a1faf0d38a6b627df082f7db54beee1ab8
Author: Balazs Varga 
AuthorDate: Mon Feb 16 10:12:00 2026 +0100
Commit: Balazs Varga 
CommitDate: Tue Feb 17 09:07:21 2026 +0100

tdf#170819 - fix unprotect sheet dialog has two icons

"show password"

follow-up of 6eb1a3c4b08f004c074dac41dee31bacb38216a5
(tdf#146947 - UI: Ability to show/reveal characters being typed into)

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

diff --git a/sfx2/source/dialog/passwd.cxx b/sfx2/source/dialog/passwd.cxx
index fcbfc60a0ba9..8a11704fcee6 100644
--- a/sfx2/source/dialog/passwd.cxx
+++ b/sfx2/source/dialog/passwd.cxx
@@ -335,6 +335,9 @@ void SfxPasswordDialog::PreRun()
 m_xConfirm2FT->hide();
 m_xConfirm2ED->hide();
 m_xPassword2StrengthBar->hide();
+m_xBtn2->hide();
+m_xBtn3->hide();
+m_xBtn4->hide();
 
 if (mnExtras != SfxShowExtras::NONE)
 m_xPassword1FT->show();
@@ -348,18 +351,21 @@ void SfxPasswordDialog::PreRun()
 m_xConfirm1FT->show();
 m_xConfirm1ED->show();
 m_xPassword1StrengthBar->show();
+m_xBtn2->show();
 }
 if (mnExtras & SfxShowExtras::PASSWORD2)
 {
 m_xPassword2Box->show();
 m_xPassword2FT->show();
 m_xPassword2ED->show();
+m_xBtn3->show();
 }
 if (mnExtras & SfxShowExtras::CONFIRM2)
 {
 m_xConfirm2FT->show();
 m_xConfirm2ED->show();
 m_xPassword2StrengthBar->show();
+m_xBtn4->show();
 }
 }
 


core.git: sfx2/source

2026-02-07 Thread Simon Chenery (via logerrit)
 sfx2/source/dialog/dinfdlg.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit bf9c80c873e218b7303dae5c13398a6c9edd1865
Author: Simon Chenery 
AuthorDate: Fri Feb 6 18:04:32 2026 +0100
Commit: Mike Kaganski 
CommitDate: Sat Feb 7 12:40:33 2026 +0100

tdf#145538 Use structured binding in range based for loop in dinfdlg.cxx

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

diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index f17047e9ab51..2f68b27b3172 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -1483,10 +1483,10 @@ namespace
 
 void fillTypeBox(weld::ComboBox& rTypeBox)
 {
-for (const auto& rCustomProperty : SFX_LB_PROPERTY_STRINGARRAY)
+for (const auto& [rResId, rProperty] : SFX_LB_PROPERTY_STRINGARRAY)
 {
-OUString sId(OUString::number(rCustomProperty.second));
-rTypeBox.append(sId, SfxResId(rCustomProperty.first));
+OUString sId(OUString::number(rProperty));
+rTypeBox.append(sId, SfxResId(rResId));
 }
 rTypeBox.set_active(0);
 Size aSize(rTypeBox.get_preferred_size());


core.git: sfx2/source

2026-01-29 Thread Miklos Vajna (via logerrit)
 sfx2/source/doc/objmisc.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 01d66be56971875a690f3e698093492e39485efa
Author: Miklos Vajna 
AuthorDate: Thu Jan 29 09:54:57 2026 +0100
Commit: Miklos Vajna 
CommitDate: Thu Jan 29 15:46:38 2026 +0100

sfx2: fix crash in SfxObjectShell::PostActivateEvent_Impl()

gdb backtrace on the core file from the crashreport:

#0  0x7078323c6c4e in std::__shared_ptr::operator bool (this=)
at 
/opt/rh/devtoolset-12/root/usr/include/c++/12/bits/shared_ptr_base.h:1670
#1  SfxMedium::GetItemSet (this=0x0) at 
sfx2/source/doc/docfile.cxx:3840
#2  0x707832428792 in SfxObjectShell::PostActivateEvent_Impl 
(this=0x3e357de0, pFrame=pFrame@entry=0x427b7460)
at sfx2/source/doc/objmisc.cxx:933
#3  0x707832214661 in SfxApplication::SetViewFrame_Impl 
(this=0x3c0a39d0, pFrame=pFrame@entry=0x427b7460)
at sfx2/source/appl/app.cxx:273
#4  0x70783254804f in SfxViewFrame::SetViewFrame 
(pFrame=0x427b7460) at sfx2/source/view/viewfrm.cxx:3735

and:

#2  0x707832428792 in SfxObjectShell::PostActivateEvent_Impl 
(this=0x3e357de0, pFrame=pFrame@entry=0x427b7460)
at sfx2/source/doc/objmisc.cxx:933
933 const SfxBoolItem* pHiddenItem = 
pMedium->GetItemSet().GetItem(SID_HIDDEN, false);
(gdb) print pMedium
$1 = (SfxMedium *) 0x0

Assume that no medium means the same as medium having no hiddem item.

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

diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 2c4a8a9b646e..405b312305e2 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -931,7 +931,7 @@ void SfxObjectShell::PostActivateEvent_Impl( SfxViewFrame 
const * pFrame )
 if ( pSfxApp->IsDowning() || IsLoading() || !pFrame || 
pFrame->GetFrame().IsClosing_Impl() )
 return;
 
-const SfxBoolItem* pHiddenItem = pMedium->GetItemSet().GetItem(SID_HIDDEN, 
false);
+const SfxBoolItem* pHiddenItem = pMedium ? 
pMedium->GetItemSet().GetItem(SID_HIDDEN, false) : nullptr;
 if ( !pHiddenItem || !pHiddenItem->GetValue() )
 {
 SfxEventHintId nId = pImpl->nEventId;


core.git: sfx2/source

2026-01-28 Thread Simon Chenery (via logerrit)
 sfx2/source/dialog/dinfdlg.cxx |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 7c6ebdfb0a7b8abbb5141bbec13467438288fa84
Author: Simon Chenery 
AuthorDate: Sat Jan 24 17:23:24 2026 +0100
Commit: David Gilbert 
CommitDate: Wed Jan 28 23:51:39 2026 +0100

tdf#145538 Use range based for loops in dinfdlg.cxx

Change-Id: Ie9d7a60d2fd3609ea2eb4de48ccb20a554be40b6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198046
Reviewed-by: David Gilbert 
Tested-by: Jenkins

diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index a30bdf65d19b..f17047e9ab51 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -1475,18 +1475,18 @@ namespace
 {
 void fillNameBox(weld::ComboBox& rNameBox)
 {
-for (size_t i = 0; i < SAL_N_ELEMENTS(SFX_CB_PROPERTY_STRINGARRAY); 
++i)
-rNameBox.append_text(SfxResId(SFX_CB_PROPERTY_STRINGARRAY[i]));
+for (const auto& rResId : SFX_CB_PROPERTY_STRINGARRAY)
+rNameBox.append_text(SfxResId(rResId));
 Size aSize(rNameBox.get_preferred_size());
 rNameBox.set_size_request(aSize.Width(), aSize.Height());
 }
 
 void fillTypeBox(weld::ComboBox& rTypeBox)
 {
-for (size_t i = 0; i < SAL_N_ELEMENTS(SFX_LB_PROPERTY_STRINGARRAY); 
++i)
+for (const auto& rCustomProperty : SFX_LB_PROPERTY_STRINGARRAY)
 {
-OUString 
sId(OUString::number(SFX_LB_PROPERTY_STRINGARRAY[i].second));
-rTypeBox.append(sId, 
SfxResId(SFX_LB_PROPERTY_STRINGARRAY[i].first));
+OUString sId(OUString::number(rCustomProperty.second));
+rTypeBox.append(sId, SfxResId(rCustomProperty.first));
 }
 rTypeBox.set_active(0);
 Size aSize(rTypeBox.get_preferred_size());


core.git: sfx2/source

2026-01-28 Thread Simon Chenery (via logerrit)
 sfx2/source/dialog/filedlghelper.cxx |   14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 1b08e449773c9403340824fa2ec0452f305da85b
Author: Simon Chenery 
AuthorDate: Sat Jan 24 12:56:16 2026 +0100
Commit: Julien Nabet 
CommitDate: Wed Jan 28 18:40:08 2026 +0100

tdf#168771 Convert enum to enum class in filedlghelper.cxx

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

diff --git a/sfx2/source/dialog/filedlghelper.cxx 
b/sfx2/source/dialog/filedlghelper.cxx
index 6ad406742e63..bda46c50aab4 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -882,7 +882,7 @@ bool lcl_isAsyncFilePicker( const uno::Reference< 
XExecutableDialog >& _rxFP )
 return false;
 }
 
-enum open_or_save_t {OPEN, SAVE, UNDEFINED};
+enum class open_or_save_t {OPEN, SAVE, UNDEFINED};
 
 }
 
@@ -899,18 +899,18 @@ static open_or_save_t lcl_OpenOrSave(sal_Int16 const 
nDialogType)
 case FILEOPEN_READONLY_VERSION_FILTEROPTIONS:
 case FILEOPEN_LINK_PREVIEW:
 case FILEOPEN_PREVIEW:
-return OPEN;
+return open_or_save_t::OPEN;
 case FILESAVE_SIMPLE:
 case FILESAVE_AUTOEXTENSION_PASSWORD:
 case FILESAVE_AUTOEXTENSION_PASSWORD_FILTEROPTIONS:
 case FILESAVE_AUTOEXTENSION_SELECTION:
 case FILESAVE_AUTOEXTENSION_TEMPLATE:
 case FILESAVE_AUTOEXTENSION:
-return SAVE;
+return open_or_save_t::SAVE;
 default:
 assert(false); // invalid dialog type
 }
-return UNDEFINED;
+return open_or_save_t::UNDEFINED;
 }
 
 // FileDialogHelper_Impl
@@ -984,7 +984,7 @@ FileDialogHelper_Impl::FileDialogHelper_Impl(
 
 // default settings
 m_nDontFlags = SFX_FILTER_NOTINSTALLED | SfxFilterFlags::INTERNAL | 
SfxFilterFlags::NOTINFILEDLG;
-if (OPEN == lcl_OpenOrSave(m_nDialogType))
+if (open_or_save_t::OPEN == lcl_OpenOrSave(m_nDialogType))
 m_nMustFlags = SfxFilterFlags::IMPORT;
 else
 m_nMustFlags = SfxFilterFlags::EXPORT;
@@ -1876,7 +1876,7 @@ void FileDialogHelper_Impl::addFilters( const OUString& 
rFactory,
 
 // append the filters
 OUString sFirstFilter;
-if (OPEN == lcl_OpenOrSave(m_nDialogType))
+if (open_or_save_t::OPEN == lcl_OpenOrSave(m_nDialogType))
 ::sfx2::appendFiltersForOpen( aIter, mxFileDlg, sFirstFilter, *this );
 else if ( mbExport )
 ::sfx2::appendExportFilters( aIter, mxFileDlg, sFirstFilter, *this );
@@ -2474,7 +2474,7 @@ FileDialogHelper::FileDialogHelper(
 aWildcard += aExtName;
 
 OUString const aUIString = ::sfx2::addExtension(
-aFilterUIName, aWildcard, (OPEN == 
lcl_OpenOrSave(mpImpl->m_nDialogType)), *mpImpl);
+aFilterUIName, aWildcard, (open_or_save_t::OPEN == 
lcl_OpenOrSave(mpImpl->m_nDialogType)), *mpImpl);
 AddFilter( aUIString, aWildcard );
 }
 


core.git: sfx2/source

2026-01-27 Thread Heiko Tietze (via logerrit)
 sfx2/source/dialog/StyleList.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 8855e318f81651f7aff33cf12d27a37b4abe87fa
Author: Heiko Tietze 
AuthorDate: Mon Jan 12 12:55:16 2026 +0100
Commit: Heiko Tietze 
CommitDate: Wed Jan 28 07:25:19 2026 +0100

Related tdf#170143 - Stylist text color should consider themed colors

DialogColor is not part of the themed colors, and WindowTextColor
might be better suited anyway

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

diff --git a/sfx2/source/dialog/StyleList.cxx b/sfx2/source/dialog/StyleList.cxx
index b7a531512cb1..589b847f4a62 100644
--- a/sfx2/source/dialog/StyleList.cxx
+++ b/sfx2/source/dialog/StyleList.cxx
@@ -1795,7 +1795,7 @@ IMPL_LINK(StyleList, CustomRenderHdl, 
weld::TreeView::render_args, aPayload, voi
 if (bSelected)
 rRenderContext.SetTextColor(rStyleSettings.GetHighlightTextColor());
 else
-rRenderContext.SetTextColor(rStyleSettings.GetDialogTextColor());
+rRenderContext.SetTextColor(rStyleSettings.GetWindowTextColor());
 
 bool bSuccess = false;
 


core.git: sfx2/source starmath/inc

2026-01-18 Thread Gabor Kelemen (via logerrit)
 sfx2/source/doc/graphhelp.hxx|1 +
 starmath/inc/mathml/export.hxx   |2 ++
 starmath/inc/mathml/import.hxx   |2 ++
 starmath/inc/mathml/mathmlimport.hxx |2 ++
 starmath/inc/nodetype.hxx|2 ++
 5 files changed, 9 insertions(+)

New commits:
commit 08e020f4d7e9ec7d5343c6672560c84c6f72464b
Author: Gabor Kelemen 
AuthorDate: Tue Jan 6 11:25:03 2026 +0100
Commit: Gabor Kelemen 
CommitDate: Sun Jan 18 23:46:15 2026 +0100

Fix some non self contained headers in module sfx2, starmath

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

diff --git a/sfx2/source/doc/graphhelp.hxx b/sfx2/source/doc/graphhelp.hxx
index 5edb1fc00685..040b99fa70ef 100644
--- a/sfx2/source/doc/graphhelp.hxx
+++ b/sfx2/source/doc/graphhelp.hxx
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 
 class SvMemoryStream;
 class GDIMetaFile;
diff --git a/starmath/inc/mathml/export.hxx b/starmath/inc/mathml/export.hxx
index 08d3f92d06de..e8ba427d1159 100644
--- a/starmath/inc/mathml/export.hxx
+++ b/starmath/inc/mathml/export.hxx
@@ -22,6 +22,8 @@
 // Our mathml
 #include "element.hxx"
 
+#include 
+
 // Xml tools
 #include 
 #include 
diff --git a/starmath/inc/mathml/import.hxx b/starmath/inc/mathml/import.hxx
index 764d5451c652..a13f8cd06301 100644
--- a/starmath/inc/mathml/import.hxx
+++ b/starmath/inc/mathml/import.hxx
@@ -12,6 +12,8 @@
 // Our mathml
 #include "element.hxx"
 
+#include 
+
 // XML tools
 #include 
 #include 
diff --git a/starmath/inc/mathml/mathmlimport.hxx 
b/starmath/inc/mathml/mathmlimport.hxx
index 3e2b5d2a991d..dc96728a1d13 100644
--- a/starmath/inc/mathml/mathmlimport.hxx
+++ b/starmath/inc/mathml/mathmlimport.hxx
@@ -19,6 +19,8 @@
 
 #pragma once
 
+#include 
+
 #include 
 #include 
 #include 
diff --git a/starmath/inc/nodetype.hxx b/starmath/inc/nodetype.hxx
index f0bf28cece67..203348d886a8 100644
--- a/starmath/inc/nodetype.hxx
+++ b/starmath/inc/nodetype.hxx
@@ -22,6 +22,8 @@
* Also provides analysis of the node functions
*/
 
+#include 
+
 enum class SmNodeType : int_fast16_t
 {
 Table, // tree header


core.git: sfx2/source

2026-01-14 Thread Mike Kaganski (via logerrit)
 sfx2/source/doc/graphhelp.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 105854d4e7e8a8812c3dfaadcdd74d5b349d56e7
Author: Mike Kaganski 
AuthorDate: Wed Jan 14 13:06:08 2026 +0100
Commit: Mike Kaganski 
CommitDate: Wed Jan 14 16:56:02 2026 +0100

Missing include

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

diff --git a/sfx2/source/doc/graphhelp.cxx b/sfx2/source/doc/graphhelp.cxx
index 37128c2ab062..7e97e9904995 100644
--- a/sfx2/source/doc/graphhelp.cxx
+++ b/sfx2/source/doc/graphhelp.cxx
@@ -48,6 +48,7 @@
 #include 
 
 #if defined _WIN32
+#include 
 #include 
 #include 
 #endif


core.git: sfx2/source

2026-01-14 Thread Stephan Bergmann (via logerrit)
 sfx2/source/dialog/filedlgimpl.hxx|4 
 sfx2/source/dialog/filtergrouping.hxx |1 +
 2 files changed, 5 insertions(+)

New commits:
commit 25b197e063c88f7403e0b748815a5a378fb5fbfe
Author: Stephan Bergmann 
AuthorDate: Wed Jan 14 08:45:52 2026 +0100
Commit: Stephan Bergmann 
CommitDate: Wed Jan 14 10:53:45 2026 +0100

missing includes

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

diff --git a/sfx2/source/dialog/filedlgimpl.hxx 
b/sfx2/source/dialog/filedlgimpl.hxx
index 2fee6c08c7d6..69b6ffe74b24 100644
--- a/sfx2/source/dialog/filedlgimpl.hxx
+++ b/sfx2/source/dialog/filedlgimpl.hxx
@@ -19,6 +19,10 @@
 #ifndef INCLUDED_SFX2_SOURCE_DIALOG_FILEDLGIMPL_HXX
 #define INCLUDED_SFX2_SOURCE_DIALOG_FILEDLGIMPL_HXX
 
+#include 
+
+#include 
+
 #include 
 #include 
 #include 
diff --git a/sfx2/source/dialog/filtergrouping.hxx 
b/sfx2/source/dialog/filtergrouping.hxx
index 1d8a444738c1..8ddae68d5212 100644
--- a/sfx2/source/dialog/filtergrouping.hxx
+++ b/sfx2/source/dialog/filtergrouping.hxx
@@ -25,6 +25,7 @@
 #include "filedlgimpl.hxx"
 
 #include 
+#include 
 
 namespace sfx2
 {


core.git: sfx2/source

2026-01-02 Thread Szymon Kłos (via logerrit)
 sfx2/source/dialog/templdlg.cxx |   17 ++---
 1 file changed, 14 insertions(+), 3 deletions(-)

New commits:
commit db91a60d77a5bd54c818eddad977ad2e813ba974
Author: Szymon Kłos 
AuthorDate: Tue Dec 16 12:17:48 2025 +
Commit: Szymon Kłos 
CommitDate: Fri Jan 2 17:13:56 2026 +0100

lok: show new style from selection in sidebar

- not all options are working yet, show only "new form selection"

Change-Id: I5d2321c67eac3ec77fe4f5781b190bfd8ee65434
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195707
(cherry picked from commit 4debae98eab4bc525f517aacb70e47dbd367fff4)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196419
Reviewed-by: Szymon Kłos 
Tested-by: Jenkins

diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index bf56e5a2c197..4a1e875bc1f7 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -812,13 +812,20 @@ 
SfxTemplateDialog_Impl::SfxTemplateDialog_Impl(SfxBindings* pB, SfxTemplatePanel
 // shown/hidden in SfxTemplateDialog_Impl::ReplaceUpdateButtonByMenu()
 m_xActionTbR->set_item_help_id(u"new"_ustr, HID_TEMPLDLG_NEWBYEXAMPLE);
 m_xActionTbR->set_item_help_id(u"newmenu"_ustr, HID_TEMPLDLG_NEWBYEXAMPLE);
-m_xActionTbR->set_item_menu(u"newmenu"_ustr, m_xToolMenu.get());
-m_xToolMenu->connect_activate(LINK(this, SfxTemplateDialog_Impl, 
ToolMenuSelectHdl));
 m_xActionTbR->set_item_help_id(u"update"_ustr, 
HID_TEMPLDLG_UPDATEBYEXAMPLE);
 
 // Features not working in LOK yet
 if (comphelper::LibreOfficeKit::isActive())
-m_xActionTbR->hide();
+{
+m_xActionTbR->set_item_visible(u"watercan"_ustr, false);
+m_xActionTbR->set_item_visible(u"newmenu"_ustr, false);
+m_xActionTbR->set_item_visible(u"update"_ustr, false);
+}
+else
+{
+m_xActionTbR->set_item_menu(u"newmenu"_ustr, m_xToolMenu.get());
+m_xToolMenu->connect_activate(LINK(this, SfxTemplateDialog_Impl, 
ToolMenuSelectHdl));
+}
 
 Initialize();
 }
@@ -865,6 +872,10 @@ void SfxTemplateDialog_Impl::InsertFamilyItem(sal_uInt16 
nId, const SfxStyleFami
 
 void SfxTemplateDialog_Impl::ReplaceUpdateButtonByMenu()
 {
+// in LOK we don't support all options yet
+if (comphelper::LibreOfficeKit::isActive())
+return;
+
 m_xActionTbR->set_item_visible(u"update"_ustr, false);
 m_xActionTbR->set_item_visible(u"new"_ustr, false);
 m_xActionTbR->set_item_visible(u"newmenu"_ustr, true);


core.git: sfx2/source

2025-12-31 Thread Michael Weghorn (via logerrit)
 sfx2/source/control/templatelocalview.cxx |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit c5dd771cc95f21a397f12ef1b76b18fd7b0c5745
Author: Michael Weghorn 
AuthorDate: Wed Dec 31 00:37:20 2025 +0100
Commit: Michael Weghorn 
CommitDate: Wed Dec 31 20:29:13 2025 +0100

sfx2: Cast once in TemplateLocalView::Command

More consistently use pViewItem after casting
pItem and don't do another dynamic_cast again later,
but directly use pViewItem.

Change-Id: I143308e3f72468c2919b1f871867ba10c75b20fa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196342
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/sfx2/source/control/templatelocalview.cxx 
b/sfx2/source/control/templatelocalview.cxx
index 3284cf4a1978..169c0da2464e 100644
--- a/sfx2/source/control/templatelocalview.cxx
+++ b/sfx2/source/control/templatelocalview.cxx
@@ -706,18 +706,18 @@ bool TemplateLocalView::Command(const CommandEvent& rCEvt)
 Point aPosition(rCEvt.GetMousePosPixel());
 maPosition = aPosition;
 ThumbnailViewItem* pItem = ImplGetItem(nPos);
-const TemplateViewItem *pViewItem = dynamic_cast(pItem);
+TemplateViewItem* pViewItem = dynamic_cast(pItem);
 
 if(pViewItem)
 {
-if(!pItem->isSelected())
+if (!pViewItem->isSelected())
 {
 deselectItems();
-pItem->setSelection(true);
-maItemStateHdl.Call(pItem);
+pViewItem->setSelection(true);
+maItemStateHdl.Call(pViewItem);
 }
-maSelectedItem = dynamic_cast(pItem);
-maCreateContextMenuHdl.Call(pItem);
+maSelectedItem = pViewItem;
+maCreateContextMenuHdl.Call(pViewItem);
 }
 }
 else


core.git: sfx2/source

2025-12-12 Thread Andrea Gelmini (via logerrit)
 sfx2/source/doc/guisaveas.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 6213f1807c2c67b7f667f5652b0bc3701cedf6ed
Author: Andrea Gelmini 
AuthorDate: Thu Dec 11 18:49:01 2025 +0100
Commit: Julien Nabet 
CommitDate: Fri Dec 12 09:26:05 2025 +0100

Remove duplicated include

Change-Id: I0cedc423503beb75f97dc7ddd549baa101359996
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195486
Tested-by: Jenkins
Reviewed-by: Simon Chenery 
Reviewed-by: Julien Nabet 

diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 4ef76c1b278e..a4324e529e45 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -107,7 +107,6 @@
 #include 
 
 #ifdef _WIN32
-#include 
 #include 
 #ifdef GetTempPath
 #undef GetTempPath


core.git: sfx2/source

2025-12-11 Thread Miklos Vajna (via logerrit)
 sfx2/source/view/viewsh.cxx |   11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

New commits:
commit b9d6213d04c84b8d514be597d8c876caf9c48be9
Author: Miklos Vajna 
AuthorDate: Wed Dec 10 10:18:41 2025 +0100
Commit: Miklos Vajna 
CommitDate: Fri Dec 12 01:26:28 2025 +0100

sfx2: fix uncaught exception in SfxViewShell::Activate()

gdb backtrace on the core file from crashreport:
#0  __pthread_kill_implementation (no_tid=0, signo=6, 
threadid=123946821978048) at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=123946821978048) at 
./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=123946821978048, 
signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3  0x70ba9de42476 in __GI_raise (sig=sig@entry=6) at 
../sysdeps/posix/raise.c:26
#4  0x70ba9de287f3 in __GI_abort () at ./stdlib/abort.c:79
#5  0x70ba9e2a2b9e in ?? () from 
/lib/x86_64-linux-gnu/libstdc++.so.6
#6  0x70ba9e2ae20c in ?? () from 
/lib/x86_64-linux-gnu/libstdc++.so.6
#7  0x70ba9e2ae277 in std::terminate() () from 
/lib/x86_64-linux-gnu/libstdc++.so.6
#8  0x70ba9e2ae4d8 in __cxa_throw () from 
/lib/x86_64-linux-gnu/libstdc++.so.6
#9  0x70ba9818129b in SfxBaseModel::MethodEntryCheck 
(this=, i_mustBeInitialized=)
at sfx2/source/doc/sfxbasemodel.cxx:3069
#10 0x70ba99e6c8cb in SfxModelGuard::SfxModelGuard 
(i_eState=SfxModelGuard::E_FULLY_ALIVE, i_rModel=..., this=0x7ffedd2f94f0)
at sfx2/source/inc/docundomanager.hxx:76
#11 SfxBaseModel::setCurrentController (this=0x194e84b0, 
xCurrentController=...)
at sfx2/source/doc/sfxbasemodel.cxx:1364
#12 0x70ba99f6955a in SfxViewShell::Activate (this=0x2b084ed0, 
bMDI=)
at sfx2/source/view/viewsh.cxx:2535

And that std::terminate() prints:
terminate called after throwing an instance of 
'com::sun::star::lang::NotInitializedException'

Fix the problem similar to what commit
adadeaf98114ffdf9893e6c92a630f7e90597f62 (avoid terminate after
unhandled exception, 2025-11-26) did, but here note that
SfxViewShell::Activate() ignores the case when the object shell has no
base model. So extend that and in case the object shell has a base
model, but it's not initialized, do the same (ignore the problem that
setCurrentController() could not finish successfully).

This solves the high level problem that processing an user event on the
main loop should not throw exceptions.

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

diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index aa9dc9b58275..da3ea1091fdc 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -2534,7 +2534,16 @@ void SfxViewShell::Activate( bool bMDI )
 {
 SfxObjectShell *pSh = GetViewFrame().GetObjectShell();
 if (const auto xModel = pSh->GetModel())
-xModel->setCurrentController(GetController());
+{
+try
+{
+xModel->setCurrentController(GetController());
+}
+catch (const uno::Exception&)
+{
+TOOLS_WARN_EXCEPTION("sfx.view", "SfxViewShell::Activate: 
failed to set current controller");
+}
+}
 
 SetCurrentDocument();
 }


core.git: sfx2/source

2025-12-11 Thread Tor Lillqvist (via logerrit)
 sfx2/source/doc/guisaveas.cxx |   17 +
 1 file changed, 17 insertions(+)

New commits:
commit 754f13a4217b4fbf7c18832eea21a395a2cd2423
Author: Tor Lillqvist 
AuthorDate: Tue Nov 4 17:33:28 2025 +0200
Commit: Miklos Vajna 
CommitDate: Thu Dec 11 15:49:15 2025 +0100

Add horrible hack to ask the filename when exporting PDF in CODA-W

The PDF export functionality displays a dialog from JavaScript that
allows the user to choose various PDF parameters. But unlike export to
other formats, no system file save dialog gets displayed by CODA. So
do something horrible: Look up a function in CODA.cpp and call it
directly. Sorry.

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

diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 55798c19af1a..1c9dd37343f7 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -107,6 +107,7 @@
 #include 
 
 #ifdef _WIN32
+#include 
 #include 
 #ifdef GetTempPath
 #undef GetTempPath
@@ -1717,6 +1718,22 @@ bool 
SfxStoringHelper::FinishGUIStoreModel(::comphelper::SequenceAsHashMap::cons
 {
 OUString aFileName;
 aFileNameIter->second >>= aFileName;
+#ifdef _WIN32
+if (comphelper::LibreOfficeKit::isActive())
+{
+// FIXME: Horrible hack. In CODA-W, we didn't actually
+// display any dialog yet, so call into a function in
+// CODA.cpp.
+typedef void (*ofd_t)(const std::wstring& suggestedURI, 
std::string& result);
+ofd_t ofd = (ofd_t)GetProcAddress(GetModuleHandle(NULL), 
"output_file_dialog_from_core");
+std::string newURI;
+(*ofd)(std::wstring(o3tl::toW(aFileName)), newURI);
+if (newURI == "")
+return false;
+aFileName = OUString::fromUtf8(newURI.c_str());
+}
+#endif
+
 aURL.SetURL( aFileName );
 DBG_ASSERT( aURL.GetProtocol() != INetProtocol::NotValid, "Illegal 
URL!" );
 


core.git: sfx2/source

2025-12-11 Thread Justin Luth (via logerrit)
 sfx2/source/appl/appopen.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 38b403a82403b333c3c0d53c2bb8adc3afc37f3b
Author: Justin Luth 
AuthorDate: Wed Dec 10 16:40:39 2025 -0500
Commit: Justin Luth 
CommitDate: Thu Dec 11 13:46:49 2025 +0100

tdf#165180 'Calc Office Open XML' is also an Excel variant

This was introduced with
commit 4de186f43456baf1de162aefa5f76d76e0817e5e
Author: Kohei Yoshida on Thu Sep 16 10:37:52 2010
calc-jump-on-formula-ref-sfx2.diff: Migrated

There are no clear instructions or unit tests
to know exactly how to test this,
but it seems clear enough that it should continue to work
when loaded with an Excel 2010 filter.

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

diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index 03e7e92c384f..dbb4405bfcf3 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -573,7 +573,7 @@ bool lcl_isFilterNativelySupported(const SfxFilter& rFilter)
 
 const OUString& aName = rFilter.GetFilterName();
 // We can handle all Excel variants natively.
-return aName.startsWith("MS Excel");
+return aName.startsWith("MS Excel") || aName.startsWith("Calc Office Open 
XML");
 }
 
 }


core.git: sfx2/source

2025-12-09 Thread Andrea Gelmini (via logerrit)
 sfx2/source/doc/sfxbasemodel.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 3ae52c31adbd4af807cb6f1dbb423846f7210656
Author: Andrea Gelmini 
AuthorDate: Tue Dec 9 13:54:22 2025 +0100
Commit: Julien Nabet 
CommitDate: Tue Dec 9 15:05:12 2025 +0100

Remove duplicated include

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

diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index c10e37e680c4..818bb88b3c72 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -136,7 +136,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include 


core.git: sfx2/source

2025-12-06 Thread Mike Kaganski (via logerrit)
 sfx2/source/doc/objstor.cxx |  113 +++-
 1 file changed, 20 insertions(+), 93 deletions(-)

New commits:
commit 37941abfd6940fdb87b23e5fa8da24173a8951a7
Author: Mike Kaganski 
AuthorDate: Tue Dec 2 19:47:01 2025 +0500
Commit: Mike Kaganski 
CommitDate: Sat Dec 6 13:53:44 2025 +0100

Simplify SfxObjectShell::ExportTo using comphelper::SequenceAsHashMap

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

diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 9c23ef5fd8b1..5fcc7a09790e 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -2824,110 +2824,37 @@ bool SfxObjectShell::ExportTo( SfxMedium& rMedium )
 SfxItemSet& rItems = rMedium.GetItemSet();
 TransformItems( SID_SAVEASDOC, rItems, aOldArgs );
 
-const css::beans::PropertyValue * pOldValue = aOldArgs.getConstArray();
-css::uno::Sequence < css::beans::PropertyValue > aArgs ( 
aOldArgs.getLength() );
-css::beans::PropertyValue * pNewValue = aArgs.getArray();
-
 // put in the REAL file name, and copy all PropertyValues
-static constexpr OUString sOutputStream ( u"OutputStream"_ustr  );
-static constexpr OUString sStream ( u"StreamForOutput"_ustr  );
-bool bHasOutputStream = false;
-bool bHasStream = false;
-bool bHasBaseURL = false;
-bool bHasFilterName = false;
-bool bIsRedactMode = false;
-bool bIsPreview = false;
-std::optional oConversionRequestOrigin;
-sal_Int32 nEnd = aOldArgs.getLength();
-
-for ( sal_Int32 i = 0; i < nEnd; i++ )
-{
-pNewValue[i] = pOldValue[i];
-if ( pOldValue[i].Name == "FileName" )
-pNewValue[i].Value <<= rMedium.GetName();
-else if ( pOldValue[i].Name == sOutputStream )
-bHasOutputStream = true;
-else if ( pOldValue[i].Name == sStream )
-bHasStream = true;
-else if ( pOldValue[i].Name == "DocumentBaseURL" )
-bHasBaseURL = true;
-else if( pOldValue[i].Name == "FilterName" )
-bHasFilterName = true;
-}
+comphelper::SequenceAsHashMap aNewArgs(aOldArgs);
+comphelper::SequenceAsHashMap aMediumArgs(rMedium.GetArgs());
 
-const css::uno::Sequence& rMediumArgs = 
rMedium.GetArgs();
-for ( sal_Int32 i = 0; i < rMediumArgs.getLength(); i++ )
-{
-if( rMediumArgs[i].Name == "IsPreview" )
-rMediumArgs[i].Value >>= bIsPreview;
-else if (rMediumArgs[i].Name == "ConversionRequestOrigin")
-{
-if (OUString s; rMediumArgs[i].Value >>= s)
-oConversionRequestOrigin = s;
-}
-}
+if (aNewArgs.contains(u"FileName"_ustr))
+aNewArgs[u"FileName"_ustr] <<= rMedium.GetName();
+
+if (aMediumArgs.getUnpackedValueOrDefault(u"IsPreview"_ustr, false))
+aNewArgs[u"IsPreview"_ustr] <<= true;
+
+if (aMediumArgs.contains(u"ConversionRequestOrigin"_ustr))
+aNewArgs[u"ConversionRequestOrigin"_ustr] = 
aMediumArgs[u"ConversionRequestOrigin"_ustr];
 
 // FIXME: Handle this inside TransformItems()
 if (rItems.GetItemState(SID_IS_REDACT_MODE) == SfxItemState::SET)
-bIsRedactMode = true;
+aNewArgs[u"IsRedactMode"_ustr] <<= true;
 
-if ( !bHasOutputStream )
-{
-aArgs.realloc ( ++nEnd );
-auto pArgs = aArgs.getArray();
-pArgs[nEnd-1].Name = sOutputStream;
-pArgs[nEnd-1].Value <<= css::uno::Reference < 
css::io::XOutputStream > ( new utl::OOutputStreamWrapper ( 
*rMedium.GetOutStream() ) );
-}
+if (!aNewArgs.contains(u"OutputStream"_ustr))
+aNewArgs[u"OutputStream"_ustr] <<= 
uno::Reference(new 
utl::OOutputStreamWrapper(*rMedium.GetOutStream()));
 
 // add stream as well, for OOX export and maybe others
-if ( !bHasStream )
-{
-aArgs.realloc ( ++nEnd );
-auto pArgs = aArgs.getArray();
-pArgs[nEnd-1].Name = sStream;
-pArgs[nEnd-1].Value <<= css::uno::Reference < css::io::XStream > ( 
new utl::OStreamWrapper ( *rMedium.GetOutStream() ) );
-}
-
-if ( !bHasBaseURL )
-{
-aArgs.realloc ( ++nEnd );
-auto pArgs = aArgs.getArray();
-pArgs[nEnd-1].Name = "DocumentBaseURL";
-pArgs[nEnd-1].Value <<= rMedium.GetBaseURL( true );
-}
-
-if( !bHasFilterName )
-{
-aArgs.realloc( ++nEnd );
-auto pArgs = aArgs.getArray();
-pArgs[nEnd-1].Name = "FilterName";
-pArgs[nEnd-1].Value <<= aFilterName;
-}
+if (!aNew

core.git: sfx2/source sw/inc sw/qa sw/source

2025-12-02 Thread Miklos Vajna (via logerrit)
 sfx2/source/control/unoctitm.cxx  |1 +
 sw/inc/unotxdoc.hxx   |2 ++
 sw/inc/viewopt.hxx|5 +
 sw/qa/uibase/uno/uno.cxx  |   22 ++
 sw/source/uibase/uno/loktxdoc.cxx |7 +++
 5 files changed, 37 insertions(+)

New commits:
commit 5ba4c652fab709d5d8182b4ad99bf1e676e7e6ca
Author: Miklos Vajna 
AuthorDate: Tue Dec 2 09:04:50 2025 +0100
Commit: Miklos Vajna 
CommitDate: Tue Dec 2 20:51:34 2025 +0100

cool#13574 sw redline render mode: send LOK status

This has 2 parts:

1) Send the status of the UNO command in the LOK case. This allows a LOK
   client to call getPartInfo(), when a non-standard redline render mode
   is activated, similar to how the Impress case can use .uno:NotesMode
   to react to the enter/leave of notes editing mode.

2) Implement getPartInfo() for Writer, which allows core to expose the
   current "mode" (0 for standard, 2 for 'omit delete'). Ignore the part
   number, since Writer only has 1 part in the LOK API, but expose our
   current mode there.

With this, a suitable LOK client can repaint tiles when
.uno:RedlineRenderMode is dispatched to "enter" or "leave" this "omit
delete" redline render mode.

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

diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index dad55c406b82..ec456a103d58 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -1182,6 +1182,7 @@ const std::map& 
GetKitUnoCommandList()
 
 { u"CharBackgroundExt", { PayloadType::IsActivePayload, true } },
 { u"ControlCodes", { PayloadType::IsActivePayload, true } },
+{ u"RedlineRenderMode", { PayloadType::IsActivePayload, true } },
 { u"DefaultBullet", { PayloadType::IsActivePayload, true } },
 { u"DefaultNumbering", { PayloadType::IsActivePayload, true } },
 { u"Italic", { PayloadType::IsActivePayload, true } },
diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx
index 7e1d793694ae..e440821d2e49 100644
--- a/sw/inc/unotxdoc.hxx
+++ b/sw/inc/unotxdoc.hxx
@@ -504,6 +504,8 @@ public:
 int getEditMode() override;
 /// @see vcl::ITiledRenderable::setEditMode().
 void setEditMode(int nEditMode) override;
+/// @see vcl::ITiledRenderable::getPartInfo().
+OUString getPartInfo(int nPart) override;
 
 voidInvalidate();
 voidReactivate(SwDocShell* pNewDocShell);
diff --git a/sw/inc/viewopt.hxx b/sw/inc/viewopt.hxx
index f07cdb15c7ed..64a80b5ffb64 100644
--- a/sw/inc/viewopt.hxx
+++ b/sw/inc/viewopt.hxx
@@ -264,10 +264,15 @@ struct SwViewColors
 };
 
 /// View option to determine if some of the redlines should be omitted during 
rendering or not.
+///
+/// This is exposed on the LOK API, don't reorder the names.
 enum class SwRedlineRenderMode
 {
+/// Normal rendering.
 Standard,
+/// Special handling of inserts to ~omit them / paint with small 
saturation.
 OmitInserts,
+/// Special handling of deletes to ~omit them / paint with small 
saturation.
 OmitDeletes,
 };
 
diff --git a/sw/qa/uibase/uno/uno.cxx b/sw/qa/uibase/uno/uno.cxx
index 2848c367a13b..6a7f866091bd 100644
--- a/sw/qa/uibase/uno/uno.cxx
+++ b/sw/qa/uibase/uno/uno.cxx
@@ -598,6 +598,28 @@ CPPUNIT_TEST_FIXTURE(SwUibaseUnoTest, 
testDoNotMirrorRtlDrawObjs)
 CPPUNIT_ASSERT(bDoNotMirrorRtlDrawObjs);
 }
 
+CPPUNIT_TEST_FIXTURE(SwUibaseUnoTest, testRedlineRenderModePartInfo)
+{
+// Given a document with redline render mode set to "omit deletes":
+createSwDoc();
+SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell();
+SwViewOption aOpt(*pWrtShell->GetViewOptions());
+aOpt.SetRedlineRenderMode(SwRedlineRenderMode::OmitDeletes);
+pWrtShell->ApplyViewOptions(aOpt);
+
+// When getting the LOK part info:
+OUString aPartInfo = getSwTextDoc()->getPartInfo(0);
+
+// Then make sure we get the correct value:
+std::stringstream aStream((std::string(aPartInfo.toUtf8(;
+boost::property_tree::ptree aTree;
+boost::property_tree::read_json(aStream, aTree);
+// Without the accompanying fix in place, this test would have failed with:
+// - (1): expected value
+// i.e. the json "mode" key was missing.
+CPPUNIT_ASSERT_EQUAL(std::string("2"), aTree.get("mode"));
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/uno/loktxdoc.cxx 
b/sw/source/uibase/uno/loktxdoc.cxx
index 54c5e3b6ebba..27f0ebca1d3c 100644
--- a/sw/source/uibase/uno/loktxdoc.cxx
+++ b/sw/source/uibase/uno/loktxdoc.cxx
@@ -1168,6 +1168,13 @@ void SwXTextDocument::setEditMode(int nEditMode)
 }
 }
 
+OUString SwXTextDocument::getPartInfo(int /*nPart*/)
+{
+to

core.git: sfx2/source

2025-11-26 Thread Olivier Hallot (via logerrit)
 sfx2/source/doc/templatedlg.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 56e11a5f41a78692f686decdb17cd4321a5e2c31
Author: Olivier Hallot 
AuthorDate: Wed Nov 26 10:48:00 2025 -0300
Commit: Olivier Hallot 
CommitDate: Wed Nov 26 22:00:11 2025 +0100

tdf#146734 Add Help to Manage button in Template manager

Core part: add a HID string

Change-Id: I3c3d7eede94e3843d9037d2b592fba82e062ce71
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194641
Tested-by: Olivier Hallot 
Tested-by: Jenkins
Reviewed-by: Olivier Hallot 
Code-Style: Olivier Hallot 

diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 04e865c994af..0de7dbe0d1fe 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -185,6 +185,8 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg(weld::Window 
*pParent)
 
 
mxActionBar->connect_selected(LINK(this,SfxTemplateManagerDlg,MenuSelectHdl));
 
+mxActionBar->set_help_id(u"HID_SFX_TEMPLATE_MANAGER_ACTION_MENU"_ustr);
+
 mxLocalView->setItemMaxTextLength(TEMPLATE_ITEM_MAX_TEXT_LENGTH);
 
mxLocalView->setItemDimensions(TEMPLATE_ITEM_MAX_WIDTH,TEMPLATE_ITEM_THUMBNAIL_MAX_HEIGHT,
   
TEMPLATE_ITEM_MAX_HEIGHT-TEMPLATE_ITEM_THUMBNAIL_MAX_HEIGHT,


core.git: sfx2/source

2025-11-26 Thread Caolán McNamara (via logerrit)
 sfx2/source/notebookbar/SfxNotebookBar.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 10090f36de159d8e6886ddac3326253ea716d26f
Author: Caolán McNamara 
AuthorDate: Wed Nov 26 08:46:59 2025 +
Commit: Caolán McNamara 
CommitDate: Wed Nov 26 17:12:32 2025 +0100

avoid terminate after unhandled exception

 #3  0x7e29f0a42476 in __GI_raise (sig=sig@entry=6) at 
../sysdeps/posix/raise.c:26
 #4  0x7e29f0a287f3 in __GI_abort () at ./stdlib/abort.c:79
 #5  0x7e29f0ea2b9e in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
 #6  0x7e29f0eae20c in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
 #7  0x7e29f0eae277 in std::terminate() () from 
/lib/x86_64-linux-gnu/libstdc++.so.6
 #8  0x7e29f0eae4d8 in __cxa_throw () from 
/lib/x86_64-linux-gnu/libstdc++.so.6
 #9  0x7e29ead812a5 in SfxBaseModel::MethodEntryCheck (this=, i_mustBeInitialized=)
 at sfx2/source/doc/sfxbasemodel.cxx:3069
 #10 0x7e29eca6d629 in SfxModelGuard::SfxModelGuard 
(i_eState=SfxModelGuard::E_FULLY_ALIVE, i_rModel=..., this=0x7ffc94a61ec0)
 at sfx2/source/inc/docundomanager.hxx:76
 #11 SfxBaseModel::getIdentifier (this=0x27ad5ab0)
 at sfx2/source/doc/sfxbasemodel.cxx:4015
 #12 0x7e29ec098e03 in (anonymous 
namespace)::ModuleManager::implts_identify (this=0x328c9cc0, xComponent=...)
 at framework/source/services/modulemanager.cxx:327
 #13 0x7e29ec0991f3 in (anonymous namespace)::ModuleManager::identify 
(this=0x328c9cc0, xModule=...)
 at framework/source/services/modulemanager.cxx:191
 #14 0x7e29ecaa8e0e in sfx2::SfxNotebookBar::IsActive 
(bConsiderSingleToolbar=)
 at sfx2/source/notebookbar/SfxNotebookBar.cxx:324
 #15 0x7e29ecaa95ab in sfx2::SfxNotebookBar::StateMethod 
(pSysWindow=0x36778bf0, xFrame=..., rUIFile=...,
 bReloadNotebookbar=)
 at sfx2/source/notebookbar/SfxNotebookBar.cxx:444
 #16 0x7e29dd85707b in sd::DrawDocShell::GetState (this=0x367c3290, 
rSet=...)
 at sd/source/ui/docshell/docshell.cxx:327
 #17 0x7e29ec8b67fe in SfxShell::GetSlotState (this=0x367c3290, 
nSlotId=nSlotId@entry=10338, pIF=,
pIF@entry=0x0, pStateSet=pStateSet@entry=0x0)

Change-Id: I13918818c04138848020ab8bdb646b0cb08f130a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194619
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 
Code-Style: Caolán McNamara 

diff --git a/sfx2/source/notebookbar/SfxNotebookBar.cxx 
b/sfx2/source/notebookbar/SfxNotebookBar.cxx
index 424f8e61ff8c..a3a01ba1c422 100644
--- a/sfx2/source/notebookbar/SfxNotebookBar.cxx
+++ b/sfx2/source/notebookbar/SfxNotebookBar.cxx
@@ -322,7 +322,7 @@ bool SfxNotebookBar::IsActive(bool bConsiderSingleToolbar)
 {
 eApp = 
vcl::EnumContext::GetApplicationEnum(xModuleManager->identify(xFrame));
 }
-catch (css::frame::UnknownModuleException& e)
+catch (css::uno::Exception& e)
 {
 SAL_WARN("sfx.appl", "SfxNotebookBar::IsActive(): " + e.Message);
 return false;


core.git: sfx2/source

2025-11-20 Thread Miklos Vajna (via logerrit)
 sfx2/source/control/dispatch.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 66d42cf637a8b3363684346c1864c958a6bc922d
Author: Miklos Vajna 
AuthorDate: Thu Nov 20 08:15:16 2025 +0100
Commit: Miklos Vajna 
CommitDate: Thu Nov 20 15:20:12 2025 +0100

Related: cool#4535 sfx2 lok: warn when ignoring UNO command in read-only 
mode

It took a bit of time to find why dispatching this command doesn't
result in a call to SwView::Execute(), make the problem more obvious for
the next person.

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

diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index 30e5b7cb6fc4..b0dd805f047c 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -1721,7 +1721,12 @@ bool SfxDispatcher::FindServer_(sal_uInt16 nSlot, 
SfxSlotServer& rServer)
 {
 if (!IsCommandAllowedInLokReadOnlyViewMode(pSlot->GetCommand(),

*xImp->pFrame->GetViewShell()))
+{
+SAL_WARN("sfx.control", "SfxDispatcher::FindServer_: 
rejecting command '"
+<< pSlot->GetCommand()
+<< "', not allowed in LOK 
read-only view mode");
 return false;
+}
 }
 }
 


core.git: sfx2/source

2025-10-18 Thread Miklos Vajna (via logerrit)
 sfx2/source/doc/guisaveas.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit a890c1466addb287418130d1a99c12004e202f0c
Author: Miklos Vajna 
AuthorDate: Fri Oct 17 08:24:45 2025 +0200
Commit: Miklos Vajna 
CommitDate: Sat Oct 18 17:46:17 2025 +0200

sfx: fix loplugin:unusedcapturedefault

In the --disable-gpgmepp case.

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

diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 8f242373bb70..2ad7c2ad1b97 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -1931,6 +1931,8 @@ bool 
SfxStoringHelper::FinishGUIStoreModel(::comphelper::SequenceAsHashMap::cons
 SfxResId(STR_ERROR_NOMATCHINGDEFUALTCERT)));
 xBox->run();
 return;
+#else
+(void)aModelData;
 #endif
 };
 SignWithDefaultSignature();


core.git: sfx2/source

2025-10-18 Thread Jim Raykowski (via logerrit)
 sfx2/source/dialog/StyleList.cxx |   23 +--
 1 file changed, 17 insertions(+), 6 deletions(-)

New commits:
commit 3967cdfe862dd4d542ae50cf16c46a62ab17cfa0
Author: Jim Raykowski 
AuthorDate: Mon Sep 22 22:20:08 2025 -0800
Commit: Jim Raykowski 
CommitDate: Tue Sep 23 16:43:04 2025 +0200

tdf#168025 Fix style spotlight numbers in styles list do not always

match style spotlight numbers in document view

This is a partial revert of commit
b5e366c97d813c65d477941d45ae55f7dff954ad

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

diff --git a/sfx2/source/dialog/StyleList.cxx b/sfx2/source/dialog/StyleList.cxx
index 956095a57730..9a71c271fee2 100644
--- a/sfx2/source/dialog/StyleList.cxx
+++ b/sfx2/source/dialog/StyleList.cxx
@@ -438,8 +438,13 @@ void StyleList::UpdateFamily()
 m_bTreeDrag = true;
 if (m_pStyleSheetPool)
 {
-UpdateStyles(StyleFlags::UpdateFamily | StyleFlags::UpdateFamilyList);
-FillTreeBox(GetActualFamily());
+if (!m_xTreeBox->get_visible())
+UpdateStyles(StyleFlags::UpdateFamily | 
StyleFlags::UpdateFamilyList);
+else
+{
+UpdateStyles(StyleFlags::UpdateFamily);
+FillTreeBox(GetActualFamily());
+}
 }
 
 InvalidateBindings();
@@ -1935,8 +1940,12 @@ void StyleList::Update()
 }
 
 m_nAppFilter = pItem->GetValue();
-UpdateStyles(StyleFlags::UpdateFamilyList);
-FillTreeBox(GetActualFamily());
+if (!m_xTreeBox->get_visible())
+{
+UpdateStyles(StyleFlags::UpdateFamilyList);
+}
+else
+FillTreeBox(GetActualFamily());
 }
 else
 {
@@ -1948,8 +1957,10 @@ void StyleList::Update()
 && m_nAppFilter != pItem->GetValue())
 {
 m_nAppFilter = pItem->GetValue();
-UpdateStyles(StyleFlags::UpdateFamilyList);
-FillTreeBox(GetActualFamily());
+if (!m_xTreeBox->get_visible())
+UpdateStyles(StyleFlags::UpdateFamilyList);
+else
+FillTreeBox(GetActualFamily());
 }
 else
 {


core.git: sfx2/source

2025-10-06 Thread Michael Weghorn (via logerrit)
 sfx2/source/appl/workwin.cxx |   21 -
 sfx2/source/inc/workwin.hxx  |3 ++-
 2 files changed, 18 insertions(+), 6 deletions(-)

New commits:
commit 184bc3cdb8c47c238cd640c18b799e30bf93c625
Author: Michael Weghorn 
AuthorDate: Mon Oct 6 09:46:39 2025 +0200
Commit: Michael Weghorn 
CommitDate: Mon Oct 6 17:19:01 2025 +0200

tdf#168500 sfx2: Prevent recursion when creating child win

After

commit 94442bd94e504b067efd0b992525b53fc660f114
Author: Michael Weghorn 
Date:   Tue Aug 5 11:07:25 2025 +0200

tdf#163802 a11y: Fully initialize SpellDialog before showing

, triggering the spell check dialog in Impress
for an empty presentation would result in infinite
recursion e.g. with the gtk3 or gen VCL plugins
on Linux, because the initialization of the
svx::SpellDialogChildWindow triggers a message dialog
asking whether to start spell check from the beginning
(s. frame #252 in below backtrace).
For gtk3 and gen, that dialog triggers processing
of pending events, which triggers an update of the
child windows (s. frame #230), which triggers the logic to
create the spell check child window again (as it isn't
shown yet).

(For qt6, that problem wasn't seen, because synchronously
showing the message dialog doesn't trigger processing
of pending events.)

Fix the problem by detecting cases where a child
window is already in the process of being created,
and return early in that case.

Change SfxWorkWindow::CreateChildWin_Impl to return
a bool result indicating whether the child window
was created or not, and evaluate that in the callers.

Sample backtrace for the gtk3 VCL plugin:

#0  0x7fffe94490c0 in memcmp@plt () at 
/lib/x86_64-linux-gnu/libgio-2.0.so.0
#1  0x7fffe955c206 in ??? () at 
/lib/x86_64-linux-gnu/libgio-2.0.so.0
#2  0x7fffe955c97f in ??? () at 
/lib/x86_64-linux-gnu/libgio-2.0.so.0
#3  0x7fffe955a4a3 in ??? () at 
/lib/x86_64-linux-gnu/libgio-2.0.so.0
#4  0x7fffe94db449 in ??? () at 
/lib/x86_64-linux-gnu/libgio-2.0.so.0
#5  0x7fffe6b6e484 in ??? () at 
/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0
#6  0x7fffe6b716e9 in ??? () at 
/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0
#7  0x7fffe6b71b6d in gdk_pixbuf_loader_close () at 
/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0
#8  0x7fffe5be2fe0 in ??? () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#9  0x7fffe5be40b1 in gtk_image_set_from_file () at 
/lib/x86_64-linux-gnu/libgtk-3.so.0
#10 0x7fffe5be41fd in gtk_image_new_from_file () at 
/lib/x86_64-linux-gnu/libgtk-3.so.0
#11 0x7fffe6498cf9 in (anonymous 
namespace)::image_new_from_xgraphic (rIcon=uno::Reference to 
(unographic::Graphic *) 0x5ef17750, bMirror=false) at 
/home/michi/development/git/libreoffice/vcl/unx/gtk3/gtkinst.cxx:4973
#12 0x7fffe6504ec8 in (anonymous 
namespace)::GtkInstanceToolbar::set_item_image (pItem=0x5ef42d20, 
rIcon=uno::Reference to (unographic::Graphic *) 0x5ef17750, bMirror=false)
at 
/home/michi/development/git/libreoffice/vcl/unx/gtk3/gtkinst.cxx:11838
#13 0x7fffe64ffb31 in (anonymous 
namespace)::GtkInstanceToolbar::set_item_image (this=0x5e956af0, 
rIdent="toggle", rIcon=uno::Reference to (unographic::Graphic *) 0x5ef17750)
at 
/home/michi/development/git/libreoffice/vcl/unx/gtk3/gtkinst.cxx:12214
#14 0x74137ba1 in sfx2::sidebar::TabBar::UpdateButtonIcons 
(this=0x597c0230) at 
/home/michi/development/git/libreoffice/sfx2/source/sidebar/TabBar.cxx:159
#15 0x74137634 in sfx2::sidebar::TabBar::SetDecks 
(this=0x597c0230, rDecks=std::__debug::vector of length 8, capacity 8 = 
{...}) at 
/home/michi/development/git/libreoffice/sfx2/source/sidebar/TabBar.cxx:148
#16 0x740b0f0b in 
sfx2::sidebar::SidebarController::UpdateConfigurations (this=0x58960ae0) at 
/home/michi/development/git/libreoffice/sfx2/source/sidebar/SidebarController.cxx:604
#17 0x740b0a49 in 
sfx2::sidebar::SidebarController::notifyContextChangeEvent 
(this=0x58960ae0, rEvent=...) at 
/home/michi/development/git/libreoffice/sfx2/source/sidebar/SidebarController.cxx:371
#18 0x74dcba91 in (anonymous 
namespace)::ContextChangeEventMultiplexer::BroadcastEventToSingleContainer 
(this=0x590d95c0, rEventObject=..., rxEventFocus=uno::Reference to 
(sd::DrawController *) 0x5830b5e8)
at 
/home/michi/development/git/libreoffice/framework/source/services/ContextChangeEventMultiplexer.cxx:252
#19 0x74dca942 in (anonymous 
namespace)::ContextChangeEventMultiplexer::broadcastContextChangeEvent 
(this=0x590d95c0, rEventObject=..., rxEventFocus=uno::Reference to 
(sd::DrawController *) 0x5830b5e8

core.git: sfx2/source sw/inc sw/qa sw/source

2025-10-01 Thread Michael Stahl (via logerrit)
 sfx2/source/doc/objserv.cxx  |   20 
 sw/inc/dbmgr.hxx |2 
 sw/qa/extras/uiwriter/data/database-display-hidden-section.fodt  |   60 ++
 sw/qa/extras/uiwriter/data/database-display-hidden-section2.fodt |   60 ++
 sw/qa/extras/uiwriter/data/set-variable-hidden-text.fodt |  121 +
 sw/qa/extras/uiwriter/uiwriter9.cxx  |  224 
++
 sw/source/uibase/dbui/dbmgr.cxx  |   69 +--
 7 files changed, 498 insertions(+), 58 deletions(-)

New commits:
commit 7978401cfcdd68536b47f2dfcf4799a5dcbdd22f
Author: Michael Stahl 
AuthorDate: Wed Sep 17 21:01:28 2025 +0200
Commit: Michael Stahl 
CommitDate: Wed Oct 1 11:59:18 2025 +0200

sw: fix "Export Directly as PDF" with set-variable fields in hidden text

... results in wrong conditional text fields.

First, add a testHiddenSectionPDFExport2 for the bug that was fixed with
commit 1e007e8f1703851b01c68884e87c906f6bae5a5e - and
testHiddenSectionPDFExport for a slightly different scenario that also
failed.

Investigating this, it turns out that the conditions are only evaluated
properly inside SwDBManager::Merge(), because this sets up its
m_pImpl->pMergeData, and without that SwCalc::VarLook() will not know
which record is currently selected and return SbxVoid (if there is no
xConnection) or a wrong record (if there is a xConnection).

There is even code in SwDBManager::Merge() that tries to store the new
state in m_DataSourceParams so that later SwCalc are able to use it, but
this broke in 2007 with commit d06a6d2c192076870d67f19653701fdc25d9841c
which changed SwNewDBMgr::FindDSData() to return the m_pImpl->pMergeData
instead of a m_DataSourceParams entry, and thus the *pTemp assignment
became self-assignment.

Also, FindDSData(bCreate=true) already does everything that this code
was doing anyway, so if we just call that *before* creating
m_pImpl->pMergeData we can delete all that code.

Now another problem becomes apparent: an obvious mismatch between how
SwDBManager::GetColumnCnt() and lcl_MoveAbsolute() treat
SwDSParam::aSelection - in the caller the nAbsRecordId is an index that
is *contained* in aSelection (see explicit search with std::any_of), in
the callee it is an index *into* aSelection.

Apparently this is a regression from commit
f5ccfd60c2c5dab392d58870fbd079a6286bc239 and testing reveals that for
tdf#73025 the lcl_MoveAbsolute() is never called from GetColumnCnt(),
but only from SwDBManager::ToRecordId(), so let's have 2 different
functions for callers expecting different behaviour.

Then revert 1e007e8f1703851b01c68884e87c906f6bae5a5e as this scenario
works with the above described fixes.

Add a testHiddenTextFieldPDFExport for the new bug.

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

diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 3d32d342ddb8..cb1c3759492c 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -1141,20 +1141,6 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
 SfxViewShell::Current()->SetStoringHelper(xHelper);
 
 QueryHiddenInformation(bIsPDFExport ? 
HiddenWarningFact::WhenCreatingPDF : HiddenWarningFact::WhenSaving);
-SfxPoolItemHolder aItem;
-if (SID_DIRECTEXPORTDOCASPDF == nId)
-aItem = GetSlotState(SID_MAIL_PREPAREEXPORT);
-const SfxBoolItem* pItem(dynamic_cast(aItem.getItem()));
-
-// Fetch value from the pool item early, because 
GUIStoreModel() can free the pool
-// item as part of spinning the main loop if a dialog is 
opened.
-const bool bMailPrepareExport(nullptr != pItem && 
pItem->GetValue());
-if (bMailPrepareExport)
-{
-SfxRequest aRequest(SID_MAIL_PREPAREEXPORT, 
SfxCallMode::SYNCHRON, GetPool());
-aRequest.AppendItem(SfxBoolItem(FN_NOUPDATE, true));
-ExecuteSlot(aRequest);
-}
 
 xHelper->GUIStoreModel( GetModel(),
pSlot->GetUnoName(),
@@ -1164,12 +1150,6 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
GetScriptingSignatureState(),
bIsAsync );
 
-if (bMailPrepareExport)
-{
-SfxRequest aRequest(SID_MAIL_EXPORT_FINISHED, 
SfxCallMode::SYNCHRON, GetPool());
-ExecuteSlot(aRequest);
-}
-
 // merge aDispatc

core.git: sfx2/source

2025-09-25 Thread Mohit Marathe (via logerrit)
 sfx2/source/control/unoctitm.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 90d15709e1915583ba5148bea133e885e3979c46
Author: Mohit Marathe 
AuthorDate: Tue Jul 15 19:39:20 2025 +0530
Commit: Mohit Marathe 
CommitDate: Wed Sep 24 13:40:29 2025 +0200

Add more graphic related uno commands to kit uno command list

add GrafLuminance, GrafContrast, GrafMode, GrafTransparence to
the list

Signed-off-by: Mohit Marathe 
Change-Id: I9be56ab8639c5c82c3f281f48d9996e348059ea4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188098
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Pranam Lashkari 
(cherry picked from commit c4fc2c55dbc501edf4a7149f750737eed6d10458)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191431
Tested-by: Jenkins

diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 335222375548..dad55c406b82 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -1391,6 +1391,10 @@ const std::map& 
GetKitUnoCommandList()
 { u"ParaRightToLeft", { PayloadType::ParaDirectionPayload, true } },
 
 { u"AssignLayout", { PayloadType::Int32Payload, true } },
+{ u"GrafContrast", { PayloadType::Int32Payload, true } },
+{ u"GrafLuminance", { PayloadType::Int32Payload, true } },
+{ u"GrafMode", { PayloadType::Int32Payload, true } },
+{ u"GrafTransparence", { PayloadType::Int32Payload, true } },
 { u"StatusSelectionMode", { PayloadType::Int32Payload, true } },
 { u"Signature", { PayloadType::Int32Payload, false } },
 { u"SelectionMode", { PayloadType::Int32Payload, true } },


core.git: sfx2/source

2025-09-24 Thread Mohit Marathe (via logerrit)
 sfx2/source/dialog/templdlg.cxx |2 --
 1 file changed, 2 deletions(-)

New commits:
commit 9f9d74b5deed43ec9d3dd2b082e178fb7cbf53f0
Author: Mohit Marathe 
AuthorDate: Thu Jul 31 20:42:30 2025 +0530
Commit: Mohit Marathe 
CommitDate: Wed Sep 24 15:11:18 2025 +0200

jsdialog: show "Show previews" checkbox for Styles List

It's a partial revert of:
commit a83d72ff76d5cec4fc25b9795d698dac9390cb1e

Reason: Now previews are supported

Signed-off-by: Mohit Marathe 
Change-Id: Ifaaa4e2c04525fcd546f331c9ee6edb5a0482c42
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188689
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 
(cherry picked from commit a7b1265804df6200c0ec2e76862dd0ba761e7396)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191437
Tested-by: Jenkins

diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index f03c8b78b3ee..bf56e5a2c197 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -256,8 +256,6 @@ 
SfxCommonTemplateDialog_Impl::SfxCommonTemplateDialog_Impl(SfxBindings* pB, weld
 {
 mxFilterLb->set_help_id(HID_TEMPLATE_FILTER);
 
mxPreviewCheckbox->set_active(officecfg::Office::Common::StylesAndFormatting::Preview::get());
-if (comphelper::LibreOfficeKit::isActive())
-mxPreviewCheckbox->hide();
 }
 
 void SfxTemplateDialog_Impl::EnableEdit(bool bEnable, StyleList* rStyleList)


core.git: sfx2/source sw/qa

2025-09-23 Thread Miklos Vajna (via logerrit)
 sfx2/source/control/bindings.cxx|3 --
 sw/qa/extras/tiledrendering/tiledrendering2.cxx |   27 
 2 files changed, 28 insertions(+), 2 deletions(-)

New commits:
commit 1b9203811b67284eae751a49d5766457a610780f
Author: Miklos Vajna 
AuthorDate: Tue Sep 23 08:33:07 2025 +0200
Commit: Miklos Vajna 
CommitDate: Tue Sep 23 18:06:01 2025 +0200

cool#12964 sfx2: fix priority of 'sfx::SfxBindings aAutoTimer'

Open the bugdoc in a LOK client, go to page 2, press backspace twice,
the expected result is that we get tiles fast, but actually we have a
delay on the 2nd backspace.

Investigating what happens, simply the LOK client is informed that a
high priority VCL task is scheduled, so the tiles are not rendered:
debug:589:484: SwEditWin::KeyInput: start
...
debug:589:484: SwEditWin::KeyInput: finished in 18 ms
...
debug, anyInputCallback: no input, return false
debug:589:484: SwLayAction::CheckIdleEnd: after LOK anyInput(), 
m_bInterrupt is 0
debug:589:484: Scheduler::GetMostUrgentTaskPriority: reporting 2 as the 
most urgent priority, task is 'sfx::SfxBindings aAutoTimer' @ 1902333277
debug, anyInputCallback: mostUrgentPriority is highest..repaint, no 
interrupt, return false
...
debug:589:484: Scheduler::GetMostUrgentTaskPriority: reporting 2 as the 
most urgent priority, task is 'sfx::SfxBindings aAutoTimer' @ 1902333976 -> 699 
ms here
debug, anyInputCallback: mostUrgentPriority is highest..repaint, no 
interrupt, return false
debug:589:484: SwLayAction::CheckIdleEnd: after LOK anyInput(), 
m_bInterrupt is 0
debug:589:484: SwLayAction::Action: is idle? 1, 1st InternalAction() 
finished in 976 ms
...
debug:589:484: SwEditWin::KeyInput: start
debug:589:484: SwEditWin::KeyInput: finished in 1 ms

Fix the problem by restoring the priority of 'sfx::SfxBindings
aAutoTimer' to the value that was set by commit
4f15a47c7faf55997e776af738106d3da229c7d2 (cool#11064 Set priority of
some idles to TaskPriority::DEFAULT_IDLE, 2025-02-18), but in the
meantime the pulled-from-upstream commit
f4ade8244bf984712e65c2eb82cf3319d2679eeb (Downgrade sfx::SfxBindings
aAutoTimer to an idle, 2024-03-21) broke the priority again.

With this, we stop idle layout as soon as the 2nd keypress arrives:
debug:5279:5148: SwEditWin::KeyInput: start
debug:5279:5148: SwEditWin::KeyInput: finished in 6 ms
...
debug:5279:5148: Scheduler::GetMostUrgentTaskPriority: reporting 7 as the 
most urgent priority, task is 'sfx::SfxBindings aAutoTimer' @ 1903486975
debug, anyInputCallback: no input, return false
debug:5279:5148: SwLayAction::CheckIdleEnd: after LOK anyInput(), 
m_bInterrupt is 0
debug, anyInputCallback: wsd socket poll() found data, return true
debug:5279:5148: SwLayAction::CheckIdleEnd: after LOK anyInput(), 
m_bInterrupt is 1
debug:5279:5148: SwLayAction::Action: is idle? 1, 1st InternalAction() 
finished in 488 ms
debug:5279:5148: SwLayAction::Action: is idle? 0, 1st InternalAction() 
finished in 0 ms
debug:5279:5148: Scheduler::GetMostUrgentTaskPriority: reporting 4 as the 
most urgent priority, task is 'vcl::Window maPaintIdle' @ 1903486976
debug, anyInputCallback: mostUrgentPriority is highest..repaint, no 
interrupt, return false
debug:5279:5148: Scheduler::GetMostUrgentTaskPriority: reporting 7 as the 
most urgent priority, task is 'sfx::SfxBindings aAutoTimer' @ 1903486976
debug, anyInputCallback: unprocessed LOK callbacks, return true
debug:5279:5148: SwEditWin::KeyInput: start
debug:5279:5148: SwEditWin::KeyInput: finished in 1 ms

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

diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx
index d8dd9c0d159d..0d78ff1eb741 100644
--- a/sfx2/source/control/bindings.cxx
+++ b/sfx2/source/control/bindings.cxx
@@ -146,10 +146,9 @@ SfxBindings::SfxBindings()
 pImpl->pSubBindings = nullptr;
 pImpl->nOwnRegLevel = nRegLevel;
 
-pImpl->aAutoTimer.SetPriority(TaskPriority::DEFAULT_IDLE);
 // all caches are valid (no pending invalidate-job)
 // create the list of caches
-pImpl->aAutoTimer.SetPriority(TaskPriority::HIGH_IDLE);
+pImpl->aAutoTimer.SetPriority(TaskPriority::DEFAULT_IDLE);
 pImpl->aAutoTimer.SetInvokeHandler( LINK(this, SfxBindings, NextJob) );
 }
 
diff --git a/sw/qa/extras/tiledrendering/tiledrendering2.cxx 
b/sw/qa/extras/tiledrendering/tiledrendering2.cxx
index a8bc37610fc4..c5788e72d4a1 100644
--- a/sw/qa/extras/tiledrendering/tiledrendering2.cxx
+++ b/sw/qa/extras/tiledrendering/tiledrendering2.cxx
@@ -807,6 +807,33 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, 
testIdleLayoutShape)
 // i.e. the priority was TaskPriority::REPAINT instead of 
TaskPr

core.git: sfx2/source

2025-09-20 Thread Samuel Mehrbrodt (via logerrit)
 sfx2/source/dialog/filedlghelper.cxx |1 
 sfx2/source/doc/guisaveas.cxx|   73 ---
 2 files changed, 10 insertions(+), 64 deletions(-)

New commits:
commit 67ea1fc544a0651e8da78531cfa3525f72c434ef
Author: Samuel Mehrbrodt 
AuthorDate: Mon Sep 8 10:04:49 2025 +0200
Commit: Samuel Mehrbrodt 
CommitDate: Mon Sep 8 13:15:53 2025 +0200

tdf#167897 Fix save/export directory preselection with empty user profile

In the case of an empty user profile, the logic to display
the correct directory was twisted.

This also reverts the fix for tdf#165228
since the root cause now has been fixed.

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

diff --git a/sfx2/source/dialog/filedlghelper.cxx 
b/sfx2/source/dialog/filedlghelper.cxx
index c65d8d1fefa5..232425881010 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -1458,7 +1458,6 @@ ErrCode FileDialogHelper_Impl::execute( 
css::uno::Sequence& rpURLList,
 }
 
 rpURLList = {};
-maPath.clear(); // tdf#165228 This should not survive between calls to 
execute
 
 if ( ! mxFileDlg.is() )
 return ERRCODE_ABORT;
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index f99fb12aad16..1d7241f42756 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -347,7 +347,6 @@ public:
 bool ShowDocumentInfoDialog();
 
 static OUString GetRecommendedExtension( const OUString& aTypeName );
-OUString GetRecommendedDir( const OUString& aSuggestedDir );
 OUString GetRecommendedName( const OUString& aSuggestedName,
 const OUString& aTypeName );
 };
@@ -963,9 +962,15 @@ bool ModelData_Impl::OutputFileDialog( sal_Int16 
nStoreMode,
 if (SfxViewShell* pViewShell = SfxViewShell::Current())
 {
 SfxObjectShell* pDocShell = pViewShell->GetObjectShell();
-if (sPreselectedDir.isEmpty() && pDocShell && 
!pDocShell->IsBasedOnTemplate())
-sPreselectedDir = 
GetDocProps().getUnpackedValueOrDefault("DocumentBaseURL", OUString());
+if (pDocShell && !pDocShell->IsBasedOnTemplate())
+{
+if (sPreselectedDir.isEmpty())
+sPreselectedDir = 
GetDocProps().getUnpackedValueOrDefault("DocumentBaseURL", OUString());
+if (sPreselectedDir.isEmpty() && GetStorable()->hasLocation())
+sPreselectedDir = GetStorable()->getLocation();
+}
 }
+
 INetURLObject aObj(sPreselectedDir);
 aObj.removeSegment(); // remove file name from URL
 sPreselectedDir = aObj.GetMainURL(INetURLObject::DecodeMechanism::NONE);
@@ -1072,9 +1077,8 @@ bool ModelData_Impl::OutputFileDialog( sal_Int16 
nStoreMode,
 }
 }
 
-const OUString aRecommendedDir {GetRecommendedDir( aSuggestedDir )};
-if ( !aRecommendedDir.isEmpty() )
-pFileDlg->SetDisplayFolder( aRecommendedDir );
+if ( !aSuggestedDir.isEmpty() )
+pFileDlg->SetDisplayFolder( aSuggestedDir );
 const OUString aRecommendedName {GetRecommendedName( aSuggestedName, 
aAdjustToType )};
 if ( !aRecommendedName.isEmpty() )
 pFileDlg->SetFileName( aRecommendedName );
@@ -1346,63 +1350,6 @@ OUString ModelData_Impl::GetRecommendedExtension( const 
OUString& aTypeName )
 return OUString();
 }
 
-
-OUString ModelData_Impl::GetRecommendedDir( const OUString& aSuggestedDir )
-{
-if ( ( !aSuggestedDir.isEmpty() || GetStorable()->hasLocation() )
-  && !GetMediaDescr().getUnpackedValueOrDefault(u"RepairPackage"_ustr, 
false ) )
-{
-INetURLObject aLocation;
-if ( !aSuggestedDir.isEmpty() )
-aLocation = INetURLObject( aSuggestedDir );
-else
-{
-const OUString aOldURL = GetStorable()->getLocation();
-if ( !aOldURL.isEmpty() )
-{
-INetURLObject aTmp( aOldURL );
-if ( aTmp.removeSegment() )
-aLocation = std::move(aTmp);
-}
-
-if ( aLocation.HasError() )
-aLocation = INetURLObject();
-}
-
-OUString sLocationURL( aLocation.GetMainURL( 
INetURLObject::DecodeMechanism::NONE ) );
-bool bIsInTempPath( false );
-OUString sSysTempPath;
-if( osl::FileBase::getTempDirURL( sSysTempPath ) == 
osl::FileBase::E_None )
-bIsInTempPath = !sSysTempPath.isEmpty() && 
sLocationURL.startsWith( sSysTempPath );
-#ifdef _WIN32
-if( !bIsInTempPath )
-{
-PWSTR sPath;
-HRESULT hRes = SHGetKnownFolderPath(FOLDERID_InternetCache, 0, 
nullptr, &sPath);
-if( SUCCEEDED(hRes) )
-{
-OUString sTempINetFiles;
-if( 
osl::FileBase::getFileURLFromSystemPath(OUString(

core.git: sfx2/source

2025-09-20 Thread Mike Kaganski (via logerrit)
 sfx2/source/appl/fileobj.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d4e291460fe801f82f405cdf648d96ed06a8113a
Author: Mike Kaganski 
AuthorDate: Sat Sep 20 10:59:45 2025 +0200
Commit: Mike Kaganski 
CommitDate: Sat Sep 20 13:17:49 2025 +0200

GetData doesn't need to register the requested format

It only compares the returned id to the pre-defined ones, so adding
a new dynamic format is useless.

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

diff --git a/sfx2/source/appl/fileobj.cxx b/sfx2/source/appl/fileobj.cxx
index 2d4aa100d9d3..1e8517acddb6 100644
--- a/sfx2/source/appl/fileobj.cxx
+++ b/sfx2/source/appl/fileobj.cxx
@@ -73,7 +73,7 @@ bool SvFileObject::GetData( css::uno::Any & rData,
 const OUString & rMimeType,
 bool /*bGetSynchron*/ )
 {
-SotClipboardFormatId nFmt = SotExchange::RegisterFormatMimeType( rMimeType 
);
+SotClipboardFormatId nFmt = 
SotExchange::GetFormatIdFromMimeType(rMimeType);
 switch( nType )
 {
 case SvFileObjectType::Text:


core.git: sfx2/source

2025-09-19 Thread Noel Grandin (via logerrit)
 sfx2/source/appl/appinit.cxx |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 9f4304ff2dbb706a1160afd347e538e615e1290f
Author: Noel Grandin 
AuthorDate: Fri Sep 19 11:10:30 2025 +0200
Commit: Noel Grandin 
CommitDate: Fri Sep 19 12:19:38 2025 +0200

tdf#166483 special char dialog not available with mergedlibs build

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

diff --git a/sfx2/source/appl/appinit.cxx b/sfx2/source/appl/appinit.cxx
index 76f9b0fc75c6..2356099ecc88 100644
--- a/sfx2/source/appl/appinit.cxx
+++ b/sfx2/source/appl/appinit.cxx
@@ -148,7 +148,14 @@ static OUString SfxGetSpecialCharsForEdit(weld::Widget* 
pParent, const vcl::Font
 PFunc_getSpecialCharsForEdit pfunc = nullptr;
 #ifndef DISABLE_DYNLOADING
 osl::Module aMod;
-aMod.loadRelative(&thisModule, SVLIBRARY("cui"));
+aMod.loadRelative(
+&thisModule,
+#if ENABLE_MERGELIBS
+SVLIBRARY("merged")
+#else
+SVLIBRARY("cui")
+#endif
+);
 
 // get symbol
 pfunc = 
reinterpret_cast(aMod.getFunctionSymbol("GetSpecialCharsForEdit"));


core.git: sfx2/source

2025-09-15 Thread Ashod Nakashian (via logerrit)
 sfx2/source/doc/objstor.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 738805c04db2ae298eaf50c5e09cbc9f675a4480
Author: Ashod Nakashian 
AuthorDate: Sat Sep 13 12:53:33 2025 -0400
Commit: Caolán McNamara 
CommitDate: Mon Sep 15 15:40:27 2025 +0200

sfx2: EnableSetModified etc. after loading empty documents

There is special handling of empty documents
which avoids invoking the import filter,
which would fail on empty files. Unfortunately,
it wouldn't enable setting the modified flag
which means that empty documents never
register modifications and data is lost
upon closing.

Signed-off-by: Ashod Nakashian 
Change-Id: I954cf53d9f389d845631786e537b81afaffa2cc6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190921
Reviewed-by: Caolán McNamara 
Tested-by: Jenkins

diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index db01b2e4b263..9c33b88ec1f1 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -782,6 +782,7 @@ bool SfxObjectShell::DoLoad( SfxMedium *pMed )
 {
 // The import filter would fail with empty input.
 bOk = true;
+FinishedLoading(); // EnableSetModified(), etc.
 }
 else
 {


core.git: sfx2/source

2025-09-10 Thread Arnaud VERSINI (via logerrit)
 sfx2/source/view/classificationhelper.cxx |   14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

New commits:
commit afdc48751314300231b783ad26001fb32241dff5
Author: Arnaud VERSINI 
AuthorDate: Fri Sep 5 15:52:47 2025 +0200
Commit: Arnaud Versini 
CommitDate: Wed Sep 10 21:17:10 2025 +0200

sfx2 : use frozen::unordered_maps to avoid allocations

Change-Id: I1259bc5f33f1c0d91493f24b5993237530cd8adb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190617
Tested-by: Jenkins
Reviewed-by: Arnaud Versini 

diff --git a/sfx2/source/view/classificationhelper.cxx 
b/sfx2/source/view/classificationhelper.cxx
index b74f2486d2a9..d35df6733a05 100644
--- a/sfx2/source/view/classificationhelper.cxx
+++ b/sfx2/source/view/classificationhelper.cxx
@@ -13,6 +13,10 @@
 #include 
 #include 
 
+#include 
+#include 
+#include 
+
 #include 
 #include 
 #include 
@@ -761,12 +765,12 @@ sal_Int32 SfxClassificationHelper::GetImpactLevel()
 }
 else if (aScale == "FIPS-199")
 {
-static std::map const aValues
+static auto constexpr aValues = 
frozen::make_unordered_map(
 {
-{ "Low", 0 },
-{ "Moderate", 1 },
-{ "High", 2 }
-};
+{ u"Low", 0 },
+{ u"Moderate", 1 },
+{ u"High", 2 }
+});
 auto itValues = aValues.find(aLevel);
 if (itValues == aValues.end())
 return nRet;


core.git: sfx2/source

2025-09-10 Thread Heiko Tietze (via logerrit)
 sfx2/source/doc/guisaveas.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit b4758df76343f82cdacf35bf526284a82f0bb23f
Author: Heiko Tietze 
AuthorDate: Mon Sep 8 14:54:28 2025 +0200
Commit: Heiko Tietze 
CommitDate: Wed Sep 10 14:02:55 2025 +0200

Resolves tdf#168259 - Hide "Show Again" if readonly

Change-Id: I8a6b2c411da837b69481439b8d29ef0e33a22b84
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190673
Reviewed-by: Justin Luth 
Tested-by: Jenkins
Reviewed-by: Heiko Tietze 

diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 1d7241f42756..8f242373bb70 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -2095,7 +2095,8 @@ bool SfxStoringHelper::WarnUnacceptableFormat( const 
uno::Reference< frame::XMod
 }
 
 VclAbstractDialogFactory* pFact = VclAbstractDialogFactory::Create();
-auto pDlg = pFact->CreateQueryDialog(pWin, 
SfxResId(STR_QUERY_ALIENFORMAT_TTITLE), sInfoText, sQuestion, true);
+bool bShowAgain = 
!officecfg::Office::Common::Save::Document::WarnAlienFormat::isReadOnly();
+auto pDlg = pFact->CreateQueryDialog(pWin, 
SfxResId(STR_QUERY_ALIENFORMAT_TTITLE), sInfoText, sQuestion, bShowAgain);
 
pDlg->SetYesLabel(SfxResId(STR_QUERY_ALIENFORMAT_YES).replaceAll("%FORMATNAME", 
aOldUIName)); // "Use %FORMATNAME Format"
 
pDlg->SetNoLabel(SfxResId(STR_QUERY_ALIENFORMAT_NO).replaceAll("%DEFAULTEXTENSION",
 sExtension)); // "Use %DEFAULTEXTENSION _Format"
 


core.git: sfx2/source

2025-09-03 Thread Neil Roberts (via logerrit)
 sfx2/source/appl/shutdowniconaqua.mm |   50 +++
 1 file changed, 10 insertions(+), 40 deletions(-)

New commits:
commit 9d2da58ec93db75d2fcfce3dc001d9db0851e3c6
Author: Neil Roberts 
AuthorDate: Tue Sep 2 12:37:56 2025 +0200
Commit: Patrick Luby 
CommitDate: Wed Sep 3 23:52:15 2025 +0200

tdf#121253 Remove the default menu new document shortcut keys on MacOS

The default menu on MacOS is displayed when there are no windows or on a
dialog box with no parent. Previously there were hardcoded shortcut keys
to create new documents. As reported in tdf#121253, one of these is ⌘A
which ends up being inconvenient because that is commonly used to select
all the text in a text box. This had the effect that if you tried to use
that shortcut in some dialogs then the dialog would seem to disappear
and be replaced by the new database wizard.

The hardcoded shortcuts were added in 6efdd1444810 which is a patch from
January 2025. Before that the shortcuts were generated based on the menu
item title. ⌘A ends up being used for the database because ⌘D is already
used for a new Draw document and it just picked the next letter along.
These shortcuts were added in 2008 with ba57ba32e8054ec.

This patch removes the shortcuts for the default menu in both the copied
version of the start center menu and the original default menu generated
in code. It seems strange to have shortcuts for these only in the
specific case of there being no window or when a few select dialog boxes
are focused. If they were generally useful to people then surely it
would make sense to add them to the start center menu as well. For
people using non-English language packs the patch from January would
have effectively changed the shortcut keys. If nobody has complained
then it probably means they aren’t used.

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

diff --git a/sfx2/source/appl/shutdowniconaqua.mm 
b/sfx2/source/appl/shutdowniconaqua.mm
index 484b0f44416f..ea82d4b7e005 100644
--- a/sfx2/source/appl/shutdowniconaqua.mm
+++ b/sfx2/source/appl/shutdowniconaqua.mm
@@ -415,24 +415,6 @@ struct RecentMenuEntry
 
 static RecentMenuDelegate* pRecentDelegate = nil;
 
-static OUString getShortCut( const OUString& i_rTitle )
-{
-// create shortcut
-OUString aKeyEquiv;
-for( sal_Int32 nIndex = 0; nIndex < i_rTitle.getLength(); nIndex++ )
-{
-OUString aShortcut( i_rTitle.copy( nIndex, 1 ).toAsciiLowerCase() );
-if( aShortcuts.find( aShortcut ) == aShortcuts.end() )
-{
-aShortcuts.insert( aShortcut );
-aKeyEquiv = aShortcut;
-break;
-}
-}
-
-return aKeyEquiv;   
-}
-
 static void appendMenuItem( NSMenu* i_pMenu, NSMenu* i_pDockMenu, const 
OUString& i_rTitle, int i_nTag, const OUString& i_rKeyEquiv )
 {
 if( ! i_rTitle.getLength() )
@@ -520,6 +502,12 @@ static void setKeyEquivalent( const vcl::KeyCode 
&rKeyCode, NSMenuItem *pNSMenuI
 if ( nModifier & KEY_MOD3 )
 nItemModifier |= NSEventModifierFlagControl;
 
+// Don’t allow setting the ⌘N shortcut because it would conflict
+// with the “Startcenter” menu item which is added explicitly in
+// getNSMenuForVCLMenu
+if ( nCommandKey == 'n' && nItemModifier == NSEventModifierFlagCommand )
+return;
+
 OUString aCommandKey( &nCommandKey, 1 );
 NSString *pCommandKey = [NSString stringWithCharacters: reinterpret_cast< 
unichar const* >(aCommandKey.getStr()) length: aCommandKey.getLength()];
 [pNSMenuItem setKeyEquivalent: pCommandKey];
@@ -589,21 +577,7 @@ static NSMenu *getNSMenuForVCLMenu( Menu *pMenu )
 [pNSMenuItem setTarget: pNSMenuItem];
 [pNSMenuItem setCommand: aCommand];
 
-// Use the default menu's special "open new file" shortcuts
-if ( aCommand == WRITER_URL )
-[pNSMenuItem setKeyEquivalent: @"t"];
-else if ( aCommand == CALC_URL )
-[pNSMenuItem setKeyEquivalent: @"s"];
-else if ( aCommand == IMPRESS_WIZARD_URL )
-[pNSMenuItem setKeyEquivalent: @"p"];
-else if ( aCommand == DRAW_URL )
-[pNSMenuItem setKeyEquivalent: @"d"];
-else if ( aCommand == MATH_URL )
-[pNSMenuItem setKeyEquivalent: @"f"];
-else if ( aCommand == BASE_URL )
-[pNSMenuItem setKeyEquivalent: @"a"];
-else
-setKeyEquivalent( pMenu->GetAccelKey( nId ), 
pNSMenuItem );
+setKeyEquivalent( pMenu->GetAccelKey( nId ), pNSMenuItem );
 }
 

core.git: sfx2/source

2025-09-03 Thread Heiko Tietze (via logerrit)
 sfx2/source/doc/guisaveas.cxx |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 6afd17ac396f7d96800c70a37aaa8beb036c01a6
Author: Heiko Tietze 
AuthorDate: Wed Sep 3 11:12:14 2025 +0200
Commit: Heiko Tietze 
CommitDate: Wed Sep 3 13:16:32 2025 +0200

Resolves tdf#168259 - Add "Show Again" checkbox to SaveAs query

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

diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 3f171cfd8bb8..f99fb12aad16 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -2148,11 +2148,18 @@ bool SfxStoringHelper::WarnUnacceptableFormat( const 
uno::Reference< frame::XMod
 }
 
 VclAbstractDialogFactory* pFact = VclAbstractDialogFactory::Create();
-auto pDlg = pFact->CreateQueryDialog(pWin, 
SfxResId(STR_QUERY_ALIENFORMAT_TTITLE), sInfoText, sQuestion, false);
+auto pDlg = pFact->CreateQueryDialog(pWin, 
SfxResId(STR_QUERY_ALIENFORMAT_TTITLE), sInfoText, sQuestion, true);
 
pDlg->SetYesLabel(SfxResId(STR_QUERY_ALIENFORMAT_YES).replaceAll("%FORMATNAME", 
aOldUIName)); // "Use %FORMATNAME Format"
 
pDlg->SetNoLabel(SfxResId(STR_QUERY_ALIENFORMAT_NO).replaceAll("%DEFAULTEXTENSION",
 sExtension)); // "Use %DEFAULTEXTENSION _Format"
 
 sal_Int32 nResult = pDlg->Execute();
+if (pDlg->ShowAgain() == false)
+{
+std::shared_ptr xChanges(
+comphelper::ConfigurationChanges::create());
+officecfg::Office::Common::Save::Document::WarnAlienFormat::set(false, 
xChanges);
+xChanges->commit();
+}
 pDlg->disposeOnce();
 
 return nResult == RET_YES;


core.git: sfx2/source

2025-09-01 Thread Xisco Fauli (via logerrit)
 sfx2/source/doc/guisaveas.cxx |9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 6372de344a33ce61f7c0cd6bde7dd1a3f351f95a
Author: Xisco Fauli 
AuthorDate: Mon Sep 1 14:04:52 2025 +0200
Commit: Xisco Fauli 
CommitDate: Mon Sep 1 16:03:08 2025 +0200

sfx2: check SfxViewShell::Current()

Seen in 
https://crashreport.libreoffice.org/stats/crash_details/4aabe4e5-c568-4fa8-bcbf-6fb787cd603a

Regression after
commit a4349c502eb2169b3f83d58e49a7871a341daf76
Author: Samuel Mehrbrodt 
Date:   Thu Aug 7 10:51:48 2025 +0200

tdf#167845 Don't preselect the template path

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

diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index b890ae226eb3..3f171cfd8bb8 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -960,9 +960,12 @@ bool ModelData_Impl::OutputFileDialog( sal_Int16 
nStoreMode,
 
 // Fall back to the document base URL - but only if the document is not 
based on a template.
 // Otherwise the template's directory would be used, which is not what we 
want.
-SfxObjectShell* pDocShell = SfxViewShell::Current()->GetObjectShell();
-if (sPreselectedDir.isEmpty() && pDocShell && 
!pDocShell->IsBasedOnTemplate())
-sPreselectedDir = 
GetDocProps().getUnpackedValueOrDefault("DocumentBaseURL", OUString());
+if (SfxViewShell* pViewShell = SfxViewShell::Current())
+{
+SfxObjectShell* pDocShell = pViewShell->GetObjectShell();
+if (sPreselectedDir.isEmpty() && pDocShell && 
!pDocShell->IsBasedOnTemplate())
+sPreselectedDir = 
GetDocProps().getUnpackedValueOrDefault("DocumentBaseURL", OUString());
+}
 INetURLObject aObj(sPreselectedDir);
 aObj.removeSegment(); // remove file name from URL
 sPreselectedDir = aObj.GetMainURL(INetURLObject::DecodeMechanism::NONE);


core.git: sfx2/source

2025-08-27 Thread Mike Kaganski (via logerrit)
 sfx2/source/bastyp/fltfnc.cxx |9 +
 1 file changed, 9 insertions(+)

New commits:
commit dfb5639721031bcc43905576e84a97bed512567e
Author: Mike Kaganski 
AuthorDate: Wed Aug 27 13:57:08 2025 +0500
Commit: Mike Kaganski 
CommitDate: Wed Aug 27 12:52:01 2025 +0200

tdf#168131: don't pick hybrid PDF, when normal PDF was detected

When a standard PDF is dragged onto a spreadsheet, a matcher is
created in ScViewFunc::PasteFile, with current document service.
Inside GuessFilterControlDefaultUI call, queryTypeByDescriptor
detects pdf_Portable_Document_Format type, and draw_pdf_import
as filter. Detection in PDFDetector::detect checks for embedded
hybrid stream, and if found, it would return one of "addstream"
filter names; and when we get a simple "*_pdf_import", it means
that hybrid PDF was not detected.

But SfxFilterMatcher::GuessFilterControlDefaultUI tried to find
a filter for the detected file type, that matches the document
service. It listed all filters for the type, and found the only
filter that matched Calc: calc_pdf_addstream_import, which is for
hybrid PDFs.

This change makes an explicit check, that when original detection
was for a normal PDF, we don't pick hybrid PDF filter.

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

diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx
index 473bdfe17788..73665f295b9c 100644
--- a/sfx2/source/bastyp/fltfnc.cxx
+++ b/sfx2/source/bastyp/fltfnc.cxx
@@ -421,6 +421,15 @@ ErrCode  SfxFilterMatcher::GuessFilterControlDefaultUI( 
SfxMedium& rMedium, std:
 uno::Sequence< beans::NamedValue > lQuery { { u"Name"_ustr, 
css::uno::Any(sTypeName) } };
 
 xNewFilter = GetFilterForProps(lQuery, nMust, nDont);
+if (xNewFilter && 
xNewFilter->GetFilterName().endsWith("_pdf_addstream_import")
+&& aFilterName.endsWith("_pdf_import")
+&& sTypeName == "pdf_Portable_Document_Format")
+{
+// pdf_Portable_Document_Format covers two sets of import 
filters: normal PDF
+// (like draw_pdf_import), and hybrid (like 
calc_pdf_addstream_import).
+// Type detection didn't detect hybrid PDF; this new 
filter can't match
+xNewFilter.reset();
+}
 }
 
 if (xNewFilter)


core.git: sfx2/source

2025-08-26 Thread Andreas Heinisch (via logerrit)
 sfx2/source/appl/linkmgr2.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 0d9b65eed8f518af5108f2587c2b237af9463622
Author: Andreas Heinisch 
AuthorDate: Tue Aug 26 17:45:14 2025 +0200
Commit: Andreas Heinisch 
CommitDate: Tue Aug 26 21:03:51 2025 +0200

tdf#168089 - Don't URL encode filename for the update links confirmation 
dialog

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

diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx
index bc3d82534be7..01febae9df5f 100644
--- a/sfx2/source/appl/linkmgr2.cxx
+++ b/sfx2/source/appl/linkmgr2.cxx
@@ -345,7 +345,7 @@ void LinkManager::UpdateAllLinks(
 INetURLObject aURL(pPersist->getDocumentBaseURL());
 // tdf#168089 - don't URL encode filename for the update links 
confirmation dialog
 aMsg = aMsg.replaceFirst("%{filename}",
- 
aURL.GetLastName(INetURLObject::DecodeMechanism::Unambiguous));
+ 
aURL.GetLastName(INetURLObject::DecodeMechanism::WithCharset));
 
 std::unique_ptr 
xQueryBox(Application::CreateMessageDialog(pParentWin,

VclMessageType::Question, VclButtonsType::YesNo, aMsg));


core.git: sfx2/source

2025-08-26 Thread Andreas Heinisch (via logerrit)
 sfx2/source/appl/linkmgr2.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 7039f8acee67cbf20a4ca2b11e8bec5ac8a94414
Author: Andreas Heinisch 
AuthorDate: Sun Aug 24 11:35:47 2025 +0200
Commit: Andreas Heinisch 
CommitDate: Tue Aug 26 15:06:38 2025 +0200

tdf#168089 - Don't URL encode filename for the update links confirmation 
dialog

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

diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx
index 6d9bb0476e17..bc3d82534be7 100644
--- a/sfx2/source/appl/linkmgr2.cxx
+++ b/sfx2/source/appl/linkmgr2.cxx
@@ -343,7 +343,9 @@ void LinkManager::UpdateAllLinks(
 
 OUString aMsg = SfxResId(STR_QUERY_UPDATE_LINKS);
 INetURLObject aURL(pPersist->getDocumentBaseURL());
-aMsg = aMsg.replaceFirst("%{filename}", aURL.GetLastName());
+// tdf#168089 - don't URL encode filename for the update links 
confirmation dialog
+aMsg = aMsg.replaceFirst("%{filename}",
+ 
aURL.GetLastName(INetURLObject::DecodeMechanism::Unambiguous));
 
 std::unique_ptr 
xQueryBox(Application::CreateMessageDialog(pParentWin,

VclMessageType::Question, VclButtonsType::YesNo, aMsg));


core.git: sfx2/source

2025-08-07 Thread Samuel Mehrbrodt (via logerrit)
 sfx2/source/doc/objstor.cxx  |   12 +++-
 sfx2/source/doc/sfxbasemodel.cxx |6 +++---
 2 files changed, 6 insertions(+), 12 deletions(-)

New commits:
commit 69670381ef2ff9c673c430ace8e36b1940e099bf
Author: Samuel Mehrbrodt 
AuthorDate: Thu Aug 7 11:04:13 2025 +0200
Commit: Samuel Mehrbrodt 
CommitDate: Thu Aug 7 13:27:49 2025 +0200

Simplify code: Use IsBasedOnTemplate method

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

diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 59fa65c02ac2..b23396599240 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -610,9 +610,8 @@ bool SfxObjectShell::DoLoad( SfxMedium *pMed )
 SfxItemSet& rSet = pMedium->GetItemSet();
 if( pImpl->nEventId == SfxEventHintId::NONE )
 {
-const SfxBoolItem* pTemplateItem = rSet.GetItem(SID_TEMPLATE, false);
 SetActivateEvent_Impl(
-( pTemplateItem && pTemplateItem->GetValue() )
+( IsBasedOnTemplate() )
 ? SfxEventHintId::CreateDoc : SfxEventHintId::OpenDoc );
 }
 
@@ -713,9 +712,7 @@ bool SfxObjectShell::DoLoad( SfxMedium *pMed )
 if ( bOk )
 {
 // the document loaded from template has no name
-const SfxBoolItem* pTemplateItem = 
rSet.GetItem(SID_TEMPLATE, false);
-if ( !pTemplateItem || !pTemplateItem->GetValue() )
-bHasName = true;
+bHasName = !IsBasedOnTemplate();
 }
 else
 SetError(ERRCODE_ABORT);
@@ -2479,12 +2476,9 @@ bool SfxObjectShell::DoSaveCompleted( SfxMedium* 
pNewMed, bool bRegisterRecent )
 {}
 }
 
-const SfxBoolItem* pTemplateItem = 
pMedium->GetItemSet().GetItem(SID_TEMPLATE, false);
-bool bTemplate = pTemplateItem && pTemplateItem->GetValue();
-
 // before the title regenerated the document must lose the 
signatures
 pImpl->nDocumentSignatureState = SignatureState::NOSIGNATURES;
-if (!bTemplate)
+if (!IsBasedOnTemplate())
 {
 pImpl->nScriptingSignatureState = 
pNewMed->GetCachedSignatureState_Impl();
 OSL_ENSURE( pImpl->nScriptingSignatureState != 
SignatureState::BROKEN, "The signature must not be broken at this place" );
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 1d4547e12da2..603757f882e0 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -3866,9 +3866,9 @@ void SAL_CALL SfxBaseModel::loadFromStorage( const 
Reference< embed::XStorage >&
 // allow to use an interactionhandler (if there is one)
 pMedium->UseInteractionHandler( true );
 
-const SfxBoolItem* pTemplateItem = aSet.GetItem(SID_TEMPLATE, 
false);
-bool bTemplate = pTemplateItem && pTemplateItem->GetValue();
-m_pData->m_pObjectShell->SetActivateEvent_Impl( bTemplate ? 
SfxEventHintId::CreateDoc : SfxEventHintId::OpenDoc );
+
m_pData->m_pObjectShell->SetActivateEvent_Impl(m_pData->m_pObjectShell->IsBasedOnTemplate()
+   ? 
SfxEventHintId::CreateDoc
+   : 
SfxEventHintId::OpenDoc);
 m_pData->m_pObjectShell->Get_Impl()->bOwnsStorage = false;
 
 // load document


core.git: sfx2/source

2025-07-31 Thread Michael Weghorn (via logerrit)
 sfx2/source/dialog/tabdlg.cxx |   10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

New commits:
commit b428c42d0dadc93b33be44107a07ededc6f0fb9e
Author: Michael Weghorn 
AuthorDate: Thu Jul 31 14:05:20 2025 +0200
Commit: Michael Weghorn 
CommitDate: Thu Jul 31 16:47:10 2025 +0200

sfx2: Don't try to preselect non-existing tab page

When trying to set the initially active page in a tab
dialog to the one that was remembered, verify that
a tab with the given ID actually exists.

Only try to set it as the active one if that is the
case, otherwise fall back to activating the first
tab, as happens when none has been remembered.

One case where this is relevant are dialogs that
don't always show up with the same set of tabs
available, like the chart attributes one.

Without this commit in place, the following scenario
would trigger a

warn:sfx.dialog:483586:483586:sfx2/source/dialog/tabdlg.cxx:537: Tab 
Page ID '' not known, this is pretty serious and needs investigation

warning and leave the dialog with no tab initially
selected for the VCL (SalInstanceNotebook) case,
e.g. when using the gen or qt6 VCL plugins:

* start Writer
* insert chart (using the "Insert Chart" toolbar item)
* double-click on the first "bar" in the chart to open
  the "Data Series"   dialog
* activate the "Options" tab
* close the dialog
* double-click on an "empty" area between two bars to
  open the "Chart Wall" dialog

Since the "Chart Wall" dialog doesn't have an "Options" tab,
preselecting it would fail, leaving the dialog with no tab page
preselected.  For all other 4 tabs ("Area", "Transparency",
"Border", "Color Palette"), the corresponding tab would be
preselected, as both, the "Data Series" and the "Options" tab have
such tabs (using the same ID).

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

diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index be47326cbda1..a93d32016298 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -1031,11 +1031,15 @@ void SfxTabDialogController::Start_Impl()
 // something that the sort dialog in calc depends on
 if (m_sAppPageId.isEmpty())
 {
+int nInitialPage = 0;
 SvtViewOptions aDlgOpt(EViewType::TabDialog, m_xDialog->get_help_id());
 if (aDlgOpt.Exists())
-m_xTabCtrl->set_current_page(aDlgOpt.GetPageID());
-else
-m_xTabCtrl->set_current_page(0);
+{
+const int nIndex = m_xTabCtrl->get_page_index(aDlgOpt.GetPageID());
+if (nIndex >= 0)
+nInitialPage = nIndex;
+}
+m_xTabCtrl->set_current_page(nInitialPage);
 }
 
 ActivatePage(m_xTabCtrl->get_current_page_ident());


core.git: sfx2/source

2025-07-25 Thread Marc Mondesir (via logerrit)
 sfx2/source/dialog/StyleList.cxx |   10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

New commits:
commit bb89af3aa3ee1dc6196b92c951d1aebea9f96209
Author: Marc Mondesir 
AuthorDate: Thu Jul 24 12:40:00 2025 -0700
Commit: Noel Grandin 
CommitDate: Fri Jul 25 19:21:56 2025 +0200

(related tdf#128357) Fix bad sort.

First sort() call puts list in order by pointer value since no compare
function given, which just makes more work for second sort() call. This
was meant to function like sort() calls in StyleList::UpdateStyles. Add
compare function to sort alphabetically to match that, and copy comment.

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

diff --git a/sfx2/source/dialog/StyleList.cxx b/sfx2/source/dialog/StyleList.cxx
index 0d35c0152319..7748177ef4af 100644
--- a/sfx2/source/dialog/StyleList.cxx
+++ b/sfx2/source/dialog/StyleList.cxx
@@ -682,7 +682,15 @@ static void MakeTree_Impl(StyleTreeArr_Impl& rArr, const 
OUString& aUIName)
 std::erase_if(rArr, [](std::unique_ptr const& pEntry) { 
return !pEntry; });
 
 // tdf#91106 sort top level styles
-std::sort(rArr.begin(), rArr.end());
+// Paradoxically, with a list and non-Latin style names,
+// sorting twice is faster than sorting once.
+// The first sort has a cheap comparator, and gets the list into 
mostly-sorted order.
+// Then the second sort needs to call its (much more expensive) comparator 
less often.
+std::sort(rArr.begin(), rArr.end(),
+  [](std::unique_ptr const& pEntry1,
+ std::unique_ptr const& pEntry2) {
+  return pEntry1->getName() < pEntry2->getName();
+  });
 std::sort(rArr.begin(), rArr.end(),
   [&aSorter, &aUIName](std::unique_ptr const& 
pEntry1,
std::unique_ptr const& 
pEntry2) {


core.git: sfx2/source

2025-07-24 Thread Caolán McNamara (via logerrit)
 sfx2/source/view/lokhelper.cxx |   17 -
 1 file changed, 8 insertions(+), 9 deletions(-)

New commits:
commit 3e23cba56886bf52c24f979abf3f93d04b5b111d
Author: Caolán McNamara 
AuthorDate: Wed Jul 23 19:30:09 2025 +0100
Commit: Caolán McNamara 
CommitDate: Thu Jul 24 21:46:50 2025 +0200

all lcl_generateJSON variants unconditionally deref the ViewShell arg

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

diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index be52c1dc8b39..67614b55bf97 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -458,20 +458,19 @@ static OString lcl_generateJSON(const SfxViewShell& 
rView, const boost::property
 return OString(o3tl::trim(aStream.str()));
 }
 
-static inline OString lcl_generateJSON(const SfxViewShell* pView, int nViewId, 
std::string_view rKey,
+static inline OString lcl_generateJSON(const SfxViewShell& rView, int nViewId, 
std::string_view rKey,
const OString& rPayload)
 {
-assert(pView != nullptr && "pView must be valid");
 return OString::Concat("{ \"viewId\": \"") + OString::number(nViewId)
-   + "\", \"part\": \"" + OString::number(pView->getPart()) + "\", 
\"mode\": \""
-   + OString::number(pView->getEditMode()) + "\", \"" + rKey + "\": \""
+   + "\", \"part\": \"" + OString::number(rView.getPart()) + "\", 
\"mode\": \""
+   + OString::number(rView.getEditMode()) + "\", \"" + rKey + "\": \""
+ lcl_sanitizeJSONAsValue(rPayload) + "\" }";
 }
 
-static inline OString lcl_generateJSON(const SfxViewShell* pView, 
std::string_view rKey,
+static inline OString lcl_generateJSON(const SfxViewShell& rView, 
std::string_view rKey,
const OString& rPayload)
 {
-return lcl_generateJSON(pView, SfxLokHelper::getView(pView), rKey, 
rPayload);
+return lcl_generateJSON(rView, SfxLokHelper::getView(rView), rKey, 
rPayload);
 }
 
 void SfxLokHelper::notifyOtherView(const SfxViewShell* pThisView, SfxViewShell 
const* pOtherView,
@@ -481,7 +480,7 @@ void SfxLokHelper::notifyOtherView(const SfxViewShell* 
pThisView, SfxViewShell c
 if (DisableCallbacks::disabled())
 return;
 
-const OString aPayload = lcl_generateJSON(pThisView, rKey, rPayload);
+const OString aPayload = lcl_generateJSON(*pThisView, rKey, rPayload);
 const int viewId = SfxLokHelper::getView(pThisView);
 pOtherView->libreOfficeKitViewCallbackWithViewId(nType, aPayload, viewId);
 }
@@ -516,7 +515,7 @@ void SfxLokHelper::notifyOtherViews(const SfxViewShell* 
pThisView, int nType, st
 // Payload is only dependent on pThisView.
 if (aPayload.isEmpty())
 {
-aPayload = lcl_generateJSON(pThisView, rKey, rPayload);
+aPayload = lcl_generateJSON(*pThisView, rKey, rPayload);
 viewId = SfxLokHelper::getView(*pThisView);
 }
 
@@ -560,7 +559,7 @@ void SfxLokHelper::notifyOtherViews(const SfxViewShell* 
pThisView, int nType,
 
 OString SfxLokHelper::makePayloadJSON(const SfxViewShell* pThisView, int 
nViewId, std::string_view rKey, const OString& rPayload)
 {
-return lcl_generateJSON(pThisView, nViewId, rKey, rPayload);
+return lcl_generateJSON(*pThisView, nViewId, rKey, rPayload);
 }
 
 namespace {


core.git: sfx2/source

2025-07-24 Thread Caolán McNamara (via logerrit)
 sfx2/source/view/lokhelper.cxx |   13 ++---
 1 file changed, 6 insertions(+), 7 deletions(-)

New commits:
commit dae8f420dd37ba425aec49bf322497e6a18a41af
Author: Caolán McNamara 
AuthorDate: Wed Jul 23 19:21:03 2025 +0100
Commit: Caolán McNamara 
CommitDate: Thu Jul 24 17:39:17 2025 +0200

two arg lcl_generateJSON always derefs ViewShell

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

diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index fc15e29c4478..08f5e37fb603 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -447,13 +447,12 @@ static OString lcl_sanitizeJSONAsValue(const OString 
&rStr)
 return aBuf.makeStringAndClear();
 }
 
-static OString lcl_generateJSON(const SfxViewShell* pView, const 
boost::property_tree::ptree& rTree)
+static OString lcl_generateJSON(const SfxViewShell& rView, const 
boost::property_tree::ptree& rTree)
 {
-assert(pView != nullptr && "pView must be valid");
 boost::property_tree::ptree aMessageProps = rTree;
-aMessageProps.put("viewId", SfxLokHelper::getView(pView));
-aMessageProps.put("part", pView->getPart());
-aMessageProps.put("mode", pView->getEditMode());
+aMessageProps.put("viewId", SfxLokHelper::getView(rView));
+aMessageProps.put("part", rView.getPart());
+aMessageProps.put("mode", rView.getEditMode());
 std::stringstream aStream;
 boost::property_tree::write_json(aStream, aMessageProps, false /* pretty 
*/);
 return OString(o3tl::trim(aStream.str()));
@@ -495,7 +494,7 @@ void SfxLokHelper::notifyOtherView(const SfxViewShell* 
pThisView, SfxViewShell c
 return;
 
 const int viewId = SfxLokHelper::getView(pThisView);
-pOtherView->libreOfficeKitViewCallbackWithViewId(nType, 
lcl_generateJSON(pThisView, rTree), viewId);
+pOtherView->libreOfficeKitViewCallbackWithViewId(nType, 
lcl_generateJSON(*pThisView, rTree), viewId);
 }
 
 void SfxLokHelper::notifyOtherViews(const SfxViewShell* pThisView, int nType, 
std::string_view rKey,
@@ -549,7 +548,7 @@ void SfxLokHelper::notifyOtherViews(const SfxViewShell* 
pThisView, int nType,
 // Payload is only dependent on pThisView.
 if (aPayload.isEmpty())
 {
-aPayload = lcl_generateJSON(pThisView, rTree);
+aPayload = lcl_generateJSON(*pThisView, rTree);
 viewId = SfxLokHelper::getView(*pThisView);
 }
 


core.git: sfx2/source

2025-07-12 Thread Heiko Tietze (via logerrit)
 sfx2/source/dialog/tabdlg.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2869d6151683a55ba795fe244bb699673ccd7008
Author: Heiko Tietze 
AuthorDate: Sat Jul 12 18:18:41 2025 +0200
Commit: Heiko Tietze 
CommitDate: Sat Jul 12 18:43:58 2025 +0200

Revert "tdf#167066, relates tdf#165487 - Show first tab as fallback"

This reverts commit 7c714428ff1a178378dec03cc287ab86fc35ec5a.

Reason for revert: Edit Style dialogs always start with the first tab

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

diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index 5bab0b7e105e..9bdc433dab5f 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -1032,7 +1032,7 @@ void SfxTabDialogController::Start_Impl()
 if (m_sAppPageId.isEmpty())
 {
 SvtViewOptions aDlgOpt(EViewType::TabDialog, m_xDialog->get_help_id());
-if (aDlgOpt.Exists() && !aDlgOpt.GetPageID().isEmpty())
+if (aDlgOpt.Exists())
 m_xTabCtrl->set_current_page(aDlgOpt.GetPageID());
 else
 m_xTabCtrl->set_current_page(0);


core.git: sfx2/source

2025-07-11 Thread Heiko Tietze (via logerrit)
 sfx2/source/dialog/tabdlg.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 7c714428ff1a178378dec03cc287ab86fc35ec5a
Author: Heiko Tietze 
AuthorDate: Fri Jul 11 17:12:16 2025 +0200
Commit: Heiko Tietze 
CommitDate: Fri Jul 11 17:24:20 2025 +0200

tdf#167066, relates tdf#165487 - Show first tab as fallback

Amends eaa970c9b9d4d8e9e29e419791f7d0dceb7c4d8c
Chart dialogs with VT style had no default tab selected

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

diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index 9bdc433dab5f..5bab0b7e105e 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -1032,7 +1032,7 @@ void SfxTabDialogController::Start_Impl()
 if (m_sAppPageId.isEmpty())
 {
 SvtViewOptions aDlgOpt(EViewType::TabDialog, m_xDialog->get_help_id());
-if (aDlgOpt.Exists())
+if (aDlgOpt.Exists() && !aDlgOpt.GetPageID().isEmpty())
 m_xTabCtrl->set_current_page(aDlgOpt.GetPageID());
 else
 m_xTabCtrl->set_current_page(0);


core.git: sfx2/source

2025-07-09 Thread Sahil Gautam (via logerrit)
 sfx2/source/appl/appserv.cxx |   62 +++
 1 file changed, 28 insertions(+), 34 deletions(-)

New commits:
commit 9645c6d4e5cd0841d9d9e474ce5f27cec8fcda1c
Author: Sahil Gautam 
AuthorDate: Sat Jun 7 08:28:48 2025 +0530
Commit: Sahil Gautam 
CommitDate: Wed Jul 9 11:45:06 2025 +0200

tdf#164970 Update .uno:ChangeTheme as per current themes implementation

Before the themes rework, the document appearance and the application
appearance were separately managed which is not the case now. Now themes
map to appearance modes as follows:

Custom theme -> AppearanceMode::AUTO
Automatic-> AppearanceMode::AUTO
Light-> AppearanceMode::LIGHT
Dark -> AppearanceMode::DARK

The current implementation toggles between Light and Dark themes except
for the case where the current theme is a custom theme.

Change-Id: I6062924a36c7848794a7588cee157333fc3e5e9a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186233
Tested-by: Jenkins
Reviewed-by: Sahil Gautam 

diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index 25d5ee8b4519..9c4a6765b885 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -698,45 +698,39 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
 case FN_CHANGE_THEME:
 {
 const SfxStringItem* pNewThemeArg = 
rReq.GetArg(FN_PARAM_NEW_THEME);
-OUString sSchemeName
-= pNewThemeArg ? pNewThemeArg->GetValue() : 
u"COLOR_SCHEME_LIBREOFFICE_AUTOMATIC"_ustr;
+OUString sSchemeName = 
ThemeColors::GetThemeColors().GetThemeName();
+AppearanceMode eAppearnceMode = MiscSettings::GetAppColorMode();
+
 if (!pNewThemeArg)
 {
-// toggle between light and dark mode
-
-// There are two separate things that can be dark mode themed: 
UI and document
-// The modes can be 0 (automatic - what the OS/VCL asks for), 
1 (light), or 2 (dark)
-
-// Since only gtk/osx/win support UI theme, toggle based on 
document colors
-// Automatic in this case means "whatever GetUseDarkMode() 
says"
-const bool bWasInDarkMode
-= MiscSettings::GetAppColorMode() == AppearanceMode::DARK
-  || (MiscSettings::GetAppColorMode() == 
AppearanceMode::AUTO
-  && MiscSettings::GetUseDarkMode());
-
-// Set the UI theme. It would be nicest to use automatic 
whenever possible
-AppearanceMode eUseMode = AppearanceMode::AUTO;
-if (MiscSettings::GetAppColorMode() != AppearanceMode::AUTO)
-MiscSettings::SetAppColorMode(eUseMode);
-
-if (MiscSettings::GetUseDarkMode() == bWasInDarkMode)
-{
-// automatic didn't toggle, so force the desired theme
-eUseMode = bWasInDarkMode ? AppearanceMode::LIGHT : 
AppearanceMode::DARK;
-MiscSettings::SetAppColorMode(eUseMode);
-}
-
-// Now set the document theme
-// If the UI can be themed, then the document theme can always 
remain on automatic.
-eUseMode = AppearanceMode::AUTO;
-// NOTE: since SetDarkMode has run, GetUseDarkMode might 
return a different result.
-if (MiscSettings::GetUseDarkMode() == bWasInDarkMode)
+// we do not override custom themes if the unocommand was 
triggered from the UI
+// by clicking on a toolbar/notebookbar button for example.
+if (!ThemeColors::IsCustomTheme(sSchemeName))
 {
-eUseMode = bWasInDarkMode ? AppearanceMode::LIGHT : 
AppearanceMode::DARK;
-sSchemeName = bWasInDarkMode ? u"Light" : u"Dark";
+bool bChangeToLightTheme = eAppearnceMode == 
AppearanceMode::DARK
+   || (eAppearnceMode == 
AppearanceMode::AUTO
+   && 
MiscSettings::GetUseDarkMode());
+
+// note that a theme and an appearance mode are not 
orthogonal anymore, for
+// "Custom Themes", appearance mode is AUTO, for the 
"Automatic", "Light" and
+// "Dark" default themes, it's AUTO, LIGHT & DARK 
respectively.
+if (bChangeToLightTheme)
+{
+sSchemeName = svtools::LIGHT_COLOR_SCHEME;
+eAppearnceMode = AppearanceMode::LIGHT;
+}
+else
+{
+sSchemeName = svtools::DARK_COLOR_SCHEME;
+eAppearnceMode = AppearanceMode::DARK;
+}
 }
- 

core.git: sfx2/source

2025-07-02 Thread Mike Kaganski (via logerrit)
 sfx2/source/control/dispatch.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 88d2a98b23d155e8711ddb0600092ec85acb5792
Author: Mike Kaganski 
AuthorDate: Wed Jul 2 16:44:33 2025 +0200
Commit: Mike Kaganski 
CommitDate: Wed Jul 2 19:15:10 2025 +0200

Drop nFirstShell from SfxDispatcher::FindServer_

Obsoleted by commit 27dadc070ec2c2a602d3c5b3494dd0bdc15c785f
(loplugin:singlevalfields in sfx2, 2018-10-16).

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

diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index 782e61fe7e2f..30e5b7cb6fc4 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -1665,8 +1665,7 @@ bool SfxDispatcher::FindServer_(sal_uInt16 nSlot, 
SfxSlotServer& rServer)
 
 // search through all the shells of the chained dispatchers
 // from top to bottom
-sal_uInt16 nFirstShell = 0;
-for ( sal_uInt16 i = nFirstShell; i < nTotCount; ++i )
+for (sal_uInt16 i = 0; i < nTotCount; ++i)
 {
 SfxShell *pObjShell = GetShell(i);
 if (!pObjShell)


core.git: sfx2/source

2025-06-30 Thread Heiko Tietze (via logerrit)
 sfx2/source/dialog/infobar.cxx |   18 +++---
 1 file changed, 11 insertions(+), 7 deletions(-)

New commits:
commit f7c20a1c78dc5eed539a0c520b80270c7b843399
Author: Heiko Tietze 
AuthorDate: Mon Jun 30 10:16:32 2025 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Tue Jul 1 08:42:57 2025 +0200

Resolves tdf#167219 - Invert infobar colors on dark background

Change-Id: I592509bcdb74ef5ac88a1cab51c2ffc978a19ecd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187169
Reviewed-by: Adolfo Jayme Barrientos 
Tested-by: Jenkins

diff --git a/sfx2/source/dialog/infobar.cxx b/sfx2/source/dialog/infobar.cxx
index c6a919d43710..1ff57326ce6c 100644
--- a/sfx2/source/dialog/infobar.cxx
+++ b/sfx2/source/dialog/infobar.cxx
@@ -43,18 +43,22 @@ void GetInfoBarColors(InfobarType ibType, BColor& 
rBackgroundColor, BColor& rFor
   BColor& rMessageColor)
 {
 const StyleSettings& rSettings = 
Application::GetSettings().GetStyleSettings();
-
+const bool bIsDark = rSettings.GetWindowColor().IsDark();
 switch (ibType)
 {
 case InfobarType::INFO: // blue; #004785/0,71,133; #BDE5F8/189,229,248
-rBackgroundColor = basegfx::BColor(0.741, 0.898, 0.973);
-rForegroundColor = basegfx::BColor(0.0, 0.278, 0.522);
-rMessageColor = basegfx::BColor(0.0, 0.278, 0.522);
+rBackgroundColor = bIsDark ? basegfx::BColor(0.000, 0.278, 0.522)
+   : basegfx::BColor(0.741, 0.898, 0.973);
+rForegroundColor = bIsDark ? basegfx::BColor(0.741, 0.898, 0.973)
+   : basegfx::BColor(0.000, 0.278, 0.522);
+rMessageColor = rForegroundColor;
 break;
 case InfobarType::SUCCESS: // green; #32550C/50,85,12; 
#DFF2BF/223,242,191
-rBackgroundColor = basegfx::BColor(0.874, 0.949, 0.749);
-rForegroundColor = basegfx::BColor(0.196, 0.333, 0.047);
-rMessageColor = basegfx::BColor(0.196, 0.333, 0.047);
+rBackgroundColor = bIsDark ? basegfx::BColor(0.196, 0.333, 0.047)
+   : basegfx::BColor(0.874, 0.949, 0.749);
+rForegroundColor = bIsDark ? basegfx::BColor(0.874, 0.949, 0.749)
+   : basegfx::BColor(0.196, 0.333, 0.047);
+rMessageColor = rForegroundColor;
 break;
 case InfobarType::WARNING: // orange; #704300/112,67,0; 
#FEEFB3/254,239,179
 rBackgroundColor = rSettings.GetWarningColor().getBColor();


core.git: sfx2/source

2025-06-24 Thread Mike Kaganski (via logerrit)
 sfx2/source/doc/sfxbasemodel.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 9f215024f6a3909228ff50439782e5ffa30ddb14
Author: Mike Kaganski 
AuthorDate: Wed Jun 25 00:07:28 2025 +0500
Commit: Mike Kaganski 
CommitDate: Tue Jun 24 22:31:11 2025 +0200

SfxBaseModel: allow repeated dispose()

A crash seen at shutdown with this call stack:

  ucrtbased.dll!terminate() Line 59
  vcruntime140_1d.dll!FindHandler<__FrameHandler4>()Unknown
  vcruntime140_1d.dll!__InternalCxxFrameHandler(struct EHExceptionRecord *,unsigned __int64 *,struct _CONTEXT 
*,struct _xDISPATCHER_CONTEXT *,struct FH4::FuncInfo4 *,int,unsigned __int64 
*,unsigned char)  Unknown
  vcruntime140_1d.dll!__InternalCxxFrameHandlerWrapper(struct EHExceptionRecord *,unsigned __int64 *,struct _CONTEXT 
*,struct _xDISPATCHER_CONTEXT *,struct FH4::FuncInfo4 *,int,unsigned __int64 
*,unsigned char)   Unknown
  vcruntime140_1d.dll!__CxxFrameHandler4()  Unknown
  ntdll.dll!RtlpExecuteHandlerForException()Unknown
  ntdll.dll!RtlDispatchException()  Unknown
  ntdll.dll!RtlRaiseException() Unknown
  KernelBase.dll!RaiseException()   Unknown
  vcruntime140d.dll!_CxxThrowException(void * pExceptionObject, const 
_s__ThrowInfo * pThrowInfo) Line 79
  sfxlo.dll!SfxBaseModel::MethodEntryCheck(const bool i_mustBeInitialized) 
Line 3065
  sfxlo.dll!SfxModelGuard::SfxModelGuard(const SfxBaseModel & i_rModel, 
const SfxModelGuard::AllowedModelState i_eState) Line 76
  sfxlo.dll!SfxBaseModel::dispose() Line 740
  cppuhelper3MSC.dll!cppu::`anonymous 
namespace'::ComponentContext::disposing(std::unique_lock & rGuard) 
Line 423
  cppuhelper3MSC.dll!cppuhelper::WeakComponentImplHelperBase2::dispose() 
Line 27
  
cppuhelper3MSC.dll!cppuhelper::WeakComponentImplHelper2::dispose()
 Line 87
  cppuhelper3MSC.dll!cppu::`anonymous 
namespace'::DisposingForwarder::disposing(const 
com::sun::star::lang::EventObject & __formal) Line 117
  
cppuhelper3MSC.dll!cppuhelper::OInterfaceContainerHelper4::disposeAndClear(std::unique_lock
 & rGuard, const com::sun::star::lang::EventObject & rEvt) Line 402
  cppuhelper3MSC.dll!cppuhelper::WeakComponentImplHelperBase2::dispose() 
Line 31
  
cppuhelper3MSC.dll!cppuhelper::WeakComponentImplHelper2::dispose()
 Line 87
  sofficeapp.dll!desktop::Desktop::DeInit() Line 606
  vcllo.dll!DeInitVCL() Line 530
  vcllo.dll!ImplSVMain() Line 244
  vcllo.dll!SVMain() Line 250
  sofficeapp.dll!soffice_main() Line 122
  soffice.bin!sal_main() Line 51C
  soffice.bin!main(int argc, char * * argv) Line 49 C
  soffice.bin!invoke_main() Line 79
  soffice.bin!__scrt_common_main_seh() Line 288
  soffice.bin!__scrt_common_main() Line 331
  soffice.bin!mainCRTStartup(void * __formal) Line 17
  kernel32.dll!BaseThreadInitThunk()Unknown
  ntdll.dll!RtlUserThreadStart()Unknown

where impl_isDisposed() returned true in SfxBaseModel::MethodEntryCheck.

The documentation for XComponent::dispose() says:

> The owner of an object calls this method to explicitly free all
> resources kept by this object and thus break cyclic references.
> ...
> After this method has been called, the object should behave as
> passive as possible, thus it should ignore all calls in case it
> can comply with its specification
> ...
> For some objects no real owner can be identified, thus it can be
> disposed from multiple reference holders. In this case the object
> should be able to cope with multiple dispose()-calls (which are
> inevitable in a multithreaded environment).

Let's handle multiple dispose()-calls: this fulfils the "behave as
passive as possible" requirement, because it complies with the
specification: the repeated calls don't leave open resources and
cyclic references after ignoring them; and also fits into the last
clause.

SfxModelGuard is not needed here. It was called with E_INITIALIZING,
which means "do not throw in not initialized"; and that translates
to "only throw when disposed". But that's exactly the state which
we want to handle gracefully now.

And SfxModelGuard uses SolarMutexClearableGuard; so we also should lock
solar mutex here.

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

diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 8b21c5f74ba5..2ee1fefb4b54 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -737,7 +737,9 @@ void SAL_CALL SfxBaseModel::setParent(const Reference< 
XInterface >& Parent)
 
 void SAL_CALL SfxBaseModel::dispose()
 {
-SfxModelGuard aGuard( *this, SfxModelGuard::E_INITIALIZING )

core.git: sfx2/source

2025-06-18 Thread Xisco Fauli (via logerrit)
 sfx2/source/dialog/styledlg.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c8acf629967aed607aa639ef8fd00de67431168d
Author: Xisco Fauli 
AuthorDate: Wed Jun 18 14:37:10 2025 +0200
Commit: Xisco Fauli 
CommitDate: Wed Jun 18 17:45:05 2025 +0200

Revert "tdf#165487 Always select a tab page by default"

After
commit eaa970c9b9d4d8e9e29e419791f7d0dceb7c4d8c
Author: Heiko Tietze 
Date:   Wed Jun 18 11:26:24 2025 +0200

Resolves tdf#167066, relates tdf#165487 - Show first tab as fallback

so it fixes
https://bugs.documentfoundation.org/show_bug.cgi?id=165487#c16

This reverts commit a91494780bb59afe8c971003e6b809f1e66df050.

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

diff --git a/sfx2/source/dialog/styledlg.cxx b/sfx2/source/dialog/styledlg.cxx
index c4bab0881d54..9e5abc01aa73 100644
--- a/sfx2/source/dialog/styledlg.cxx
+++ b/sfx2/source/dialog/styledlg.cxx
@@ -46,7 +46,7 @@ SfxStyleDialogController::SfxStyleDialogController
 AddTabPage(u"organizer"_ustr, SfxManageStyleSheetPage::Create, nullptr);
 
 // With new template always set the management page as the current page
-if (rStyle.GetName().isEmpty() || GetCurPageId().isEmpty())
+if (rStyle.GetName().isEmpty())
 SetCurPageId(u"organizer"_ustr);
 else
 {


core.git: sfx2/source

2025-06-18 Thread Heiko Tietze (via logerrit)
 sfx2/source/dialog/tabdlg.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit eaa970c9b9d4d8e9e29e419791f7d0dceb7c4d8c
Author: Heiko Tietze 
AuthorDate: Wed Jun 18 11:26:24 2025 +0200
Commit: Heiko Tietze 
CommitDate: Wed Jun 18 14:33:43 2025 +0200

Resolves tdf#167066, relates tdf#165487 - Show first tab as fallback

If the dialog runs for the first time, the viewoptions
are empty and no tab would be active, crashing on Reset

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

diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index 5e75ad64bc57..9320146c9fe6 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -1017,6 +1017,8 @@ void SfxTabDialogController::Start_Impl()
 SvtViewOptions aDlgOpt(EViewType::TabDialog, m_xDialog->get_help_id());
 if (aDlgOpt.Exists())
 m_xTabCtrl->set_current_page(aDlgOpt.GetPageID());
+else
+m_xTabCtrl->set_current_page(0);
 }
 
 ActivatePage(m_xTabCtrl->get_current_page_ident());


core.git: sfx2/source

2025-06-17 Thread Mike Kaganski (via logerrit)
 sfx2/source/control/dispatch.cxx |   64 ++-
 1 file changed, 30 insertions(+), 34 deletions(-)

New commits:
commit ace2c6b806df370e9b2817b723b8298bdf30bc3b
Author: Mike Kaganski 
AuthorDate: Tue Jun 17 18:01:30 2025 +0500
Commit: Mike Kaganski 
CommitDate: Tue Jun 17 22:00:30 2025 +0200

Flatten SfxDispatcher::FindServer_

The repeated checks of pSlot can be replaces by one initial check.

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

diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index 27d4afbbb82b..8a602b3cf785 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -1646,20 +1646,22 @@ bool SfxDispatcher::FindServer_(sal_uInt16 nSlot, 
SfxSlotServer& rServer)
 
 SfxInterface *pIFace = pObjShell->GetInterface();
 const SfxSlot *pSlot = pIFace->GetSlot(nSlot);
+if (!pSlot)
+continue;
 
 // This check can be true only if Lokit is active and view is readonly.
-if (pSlot && bCheckForCommentCommands)
+if (bCheckForCommentCommands)
 bReadOnly = 
!IsCommandAllowedInLokReadOnlyViewMode(pSlot->GetCommand());
 
-if ( pSlot && pSlot->nDisableFlags != SfxDisableFlags::NONE &&
+if ( pSlot->nDisableFlags != SfxDisableFlags::NONE &&
  ( static_cast(pSlot->nDisableFlags) & 
static_cast(pObjShell->GetDisableFlags()) ) != 0 )
 return false;
 
-if (pSlot && !(pSlot->nFlags & SfxSlotMode::VIEWERAPP) && 
isViewerAppMode)
+if (!(pSlot->nFlags & SfxSlotMode::VIEWERAPP) && isViewerAppMode)
 return false;
 
 // Enable insert new annotation in Writer in read-only mode
-if (pSlot && bReadOnly && getenv("EDIT_COMMENT_IN_READONLY_MODE") != 
nullptr)
+if (bReadOnly && getenv("EDIT_COMMENT_IN_READONLY_MODE") != nullptr)
 {
 OUString sCommand = pSlot->GetCommand();
 if (sCommand == u".uno:InsertAnnotation"_ustr
@@ -1671,42 +1673,36 @@ bool SfxDispatcher::FindServer_(sal_uInt16 nSlot, 
SfxSlotServer& rServer)
 }
 }
 
-if ( pSlot && !( pSlot->nFlags & SfxSlotMode::READONLYDOC ) && 
bReadOnly )
+if ( !( pSlot->nFlags & SfxSlotMode::READONLYDOC ) && bReadOnly )
 return false;
 
-if ( pSlot )
-{
-// Slot belongs to Container?
-bool bIsContainerSlot = pSlot->IsMode(SfxSlotMode::CONTAINER);
-bool bIsInPlace = xImp->pFrame && 
xImp->pFrame->GetObjectShell()->IsInPlaceActive();
-
-// Shell belongs to Server?
-// AppDispatcher or IPFrame-Dispatcher
-bool bIsServerShell = !xImp->pFrame || bIsInPlace;
+// Slot belongs to Container?
+bool bIsContainerSlot = pSlot->IsMode(SfxSlotMode::CONTAINER);
+bool bIsInPlace = xImp->pFrame && 
xImp->pFrame->GetObjectShell()->IsInPlaceActive();
 
-// Of course ShellServer-Slots are also executable even when it is
-// executed on a container dispatcher without an IPClient.
-if ( !bIsServerShell )
-{
-SfxViewShell *pViewSh = xImp->pFrame->GetViewShell();
-bIsServerShell = !pViewSh || !pViewSh->GetUIActiveClient();
-}
+// Shell belongs to Server?
+// AppDispatcher or IPFrame-Dispatcher
+bool bIsServerShell = !xImp->pFrame || bIsInPlace;
 
-// Shell belongs to Container?
-// AppDispatcher or no IPFrameDispatcher
-bool bIsContainerShell = !xImp->pFrame || !bIsInPlace;
-// Shell and Slot match
-if ( !( ( bIsContainerSlot && bIsContainerShell ) ||
-( !bIsContainerSlot && bIsServerShell ) ) )
-pSlot = nullptr;
-}
-
-if ( pSlot )
+// Of course ShellServer-Slots are also executable even when it is
+// executed on a container dispatcher without an IPClient.
+if ( !bIsServerShell )
 {
-rServer.SetSlot(pSlot);
-rServer.SetShellLevel(i);
-return true;
+SfxViewShell *pViewSh = xImp->pFrame->GetViewShell();
+bIsServerShell = !pViewSh || !pViewSh->GetUIActiveClient();
 }
+
+// Shell belongs to Container?
+// AppDispatcher or no IPFrameDispatcher
+bool bIsContainerShell = !xImp->pFrame || !bIsInPlace;
+// Shell and Slot match
+if ( !( ( bIsContainerSlot && bIsContainerShell ) ||
+( !bIsContainerSlot && bIsServerShell ) ) )
+continue;
+
+rServer.SetSlot(pSlot);
+rServer.SetShellLevel(i);
+return true;
 }
 
 return false;


core.git: sfx2/source

2025-06-17 Thread Mike Kaganski (via logerrit)
 sfx2/source/view/lokhelper.cxx |  117 +
 1 file changed, 28 insertions(+), 89 deletions(-)

New commits:
commit 55945f78fa3d560bb1714788693b3e1749844416
Author: Mike Kaganski 
AuthorDate: Tue Jun 17 15:27:05 2025 +0500
Commit: Mike Kaganski 
CommitDate: Tue Jun 17 17:19:23 2025 +0200

Use getViewOfId

All the replaced code did the same repeatedly.

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

diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index ba4a80e12947..580df4546bdb 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -153,23 +153,12 @@ void SfxLokHelper::setEditMode(int nMode, 
vcl::ITiledRenderable* pDoc)
 
 void SfxLokHelper::destroyView(int nId)
 {
-const SfxApplication* pApp = SfxApplication::Get();
-if (pApp == nullptr)
-return;
-
-const ViewShellId nViewShellId(nId);
-std::vector& rViewArr = pApp->GetViewShells_Impl();
-
-for (SfxViewShell* pViewShell : rViewArr)
+if (SfxViewShell* pViewShell = getViewOfId(nId))
 {
-if (pViewShell->GetViewShellId() == nViewShellId)
-{
-pViewShell->SetLOKAccessibilityState(false);
-SfxViewFrame& rViewFrame = pViewShell->GetViewFrame();
-SfxRequest aRequest(rViewFrame, SID_CLOSEWIN);
-rViewFrame.Exec_Impl(aRequest);
-break;
-}
+pViewShell->SetLOKAccessibilityState(false);
+SfxViewFrame& rViewFrame = pViewShell->GetViewFrame();
+SfxRequest aRequest(rViewFrame, SID_CLOSEWIN);
+rViewFrame.Exec_Impl(aRequest);
 }
 }
 
@@ -183,19 +172,10 @@ void SfxLokHelper::setView(int nId)
 g_bSettingView = true;
 comphelper::ScopeGuard g([] { g_bSettingView = false; });
 
-SfxApplication* pApp = SfxApplication::Get();
-if (pApp == nullptr)
-return;
-
-const ViewShellId nViewShellId(nId);
-std::vector& rViewArr = pApp->GetViewShells_Impl();
-
-const auto itViewShell = std::find_if(rViewArr.begin(), rViewArr.end(), 
[nViewShellId](SfxViewShell* pViewShell){ return pViewShell->GetViewShellId() 
== nViewShellId; });
-if (itViewShell == rViewArr.end())
+const SfxViewShell* pViewShell = getViewOfId(nId);
+if (!pViewShell)
 return;
 
-const SfxViewShell* pViewShell = *itViewShell;
-assert(pViewShell);
 DisableCallbacks dc;
 
 bool bIsCurrShell = (pViewShell == SfxViewShell::Current());
@@ -336,78 +316,48 @@ void SfxLokHelper::setLoadLanguage(const OUString& 
rBcp47LanguageTag)
 
 void SfxLokHelper::setViewLanguage(int nId, const OUString& rBcp47LanguageTag)
 {
-std::vector& rViewArr = SfxGetpApp()->GetViewShells_Impl();
-
-for (SfxViewShell* pViewShell : rViewArr)
+if (SfxViewShell* pViewShell = getViewOfId(nId))
 {
-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;
-}
+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));
 }
 }
 
 void SfxLokHelper::setViewReadOnly(int nId, bool readOnly)
 {
-std::vector& rViewArr = SfxGetpApp()->GetViewShells_Impl();
-
-for (SfxViewShell* pViewShell : rViewArr)
+if (SfxViewShell* pViewShell = getViewOfId(nId))
 {
-if (pViewShell && pViewShell->GetViewShellId() == ViewShellId(nId))
-{
-LOK_INFO("lok.readonlyview", "SfxLokHelper::setViewReadOnly: view 
id: " << nId << ", readOnly: " << readOnly);
-pViewShell->SetLokReadOnlyView(readOnly);
-return;
-}
+LOK_INFO("lok.readonlyview", "SfxLokHelper::setViewReadOnly: view id: 
" << nId << ", readOnly: " << readOnly);
+pViewShell->SetLokReadOnlyView(readOnly);
 }
 }
 
 void SfxLokHelper::setAllowChangeComments(int nId, bool allow)
 {
-std::vector& rViewArr = SfxGetpApp()->GetViewShells_Impl();
-
-for (SfxViewShell* pViewShell : rViewArr)
+if (SfxViewShell* pViewShell = getViewOfId(nId))
 {
-if (pViewShell && pViewShell->GetViewShellId() == ViewShellId(nId))
-{
-LOK_INFO("lok.readonlyview", 
"SfxLokHelper::setAllowChangeComments: view id: " << nId << ", allow: " << 
allow);
-pViewShell->SetAllowChangeComments(allow);
-return;
- 

core.git: sfx2/source

2025-06-03 Thread Bogdan Buzea (via logerrit)
 sfx2/source/doc/oleprops.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 82f027015e9086a29e802ce35722c0c23adf4fd5
Author: Bogdan Buzea 
AuthorDate: Sat Nov 23 13:02:26 2024 +0100
Commit: Xisco Fauli 
CommitDate: Tue Jun 3 22:47:32 2025 +0200

tdf#163486: PVS V1028 Possible overflow. Consider casting operands,

not the result.

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

diff --git a/sfx2/source/doc/oleprops.cxx b/sfx2/source/doc/oleprops.cxx
index 8ba709111fce..09ab312a5652 100644
--- a/sfx2/source/doc/oleprops.cxx
+++ b/sfx2/source/doc/oleprops.cxx
@@ -1007,7 +1007,7 @@ void SfxOleSection::ImplSave( SvStream& rStrm )
 
 // write placeholders for property ID/position pairs
 sal_uInt64 nPropPosPos = rStrm.Tell();
-rStrm.SeekRel( static_cast< sal_sSize >( 8 * nPropCount ) );
+rStrm.SeekRel( static_cast< sal_sSize >(nPropCount) * 8 );
 
 // write dictionary property
 if( maDictProp.HasPropertyNames() )
@@ -1201,7 +1201,7 @@ void SfxOlePropertySet::ImplSave( SvStream& rStrm )
 
 // write placeholders for section guid/position pairs
 sal_uInt64 nSectPosPos = rStrm.Tell();
-rStrm.SeekRel( static_cast< sal_sSize >( 20 * nSectCount ) );
+rStrm.SeekRel( static_cast< sal_sSize >(nSectCount) * 20 );
 
 // write sections
 for (auto const& section : maSectionMap)


core.git: sfx2/source

2025-05-24 Thread Caolán McNamara (via logerrit)
 sfx2/source/doc/objserv.cxx |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 89b0193639f6cc1e62d9f4894ea088f9691f3a79
Author: Caolán McNamara 
AuthorDate: Fri May 23 09:18:39 2025 +0100
Commit: Caolán McNamara 
CommitDate: Sat May 24 14:48:17 2025 +0200

cid#1647994 Resource leak

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

diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index d5a9bbed0a32..9ce43e1b6f02 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -813,10 +813,9 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
 
 if (redactImage && redactImage->GetValue())
 {
-RedactionTarget* redactiontarget
-= new RedactionTarget({ "Images", 
RedactionTargetType::REDACTION_TARGET_IMAGE,
+RedactionTarget redactiontarget({ "Images", 
RedactionTargetType::REDACTION_TARGET_IMAGE,
 "All Images", false, false, 0 });
-aRedactionTargets.push_back({*redactiontarget, 
redactiontarget->sName});
+aRedactionTargets.push_back({redactiontarget, 
redactiontarget.sName});
 }
 else if (nResult != RET_OK || !aDlg.hasTargets() || 
!aDlg.isValidState())
 {


core.git: sfx2/source

2025-05-22 Thread Andreas Heinisch (via logerrit)
 sfx2/source/dialog/backingwindow.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit f7e781292fc97b1d5e845c219c59bd01833da5ee
Author: Andreas Heinisch 
AuthorDate: Wed May 21 14:29:02 2025 +0200
Commit: Andreas Heinisch 
CommitDate: Thu May 22 09:59:27 2025 +0200

tdf#166349 - Reload recent documents to show pinned items

After clearing the recent document list, reload the start center in order 
to show pinned items.

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

diff --git a/sfx2/source/dialog/backingwindow.cxx 
b/sfx2/source/dialog/backingwindow.cxx
index f11c184bc81c..62898e35f08e 100644
--- a/sfx2/source/dialog/backingwindow.cxx
+++ b/sfx2/source/dialog/backingwindow.cxx
@@ -807,5 +807,7 @@ void BackingWindow::dispatchURL( const OUString& i_rURL,
 void BackingWindow::clearRecentFileList()
 {
 mxAllRecentThumbnails->Clear();
+// tdf#166349 - reload recent documents to show pinned items
+mxAllRecentThumbnails->Reload();
 }
 /* vim:set shiftwidth=4 softtabstop=4 expandtab:*/


core.git: sfx2/source

2025-05-21 Thread Caolán McNamara (via logerrit)
 sfx2/source/doc/objstor.cxx |8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 46f2bd7e96cec80f57b12a60fefb16ecec866117
Author: Caolán McNamara 
AuthorDate: Tue May 20 21:33:23 2025 +0100
Commit: Caolán McNamara 
CommitDate: Wed May 21 10:19:27 2025 +0200

null deref of SfxMedium seen

 #1  SfxMedium::GetItemSet (this=this@entry=0x0) at 
libreoffice/sfx2/source/doc/docfile.cxx:3816
 #2  0x7fa2526680d8 in SfxMedium::GetBaseURL (this=0x0, 
bForSaving=bForSaving@entry=false)
 at libreoffice/sfx2/source/doc/docfile.cxx:685
 #3  0x7fa2526e184a in SfxObjectShell::getDocumentBaseURL 
(this=) at libreoffice/include/sfx2/objsh.hxx:271
 #4  0x7fa2453fbb26 in SwOLEObj::GetOleRef (this=0x3370d698) at 
libreoffice/sw/source/core/ole/ndole.cxx:1027
 #5  0x7fa2452e3ded in SwFEShell::IsSelObjProtected (this=0x3385dee0, 
eType=eType@entry=FlyProtectFlags::Content)
 at libreoffice/sw/source/core/frmedt/feshview.cxx:2714
 #6  0x7fa245b117b1 in SwView::ImpSetVerb (this=this@entry=0x33857340, 
nSelType=nSelType@entry=SelectionType::Ole)
 at /opt/rh/devtoolset-12/root/usr/include/c++/12/bits/unique_ptr.h:191
 #7  0x7fa245b139de in SwView::SelectShell (this=0x33857340) at 
libreoffice/sw/source/uibase/uiview/view.cxx:312
 #8  0x7fa245b14237 in SwView::AttrChangedNotify (this=0x33857340) at 
libreoffice/sw/source/uibase/uiview/view.cxx:580
 #9  SwView::AttrChangedNotify (this=this@entry=0x33857340) at 
libreoffice/sw/source/uibase/uiview/view.cxx:542
 #10 0x7fa245b1ec82 in SwView::Activate (this=0x33857340, 
bMDIActivate=)
 at libreoffice/sw/source/uibase/uiview/view1.cxx:101

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

diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index ad85ccc65b08..bde35636ad63 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -4267,14 +4267,16 @@ bool SfxObjectShell::QueryAllowExoticFormat_Impl( const 
uno::Reference< task::XI
 uno::Reference< task::XInteractionHandler > 
SfxObjectShell::getInteractionHandler() const
 {
 uno::Reference< task::XInteractionHandler > xRet;
-if ( GetMedium() )
-xRet = GetMedium()->GetInteractionHandler();
+if (SfxMedium* pRetrMedium = GetMedium())
+xRet = pRetrMedium->GetInteractionHandler();
 return xRet;
 }
 
 OUString SfxObjectShell::getDocumentBaseURL() const
 {
-return GetMedium()->GetBaseURL();
+if (SfxMedium* pRetrMedium = GetMedium())
+return pRetrMedium->GetBaseURL();
+return OUString();
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


core.git: sfx2/source

2025-05-19 Thread Mike Kaganski (via logerrit)
 sfx2/source/view/viewsh.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 9a91a2899947bc906ea5b7b1a740f00cce04a3c0
Author: Mike Kaganski 
AuthorDate: Mon May 19 10:46:45 2025 +0200
Commit: Mike Kaganski 
CommitDate: Mon May 19 12:55:55 2025 +0200

tdf#166637: Do not dereference a result of UNO_QUERY unconditionally

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

diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 04a363fa0a10..3d23d7a3d935 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -2824,6 +2824,10 @@ uno::Reference
 GetSelectedShapeOfView(const uno::Reference& xController)
 {
 uno::Reference xSelectionSupplier(xController, 
uno::UNO_QUERY);
+if (!xSelectionSupplier)
+{
+return {};
+}
 uno::Reference 
xShapes(xSelectionSupplier->getSelection(), uno::UNO_QUERY);
 if (!xShapes.is() || xShapes->getCount() != 1)
 {


core.git: sfx2/source

2025-05-19 Thread Caolán McNamara (via logerrit)
 sfx2/source/control/dispatch.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 3bd061338efcc492bd039bbae1f922efc5ac9478
Author: Caolán McNamara 
AuthorDate: Mon May 19 09:20:32 2025 +0100
Commit: Caolán McNamara 
CommitDate: Mon May 19 11:55:46 2025 +0200

null deref of SfxMedium

 #1  SfxMedium::GetItemSet (this=0x0) at sfx2/source/doc/docfile.cxx:3816
 #2  0x7d70ffdfc395 in SfxDispatcher::Update_Impl_ (this=0x250de660, 
bUIActive=true, bIsMDIApp=true, bIsIPOwner=false, pTaskWin=0x24dcbce0)
 at include/sfx2/objsh.hxx:271
 #3  0x7d70ffdfe275 in SfxDispatcher::Update_Impl 
(this=this@entry=0x250de660, bForce=bForce@entry=true)
 at sfx2/source/control/dispatch.cxx:1121
 #4  0x7d70ffe09955 in DispatcherUpdate_Impl (pArg=0x250de660) at 
sfx2/source/control/shell.cxx:662
 #5  0x7d7101189d20 in Link::Call (data=, 
this=0x221a71f8)
 at include/tools/link.hxx:111
 #6  ImplHandleUserEvent (pSVEvent=0x221a71f0) at 
vcl/source/window/winproc.cxx:2285
 #7  ImplWindowFrameProc (_pWindow=, 
nEvent=SalEvent::UserEvent, pEvent=0x221a71f0)
 at vcl/source/window/winproc.cxx:2849
 #8  0x7d710167754c in SalFrame::CallCallback (pEvent=0x221a71f0, 
nEvent=SalEvent::UserEvent, this=0x160a7d50)
 at vcl/inc/salframe.hxx:311
 #9  SvpSalInstance::ProcessEvent (this=0x136a0ed0, aEvent=...) at 
vcl/headless/svpinst.cxx:271

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

diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index 7b646c57ce14..27d4afbbb82b 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -1190,7 +1190,8 @@ void SfxDispatcher::Update_Impl_( bool bUIActive, bool 
bIsMDIApp, bool bIsIPOwne
 {
 bool bViewerTbx( nFlags & SfxVisibilityFlags::Viewer );
 SfxObjectShell* pSh = xImp->pFrame->GetObjectShell();
-const SfxBoolItem* pItem = 
pSh->GetMedium()->GetItemSet().GetItem(SID_VIEWONLY, false);
+const SfxMedium* pMedium = pSh->GetMedium();
+const SfxBoolItem* pItem = pMedium ? 
pMedium->GetItemSet().GetItem(SID_VIEWONLY, false) : nullptr;
 bool bIsViewer = pItem && pItem->GetValue();
 if ( bIsViewer != bViewerTbx )
 continue;


core.git: sfx2/source

2025-05-13 Thread Mike Kaganski (via logerrit)
 sfx2/source/dialog/filedlghelper.cxx |  277 +--
 1 file changed, 136 insertions(+), 141 deletions(-)

New commits:
commit 28c2be7c1f96219d4454de36cac0a51c1be24fd3
Author: Mike Kaganski 
AuthorDate: Tue May 13 07:46:48 2025 +0200
Commit: Mike Kaganski 
CommitDate: Tue May 13 09:57:01 2025 +0200

Flatten and simplify FileDialogHelper_Impl::execute a bit

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

diff --git a/sfx2/source/dialog/filedlghelper.cxx 
b/sfx2/source/dialog/filedlghelper.cxx
index effe8bae42c3..677cea0e370f 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -1412,8 +1412,6 @@ ErrCode FileDialogHelper_Impl::execute( 
css::uno::Sequence& rpURLList,
 // changing this would surely break code
 // rpSet is in/out parameter, usually just a media-descriptor that can be 
changed by dialog
 
-uno::Reference< XFilePickerControlAccess > xCtrlAccess( mxFileDlg, 
UNO_QUERY );
-
 // retrieves parameters from rpSet
 // for now only Password is used
 if ( rpSet )
@@ -1421,16 +1419,16 @@ ErrCode FileDialogHelper_Impl::execute( 
css::uno::Sequence& rpURLList,
 // check password checkbox if the document had password before
 if( mbHasPassword )
 {
-const SfxBoolItem* pPassItem = 
SfxItemSet::GetItem(&*rpSet, SID_PASSWORDINTERACTION, false);
+const SfxBoolItem* pPassItem = 
rpSet->GetItem(SID_PASSWORDINTERACTION, false);
 // TODO: tdf#158839 problem: Is also true if the file is GPG 
encrypted. (not with a password)
 mbPwdCheckBoxState = ( pPassItem != nullptr && 
pPassItem->GetValue() );
 
 // in case the document has password to modify, the dialog should 
be shown
-const SfxUnoAnyItem* pPassToModifyItem = 
SfxItemSet::GetItem(&*rpSet, SID_MODIFYPASSWORDINFO, false);
+const SfxUnoAnyItem* pPassToModifyItem = 
rpSet->GetItem(SID_MODIFYPASSWORDINFO, false);
 mbPwdCheckBoxState |= ( pPassToModifyItem && 
pPassToModifyItem->GetValue().hasValue() );
 }
 
-const SfxBoolItem* pSelectItem = 
SfxItemSet::GetItem(&*rpSet, SID_SELECTION, false);
+const SfxBoolItem* pSelectItem = rpSet->GetItem(SID_SELECTION, false);
 if ( pSelectItem )
 mbSelection = pSelectItem->GetValue();
 else
@@ -1462,177 +1460,174 @@ ErrCode FileDialogHelper_Impl::execute( 
css::uno::Sequence& rpURLList,
 if ( ! mxFileDlg.is() )
 return ERRCODE_ABORT;
 
-if ( ExecutableDialogResults::CANCEL != implDoExecute() )
-{
-// create an itemset if there is no
-if( !rpSet )
-rpSet.emplace( SfxGetpApp()->GetPool() );
+if (ExecutableDialogResults::CANCEL == implDoExecute())
+return ERRCODE_ABORT;
+
+// fill the rpURLList
+rpURLList = mxFileDlg->getSelectedFiles();
+if (!rpURLList.hasElements())
+return ERRCODE_ABORT;
 
-// the item should remain only if it was set by the dialog
-rpSet->ClearItem( SID_SELECTION );
+uno::Reference xCtrlAccess(mxFileDlg, UNO_QUERY);
 
-if( mbExport && mbHasSelectionBox )
+// create an itemset if there is no
+if( !rpSet )
+rpSet.emplace( SfxGetpApp()->GetPool() );
+
+// the item should remain only if it was set by the dialog
+rpSet->ClearItem( SID_SELECTION );
+
+if (mbExport && mbHasSelectionBox && xCtrlAccess)
+{
+try
 {
-try
-{
-Any aValue = xCtrlAccess->getValue( 
ExtendedFilePickerElementIds::CHECKBOX_SELECTION, 0 );
-bool bSelection = false;
-if ( aValue >>= bSelection )
-rpSet->Put( SfxBoolItem( SID_SELECTION, bSelection ) );
-}
-catch( const IllegalArgumentException& )
-{
-TOOLS_WARN_EXCEPTION( "sfx.dialog", 
"FileDialogHelper_Impl::execute: caught an IllegalArgumentException!" );
-}
+Any aValue = xCtrlAccess->getValue( 
ExtendedFilePickerElementIds::CHECKBOX_SELECTION, 0 );
+bool bSelection = false;
+if ( aValue >>= bSelection )
+rpSet->Put( SfxBoolItem( SID_SELECTION, bSelection ) );
+}
+catch( const IllegalArgumentException& )
+{
+TOOLS_WARN_EXCEPTION( "sfx.dialog", 
"FileDialogHelper_Impl::execute: caught an IllegalArgumentException!" );
 }
+}
 
 
-// set the read-only flag. When inserting a file, this flag is always 
set
-if ( mbInsert )
-rpSet->Put( SfxBoolItem( SID_DOC_READONLY, true ) );
-else
+// set the read-only flag. When inserting a file, this flag is always set
+if ( mbInsert )
+rpSet->Put( SfxBoolItem( SID_DOC_READONLY, true ) );
+else if ( ( 

core.git: sfx2/source

2025-05-12 Thread Caolán McNamara (via logerrit)
 sfx2/source/sidebar/ControllerItem.cxx |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 5fb0ee63450bef5f1dbfac4760d56d5710e28015
Author: Caolán McNamara 
AuthorDate: Mon May 12 09:15:53 2025 +0100
Commit: Caolán McNamara 
CommitDate: Mon May 12 13:25:56 2025 +0200

null deref seen on ControllerItem::ReceiverNotifyItemUpdate

 #0  CntUInt16Item::SetValue (nTheValue=8, this=0x0) at 
include/svl/cintitem.hxx:91
 #1  sfx2::sidebar::ControllerItem::ReceiverNotifyItemUpdate 
(this=0x250f5628, nSID=, eState=SfxItemState::UNKNOWN,
 pState=0x792a379165d0 <(anonymous namespace)::aDisabledItem>)
 at sfx2/source/sidebar/ControllerItem.cxx:56
 #2  0x792a33a04284 in SfxStateCache::SetState_Impl (this=0x25170250, 
eState=SfxItemState::UNKNOWN, pState=0x792a379165d0 <(anonymous 
namespace)::aDisabledItem>,
 bMaybeDirty=) at sfx2/source/control/statcach.cxx:428
 #3  0x792a33a042fc in SfxStateCache::SetState (this=, 
eState=, pState=, bMaybeDirty=)
 at sfx2/source/control/statcach.cxx:335
 #4  0x792a339e20e4 in SfxBindings::UpdateControllers_Impl (rFound=..., 
pItem=, eState=eState@entry=SfxItemState::DEFAULT)
 at sfx2/source/control/bindings.cxx:1218
 #5  0x792a339e5437 in SfxBindings::Update_Impl (this=, 
rCache=...)
 at sfx2/source/control/bindings.cxx:279
 #6  0x792a339e5e11 in SfxBindings::NextJob_Impl 
(this=this@entry=0x262f52c0, pTimer=pTimer@entry=0x26104cc8)
 at sfx2/source/control/bindings.cxx:1281
 #7  0x792a339e6020 in SfxBindings::NextJob (this=0x262f52c0, 
pTimer=0x26104cc8)
 at sfx2/source/control/bindings.cxx:1226
 #8  0x792a350adadb in Scheduler::CallbackTaskScheduling ()
 at vcl/source/app/scheduler.cxx:579
 #9  0x792a3526d9eb in SalTimer::CallCallback (this=)

(gdb) print *pState
$5 = {_vptr.SfxPoolItem = 0x792a37591020 , m_nRefCount = 0, m_nWhich = 0, m_bStaticDefault = 
true,
  m_bDynamicDefault = false, m_bIsSetItem = false, m_bShareable = true, 
m_bNameOrIndex = false}

DisabledItem isn't cloneable

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

diff --git a/sfx2/source/sidebar/ControllerItem.cxx 
b/sfx2/source/sidebar/ControllerItem.cxx
index 313cf1c49566..987e95cd0797 100644
--- a/sfx2/source/sidebar/ControllerItem.cxx
+++ b/sfx2/source/sidebar/ControllerItem.cxx
@@ -44,10 +44,15 @@ ControllerItem::~ControllerItem()
 dispose();
 }
 
+static bool IsCloneable(const SfxPoolItem* pState)
+{
+return pState && !IsInvalidItem(pState) && !IsDisabledItem(pState);
+}
+
 void ControllerItem::ReceiverNotifyItemUpdate(sal_uInt16 nSID, SfxItemState 
eState,
   const SfxPoolItem* pState)
 {
-if (nSID == SID_ATTR_METRIC && pState && 
comphelper::LibreOfficeKit::isActive())
+if (nSID == SID_ATTR_METRIC && IsCloneable(pState) && 
comphelper::LibreOfficeKit::isActive())
 {
 std::unique_ptr xClose(pState->Clone());
 MeasurementSystem eSystem


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

2025-05-07 Thread Tibor Nagy (via logerrit)
 sfx2/source/control/dispatch.cxx  |   13 +
 sw/inc/AnnotationWin.hxx  |5 +
 sw/source/uibase/docvw/AnnotationWin.cxx  |7 ++-
 sw/source/uibase/docvw/AnnotationWin2.cxx |5 +++--
 4 files changed, 23 insertions(+), 7 deletions(-)

New commits:
commit 0a677d53a6c0eba6f859eaa658d4aecf78bee631
Author: Tibor Nagy 
AuthorDate: Fri Sep 13 15:16:27 2024 +0200
Commit: Michael Stahl 
CommitDate: Wed May 7 13:34:56 2025 +0200

LOCRDT sfx2,sw: add special mode EDIT_COMMENT_IN_READONLY_MODE

Create a special mode that allows editing comments and adding new
comments, while the rest of the document remains in read-only mode.

Since this is a prototype, it is is activated by environment variable.

Change-Id: I6a49000127d2c19804596d84377cc5aeb578cc38
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173340
Tested-by: Michael Stahl 
Reviewed-by: Michael Stahl 

diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index 9fd3a0153a66..7b646c57ce14 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -1657,6 +1657,19 @@ bool SfxDispatcher::FindServer_(sal_uInt16 nSlot, 
SfxSlotServer& rServer)
 if (pSlot && !(pSlot->nFlags & SfxSlotMode::VIEWERAPP) && 
isViewerAppMode)
 return false;
 
+// Enable insert new annotation in Writer in read-only mode
+if (pSlot && bReadOnly && getenv("EDIT_COMMENT_IN_READONLY_MODE") != 
nullptr)
+{
+OUString sCommand = pSlot->GetCommand();
+if (sCommand == u".uno:InsertAnnotation"_ustr
+|| ((sCommand == u".uno:FontDialog"_ustr
+ || sCommand == u".uno:ParagraphDialog"_ustr)
+&& pIFace->GetClassName() == "SwAnnotationShell"_ostr))
+{
+bReadOnly = false;
+}
+}
+
 if ( pSlot && !( pSlot->nFlags & SfxSlotMode::READONLYDOC ) && 
bReadOnly )
 return false;
 
diff --git a/sw/inc/AnnotationWin.hxx b/sw/inc/AnnotationWin.hxx
index 9e5aaeba6aeb..c63d6d339d1d 100644
--- a/sw/inc/AnnotationWin.hxx
+++ b/sw/inc/AnnotationWin.hxx
@@ -140,10 +140,7 @@ class SAL_DLLPUBLIC_RTTI SwAnnotationWin final : public 
InterimItemWindow
 
 voidSetSidebarPosition(sw::sidebarwindows::SidebarPosition 
eSidebarPosition);
 voidSetReadonly(bool bSet);
-boolIsReadOnly() const
-{
-return mbReadonly;
-}
+boolIsReadOnly() const;
 
 void SetColor(Color aColorDark,Color aColorLight, Color 
aColorAnchor);
 const Color& ColorDark() { return mColorDark; }
diff --git a/sw/source/uibase/docvw/AnnotationWin.cxx 
b/sw/source/uibase/docvw/AnnotationWin.cxx
index 864603f179a9..474c0757eab9 100644
--- a/sw/source/uibase/docvw/AnnotationWin.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin.cxx
@@ -514,9 +514,14 @@ OString SwAnnotationWin::GetSimpleHtml() const
 return GetOutlinerView()->GetEditView().GetSimpleHtml();
 }
 
+bool SwAnnotationWin::IsReadOnly() const
+{
+return mbReadonly;
+}
+
 bool SwAnnotationWin::IsReadOnlyOrProtected() const
 {
-return mbReadonly ||
+return IsReadOnly() ||
GetLayoutStatus() == SwPostItHelper::DELETED ||
( mpFormatField && mpFormatField->IsProtect() );
 }
diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx 
b/sw/source/uibase/docvw/AnnotationWin2.cxx
index f539cc3f5a05..59843da348d6 100644
--- a/sw/source/uibase/docvw/AnnotationWin2.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin2.cxx
@@ -922,8 +922,9 @@ void 
SwAnnotationWin::SetSidebarPosition(sw::sidebarwindows::SidebarPosition eSi
 
 void SwAnnotationWin::SetReadonly(bool bSet)
 {
-mbReadonly = bSet;
-GetOutlinerView()->SetReadOnly(bSet);
+// the OutlinerView determines if the comment window accepts key input
+mbReadonly = bSet && getenv("EDIT_COMMENT_IN_READONLY_MODE") == nullptr;
+GetOutlinerView()->SetReadOnly(mbReadonly);
 }
 
 void SwAnnotationWin::GetFocus()


core.git: sfx2/source

2025-05-02 Thread Heiko Tietze (via logerrit)
 sfx2/source/dialog/backingwindow.cxx |8 
 1 file changed, 8 deletions(-)

New commits:
commit 078337562dc8c6a92def7760c54960a06d6a81cf
Author: Heiko Tietze 
AuthorDate: Fri May 2 09:35:22 2025 +0200
Commit: Heiko Tietze 
CommitDate: Fri May 2 12:31:50 2025 +0200

Resolves tdf#166347 - Start center recent/template button toggle

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

diff --git a/sfx2/source/dialog/backingwindow.cxx 
b/sfx2/source/dialog/backingwindow.cxx
index 337fd893d678..f11c184bc81c 100644
--- a/sfx2/source/dialog/backingwindow.cxx
+++ b/sfx2/source/dialog/backingwindow.cxx
@@ -611,18 +611,11 @@ IMPL_LINK_NOARG( BackingWindow, FilterHdl, 
weld::ComboBox&, void )
 
 IMPL_LINK( BackingWindow, ToggleHdl, weld::Toggleable&, rButton, void )
 {
-bool bRecentMode;
 if (&rButton == mxRecentButton.get())
-bRecentMode = rButton.get_active();
-else
-bRecentMode = !rButton.get_active();
-
-if (bRecentMode)
 {
 mxLocalView->Hide();
 mxAllRecentThumbnails->Show();
 mxAllRecentThumbnails->GrabFocus();
-mxRecentButton->set_active(true);
 mxTemplateButton->set_active(false);
 mxActions->show();
 }
@@ -634,7 +627,6 @@ IMPL_LINK( BackingWindow, ToggleHdl, weld::Toggleable&, 
rButton, void )
 mxLocalView->reload();
 mxLocalView->GrabFocus();
 mxRecentButton->set_active(false);
-mxTemplateButton->set_active(true);
 mxActions->hide();
 }
 applyFilter();


core.git: sfx2/source

2025-04-29 Thread Mike Kaganski (via logerrit)
 sfx2/source/control/thumbnailview.cxx |  172 +-
 1 file changed, 91 insertions(+), 81 deletions(-)

New commits:
commit b4965d0a7875384d1fedc7d43762c94b30e5e90f
Author: Mike Kaganski 
AuthorDate: Tue Apr 29 10:55:24 2025 +0200
Commit: Mike Kaganski 
CommitDate: Tue Apr 29 14:26:41 2025 +0200

Refactor getting thumbnail a bit

Use OOXML package relations (and XRelationshipAccess) to access
OOXML's thumbnails.
Unify obtaining the bitmap.
This change also fixes a possible nullptr dereference when trying
to read the older Thumbnail/thumbnail.png - access to xDocStorage
wasn't checked before.

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

diff --git a/sfx2/source/control/thumbnailview.cxx 
b/sfx2/source/control/thumbnailview.cxx
index 28c43d4144b7..606999e2ad2d 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -19,6 +19,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -41,6 +42,9 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 #include 
 #include 
 
@@ -61,99 +65,90 @@ bool ThumbnailView::renameItem(ThumbnailViewItem&, const 
OUString&)
 return false;
 }
 
-BitmapEx ThumbnailView::readThumbnail(const OUString &msURL)
+static css::uno::Reference
+getStorageAccess(const OUString& URL, sal_Int32 format)
 {
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
+auto xFactory = 
css::embed::StorageFactory::create(comphelper::getProcessComponentContext());
+css::uno::Sequence descriptor{ 
comphelper::makePropertyValue(u"StorageFormat"_ustr, format) };
+css::uno::Sequence args{ css::uno::Any(URL), 
css::uno::Any(css::embed::ElementModes::READ),
+ css::uno::Any(descriptor) };
+return xFactory->createInstanceWithArguments(args)
+.queryThrow();
+}
 
-// Load the thumbnail from a template document.
-uno::Reference xIStream;
+static css::uno::Reference
+getHierarchicalStream(const 
css::uno::Reference& xStorage,
+  const OUString& name)
+{
+auto xStream
+= xStorage->openStreamElementByHierarchicalName(name, 
css::embed::ElementModes::READ);
+return xStream->getInputStream();
+}
 
-const uno::Reference< uno::XComponentContext >& 
xContext(::comphelper::getProcessComponentContext());
-try
+static css::uno::Reference
+getFirstHierarchicalStream(const OUString& URL, sal_Int32 format,
+   std::initializer_list names)
+{
+auto xStorage(getStorageAccess(URL, format));
+for (const auto& name : names)
 {
-uno::Reference xStorageFactory = 
embed::StorageFactory::create(xContext);
-
-uno::Sequence aArgs{ uno::Any(msURL), 
uno::Any(embed::ElementModes::READ) };
-uno::Reference xDocStorage (
-xStorageFactory->createInstanceWithArguments(aArgs),
-uno::UNO_QUERY);
-
 try
 {
-if (xDocStorage.is())
-{
-uno::Reference xStorage (
-xDocStorage->openStorageElement(
-u"Thumbnails"_ustr,
-embed::ElementModes::READ));
-if (xStorage.is())
-{
-uno::Reference xThumbnailCopy (
-xStorage->cloneStreamElement(u"thumbnail.png"_ustr));
-if (xThumbnailCopy.is())
-xIStream = xThumbnailCopy->getInputStream();
-}
-}
+return getHierarchicalStream(xStorage, name);
 }
-catch (const uno::Exception&)
+catch (const css::uno::Exception&)
 {
-TOOLS_WARN_EXCEPTION("sfx",
-"caught exception while trying to access 
Thumbnails/thumbnail.png of " << msURL);
+TOOLS_WARN_EXCEPTION("sfx", "caught exception while trying to 
access " << name << " of "
+   
<< URL);
 }
+}
+return {};
+}
 
-if (!xIStream.is())
+static css::uno::Reference
+getFirstStreamByRelType(const OUString& URL, std::initializer_list 
types)
+{
+auto xStorage(getStorageAccess(URL, css::embed::StorageFormats::OFOPXML));
+if (auto xRelationshipAccess = 
xStorage.query())
+{
+for (const auto& type : types)
 {
-// a Microsoft formatted template?
-uno::Reference xNameAccess
-= packages::zip::ZipFileAccess::createWithURL(xContext, msURL);
-if (xNameAccess.is())
+auto rels = xRelationshipAccess->getRelationshipsByType(type);
+if (rels.hasElements())
 {
-if (xNameAccess->hasByName(u"docProps/thumbnail.emf"_ustr))
- 

core.git: sfx2/source

2025-04-29 Thread Andrea Gelmini (via logerrit)
 sfx2/source/control/thumbnailview.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 51e8c19d6d30c659a7f3093736a0e2aa9cb1283f
Author: Andrea Gelmini 
AuthorDate: Tue Apr 29 07:29:52 2025 +0200
Commit: Andrea Gelmini 
CommitDate: Tue Apr 29 10:50:50 2025 +0200

Fix typo

Change-Id: I85a2307ec15f67a6e799085a4f964fc2604469fe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184740
Tested-by: Jenkins
Reviewed-by: Andrea Gelmini 

diff --git a/sfx2/source/control/thumbnailview.cxx 
b/sfx2/source/control/thumbnailview.cxx
index 79eefc0f4590..28c43d4144b7 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -104,7 +104,7 @@ BitmapEx ThumbnailView::readThumbnail(const OUString &msURL)
 
 if (!xIStream.is())
 {
-// a Micrsosoft formatted template?
+// a Microsoft formatted template?
 uno::Reference xNameAccess
 = packages::zip::ZipFileAccess::createWithURL(xContext, msURL);
 if (xNameAccess.is())


core.git: sfx2/source

2025-04-28 Thread Justin Luth (via logerrit)
 sfx2/source/control/thumbnailview.cxx |   33 +++--
 1 file changed, 31 insertions(+), 2 deletions(-)

New commits:
commit 9ba4c479d8f510cadf1c76bab5ced4b29745bc6b
Author: Justin Luth 
AuthorDate: Mon Apr 28 11:19:04 2025 -0400
Commit: Justin Luth 
CommitDate: Tue Apr 29 04:21:52 2025 +0200

tdf#166035 thumbnailview: recognize some MS-format thumbnails

The sample I was given had thumbnail.emf.
Using Word 2010, I generated a powerpoint presentation
that had thumbnail.jpeg, and a spreadsheet that had thumbnail.wmf.

I imagine that other formats could easily exist.
But I don't know of a generic way to identify them,
since there doesn't seem to be any special
"this is where you find the thumbnail" pointer.

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

diff --git a/sfx2/source/control/thumbnailview.cxx 
b/sfx2/source/control/thumbnailview.cxx
index 3bcbfb648568..79eefc0f4590 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -35,12 +35,14 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #if !ENABLE_WASM_STRIP_RECENT
@@ -97,7 +99,34 @@ BitmapEx ThumbnailView::readThumbnail(const OUString &msURL)
 catch (const uno::Exception&)
 {
 TOOLS_WARN_EXCEPTION("sfx",
-"caught exception while trying to access 
Thumbnail/thumbnail.png of " << msURL);
+"caught exception while trying to access 
Thumbnails/thumbnail.png of " << msURL);
+}
+
+if (!xIStream.is())
+{
+// a Micrsosoft formatted template?
+uno::Reference xNameAccess
+= packages::zip::ZipFileAccess::createWithURL(xContext, msURL);
+if (xNameAccess.is())
+{
+if (xNameAccess->hasByName(u"docProps/thumbnail.emf"_ustr))
+
xIStream.set(xNameAccess->getByName(u"docProps/thumbnail.emf"_ustr),
+ uno::UNO_QUERY);
+else if 
(xNameAccess->hasByName(u"docProps/thumbnail.jpeg"_ustr))
+
xIStream.set(xNameAccess->getByName(u"docProps/thumbnail.jpeg"_ustr),
+ uno::UNO_QUERY);
+else if 
(xNameAccess->hasByName(u"docProps/thumbnail.wmf"_ustr))
+
xIStream.set(xNameAccess->getByName(u"docProps/thumbnail.wmf"_ustr),
+ uno::UNO_QUERY);
+std::unique_ptr pStream(
+utl::UcbStreamHelper::CreateStream(xIStream, 
/*CloseStream=*/ true));
+if (pStream)
+{
+Graphic aGraphic
+= 
GraphicFilter::GetGraphicFilter().ImportUnloadedGraphic(*pStream);
+return aGraphic.GetBitmapEx();
+}
+}
 }
 
 try
@@ -123,7 +152,7 @@ BitmapEx ThumbnailView::readThumbnail(const OUString &msURL)
 catch (const uno::Exception&)
 {
 TOOLS_WARN_EXCEPTION("sfx",
-"caught exception while trying to access 
Thumbnails/thumbnail.png of " << msURL);
+"caught exception while trying to access 
Thumbnail/thumbnail.png of " << msURL);
 }
 }
 catch (const uno::Exception&)


core.git: sfx2/source

2025-04-17 Thread Stephan Bergmann (via logerrit)
 sfx2/source/control/dispatch.cxx |   20 
 1 file changed, 20 insertions(+)

New commits:
commit 39bd06ad1e404b37eb70b58ee76fc52184dd4b21
Author: Stephan Bergmann 
AuthorDate: Thu Apr 17 10:34:14 2025 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Apr 17 12:09:07 2025 +0200

Hack to keep popup menus alive long enough for Emscripten Qt5

This fixes  "Is it possible 
to
make context menu work?"

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

diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index 1959b5e81efa..9fd3a0153a66 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -40,6 +40,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1902,6 +1903,23 @@ void SfxDispatcher::ExecutePopup( const OUString& 
rResName, vcl::Window* pWin, c
 css::uno::Reference< css::frame::XPopupMenuController > xPopupController(
 xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
 u"com.sun.star.comp.framework.ResourceMenuController"_ustr, aArgs, 
xContext ), css::uno::UNO_QUERY );
+#if defined EMSCRIPTEN && ENABLE_QT5
+// At least under Emscripten with Qt5, the QMenu::exec underlying the 
below call to
+// xPopupMenu->execute returns immediately, without going into a new event 
loop, and we need to
+// keep the underlying QMenu instance alive via the static 
lastPopupController chain here, until
+// the next popup menu is opened (there can only ever be a single popup 
menu open, so it
+// suffices to have a single static lastPopupController instance):
+static css::uno::Reference 
lastPopupController;
+if (lastPopupController.is()) {
+if (css::uno::Reference component(
+lastPopupController, css::uno::UNO_QUERY);
+component.is())
+{
+component->dispose();
+}
+lastPopupController = xPopupController;
+}
+#endif
 
 rtl::Reference< VCLXPopupMenu > xPopupMenu = new VCLXPopupMenu();
 
@@ -1938,9 +1956,11 @@ void SfxDispatcher::ExecutePopup( const OUString& 
rResName, vcl::Window* pWin, c
 }
 }
 
+#if !(defined EMSCRIPTEN && ENABLE_QT5)
 css::uno::Reference< css::lang::XComponent > xComponent( xPopupController, 
css::uno::UNO_QUERY );
 if ( xComponent.is() )
 xComponent->dispose();
+#endif
 }
 
 /** With this method the SfxDispatcher can be locked and released. A locked


core.git: sfx2/source

2025-04-14 Thread Caolán McNamara (via logerrit)
 sfx2/source/appl/appuno.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 925e6269915ee2c62181c93fc6af21572f9863a7
Author: Caolán McNamara 
AuthorDate: Mon Apr 14 09:50:13 2025 +0100
Commit: Caolán McNamara 
CommitDate: Mon Apr 14 11:55:50 2025 +0200

show what the name is expected to be in the warning

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

diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index 7a0e32473344..c989a1c14a82 100644
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
@@ -219,7 +219,7 @@ void TransformParameters( sal_uInt16 nSlotId, const 
uno::SequenceaUnoName << "'");
 }
 #endif
 else


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

2025-04-05 Thread Jim Raykowski (via logerrit)
 sfx2/source/dialog/StyleList.cxx|   23 +--
 sfx2/source/dialog/templdlg.cxx |9 +-
 svx/source/sidebar/inspector/InspectorTextPanel.cxx |9 --
 sw/source/uibase/uiview/view0.cxx   |   62 +++-
 4 files changed, 62 insertions(+), 41 deletions(-)

New commits:
commit b5e366c97d813c65d477941d45ae55f7dff954ad
Author: Jim Raykowski 
AuthorDate: Thu Apr 3 13:10:20 2025 -0800
Commit: Jim Raykowski 
CommitDate: Sat Apr 5 20:47:21 2025 +0200

tdf#165998 Spotlight switches the view to the Stylist

* Makes turning on spotlight not switch to the Styles deck unless the
sidebar is not currently open.

* Makes turning off spotlight not switch to the Styles deck.

* Fixes incorrect spotlight checkbutton state in the Styles deck when
the state is changed in the Styles Inspector deck.

* Fixes spotlight not turning on using the Styles Inspector deck
spotlight buttons before visiting the Styles deck once.

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

diff --git a/sfx2/source/dialog/StyleList.cxx b/sfx2/source/dialog/StyleList.cxx
index 6643cc8e2981..0d35c0152319 100644
--- a/sfx2/source/dialog/StyleList.cxx
+++ b/sfx2/source/dialog/StyleList.cxx
@@ -438,13 +438,8 @@ void StyleList::UpdateFamily()
 m_bTreeDrag = true;
 if (m_pStyleSheetPool)
 {
-if (!m_xTreeBox->get_visible())
-UpdateStyles(StyleFlags::UpdateFamily | 
StyleFlags::UpdateFamilyList);
-else
-{
-UpdateStyles(StyleFlags::UpdateFamily);
-FillTreeBox(GetActualFamily());
-}
+UpdateStyles(StyleFlags::UpdateFamily | StyleFlags::UpdateFamilyList);
+FillTreeBox(GetActualFamily());
 }
 
 InvalidateBindings();
@@ -1935,12 +1930,8 @@ void StyleList::Update()
 }
 
 m_nAppFilter = pItem->GetValue();
-if (!m_xTreeBox->get_visible())
-{
-UpdateStyles(StyleFlags::UpdateFamilyList);
-}
-else
-FillTreeBox(GetActualFamily());
+UpdateStyles(StyleFlags::UpdateFamilyList);
+FillTreeBox(GetActualFamily());
 }
 else
 {
@@ -1952,10 +1943,8 @@ void StyleList::Update()
 && m_nAppFilter != pItem->GetValue())
 {
 m_nAppFilter = pItem->GetValue();
-if (!m_xTreeBox->get_visible())
-UpdateStyles(StyleFlags::UpdateFamilyList);
-else
-FillTreeBox(GetActualFamily());
+UpdateStyles(StyleFlags::UpdateFamilyList);
+FillTreeBox(GetActualFamily());
 }
 else
 {
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index 9204e8779478..f03c8b78b3ee 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -420,6 +420,7 @@ 
SfxCommonTemplateDialog_Impl::~SfxCommonTemplateDialog_Impl()
 m_pDeletionWatcher->signal();
 mxPreviewCheckbox.reset();
 mxFilterLb.reset();
+mxSpotlightCheckbox.reset();
 }
 
 /**
@@ -618,9 +619,11 @@ void SfxCommonTemplateDialog_Impl::FamilySelect(sal_uInt16 
nEntry, StyleList&, b
 m_aStyleList.FamilySelect(nEntry, bRefresh);
 
 SfxStyleFamily eFam = SfxTemplate::NIdToSfxFamilyId(nActFamily);
-
mxSpotlightCheckbox->set_visible(m_aStyleList.HasStylesSpotlightFeature()
-&& (eFam == SfxStyleFamily::Para || eFam == 
SfxStyleFamily::Char));
-if (mxSpotlightCheckbox->is_visible())
+bool bShowSpotlightCheckbox
+= m_aStyleList.HasStylesSpotlightFeature()
+  && (eFam == SfxStyleFamily::Para || eFam == 
SfxStyleFamily::Char);
+mxSpotlightCheckbox->set_visible(bShowSpotlightCheckbox);
+if (bShowSpotlightCheckbox)
 {
 bool bActive = false;
 if (eFam == SfxStyleFamily::Para)
diff --git a/svx/source/sidebar/inspector/InspectorTextPanel.cxx 
b/svx/source/sidebar/inspector/InspectorTextPanel.cxx
index 79f718f9eb19..4ec0f39f97ba 100644
--- a/svx/source/sidebar/inspector/InspectorTextPanel.cxx
+++ b/svx/source/sidebar/inspector/InspectorTextPanel.cxx
@@ -206,18 +206,13 @@ void InspectorTextPanel::NotifyItemUpdate(const 
sal_uInt16 nSId, const SfxItemSt
 IMPL_LINK(InspectorTextPanel, ToolbarHdl, const OUString&, rEntry, void)
 {
 SfxDispatcher* pDispatcher = SfxViewFrame::Current()->GetDispatcher();
-SfxFlagItem aParam(FN_PARAM_1);
 if (rEntry == "paragraphstyles")
 {
-SfxBoolItem aItem(SID_SPOTLIGHT_PARASTYLES, 
mpToolbar->get_item_active(rEntry));
-pDispatcher->ExecuteList(SID_SPOTLIGHT_PARASTYLES, 
SfxCallMode::SYNCHRON,
- { &aItem, &aParam });
+pDispatcher->Execute(SID_SPOTLIGHT_PARASTYLES, SfxCallMode::SYNCHRON)

core.git: sfx2/source

2025-03-22 Thread Michael Stahl (via logerrit)
 sfx2/source/view/frmload.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 8c548d46f4eacd615527412a0019d7a46150bee6
Author: Michael Stahl 
AuthorDate: Fri Mar 21 15:48:41 2025 +0100
Commit: Michael Stahl 
CommitDate: Fri Mar 21 17:24:54 2025 +0100

tdf#165851 sfx2: fix loading template with expand URL from configuration

Expand trusted URLs from configuration or extension.

(regression from commit 836d73a65180d89a077e36457f1f3aa1698c2058)

Change-Id: I7c2f8a59b44ae62e25ac26eb568f3f80c77a01ee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183206
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Reviewed-by: Michael Stahl 

diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx
index 7ef7c19d2f63..39de317cb4fd 100644
--- a/sfx2/source/view/frmload.cxx
+++ b/sfx2/source/view/frmload.cxx
@@ -47,6 +47,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -418,6 +419,8 @@ bool SfxFrameLoader_Impl::impl_determineTemplateDocument( 
::comphelper::NamedVal
 sTemplateURL = SfxObjectFactory::GetStandardTemplate( 
sServiceName );
 else
 sTemplateURL = SfxObjectFactory::GetStandardTemplate( 
SfxObjectShell::GetServiceNameFromFactory( sURL ) );
+// tdf#165851 expand trusted urls from configuration here
+sTemplateURL = comphelper::getExpandedUri(m_aContext, 
sTemplateURL);
 }
 
 if ( !sTemplateURL.isEmpty() )


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

2025-03-22 Thread Jim Raykowski (via logerrit)
 sfx2/source/dialog/StyleList.cxx  |2 +-
 sfx2/uiconfig/ui/templatepanel.ui |   14 ++
 vcl/source/app/salvtables.cxx |2 +-
 3 files changed, 12 insertions(+), 6 deletions(-)

New commits:
commit 186a2738396e938cc898166b95a02c70a5e22a30
Author: Jim Raykowski 
AuthorDate: Fri Mar 21 13:30:17 2025 -0800
Commit: Ilmari Lauhakangas 
CommitDate: Sat Mar 22 08:40:07 2025 +0100

Resolves: tdf#165756 - The spotlight view does not display colored and

numbered boxes beside the names of the styles (GTK3)

This first went missing when the surface attributes were dropped in
commit e3d7473a5611f414bfcf1a3e812248c82f9e9b83 and then again in commit
7f42f031ed1b9f374f3fcba9c814dc5862492026 when set_image replaced setting
the image in insert.

Change-Id: Ib5dd05e11fbc3db8f02a777cf7147bfd2b01ae97
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183213
Tested-by: Jenkins
Tested-by: Ilmari Lauhakangas 
Reviewed-by: Ilmari Lauhakangas 

diff --git a/sfx2/source/dialog/StyleList.cxx b/sfx2/source/dialog/StyleList.cxx
index a51a9e0e0a0d..b925b7e6e6a9 100644
--- a/sfx2/source/dialog/StyleList.cxx
+++ b/sfx2/source/dialog/StyleList.cxx
@@ -760,7 +760,7 @@ static void lcl_Update(weld::TreeView& rTreeView, const 
weld::TreeIter& rIter,
 
 rTreeView.set_id(rIter, rName);
 rTreeView.set_text(rIter, rName);
-rTreeView.set_image(rIter, *xDevice);
+rTreeView.set_image(rIter, *xDevice, 0);
 }
 
 static void FillBox_Impl(weld::TreeView& rBox, StyleTreeArr_Impl& rTreeArray,
diff --git a/sfx2/uiconfig/ui/templatepanel.ui 
b/sfx2/uiconfig/ui/templatepanel.ui
index 41c908c805cd..a5d232659113 100644
--- a/sfx2/uiconfig/ui/templatepanel.ui
+++ b/sfx2/uiconfig/ui/templatepanel.ui
@@ -4,8 +4,8 @@
   
   
 
-  
-  
+  
+  
   
   
   
@@ -14,8 +14,8 @@
   
   
 
-  
-  
+  
+  
   
   
   
@@ -304,6 +304,9 @@
   
 
   
+  
+0
+  
 
   
 
@@ -358,6 +361,9 @@
   
 
   
+  
+0
+  
 
   
 
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 4cc7090697bc..3dc6c0f38bb5 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -4533,7 +4533,7 @@ void SalInstanceTreeView::end_editing() { 
m_xTreeView->EndEditing(); }
 
 void SalInstanceTreeView::set_image(SvTreeListEntry* pEntry, const Image& 
rImage, int col)
 {
-if (col == -1)
+if (col == -1 || col == 0)
 {
 m_xTreeView->SetExpandedEntryBmp(pEntry, rImage);
 m_xTreeView->SetCollapsedEntryBmp(pEntry, rImage);


core.git: sfx2/source

2025-03-04 Thread Heiko Tietze (via logerrit)
 sfx2/source/dialog/backingwindow.cxx |2 --
 1 file changed, 2 deletions(-)

New commits:
commit ffd552926b381591972d2db55c16e57569cde98a
Author: Heiko Tietze 
AuthorDate: Tue Mar 4 10:12:43 2025 +0100
Commit: Heiko Tietze 
CommitDate: Wed Mar 5 07:24:36 2025 +0100

Resolves tdf#151040 - Brand image misplaced in Start Center

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

diff --git a/sfx2/source/dialog/backingwindow.cxx 
b/sfx2/source/dialog/backingwindow.cxx
index 32a3c4c5f0ee..337fd893d678 100644
--- a/sfx2/source/dialog/backingwindow.cxx
+++ b/sfx2/source/dialog/backingwindow.cxx
@@ -104,8 +104,6 @@ public:
 
 void ConfigureForWidth(int nWidth)
 {
-if (maBrandImage.GetSizePixel().Width() == nWidth)
-return;
 LoadImageForWidth(nWidth);
 m_BmpSize = maBrandImage.GetSizePixel();
 set_size_request(m_BmpSize.Width(), m_BmpSize.Height());


core.git: sfx2/source

2025-03-03 Thread Michael Stahl (via logerrit)
 sfx2/source/doc/objstor.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 0be897258beadc77ad2fa129f12ccbdb5c956e93
Author: Michael Stahl 
AuthorDate: Fri Feb 28 20:25:36 2025 +0100
Commit: Michael Stahl 
CommitDate: Mon Mar 3 12:33:02 2025 +0100

tdf#165115 sfx2: fix storing wholesome encrypted ODF templates

Oops, hard-coded SetupStorage(bTemplate=false) which caused wrong
MediaType on the root folder and:

  ManifestExport.cxx:131: ManifestExport::ManifestExport(): Assertion 
`aDocMediaType.isEmpty() || aDocMediaType == aMediaType' failed.

(regression from commit 3b347664b26d58d44f685a607a5e6d10dff89cd4)

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

diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index c7ca711d9542..1a039d669c6a 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -2073,7 +2073,8 @@ bool SfxObjectShell::SaveTo_Impl
 assert(xOuterStorage.is());
 assert(!rMedium.GetErrorCode());
 // the outer storage needs the same properties as the inner one
-SetupStorage(xOuterStorage, SOFFICE_FILEFORMAT_CURRENT, false);
+bool const isTemplate{rMedium.GetFilter()->IsOwnTemplateFormat()};
+SetupStorage(xOuterStorage, SOFFICE_FILEFORMAT_CURRENT, 
isTemplate);
 
 uno::Reference const xEncryptedInnerPackage =
 xOuterStorage->openStreamElement(


core.git: sfx2/source

2025-02-28 Thread Samuel Mehrbrodt (via logerrit)
 sfx2/source/dialog/styledlg.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a91494780bb59afe8c971003e6b809f1e66df050
Author: Samuel Mehrbrodt 
AuthorDate: Thu Feb 27 22:24:03 2025 +0100
Commit: Samuel Mehrbrodt 
CommitDate: Fri Feb 28 23:02:01 2025 +0100

tdf#165487 Always select a tab page by default

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

diff --git a/sfx2/source/dialog/styledlg.cxx b/sfx2/source/dialog/styledlg.cxx
index 9e5abc01aa73..c4bab0881d54 100644
--- a/sfx2/source/dialog/styledlg.cxx
+++ b/sfx2/source/dialog/styledlg.cxx
@@ -46,7 +46,7 @@ SfxStyleDialogController::SfxStyleDialogController
 AddTabPage(u"organizer"_ustr, SfxManageStyleSheetPage::Create, nullptr);
 
 // With new template always set the management page as the current page
-if (rStyle.GetName().isEmpty())
+if (rStyle.GetName().isEmpty() || GetCurPageId().isEmpty())
 SetCurPageId(u"organizer"_ustr);
 else
 {


core.git: sfx2/source

2025-02-25 Thread Michael Weghorn (via logerrit)
 sfx2/source/control/thumbnailviewacc.cxx  |8 ++--
 sfx2/source/control/thumbnailviewacc.hxx  |3 +--
 sfx2/source/control/thumbnailviewitem.cxx |2 +-
 3 files changed, 4 insertions(+), 9 deletions(-)

New commits:
commit e20cc47c0e03f3412517a3ff4ac856f6d250205b
Author: Michael Weghorn 
AuthorDate: Tue Feb 25 16:03:59 2025 +0100
Commit: Michael Weghorn 
CommitDate: Wed Feb 26 08:10:25 2025 +0100

thumbnailview a11y: Drop ThumbnailViewItemAcc::mbIsTransientChildrenDisabled

See also

commit 91ee00bcc13408eed23335770eabaf363970c526
Author: Michael Weghorn 
Date:   Mon Feb 24 18:44:24 2025 +0100

valueset a11y: Drop ValueItemAcc::mbIsTransientChildrenDisabled

which did the same for ValueItemAcc.

Change-Id: Iac03d27aa67bc3379c51827131e92570fa1a11a2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182197
Reviewed-by: Michael Weghorn 
Tested-by: Jenkins

diff --git a/sfx2/source/control/thumbnailviewacc.cxx 
b/sfx2/source/control/thumbnailviewacc.cxx
index da477e1b8fff..4278a30fb683 100644
--- a/sfx2/source/control/thumbnailviewacc.cxx
+++ b/sfx2/source/control/thumbnailviewacc.cxx
@@ -493,10 +493,8 @@ void ThumbnailViewAcc::ThrowIfDisposed()
 }
 }
 
-ThumbnailViewItemAcc::ThumbnailViewItemAcc(ThumbnailViewItem* 
pThumbnailViewItem,
-   bool bIsTransientChildrenDisabled)
+ThumbnailViewItemAcc::ThumbnailViewItemAcc(ThumbnailViewItem* 
pThumbnailViewItem)
 : mpThumbnailViewItem(pThumbnailViewItem)
-, mbIsTransientChildrenDisabled(bIsTransientChildrenDisabled)
 {
 }
 
@@ -665,9 +663,7 @@ sal_Int64 SAL_CALL 
ThumbnailViewItemAcc::getAccessibleStateSet()
 nStateSet |= accessibility::AccessibleStateType::SENSITIVE;
 nStateSet |= accessibility::AccessibleStateType::SHOWING;
 nStateSet |= accessibility::AccessibleStateType::VISIBLE;
-if ( !mbIsTransientChildrenDisabled )
-nStateSet |= accessibility::AccessibleStateType::TRANSIENT;
-
+nStateSet |= accessibility::AccessibleStateType::TRANSIENT;
 nStateSet |= accessibility::AccessibleStateType::SELECTABLE;
 nStateSet |= accessibility::AccessibleStateType::FOCUSABLE;
 
diff --git a/sfx2/source/control/thumbnailviewacc.hxx 
b/sfx2/source/control/thumbnailviewacc.hxx
index fe97b73c5f43..22c4d2464c11 100644
--- a/sfx2/source/control/thumbnailviewacc.hxx
+++ b/sfx2/source/control/thumbnailviewacc.hxx
@@ -157,10 +157,9 @@ private:
 
mxEventListeners;
 std::mutex  
maMutex;
 ThumbnailViewItem*  
mpThumbnailViewItem;
-bool
mbIsTransientChildrenDisabled;
 
 public:
-ThumbnailViewItemAcc(ThumbnailViewItem* pThumbnailViewItem, bool 
bIsTransientChildrenDisabled);
+ThumbnailViewItemAcc(ThumbnailViewItem* pThumbnailViewItem);
 virtual ~ThumbnailViewItemAcc() override;
 
 void ThumbnailViewItemDestroyed();
diff --git a/sfx2/source/control/thumbnailviewitem.cxx 
b/sfx2/source/control/thumbnailviewitem.cxx
index c2295cefd041..ed4ffb03b24b 100644
--- a/sfx2/source/control/thumbnailviewitem.cxx
+++ b/sfx2/source/control/thumbnailviewitem.cxx
@@ -114,7 +114,7 @@ void ThumbnailViewItem::setTitle (const OUString& rTitle)
 const rtl::Reference< ThumbnailViewItemAcc > & 
ThumbnailViewItem::GetAccessible()
 {
 if( !mxAcc.is() )
-mxAcc = new ThumbnailViewItemAcc(this, false);
+mxAcc = new ThumbnailViewItemAcc(this);
 
 return mxAcc;
 }


core.git: sfx2/source

2025-02-25 Thread Bogdan Buzea (via logerrit)
 sfx2/source/inc/sfxpicklist.hxx |2 --
 1 file changed, 2 deletions(-)

New commits:
commit 7950d2900f1a959643512e7bec3a807b4916b326
Author: Bogdan Buzea 
AuthorDate: Sat Nov 23 16:44:41 2024 +0100
Commit: David Gilbert 
CommitDate: Wed Feb 26 02:03:03 2025 +0100

tdf#152299 - Remove unused define(s) from C/C++ files

Change-Id: I3ef9e2f547ddbc39ccad230e4e6fb3b95dd49c81
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177155
Reviewed-by: Simon Chenery 
Tested-by: Jenkins
Reviewed-by: David Gilbert 

diff --git a/sfx2/source/inc/sfxpicklist.hxx b/sfx2/source/inc/sfxpicklist.hxx
index b8af2310d467..a40095bd2498 100644
--- a/sfx2/source/inc/sfxpicklist.hxx
+++ b/sfx2/source/inc/sfxpicklist.hxx
@@ -22,8 +22,6 @@
 
 #include 
 
-#define PICKLIST_MAXSIZE 100
-
 class SfxApplication;
 class SfxPickListImpl;
 


core.git: sfx2/source

2025-02-24 Thread Simon Chenery (via logerrit)
 sfx2/source/appl/appuno.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 4d6cf9434009fcbdd2445d7bcae5081595edae28
Author: Simon Chenery 
AuthorDate: Sun Feb 23 16:05:04 2025 +0100
Commit: Hossein 
CommitDate: Mon Feb 24 12:56:04 2025 +0100

tdf#147021 avoid use of SAL_N_ELEMENTS macro in appuno.cxx

Change-Id: I6d72f0dd0d2747b2e0041f1be1284e3f570b0363
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182067
Tested-by: Jenkins
Reviewed-by: Hossein   

diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index 46ca28982fec..e0a8ad545977 100644
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
@@ -93,7 +93,7 @@ SfxFormalArgument const aFormalArgs[] = {
 { static_cast(&aSfxStringItem_Impl), u"AdditionsTag"_ustr, 
FN_PARAM_ADDITIONS_TAG },
 };
 
-sal_uInt16 const nMediaArgsCount = SAL_N_ELEMENTS(aFormalArgs);
+constexpr sal_uInt16 nMediaArgsCount = std::size(aFormalArgs);
 
 constexpr OUString sTemplateRegionName = u"TemplateRegionName"_ustr;
 constexpr OUString sTemplateName = u"TemplateName"_ustr;


core.git: sfx2/source

2025-02-18 Thread Caolán McNamara (via logerrit)
 sfx2/source/appl/appmisc.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 906598cac70f471954ef1bdb6905bcfa303c522a
Author: Caolán McNamara 
AuthorDate: Tue Feb 18 08:07:04 2025 +
Commit: Caolán McNamara 
CommitDate: Tue Feb 18 10:30:38 2025 +0100

cid#1642994 COPY_INSTEAD_OF_MOVE

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

diff --git a/sfx2/source/appl/appmisc.cxx b/sfx2/source/appl/appmisc.cxx
index d96568b825a5..b02c4761e38e 100644
--- a/sfx2/source/appl/appmisc.cxx
+++ b/sfx2/source/appl/appmisc.cxx
@@ -147,7 +147,7 @@ bool SfxApplication::loadBrandSvg(const char *pName, 
BitmapEx &rBitmap, int nWid
 if (aStream.GetError())
 return false;
 
-VectorGraphicData aVectorGraphicData(aDataContainer, 
VectorGraphicDataType::Svg);
+VectorGraphicData aVectorGraphicData(std::move(aDataContainer), 
VectorGraphicDataType::Svg);
 
 // transform into [0,0,width,width*aspect] std dimensions
 


core.git: sfx2/source

2025-02-16 Thread Samuel Mehrbrodt (via logerrit)
 sfx2/source/dialog/filedlghelper.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 50b211d6ba6cdec01f7eb304d406fec615e6917f
Author: Samuel Mehrbrodt 
AuthorDate: Thu Feb 13 16:16:04 2025 +0100
Commit: Samuel Mehrbrodt 
CommitDate: Mon Feb 17 07:35:56 2025 +0100

Correct bug number

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

diff --git a/sfx2/source/dialog/filedlghelper.cxx 
b/sfx2/source/dialog/filedlghelper.cxx
index dce3103de3cc..8e7020d5cfe2 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -1476,7 +1476,7 @@ ErrCode FileDialogHelper_Impl::execute( 
std::vector& rpURLList,
 }
 
 rpURLList.clear();
-maPath.clear(); // tdf#147202 This should not survive between calls to 
execute
+maPath.clear(); // tdf#165228 This should not survive between calls to 
execute
 
 if ( ! mxFileDlg.is() )
 return ERRCODE_ABORT;


core.git: sfx2/source

2025-02-13 Thread Samuel Mehrbrodt (via logerrit)
 sfx2/source/dialog/filedlghelper.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 22c07826d77adf93ada6e17ed6ac531163dd5059
Author: Samuel Mehrbrodt 
AuthorDate: Thu Feb 13 09:55:04 2025 +0100
Commit: Samuel Mehrbrodt 
CommitDate: Thu Feb 13 12:03:19 2025 +0100

tdf#165228 Don't reuse previous path in save dialog

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

diff --git a/sfx2/source/dialog/filedlghelper.cxx 
b/sfx2/source/dialog/filedlghelper.cxx
index 07325adf3085..dce3103de3cc 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -1476,6 +1476,7 @@ ErrCode FileDialogHelper_Impl::execute( 
std::vector& rpURLList,
 }
 
 rpURLList.clear();
+maPath.clear(); // tdf#147202 This should not survive between calls to 
execute
 
 if ( ! mxFileDlg.is() )
 return ERRCODE_ABORT;


core.git: sfx2/source

2025-02-12 Thread Simon Chenery (via logerrit)
 sfx2/source/doc/zoomitem.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 37481972038dddffcfda9cb5b86d75cac85a3b27
Author: Simon Chenery 
AuthorDate: Sun Feb 9 18:29:33 2025 +0100
Commit: Hossein 
CommitDate: Wed Feb 12 14:59:56 2025 +0100

tdf#145614 Convert #define ZOOM_PARAMS to constexpr

Change-Id: I17bf502166cc8de337267679b360326cc40d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181319
Tested-by: Jenkins
Reviewed-by: Hossein   

diff --git a/sfx2/source/doc/zoomitem.cxx b/sfx2/source/doc/zoomitem.cxx
index 049cfa39f951..0ed8215c33ae 100644
--- a/sfx2/source/doc/zoomitem.cxx
+++ b/sfx2/source/doc/zoomitem.cxx
@@ -32,7 +32,7 @@ SfxPoolItem* SvxZoomItem::CreateDefault() { return new 
SvxZoomItem; }
 constexpr OUString ZOOM_PARAM_VALUE = u"Value"_ustr;
 constexpr OUString ZOOM_PARAM_VALUESET = u"ValueSet"_ustr;
 constexpr OUString ZOOM_PARAM_TYPE = u"Type"_ustr;
-#define ZOOM_PARAMS 3
+constexpr auto ZOOM_PARAMS = 3;
 
 
 SvxZoomItem::SvxZoomItem


core.git: sfx2/source

2025-02-03 Thread Jaume Pujantell (via logerrit)
 sfx2/source/control/dispatch.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit e748726e3cb7bd311d4c0808963d6847295385ea
Author: Jaume Pujantell 
AuthorDate: Thu Jan 30 12:11:39 2025 +0100
Commit: Jaume Pujantell 
CommitDate: Mon Feb 3 11:13:03 2025 +0100

lok: allow save on comment only mode

Allow execution of .uno:Save command on comment only mode for all types
of files, not only pdf.

Change-Id: I35387d93d00d709d209d3ed1ba2d315bd20b67d5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180940
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 
(cherry picked from commit adcfa0902b8641a50b11c9fb528bb971993d5f12)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181026
Reviewed-by: Jaume Pujantell 
Tested-by: Jenkins

diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index cb0f26e3c4b6..1959b5e81efa 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -1543,6 +1543,7 @@ bool SfxDispatcher::IsCommandAllowedInLokReadOnlyViewMode 
(const OUString & comm
 u".uno:DeleteAnnotation"_ustr,
 u".uno:EditAnnotation"_ustr,
 u".uno:PromoteComment"_ustr,
+u".uno:Save"_ustr,
 };
 
 if (std::find(std::begin(allowedList), std::end(allowedList), commandName) 
!= std::end(allowedList))


core.git: sfx2/source

2025-01-30 Thread Caolán McNamara (via logerrit)
 sfx2/source/doc/objstor.cxx  |3 ++-
 sfx2/source/doc/sfxbasemodel.cxx |   39 +--
 2 files changed, 23 insertions(+), 19 deletions(-)

New commits:
commit 8dccf51cabbc8e9e269ed97cece2d4808d28cd34
Author: Caolán McNamara 
AuthorDate: Thu Jan 30 14:33:39 2025 +
Commit: Caolán McNamara 
CommitDate: Thu Jan 30 20:50:31 2025 +0100

ucbhelper::Content can do nothing with a "private:stream"

so don't bother, and skip throwing exceptions in this case

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

diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 9e1861285ac8..74d209965f5d 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -2143,7 +2143,8 @@ bool SfxObjectShell::SaveTo_Impl
 aLockUIGuard.Unlock();
 pImpl->bForbidReload = bOldStat;
 
-if ( bOk )
+// ucbhelper::Content is unable to do anything useful with a private:stream
+if (bOk && !rMedium.GetName().equalsIgnoreAsciiCase("private:stream"))
 {
 try
 {
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 18dc4e87a1cb..34dc443bc242 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -4067,27 +4067,30 @@ OUString SAL_CALL SfxBaseModel::getTitle()
 SfxMedium* pMedium = m_pData->m_pObjectShell->GetMedium();
 if ( pMedium )
 {
-try {
-::ucbhelper::Content aContent( pMedium->GetName(),
-utl::UCBContentHelper::getDefaultCommandEnvironment(),
-comphelper::getProcessComponentContext() );
-const Reference < beans::XPropertySetInfo > xProps
- = aContent.getProperties();
-if ( xProps.is() )
-{
-static constexpr OUString aServerTitle( 
u"TitleOnServer"_ustr );
-if ( xProps->hasPropertyByName( aServerTitle ) )
+if (!pMedium->GetName().equalsIgnoreAsciiCase("private:stream"))
+{
+try {
+::ucbhelper::Content aContent( pMedium->GetName(),
+utl::UCBContentHelper::getDefaultCommandEnvironment(),
+comphelper::getProcessComponentContext() );
+const Reference < beans::XPropertySetInfo > xProps
+ = aContent.getProperties();
+if ( xProps.is() )
 {
-Any aAny = aContent.getPropertyValue( aServerTitle );
-aAny >>= aResult;
+static constexpr OUString aServerTitle( 
u"TitleOnServer"_ustr );
+if ( xProps->hasPropertyByName( aServerTitle ) )
+{
+Any aAny = aContent.getPropertyValue( aServerTitle 
);
+aAny >>= aResult;
+}
 }
 }
-}
-catch (const ucb::ContentCreationException &)
-{
-}
-catch (const ucb::CommandAbortedException &)
-{
+catch (const ucb::ContentCreationException &)
+{
+}
+catch (const ucb::CommandAbortedException &)
+{
+}
 }
 if (pMedium->IsRepairPackage())
 aResult += SfxResId(STR_REPAIREDDOCUMENT);


core.git: sfx2/source

2025-01-28 Thread Caolán McNamara (via logerrit)
 sfx2/source/doc/objmisc.cxx |9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 815c59104ff2f0a3603471b84132f4786a102fbd
Author: Caolán McNamara 
AuthorDate: Tue Jan 28 14:59:18 2025 +
Commit: Caolán McNamara 
CommitDate: Tue Jan 28 17:56:39 2025 +0100

Don't broadcast SfxHintId::TitleChanged if title doesn't change

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

diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 0a58635a2f7d..a0296194e807 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -865,9 +865,14 @@ void SfxObjectShell::InvalidateName()
 
 {
 pImpl->aTitle.clear();
-SetName( GetTitle( SFX_TITLE_APINAME ) );
 
-Broadcast( SfxHint(SfxHintId::TitleChanged) );
+OUString sOldName = GetName();
+OUString sNewName = GetTitle(SFX_TITLE_APINAME);
+if (sOldName != sNewName)
+{
+SetName(sNewName);
+Broadcast(SfxHint(SfxHintId::TitleChanged));
+}
 }
 
 


core.git: sfx2/source

2025-01-24 Thread Miklos Vajna (via logerrit)
 sfx2/source/doc/objmisc.cxx |   10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

New commits:
commit 32f0b68a9cb4f2762f9b5d31713972e6a430a2f2
Author: Miklos Vajna 
AuthorDate: Fri Jan 24 08:31:13 2025 +0100
Commit: Miklos Vajna 
CommitDate: Fri Jan 24 16:17:16 2025 +0100

cool#11002 sfx2: fix uncaught exception in SfxObjectShell::isExportLocked()

Similar to commit 71aa5352f6f57283d1db51c980f6f0b802381871 (sfx2: fix
uncaught exception in SfxObjectShell::isEditDocLocked(), 2025-01-23).

This seems to be the last problem with this pattern.

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

diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 868277740b59..0a58635a2f7d 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -2051,7 +2051,15 @@ bool SfxObjectShell::isExportLocked() const
 Reference xModel = GetModel();
 if (!xModel.is())
 return false;
-return comphelper::NamedValueCollection::getOrDefault(xModel->getArgs2( { 
u"LockExport"_ustr } ), u"LockExport", false);
+try
+{
+return 
comphelper::NamedValueCollection::getOrDefault(xModel->getArgs2( { 
u"LockExport"_ustr } ), u"LockExport", false);
+}
+catch (const uno::RuntimeException&)
+{
+TOOLS_WARN_EXCEPTION("sfx.appl", "unexpected RuntimeException");
+}
+return false;
 }
 
 bool SfxObjectShell::isPrintLocked() const


core.git: sfx2/source

2025-01-24 Thread Miklos Vajna (via logerrit)
 sfx2/source/doc/objmisc.cxx |   10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

New commits:
commit 99f4c0fc0a0e12ff7e72a4b047a6d8cfdfee5012
Author: Miklos Vajna 
AuthorDate: Fri Jan 24 08:13:51 2025 +0100
Commit: Miklos Vajna 
CommitDate: Fri Jan 24 14:04:44 2025 +0100

cool#11002 sfx2: fix uncaught exception in 
SfxObjectShell::isContentExtractionLocked()

Similar to commit 71aa5352f6f57283d1db51c980f6f0b802381871 (sfx2: fix
uncaught exception in SfxObjectShell::isEditDocLocked(), 2025-01-23).

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

diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 7d48d40a7439..868277740b59 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -2035,7 +2035,15 @@ bool SfxObjectShell::isContentExtractionLocked() const
 Reference xModel = GetModel();
 if (!xModel.is())
 return false;
-return comphelper::NamedValueCollection::getOrDefault(xModel->getArgs2( { 
u"LockContentExtraction"_ustr } ), u"LockContentExtraction", false);
+try
+{
+return 
comphelper::NamedValueCollection::getOrDefault(xModel->getArgs2( { 
u"LockContentExtraction"_ustr } ), u"LockContentExtraction", false);
+}
+catch (const uno::RuntimeException&)
+{
+TOOLS_WARN_EXCEPTION("sfx.appl", "unexpected RuntimeException");
+}
+return false;
 }
 
 bool SfxObjectShell::isExportLocked() const


  1   2   3   4   5   6   7   8   9   10   >