core.git: include/sfx2 sd/source sfx2/source sw/qa sw/source

2024-06-13 Thread Stephan Bergmann (via logerrit)
 include/sfx2/linkmgr.hxx  |3 +-
 sd/source/core/drawdoc.cxx|2 -
 sfx2/source/appl/linkmgr2.cxx |6 +++--
 sw/qa/extras/uiwriter/uiwriter8.cxx   |4 +--
 sw/qa/extras/uiwriter/uiwriter9.cxx   |3 +-
 sw/source/core/doc/DocumentLinksAdministrationManager.cxx |4 ++-
 sw/source/core/docnode/section.cxx|2 -
 sw/source/core/frmedt/feflyole.cxx|2 -
 sw/source/filter/html/swhtml.cxx  |5 +++-
 sw/source/uibase/shells/basesh.cxx|   15 --
 sw/source/uibase/uiview/viewprt.cxx   |8 ++-
 sw/source/uibase/uno/unotxdoc.cxx |2 -
 sw/source/uibase/utlui/glbltree.cxx   |2 -
 13 files changed, 42 insertions(+), 16 deletions(-)

New commits:
commit 2b250d2dbfa907a2eb571c5c4cb36b00c908bdc6
Author: Stephan Bergmann 
AuthorDate: Thu Jun 13 15:03:51 2024 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Jun 13 20:55:11 2024 +0200

Let LinkManager::UpdateAllLinks honor isUntrustedReferer

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

diff --git a/include/sfx2/linkmgr.hxx b/include/sfx2/linkmgr.hxx
index af6be44f58b1..1af8e7263197 100644
--- a/include/sfx2/linkmgr.hxx
+++ b/include/sfx2/linkmgr.hxx
@@ -130,7 +130,8 @@ public:
 
 voidUpdateAllLinks(bool bAskUpdate,
bool bUpdateGrfLinks,
-   weld::Window* pParentWin);
+   weld::Window* pParentWin,
+   OUString const & referer);
 
 // Call for list of links (eg for link-dialog)
 const   SvBaseLinks& GetLinks() const { return aLinkTbl; }
diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx
index 7029b55edbc6..635696cd3695 100644
--- a/sd/source/core/drawdoc.cxx
+++ b/sd/source/core/drawdoc.cxx
@@ -840,7 +840,7 @@ void SdDrawDocument::UpdateAllLinks()
 rEmbeddedObjectContainer.setUserAllowsLinkUpdate(true);
 }
 
-m_pLinkManager->UpdateAllLinks(true, false, nullptr);  // query box: 
update all links?
+m_pLinkManager->UpdateAllLinks(true, false, nullptr, "");  // query box: 
update all links?
 
 if (s_pDocLockedInsertingLinks == this)
 s_pDocLockedInsertingLinks = nullptr;  // unlock inserting links
diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx
index f041b28a12cc..da2a3cf141f7 100644
--- a/sfx2/source/appl/linkmgr2.cxx
+++ b/sfx2/source/appl/linkmgr2.cxx
@@ -281,11 +281,13 @@ bool LinkManager::GetDisplayNames( const SvBaseLink * 
pLink,
 void LinkManager::UpdateAllLinks(
 bool bAskUpdate,
 bool bUpdateGrfLinks,
-weld::Window* pParentWin )
+weld::Window* pParentWin,
+OUString const & referer )
 {
 // when active content is disabled don't bother updating all links
 // also (when bAskUpdate == true) don't show the pop up.
-
if(officecfg::Office::Common::Security::Scripting::DisableActiveContent::get())
+
if(officecfg::Office::Common::Security::Scripting::DisableActiveContent::get()
+   || SvtSecurityOptions::isUntrustedReferer(referer))
 return;
 
 // First make a copy of the array in order to update links
diff --git a/sw/qa/extras/uiwriter/uiwriter8.cxx 
b/sw/qa/extras/uiwriter/uiwriter8.cxx
index 215fc719ad66..77f9d72432e3 100644
--- a/sw/qa/extras/uiwriter/uiwriter8.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter8.cxx
@@ -2749,7 +2749,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf128106)
 // no way to set SwDocShell::m_nUpdateDocMode away from NO_UPDATE ?
 // pMasterDoc->getIDocumentLinksAdministration().UpdateLinks();
 
pMasterDoc->getIDocumentLinksAdministration().GetLinkManager().UpdateAllLinks(false,
 false,
-   
   nullptr);
+   
   nullptr, "");
 // note: this has called SwGetRefFieldType::UpdateGetReferences()
 SwFieldType const* const pType(
 
pMasterDoc->getIDocumentFieldsAccess().GetSysFieldType(SwFieldIds::GetRef));
@@ -2804,7 +2804,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf103612)
 size_t(1),
 
pGlobalDoc->getIDocumentLinksAdministration().GetLinkManager().GetLinks().size());
 
pGlobalDoc->getIDocumentLinksAdministration().GetLinkManager().UpdateAllLinks(false,
 false,
-   
   nullptr);
+   
   nullptr, "");
 
 xmlDocUniquePtr pLayout = parseLayoutDump();
 
diff 

core.git: include/sfx2 sfx2/source

2024-06-12 Thread Sarper Akdemir (via logerrit)
 include/sfx2/docmacromode.hxx|1 
 include/sfx2/strings.hrc |1 
 include/sfx2/viewfrm.hxx |1 
 sfx2/source/doc/docmacromode.cxx |   24 --
 sfx2/source/view/viewfrm.cxx |   41 +++
 5 files changed, 66 insertions(+), 2 deletions(-)

New commits:
commit 2beaa3be3829303e948d401f492dbfd239d60aad
Author: Sarper Akdemir 
AuthorDate: Tue Jun 11 12:39:36 2024 +0200
Commit: Sarper Akdemir 
CommitDate: Wed Jun 12 10:06:04 2024 +0200

remove ability to trust not validated macro signatures in high security

Giving the user the option to determine if they should trust an
invalid signature in HIGH macro security doesn't make sense.
CommonName of the signature is the most prominent feature presented
and the CommonName of a certificate can be easily forged for an
invalid signature, tricking the user into accepting an invalid
signature.

in the HIGH macro security setting only show the pop-up to
enable/disable signed macro if the certificate signature can be
validated.

Additionally present a ViewSignatures button in the Macro Disabled
infobar, so that the user can inspect what are the invalid signatures
and why (wihtout the ability of enabling macros).

Change-Id: Ia766fb701660160ee5dc9f6e077f4012a44ce721
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168667
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/include/sfx2/docmacromode.hxx b/include/sfx2/docmacromode.hxx
index 0816f310b45b..19ce18250175 100644
--- a/include/sfx2/docmacromode.hxx
+++ b/include/sfx2/docmacromode.hxx
@@ -265,6 +265,7 @@ namespace sfx2
 boolhasMacroLibrary() const;
 
 bool hasUnsignedContentError() const;
+bool hasInvalidSignaturesError() const;
 
 /** determines whether the given document storage has sub storages 
containing scripts
 or macros.
diff --git a/include/sfx2/strings.hrc b/include/sfx2/strings.hrc
index 1c3fafa074c0..35997819573d 100644
--- a/include/sfx2/strings.hrc
+++ b/include/sfx2/strings.hrc
@@ -289,6 +289,7 @@
 #define STR_MACROS_DISABLED_TITLE   
NC_("STR_MACROS_DISABLED_TITLE", "Macros disabled")
 #define STR_CONTAINS_MACROS NC_("STR_CONTAINS_MACROS", 
"Macros in this document are disabled due to the Macro Security settings.")
 #define STR_MACROS_DISABLED NC_("STR_MACROS_DISABLED", 
"Macros are disabled due to the Macro Security settings.")
+#define STR_MACROS_DISABLED_SIGNATURE_INVALID   
NC_("STR_MACROS_DISABLED_SIGNATURE_INVALID", "Macros are signed, but at least 
one signature has problems.")
 #define STR_MACROS_DISABLED_CONTENT_UNSIGNED
NC_("STR_MACROS_DISABLED_CONTENT_UNSIGNED", "Macros are signed, but the 
document (containing document events) is not signed.")
 #define STR_MACROS  NC_("STR_MACROS", "Show 
Macros")
 #define STR_SECURITY_OPTIONSNC_("STR_MACROS", "Show 
Security Options")
diff --git a/include/sfx2/viewfrm.hxx b/include/sfx2/viewfrm.hxx
index e0c56342eae5..ff942d4b27b1 100644
--- a/include/sfx2/viewfrm.hxx
+++ b/include/sfx2/viewfrm.hxx
@@ -67,6 +67,7 @@ class SFX2_DLLPUBLIC SfxViewFrame final : public SfxShell, 
public SfxListener
 DECL_DLLPRIVATE_LINK(MacroButtonHandler, weld::Button&, void);
 DECL_DLLPRIVATE_LINK(SecurityButtonHandler, weld::Button&, void);
 DECL_DLLPRIVATE_LINK(EventButtonHandler, weld::Button&, void);
+DECL_DLLPRIVATE_LINK(ViewSignaturesButtonHandler, weld::Button&, void);
 DECL_DLLPRIVATE_LINK(SwitchReadOnlyHandler, weld::Button&, void);
 DECL_DLLPRIVATE_LINK(SignDocumentHandler, weld::Button&, void);
 DECL_DLLPRIVATE_LINK(HiddenTrackChangesHandler, weld::Button&, void);
diff --git a/sfx2/source/doc/docmacromode.cxx b/sfx2/source/doc/docmacromode.cxx
index 4e9311593aed..c87224301590 100644
--- a/sfx2/source/doc/docmacromode.cxx
+++ b/sfx2/source/doc/docmacromode.cxx
@@ -72,10 +72,13 @@ namespace sfx2
 {
 IMacroDocumentAccess&   m_rDocumentAccess;
 bool m_bHasUnsignedContentError;
+/// Is true when macros was disabled due to invalid signatures (when 
macro security is high)
+bool m_bHasInvalidSignaturesError;
 
 explicit DocumentMacroMode_Data( IMacroDocumentAccess& rDocumentAccess 
)
 :m_rDocumentAccess( rDocumentAccess )
 ,m_bHasUnsignedContentError( false )
+,m_bHasInvalidSignaturesError( false )
 {
 }
 };
@@ -212,13 +215,26 @@ namespace sfx2
 // confirmation when macros are unsigned or untrusted. 
FROM_LIST_AND_SIGNED_NO_WARN
 // should not ask any confirmations. FROM_LIST_AND_SIGNED_WARN 
should only allow
 // trusted signed macros at this point; so it may only ask for 
confirmation to add
-// certificates to trusted, and shouldn't show UI 

core.git: include/sfx2 sc/source sd/source sfx2/source sw/source

2024-06-04 Thread Xisco Fauli (via logerrit)
 include/sfx2/shell.hxx  |4 -
 sc/source/ui/condformat/condformatdlgentry.cxx  |   66 ++-
 sc/source/ui/drawfunc/drawsh2.cxx   |   23 --
 sd/source/ui/func/fubullet.cxx  |7 +-
 sd/source/ui/tools/EventMultiplexer.cxx |5 -
 sd/source/ui/view/outlview.cxx  |4 -
 sfx2/source/doc/objserv.cxx |   67 +++-
 sfx2/source/view/viewsh.cxx |5 +
 sw/source/core/doc/docdesc.cxx  |   20 +++--
 sw/source/core/txtnode/OnlineAccessibilityCheck.cxx |   15 ++--
 sw/source/uibase/shells/frmsh.cxx   |4 -
 11 files changed, 130 insertions(+), 90 deletions(-)

New commits:
commit 587870297963b35ae8953adadbdc5ea8933004a7
Author: Xisco Fauli 
AuthorDate: Fri May 31 12:40:45 2024 +0200
Commit: Xisco Fauli 
CommitDate: Tue Jun 4 09:03:31 2024 +0200

sfx2: use SAL_RET_MAYBENULL in GetDispatcher() and GetFrame()

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

diff --git a/include/sfx2/shell.hxx b/include/sfx2/shell.hxx
index b454547970a5..420c8d578b95 100644
--- a/include/sfx2/shell.hxx
+++ b/include/sfx2/shell.hxx
@@ -367,7 +367,7 @@ public:
 The returned pointer is only valid in the immediate context of the 
method
 call.
 */
-SfxDispatcher*  GetDispatcher() const;
+SAL_RET_MAYBENULL SfxDispatcher*  GetDispatcher() const;
 
 /**
 This method returns a pointer to the  to which this 
SfxShell
@@ -388,7 +388,7 @@ public:
 
 
 */
-SfxViewFrame*   GetFrame() const;
+SAL_RET_MAYBENULL SfxViewFrame*   GetFrame() const;
 
 virtual boolHasUIFeature(SfxShellFeature nFeature) const;
 voidUIFeatureChanged();
diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx 
b/sc/source/ui/condformat/condformatdlgentry.cxx
index f08d23bd977b..066958daa4b8 100644
--- a/sc/source/ui/condformat/condformatdlgentry.cxx
+++ b/sc/source/ui/condformat/condformatdlgentry.cxx
@@ -448,42 +448,44 @@ void StyleSelect(weld::Window* pDialogParent, 
weld::ComboBox& rLbStyle, const Sc
 // (SetDispatcherLock would affect all Calc documents)
 if (ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell())
 {
-SfxDispatcher* pDisp = pViewShell->GetDispatcher();
-bool bLocked = pDisp->IsLocked();
-if (bLocked)
-pDisp->Lock(false);
-
-// Execute the "new style" slot, complete with undo and all 
necessary updates.
-// The return value (SfxUInt16Item) is ignored, look for new 
styles instead.
-pDisp->ExecuteList(SID_STYLE_NEW,
-SfxCallMode::SYNCHRON | SfxCallMode::RECORD,
-{ ,  }, {  });
-
-if (bLocked)
-pDisp->Lock(true);
-
-// Find the new style and add it into the style list boxes
-SfxStyleSheetIterator aStyleIter( pDoc->GetStyleSheetPool(), 
SfxStyleFamily::Para );
-bool bFound = false;
-for ( SfxStyleSheetBase* pStyle = aStyleIter.First(); pStyle && 
!bFound; pStyle = aStyleIter.Next() )
+if (SfxDispatcher* pDisp = pViewShell->GetDispatcher())
 {
-const OUString& aName = pStyle->GetName();
-if (rLbStyle.find_text(aName) == -1)// all lists contain 
the same entries
+bool bLocked = pDisp->IsLocked();
+if (bLocked)
+pDisp->Lock(false);
+
+// Execute the "new style" slot, complete with undo and all 
necessary updates.
+// The return value (SfxUInt16Item) is ignored, look for new 
styles instead.
+pDisp->ExecuteList(SID_STYLE_NEW,
+SfxCallMode::SYNCHRON | SfxCallMode::RECORD,
+{ ,  }, {  });
+
+if (bLocked)
+pDisp->Lock(true);
+
+// Find the new style and add it into the style list boxes
+SfxStyleSheetIterator aStyleIter( pDoc->GetStyleSheetPool(), 
SfxStyleFamily::Para );
+bool bFound = false;
+for ( SfxStyleSheetBase* pStyle = aStyleIter.First(); pStyle 
&& !bFound; pStyle = aStyleIter.Next() )
 {
-for( sal_Int32 i = 1, n = rLbStyle.get_count(); i <= n && 
!bFound; ++i)
+const OUString& aName = pStyle->GetName();
+if (rLbStyle.find_text(aName) == -1)// all lists 
contain the same entries
 {
-OUString aStyleName = 
ScGlobal::getCharClass().uppercase(rLbStyle.get_text(i));
-  

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

2024-05-29 Thread Heiko Tietze (via logerrit)
 include/sfx2/dinfdlg.hxx|   31 ++-
 sfx2/source/dialog/dinfdlg.cxx  |  130 -
 sfx2/uiconfig/ui/descriptioninfopage.ui |  299 
 sfx2/uiconfig/ui/documentinfopage.ui|   78 
 sfx2/uiconfig/ui/linefragment.ui|  106 +--
 5 files changed, 239 insertions(+), 405 deletions(-)

New commits:
commit 2164406a973fd40fcc56b8839a21854f6b50a53b
Author: Heiko Tietze 
AuthorDate: Tue May 28 10:15:43 2024 +0200
Commit: Heiko Tietze 
CommitDate: Wed May 29 08:59:02 2024 +0200

Resolves tdf#160937 - Improve dialog size for document properties

linefragment.ui and documentinfopage.ui modified to keep
the usual dialog dimension

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

diff --git a/include/sfx2/dinfdlg.hxx b/include/sfx2/dinfdlg.hxx
index d4743ed00ef5..c602a940c6f2 100644
--- a/include/sfx2/dinfdlg.hxx
+++ b/include/sfx2/dinfdlg.hxx
@@ -244,16 +244,31 @@ private:
 std::unique_ptr m_xTitleEd;
 std::unique_ptr m_xThemaEd;
 std::unique_ptr m_xKeywordsEd;
-std::unique_ptr m_xContributorEd;
-std::unique_ptr m_xCoverageEd;
-std::unique_ptr m_xIdentifierEd;
-std::unique_ptr m_xPublisherEd;
-std::unique_ptr m_xRelationEd;
-std::unique_ptr m_xRightsEd;
-std::unique_ptr m_xSourceEd;
-std::unique_ptr m_xTypeEd;
+std::unique_ptr m_xMoreTypes;
+std::unique_ptr m_xMoreValue;
 std::unique_ptr m_xCommentEd;
 
+DECL_LINK(MoreTypesHdl, weld::ComboBox&, void);
+DECL_LINK(MoreValueHdl, weld::Entry&, void);
+
+OUString m_sMoreValue_Contributor;
+OUString m_sMoreValue_Coverage;
+OUString m_sMoreValue_Identifier;
+OUString m_sMoreValue_Publisher;
+OUString m_sMoreValue_Relation;
+OUString m_sMoreValue_Rights;
+OUString m_sMoreValue_Source;
+OUString m_sMoreValue_Type;
+
+OUString m_sMoreValue_Contributor_Stored;
+OUString m_sMoreValue_Coverage_Stored;
+OUString m_sMoreValue_Identifier_Stored;
+OUString m_sMoreValue_Publisher_Stored;
+OUString m_sMoreValue_Relation_Stored;
+OUString m_sMoreValue_Rights_Stored;
+OUString m_sMoreValue_Source_Stored;
+OUString m_sMoreValue_Type_Stored;
+
 virtual boolFillItemSet( SfxItemSet* ) override;
 virtual voidReset( const SfxItemSet* ) override;
 
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index b1e5dbd92916..80387eacd85e 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -624,18 +624,14 @@ SfxDocumentDescPage::SfxDocumentDescPage(weld::Container* 
pPage, weld::DialogCon
 , m_xTitleEd(m_xBuilder->weld_entry(u"title"_ustr))
 , m_xThemaEd(m_xBuilder->weld_entry(u"subject"_ustr))
 , m_xKeywordsEd(m_xBuilder->weld_entry(u"keywords"_ustr))
-, m_xContributorEd(m_xBuilder->weld_entry(u"contributor"_ustr))
-, m_xCoverageEd(m_xBuilder->weld_entry(u"coverage"_ustr))
-, m_xIdentifierEd(m_xBuilder->weld_entry(u"identifier"_ustr))
-, m_xPublisherEd(m_xBuilder->weld_entry(u"publisher"_ustr))
-, m_xRelationEd(m_xBuilder->weld_entry(u"relation"_ustr))
-, m_xRightsEd(m_xBuilder->weld_entry(u"rights"_ustr))
-, m_xSourceEd(m_xBuilder->weld_entry(u"source"_ustr))
-, m_xTypeEd(m_xBuilder->weld_entry(u"type"_ustr))
+, m_xMoreTypes(m_xBuilder->weld_combo_box("cbMoreTypes"))
+, m_xMoreValue(m_xBuilder->weld_entry("edMoreValue"))
 , m_xCommentEd(m_xBuilder->weld_text_view(u"comments"_ustr))
 {
-m_xCommentEd->set_size_request(m_xKeywordsEd->get_preferred_size().Width(),
-   m_xCommentEd->get_height_rows(16));
+m_xCommentEd->set_size_request(-1, 
//m_xKeywordsEd->get_preferred_size().Width(),
+   m_xCommentEd->get_height_rows(8));
+m_xMoreTypes->connect_changed(LINK(this, SfxDocumentDescPage, 
MoreTypesHdl));
+m_xMoreValue->connect_changed(LINK(this, SfxDocumentDescPage, 
MoreValueHdl));
 }
 
 SfxDocumentDescPage::~SfxDocumentDescPage()
@@ -653,14 +649,16 @@ bool SfxDocumentDescPage::FillItemSet(SfxItemSet *rSet)
 const bool bTitleMod = m_xTitleEd->get_value_changed_from_saved();
 const bool bThemeMod = m_xThemaEd->get_value_changed_from_saved();
 const bool bKeywordsMod = m_xKeywordsEd->get_value_changed_from_saved();
-const bool bContributorMod = 
m_xContributorEd->get_value_changed_from_saved();
-const bool bCoverageMod = m_xCoverageEd->get_value_changed_from_saved();
-const bool bIdentifierMod = 
m_xIdentifierEd->get_value_changed_from_saved();
-const bool bPublisherMod = m_xPublisherEd->get_value_changed_from_saved();
-const bool bRelationMod = m_xRelationEd->get_value_changed_from_saved();
-const bool bRightsMod = m_xRightsEd->get_value_changed_from_saved();
-const bool bSourceMod = 

core.git: include/sfx2

2024-05-27 Thread Xisco Fauli (via logerrit)
 include/sfx2/viewfrm.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 369a3b5ab389222bbbc9aafaa5c2d9f269ba5775
Author: Xisco Fauli 
AuthorDate: Mon May 27 18:29:35 2024 +0200
Commit: Xisco Fauli 
CommitDate: Mon May 27 20:46:46 2024 +0200

sfx2: use SAL_RET_MAYBENULL in GetFrameWeld()

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

diff --git a/include/sfx2/viewfrm.hxx b/include/sfx2/viewfrm.hxx
index 884b557dc741..e0c56342eae5 100644
--- a/include/sfx2/viewfrm.hxx
+++ b/include/sfx2/viewfrm.hxx
@@ -111,7 +111,7 @@ public:
 SfxBindings&GetBindings() { return *m_pBindings; }
 const SfxBindings&  GetBindings() const  { return *m_pBindings; }
 vcl::Window&GetWindow() const;
-weld::Window*   GetFrameWeld() const;
+SAL_RET_MAYBENULL weld::Window* GetFrameWeld() const;
 
 SAL_DLLPRIVATE SfxProgress* GetProgress() const;
 


core.git: include/sfx2 sfx2/source

2024-05-22 Thread Xisco Fauli (via logerrit)
 include/sfx2/bindings.hxx|2 +-
 sfx2/source/control/bindings.cxx |8 ++--
 2 files changed, 3 insertions(+), 7 deletions(-)

New commits:
commit 343ca5c8ae6f7216683c78b961816bf149f957a0
Author: Xisco Fauli 
AuthorDate: Wed May 22 10:01:14 2024 +0200
Commit: Xisco Fauli 
CommitDate: Wed May 22 12:22:47 2024 +0200

sfx2: bGlobalOnly is always false

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

diff --git a/include/sfx2/bindings.hxx b/include/sfx2/bindings.hxx
index 2b85b4dbd065..2fac9d1048ef 100644
--- a/include/sfx2/bindings.hxx
+++ b/include/sfx2/bindings.hxx
@@ -101,7 +101,7 @@ friend class SfxBindings_Impl;
 
 private:
 SAL_DLLPRIVATE SfxPoolItemHolder Execute_Impl( sal_uInt16 nSlot, const 
SfxPoolItem **pArgs, sal_uInt16 nModi,
-SfxCallMode nCall, const SfxPoolItem 
**pInternalArgs, bool bGlobalOnly=false);
+SfxCallMode nCall, const SfxPoolItem 
**pInternalArgs);
 SAL_DLLPRIVATE void SetSubBindings_Impl( SfxBindings* );
 SAL_DLLPRIVATE void UpdateSlotServer_Impl(); // Update SlotServer
 SAL_DLLPRIVATE std::optional CreateSet_Impl(SfxStateCache& 
rCache, const SfxSlot* ,
diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx
index 63c8e56080d6..659d72254868 100644
--- a/sfx2/source/control/bindings.cxx
+++ b/sfx2/source/control/bindings.cxx
@@ -876,7 +876,7 @@ bool SfxBindings::Execute( sal_uInt16 nId, const 
SfxPoolItem** ppItems, SfxCallM
 }
 
 SfxPoolItemHolder SfxBindings::Execute_Impl( sal_uInt16 nId, const 
SfxPoolItem** ppItems, sal_uInt16 nModi, SfxCallMode nCallMode,
-const SfxPoolItem **ppInternalArgs, bool bGlobalOnly )
+const SfxPoolItem **ppInternalArgs )
 {
 SfxStateCache *pCache = GetStateCache( nId );
 if ( !pCache )
@@ -885,7 +885,7 @@ SfxPoolItemHolder SfxBindings::Execute_Impl( sal_uInt16 
nId, const SfxPoolItem**
 while ( pBind )
 {
 if ( pBind->GetStateCache( nId ) )
-return pBind->Execute_Impl( nId, ppItems, nModi, nCallMode, 
ppInternalArgs, bGlobalOnly );
+return pBind->Execute_Impl( nId, ppItems, nModi, nCallMode, 
ppInternalArgs );
 pBind = pBind->pImpl->pSubBindings;
 }
 }
@@ -944,10 +944,6 @@ SfxPoolItemHolder SfxBindings::Execute_Impl( sal_uInt16 
nId, const SfxPoolItem**
 pSlot = pServer->GetSlot();
 }
 
-if ( bGlobalOnly )
-if ( dynamic_cast< const SfxModule *>( pShell ) == nullptr && 
dynamic_cast< const SfxApplication *>( pShell ) == nullptr && dynamic_cast< 
const SfxViewFrame *>( pShell ) == nullptr )
-return SfxPoolItemHolder();
-
 SfxItemPool  = pShell->GetPool();
 SfxRequest aReq( nId, nCallMode, rPool );
 aReq.SetModifier( nModi );


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

2024-05-10 Thread Noel Grandin (via logerrit)
 include/sfx2/basedlgs.hxx |4 
 include/sfx2/tplpitem.hxx |2 
 sfx2/inc/preventduplicateinteraction.hxx  |2 
 sfx2/qa/cppunit/doc.cxx   |   36 +--
 sfx2/qa/cppunit/test_classification.cxx   |   38 +--
 sfx2/qa/cppunit/test_metadatable.cxx  |   12 -
 sfx2/qa/cppunit/test_misc.cxx |   18 -
 sfx2/qa/cppunit/view.cxx  |4 
 sfx2/source/appl/app.cxx  |2 
 sfx2/source/appl/appdata.cxx  |2 
 sfx2/source/appl/appdispatchprovider.cxx  |6 
 sfx2/source/appl/appinit.cxx  |4 
 sfx2/source/appl/appmisc.cxx  |2 
 sfx2/source/appl/appopen.cxx  |   36 +--
 sfx2/source/appl/appserv.cxx  |   68 +++---
 sfx2/source/appl/appuno.cxx   |   56 ++--
 sfx2/source/appl/childwin.cxx |4 
 sfx2/source/appl/fileobj.cxx  |4 
 sfx2/source/appl/helpinterceptor.cxx  |2 
 sfx2/source/appl/impldde.cxx  |   12 -
 sfx2/source/appl/linkmgr2.cxx |4 
 sfx2/source/appl/lnkbase2.cxx |2 
 sfx2/source/appl/macroloader.cxx  |8 
 sfx2/source/appl/newhelp.cxx  |  182 
 sfx2/source/appl/newhelp.hxx  |8 
 sfx2/source/appl/sfxhelp.cxx  |   36 +--
 sfx2/source/appl/shutdownicon.cxx |   18 -
 sfx2/source/appl/workwin.cxx  |2 
 sfx2/source/appl/xpackcreator.cxx |4 
 sfx2/source/bastyp/fltfnc.cxx |   20 -
 sfx2/source/bastyp/frmhtmlw.cxx   |   18 -
 sfx2/source/bastyp/helper.cxx |8 
 sfx2/source/bastyp/sfxhtml.cxx|2 
 sfx2/source/commandpopup/CommandPopup.cxx |   11 
 sfx2/source/config/evntconf.cxx   |2 
 sfx2/source/control/bindings.cxx  |2 
 sfx2/source/control/charmapcontrol.cxx|   16 -
 sfx2/source/control/charwin.cxx   |   13 -
 sfx2/source/control/dispatch.cxx  |   18 -
 sfx2/source/control/listview.cxx  |8 
 sfx2/source/control/recentdocsviewitem.cxx|   10 
 sfx2/source/control/request.cxx   |2 
 sfx2/source/control/statcach.cxx  |2 
 sfx2/source/control/templatedefaultview.cxx   |4 
 sfx2/source/control/templatedlglocalview.cxx  |   46 ++--
 sfx2/source/control/templatelocalview.cxx |2 
 sfx2/source/control/thumbnailview.cxx |8 
 sfx2/source/control/thumbnailviewacc.cxx  |8 
 sfx2/source/control/thumbnailviewitem.cxx |2 
 sfx2/source/control/unoctitm.cxx  |2 
 sfx2/source/devtools/DevelopmentToolDockingWindow.cxx |   16 -
 sfx2/source/devtools/DocumentModelTreeHandler.cxx |   10 
 sfx2/source/devtools/ObjectInspectorTreeHandler.cxx   |   25 +-
 sfx2/source/devtools/ObjectInspectorWidgets.cxx   |   18 -
 sfx2/source/dialog/StyleList.cxx  |   50 ++--
 sfx2/source/dialog/alienwarn.cxx  |   11 
 sfx2/source/dialog/backingcomp.cxx|   24 +-
 sfx2/source/dialog/backingwindow.cxx  |   92 
 sfx2/source/dialog/backingwindow.hxx  |2 
 sfx2/source/dialog/basedlgs.cxx   |8 
 sfx2/source/dialog/charmappopup.cxx   |4 
 sfx2/source/dialog/checkin.cxx|8 
 sfx2/source/dialog/dinfdlg.cxx|  204 +-
 sfx2/source/dialog/documentfontsdialog.cxx|   36 +--
 sfx2/source/dialog/filedlghelper.cxx  |  142 ++--
 sfx2/source/dialog/filtergrouping.cxx |4 
 sfx2/source/dialog/infobar.cxx|   20 -
 sfx2/source/dialog/inputdlg.cxx   |   12 -
 sfx2/source/dialog/mailmodel.cxx  |   28 +-
 sfx2/source/dialog/mgetempl.cxx   |   24 +-
 sfx2/source/dialog/navigat.cxx|2 
 sfx2/source/dialog/newstyle.cxx   |6 
 sfx2/source/dialog/partwnd.cxx|2 
 sfx2/source/dialog/passwd.cxx |   40 +--
 sfx2/source/dialog/printopt.cxx   |   86 +++
 sfx2/source/dialog/recfloat.cxx   |6 
 sfx2/source/dialog/securitypage.cxx   |   10 
 

core.git: include/sfx2 sfx2/source

2024-04-29 Thread Caolán McNamara (via logerrit)
 include/sfx2/templatelocalview.hxx|2 +-
 include/sfx2/thumbnailview.hxx|2 +-
 sfx2/source/control/templatelocalview.cxx |   10 --
 sfx2/source/control/thumbnailview.cxx |   26 +-
 sfx2/source/control/thumbnailviewitem.cxx |2 +-
 5 files changed, 20 insertions(+), 22 deletions(-)

New commits:
commit 9dbae9762c38ac69d71b2a763b812e3711c28921
Author: Caolán McNamara 
AuthorDate: Fri Apr 26 10:59:12 2024 +0100
Commit: Caolán McNamara 
CommitDate: Mon Apr 29 09:29:17 2024 +0200

rearrange to clarify that ThumbnailViewItem* was never null

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

diff --git a/include/sfx2/templatelocalview.hxx 
b/include/sfx2/templatelocalview.hxx
index 9d44e54d7cf4..4284c74b334f 100644
--- a/include/sfx2/templatelocalview.hxx
+++ b/include/sfx2/templatelocalview.hxx
@@ -116,7 +116,7 @@ public:
 
 bool exportTo (const sal_uInt16 nItemId, const sal_uInt16 nRegionItemId, 
std::u16string_view rName);
 
-virtual bool renameItem(ThumbnailViewItem* pItem, const OUString& 
sNewTitle) override;
+virtual bool renameItem(ThumbnailViewItem& rItem, const OUString& 
sNewTitle) override;
 
 virtual bool MouseButtonDown( const MouseEvent& rMEvt ) override;
 
diff --git a/include/sfx2/thumbnailview.hxx b/include/sfx2/thumbnailview.hxx
index 08babad793cb..d1945dbfe85c 100644
--- a/include/sfx2/thumbnailview.hxx
+++ b/include/sfx2/thumbnailview.hxx
@@ -191,7 +191,7 @@ public:
 
 sal_uInt16 GetItemId( const Point& rPos ) const;
 
-virtual bool renameItem(ThumbnailViewItem* pItem, const OUString& 
sNewTitle);
+virtual bool renameItem(ThumbnailViewItem& rItem, const OUString& 
sNewTitle);
 
 bool isDrawMnemonic() const { return mbDrawMnemonics; }
 
diff --git a/sfx2/source/control/templatelocalview.cxx 
b/sfx2/source/control/templatelocalview.cxx
index ada15399951e..11a870e39d2f 100644
--- a/sfx2/source/control/templatelocalview.cxx
+++ b/sfx2/source/control/templatelocalview.cxx
@@ -598,13 +598,11 @@ bool TemplateLocalView::exportTo(const sal_uInt16 
nItemId, const sal_uInt16 nReg
 return false;
 }
 
-bool TemplateLocalView::renameItem(ThumbnailViewItem* pItem, const OUString& 
sNewTitle)
+bool TemplateLocalView::renameItem(ThumbnailViewItem& rItem, const OUString& 
sNewTitle)
 {
 sal_uInt16 nRegionId = 0;
 sal_uInt16 nDocId = USHRT_MAX;
-TemplateViewItem* pDocItem = dynamic_cast( pItem );
-
-if ( pDocItem )
+if (TemplateViewItem* pDocItem = dynamic_cast())
 {
 nRegionId = pDocItem->mnRegionId;
 nDocId = pDocItem->mnDocId;
@@ -641,8 +639,8 @@ bool TemplateLocalView::renameItem(ThumbnailViewItem* 
pItem, const OUString& sNe
 
 OUString sHelpText = SfxResId(STR_TEMPLATE_TOOLTIP);
 sHelpText = (sHelpText.replaceFirst("$1", 
sNewTitle)).replaceFirst("$2", sRegionName);
-pItem->setHelpText(sHelpText);
-pItem->maTitle = sNewTitle;
+rItem.setHelpText(sHelpText);
+rItem.maTitle = sNewTitle;
 }
 return bRes;
 }
diff --git a/sfx2/source/control/thumbnailview.cxx 
b/sfx2/source/control/thumbnailview.cxx
index b47d9600b0f2..f1c01188de69 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -52,7 +52,7 @@ using namespace drawinglayer::primitive2d;
 
 constexpr int gnFineness = 5;
 
-bool ThumbnailView::renameItem(ThumbnailViewItem*, const OUString&)
+bool ThumbnailView::renameItem(ThumbnailViewItem&, const OUString&)
 {
 // Do nothing by default
 return false;
@@ -416,11 +416,11 @@ void ThumbnailView::CalculateItemPositions(bool 
bScrollBarUsed)
 size_t nCurCount = 0;
 for ( size_t i = 0; i < nItemCount; i++ )
 {
-ThumbnailViewItem *const pItem = mFilteredItemList[i];
+ThumbnailViewItem& rItem = *mFilteredItemList[i];
 
 #if !ENABLE_WASM_STRIP_RECENT
 // tdf#38742 - show pinned items in a separate line
-if (auto const pRecentDocsItem = 
dynamic_cast(pItem))
+if (auto const pRecentDocsItem = 
dynamic_cast())
 {
 if (bPinnedItems && !pRecentDocsItem->isPinned())
 {
@@ -438,23 +438,23 @@ void ThumbnailView::CalculateItemPositions(bool 
bScrollBarUsed)
 
 if ((nCurCount >= nFirstItem) && (nCurCount < nLastItem))
 {
-if( !pItem->isVisible())
+if( !rItem.isVisible())
 {
 if ( ImplHasAccessibleListeners() )
 {
 css::uno::Any aOldAny, aNewAny;
 
-aNewAny <<= 
css::uno::Reference(pItem->GetAccessible( 
false ));
+aNewAny <<= 
css::uno::Reference(rItem.GetAccessible( false 
));
 ImplFireAccessibleEvent( 
css::accessibility::AccessibleEventId::CHILD, aOldAny, aNewAny );
 }
 
-

core.git: include/sfx2 sfx2/Library_sfx.mk sfx2/source

2024-04-25 Thread Noel Grandin (via logerrit)
 include/sfx2/devtools/ObjectInspectorWidgets.hxx |   30 ++---
 sfx2/Library_sfx.mk  |1 
 sfx2/source/devtools/ObjectInspectorWidgets.cxx  |   40 +++
 3 files changed, 45 insertions(+), 26 deletions(-)

New commits:
commit 15d19cb69db25f99f7225c2708cda4a17cc7a053
Author: Noel Grandin 
AuthorDate: Thu Apr 25 12:19:42 2024 +0200
Commit: Noel Grandin 
CommitDate: Thu Apr 25 20:36:19 2024 +0200

Move ObjectInspectorWidgets code into cxx file

having this much code in a header file is not a good idea

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

diff --git a/include/sfx2/devtools/ObjectInspectorWidgets.hxx 
b/include/sfx2/devtools/ObjectInspectorWidgets.hxx
index 9c719d2aabef..04d6b0f1c06c 100644
--- a/include/sfx2/devtools/ObjectInspectorWidgets.hxx
+++ b/include/sfx2/devtools/ObjectInspectorWidgets.hxx
@@ -10,36 +10,14 @@
 
 #pragma once
 
+#include 
 #include 
 
-struct ObjectInspectorWidgets
+struct SFX2_DLLPUBLIC ObjectInspectorWidgets
 {
-ObjectInspectorWidgets(const std::unique_ptr& rxBuilder)
-: mpClassNameLabel(rxBuilder->weld_label("class_name_value_id"))
-, 
mpInterfacesTreeView(rxBuilder->weld_tree_view("interfaces_treeview_id"))
-, mpServicesTreeView(rxBuilder->weld_tree_view("services_treeview_id"))
-, 
mpPropertiesTreeView(rxBuilder->weld_tree_view("properties_treeview_id"))
-, mpMethodsTreeView(rxBuilder->weld_tree_view("methods_treeview_id"))
-, mpToolbar(rxBuilder->weld_toolbar("object_inspector_toolbar"))
-, mpNotebook(rxBuilder->weld_notebook("object_inspector_notebookbar"))
-, mpTextView(rxBuilder->weld_text_view("object_inspector_text_view"))
-, mpPaned(rxBuilder->weld_paned("object_inspector_paned"))
-{
-}
+ObjectInspectorWidgets(const std::unique_ptr& rxBuilder);
 
-~ObjectInspectorWidgets()
-{
-// dispose welded objects
-mpClassNameLabel.reset();
-mpInterfacesTreeView.reset();
-mpServicesTreeView.reset();
-mpPropertiesTreeView.reset();
-mpMethodsTreeView.reset();
-mpToolbar.reset();
-mpNotebook.reset();
-mpTextView.reset();
-mpPaned.reset();
-}
+~ObjectInspectorWidgets();
 
 std::unique_ptr mpClassNameLabel;
 std::unique_ptr mpInterfacesTreeView;
diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk
index 5013ebc7a318..c34a48f1e515 100644
--- a/sfx2/Library_sfx.mk
+++ b/sfx2/Library_sfx.mk
@@ -174,6 +174,7 @@ $(eval $(call gb_Library_add_exception_objects,sfx,\
 sfx2/source/devtools/DevelopmentToolDockingWindow \
 sfx2/source/devtools/DocumentModelTreeHandler \
 sfx2/source/devtools/ObjectInspectorTreeHandler \
+sfx2/source/devtools/ObjectInspectorWidgets \
 sfx2/source/dialog/alienwarn \
 sfx2/source/dialog/basedlgs \
 sfx2/source/dialog/checkin \
diff --git a/sfx2/source/devtools/ObjectInspectorWidgets.cxx 
b/sfx2/source/devtools/ObjectInspectorWidgets.cxx
new file mode 100644
index ..eef505ed9e2d
--- /dev/null
+++ b/sfx2/source/devtools/ObjectInspectorWidgets.cxx
@@ -0,0 +1,40 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#include 
+
+ObjectInspectorWidgets::ObjectInspectorWidgets(const 
std::unique_ptr& rxBuilder)
+: mpClassNameLabel(rxBuilder->weld_label("class_name_value_id"))
+, mpInterfacesTreeView(rxBuilder->weld_tree_view("interfaces_treeview_id"))
+, mpServicesTreeView(rxBuilder->weld_tree_view("services_treeview_id"))
+, mpPropertiesTreeView(rxBuilder->weld_tree_view("properties_treeview_id"))
+, mpMethodsTreeView(rxBuilder->weld_tree_view("methods_treeview_id"))
+, mpToolbar(rxBuilder->weld_toolbar("object_inspector_toolbar"))
+, mpNotebook(rxBuilder->weld_notebook("object_inspector_notebookbar"))
+, mpTextView(rxBuilder->weld_text_view("object_inspector_text_view"))
+, mpPaned(rxBuilder->weld_paned("object_inspector_paned"))
+{
+}
+
+ObjectInspectorWidgets::~ObjectInspectorWidgets()
+{
+// dispose welded objects
+mpClassNameLabel.reset();
+mpInterfacesTreeView.reset();
+mpServicesTreeView.reset();
+mpPropertiesTreeView.reset();
+mpMethodsTreeView.reset();
+mpToolbar.reset();
+mpNotebook.reset();
+mpTextView.reset();
+mpPaned.reset();
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */


core.git: include/sfx2 sfx2/sdi sfx2/source

2024-04-17 Thread Pranam Lashkari (via logerrit)
 include/sfx2/dinfdlg.hxx   |5 -
 sfx2/sdi/sfx.sdi   |2 +-
 sfx2/source/dialog/dinfdlg.cxx |   15 +++
 sfx2/source/doc/objserv.cxx|8 +---
 4 files changed, 21 insertions(+), 9 deletions(-)

New commits:
commit 11ae1cf4e4415237ed4fce7fa8d77502ab058ab1
Author: Pranam Lashkari 
AuthorDate: Mon Apr 15 01:22:45 2024 +0100
Commit: Caolán McNamara 
CommitDate: Wed Apr 17 13:32:27 2024 +0200

sw lok: .uno:SetDocumentProperties: add file size parameter

problem:
in LOK/online to support async save, files in jails may have
different extensions (ie: .upload, .uploading)
this caused problem to detect files as original file name may not exist.
As result property like file size were always set to 0

Change-Id: I552aef203297470d01032659a266210970129e66
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165769
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Caolán McNamara 
(cherry picked from commit aa4e10efc6e9ac92b0c652f238526aacbe2096c6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166171
Tested-by: Jenkins

diff --git a/include/sfx2/dinfdlg.hxx b/include/sfx2/dinfdlg.hxx
index 874e127f20b5..d4743ed00ef5 100644
--- a/include/sfx2/dinfdlg.hxx
+++ b/include/sfx2/dinfdlg.hxx
@@ -82,6 +82,7 @@ private:
 OUString m_Type;
 OUString m_Subject;
 OUString m_Title;
+sal_Int64m_nFileSize;
 bool m_bHasTemplate;
 bool m_bDeleteUserData;
 bool m_bUseUserData;
@@ -95,7 +96,7 @@ public:
 SfxDocumentInfoItem( const OUString ,
 const css::uno::Reference< css::document::XDocumentProperties> & 
i_xDocProps,
 const css::uno::Sequence< css::document::CmisProperty> & i_cmisProps,
-bool bUseUserData, bool bUseThumbnailSave );
+bool bUseUserData, bool bUseThumbnailSave, sal_Int64 nFileSize );
 SfxDocumentInfoItem( const SfxDocumentInfoItem& );
 virtual ~SfxDocumentInfoItem() override;
 
@@ -148,6 +149,8 @@ public:
 voidsetSubject(const OUString& i_val) { m_Subject = i_val; }
 const OUString& getTitle() const { return m_Title; }
 voidsetTitle(const OUString& i_val) { m_Title = i_val; }
+sal_Int64   getFileSize() const { return m_nFileSize; }
+void setFileSize(sal_Int64 i_val) { m_nFileSize = i_val; }
 
 /// reset user-specific data (author, modified-by, ...)
 voidresetUserData(const OUString & i_rAuthor);
diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi
index 21894391ef51..721ab116f60e 100644
--- a/sfx2/sdi/sfx.sdi
+++ b/sfx2/sdi/sfx.sdi
@@ -3398,7 +3398,7 @@ SfxBoolItem PrintPreview SID_PRINTPREVIEW
 
 
 SfxVoidItem SetDocumentProperties SID_DOCINFO
-(SfxDocumentInfoItem Properties SID_DOCINFO, SfxUnoAnyItem UpdatedProperties 
FN_PARAM_1)
+(SfxDocumentInfoItem Properties SID_DOCINFO, SfxUnoAnyItem UpdatedProperties 
FN_PARAM_1, SfxStringItem FileSize FN_PARAM_2)
 [
 AutoUpdate = FALSE,
 FastCall = FALSE,
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index f103654f04a9..74caea85569e 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -180,6 +180,7 @@ SfxDocumentInfoItem::SfxDocumentInfoItem()
 , m_isAutoloadEnabled(false)
 , m_EditingCycles(0)
 , m_EditingDuration(0)
+, m_nFileSize(-1)
 , m_bHasTemplate( true )
 , m_bDeleteUserData( false )
 , m_bUseUserData( true )
@@ -190,7 +191,7 @@ SfxDocumentInfoItem::SfxDocumentInfoItem()
 SfxDocumentInfoItem::SfxDocumentInfoItem( const OUString& rFile,
 const uno::Reference& i_xDocProps,
 const uno::Sequence& i_cmisProps,
-bool bIs, bool _bIs )
+bool bIs, bool _bIs, sal_Int64 _nFileSize )
 : SfxStringItem( SID_DOCINFO, rFile )
 , m_AutoloadDelay( i_xDocProps->getAutoloadSecs() )
 , m_AutoloadURL( i_xDocProps->getAutoloadURL() )
@@ -210,6 +211,7 @@ SfxDocumentInfoItem::SfxDocumentInfoItem( const OUString& 
rFile,
 i_xDocProps->getKeywords()) )
 , m_Subject( i_xDocProps->getSubject() )
 , m_Title( i_xDocProps->getTitle() )
+, m_nFileSize( _nFileSize )
 , m_bHasTemplate( true )
 , m_bDeleteUserData( false )
 , m_bUseUserData( bIs )
@@ -280,6 +282,7 @@ SfxDocumentInfoItem::SfxDocumentInfoItem( const 
SfxDocumentInfoItem& rItem )
 , m_Type(rItem.getType())
 , m_Subject( rItem.getSubject() )
 , m_Title( rItem.getTitle() )
+, m_nFileSize ( rItem.m_nFileSize )
 , m_bHasTemplate( rItem.m_bHasTemplate )
 , m_bDeleteUserData( rItem.m_bDeleteUserData )
 , m_bUseUserData( rItem.m_bUseUserData )
@@ -1117,9 +1120,13 @@ void SfxDocumentPage::Reset( const SfxItemSet* rSet )
 
 // determine size and type
 OUString aSizeText( m_aUnknownSize );
-if ( aURL.GetProtocol() == INetProtocol::File ||
-  

core.git: include/sfx2 sfx2/source

2024-04-15 Thread Caolán McNamara (via logerrit)
 include/sfx2/viewsh.hxx  |2 +-
 sfx2/source/control/unoctitm.cxx |   25 ++---
 sfx2/source/view/viewsh.cxx  |2 +-
 3 files changed, 16 insertions(+), 13 deletions(-)

New commits:
commit 5d111672ae58e35b7856bc2578352ebdc3ab6ecd
Author: Caolán McNamara 
AuthorDate: Mon Apr 15 19:30:18 2024 +0100
Commit: Caolán McNamara 
CommitDate: Mon Apr 15 22:17:19 2024 +0200

null-deref in SfxViewShell::isBlockedCommand

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

diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx
index ea7d345b29c4..3ebd2f4ec72f 100644
--- a/include/sfx2/viewsh.hxx
+++ b/include/sfx2/viewsh.hxx
@@ -485,7 +485,7 @@ public:
 
 // Blocked Command view settings
 void setBlockedCommandList(const char* blockedCommandList);
-bool isBlockedCommand(OUString command);
+bool isBlockedCommand(OUString command) const;
 
 void SetStoringHelper(const std::shared_ptr& xHelper) { 
m_xHelper = xHelper; }
 
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index f49dc2d7336f..9cbd29034a46 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -532,18 +532,21 @@ void SfxDispatchController_Impl::dispatch( const 
css::util::URL& aURL,
 
 SolarMutexGuard aGuard;
 
-if (comphelper::LibreOfficeKit::isActive() &&
-SfxViewShell::Current()->isBlockedCommand(aURL.Complete))
+if (comphelper::LibreOfficeKit::isActive())
 {
-tools::JsonWriter aTree;
-aTree.put("code", "");
-aTree.put("kind", "BlockedCommand");
-aTree.put("cmd", aURL.Complete);
-aTree.put("message", "Blocked feature");
-aTree.put("viewID", SfxViewShell::Current()->GetViewShellId().get());
-
-
SfxViewShell::Current()->libreOfficeKitViewCallback(LOK_COMMAND_BLOCKED, 
aTree.finishAndGetAsOString());
-return;
+const SfxViewShell* pViewShell = SfxViewShell::Current();
+if (pViewShell && pViewShell->isBlockedCommand(aURL.Complete))
+{
+tools::JsonWriter aTree;
+aTree.put("code", "");
+aTree.put("kind", "BlockedCommand");
+aTree.put("cmd", aURL.Complete);
+aTree.put("message", "Blocked feature");
+aTree.put("viewID", pViewShell->GetViewShellId().get());
+
+pViewShell->libreOfficeKitViewCallback(LOK_COMMAND_BLOCKED, 
aTree.finishAndGetAsOString());
+return;
+}
 }
 
 if (
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 0c800e1092d7..52761a1fb5fb 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -3908,7 +3908,7 @@ void SfxViewShell::setBlockedCommandList(const char* 
blockedCommandList)
 }
 }
 
-bool SfxViewShell::isBlockedCommand(OUString command)
+bool SfxViewShell::isBlockedCommand(OUString command) const
 {
 return mvLOKBlockedCommandList.find(command) != 
mvLOKBlockedCommandList.end();
 }


core.git: include/sfx2 sc/inc sc/qa sc/source sfx2/source

2024-04-06 Thread Gabriel Masei (via logerrit)
 include/sfx2/objsh.hxx  |6 
 sc/inc/scabstdlg.hxx|3 
 sc/qa/unit/data/csv/tdf48731.csv|4 
 sc/source/ui/attrdlg/scdlgfact.cxx  |5 
 sc/source/ui/attrdlg/scdlgfact.hxx  |3 
 sc/source/ui/dbgui/scuiasciiopt.cxx |   33 +++
 sc/source/ui/inc/scuiasciiopt.hxx   |3 
 sc/source/ui/unoobj/filtuno.cxx |   12 +
 sfx2/source/doc/objstor.cxx |  327 
 9 files changed, 383 insertions(+), 13 deletions(-)

New commits:
commit 2feda8ba21acdcf33a9b4ba94742f574c17839bd
Author: Gabriel Masei 
AuthorDate: Sun Mar 17 10:13:25 2024 +0200
Commit: Mike Kaganski 
CommitDate: Sat Apr 6 19:39:22 2024 +0200

tdf#152336 Detect charset and separators for csv files

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

diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index 075b3e57f4b9..e26c242d 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -45,6 +45,8 @@
 #include 
 #include 
 
+#include 
+
 namespace weld {class Button; }
 namespace model {class ColorSet; }
 struct NamedColor;
@@ -443,6 +445,10 @@ public:
 const css::uno::Sequence< css::beans::PropertyValue >& 
GetModifyPasswordInfo() const;
 boolSetModifyPasswordInfo( const 
css::uno::Sequence< css::beans::PropertyValue >& aInfo );
 
+static void DetectCharSet(SvStream& stream, 
rtl_TextEncoding& eCharSet, SvStreamEndian& endian);
+static void DetectCsvSeparators(SvStream& stream, 
rtl_TextEncoding& eCharSet, OUString& separators, sal_Unicode cStringDelimiter, 
bool bForceCommonSeps = true,  bool bAllowMultipleSeps = false);
+static void DetectCsvFilterOptions(SvStream& stream, 
OUString& aFilterOptions, bool bForceDetect = false);
+static void DetectFilterOptions(SfxMedium* pMedium, bool 
bForceDetect = false);
 static ErrCode  HandleFilter( SfxMedium* pMedium, 
SfxObjectShell const * pDoc );
 
 virtual boolPrepareClose(bool bUI = true);
diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx
index 7a94af5f6fe9..afd9abf4fbfc 100644
--- a/sc/inc/scabstdlg.hxx
+++ b/sc/inc/scabstdlg.hxx
@@ -417,7 +417,8 @@ public:
 virtual VclPtr 
CreateScImportAsciiDlg(weld::Window* pParent,
 const 
OUString& aDatName,
 SvStream* 
pInStream,
-
ScImportAsciiCall eCall) = 0;
+
ScImportAsciiCall eCall,
+
ScAsciiOptions* aOptions = nullptr) = 0;
 
 virtual VclPtr 
CreateScTextImportOptionsDlg(weld::Window* pParent) = 0;
 
diff --git a/sc/qa/unit/data/csv/tdf48731.csv b/sc/qa/unit/data/csv/tdf48731.csv
index c0353427ced3..fdbead52112e 100644
--- a/sc/qa/unit/data/csv/tdf48731.csv
+++ b/sc/qa/unit/data/csv/tdf48731.csv
@@ -1,4 +1,4 @@
-WITHOUT QUOTES
+WITHOUT QUOTES,
 1 apostrophe,'
 2 apostrophes,''
 3 apostrophes,'''
@@ -6,7 +6,7 @@ A number,'3
 A word,'word
 A misspelled word,'mword
 
-WITH QUOTES
+WITH QUOTES,
 1 apostrophe,"'"
 2 apostrophes,"''"
 3 apostrophes,"'''"
diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx 
b/sc/source/ui/attrdlg/scdlgfact.cxx
index 4fe36f303c57..03926077d9f1 100644
--- a/sc/source/ui/attrdlg/scdlgfact.cxx
+++ b/sc/source/ui/attrdlg/scdlgfact.cxx
@@ -1058,9 +1058,10 @@ const SfxItemSet* 
ScAsyncTabController_Impl::GetOutputItemSet() const
 // =Factories  for createdialog ===
 VclPtr 
ScAbstractDialogFactory_Impl::CreateScImportAsciiDlg(weld::Window* pParent,
 const OUString& aDatName,
-SvStream* pInStream, 
ScImportAsciiCall eCall)
+SvStream* pInStream, 
ScImportAsciiCall eCall,
+ScAsciiOptions* aOptions)
 {
-return 
VclPtr::Create(std::make_shared(pParent,
 aDatName,pInStream, eCall));
+return 
VclPtr::Create(std::make_shared(pParent,
 aDatName,pInStream, eCall, aOptions));
 }
 
 VclPtr 
ScAbstractDialogFactory_Impl::CreateScTextImportOptionsDlg(weld::Window* 
pParent)
diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx 
b/sc/source/ui/attrdlg/scdlgfact.hxx
index 276bffd63195..4644ff4b35e2 100644
--- a/sc/source/ui/attrdlg/scdlgfact.hxx
+++ b/sc/source/ui/attrdlg/scdlgfact.hxx
@@ -663,7 +663,8 @@ public:
 virtual VclPtr 
CreateScImportAsciiDlg(weld::Window* pParent,
 const 
OUString& 

core.git: include/sfx2 include/svl solenv/gdb svl/source sw/source

2024-03-19 Thread Armin Le Grand (allotropia) (via logerrit)
 include/sfx2/basedlgs.hxx   |2 
 include/svl/itemset.hxx |   20 ++---
 include/svl/whichranges.hxx |   46 +++--
 solenv/gdb/libreoffice/svl.py   |4 -
 svl/source/inc/items_helper.hxx |   60 -
 svl/source/items/itemset.cxx|  141 +---
 svl/source/items/whiter.cxx |8 +-
 sw/source/uibase/inc/tabsh.hxx  |2 
 8 files changed, 134 insertions(+), 149 deletions(-)

New commits:
commit 73567d60a1c4d2dded06f49df1fae95467e558c3
Author: Armin Le Grand (allotropia) 
AuthorDate: Mon Mar 18 20:36:45 2024 +0100
Commit: Armin Le Grand 
CommitDate: Tue Mar 19 10:43:03 2024 +0100

ITEM: Move TotalCount to WhichRangesContainer

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

diff --git a/include/sfx2/basedlgs.hxx b/include/sfx2/basedlgs.hxx
index e182b9aa7789..0805e55264e7 100644
--- a/include/sfx2/basedlgs.hxx
+++ b/include/sfx2/basedlgs.hxx
@@ -29,7 +29,7 @@ class SfxBindings;
 class SfxChildWindow;
 struct SfxChildWinInfo;
 class SfxItemSet;
-struct WhichRangesContainer;
+class WhichRangesContainer;
 
 class SFX2_DLLPUBLIC SfxDialogController : public weld::GenericDialogController
 {
diff --git a/include/svl/itemset.hxx b/include/svl/itemset.hxx
index f04b274ec83b..65f7076f69ab 100644
--- a/include/svl/itemset.hxx
+++ b/include/svl/itemset.hxx
@@ -87,13 +87,12 @@ class SAL_WARN_UNUSED SVL_DLLPUBLIC SfxItemSet
 const SfxItemSet* m_pParent;   ///< derivation
 sal_uInt16m_nCount;///< number of items
 sal_uInt16m_nRegister; ///< number of items with 
NeedsSurrogateSupport
-sal_uInt16m_nTotalCount;   ///< number of WhichIDs, also size of 
m_ppItems array
 
 // bitfield (better packaging if a bool needs to be added)
 bool  m_bItemsFixed : 1; ///< true if this is a 
SfxItemSetFixed object, so does not *own* m_ppItems
 
 SfxPoolItem const** m_ppItems; ///< pointer to array of items, we 
allocate and free this unless m_bItemsFixed==true
-WhichRangesContainer m_pWhichRanges;  ///< array of Which Ranges
+WhichRangesContainer m_aWhichRanges;  ///< array of Which Ranges
 
 // Notification-Callback mechanism for SwAttrSet in SW, functionPtr for 
callback
 std::function m_aCallback;
@@ -112,13 +111,13 @@ protected:
 using const_iterator = SfxPoolItem const**;
 
 const_iterator begin() const noexcept { return m_ppItems; }
-const_iterator end() const noexcept { return begin() + m_nTotalCount; }
+const_iterator end() const noexcept { return begin() + TotalCount(); }
 
-bool empty() const noexcept { return 0 == m_nTotalCount; }
-sal_Int32 size() const noexcept { return m_nTotalCount; }
+bool empty() const noexcept { return 0 == TotalCount(); }
+sal_Int32 size() const noexcept { return TotalCount(); }
 SfxPoolItem const* operator[](sal_Int32 idx) const noexcept
 {
-assert(idx >= 0 && idx < m_nTotalCount && "index out of range");
+assert(idx >= 0 && idx < TotalCount() && "index out of range");
 return m_ppItems[idx];
 }
 
@@ -141,7 +140,7 @@ protected:
 enum class SfxAllItemSetFlag { Flag };
 SfxItemSet( SfxItemPool&, SfxAllItemSetFlag );
 /** special constructor for SfxItemSetFixed */
-SfxItemSet( SfxItemPool&, WhichRangesContainer&& ranges, SfxPoolItem const 
** ppItems, sal_uInt16 nTotalCount );
+SfxItemSet( SfxItemPool&, WhichRangesContainer&& ranges, SfxPoolItem const 
** ppItems);
 /** special constructor for SfxItemSetFixed copy constructor */
 SfxItemSet( const SfxItemSet& rOther, SfxPoolItem const ** ppMyItems );
 
@@ -167,7 +166,7 @@ public:
 
 // Get number of items
 sal_uInt16  Count() const { return m_nCount; }
-sal_uInt16  TotalCount() const { return m_nTotalCount; }
+sal_uInt16  TotalCount() const { return 
m_aWhichRanges.TotalCount(); }
 
 bool IsItemsFixed() const { return m_bItemsFixed; }
 
@@ -280,7 +279,7 @@ public:
 voidMergeValue( const SfxPoolItem& rItem, bool 
bOverwriteDefaults = false  );
 
 SfxItemPool*GetPool() const { return m_pPool; }
-const WhichRangesContainer & GetRanges() const { return m_pWhichRanges; }
+const WhichRangesContainer & GetRanges() const { return m_aWhichRanges; }
 voidSetRanges( const WhichRangesContainer& );
 voidSetRanges( WhichRangesContainer&& );
 voidMergeRange( sal_uInt16 nFrom, sal_uInt16 nTo );
@@ -377,8 +376,7 @@ class SfxItemSetFixed : public 
SfxItemSetFixedStorage, public SfxItemSe
 public:
 SfxItemSetFixed( SfxItemPool& rPool)
 : SfxItemSet(rPool, WhichRangesContainer(svl::Items_t{}),
- 

core.git: include/sfx2 sfx2/source

2024-03-10 Thread Mike Kaganski (via logerrit)
 include/sfx2/objsh.hxx   |9 +
 sfx2/source/doc/objcont.cxx  |1 +
 sfx2/source/doc/objxtor.cxx  |   38 +++---
 sfx2/source/inc/objshimp.hxx |3 +++
 4 files changed, 48 insertions(+), 3 deletions(-)

New commits:
commit 99c1bd1a4ef5365d8c26a41c8e858c67e673beb4
Author: Mike Kaganski 
AuthorDate: Sun Mar 10 20:44:46 2024 +0600
Commit: Mike Kaganski 
CommitDate: Mon Mar 11 04:43:46 2024 +0100

Disallow closing document during generation of preview

Using an external (Java) script that opens a document, and then quickly
closes it, it may happen that the idle that generates a preview is still
active, when the control thread calls XCloseable::close, which destroys
still used document. This leads to use-after-free.

This uses the close listener in SfxObjectShell, to veto closing document
that is still in use by the preview generation code. After completion,
when the caller of close() transferred ownership, then the call to close
is repeated.

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

diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index c961394db08c..075b3e57f4b9 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -836,6 +836,15 @@ public:
 }
 };
 
+class SfxCloseVetoLock
+{
+public:
+SfxCloseVetoLock(const SfxObjectShell& rDocShell);
+~SfxCloseVetoLock();
+
+private:
+const SfxObjectShell& m_rDocShell;
+};
 
 typedef rtl::Reference SfxObjectShellRef;
 
diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx
index b762e9d11084..acaeb1047339 100644
--- a/sfx2/source/doc/objcont.cxx
+++ b/sfx2/source/doc/objcont.cxx
@@ -105,6 +105,7 @@ SfxObjectShell::GetPreviewMetaFile( bool bFullContent ) 
const
 
 BitmapEx SfxObjectShell::GetPreviewBitmap() const
 {
+SfxCloseVetoLock lock(*this);
 ScopedVclPtrInstance< VirtualDevice > pDevice;
 pDevice->SetAntialiasing(AntialiasingFlags::Enable | 
pDevice->GetAntialiasing());
 if(!CreatePreview_Impl(/*bFullContent*/false, pDevice, nullptr))
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index 88c13826e6b1..8a34dc40812f 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -137,8 +138,14 @@ public:
 
 } // namespace
 
-void SAL_CALL SfxModelListener_Impl::queryClosing( const 
css::lang::EventObject& , sal_Bool )
+void SAL_CALL SfxModelListener_Impl::queryClosing( const 
css::lang::EventObject& , sal_Bool bDeliverOwnership)
 {
+if (mpDoc->Get_Impl()->m_nClosingLockLevel)
+{
+if (bDeliverOwnership)
+mpDoc->Get_Impl()->m_bCloseModelScheduled = true;
+throw util::CloseVetoException(u"Closing document is blocked"_ustr, 
getXWeak());
+}
 }
 
 void SAL_CALL SfxModelListener_Impl::notifyClosing( const 
css::lang::EventObject& )
@@ -305,8 +312,6 @@ SfxObjectShell::~SfxObjectShell()
 if ( pSfxApp && pSfxApp->GetDdeService() )
 pSfxApp->RemoveDdeTopic( this );
 
-pImpl->pBaseModel.clear();
-
 // don't call GetStorage() here, in case of Load Failure it's possible 
that a storage was never assigned!
 if ( pMedium && pMedium->HasStorage_Impl() && pMedium->GetStorage( false ) 
== pImpl->m_xDocStorage )
 pMedium->CanDisposeStorage_Impl( false );
@@ -341,6 +346,33 @@ SfxObjectShell::~SfxObjectShell()
 }
 }
 
+SfxCloseVetoLock::SfxCloseVetoLock(const SfxObjectShell& rDocShell)
+: m_rDocShell(rDocShell)
+{
+osl_atomic_increment(_rDocShell.Get_Impl()->m_nClosingLockLevel);
+}
+
+SfxCloseVetoLock::~SfxCloseVetoLock()
+{
+if (osl_atomic_decrement(_rDocShell.Get_Impl()->m_nClosingLockLevel) == 
0)
+{
+if (m_rDocShell.Get_Impl()->m_bCloseModelScheduled)
+{
+m_rDocShell.Get_Impl()->m_bCloseModelScheduled = false; // pass 
ownership
+if (rtl::Reference model = 
static_cast(m_rDocShell.GetBaseModel().get()))
+{
+try
+{
+model->close(true);
+}
+catch (const util::CloseVetoException&)
+{
+DBG_UNHANDLED_EXCEPTION("sfx.doc");
+}
+}
+}
+}
+}
 
 void SfxObjectShell::Stamp_SetPrintCancelState(bool bState)
 {
diff --git a/sfx2/source/inc/objshimp.hxx b/sfx2/source/inc/objshimp.hxx
index acd85eb0d1a9..87499380e997 100644
--- a/sfx2/source/inc/objshimp.hxx
+++ b/sfx2/source/inc/objshimp.hxx
@@ -139,6 +139,9 @@ struct SfxObjectShell_Impl final : public 
::sfx2::IMacroDocumentAccess
 // Recent colors used by toolbar buttons
 std::unordered_map m_aRecentColors;
 
+mutable oslInterlockedCount m_nClosingLockLevel = 0;
+mutable bool 

core.git: include/sfx2 sfx2/source

2024-03-10 Thread Hassan Sajjad (via logerrit)
 include/sfx2/dispatch.hxx|1 +
 sfx2/source/control/dispatch.cxx |4 ++--
 sfx2/source/inc/hintpost.hxx |7 ---
 sfx2/source/notify/hintpost.cxx  |   11 ---
 4 files changed, 11 insertions(+), 12 deletions(-)

New commits:
commit 0783eeba65ec51051d072b6d4c6d32b3b45bee61
Author: Hassan Sajjad 
AuthorDate: Mon Jan 29 21:00:15 2024 +0500
Commit: Hossein 
CommitDate: Mon Mar 11 00:12:30 2024 +0100

Remove redundant function indirection in SfxHintPoster

SfxHintPoster::mLink always pointed to SfxDispatcher::PostMsgHandler and
except in ~SfxDispatcher, it was reinitialized to empty i.e. cleared.
This extra indirection is now removed.
SfxHintPoster was using SvRefBase to persist even after SfxDispatcher
was deleted and then deleted itself after SfxHintPoster::Post call was
completed. This extra indirection was adding 4-5 frames while debugging.

Change-Id: Ibfd6d3aea10ddf45732adc1a9d63a25717a771fa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162700
Tested-by: Hossein 
Reviewed-by: Hossein 

diff --git a/include/sfx2/dispatch.hxx b/include/sfx2/dispatch.hxx
index 7216fc92badc..eea69d2a5abc 100644
--- a/include/sfx2/dispatch.hxx
+++ b/include/sfx2/dispatch.hxx
@@ -80,6 +80,7 @@ friend class SfxBindings;
 friend class SfxStateCache;
 friend class SfxPopupMenuManager;
 friend class SfxHelp;
+friend class SfxHintPoster;
 
 DECL_DLLPRIVATE_LINK( EventHdl_Impl, Timer *, void );
 void PostMsgHandler(std::unique_ptr);
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index ccb0b0802f42..a780892b6940 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -303,7 +303,7 @@ void SfxDispatcher::Construct_Impl()
 for (SfxObjectBars_Impl & rObjBar : xImp->aObjBars)
 rObjBar.eId = ToolbarId::None;
 
-xImp->xPoster = new 
SfxHintPoster(std::bind(::PostMsgHandler, this, 
std::placeholders::_1));
+xImp->xPoster = new SfxHintPoster(this);
 
 xImp->aIdle.SetPriority(TaskPriority::HIGH_IDLE );
 xImp->aIdle.SetInvokeHandler( LINK(this, SfxDispatcher, EventHdl_Impl ) );
@@ -335,7 +335,7 @@ SfxDispatcher::~SfxDispatcher()
 
 // So that no timer by Reschedule in PlugComm strikes the 
LeaveRegistrations
 xImp->aIdle.Stop();
-xImp->xPoster->SetEventHdl( std::function)>() );
+xImp->xPoster->ClearLink();
 
 // Notify the stack variables in Call_Impl
 if ( xImp->pInCallAliveFlag )
diff --git a/sfx2/source/inc/hintpost.hxx b/sfx2/source/inc/hintpost.hxx
index ac37fde446ed..cca12647a283 100644
--- a/sfx2/source/inc/hintpost.hxx
+++ b/sfx2/source/inc/hintpost.hxx
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 
 
 class SfxRequest;
@@ -41,17 +42,17 @@ class SfxRequest;
 class SfxHintPoster final : public SvRefBase
 {
 private:
-std::function)> m_Link;
+class SfxDispatcher *m_Link;
 
 DECL_LINK( DoEvent_Impl, void*, void );
 
 virtual ~SfxHintPoster() override;
 
 public:
-SfxHintPoster(std::function)> aLink);
+SfxHintPoster(SfxDispatcher *aLink);
 
 voidPost( std::unique_ptr pHint );
-voidSetEventHdl(const std::function)>& rLink);
+voidClearLink();
 };
 
 #endif
diff --git a/sfx2/source/notify/hintpost.cxx b/sfx2/source/notify/hintpost.cxx
index 78c8c0499099..25d650de8ef2 100644
--- a/sfx2/source/notify/hintpost.cxx
+++ b/sfx2/source/notify/hintpost.cxx
@@ -25,8 +25,8 @@
 #include 
 #include 
 
-SfxHintPoster::SfxHintPoster(std::function)> 
aLink)
-: m_Link(std::move(aLink))
+SfxHintPoster::SfxHintPoster(SfxDispatcher* aLink)
+: m_Link(aLink)
 {
 }
 
@@ -71,7 +71,7 @@ IMPL_LINK(SfxHintPoster, DoEvent_Impl, void*, pPostedHint, 
void)
 }
 }
 
-m_Link(std::unique_ptr(pRequest));
+m_Link->PostMsgHandler(std::unique_ptr(pRequest));
 
 if (bSetView)
 {
@@ -83,9 +83,6 @@ IMPL_LINK(SfxHintPoster, DoEvent_Impl, void*, pPostedHint, 
void)
 ReleaseRef();
 }
 
-void SfxHintPoster::SetEventHdl(const 
std::function)>& rLink)
-{
-m_Link = rLink;
-}
+void SfxHintPoster::ClearLink() { m_Link = nullptr; }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


core.git: include/sfx2 sfx2/source

2024-02-29 Thread Jim Raykowski (via logerrit)
 include/sfx2/sidebar/TabBar.hxx |2 --
 sfx2/source/sidebar/TabBar.cxx  |   12 +---
 2 files changed, 1 insertion(+), 13 deletions(-)

New commits:
commit 0daeee1a7d0e530f1cce40f86a26ed01f07ee7da
Author: Jim Raykowski 
AuthorDate: Mon Feb 26 17:22:42 2024 -0900
Commit: Jim Raykowski 
CommitDate: Fri Mar 1 00:29:51 2024 +0100

tdf#159837 Drop unneeded TabBar EventNotify KEYINPUT handling code

to make qt and windows VCL backends respond to shortcuts when the
keyboard focus is on a TabBar tab.

commit 51f8e04eaaea50b779e3882e87628a6e625e0fd8 done to make the
Shift+Ctrl+F10 short cut, used to dock/undock the sidebar, work from
the sidebar tabbar appears no longer necessary. Simply passing the
KEYINPUT event on to InterimItemWindow::EventNotify seems to be
enough.

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

diff --git a/include/sfx2/sidebar/TabBar.hxx b/include/sfx2/sidebar/TabBar.hxx
index 6ef0fc9c3ddd..bdaa442c58ef 100644
--- a/include/sfx2/sidebar/TabBar.hxx
+++ b/include/sfx2/sidebar/TabBar.hxx
@@ -128,8 +128,6 @@ private:
 DECL_LINK(OnToolboxClicked, weld::Toggleable&, void);
 
 SidebarController* pParentSidebarController;
-std::unique_ptr mpAccel;
-
 };
 
 
diff --git a/sfx2/source/sidebar/TabBar.cxx b/sfx2/source/sidebar/TabBar.cxx
index 9d92d24cd93a..3ccaa7ebd454 100644
--- a/sfx2/source/sidebar/TabBar.cxx
+++ b/sfx2/source/sidebar/TabBar.cxx
@@ -185,17 +185,7 @@ bool TabBar::EventNotify(NotifyEvent& rEvent)
 NotifyEventType nType = rEvent.GetType();
 if(NotifyEventType::KEYINPUT == nType)
 {
-const vcl::KeyCode& rKeyCode = rEvent.GetKeyEvent()->GetKeyCode();
-if (!mpAccel)
-{
-mpAccel = svt::AcceleratorExecute::createAcceleratorHelper();
-mpAccel->init(comphelper::getProcessComponentContext(), mxFrame);
-}
-const OUString 
aCommand(mpAccel->findCommand(svt::AcceleratorExecute::st_VCLKey2AWTKey(rKeyCode)));
-if (".uno:Sidebar" == aCommand ||
-(rKeyCode.IsMod1() && rKeyCode.IsShift() && rKeyCode.GetCode() 
== KEY_F10))
-return InterimItemWindow::EventNotify(rEvent);
-return true;
+return InterimItemWindow::EventNotify(rEvent);
 }
 else if(NotifyEventType::COMMAND == nType)
 {


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

2024-02-24 Thread Noel Grandin (via logerrit)
 sfx2/inc/DevelopmentToolDockingWindow.hxx |6 +++---
 sfx2/inc/pch/precompiled_sfx.hxx  |1 -
 sfx2/source/appl/appserv.cxx  |2 +-
 sfx2/source/devtools/DevelopmentToolChildWindow.cxx   |2 +-
 sfx2/source/devtools/DevelopmentToolDockingWindow.cxx |2 +-
 sfx2/source/devtools/SelectionChangeHandler.hxx   |2 +-
 6 files changed, 7 insertions(+), 8 deletions(-)

New commits:
commit e2cacf0456f79540ced611be84504d11b94ebe6f
Author: Noel Grandin 
AuthorDate: Fri Feb 23 13:02:41 2024 +0200
Commit: Noel Grandin 
CommitDate: Sat Feb 24 10:13:19 2024 +0100

move this header inside the module

it is not used anywhere else

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

diff --git a/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx 
b/sfx2/inc/DevelopmentToolDockingWindow.hxx
similarity index 90%
rename from include/sfx2/devtools/DevelopmentToolDockingWindow.hxx
rename to sfx2/inc/DevelopmentToolDockingWindow.hxx
index 9cd1efeb352e..18511f70b9b6 100644
--- a/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx
+++ b/sfx2/inc/DevelopmentToolDockingWindow.hxx
@@ -28,7 +28,7 @@
  * Contains two sides. Left side contains the simplified DOM tree and
  * the right side the object inspector tree.
  */
-class UNLESS_MERGELIBS(SFX2_DLLPUBLIC) DevelopmentToolDockingWindow final : 
public SfxDockingWindow
+class DevelopmentToolDockingWindow final : public SfxDockingWindow
 {
 private:
 std::unique_ptr mpObjectInspectorWidgets;
@@ -47,8 +47,8 @@ private:
 // Handler for the object inspector tree
 ObjectInspectorTreeHandler maObjectInspectorTreeHandler;
 
-DECL_DLLPRIVATE_LINK(DocumentModelTreeViewSelectionHandler, 
weld::TreeView&, void);
-DECL_DLLPRIVATE_LINK(DomToolbarButtonClicked, const OUString&, void);
+DECL_LINK(DocumentModelTreeViewSelectionHandler, weld::TreeView&, void);
+DECL_LINK(DomToolbarButtonClicked, const OUString&, void);
 
 void updateSelection();
 
diff --git a/sfx2/inc/pch/precompiled_sfx.hxx b/sfx2/inc/pch/precompiled_sfx.hxx
index 1f92a21a34ea..97de88104b0b 100644
--- a/sfx2/inc/pch/precompiled_sfx.hxx
+++ b/sfx2/inc/pch/precompiled_sfx.hxx
@@ -411,7 +411,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index d3884203596a..ed114b0d31a7 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -98,7 +98,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 #include 
 #include 
diff --git a/sfx2/source/devtools/DevelopmentToolChildWindow.cxx 
b/sfx2/source/devtools/DevelopmentToolChildWindow.cxx
index 6b160bfa092a..291c476247ac 100644
--- a/sfx2/source/devtools/DevelopmentToolChildWindow.cxx
+++ b/sfx2/source/devtools/DevelopmentToolChildWindow.cxx
@@ -9,7 +9,7 @@
  */
 
 #include 
-#include 
+#include 
 #include 
 
 SFX_IMPL_DOCKINGWINDOW_WITHID(DevelopmentToolChildWindow, 
SID_DEVELOPMENT_TOOLS_DOCKING_WINDOW);
diff --git a/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx 
b/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx
index 0095e3396cf8..4e3107a71ced 100644
--- a/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx
+++ b/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx
@@ -10,7 +10,7 @@
 
 #include 
 
-#include 
+#include 
 
 #include 
 
diff --git a/sfx2/source/devtools/SelectionChangeHandler.hxx 
b/sfx2/source/devtools/SelectionChangeHandler.hxx
index 57224e056a52..f7c3afdf9c87 100644
--- a/sfx2/source/devtools/SelectionChangeHandler.hxx
+++ b/sfx2/source/devtools/SelectionChangeHandler.hxx
@@ -10,7 +10,7 @@
 
 #pragma once
 
-#include 
+#include 
 
 #include 
 #include 


core.git: include/sfx2

2024-02-15 Thread Samuel Mehrbrodt (via logerrit)
 include/sfx2/strings.hrc |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 70b287d599a2bbddd8c67f51809a0513c2bdb2e6
Author: Samuel Mehrbrodt 
AuthorDate: Thu Feb 15 16:11:12 2024 +0100
Commit: Samuel Mehrbrodt 
CommitDate: Thu Feb 15 21:22:33 2024 +0100

Improve wording for security warning infobar

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

diff --git a/include/sfx2/strings.hrc b/include/sfx2/strings.hrc
index d28fa1cc22b7..1c3fafa074c0 100644
--- a/include/sfx2/strings.hrc
+++ b/include/sfx2/strings.hrc
@@ -42,7 +42,7 @@
 #define STR_AUTOMATICVERSIONNC_("STR_AUTOMATICVERSION", 
"Automatically saved version")
 #define STR_EXPORTBUTTONNC_("STR_EXPORTBUTTON", 
"Export")
 #define STR_LABEL_FILEFORMATNC_("STR_LABEL_FILEFORMAT", 
"File format:")
-#define STR_HIDDENINFO_CONTAINS NC_("STR_HIDDENINFO_CONTAINS", 
"This document contains:

")
+#define STR_HIDDENINFO_CONTAINS NC_("STR_HIDDENINFO_CONTAINS", 
"The document contains the following potentially sensitive elements:")
 #define STR_HIDDENINFO_RECORDCHANGES
NC_("STR_HIDDENINFO_RECORDCHANGES", "Recorded changes")
 #define STR_HIDDENINFO_NOTESNC_("STR_HIDDENINFO_NOTES", 
"Notes")
 #define STR_HIDDENINFO_DOCVERSIONS  
NC_("STR_HIDDENINFO_DOCVERSIONS", "Document versions")


core.git: include/sfx2 include/svx officecfg/registry sd/inc sd/sdi sd/source sd/uiconfig svx/Library_svx.mk svx/sdi svx/source svx/uiconfig svx/UIConfig_svx.mk sw/inc sw/Library_sw.mk sw/sdi sw/sourc

2024-02-09 Thread AkshayWarrier (via logerrit)
 include/sfx2/sfxsids.hrc |
2 
 include/svx/dialog/gotodlg.hxx   |   
32 +--
 officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu |   
19 +
 sd/inc/strings.hrc   |
2 
 sd/sdi/_drvwsh.sdi   |
5 
 sd/source/ui/func/funavig.cxx|   
27 ++
 sd/source/ui/inc/DrawViewShell.hxx   |
3 
 sd/source/ui/inc/SlideSorterViewShell.hxx|
2 
 sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx  |   
16 +
 sd/source/ui/view/drviews3.cxx   |
7 
 sd/source/ui/view/drviewsa.cxx   |   
11 +
 sd/uiconfig/sdraw/menubar/menubar.xml|
1 
 sd/uiconfig/simpress/menubar/menubar.xml |
1 
 svx/Library_svx.mk   |
1 
 svx/UIConfig_svx.mk  |
1 
 svx/sdi/svx.sdi  |   
17 +
 svx/source/dialog/gotodlg.cxx|   
66 ++
 svx/uiconfig/ui/gotopagedialog.ui|
2 
 sw/Library_sw.mk |
1 
 sw/UIConfig_swriter.mk   |
1 
 sw/inc/cmdid.h   |
2 
 sw/inc/strings.hrc   |
1 
 sw/sdi/_viewsh.sdi   |
2 
 sw/sdi/swriter.sdi   |   
17 -
 sw/source/uibase/uiview/view2.cxx|   
13 -
 sw/source/uibase/utlui/gotodlg.cxx   |  
105 --
 26 files changed, 202 insertions(+), 155 deletions(-)

New commits:
commit ace21b4b2537a3cf2301fca2ac6f78d0612e911f
Author: AkshayWarrier 
AuthorDate: Fri Feb 2 02:18:24 2024 +0530
Commit: Jim Raykowski 
CommitDate: Sat Feb 10 02:05:55 2024 +0100

tdf#159372 svx: Add goto dialog

Adds a goto page/slide dialog for Impress and Draw similar to Writer.
To avoid duplicating code and ui, the dialog is created in svx/ and used in 
other modules.
The old goto dialog in Writer has now been replaced with this dialog.

Change-Id: I28f819f0d0734fb2bb08a7b99a628217ef66dba9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162913
Tested-by: Heiko Tietze 
Reviewed-by: Heiko Tietze 
Tested-by: Jenkins
Reviewed-by: Jim Raykowski 

diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc
index 176e500c55b3..e2fafac7321a 100644
--- a/include/sfx2/sfxsids.hrc
+++ b/include/sfx2/sfxsids.hrc
@@ -228,7 +228,7 @@ class SvxZoomItem;
 #define SID_UNPACK  
TypedWhichId(SID_SFX_START + 1662)
 // (SID_SFX_START + 1663) used further down
 #define SID_ATTR_TARGETLANG_STR (SID_SFX_START + 1664)
-// FREE
+#define SID_GO_TO_PAGE  (SID_SFX_START + 1665)
 #define SID_OUTPUTSTREAM
TypedWhichId(SID_SFX_START + 1666)
 #define SID_IMAGE_ORIENTATION   
TypedWhichId(SID_SFX_START + 1667)
 
diff --git a/sw/inc/gotodlg.hxx b/include/svx/dialog/gotodlg.hxx
similarity index 64%
rename from sw/inc/gotodlg.hxx
rename to include/svx/dialog/gotodlg.hxx
index 0d10da367f68..304f1352b0db 100644
--- a/sw/inc/gotodlg.hxx
+++ b/include/svx/dialog/gotodlg.hxx
@@ -17,38 +17,30 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_SW_SOURCE_UIBASE_INC_GOTODLG_HXX
-#define INCLUDED_SW_SOURCE_UIBASE_INC_GOTODLG_HXX
+#pragma once
 
-#include 
+#include 
 #include 
 
-class SwView;
-
-class SwGotoPageDlg final : public weld::GenericDialogController
+namespace svx
+{
+class SVX_DLLPUBLIC GotoPageDlg final : public weld::GenericDialogController
 {
 public:
-SwGotoPageDlg(weld::Window *parent, SfxBindings& rBindings);
+GotoPageDlg(weld::Window* pParent, const OUString& title, const OUString& 
label,
+sal_uInt16 curPagePos, sal_uInt16 pageCnt);
 
-sal_uInt16 GetPageSelection() const
-{
-return mxMtrPageCtrl->get_text().toUInt32();
-}
+sal_uInt16 GetPageSelection() const { return 
mxMtrPageCtrl->get_text().toUInt32(); }
 
 private:
-SwView   *m_pCreateView;
-SfxBindings& m_rBindings;
-sal_uInt16   mnMaxPageCnt;
+sal_uInt16 mnMaxPageCnt;
 
 std::unique_ptr mxMtrPageCtrl;
 std::unique_ptr mxPageNumberLbl;
+std::unique_ptr mxPageLbl;
 
-SwView*

core.git: include/sfx2 sfx2/source

2024-02-01 Thread Mike Kaganski (via logerrit)
 include/sfx2/docfile.hxx |2 ++
 sfx2/source/doc/docfile.cxx  |   19 ++-
 sfx2/source/doc/objmisc.cxx  |4 +---
 sfx2/source/doc/objstor.cxx  |3 +--
 sfx2/source/doc/sfxbasemodel.cxx |6 ++
 5 files changed, 16 insertions(+), 18 deletions(-)

New commits:
commit 4981c0e7d5bbe8e1fadc1b5cc7923e32f160d635
Author: Mike Kaganski 
AuthorDate: Fri Feb 2 11:28:27 2024 +0600
Commit: Mike Kaganski 
CommitDate: Fri Feb 2 08:49:14 2024 +0100

Add SfxMedium::IsRepairPackage

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

diff --git a/include/sfx2/docfile.hxx b/include/sfx2/docfile.hxx
index fb8039f6b8f1..f4a29a9414d9 100644
--- a/include/sfx2/docfile.hxx
+++ b/include/sfx2/docfile.hxx
@@ -200,6 +200,8 @@ public:
 // independent of later changes via SetOpenMode; used for SID_RELOAD:
 [[nodiscard]] bool IsOriginallyLoadedReadOnly() const;
 
+[[nodiscard]] bool IsRepairPackage() const;
+
 css::uno::Reference< css::io::XInputStream > const &  GetInputStream();
 
 voidCreateTempFile( bool bReplace = true );
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 670a27841414..fe1f5d0b773c 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -1764,6 +1764,12 @@ 
SfxMedium::TryEncryptedInnerPackage(uno::Reference const xStora
 return xRet;
 }
 
+bool SfxMedium::IsRepairPackage() const
+{
+const SfxBoolItem* pRepairItem = GetItemSet().GetItem(SID_REPAIRPACKAGE, 
false);
+return pRepairItem && pRepairItem->GetValue();
+}
+
 uno::Reference < embed::XStorage > SfxMedium::GetStorage( bool bCreateTempFile 
)
 {
 if ( pImpl->xStorage.is() || pImpl->m_bTriedStorage )
@@ -1784,8 +1790,7 @@ uno::Reference < embed::XStorage > SfxMedium::GetStorage( 
bool bCreateTempFile )
 if ( GetErrorIgnoreWarning() )
 return pImpl->xStorage;
 
-const SfxBoolItem* pRepairItem = GetItemSet().GetItem(SID_REPAIRPACKAGE, 
false);
-if ( pRepairItem && pRepairItem->GetValue() )
+if (IsRepairPackage())
 {
 // the storage should be created for repairing mode
 CreateTempFile( false );
@@ -1979,13 +1984,11 @@ uno::Reference 
SfxMedium::GetScriptingStorageToSign_Impl()
 SAL_WARN_IF(!pImpl->m_xODFDecryptedInnerPackageStream.is(), 
"sfx.doc", "no inner package stream?");
 if (pImpl->m_xODFDecryptedInnerPackageStream.is())
 {
-const SfxBoolItem* pRepairItem = 
GetItemSet().GetItem(SID_REPAIRPACKAGE, false);
-const bool bRepairPackage = pRepairItem && 
pRepairItem->GetValue();
 pImpl->m_xODFDecryptedInnerZipStorage =
 
::comphelper::OStorageHelper::GetStorageOfFormatFromInputStream(
 ZIP_STORAGE_FORMAT_STRING,
 
pImpl->m_xODFDecryptedInnerPackageStream->getInputStream(), {},
-bRepairPackage);
+IsRepairPackage());
 }
 }
 return pImpl->m_xODFDecryptedInnerZipStorage;
@@ -2006,21 +2009,19 @@ uno::Reference< embed::XStorage > const & 
SfxMedium::GetZipStorageToSign_Impl( b
 
 try
 {
-const SfxBoolItem* pRepairItem = 
GetItemSet().GetItem(SID_REPAIRPACKAGE, false);
-const bool bRepairPackage = pRepairItem && pRepairItem->GetValue();
 // we can not sign document if there is no stream
 // should it be possible at all?
 if ( !bReadOnly && pImpl->xStream.is() )
 {
 pImpl->m_xZipStorage = 
::comphelper::OStorageHelper::GetStorageOfFormatFromStream(
 ZIP_STORAGE_FORMAT_STRING, pImpl->xStream, 
css::embed::ElementModes::READWRITE,
-{}, bRepairPackage);
+{}, IsRepairPackage());
 }
 else if ( pImpl->xInputStream.is() )
 {
 pImpl->m_xZipStorage
 = 
::comphelper::OStorageHelper::GetStorageOfFormatFromInputStream(
-ZIP_STORAGE_FORMAT_STRING, pImpl->xInputStream, {}, 
bRepairPackage);
+ZIP_STORAGE_FORMAT_STRING, pImpl->xInputStream, {}, 
IsRepairPackage());
 }
 }
 catch( const uno::Exception& )
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 72e7f01e3d54..d7f417a9bcad 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -1957,9 +1957,7 @@ bool SfxObjectShell::IsContinueImportOnFilterExceptions()
 return false;
 }
 
-if (const SfxBoolItem* pRepairItem
-= pMedium->GetItemSet().GetItem(SID_REPAIRPACKAGE, false);
-pRepairItem && pRepairItem->GetValue())
+if (pMedium->IsRepairPackage())
 {
 

core.git: include/sfx2

2024-02-01 Thread Andrea Gelmini (via logerrit)
 include/sfx2/IDocumentModelAccessor.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 747c4c50f3d5a283dc61837675bbd3d42c661f78
Author: Andrea Gelmini 
AuthorDate: Thu Feb 1 11:50:37 2024 +0100
Commit: Julien Nabet 
CommitDate: Thu Feb 1 12:12:10 2024 +0100

Fix typo

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

diff --git a/include/sfx2/IDocumentModelAccessor.hxx 
b/include/sfx2/IDocumentModelAccessor.hxx
index 9980ce09992e..4572fc222345 100644
--- a/include/sfx2/IDocumentModelAccessor.hxx
+++ b/include/sfx2/IDocumentModelAccessor.hxx
@@ -28,7 +28,7 @@ struct SFX2_DLLPUBLIC CurrencyID
 /** Document model accessor, used to access parts of the document model.
  *
  * This is useful when some common parts of the model are needed, but can
- * only access the model indirecly from other modules that can access
+ * only access the model indirectly from other modules that can access
  * SfxObjectShell, but don't have a direct access to the document model
  * (and access through UNO would be inconvenient).
  *


core.git: include/sfx2 sc/Library_sc.mk sc/qa sc/source

2024-01-31 Thread Tomaž Vajngerl (via logerrit)
 include/sfx2/IDocumentModelAccessor.hxx |4 +
 sc/Library_sc.mk|1 
 sc/qa/unit/ucalc.cxx|   36 
 sc/source/ui/docshell/DocumentModelAccessor.cxx |   51 
 sc/source/ui/inc/DocumentModelAccessor.hxx  |   31 --
 5 files changed, 91 insertions(+), 32 deletions(-)

New commits:
commit 1276daee3d0d4f30ee8844b6df55d72e0b54093f
Author: Tomaž Vajngerl 
AuthorDate: Wed Jan 31 00:13:02 2024 +0900
Commit: Tomaž Vajngerl 
CommitDate: Thu Feb 1 05:00:07 2024 +0100

Currency pop-up: move getDocumentCurrencies to cxx, extend test

Test now checks that multiple cells with the same currency still
result in only one entry returned by getDocumentCurrencies.

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

diff --git a/include/sfx2/IDocumentModelAccessor.hxx 
b/include/sfx2/IDocumentModelAccessor.hxx
index d843a1b41ed8..9980ce09992e 100644
--- a/include/sfx2/IDocumentModelAccessor.hxx
+++ b/include/sfx2/IDocumentModelAccessor.hxx
@@ -11,9 +11,13 @@
 #pragma once
 
 #include 
+#include 
+#include 
+#include 
 
 namespace sfx
 {
+/** Currency ID, to identify the currency in the currency list */
 struct SFX2_DLLPUBLIC CurrencyID
 {
 OUString aSymbol;
diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk
index c8f5b77d0e43..91ffcced298b 100644
--- a/sc/Library_sc.mk
+++ b/sc/Library_sc.mk
@@ -444,6 +444,7 @@ $(eval $(call gb_Library_add_exception_objects,sc,\
 sc/source/ui/docshell/docsh6 \
 sc/source/ui/docshell/docsh8 \
 sc/source/ui/docshell/documentlinkmgr \
+sc/source/ui/docshell/DocumentModelAccessor \
 sc/source/ui/docshell/editable \
 sc/source/ui/docshell/externalrefmgr \
 sc/source/ui/docshell/impex \
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index be7f19f1d2b6..efd836c89190 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -6865,7 +6865,7 @@ CPPUNIT_TEST_FIXTURE(Test, 
testDocumentModelAccessor_getDocumentCurrencies)
 {
 m_pDoc->InsertTab(0, "Sheet1");
 
-// Check Document Currencies
+// Check document currencies - expect 0
 auto pAccessor = m_xDocShell->GetDocumentModelAccessor();
 CPPUNIT_ASSERT(pAccessor);
 CPPUNIT_ASSERT_EQUAL(size_t(0), pAccessor->getDocumentCurrencies().size());
@@ -6891,13 +6891,45 @@ CPPUNIT_TEST_FIXTURE(Test, 
testDocumentModelAccessor_getDocumentCurrencies)
 CPPUNIT_ASSERT_EQUAL(u"2,00€"_ustr, m_pDoc->GetString(ScAddress(0, 0, 
0)));
 }
 
-// Check Document Currencies Again
+// Check document currencies again
 auto aCurrencyIDs = pAccessor->getDocumentCurrencies();
 CPPUNIT_ASSERT_EQUAL(size_t(1), aCurrencyIDs.size());
 
 CPPUNIT_ASSERT_EQUAL(LANGUAGE_SLOVENIAN, aCurrencyIDs[0].eLanguage);
 CPPUNIT_ASSERT_EQUAL(u"-424"_ustr, aCurrencyIDs[0].aExtension);
 CPPUNIT_ASSERT_EQUAL(u"€"_ustr, aCurrencyIDs[0].aSymbol);
+
+// Set the same currency to 2 more cells
+{
+m_pDoc->SetValue(ScAddress(1, 1, 0), 5.0);
+m_pDoc->SetValue(ScAddress(2, 2, 0), 7.0);
+
+OUString aCode = u"#.##0,00[$€-424]"_ustr;
+
+sal_Int32 nCheckPos;
+SvNumFormatType eType;
+sal_uInt32 nFormat;
+
+m_pDoc->GetFormatTable()->PutEntry(aCode, nCheckPos, eType, nFormat, 
LANGUAGE_SLOVENIAN);
+CPPUNIT_ASSERT_EQUAL(SvNumFormatType::CURRENCY, eType);
+
+ScPatternAttr aNewAttrs(m_pDoc->getCellAttributeHelper());
+SfxItemSet& rSet = aNewAttrs.GetItemSet();
+rSet.Put(SfxUInt32Item(ATTR_VALUE_FORMAT, nFormat));
+m_pDoc->ApplyPattern(1, 1, 0, aNewAttrs); // B2.
+m_pDoc->ApplyPattern(2, 2, 0, aNewAttrs); // C3.
+
+CPPUNIT_ASSERT_EQUAL(u"5,00€"_ustr, m_pDoc->GetString(ScAddress(1, 1, 
0)));
+CPPUNIT_ASSERT_EQUAL(u"7,00€"_ustr, m_pDoc->GetString(ScAddress(2, 2, 
0)));
+}
+
+// Check document currencies again - should be 1 entry only
+aCurrencyIDs = pAccessor->getDocumentCurrencies();
+CPPUNIT_ASSERT_EQUAL(size_t(1), aCurrencyIDs.size());
+
+CPPUNIT_ASSERT_EQUAL(LANGUAGE_SLOVENIAN, aCurrencyIDs[0].eLanguage);
+CPPUNIT_ASSERT_EQUAL(u"-424"_ustr, aCurrencyIDs[0].aExtension);
+CPPUNIT_ASSERT_EQUAL(u"€"_ustr, aCurrencyIDs[0].aSymbol);
 }
 
 
diff --git a/sc/source/ui/docshell/DocumentModelAccessor.cxx 
b/sc/source/ui/docshell/DocumentModelAccessor.cxx
new file mode 100644
index ..0b7425c05d03
--- /dev/null
+++ b/sc/source/ui/docshell/DocumentModelAccessor.cxx
@@ -0,0 +1,51 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at 

core.git: include/sfx2 include/svx sc/qa sc/source sfx2/source svx/source

2024-01-31 Thread Tomaž Vajngerl (via logerrit)
 include/sfx2/IDocumentModelAccessor.hxx|   43 +++
 include/sfx2/objsh.hxx |8 ++-
 include/svx/tbcontrl.hxx   |9 +---
 sc/qa/unit/ucalc.cxx   |   40 ++
 sc/source/core/data/docpool.cxx|2 
 sc/source/ui/docshell/docsh.cxx|8 +++
 sc/source/ui/inc/DocumentModelAccessor.hxx |   63 +
 sc/source/ui/inc/docsh.hxx |1 
 sfx2/source/doc/objcont.cxx|6 ++
 svx/source/items/numfmtsh.cxx  |5 +-
 svx/source/tbxctrls/tbcontrl.cxx   |   59 +--
 11 files changed, 221 insertions(+), 23 deletions(-)

New commits:
commit 2cac2ee38445c19c9281f54c2b961bbc9149cc00
Author: Tomaž Vajngerl 
AuthorDate: Sat Jan 27 00:33:56 2024 +0900
Commit: Tomaž Vajngerl 
CommitDate: Thu Feb 1 02:47:56 2024 +0100

sc: put used currencies on top of the currency pop-up list

The list of currencies is fairly long and there is no easy way
to search the list, so to make it easier to concurrently fint the
desired currency, put the currencies that are used in the document
on top of the list.

This adds a DocumentModelAccessor class, which is used to access
parts of the document model from other modules throught the
SfxObjectShell.

Change-Id: I81a180b674ae69b373b0422f363678e8bab37194
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162638
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 
(cherry picked from commit 79da840fac78f11c156801c43d8b79d6d4f32869)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162755
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/sfx2/IDocumentModelAccessor.hxx 
b/include/sfx2/IDocumentModelAccessor.hxx
new file mode 100644
index ..d843a1b41ed8
--- /dev/null
+++ b/include/sfx2/IDocumentModelAccessor.hxx
@@ -0,0 +1,43 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#pragma once
+
+#include 
+
+namespace sfx
+{
+struct SFX2_DLLPUBLIC CurrencyID
+{
+OUString aSymbol;
+OUString aExtension;
+LanguageType eLanguage;
+};
+
+/** Document model accessor, used to access parts of the document model.
+ *
+ * This is useful when some common parts of the model are needed, but can
+ * only access the model indirecly from other modules that can access
+ * SfxObjectShell, but don't have a direct access to the document model
+ * (and access through UNO would be inconvenient).
+ *
+ * For example - get information about various parts of the document in
+ * generic dialogs (in CUI).
+ */
+class SFX2_DLLPUBLIC IDocumentModelAccessor
+{
+public:
+virtual std::vector getDocumentCurrencies() const { return {}; 
}
+virtual ~IDocumentModelAccessor() = default;
+};
+
+} // end sfx namespace
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index 20e497b6e4af..3175cb283642 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -89,8 +89,11 @@ namespace sfx2
 {
 class SvLinkSource;
 class StyleManager;
+class IXmlIdRegistry;
 }
 
+namespace sfx { class IDocumentModelAccessor; }
+
 namespace com::sun::star::awt { class XWindow; }
 namespace com::sun::star::beans { struct PropertyValue; }
 namespace com::sun::star::document { struct CmisVersion; }
@@ -107,8 +110,6 @@ namespace com::sun::star::task { class XInteractionHandler; 
}
 namespace com::sun::star::lang { class XComponent; }
 namespace com::sun::star::text { class XTextRange; }
 
-namespace sfx2 { class IXmlIdRegistry; }
-
 #define SFX_TITLE_TITLE0
 #define SFX_TITLE_FILENAME 1
 #define SFX_TITLE_FULLNAME 2
@@ -574,7 +575,8 @@ public:
 std::optional GetRecentColor(sal_uInt16 nSlotId);
 void SetRecentColor(sal_uInt16 nSlotId, const NamedColor& rColor);
 
-virtual std::set GetDocColors();
+virtual std::shared_ptr 
GetDocumentModelAccessor() const;
+virtual std::set GetDocColors();
 virtual std::shared_ptr GetThemeColors();
 
 // Accessibility Check
diff --git a/include/svx/tbcontrl.hxx b/include/svx/tbcontrl.hxx
index 9fffced835cb..f930d46b208d 100644
--- a/include/svx/tbcontrl.hxx
+++ b/include/svx/tbcontrl.hxx
@@ -146,10 +146,8 @@ class SfxStyleSheetBasePool;
 class SfxTemplateItem;
 class PaletteManager;
 
-namespace svx
-{
-class ToolboxButtonColorUpdaterBase;
-}
+namespace svx { class ToolboxButtonColorUpdaterBase; }
+namespace sfx { struct CurrencyID; }
 
 class SvxStyleToolBoxControl final : public 
cppu::ImplInheritanceHelper
@@ -264,7 +262,8 @@ public:
 * 

core.git: include/sfx2 include/svl include/test include/tools include/vcl

2024-01-29 Thread Keldin Maldonado (KNM) (via logerrit)
 include/sfx2/linkmgr.hxx   |5 +
 include/sfx2/linksrc.hxx   |4 +---
 include/sfx2/lokcomponenthelpers.hxx   |5 +
 include/sfx2/mailmodelapi.hxx  |5 +
 include/sfx2/mieclip.hxx   |5 +
 include/sfx2/module.hxx|5 +
 include/sfx2/msg.hxx   |5 +
 include/sfx2/new.hxx   |5 +
 include/sfx2/objface.hxx   |5 +
 include/sfx2/opengrf.hxx   |5 +
 include/sfx2/passwd.hxx|5 +
 include/sfx2/printopt.hxx  |5 +
 include/sfx2/sfxhtml.hxx   |6 +-
 include/sfx2/sfxuno.hxx|5 +
 include/sfx2/viewfac.hxx   |5 +
 include/svl/filenotation.hxx   |6 +-
 include/test/sheet/xsheetlinkable.hxx  |5 +
 include/test/sheet/xsheetpagebreak.hxx |5 +
 include/test/table/xcell.hxx   |5 +
 include/tools/zcodec.hxx   |5 +
 include/vcl/imapobj.hxx|5 +
 include/vcl/imappoly.hxx   |5 +
 include/vcl/imaprect.hxx   |5 +
 include/vcl/inputctx.hxx   |5 +
 include/vcl/introwin.hxx   |5 +
 include/vcl/jobset.hxx |5 +
 include/vcl/keycod.hxx |5 +
 include/vcl/keycodes.hxx   |5 +
 include/vcl/layout.hxx |5 +
 include/vcl/lazydelete.hxx |4 +---
 30 files changed, 30 insertions(+), 120 deletions(-)

New commits:
commit 405e3f8815d9117d3f6d93ac4d0031e308a284f0
Author: Keldin Maldonado (KNM) 
AuthorDate: Sun Jan 28 21:12:54 2024 -0800
Commit: Ilmari Lauhakangas 
CommitDate: Mon Jan 29 10:30:01 2024 +0100

tdf#143148 use pragma once instead of include guards

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

diff --git a/include/sfx2/linkmgr.hxx b/include/sfx2/linkmgr.hxx
index 8a54e288..af6be44f58b1 100644
--- a/include/sfx2/linkmgr.hxx
+++ b/include/sfx2/linkmgr.hxx
@@ -16,8 +16,7 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
-#ifndef INCLUDED_SFX2_LINKMGR_HXX
-#define INCLUDED_SFX2_LINKMGR_HXX
+#pragma once
 
 #include 
 #include 
@@ -182,6 +181,4 @@ SFX2_DLLPUBLIC void MakeLnkName( OUString& rName,
 
 }
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/linksrc.hxx b/include/sfx2/linksrc.hxx
index bac48b18589e..7fc3eaf42415 100644
--- a/include/sfx2/linksrc.hxx
+++ b/include/sfx2/linksrc.hxx
@@ -16,8 +16,7 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
-#ifndef INCLUDED_SFX2_LINKSRC_HXX
-#define INCLUDED_SFX2_LINKSRC_HXX
+#pragma once
 
 #include 
 #include 
@@ -114,6 +113,5 @@ public:
 typedef tools::SvRef SvLinkSourceRef;
 
 }
-#endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/lokcomponenthelpers.hxx 
b/include/sfx2/lokcomponenthelpers.hxx
index c76067bc1330..6a8c05fcfd70 100644
--- a/include/sfx2/lokcomponenthelpers.hxx
+++ b/include/sfx2/lokcomponenthelpers.hxx
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_SFX2_LOKCHARTHELPER_HXX
-#define INCLUDED_SFX2_LOKCHARTHELPER_HXX
+#pragma once
 
 #include 
 #include 
@@ -94,6 +93,4 @@ private:
 VclPtr mpWidgetWindow;
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/mailmodelapi.hxx b/include/sfx2/mailmodelapi.hxx
index 47d5b408659f..78438ff22483 100644
--- a/include/sfx2/mailmodelapi.hxx
+++ b/include/sfx2/mailmodelapi.hxx
@@ -16,8 +16,7 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
-#ifndef INCLUDED_SFX2_MAILMODELAPI_HXX
-#define INCLUDED_SFX2_MAILMODELAPI_HXX
+#pragma once
 
 #include 
 #include 
@@ -99,6 +98,4 @@ public:
 
 bool CreateFromAddress_Impl( OUString& rFrom );
 
-#endif // INCLUDED_SFX2_MAILMODELAPI_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/mieclip.hxx b/include/sfx2/mieclip.hxx
index bc2a431b3a24..4d1256ba6da2 100644
--- a/include/sfx2/mieclip.hxx
+++ b/include/sfx2/mieclip.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_SFX2_MIECLIP_HXX
-#define INCLUDED_SFX2_MIECLIP_HXX
+#pragma once
 
 #include 
 #include 
@@ -38,6 +37,4 @@ public:
 SvStream* IsValid(SvStream&);
 };
 
-#endif // INCLUDED_SFX2_MIECLIP_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff 

core.git: include/sfx2 sc/source sd/source sfx2/source sw/source

2024-01-11 Thread Szymon Kłos (via logerrit)
 include/sfx2/lokhelper.hxx |2 +-
 sc/source/filter/html/htmlpars.cxx |2 +-
 sc/source/ui/drawfunc/fuins1.cxx   |   11 +++
 sd/source/ui/func/fuinsert.cxx |   14 +-
 sfx2/source/view/lokhelper.cxx |4 ++--
 sw/source/filter/html/htmlgrin.cxx |2 +-
 sw/source/uibase/uiview/view2.cxx  |   10 ++
 7 files changed, 39 insertions(+), 6 deletions(-)

New commits:
commit 40c94cff178bd4bef4dc5ce38cc9eb67fe2eb780
Author: Szymon Kłos 
AuthorDate: Tue Dec 19 19:24:19 2023 +0100
Commit: Szymon Kłos 
CommitDate: Thu Jan 11 12:23:27 2024 +0100

lok: send error on access denied in image import 2

followup for commit 64624d225c71229acce4f889d4863d7c29c52658
lok: send error on access denied in image import

It shows an error in LOK when we try to insert image
from remote host blocked by HostFilter

Previously it was showing error in paste case,
now do the same also on image insertion.

For now disable HandleGraphicFilterError in sd, as it
crashes, is synchronous and cannot be easily fixed
- dialog sits inside module not linked to sfx2, needs
some rework.

Change-Id: I3c15ff5621add97ef9d60d4f4c1305dae2909158
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161001
Tested-by: Jenkins CollaboraOffice 
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161774
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 

diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx
index dc9558a31f0f..8ca9ce80da08 100644
--- a/include/sfx2/lokhelper.hxx
+++ b/include/sfx2/lokhelper.hxx
@@ -227,7 +227,7 @@ public:
 static VclPtr getInPlaceDocWindow(SfxViewShell* pViewShell);
 
 /// Sends Network Access error to LOK
-static void sendNetworkAccessError();
+static void sendNetworkAccessError(std::string_view rAction);
 
 static void notifyLog(const std::ostringstream& stream);
 
diff --git a/sc/source/filter/html/htmlpars.cxx 
b/sc/source/filter/html/htmlpars.cxx
index 10d31fc84cd4..43ff3cca2de5 100644
--- a/sc/source/filter/html/htmlpars.cxx
+++ b/sc/source/filter/html/htmlpars.cxx
@@ -1325,7 +1325,7 @@ void ScHTMLLayoutParser::Image( HtmlImportInfo* pInfo )
 {
 INetURLObject aURL(pImage->aURL);
 if (HostFilter::isForbidden(aURL.GetHost()))
-SfxLokHelper::sendNetworkAccessError();
+SfxLokHelper::sendNetworkAccessError("paste");
 }
 
 sal_uInt16 nFormat;
diff --git a/sc/source/ui/drawfunc/fuins1.cxx b/sc/source/ui/drawfunc/fuins1.cxx
index 72886789b448..9b51a62c5b2a 100644
--- a/sc/source/ui/drawfunc/fuins1.cxx
+++ b/sc/source/ui/drawfunc/fuins1.cxx
@@ -22,6 +22,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -48,6 +49,9 @@
 #include 
 #include 
 
+#include 
+#include 
+
 #include 
 #include 
 #include 
@@ -279,6 +283,13 @@ FuInsertGraphic::FuInsertGraphic( ScTabViewShell&   
rViewSh,
 if ( pReqArgs->GetItemState( FN_PARAM_1, true,  ) == 
SfxItemState::SET )
 bAsLink = static_cast(pItem)->GetValue();
 
+if (comphelper::LibreOfficeKit::isActive())
+{
+INetURLObject aURL(aFileName);
+if (INetProtocol::File != aURL.GetProtocol() && 
HostFilter::isForbidden(aURL.GetHost()))
+SfxLokHelper::sendNetworkAccessError("insert");
+}
+
 Graphic aGraphic;
 ErrCode nError = GraphicFilter::LoadGraphic( aFileName, aFilterName, 
aGraphic, ::GetGraphicFilter() );
 if ( nError == ERRCODE_NONE )
diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx
index 31b286c822e3..e8409c815b25 100644
--- a/sd/source/ui/func/fuinsert.cxx
+++ b/sd/source/ui/func/fuinsert.cxx
@@ -36,6 +36,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -60,6 +61,9 @@
 #include 
 #include 
 
+#include 
+#include 
+
 #include 
 #include 
 #include 
@@ -129,6 +133,13 @@ void FuInsertGraphic::DoExecute( SfxRequest& rReq )
 if ( pArgs->GetItemState( FN_PARAM_1, true,  ) == 
SfxItemState::SET )
 bAsLink = static_cast(pItem)->GetValue();
 
+if (comphelper::LibreOfficeKit::isActive())
+{
+INetURLObject aURL(aFileName);
+if (INetProtocol::File != aURL.GetProtocol() && 
HostFilter::isForbidden(aURL.GetHost()))
+SfxLokHelper::sendNetworkAccessError("insert");
+}
+
 nError = GraphicFilter::LoadGraphic( aFileName, aFilterName, aGraphic, 
::GetGraphicFilter() );
 }
 else
@@ -188,8 +199,9 @@ void FuInsertGraphic::DoExecute( SfxRequest& rReq )
 }
 }
 }
-else
+else if (!comphelper::LibreOfficeKit::isActive())
 {
+// TODO: enable in LOK, it contains synchronous error window without 
LOKNotifier
 SdGRFFilter::HandleGraphicFilterError( nError, 

core.git: include/sfx2 sc/source sfx2/source sw/source

2024-01-11 Thread Szymon Kłos (via logerrit)
 include/sfx2/lokhelper.hxx |3 +++
 sc/source/filter/html/htmlpars.cxx |   10 ++
 sfx2/source/view/lokhelper.cxx |   17 +
 sw/source/filter/html/htmlgrin.cxx |6 ++
 4 files changed, 36 insertions(+)

New commits:
commit 0f8ef44c919a59755a5b8cb2f9bd95b4ad538f82
Author: Szymon Kłos 
AuthorDate: Mon Dec 4 18:36:29 2023 +0100
Commit: Szymon Kłos 
CommitDate: Thu Jan 11 09:09:17 2024 +0100

lok: send error on access denied in image import

- when we paste HTML with references to external images
  and host filter is configured then we have empty graphics
- inform client about that so we can show an error to the user

Change-Id: I7d584c256d8d004955c970056341ab42864d1dd3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160319
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Caolán McNamara 
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161773
Tested-by: Jenkins

diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx
index dc144503b8dd..338dda192b8c 100644
--- a/include/sfx2/lokhelper.hxx
+++ b/include/sfx2/lokhelper.hxx
@@ -226,6 +226,9 @@ public:
 
 static VclPtr getInPlaceDocWindow(SfxViewShell* pViewShell);
 
+/// Sends Network Access error to LOK
+static void sendNetworkAccessError();
+
 static void notifyLog(const std::ostringstream& stream);
 
 private:
diff --git a/sc/source/filter/html/htmlpars.cxx 
b/sc/source/filter/html/htmlpars.cxx
index f5f890081592..10d31fc84cd4 100644
--- a/sc/source/filter/html/htmlpars.cxx
+++ b/sc/source/filter/html/htmlpars.cxx
@@ -20,6 +20,7 @@
 #include 
 #include 
 
+#include 
 #include 
 
 #include 
@@ -37,6 +38,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -47,6 +49,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1318,6 +1321,13 @@ void ScHTMLLayoutParser::Image( HtmlImportInfo* pInfo )
 return ;
 }
 
+if (comphelper::LibreOfficeKit::isActive())
+{
+INetURLObject aURL(pImage->aURL);
+if (HostFilter::isForbidden(aURL.GetHost()))
+SfxLokHelper::sendNetworkAccessError();
+}
+
 sal_uInt16 nFormat;
 std::optional oGraphic(std::in_place);
 GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter();
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index 4bebd7d1dc50..7cfe51426bce 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -37,6 +37,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -1077,4 +1078,20 @@ VclPtr 
SfxLokHelper::getInPlaceDocWindow(SfxViewShell* pViewShell)
 return {};
 }
 
+void SfxLokHelper::sendNetworkAccessError()
+{
+tools::JsonWriter aWriter;
+aWriter.put("code", static_cast(
+ErrCode(ErrCodeArea::Inet, sal_uInt16(ErrCodeClass::Access;
+aWriter.put("kind", "network");
+aWriter.put("cmd", "paste");
+
+SfxViewShell* pViewShell = SfxViewShell::Current();
+if (pViewShell)
+{
+pViewShell->libreOfficeKitViewCallback(
+LOK_CALLBACK_ERROR, aWriter.finishAndGetAsOString());
+}
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/html/htmlgrin.cxx 
b/sw/source/filter/html/htmlgrin.cxx
index 2b30c167bfe0..8304fa3002f3 100644
--- a/sw/source/filter/html/htmlgrin.cxx
+++ b/sw/source/filter/html/htmlgrin.cxx
@@ -19,6 +19,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -34,6 +35,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -69,6 +71,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -509,6 +512,9 @@ IMAGE_SETEVENT:
 }
 else if (m_sBaseURL.isEmpty() || !aGraphicData.isEmpty())
 {
+if (comphelper::LibreOfficeKit::isActive() && 
HostFilter::isForbidden(aGraphicURL.GetHost()))
+SfxLokHelper::sendNetworkAccessError();
+
 // sBaseURL is empty if the source is clipboard
 // aGraphicData is non-empty for  -> not a linked 
graphic.
 if (ERRCODE_NONE == 
GraphicFilter::GetGraphicFilter().ImportGraphic(aGraphic, aGraphicURL))


core.git: include/sfx2 sc/qa sfx2/source

2024-01-07 Thread Miklos Vajna (via logerrit)
 include/sfx2/bindings.hxx|1 
 sc/qa/unit/tiledrendering/tiledrendering.cxx |   56 +++
 sfx2/source/control/bindings.cxx |   28 +
 sfx2/source/control/unoctitm.cxx |   21 +-
 4 files changed, 105 insertions(+), 1 deletion(-)

New commits:
commit 51d8a2ef54751403fa707816e27ddb4e7faa8231
Author: Miklos Vajna 
AuthorDate: Fri Jan 5 16:51:42 2024 +0100
Commit: Miklos Vajna 
CommitDate: Mon Jan 8 08:27:18 2024 +0100

cool#7492 sfx2 lok: fix bad view id / statusbar string on async binding 
update

With two Calc views (first is an English one, second is a German one),
type in the English view and in parallel to that, create a cell
selection in the German view. Sometimes the status bar update about the
selected cells arrives in English, in the German view.

The root of the problem is that SfxBindings has a timer that does the
expensive update of all the UNO commands only after a delay, but by the
time this timer runs, possibly the current view is no longer the German
one, which leads to English strings in the German view.

Fix the problem somewhat similar to what commit
ee7ca8e4ea8ed93655f99e77a9e77032ac830c46 (cool#7865 sfx2 lok: fix bad
view id on async command dispatch, 2023-12-20) did in
SfxHintPoster::DoEvent_Impl() by restoring the original view for the
duration of the timer job execution.

The test works even in case '--with-lang=en-US de' is not used, because
it asserts the locale, which is not downgraded to English when
translations are not available. This required turning the payload of the
.uno:RowColSelCount status update into JSON, which is meant to be mostly
backwards-compatible, given that we already have a mix of plain text and
JSON for the various UNO commands. Another trouble is that the
SfxBindings lazy update is a timer, so processing idles won't help and
sleeping in test code is not ideal, either. Solve that by exposing the
timer of SfxBindings, so test code can explicitly invoke the timer
without waiting.

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

diff --git a/include/sfx2/bindings.hxx b/include/sfx2/bindings.hxx
index 8cd92a24108d..2b85b4dbd065 100644
--- a/include/sfx2/bindings.hxx
+++ b/include/sfx2/bindings.hxx
@@ -188,6 +188,7 @@ public:
 SAL_DLLPRIVATE void SetRecorder_Impl( css::uno::Reference< 
css::frame::XDispatchRecorder > const & );
 SAL_DLLPRIVATE void InvalidateSlotsInMap_Impl();
 SAL_DLLPRIVATE void AddSlotToInvalidateSlotsMap_Impl( sal_uInt16 nId );
+Timer& GetTimer();
 };
 
 #ifdef DBG_UTIL
diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx 
b/sc/qa/unit/tiledrendering/tiledrendering.cxx
index 5548dc06fbdf..25d1258c21d3 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -16,6 +16,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -26,6 +27,8 @@
 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -437,6 +440,7 @@ public:
 OString m_sInvalidateSheetGeometry;
 OString m_aHyperlinkClicked;
 OString m_ShapeSelection;
+std::map m_aStateChanges;
 TestLokCallbackWrapper m_callbackWrapper;
 
 ViewCallback(bool bDeleteListenerOnDestruct=true)
@@ -581,6 +585,16 @@ public:
 {
 m_aTextSelectionResult.parseMessage(pPayload);
 }
+break;
+case LOK_CALLBACK_STATE_CHANGED:
+{
+std::stringstream aStream(pPayload);
+boost::property_tree::ptree aTree;
+boost::property_tree::read_json(aStream, aTree);
+std::string aCommandName = aTree.get("commandName");
+m_aStateChanges[aCommandName] = aTree;
+}
+break;
 }
 }
 };
@@ -3184,6 +3198,48 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, 
testInvalidateForSplitPanes)
 CPPUNIT_ASSERT_MESSAGE("The cell visible in the bottom left pane should be 
redrawn", bFoundBottomLeftPane);
 }
 
+CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testStatusBarLocale)
+{
+// Given 2 views, the second's locale is set to German:
+createDoc("empty.ods");
+int nView1 = SfxLokHelper::getView();
+ViewCallback aView1;
+SfxLokHelper::createView();
+ViewCallback aView2;
+SfxViewShell* pView2 = SfxViewShell::Current();
+pView2->SetLOKLocale("de-DE");
+{
+SfxViewFrame& rFrame = pView2->GetViewFrame();
+SfxSlotPool& rSlotPool = SfxSlotPool::GetSlotPool();
+uno::Reference 
xParser(util::URLTransformer::create(m_xContext));
+util::URL aCommandURL;
+aCommandURL.Complete = ".uno:RowColSelCount";
+xParser->parseStrict(aCommandURL);
+const SfxSlot* pSlot 

core.git: include/sfx2 sc/source sfx2/source

2023-12-21 Thread Matt K (via logerrit)
 include/sfx2/childwin.hxx   |2 +-
 sc/source/ui/inc/ChildWindowWrapper.hxx |2 +-
 sc/source/ui/inc/reffact.hxx|2 +-
 sc/source/ui/inc/tabvwsh.hxx|2 +-
 sc/source/ui/view/reffact.cxx   |3 ++-
 sc/source/ui/view/tabvwshc.cxx  |7 +--
 sfx2/source/appl/childwin.cxx   |3 ++-
 7 files changed, 13 insertions(+), 8 deletions(-)

New commits:
commit e760dcf43052212952191ccdadbfb677fea3b5b8
Author: Matt K 
AuthorDate: Tue Dec 12 20:16:12 2023 -0600
Commit: Caolán McNamara 
CommitDate: Thu Dec 21 21:17:42 2023 +0100

tdf#153690 Prevent invisible dialogs in Calc Full Screen

This change just adds the flag "SfxChildWindowFlags::NEVERHIDE"
to the info passed around so that the dialogs are not treated as
invisible when executing SfxWorkWindow::ShowChildren_Impl.

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

diff --git a/include/sfx2/childwin.hxx b/include/sfx2/childwin.hxx
index 568abf3f2e21..ff12fe30b3d0 100644
--- a/include/sfx2/childwin.hxx
+++ b/include/sfx2/childwin.hxx
@@ -136,7 +136,7 @@ public:
 
 static void RegisterChildWindow(SfxModule*, const 
SfxChildWinFactory&);
 
-static std::unique_ptr CreateChildWindow( sal_uInt16, 
vcl::Window*, SfxBindings*, SfxChildWinInfo const &);
+static std::unique_ptr CreateChildWindow( sal_uInt16, 
vcl::Window*, SfxBindings*, SfxChildWinInfo &);
 voidSetHideNotDelete( bool bOn );
 boolIsHideNotDelete() const;
 boolIsVisible() const;
diff --git a/sc/source/ui/inc/ChildWindowWrapper.hxx 
b/sc/source/ui/inc/ChildWindowWrapper.hxx
index 5fb038df27dd..926e456c87ce 100644
--- a/sc/source/ui/inc/ChildWindowWrapper.hxx
+++ b/sc/source/ui/inc/ChildWindowWrapper.hxx
@@ -22,7 +22,7 @@ class ChildControllerWrapper : public SfxChildWindow
 {
 public:
 ChildControllerWrapper(vcl::Window* pParentP, sal_uInt16 nId,
-   SfxBindings* pBindings, const SfxChildWinInfo* 
pInfo)
+   SfxBindings* pBindings, SfxChildWinInfo* pInfo)
 : SfxChildWindow(pParentP, nId)
 {
 ScTabViewShell* pViewShell = getTabViewShell( pBindings );
diff --git a/sc/source/ui/inc/reffact.hxx b/sc/source/ui/inc/reffact.hxx
index 4fbe965c15d9..de001354bda8 100644
--- a/sc/source/ui/inc/reffact.hxx
+++ b/sc/source/ui/inc/reffact.hxx
@@ -28,7 +28,7 @@
 class Class : public SfxChildWindow
 \
 {  
 \
 public:
 \
-Class( vcl::Window*, sal_uInt16, SfxBindings*, const SfxChildWinInfo* 
); \
+Class( vcl::Window*, sal_uInt16, SfxBindings*, SfxChildWinInfo* ); \
 SFX_DECL_CHILDWINDOW_WITHID(Class);
 \
 };
 
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index 1b80b0ab2f25..47c5c46e1bb0 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -356,7 +356,7 @@ public:
 static ScTabViewShell* GetActiveViewShell();
 
 std::shared_ptr 
CreateRefDialogController(SfxBindings* pB, SfxChildWindow* pCW,
-const SfxChildWinInfo* 
pInfo,
+SfxChildWinInfo* pInfo,
 weld::Window* pParent, 
sal_uInt16 nSlotId);
 
 voidUpdateOleZoom();
diff --git a/sc/source/ui/view/reffact.cxx b/sc/source/ui/view/reffact.cxx
index 3834e3b8c33f..999f0402d0a6 100644
--- a/sc/source/ui/view/reffact.cxx
+++ b/sc/source/ui/view/reffact.cxx
@@ -67,7 +67,7 @@ namespace
 Class::Class( vcl::Window*   pParentP,   \
 sal_uInt16  nId,\
 SfxBindings*p,  \
-const SfxChildWinInfo*  pInfo ) \
+SfxChildWinInfo*  pInfo ) \
 : SfxChildWindow(pParentP, nId) \
 {   \
 
//\
@@ -227,6 +227,7 @@ ScAcceptChgDlgWrapper::ScAcceptChgDlgWrapper(vcl::Window* 
pParentP,
 {
 auto xDlg = std::make_shared(pBindings, this, 
pParentP->GetFrameWeld(), >GetViewData());
 SetController(xDlg);
+pInfo->nFlags = SfxChildWindowFlags::NEVERHIDE;
 xDlg->Initialize( pInfo );
 }
 else
diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx

core.git: include/sfx2 sc/source sd/source sfx2/source

2023-12-20 Thread Miklos Vajna (via logerrit)
 include/sfx2/lokhelper.hxx  |2 ++
 include/sfx2/request.hxx|5 +
 sc/source/core/data/global.cxx  |   11 +--
 sd/source/ui/view/viewshel.cxx  |   15 ++-
 sfx2/source/control/request.cxx |   11 +++
 sfx2/source/notify/hintpost.cxx |   37 +
 sfx2/source/view/lokhelper.cxx  |   11 +++
 7 files changed, 81 insertions(+), 11 deletions(-)

New commits:
commit ee7ca8e4ea8ed93655f99e77a9e77032ac830c46
Author: Miklos Vajna 
AuthorDate: Wed Dec 20 16:12:12 2023 +0100
Commit: Miklos Vajna 
CommitDate: Wed Dec 20 22:37:32 2023 +0100

cool#7865 sfx2 lok: fix bad view id on async command dispatch

If you try hard enough, it's possible to request an "add conditional
format" dialog in one view and have the dialog pop up in an other view.
This is related to cool#7853 but it focuses on the wider problem.

What happens is that sometimes we do want to execute an uno command in
an async way, e.g. one dialog opening an other dialog in its response
handler: making sure the dialog is not manually / synchronously spinning
the main loop while it's running is wanted. Also fixing each & every
async command dispatch manually would be a lot of work.

Fix the problem by remembering the current view in SfxHintPoster::Post()
as it posts events to the main loop and restoring that view if necessary
in SfxHintPoster::DoEvent_Impl().

Other comments:

- An alternative would be to just dispatch all these UNO commands
  synchronously, but see above, there are cases where we want to stay
  async, a nested main loop would be worse.

- An even more general fix would be to handle all calls to
  Application::PostUserEvent(), but vcl doesn't know what is the
  current view and would have trouble switching to that view (only sfx2
  and higher up knows that), so do this only at a SfxHintPoster::Post()
  level, this is already meant to fix all async uno commands.

- There was a single case in sd/ where we tried to dispatch an async
  event while switching views, so switch to a sync command dispatch
  there to avoid the problem. CppunitTest_sd_tiledrendering would hang
  without this and would emit a warning in SfxHintPoster::Post().

- Restore the sc/ code to do its async dispatch as it used to, so now
  CppunitTest_sc_tiledrendering's testOpenURL is a test case that covers
  this change.

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

diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx
index 98eeccb74476..dc144503b8dd 100644
--- a/include/sfx2/lokhelper.hxx
+++ b/include/sfx2/lokhelper.hxx
@@ -93,6 +93,8 @@ public:
 static void destroyView(int nId);
 /// Set a view shell as current one.
 static void setView(int nId);
+/// Determines if a call to setView() is in progress or not.
+static bool isSettingView();
 /// Set the edit mode for a document with callbacks disabled.
 static void setEditMode(int nMode, vcl::ITiledRenderable* pDoc);
 /// Get view shell with id
diff --git a/include/sfx2/request.hxx b/include/sfx2/request.hxx
index 5c7db9925560..16c1ad8c7273 100644
--- a/include/sfx2/request.hxx
+++ b/include/sfx2/request.hxx
@@ -119,6 +119,11 @@ public:
 /** Return the window that should be used as the parent for any dialogs 
this request creates
 */
 weld::Window* GetFrameWeld() const;
+
+void SetLokViewId(int nId);
+
+int GetLokViewId() const;
+
 private:
 const SfxRequest&   operator=(const SfxRequest &) = delete;
 };
diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index 15fdc7dfb39d..29a616c6b6e8 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -879,17 +879,8 @@ void ScGlobal::OpenURL(const OUString& rURL, const 
OUString& rTarget, bool bIgno
 SfxBoolItem aBrowsing( SID_BROWSE, true );
 
 // No SID_SILENT anymore
-SfxCallMode nCall = SfxCallMode::RECORD;
-if (comphelper::LibreOfficeKit::isActive())
-{
-nCall |= SfxCallMode::SYNCHRON;
-}
-else
-{
-nCall |= SfxCallMode::ASYNCHRON;
-}
 pViewFrm->GetDispatcher()->ExecuteList(SID_OPENDOC,
-nCall,
+SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
 { , , , , ,  });
 }
 
diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx
index 09c1f95102f9..2ed4099fc5d9 100644
--- a/sd/source/ui/view/viewshel.cxx
+++ b/sd/source/ui/view/viewshel.cxx
@@ -307,10 +307,23 @@ void ViewShell::Activate(bool bIsMDIActivate)
 // thus, the Navigator will also get a current status
 SfxBoolItem aItem( SID_NAVIGATOR_INIT, true );
 if (GetDispatcher() != nullptr)
+{
+

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

2023-12-18 Thread Miklos Vajna (via logerrit)
 include/sfx2/viewsh.hxx  |4 
 sfx2/source/view/viewfrm.cxx |2 ++
 sw/inc/view.hxx  |9 ++---
 sw/qa/uibase/uiview/uiview.cxx   |   19 +++
 sw/source/uibase/uiview/view.cxx |8 +++-
 5 files changed, 38 insertions(+), 4 deletions(-)

New commits:
commit 164fb25f7b2db7d833d6d0f28e49c5cac68426b3
Author: Miklos Vajna 
AuthorDate: Mon Dec 18 17:21:15 2023 +0100
Commit: Miklos Vajna 
CommitDate: Mon Dec 18 18:13:54 2023 +0100

tdf#158686 sw floattable: fix print preview crash

Regression from commit b8521d969ab5be4fc947e467d4afe969f9d3b563
(tdf#157263 sw floattable: prefer join over split after moving fwd,
2023-09-25), enabling Options -> Writer -> Formatting Aids -> Hidden
Characters, then opening the bugdoc, finally Toggle Print Preview on the
toolbar resulted in a crash.

We have a memory corruption here:

==11968==ERROR: AddressSanitizer: heap-use-after-free on address 
0x60f734e0 at pc 0x7f473822d2ee bp 0x7fffdadd3660 sp 0x7fffdadd3658
READ of size 8 at 0x60f734e0 thread T0
#0 0x7f473822d2ed in rtl::Reference::operator->() 
const /include/rtl/ref.hxx:216:9
#1 0x7f473821feeb in FmFormShell::IsActiveControl() const 
/svx/source/form/fmshell.cxx:1227:12
#2 0x7f46dad4d52a in SwView::SelectShell() 
/sw/source/uibase/uiview/view.cxx:296:40
#3 0x7f46dad496a6 in SwView::AttrChangedNotify(LinkParamNone*) 
/sw/source/uibase/uiview/view.cxx:572:13
...
#32 0x7f4748944cda in 
SfxViewFrame::SwitchToViewShell_Impl(unsigned short, bool) 
/sfx2/source/view/viewfrm.cxx:2552:32
#33 0x7f47488f4e3b in SfxViewFrame::ExecView_Impl(SfxRequest&) 
/sfx2/source/view/viewfrm.cxx:2637:29
freed by thread T0 here:
#0 0x5568ff2f9a7b in operator delete(void*, unsigned long) 
/home/abuild/rpmbuild/BUILD/llvm-15.0.7.src/build/../projects/compiler-rt/lib/asan/asan_new_delete.cpp:164:3
#1 0x7f4738214346 in FmFormShell::~FmFormShell() 
/svx/source/form/fmshell.cxx:181:1
#2 0x7f4746b04b9d in SfxDispatcher::FlushImpl() 
/sfx2/source/control/dispatch.cxx:1412:13
#3 0x7f4746aff767 in SfxDispatcher::Flush() 
/sfx2/source/control/dispatch.cxx:157:26
#4 0x7f47489100dc in 
SfxViewFrame::PopShellAndSubShells_Impl(SfxViewShell&) 
/sfx2/source/view/viewfrm.cxx:1100:24
#5 0x7f47489441a3 in 
SfxViewFrame::SwitchToViewShell_Impl(unsigned short, bool) 
/sfx2/source/view/viewfrm.cxx:2538:13
#6 0x7f47488f4e3b in SfxViewFrame::ExecView_Impl(SfxRequest&) 
/sfx2/source/view/viewfrm.cxx:2637:29

I.e. a new SwPagePreview replaces the old SwView, but the order is that
SfxViewFrame::SwitchToViewShell_Impl() starts with deleting the
SfxShells of the old SwView in PopShellAndSubShells_Impl(), then it
creates the new shell, finally deletes the old shell. Given that the new
shell hides hidden characters and the old shell did not, this triggers a
size notification for the half-deleted old shell and we crash.

Seeing that SwView::AttrChangedNotify() already had code to delay the
selection of an SfxShell in the old SwView, fix the problem by
introducing a new flag that allows not selecting an SfxShell at all if
the old view is known to be deleted in the near future anyway.

An alternative would be to make sure that all relevant pointers are
maintained using an SfxBroadcaster / SfxListener protocol, but after
fixing some 4 of them and that's still not enough, probably it's better
to handle this at a higher level. It's also a bit unclear how this
"worked" in the past; looks like the old view didn't get the size change
notification by accident.

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

diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx
index fff558ba28a4..0cbadc5072dc 100644
--- a/include/sfx2/viewsh.hxx
+++ b/include/sfx2/viewsh.hxx
@@ -227,6 +227,10 @@ public:
 SfxViewShell( SfxViewFrame& rFrame, 
SfxViewShellFlags nFlags );
 virtual ~SfxViewShell() override;
 
+/// Informs the view shell that it'll be deleted before the main loop 
processes the next user
+/// input.
+virtual void SetDying() {}
+
 SfxInPlaceClient*   GetIPClient() const;
 SfxInPlaceClient*   GetUIActiveClient() const;
 SfxInPlaceClient*   FindIPClient( const css::uno::Reference < 
css::embed::XEmbeddedObject >&  xObj, vcl::Window *pObjParentWin ) const;
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 203c638728b0..ba30feb36a73 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ 

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

2023-12-04 Thread Ilmari Lauhakangas (via logerrit)
 include/sfx2/thumbnailview.hxx  |1 +
 sfx2/source/control/recentdocsview.cxx  |1 +
 sfx2/source/control/templatedefaultview.cxx |1 +
 sfx2/source/control/thumbnailview.cxx   |3 ++-
 4 files changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 5584980493fd599054cc5bbdb9911ae2c70cd60f
Author: Ilmari Lauhakangas 
AuthorDate: Mon Nov 27 18:40:57 2023 +0200
Commit: Ilmari Lauhakangas 
CommitDate: Mon Dec 4 20:16:06 2023 +0100

tdf#158404 Start Center: remove ability to do multiselections

in Recent Documents and Templates views using Shift+arrow keys as
no actions can be executed for multiple selected files.

Multiselection still works as normal in Manage Templates dialog.

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

diff --git a/include/sfx2/thumbnailview.hxx b/include/sfx2/thumbnailview.hxx
index 655aa3ba13e5..54e8440ad363 100644
--- a/include/sfx2/thumbnailview.hxx
+++ b/include/sfx2/thumbnailview.hxx
@@ -309,6 +309,7 @@ protected:
 bool mbShowTooltips : 1;
 bool mbDrawMnemonics : 1;
 bool mbSelectOnFocus : 1;
+bool mbAllowMultiSelection : 1;
 Color maFillColor;  ///< Background color of the thumbnail 
view widget.
 Color maTextColor;  ///< Text color.
 Color maHighlightColor; ///< Color of the highlight (background) 
of the hovered item.
diff --git a/sfx2/source/control/recentdocsview.cxx 
b/sfx2/source/control/recentdocsview.cxx
index 6df534788a32..f6ea1278390a 100644
--- a/sfx2/source/control/recentdocsview.cxx
+++ b/sfx2/source/control/recentdocsview.cxx
@@ -68,6 +68,7 @@ 
RecentDocsView::RecentDocsView(std::unique_ptr xWindow, st
 , mpLoadRecentFile(nullptr)
 , m_nExecuteHdlId(nullptr)
 {
+mbAllowMultiSelection = false;
 AbsoluteScreenPixelRectangle aScreen = 
Application::GetScreenPosSizePixel(Application::GetDisplayBuiltInScreen());
 mnItemMaxSize = std::min(aScreen.GetWidth(),aScreen.GetHeight()) > 800 ? 
256 : 192;
 
diff --git a/sfx2/source/control/templatedefaultview.cxx 
b/sfx2/source/control/templatedefaultview.cxx
index 909545e423ce..eef46f1817fd 100644
--- a/sfx2/source/control/templatedefaultview.cxx
+++ b/sfx2/source/control/templatedefaultview.cxx
@@ -25,6 +25,7 @@ 
TemplateDefaultView::TemplateDefaultView(std::unique_ptr x
  std::unique_ptr xMenu)
 : TemplateLocalView(std::move(xWindow), std::move(xMenu))
 {
+mbAllowMultiSelection = false;
 AbsoluteScreenPixelRectangle aScreen = 
Application::GetScreenPosSizePixel(Application::GetDisplayBuiltInScreen());
 tools::Long nItemMaxSize = 
std::min(aScreen.GetWidth(),aScreen.GetHeight()) > 800 ? 256 : 192;
 ThumbnailView::setItemDimensions( nItemMaxSize, nItemMaxSize, 
gnTextHeight, gnItemPadding );
diff --git a/sfx2/source/control/thumbnailview.cxx 
b/sfx2/source/control/thumbnailview.cxx
index abb9f9799e34..1ae47016935e 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -246,6 +246,7 @@ void ThumbnailView::ImplInit()
 mbHasVisibleItems = false;
 mbShowTooltips = false;
 mbDrawMnemonics = false;
+mbAllowMultiSelection = true;
 maFilterFunc = ViewFilterAll();
 
 const StyleSettings& rSettings = 
Application::GetSettings().GetStyleSettings();
@@ -681,7 +682,7 @@ bool ThumbnailView::KeyInput( const KeyEvent& rKEvt )
 
 if ( pNext )
 {
-if (aKeyCode.IsShift() && bValidRange)
+if (aKeyCode.IsShift() && bValidRange && mbAllowMultiSelection)
 {
 std::pair aRange;
 size_t nSelPos = mpStartSelRange - mFilteredItemList.begin();


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

2023-11-28 Thread Mike Kaganski (via logerrit)
 include/sfx2/objsh.hxx  |2 
 include/sfx2/strings.hrc|3 -
 sfx2/source/doc/objmisc.cxx |   54 +++-
 writerfilter/source/ooxml/OOXMLDocumentImpl.cxx |6 --
 4 files changed, 47 insertions(+), 18 deletions(-)

New commits:
commit 92e7f28f9aff78907bad030be80a9ea9452a3ddc
Author: Mike Kaganski 
AuthorDate: Mon Nov 27 18:07:30 2023 +0300
Commit: Mike Kaganski 
CommitDate: Wed Nov 29 06:23:33 2023 +0100

Related: tdf#104718 Use package repair request and behavior

Same as in other places handling that:
* SfxBaseModel::load (sfx2/source/doc/sfxbasemodel.cxx);
* StorageFilterDetect::detect 
(filter/source/storagefilterdetect/filterdetect.cxx);
* TypeDetection::impl_detectTypeFlatAndDeep 
(filter/source/config/cache/typedetection.cxx)

In these cases, the same handler is used (RequestPackageReparation);
when the user approves an attempt to repair the package, the media
descriptor gets "RepairPackage" property set to true (this produces
a "(repaired document)" appended to the document title); also, the
document is opened in template mode (so saving it doesn't simply
overwrite the original broken document, but asks for a new name).

Re-using this logic, and checking if the "RepairPackage" is already
set, allows to unify the behavior, and to avoid duplicate warnings
when the user already approved repair of a broken package.

The request won't contain the details of the XML problem; but it
will be shown if rejected anyway, so OK for the diagnostics.

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

diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index fd23ae4af437..20e497b6e4af 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -475,7 +475,7 @@ public:
 voidAvoidRecentDocs(bool bAvoid) { 
mbAvoidRecentDocs = bAvoid; }
 
 /// On first error ask user if import should continue; return saved answer.
-bool
IsContinueImportOnFilterExceptions(std::u16string_view aErrMessage);
+boolIsContinueImportOnFilterExceptions();
 
 // Transfer IFace
 boolIsAbortingImport() const;
diff --git a/include/sfx2/strings.hrc b/include/sfx2/strings.hrc
index 300e1036169b..d28fa1cc22b7 100644
--- a/include/sfx2/strings.hrc
+++ b/include/sfx2/strings.hrc
@@ -70,9 +70,6 @@
 #define STR_QMSG_SEL_FOLDER_DELETE  
NC_("STR_QMSG_SEL_FOLDER_DELETE", "Do you want to delete the selected 
category?")
 #define STR_QMSG_TEMPLATE_OVERWRITE 
NC_("STR_QMSG_TEMPLATE_OVERWRITE", "A template named $1 already exists in $2. 
Do you want to overwrite it?")
 #define STR_QMSG_SEL_TEMPLATE_DELETE
NC_("STR_QMSG_SEL_TEMPLATE_DELETE", "Do you want to delete the selected 
templates?")
-#define STR_QMSG_ERROR_OPENING_FILE 
NC_("STR_QMSG_ERROR_OPENING_FILE", "An error occurred during opening the file. 
This may be caused by incorrect file contents.\n")
-#define STR_QMSG_ERROR_OPENING_FILE_DETAILS 
NC_("STR_QMSG_ERROR_OPENING_FILE_DETAILS", "The error details are:\n")
-#define STR_QMSG_ERROR_OPENING_FILE_CONTINUE
NC_("STR_QMSG_ERROR_OPENING_FILE_CONTINUE", "\nProceeding with import may cause 
data loss or corruption, and application may become unstable or crash.\n\nDo 
you want to ignore the error and attempt to continue loading the file?")
 
 #define STR_HELP_WINDOW_TITLE   NC_("STR_HELP_WINDOW_TITLE", 
"%PRODUCTNAME Help")
 #define STR_HELP_BUTTON_INDEX_ON
NC_("STR_HELP_BUTTON_INDEX_ON", "Show Navigation Pane")
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 57deb4fe9de8..ede8983608c6 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -50,6 +50,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 
@@ -66,6 +67,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -80,6 +82,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -1937,20 +1940,51 @@ bool SfxObjectShell_Impl::hasTrustedScriptingSignature(
 return bResult;
 }
 
-bool SfxObjectShell::IsContinueImportOnFilterExceptions(std::u16string_view 
aErrMessage)
+bool SfxObjectShell::IsContinueImportOnFilterExceptions()
 {
 if (mbContinueImportOnFilterExceptions == undefined)
 {
-if (Application::GetDialogCancelMode() == DialogCancelMode::Off)
+if (!pMedium)
 {
-// Ask the user to try to continue or abort loading
-OUString aMessage = SfxResId(STR_QMSG_ERROR_OPENING_FILE);
-if (!aErrMessage.empty())
-aMessage += SfxResId(STR_QMSG_ERROR_OPENING_FILE_DETAILS) + 
aErrMessage;
-   

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

2023-11-19 Thread Stephan Bergmann (via logerrit)
 include/sfx2/lokhelper.hxx   |2 +-
 sfx2/qa/cppunit/doc.cxx  |2 +-
 sfx2/qa/cppunit/test_misc.cxx|   10 +-
 sfx2/source/doc/guisaveas.cxx|4 ++--
 sfx2/source/doc/sfxbasemodel.cxx |2 +-
 sfx2/source/view/ipclient.cxx|2 +-
 sfx2/source/view/lokhelper.cxx   |   10 +-
 sfx2/source/view/viewsh.cxx  |2 +-
 8 files changed, 17 insertions(+), 17 deletions(-)

New commits:
commit baecfd21797310bb15ab98ca3962445d99e397db
Author: Stephan Bergmann 
AuthorDate: Sun Nov 19 17:30:58 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Sun Nov 19 23:23:49 2023 +0100

Extended loplugin:ostr: sfx2

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

diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx
index f73312c56417..98eeccb74476 100644
--- a/include/sfx2/lokhelper.hxx
+++ b/include/sfx2/lokhelper.hxx
@@ -195,7 +195,7 @@ public:
 static OString makePayloadJSON(const SfxViewShell* pThisView, int nViewId, 
std::string_view rKey, const OString& rPayload);
 /// Makes a LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR payload, but tweaks it 
according to setOptionalFeatures() if needed.
 static OString makeVisCursorInvalidation(int nViewId, const OString& 
rRectangle,
- bool bMispelledWord = false, 
const OString& rHyperlink = "");
+ bool bMispelledWord = false, 
const OString& rHyperlink = ""_ostr);
 
 /// Helper for posting async key event
 static void postKeyEventAsync(const VclPtr ,
diff --git a/sfx2/qa/cppunit/doc.cxx b/sfx2/qa/cppunit/doc.cxx
index 902ac48646e5..9eea6d29390d 100644
--- a/sfx2/qa/cppunit/doc.cxx
+++ b/sfx2/qa/cppunit/doc.cxx
@@ -126,7 +126,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSetDocumentPropertiesUpdate)
 }
 }
 }
-)json");
+)json"_ostr);
 uno::Sequence aArgs = 
comphelper::containerToSequence(aArgsVec);
 dispatchCommand(mxComponent, ".uno:SetDocumentProperties", aArgs);
 
diff --git a/sfx2/qa/cppunit/test_misc.cxx b/sfx2/qa/cppunit/test_misc.cxx
index c93a3ad7335a..a59a1128e7df 100644
--- a/sfx2/qa/cppunit/test_misc.cxx
+++ b/sfx2/qa/cppunit/test_misc.cxx
@@ -76,11 +76,11 @@ CPPUNIT_TEST_FIXTURE(MiscTest, testODFCustomMetadata)
 
 // check that custom metadata is preserved
 xmlDocUniquePtr pXmlDoc = parseExport("meta.xml");
-assertXPathContent(pXmlDoc, "/office:document-meta/office:meta/bork", 
"bork");
-assertXPath(pXmlDoc, "/office:document-meta/office:meta/foo:bar", 1);
-assertXPath(pXmlDoc, "/office:document-meta/office:meta/foo:bar/baz:foo", 
1);
-assertXPath(pXmlDoc, 
"/office:document-meta/office:meta/foo:bar/baz:foo[@baz:bar='foo']");
-assertXPathContent(pXmlDoc, 
"/office:document-meta/office:meta/foo:bar/foo:baz", "bar");
+assertXPathContent(pXmlDoc, "/office:document-meta/office:meta/bork"_ostr, 
"bork");
+assertXPath(pXmlDoc, "/office:document-meta/office:meta/foo:bar"_ostr, 1);
+assertXPath(pXmlDoc, 
"/office:document-meta/office:meta/foo:bar/baz:foo"_ostr, 1);
+assertXPath(pXmlDoc, 
"/office:document-meta/office:meta/foo:bar/baz:foo[@baz:bar='foo']"_ostr);
+assertXPathContent(pXmlDoc, 
"/office:document-meta/office:meta/foo:bar/foo:baz"_ostr, "bar");
 }
 
 CPPUNIT_TEST_FIXTURE(MiscTest, testNoThumbnail)
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 1c013c4a382b..657d162ff732 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -677,7 +677,7 @@ IMPL_LINK( ModelData_Impl, OptionsDialogClosedHdl, 
css::ui::dialogs::DialogClose
 if (pEvt->DialogResult == RET_OK && m_xFilterProperties)
 {
 if ( comphelper::LibreOfficeKit::isActive() && SfxViewShell::Current() 
)
-SfxViewShell::Current()->libreOfficeKitViewCallback( 
LOK_CALLBACK_EXPORT_FILE, "PENDING" );
+SfxViewShell::Current()->libreOfficeKitViewCallback( 
LOK_CALLBACK_EXPORT_FILE, "PENDING"_ostr );
 
 const uno::Sequence< beans::PropertyValue > aPropsFromDialog = 
m_xFilterProperties->getPropertyValues();
 for ( const auto& rProp : aPropsFromDialog )
@@ -687,7 +687,7 @@ IMPL_LINK( ModelData_Impl, OptionsDialogClosedHdl, 
css::ui::dialogs::DialogClose
 }
 else if ( comphelper::LibreOfficeKit::isActive() && 
SfxViewShell::Current() )
 {
-SfxViewShell::Current()->libreOfficeKitViewCallback( 
LOK_CALLBACK_EXPORT_FILE, "ABORT" );
+SfxViewShell::Current()->libreOfficeKitViewCallback( 
LOK_CALLBACK_EXPORT_FILE, "ABORT"_ostr );
 }
 }
 
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 860bea828122..985af531358d 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -3265,7 +3265,7 @@ void SfxBaseModel::impl_store(  const   OUString& 
   

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

2023-11-16 Thread Caolán McNamara (via logerrit)
 include/sfx2/objsh.hxx |7 +--
 sc/source/core/data/global.cxx |   32 ++--
 sfx2/source/doc/objmisc.cxx|   27 +++
 3 files changed, 34 insertions(+), 32 deletions(-)

New commits:
commit e6a7537762e19fde446441edd10d301f9b37ce75
Author: Caolán McNamara 
AuthorDate: Wed Nov 15 11:39:24 2023 +
Commit: Caolán McNamara 
CommitDate: Thu Nov 16 12:19:05 2023 +0100

reorg calc hyperlink check to reuse elsewhere

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

diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index 83fbeba7a230..fd23ae4af437 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -205,6 +205,9 @@ private:
 
 SAL_DLLPRIVATE bool SaveTo_Impl(SfxMedium , const SfxItemSet* pSet 
);
 
+// true if the document had macros (or similar) on load to trigger warning 
user
+SAL_DLLPRIVATE bool  GetHadCheckedMacrosOnLoad() const;
+
 protected:
 SfxObjectShell(SfxObjectCreateMode);
 SfxObjectShell(SfxModelFlags);// see 
sfxmodelfactory.hxx
@@ -433,8 +436,8 @@ public:
 voidSetMacroCallsSeenWhileLoading();
 boolGetMacroCallsSeenWhileLoading() const;
 
-// true if the document had macros (or similar) on load to trigger warning 
user
-boolGetHadCheckedMacrosOnLoad() const;
+// true if this type of link, from a document, is allowed by the user to 
be passed to uno:OpenDoc
+static bool AllowedLinkProtocolFromDocument(const 
OUString& rUrl, SfxObjectShell* pObjShell, weld::Window* pDialogParent);
 
 const css::uno::Sequence< css::beans::PropertyValue >& 
GetModifyPasswordInfo() const;
 boolSetModifyPasswordInfo( const 
css::uno::Sequence< css::beans::PropertyValue >& aInfo );
diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index 72323f7630e8..c4737d1e0bce 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -29,9 +29,7 @@
 #include 
 #include 
 #include 
-#include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -858,34 +856,8 @@ void ScGlobal::OpenURL(const OUString& rURL, const 
OUString& rTarget, bool bIgno
 aUrlName = aNewUrlName;
 }
 
-if (INetURLObject(aUrlName).IsExoticProtocol())
-{
-// Default to ignoring exotic protocols
-bool bAllow = false;
-if (pObjShell)
-{
-// If the document had macros when loaded then follow the allowed 
macro-mode
-if (pObjShell->GetHadCheckedMacrosOnLoad())
-bAllow = pObjShell->AdjustMacroMode();
-else // otherwise ask the user, defaulting to cancel
-{
-assert(pFrame && "if we have pObjShell we have pFrame");
-//Reuse URITools::onOpenURI warning string
-std::unique_ptr 
xQueryBox(Application::CreateMessageDialog(pFrame->GetFrameWeld(),
-   
VclMessageType::Warning, VclButtonsType::YesNo,
-   
SfxResId(STR_DANGEROUS_TO_OPEN)));
-
xQueryBox->set_primary_text(xQueryBox->get_primary_text().replaceFirst("$(ARG1)",
-INetURLObject::decode(aUrlName, 
INetURLObject::DecodeMechanism::Unambiguous)));
-xQueryBox->set_default_response(RET_NO);
-bAllow = xQueryBox->run() == RET_YES;
-}
-}
-if (!bAllow)
-{
-SAL_WARN("sc", "ScGlobal::OpenURL ignoring: " << aUrlName);
-return;
-}
-}
+if (!SfxObjectShell::AllowedLinkProtocolFromDocument(aUrlName, pObjShell, 
pFrame ? pFrame->GetFrameWeld() : nullptr))
+return;
 
 SfxStringItem aUrl( SID_FILE_NAME, aUrlName );
 SfxStringItem aTarget( SID_TARGETNAME, rTarget );
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index a3735bdc6826..57deb4fe9de8 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -968,6 +968,33 @@ bool SfxObjectShell::GetHadCheckedMacrosOnLoad() const
 return pImpl->m_bHadCheckedMacrosOnLoad;
 }
 
+bool SfxObjectShell::AllowedLinkProtocolFromDocument(const OUString& rUrl, 
SfxObjectShell* pObjShell, weld::Window* pDialogParent)
+{
+if (!INetURLObject(rUrl).IsExoticProtocol())
+return true;
+// Default to ignoring exotic protocols
+bool bAllow = false;
+if (pObjShell)
+{
+// If the document had macros when loaded then follow the allowed 
macro-mode
+if (pObjShell->GetHadCheckedMacrosOnLoad())
+bAllow = pObjShell->AdjustMacroMode();
+else // otherwise ask the 

[Libreoffice-commits] core.git: include/sfx2 sfx2/source sfx2/uiconfig solenv/sanitizers

2023-11-15 Thread Sarper Akdemir (via logerrit)
 include/sfx2/passwd.hxx|3 ++
 sfx2/source/dialog/passwd.cxx  |   45 
 sfx2/uiconfig/ui/password.ui   |   56 -
 solenv/sanitizers/ui/sfx.suppr |4 ++
 4 files changed, 96 insertions(+), 12 deletions(-)

New commits:
commit ed72c6fbfa02cf98cb0d0f761ef5a7b9ffb894bc
Author: Sarper Akdemir 
AuthorDate: Wed Nov 15 14:54:42 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Wed Nov 15 23:05:49 2023 +0100

tdf#157518: enforce password policy on sfx2/ui/password.ui

Change-Id: I115b5b05ed82f2f900bcd70ec4f52c7f749544e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159443
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/include/sfx2/passwd.hxx b/include/sfx2/passwd.hxx
index bc5e478bbf03..3ddffed196d0 100644
--- a/include/sfx2/passwd.hxx
+++ b/include/sfx2/passwd.hxx
@@ -51,6 +51,7 @@ private:
 std::unique_ptr m_xPassword1FT;
 std::unique_ptr m_xPassword1ED;
 std::unique_ptr m_xPassword1StrengthBar;
+std::unique_ptr m_xPassword1PolicyLabel;
 std::unique_ptr m_xConfirm1FT;
 std::unique_ptr m_xConfirm1ED;
 
@@ -58,6 +59,7 @@ private:
 std::unique_ptr m_xPassword2FT;
 std::unique_ptr m_xPassword2ED;
 std::unique_ptr m_xPassword2StrengthBar;
+std::unique_ptr m_xPassword2PolicyLabel;
 std::unique_ptr m_xConfirm2FT;
 std::unique_ptr m_xConfirm2ED;
 
@@ -74,6 +76,7 @@ private:
 OUStringmaMainPwdStr;
 sal_uInt16  mnMinLen;
 SfxShowExtras  mnExtras;
+std::optional moPasswordPolicy;
 
 boolmbAsciiOnly;
 DECL_DLLPRIVATE_LINK(OKHdl, weld::Button&, void);
diff --git a/sfx2/source/dialog/passwd.cxx b/sfx2/source/dialog/passwd.cxx
index a69d0aef352a..b78546722cb9 100644
--- a/sfx2/source/dialog/passwd.cxx
+++ b/sfx2/source/dialog/passwd.cxx
@@ -17,6 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include 
 #include 
 #include 
 #include 
@@ -38,15 +39,35 @@ void SfxPasswordDialog::ModifyHdl()
 bEnable = (bEnable && (m_xPassword2ED->get_text().getLength() >= 
mnMinLen));
 m_xOKBtn->set_sensitive(bEnable);
 
+// if there's a confirm entry, the dialog is being used for setting a 
password
 if (m_xConfirm1ED->get_visible())
 {
 m_xPassword1StrengthBar->set_percentage(
 SvPasswordHelper::GetPasswordStrengthPercentage(aPassword1Text));
+bool bPasswordMeetsPolicy = SvPasswordHelper::PasswordMeetsPolicy(
+aPassword1Text, moPasswordPolicy);
+m_xPassword1ED->set_message_type(bPasswordMeetsPolicy ? 
weld::EntryMessageType::Normal
+  : 
weld::EntryMessageType::Error);
+m_xPassword1PolicyLabel->set_visible(!bPasswordMeetsPolicy);
 }
+
+// if there's a confirm entry, the dialog is being used for setting a 
password
 if (m_xConfirm2ED->get_visible())
 {
+OUString aPassword2Text = m_xPassword2ED->get_text();
+
 m_xPassword2StrengthBar->set_percentage(
 
SvPasswordHelper::GetPasswordStrengthPercentage(m_xPassword2ED->get_text()));
+
+// second password is optional, ignore policy if it is empty
+bool bPasswordMeetsPolicy
+= aPassword2Text.isEmpty()
+  ? true
+  : SvPasswordHelper::PasswordMeetsPolicy(
+  aPassword2Text, moPasswordPolicy);
+m_xPassword2ED->set_message_type(bPasswordMeetsPolicy ? 
weld::EntryMessageType::Normal
+  : 
weld::EntryMessageType::Error);
+m_xPassword2PolicyLabel->set_visible(!bPasswordMeetsPolicy);
 }
 }
 
@@ -81,6 +102,19 @@ IMPL_LINK(SfxPasswordDialog, InsertTextHdl, OUString&, 
rTest, bool)
 
 IMPL_LINK_NOARG(SfxPasswordDialog, OKHdl, weld::Button&, void)
 {
+if (m_xConfirm1ED->get_visible()
+&& !SvPasswordHelper::PasswordMeetsPolicy(GetPassword(), 
moPasswordPolicy))
+{
+m_xPassword1ED->grab_focus();
+return;
+}
+if (m_xConfirm2ED->get_visible() && !GetPassword2().isEmpty()
+&& !SvPasswordHelper::PasswordMeetsPolicy(GetPassword2(), 
moPasswordPolicy))
+{
+m_xPassword2ED->grab_focus();
+return;
+}
+
 bool bConfirmFailed = bool( mnExtras & SfxShowExtras::CONFIRM ) &&
   ( GetConfirm() != GetPassword() );
 if( ( mnExtras & SfxShowExtras::CONFIRM2 ) && ( m_xConfirm2ED->get_text() 
!= GetPassword2() ) )
@@ -114,12 +148,14 @@ SfxPasswordDialog::SfxPasswordDialog(weld::Widget* 
pParent, const OUString* pGro
 , m_xPassword1FT(m_xBuilder->weld_label("pass1ft"))
 , m_xPassword1ED(m_xBuilder->weld_entry("pass1ed"))
 , m_xPassword1StrengthBar(m_xBuilder->weld_level_bar("pass1bar"))
+, m_xPassword1PolicyLabel(m_xBuilder->weld_label("pass1policylabel"))
 , m_xConfirm1FT(m_xBuilder->weld_label("confirm1ft"))

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

2023-11-14 Thread Heiko Tietze (via logerrit)
 include/sfx2/thumbnailview.hxx  |2 --
 include/sfx2/thumbnailviewitem.hxx  |2 --
 sfx2/source/control/recentdocsview.cxx  |4 +---
 sfx2/source/control/templatedefaultview.cxx |4 +---
 sfx2/source/control/templateviewitem.cxx|2 +-
 sfx2/source/control/thumbnailview.cxx   |4 
 sfx2/source/control/thumbnailviewitem.cxx   |7 ++-
 7 files changed, 5 insertions(+), 20 deletions(-)

New commits:
commit adfb0a34af196befc46527418f6e870d1f8f1889
Author: Heiko Tietze 
AuthorDate: Tue Nov 14 11:35:43 2023 +0100
Commit: Heiko Tietze 
CommitDate: Tue Nov 14 13:26:53 2023 +0100

Resolves tdf#158084 - Start Center hover color

Selected colors removed since hovering leads to selection
(or execution) and does not need a special color

Transparency for reccent documents and templates in start center
increased to make the difference to selected more clear

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

diff --git a/include/sfx2/thumbnailview.hxx b/include/sfx2/thumbnailview.hxx
index a51db9df048b..655aa3ba13e5 100644
--- a/include/sfx2/thumbnailview.hxx
+++ b/include/sfx2/thumbnailview.hxx
@@ -313,8 +313,6 @@ protected:
 Color maTextColor;  ///< Text color.
 Color maHighlightColor; ///< Color of the highlight (background) 
of the hovered item.
 Color maHighlightTextColor; ///< Color of the text for the highlighted 
item.
-Color maSelectHighlightColor;   ///< Color of the highlight (background) 
of the selected and hovered item.
-Color maSelectHighlightTextColor;   ///< Color of the text of the selected 
and hovered item.
 double mfHighlightTransparence; ///< Transparence of the highlight.
 
 Link maItemStateHdl;
diff --git a/include/sfx2/thumbnailviewitem.hxx 
b/include/sfx2/thumbnailviewitem.hxx
index 9495b08054e3..22020c47728d 100644
--- a/include/sfx2/thumbnailviewitem.hxx
+++ b/include/sfx2/thumbnailviewitem.hxx
@@ -56,8 +56,6 @@ struct ThumbnailItemAttributes
 basegfx::BColor aTextColor;
 basegfx::BColor aHighlightColor;
 basegfx::BColor aHighlightTextColor;
-basegfx::BColor aSelectHighlightColor;
-basegfx::BColor aSelectHighlightTextColor;
 double fHighlightTransparence;
 basegfx::B2DVector aFontSize;
 drawinglayer::attribute::FontAttribute aFontAttr;
diff --git a/sfx2/source/control/recentdocsview.cxx 
b/sfx2/source/control/recentdocsview.cxx
index 055dc6962423..6df534788a32 100644
--- a/sfx2/source/control/recentdocsview.cxx
+++ b/sfx2/source/control/recentdocsview.cxx
@@ -80,10 +80,8 @@ 
RecentDocsView::RecentDocsView(std::unique_ptr xWindow, st
 const StyleSettings& rSettings = 
Application::GetSettings().GetStyleSettings();
 maHighlightColor = rSettings.GetHighlightColor();
 maHighlightTextColor = rSettings.GetHighlightTextColor();
-maSelectHighlightColor = rSettings.GetActiveColor();
-maSelectHighlightTextColor = rSettings.GetActiveTextColor();
 
-mfHighlightTransparence = 0.25;
+mfHighlightTransparence = 0.75;
 
 UpdateColors();
 }
diff --git a/sfx2/source/control/templatedefaultview.cxx 
b/sfx2/source/control/templatedefaultview.cxx
index 34d40875d23c..909545e423ce 100644
--- a/sfx2/source/control/templatedefaultview.cxx
+++ b/sfx2/source/control/templatedefaultview.cxx
@@ -37,10 +37,8 @@ 
TemplateDefaultView::TemplateDefaultView(std::unique_ptr x
 const StyleSettings& rSettings = 
Application::GetSettings().GetStyleSettings();
 maHighlightColor = rSettings.GetHighlightColor();
 maHighlightTextColor = rSettings.GetHighlightTextColor();
-maSelectHighlightColor = rSettings.GetActiveColor();
-maSelectHighlightTextColor = rSettings.GetActiveTextColor();
 
-mfHighlightTransparence = 0.25;
+mfHighlightTransparence = 0.75;
 
 UpdateColors();
 }
diff --git a/sfx2/source/control/templateviewitem.cxx 
b/sfx2/source/control/templateviewitem.cxx
index 28ff1f43133c..d28ad50f74cd 100644
--- a/sfx2/source/control/templateviewitem.cxx
+++ b/sfx2/source/control/templateviewitem.cxx
@@ -61,7 +61,7 @@ void 
TemplateViewItem::Paint(drawinglayer::processor2d::BaseProcessor2D *pProces
 
 // Draw background
 if( mbSelected && mbHover)
-aFillColor = pAttrs->aSelectHighlightColor;
+aFillColor = pAttrs->aHighlightColor;
 else if (mbSelected || mbHover)
 {
 aFillColor = pAttrs->aHighlightColor;
diff --git a/sfx2/source/control/thumbnailview.cxx 
b/sfx2/source/control/thumbnailview.cxx
index 2d4e8bb57611..abb9f9799e34 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -253,8 +253,6 @@ void ThumbnailView::ImplInit()
 maTextColor = rSettings.GetWindowTextColor();
 maHighlightColor = rSettings.GetHighlightColor();
 maHighlightTextColor = 

[Libreoffice-commits] core.git: include/sfx2 sw/inc sw/qa sw/source sw/uiconfig

2023-11-08 Thread László Németh (via logerrit)
 include/sfx2/AccessibilityIssue.hxx  |1 
 sw/inc/AccessibilityCheckStrings.hrc |1 
 sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx |   12 
 sw/qa/core/accessibilitycheck/data/LinkedImageTest.fodt  |   18 ++
 sw/source/core/access/AccessibilityCheck.cxx |   42 +-
 sw/source/core/access/AccessibilityIssue.cxx |1 
 sw/source/core/inc/AccessibilityIssue.hxx|1 
 sw/source/uibase/sidebar/A11yCheckIssuesPanel.cxx|   40 +++--
 sw/source/uibase/sidebar/A11yCheckIssuesPanel.hxx|3 +
 sw/uiconfig/swriter/ui/a11ycheckissuespanel.ui   |   44 ---
 10 files changed, 146 insertions(+), 17 deletions(-)

New commits:
commit 0156cba6e34026f8fa0f2912e503378a5ec2208d
Author: László Németh 
AuthorDate: Wed Nov 8 11:04:40 2023 +0100
Commit: László Németh 
CommitDate: Wed Nov 8 21:16:59 2023 +0100

tdf#43784 tdf#158114 sw accessibility: check missing linked graphic

Show missing linked graphics and their abbreviated paths,
(and as tooltips, full paths) in the accessibility checker.

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

diff --git a/include/sfx2/AccessibilityIssue.hxx 
b/include/sfx2/AccessibilityIssue.hxx
index ac9ad6adb73b..92bef3d7d6a2 100644
--- a/include/sfx2/AccessibilityIssue.hxx
+++ b/include/sfx2/AccessibilityIssue.hxx
@@ -27,6 +27,7 @@ enum class AccessibilityIssueID
 DOCUMENT_LANGUAGE,
 DOCUMENT_BACKGROUND,
 STYLE_LANGUAGE,
+LINKED_GRAPHIC,
 NO_ALT_OLE,
 NO_ALT_GRAPHIC,
 NO_ALT_SHAPE,
diff --git a/sw/inc/AccessibilityCheckStrings.hrc 
b/sw/inc/AccessibilityCheckStrings.hrc
index 44dd7217dc04..8073f9cc1c73 100644
--- a/sw/inc/AccessibilityCheckStrings.hrc
+++ b/sw/inc/AccessibilityCheckStrings.hrc
@@ -14,6 +14,7 @@
 #define NC_(Context, String) TranslateId(Context, u8##String)
 
 #define STR_NO_ALT  NC_("STR_NO_ALT", "%OBJECT_NAME%")
+#define STR_LINKED_GRAPHIC  NC_("STR_LINKED_GRAPHIC", 
"“%OBJECT_NAME%” referenced as “%LINK%”.")
 #define STR_TABLE_MERGE_SPLIT   NC_("STR_TABLE_MERGE_SPLIT", "Table 
“%OBJECT_NAME%” contains merges or splits.")
 #define STR_FAKE_NUMBERING  NC_("STR_FAKE_NUMBERING", "Simulated 
numbering “%NUMBERING%”.")
 #define STR_HYPERLINK_TEXT_IS_LINK  NC_("STR_HYPERLINK_TEXT_IS_LINK", 
"Hyperlink text is the same as the link address “%LINK%”.")
diff --git a/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx 
b/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx
index 72337e62d6e0..117b48d01661 100644
--- a/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx
+++ b/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx
@@ -84,6 +84,18 @@ CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, 
testCheckBackgroundImage)
 CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::DOCUMENT_BACKGROUND, 
aIssues[0]->m_eIssueID);
 }
 
+CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testCheckLinkedImage)
+{
+createSwDoc("LinkedImageTest.fodt");
+SwDoc* pDoc = getSwDoc();
+CPPUNIT_ASSERT(pDoc);
+sw::AccessibilityCheck aCheck(pDoc);
+aCheck.check();
+auto& aIssues = aCheck.getIssueCollection().getIssues();
+CPPUNIT_ASSERT_EQUAL(size_t(4), aIssues.size());
+CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::LINKED_GRAPHIC, 
aIssues[1]->m_eIssueID);
+}
+
 CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testCheckNewlineSpace)
 {
 createSwDoc("NewlineTest.odt");
diff --git a/sw/qa/core/accessibilitycheck/data/LinkedImageTest.fodt 
b/sw/qa/core/accessibilitycheck/data/LinkedImageTest.fodt
new file mode 100644
index ..c73162b18372
--- /dev/null
+++ b/sw/qa/core/accessibilitycheck/data/LinkedImageTest.fodt
@@ -0,0 +1,18 @@
+
+http://www.w3.org/1999/xlink; 
xmlns:dc="http://purl.org/dc/elements/1.1/; 
xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" 
xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" 
xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" 
xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" 
xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" 
xmlns:math="http://www.w3.org/1998/Math/MathML; 
xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" 
xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" 
xmlns:config="urn:oas
 is:names:tc:opendocument:xmlns:config:1.0" 
xmlns:ooo="http://openoffice.org/2004/office; 
xmlns:ooow="http://openoffice.org/2004/writer; 
xmlns:oooc="http://openoffice.org/2004/calc; 
xmlns:dom="http://www.w3.org/2001/xml-events; 
xmlns:xforms="http://www.w3.org/2002/xforms; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; 
xmlns:rpt="http://openoffice.org/2005/report; 

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

2023-10-24 Thread Balazs Varga (via logerrit)
 include/sfx2/printopt.hxx|   11 ++
 sfx2/source/dialog/printopt.cxx  |   89 +---
 sfx2/uiconfig/ui/optprintpage.ui |  167 ---
 3 files changed, 243 insertions(+), 24 deletions(-)

New commits:
commit 60952eb3234006e9fba189e4189e15f902cafb4b
Author: Balazs Varga 
AuthorDate: Fri Oct 20 19:38:58 2023 +0200
Commit: Balazs Varga 
CommitDate: Tue Oct 24 08:38:54 2023 +0200

tdf#157838 - UI: Part 4 - Unify lockdown behavior of Options dialog

for Print Page.

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

diff --git a/include/sfx2/printopt.hxx b/include/sfx2/printopt.hxx
index a251616a4890..e01991dad347 100644
--- a/include/sfx2/printopt.hxx
+++ b/include/sfx2/printopt.hxx
@@ -33,22 +33,33 @@ private:
 std::unique_ptr m_xPrinterOutputRB;
 std::unique_ptr m_xPrintFileOutputRB;
 std::unique_ptr m_xReduceTransparencyCB;
+std::unique_ptr m_xReduceTransparencyImg;
 std::unique_ptr m_xReduceTransparencyAutoRB;
 std::unique_ptr m_xReduceTransparencyNoneRB;
+std::unique_ptr m_xReduceTransparencyModeImg;
 std::unique_ptr m_xReduceGradientsCB;
+std::unique_ptr m_xReduceGradientsImg;
 std::unique_ptr m_xReduceGradientsStripesRB;
 std::unique_ptr m_xReduceGradientsColorRB;
+std::unique_ptr m_xReduceGradientsModeImg;
 std::unique_ptr m_xReduceGradientsStepCountNF;
 std::unique_ptr m_xReduceBitmapsCB;
+std::unique_ptr m_xReduceBitmapsImg;
 std::unique_ptr m_xReduceBitmapsOptimalRB;
 std::unique_ptr m_xReduceBitmapsNormalRB;
 std::unique_ptr m_xReduceBitmapsResolutionRB;
+std::unique_ptr m_xReduceBitmapsModeImg;
 std::unique_ptr m_xReduceBitmapsResolutionLB;
 std::unique_ptr m_xReduceBitmapsTransparencyCB;
+std::unique_ptr m_xReduceBitmapsTransparencyImg;
 std::unique_ptr m_xConvertToGreyscalesCB;
+std::unique_ptr m_xConvertToGreyscalesImg;
 std::unique_ptr m_xPaperSizeCB;
+std::unique_ptr m_xPaperSizeImg;
 std::unique_ptr m_xPaperOrientationCB;
+std::unique_ptr m_xPaperOrientationImg;
 std::unique_ptr m_xTransparencyCB;
+std::unique_ptr m_xTransparencyImg;
 
 private:
 
diff --git a/sfx2/source/dialog/printopt.cxx b/sfx2/source/dialog/printopt.cxx
index 1638f4e2f08e..d0ee19c17a1a 100644
--- a/sfx2/source/dialog/printopt.cxx
+++ b/sfx2/source/dialog/printopt.cxx
@@ -37,22 +37,33 @@ 
SfxCommonPrintOptionsTabPage::SfxCommonPrintOptionsTabPage(weld::Container* pPag
 , m_xPrinterOutputRB(m_xBuilder->weld_radio_button("printer"))
 , m_xPrintFileOutputRB(m_xBuilder->weld_radio_button("file"))
 , m_xReduceTransparencyCB(m_xBuilder->weld_check_button("reducetrans"))
+, m_xReduceTransparencyImg(m_xBuilder->weld_widget("lockreducetrans"))
 , 
m_xReduceTransparencyAutoRB(m_xBuilder->weld_radio_button("reducetransauto"))
 , 
m_xReduceTransparencyNoneRB(m_xBuilder->weld_radio_button("reducetransnone"))
+, 
m_xReduceTransparencyModeImg(m_xBuilder->weld_widget("lockreducetransmode"))
 , m_xReduceGradientsCB(m_xBuilder->weld_check_button("reducegrad"))
+, m_xReduceGradientsImg(m_xBuilder->weld_widget("lockreducegrad"))
 , 
m_xReduceGradientsStripesRB(m_xBuilder->weld_radio_button("reducegradstripes"))
 , 
m_xReduceGradientsColorRB(m_xBuilder->weld_radio_button("reducegradcolor"))
+, m_xReduceGradientsModeImg(m_xBuilder->weld_widget("lockreducegradmode"))
 , 
m_xReduceGradientsStepCountNF(m_xBuilder->weld_spin_button("reducegradstep"))
 , m_xReduceBitmapsCB(m_xBuilder->weld_check_button("reducebitmap"))
+, m_xReduceBitmapsImg(m_xBuilder->weld_widget("lockreducebitmap"))
 , 
m_xReduceBitmapsOptimalRB(m_xBuilder->weld_radio_button("reducebitmapoptimal"))
 , 
m_xReduceBitmapsNormalRB(m_xBuilder->weld_radio_button("reducebitmapnormal"))
 , 
m_xReduceBitmapsResolutionRB(m_xBuilder->weld_radio_button("reducebitmapresol"))
+, m_xReduceBitmapsModeImg(m_xBuilder->weld_widget("lockreducebitmapmode"))
 , 
m_xReduceBitmapsResolutionLB(m_xBuilder->weld_combo_box("reducebitmapdpi"))
 , 
m_xReduceBitmapsTransparencyCB(m_xBuilder->weld_check_button("reducebitmaptrans"))
+, 
m_xReduceBitmapsTransparencyImg(m_xBuilder->weld_widget("lockreducebitmaptrans"))
 , m_xConvertToGreyscalesCB(m_xBuilder->weld_check_button("converttogray"))
+, m_xConvertToGreyscalesImg(m_xBuilder->weld_widget("lockconverttogray"))
 , m_xPaperSizeCB(m_xBuilder->weld_check_button("papersize"))
+, m_xPaperSizeImg(m_xBuilder->weld_widget("lockpapersize"))
 , m_xPaperOrientationCB(m_xBuilder->weld_check_button("paperorient"))
+, m_xPaperOrientationImg(m_xBuilder->weld_widget("lockpaperorient"))
 , m_xTransparencyCB(m_xBuilder->weld_check_button("trans"))
+, m_xTransparencyImg(m_xBuilder->weld_widget("locktrans"))
 {
 if (bOutputForPrinter)
   

[Libreoffice-commits] core.git: include/sfx2 officecfg/registry sfx2/source sw/inc sw/sdi sw/source sw/uiconfig

2023-10-17 Thread Jim Raykowski (via logerrit)
 include/sfx2/sfxsids.hrc|3 
 include/sfx2/templdlg.hxx   |   14 +
 officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu |   33 +++
 sfx2/source/dialog/templdlg.cxx |   88 
--
 sw/inc/view.hxx |2 
 sw/sdi/_viewsh.sdi  |   12 +
 sw/sdi/swriter.sdi  |   34 +++
 sw/source/uibase/uiview/view0.cxx   |   28 +++
 sw/uiconfig/swriter/menubar/menubar.xml |8 
 9 files changed, 204 insertions(+), 18 deletions(-)

New commits:
commit 6320a4c21cf54d32c778417ee077d67fd0bad050
Author: Jim Raykowski 
AuthorDate: Mon Oct 16 06:48:35 2023 -0800
Commit: Jim Raykowski 
CommitDate: Wed Oct 18 04:13:55 2023 +0200

tdf#156114 UNO commands / menu entries to enable PS/CS spotlight

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

diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc
index 9789cc8a0ac1..55327feb0034 100644
--- a/include/sfx2/sfxsids.hrc
+++ b/include/sfx2/sfxsids.hrc
@@ -388,6 +388,9 @@ class SvxZoomItem;
 #define SID_STYLE_UPD_BY_EX_NAME
TypedWhichId(SID_SFX_START + 1585)
 #define SID_STYLE_REFERENCE 
TypedWhichId(SID_SFX_START + 1602)
 
+#define SID_SPOTLIGHT_PARASTYLES
TypedWhichId(SID_SFX_START + 1605)
+#define SID_SPOTLIGHT_CHARSTYLES
TypedWhichId(SID_SFX_START + 1606)
+
 #define SID_TEMPLATE_NAME   
TypedWhichId(SID_SFX_START + 660)
 #define SID_TEMPLATE_REGIONNAME 
TypedWhichId(SID_SFX_START + 662)
 #define SID_TEMPLATE_LOAD   
TypedWhichId(SID_SFX_START + 663)
diff --git a/include/sfx2/templdlg.hxx b/include/sfx2/templdlg.hxx
index 5dd5b8b6b178..254fcc790fb0 100644
--- a/include/sfx2/templdlg.hxx
+++ b/include/sfx2/templdlg.hxx
@@ -24,11 +24,14 @@
 #include 
 #include 
 #include 
+#include 
 
 class SfxBindings;
 class SfxTemplateDialog_Impl;
 
-class UNLESS_MERGELIBS(SFX2_DLLPUBLIC) SfxTemplatePanelControl final : public 
PanelLayout
+class UNLESS_MERGELIBS(SFX2_DLLPUBLIC) SfxTemplatePanelControl final
+: public PanelLayout,
+  public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
 {
 public:
 SfxTemplatePanelControl(SfxBindings* pBindings, weld::Widget* pParent);
@@ -37,7 +40,16 @@ public:
 weld::Builder* get_builder() { return m_xBuilder.get(); }
 weld::Container* get_container() { return m_xContainer.get(); }
 
+virtual void NotifyItemUpdate(const sal_uInt16 nSId, const SfxItemState 
eState,
+  const SfxPoolItem* pState) override;
+
+virtual void GetControlState(const sal_uInt16 /*nSId*/,
+ boost::property_tree::ptree& /*rState*/) 
override{};
+
 private:
+::sfx2::sidebar::ControllerItem m_aSpotlightParaStyles;
+::sfx2::sidebar::ControllerItem m_aSpotlightCharStyles;
+
 std::unique_ptr pImpl;
 };
 
diff --git 
a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu 
b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
index c0d820c0e43b..44a98e183ccc 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
@@ -429,6 +429,31 @@
 
   Spotlight Character Direct Formatting
 
+
+  Character Direct Formatting
+
+
+  1
+
+  
+  
+
+  Spotlight Paragraph Styles
+
+
+  Paragraph Styles
+
+
+  1
+
+  
+  
+
+  Spotlight Character Styles
+
+
+  Character Styles
+
 
   1
 
@@ -4214,6 +4239,14 @@
   Open the Accessibility Check Deck
 
   
+  
+
+  Spotlight
+
+
+  1
+
+  
 
   
 
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index 7f44bf64d366..db21ee720c2d 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -107,17 +107,6 @@ IMPL_LINK(SfxCommonTemplateDialog_Impl, 
OnAsyncExecuteDrop, void*, pStyleList, v
 ActionSelect("new", m_aStyleList);
 }
 
-SfxTemplatePanelControl::SfxTemplatePanelControl(SfxBindings* pBindings, 
weld::Widget* pParent)
-: PanelLayout(pParent, "TemplatePanel", "sfx/ui/templatepanel.ui")
-, pImpl(new SfxTemplateDialog_Impl(pBindings, this))
-{
-OSL_ASSERT(pBindings!=nullptr);
-}
-
-SfxTemplatePanelControl::~SfxTemplatePanelControl()
-{
-}
-
 namespace 

[Libreoffice-commits] core.git: include/sfx2 sc/source sd/source sfx2/source sw/inc sw/source

2023-10-16 Thread Paris Oplopoios (via logerrit)
 include/sfx2/viewsh.hxx |2 --
 sc/source/ui/inc/tabvwsh.hxx|2 --
 sc/source/ui/view/tabvwshc.cxx  |5 -
 sd/source/ui/inc/ViewShellBase.hxx  |2 --
 sd/source/ui/view/ViewShellBase.cxx |   12 
 sfx2/source/appl/appserv.cxx|   20 ++--
 sfx2/source/view/viewsh.cxx |6 --
 sw/inc/view.hxx |2 --
 sw/inc/viewopt.hxx  |2 +-
 sw/source/core/view/vnew.cxx|   17 +
 sw/source/uibase/uiview/viewprt.cxx |   14 --
 11 files changed, 4 insertions(+), 80 deletions(-)

New commits:
commit cfba837abe3137b2bb20ddb414bb91078c4a1c9f
Author: Paris Oplopoios 
AuthorDate: Fri Oct 13 15:55:51 2023 +0300
Commit: Paris Oplopoios 
CommitDate: Mon Oct 16 10:41:57 2023 +0200

Revert "Make sure views get new themes on .uno:ChangeTheme"

Seems to cause more issues than it solves, reverting for now

This reverts commit 884fd220d0025a92510d3ff4710c8c517c8f271e.

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

diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx
index c0628a0bd4fb..14d9ca94881c 100644
--- a/include/sfx2/viewsh.hxx
+++ b/include/sfx2/viewsh.hxx
@@ -431,8 +431,6 @@ public:
 virtual vcl::Window* GetEditWindowForActiveOLEObj() const override;
 /// Get a color config color from this view
 virtual ::Color GetColorConfigColor(svtools::ColorConfigEntry nColorType) 
const;
-/// Get the color scheme name of this view
-virtual OUString GetColorConfigName() const;
 
 /// Set the LibreOfficeKit language of this view.
 void SetLOKLanguageTag(const OUString& rBcp47LanguageTag);
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index 3c80dbc1995d..53b093695297 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -398,8 +398,6 @@ public:
 void NotifyCursor(SfxViewShell* pViewShell) const override;
 /// See SfxViewShell::GetColorConfigColor().
 ::Color GetColorConfigColor(svtools::ColorConfigEntry nColorType) const 
override;
-/// See SfxViewShell::GetColorConfigName().
-OUString GetColorConfigName() const override;
 /// Emits a LOK_CALLBACK_INVALIDATE_HEADER for all views whose current tab 
is equal to nCurrentTabIndex
 static void notifyAllViewsHeaderInvalidation(const SfxViewShell* 
pForViewShell, HeaderType eHeaderType, SCTAB nCurrentTabIndex);
 static bool isAnyEditViewInRange(const SfxViewShell* pForViewShell, bool 
bColumns, SCCOLROW nStart, SCCOLROW nEnd);
diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx
index 56cfba5ddfdb..bb3824d8e6a5 100644
--- a/sc/source/ui/view/tabvwshc.cxx
+++ b/sc/source/ui/view/tabvwshc.cxx
@@ -514,11 +514,6 @@ void ScTabViewShell::NotifyCursor(SfxViewShell* 
pOtherShell) const
 }
 }
 
-OUString ScTabViewShell::GetColorConfigName() const
-{
-return GetViewData().GetOptions().GetColorSchemeName();
-}
-
 css::uno::Reference 
ScTabViewShell::GetClipData(vcl::Window* pWin)
 {
 SfxViewFrame* pViewFrame = nullptr;
diff --git a/sd/source/ui/inc/ViewShellBase.hxx 
b/sd/source/ui/inc/ViewShellBase.hxx
index c2b2d16158e0..acdd244c70f3 100644
--- a/sd/source/ui/inc/ViewShellBase.hxx
+++ b/sd/source/ui/inc/ViewShellBase.hxx
@@ -221,8 +221,6 @@ public:
 void NotifyCursor(SfxViewShell* pViewShell) const override;
 /// See SfxViewShell::GetColorConfigColor().
 ::Color GetColorConfigColor(svtools::ColorConfigEntry nColorType) const 
override;
-/// See SfxViewShell::GetColorConfigName().
-OUString GetColorConfigName() const override;
 
 void setLOKVisibleArea(const ::tools::Rectangle& rArea) { maLOKVisibleArea 
= rArea; }
 virtual ::tools::Rectangle getLOKVisibleArea() const override { return 
maLOKVisibleArea; }
diff --git a/sd/source/ui/view/ViewShellBase.cxx 
b/sd/source/ui/view/ViewShellBase.cxx
index 9737245f89ff..6c083b2ef45c 100644
--- a/sd/source/ui/view/ViewShellBase.cxx
+++ b/sd/source/ui/view/ViewShellBase.cxx
@@ -1079,18 +1079,6 @@ void ViewShellBase::NotifyCursor(SfxViewShell* 
pOtherShell) const
 return {};
 }
 
-OUString ViewShellBase::GetColorConfigName() const
-{
-if (DrawViewShell* pCurrentDrawShell = 
dynamic_cast(GetMainViewShell().get()))
-{
-const SdViewOptions& rViewOptions = 
pCurrentDrawShell->GetViewOptions();
-return rViewOptions.msColorSchemeName;
-}
-
-SAL_WARN("sd", "dynamic_cast to DrawViewShell failed");
-return {};
-}
-
 //= ViewShellBase::Implementation =
 
 ViewShellBase::Implementation::Implementation (ViewShellBase& rBase)
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index 507cc60cc672..493361fabc0f 100644
--- a/sfx2/source/appl/appserv.cxx
+++ 

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

2023-10-11 Thread Noel Grandin (via logerrit)
 include/sfx2/sidebar/FocusManager.hxx |1 -
 sfx2/source/sidebar/FocusManager.cxx  |   11 ---
 2 files changed, 12 deletions(-)

New commits:
commit 03013f35a6d931df4b59bd6578f012a9271b186c
Author: Noel Grandin 
AuthorDate: Wed Oct 11 11:22:59 2023 +0200
Commit: Noel Grandin 
CommitDate: Wed Oct 11 19:08:54 2023 +0200

FocusManager::IsPanelTitleVisible is dead

ever since
commit df2c41859287282501c8ebd7b3c67465455a457c
Author: Noel Grandin 
Date:   Sat Sep 23 21:01:50 2023 +0200
MoveFocusInsideDeckTitle is dead

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

diff --git a/include/sfx2/sidebar/FocusManager.hxx 
b/include/sfx2/sidebar/FocusManager.hxx
index 4cb9394d28cd..6eaa877b4dca 100644
--- a/include/sfx2/sidebar/FocusManager.hxx
+++ b/include/sfx2/sidebar/FocusManager.hxx
@@ -107,7 +107,6 @@ private:
 
 void FocusDeckTitle();
 bool IsDeckTitleVisible() const;
-bool IsPanelTitleVisible(const sal_Int32 nPanelIndex) const;
 
 /** Set the focus to the title bar of the panel or, if the
 title bar is not visible, directly to the panel.
diff --git a/sfx2/source/sidebar/FocusManager.cxx 
b/sfx2/source/sidebar/FocusManager.cxx
index 416b6d39ce6b..e86de2b7de6a 100644
--- a/sfx2/source/sidebar/FocusManager.cxx
+++ b/sfx2/source/sidebar/FocusManager.cxx
@@ -193,17 +193,6 @@ bool FocusManager::IsDeckTitleVisible() const
 return mpDeckTitleBar != nullptr && mpDeckTitleBar->GetVisible();
 }
 
-bool FocusManager::IsPanelTitleVisible (const sal_Int32 nPanelIndex) const
-{
-if (nPanelIndex<0 || o3tl::make_unsigned(nPanelIndex)>=maPanels.size())
-return false;
-
-TitleBar* pTitleBar = maPanels[nPanelIndex]->GetTitleBar();
-if (!pTitleBar)
-return false;
-return pTitleBar->GetVisible();
-}
-
 void FocusManager::FocusPanel (
 const sal_Int32 nPanelIndex,
 const bool bFallbackToDeckTitle)


[Libreoffice-commits] core.git: include/sfx2 include/svl sc/source sd/source sfx2/source svx/source sw/source

2023-10-06 Thread Caolán McNamara (via logerrit)
 include/sfx2/event.hxx   |   12 +++-
 include/svl/hint.hxx |3 ++-
 sc/source/ui/app/inputwin.cxx|6 +++---
 sc/source/ui/docshell/docsh.cxx  |   11 ---
 sc/source/ui/docshell/externalrefmgr.cxx |6 ++
 sc/source/ui/navipi/navipi.cxx   |5 +++--
 sd/source/ui/view/ViewShellBase.cxx  |   10 +-
 sfx2/source/appl/sfxpicklist.cxx |8 
 sfx2/source/doc/sfxbasemodel.cxx |   13 +
 sfx2/source/view/viewfrm.cxx |4 ++--
 sfx2/source/view/viewsh.cxx  |6 --
 svx/source/form/fmundo.cxx   |4 ++--
 sw/source/uibase/app/apphdl.cxx  |7 ---
 sw/source/uibase/app/docsh2.cxx  |   15 +++
 sw/source/uibase/docvw/PostItMgr.cxx |5 +++--
 sw/source/uibase/uno/unoatxt.cxx |5 +++--
 sw/source/uibase/utlui/navipi.cxx|4 ++--
 17 files changed, 62 insertions(+), 62 deletions(-)

New commits:
commit 757a73379dba01fde853443a09583d862c404531
Author: Caolán McNamara 
AuthorDate: Fri Oct 6 09:31:28 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri Oct 6 12:40:59 2023 +0200

Related: cool#7373 add an SfxHintId::ThisIsAnSfxEventHint

to avoid cost of dynamic_cast of SdrHint to SfxEventHint

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

diff --git a/include/sfx2/event.hxx b/include/sfx2/event.hxx
index 021472830ab8..1024dd5b2423 100644
--- a/include/sfx2/event.hxx
+++ b/include/sfx2/event.hxx
@@ -196,11 +196,13 @@ class SFX2_DLLPUBLIC SfxEventHint : public SfxHint
 SfxEventHintId  nEventId;
 
 public:
-SfxEventHint( SfxEventHintId nId, OUString aName, SfxObjectShell *pObj )
-:   pObjShell(pObj),
-aEventName(std::move(aName)),
-nEventId(nId)
-{}
+SfxEventHint(SfxEventHintId nId, OUString aName, SfxObjectShell *pObj)
+: SfxHint(SfxHintId::ThisIsAnSfxEventHint)
+, pObjShell(pObj)
+, aEventName(std::move(aName))
+, nEventId(nId)
+{
+}
 
 SfxEventHintId  GetEventId() const
 { return nEventId; }
diff --git a/include/svl/hint.hxx b/include/svl/hint.hxx
index 91533d4ffdbb..ec0c7b1d9872 100644
--- a/include/svl/hint.hxx
+++ b/include/svl/hint.hxx
@@ -155,7 +155,8 @@ enum class SfxHintId {
 SwVirtPageNumHint,
 SwAutoFormatUsedHint,
 
-ThisIsAnSdrHint
+ThisIsAnSdrHint,
+ThisIsAnSfxEventHint
 };
 
 template< typename charT, typename traits >
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 802d2d7087e5..2bb29146da07 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -2443,16 +2443,16 @@ void ScPosWnd::Notify( SfxBroadcaster&, const SfxHint& 
rHint )
 if ( bFormulaMode )
 return;
 
+const SfxHintId nHintId = rHint.GetId();
 // Does the list of range names need updating?
-if ( auto pEventHint = dynamic_cast() )
+if (nHintId == SfxHintId::ThisIsAnSfxEventHint)
 {
-SfxEventHintId nEventId = pEventHint->GetEventId();
+SfxEventHintId nEventId = static_cast(rHint).GetEventId();
 if ( nEventId == SfxEventHintId::ActivateDoc )
 FillRangeNames();
 }
 else
 {
-const SfxHintId nHintId = rHint.GetId();
 if (nHintId == SfxHintId::ScAreasChanged || nHintId == 
SfxHintId::ScNavigatorUpdateAll)
 FillRangeNames();
 }
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index a869e740083c..96a1ff9407ff 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -707,11 +707,9 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& 
rHint )
 m_pAutoStyleList.reset( new ScAutoStyleList(this) );
 m_pAutoStyleList->AddInitial( aRange, aName1, nTimeout, aName2 );
 }
-else if ( auto pEventHint = dynamic_cast() )
+else if (rHint.GetId() == SfxHintId::ThisIsAnSfxEventHint)
 {
-SfxEventHintId nEventId = pEventHint->GetEventId();
-
-switch ( nEventId )
+switch (static_cast(rHint).GetEventId())
 {
 case SfxEventHintId::LoadFinished:
 {
@@ -1080,11 +1078,10 @@ void ScDocShell::Notify( SfxBroadcaster&, const 
SfxHint& rHint )
 }
 }
 
-const SfxEventHint* pSfxEventHint = dynamic_cast();
-if (!pSfxEventHint)
+if (rHint.GetId() != SfxHintId::ThisIsAnSfxEventHint)
 return;
 
-switch( pSfxEventHint->GetEventId() )
+switch(static_cast(rHint).GetEventId())
 {
case SfxEventHintId::CreateDoc:
 {
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx 

[Libreoffice-commits] core.git: include/sfx2 include/svtools sc/source sfx2/source svtools/source sw/source

2023-10-06 Thread Noel Grandin (via logerrit)
 include/sfx2/ipclient.hxx   |2 +-
 include/svtools/ehdl.hxx|5 -
 sc/source/ui/view/tabvwshb.cxx  |4 ++--
 sfx2/source/view/ipclient.cxx   |7 +++
 svtools/source/misc/ehdl.cxx|   14 +++---
 sw/source/uibase/table/tablemgr.cxx |2 +-
 6 files changed, 10 insertions(+), 24 deletions(-)

New commits:
commit 66123b319da98c6ecabcd9635eb2ed9c3de99f35
Author: Noel Grandin 
AuthorDate: Fri Oct 6 08:48:24 2023 +0200
Commit: Noel Grandin 
CommitDate: Fri Oct 6 09:53:07 2023 +0200

use more ErrCodeMsg

instead of a sideband mechanism to convey extra error message around

Change-Id: Ibd1fc8629c5b10bc6f9e6cbd30e8a20156ac13b5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157630
Reviewed-by: Mike Kaganski 
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/include/sfx2/ipclient.hxx b/include/sfx2/ipclient.hxx
index b95018c5614c..2e58f5e339bc 100644
--- a/include/sfx2/ipclient.hxx
+++ b/include/sfx2/ipclient.hxx
@@ -82,7 +82,7 @@ public:
 static SfxInPlaceClient* GetClient( SfxObjectShell const * pDoc, const 
css::uno::Reference < css::embed::XEmbeddedObject >& xObject );
 sal_Int64   GetAspect() const;
 sal_Int64   GetObjectMiscStatus() const;
-ErrCode DoVerb(sal_Int32 nVerb);
+ErrCodeMsg  DoVerb(sal_Int32 nVerb);
 voidVisAreaChanged();
 voidResetObject();
 boolIsUIActive() const;
diff --git a/include/svtools/ehdl.hxx b/include/svtools/ehdl.hxx
index 1f3b8d6cb17e..1e70ee1ca55e 100644
--- a/include/svtools/ehdl.hxx
+++ b/include/svtools/ehdl.hxx
@@ -23,8 +23,6 @@
 #include 
 #include 
 
-#include 
-
 typedef std::pair ErrMsgCode;
 SVT_DLLPUBLIC extern const ErrMsgCode RID_ERRHDL[];
 SVT_DLLPUBLIC extern const ErrMsgCode RID_ERRCTX[];
@@ -42,14 +40,11 @@ public:
 const ErrMsgCode* pIds = nullptr, const std::locale& rResLocaleP = 
SvtResLocale());
 bool GetString(const ErrCodeMsg& nErrId, OUString ) override;
 
-void SetExtendedMessage(ErrCode nErrId, const OUString& rStr);
-
 private:
 sal_uInt16 nCtxId;
 const ErrMsgCode* pIds;
 std::locale aResLocale;
 OUString aArg1;
-std::unordered_map m_extMessages;
 };
 
 class SVT_DLLPUBLIC SfxErrorHandler : private ErrorHandler
diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx
index 04c97bcea64f..f0415d03d9aa 100644
--- a/sc/source/ui/view/tabvwshb.cxx
+++ b/sc/source/ui/view/tabvwshb.cxx
@@ -159,7 +159,7 @@ void ScTabViewShell::ActivateObject(SdrOle2Obj* pObj, 
sal_Int32 nVerb)
 
 uno::Reference < embed::XEmbeddedObject > xObj = pObj->GetObjRef();
 vcl::Window* pWin = GetActiveWin();
-ErrCode nErr = ERRCODE_NONE;
+ErrCodeMsg nErr = ERRCODE_NONE;
 bool bErrorShown = false;
 
 {
@@ -174,7 +174,7 @@ void ScTabViewShell::ActivateObject(SdrOle2Obj* pObj, 
sal_Int32 nVerb)
 if (bNegativeX)
 pClient->SetNegativeX(true);
 
-if ( (sal_uInt32(nErr) & ERRCODE_ERROR_MASK) == 0 && xObj.is() )
+if ( (sal_uInt32(nErr.GetCode()) & ERRCODE_ERROR_MASK) == 0 && 
xObj.is() )
 {
 tools::Rectangle aRect = pObj->GetLogicRect();
 
diff --git a/sfx2/source/view/ipclient.cxx b/sfx2/source/view/ipclient.cxx
index 260bdff77f34..d8c27ea02558 100644
--- a/sfx2/source/view/ipclient.cxx
+++ b/sfx2/source/view/ipclient.cxx
@@ -894,10 +894,10 @@ sal_Int64 SfxInPlaceClient::GetAspect() const
 return m_xImp->m_nAspect;
 }
 
-ErrCode SfxInPlaceClient::DoVerb(sal_Int32 nVerb)
+ErrCodeMsg SfxInPlaceClient::DoVerb(sal_Int32 nVerb)
 {
 SfxErrorContext aEc(ERRCTX_SO_DOVERB, m_pViewSh->GetFrameWeld(), 
RID_SO_ERRCTX);
-ErrCode nError = ERRCODE_NONE;
+ErrCodeMsg nError = ERRCODE_NONE;
 
 if ( m_xImp->m_xObject.is() )
 {
@@ -996,8 +996,7 @@ ErrCode SfxInPlaceClient::DoVerb(sal_Int32 nVerb)
 catch (uno::Exception const&)
 {
 TOOLS_WARN_EXCEPTION("embeddedobj", 
"SfxInPlaceClient::DoVerb: -9 fallback path");
-nError = ERRCODE_SO_GENERALERROR;
-aEc.SetExtendedMessage(ERRCODE_SO_GENERALERROR, 
e.Message);
+nError = ErrCodeMsg(ERRCODE_SO_GENERALERROR, 
e.Message);
 }
 }
 }
diff --git a/svtools/source/misc/ehdl.cxx b/svtools/source/misc/ehdl.cxx
index ab602be60aaf..59613089a514 100644
--- a/svtools/source/misc/ehdl.cxx
+++ b/svtools/source/misc/ehdl.cxx
@@ -283,19 +283,11 @@ bool SfxErrorContext::GetString(const ErrCodeMsg& nErr, 
OUString )
 }
 }
 
-if (bRet)
-if (auto it = m_extMessages.find(sal_uInt32(nErr.GetCode())); it != 
m_extMessages.end())
-rStr += "\n" + it->second;
+// SfxInPlaceClient::DoVerb adds some extra info to report
+if (bRet && 

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

2023-09-19 Thread Noel Grandin (via logerrit)
 include/sfx2/objsh.hxx |2 -
 sc/source/ui/docshell/docsh.cxx|   38 ++---
 sc/source/ui/docshell/docsh4.cxx   |2 -
 sc/source/ui/miscdlgs/instbdlg.cxx |2 -
 sc/source/ui/miscdlgs/linkarea.cxx |2 -
 sd/source/ui/docshell/docshel4.cxx |2 -
 sfx2/source/doc/objmisc.cxx|2 -
 sfx2/source/doc/objstor.cxx|   12 +--
 sfx2/source/doc/sfxbasemodel.cxx   |6 ++---
 sw/source/core/doc/docglbl.cxx |2 -
 sw/source/uibase/app/docsh2.cxx|2 -
 sw/source/uibase/dbui/dbmgr.cxx|6 ++---
 12 files changed, 39 insertions(+), 39 deletions(-)

New commits:
commit 6ae179473b2a483120977479fc6f12406021
Author: Noel Grandin 
AuthorDate: Tue Sep 19 13:16:41 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue Sep 19 17:56:37 2023 +0200

rename SfxObjectShell::GetError -> GetErrorIgnoreWarning

to distinguish it from the very similar GetErrorCode()

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

diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index dfb69b264418..a214c242a1c7 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -290,7 +290,7 @@ public:
 SAL_DLLPRIVATE void SetMacroMode_Impl(bool bModal=true);
 
 voidResetError();
-ErrCode GetError() const;
+ErrCode GetErrorIgnoreWarning() const;
 ErrCode GetErrorCode() const;
 voidSetError(ErrCode rErr);
 
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index dc61327de9d1..2b568c5d8d54 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -1219,7 +1219,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
 
ScGlobal::GetCharsetValue(sItStr));
 if (eError != ERRCODE_NONE)
 {
-if (!GetError())
+if (!GetErrorIgnoreWarning())
 SetError(eError);
 
 if( eError.IsWarning() )
@@ -1256,7 +1256,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
 
 if (eError != ERRCODE_NONE)
 {
-if (!GetError())
+if (!GetErrorIgnoreWarning())
 SetError(eError);
 if( eError.IsWarning() )
 bRet = true;
@@ -1356,12 +1356,12 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
 
 if (eError != ERRCODE_NONE)
 {
-if (!GetError())
+if (!GetErrorIgnoreWarning())
 SetError(eError);
 if( eError.IsWarning() )
 bRet = true;
 }
-else if (!GetError() && (bOverflowRow || bOverflowCol || 
bOverflowCell))
+else if (!GetErrorIgnoreWarning() && (bOverflowRow || bOverflowCol 
|| bOverflowCell))
 {
 // precedence: row, column, cell
 ErrCode nWarn = (bOverflowRow ? SCWARN_IMPORT_ROW_OVERFLOW :
@@ -1395,7 +1395,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
 
 if (eError != ERRCODE_NONE)
 {
-if (!GetError())
+if (!GetErrorIgnoreWarning())
 SetError(eError);
 if( eError.IsWarning() )
 bRet = true;
@@ -1431,7 +1431,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
 ScGlobal::GetCharsetValue(sItStr));
 if (eError != ERRCODE_NONE)
 {
-if (!GetError())
+if (!GetErrorIgnoreWarning())
 SetError(eError);
 
 if( eError.IsWarning() )
@@ -1475,12 +1475,12 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
 
 if (eError != ERRCODE_NONE)
 {
-if (!GetError())
+if (!GetErrorIgnoreWarning())
 SetError(eError);
 if( eError.IsWarning() )
 bRet = true;
 }
-else if (!GetError() && (bOverflowRow || bOverflowCol || 
bOverflowCell))
+else if (!GetErrorIgnoreWarning() && (bOverflowRow || bOverflowCol 
|| bOverflowCell))
 {
 // precedence: row, column, cell
 ErrCode nWarn = (bOverflowRow ? SCWARN_IMPORT_ROW_OVERFLOW :
@@ -1497,7 +1497,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
 ErrCode eError = 
ScFormatFilter::Get().ScImportQuattroPro(rMedium.GetInStream(), *m_pDocument);
 if (eError != ERRCODE_NONE)
 {
-if (!GetError())
+if (!GetErrorIgnoreWarning())
 

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

2023-09-13 Thread Szymon Kłos (via logerrit)
 include/sfx2/notebookbar/SfxNotebookBar.hxx |2 +
 sfx2/source/notebookbar/SfxNotebookBar.cxx  |   32 
 2 files changed, 34 insertions(+)

New commits:
commit b33c175233ef6a9754fc4af647d82b9a51871a22
Author: Szymon Kłos 
AuthorDate: Tue Sep 12 09:02:41 2023 +0200
Commit: Szymon Kłos 
CommitDate: Wed Sep 13 08:31:28 2023 +0200

lok: fix notebookbar not initialized when switched from classic mode

This is revert of "tdf#155720 remove old skip notebookbar init workaround"
This reverts commit f95b5d12c59e612ee4643b385389fc791e31f76d.

Mentioned change introduced regression in loading notebookbar.

Steps to reproduce bug:
1. be sure cool is in classic/compact mode
2. restart the app so it will load in classic mode
3. switch to tabbed mode

Result: notebookbar is not initialized and style previews
and font selector are not present

Change-Id: I35d6682cdd6c028437b373a748ed9ec36418ac17
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156836
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 
(cherry picked from commit c0234520ba9afda5a8b32f7a04c2155cbfbe30ed)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156875
Tested-by: Jenkins

diff --git a/include/sfx2/notebookbar/SfxNotebookBar.hxx 
b/include/sfx2/notebookbar/SfxNotebookBar.hxx
index 55a318e40bdd..96f5805f50e0 100644
--- a/include/sfx2/notebookbar/SfxNotebookBar.hxx
+++ b/include/sfx2/notebookbar/SfxNotebookBar.hxx
@@ -77,6 +77,8 @@ private:
 static std::map>
 m_pNotebookBarWeldedWrapper;
 
+static void ResetActiveToolbarModeToDefault(vcl::EnumContext::Application 
eApp);
+
 DECL_DLLPRIVATE_STATIC_LINK(SfxNotebookBar, VclDisposeHdl, const 
SfxViewShell*, void);
 };
 
diff --git a/sfx2/source/notebookbar/SfxNotebookBar.cxx 
b/sfx2/source/notebookbar/SfxNotebookBar.cxx
index 7a9fef48cfca..3b33ef7dd781 100644
--- a/sfx2/source/notebookbar/SfxNotebookBar.cxx
+++ b/sfx2/source/notebookbar/SfxNotebookBar.cxx
@@ -290,6 +290,26 @@ bool SfxNotebookBar::IsActive(bool bConsiderSingleToolbar)
 return false;
 }
 
+void 
SfxNotebookBar::ResetActiveToolbarModeToDefault(vcl::EnumContext::Application 
eApp)
+{
+const OUString appName( lcl_getAppName( eApp ) );
+
+if ( appName.isEmpty() )
+return;
+
+const OUString aPath = 
"org.openoffice.Office.UI.ToolbarMode/Applications/" + appName;
+
+utl::OConfigurationTreeRoot aAppNode(
+
::comphelper::getProcessComponentContext(),
+aPath,
+true);
+if ( !aAppNode.isValid() )
+return;
+
+aAppNode.setNodeValue( "Active", Any( OUString( "Default" ) ) );
+aAppNode.commit();
+}
+
 void SfxNotebookBar::ExecMethod(SfxBindings& rBindings, const OUString& 
rUIName)
 {
 // Save active UI file name
@@ -359,6 +379,18 @@ bool SfxNotebookBar::StateMethod(SystemWindow* pSysWindow,
 {
 const SfxViewShell* pViewShell = SfxViewShell::Current();
 
+// Notebookbar was loaded too early what caused:
+//   * in LOK: Paste Special feature was incorrectly initialized
+// Skip first request so Notebookbar will be initialized after 
document was loaded
+static std::map bSkippedFirstInit;
+if (comphelper::LibreOfficeKit::isActive() && eApp == 
vcl::EnumContext::Application::Writer
+&& bSkippedFirstInit.find(pViewShell) == 
bSkippedFirstInit.end())
+{
+bSkippedFirstInit[pViewShell] = true;
+ResetActiveToolbarModeToDefault(eApp);
+return false;
+}
+
 RemoveListeners(pSysWindow);
 
 OUString aBuf = rUIFile + sFile;


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

2023-09-06 Thread Andreas Heinisch (via logerrit)
 include/sfx2/thumbnailviewitem.hxx |7 ---
 sfx2/source/control/recentdocsviewitem.cxx |   51 +
 sfx2/source/control/recentdocsviewitem.hxx |8 
 sfx2/source/control/thumbnailview.cxx  |   18 ++
 sfx2/source/control/thumbnailviewitem.cxx  |   34 ---
 5 files changed, 65 insertions(+), 53 deletions(-)

New commits:
commit 9a37652b79001bf5208841b9221dee851b9b6d0f
Author: Andreas Heinisch 
AuthorDate: Wed Sep 6 17:03:26 2023 +0200
Commit: Andreas Heinisch 
CommitDate: Wed Sep 6 22:06:09 2023 +0200

tdf#156959 - Remove pinned icons from thumbnail view item

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

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

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

diff --git a/include/sfx2/thumbnailviewitem.hxx 
b/include/sfx2/thumbnailviewitem.hxx
index 7c84b344a8a0..9495b08054e3 100644
--- a/include/sfx2/thumbnailviewitem.hxx
+++ b/include/sfx2/thumbnailviewitem.hxx
@@ -73,16 +73,11 @@ public:
 bool mbBorder;
 bool mbSelected;
 bool mbHover;
-bool mbPinned;
 BitmapEx maPreview1;
 OUString maTitle;
 OUString maHelpText;
 rtl::Reference< ThumbnailViewItemAcc > mxAcc;
 
-bool mbPinnedDocumentHighlighted;
-BitmapEx maPinnedDocumentBitmap;
-BitmapEx maPinnedDocumentBitmapHiglighted;
-
 ThumbnailViewItem(ThumbnailView& rView, sal_uInt16 nId);
 
 virtual ~ThumbnailViewItem ();
@@ -102,8 +97,6 @@ public:
 
 void setHighlight (bool state);
 
-bool isPinned () const { return mbPinned; }
-
 /** Updates own highlight status based on the aPoint position.
 
 Returns rectangle that needs to be invalidated.
diff --git a/sfx2/source/control/recentdocsviewitem.cxx 
b/sfx2/source/control/recentdocsviewitem.cxx
index 240ef0c32d9d..2070a4efe46e 100644
--- a/sfx2/source/control/recentdocsviewitem.cxx
+++ b/sfx2/source/control/recentdocsviewitem.cxx
@@ -130,7 +130,11 @@ 
RecentDocsViewItem::RecentDocsViewItem(sfx2::RecentDocsView , const OUStri
   m_isReadOnly(isReadOnly),
   m_bRemoveIconHighlighted(false),
   m_aRemoveRecentBitmap(BMP_RECENTDOC_REMOVE),
-  m_aRemoveRecentBitmapHighlighted(BMP_RECENTDOC_REMOVE_HIGHLIGHTED)
+  m_aRemoveRecentBitmapHighlighted(BMP_RECENTDOC_REMOVE_HIGHLIGHTED),
+  m_bPinned(isPinned),
+  m_bPinnedIconHighlighted(false),
+  m_aPinnedDocumentBitmap(BMP_PIN_DOC),
+  m_aPinnedDocumentBitmapHiglighted(BMP_PIN_DOC_HIGHLIGHTED)
 {
 OUString aTitle(rTitle);
 INetURLObject aURLObj(rURL);
@@ -230,7 +234,6 @@ RecentDocsViewItem::RecentDocsViewItem(sfx2::RecentDocsView 
, const OUStri
 
 maTitle = aTitle;
 maPreview1 = aThumbnail;
-mbPinned = isPinned;
 }
 
 ::tools::Rectangle RecentDocsViewItem::updateHighlight(bool bVisible, const 
Point& rPoint)
@@ -252,6 +255,21 @@ 
RecentDocsViewItem::RecentDocsViewItem(sfx2::RecentDocsView , const OUStri
 m_bRemoveIconHighlighted = false;
 }
 
+if (bVisible && getPinnedIconArea().Contains(rPoint))
+{
+if (!m_bPinnedIconHighlighted)
+aRect.Union(getPinnedIconArea());
+
+m_bPinnedIconHighlighted = true;
+}
+else
+{
+if (m_bPinnedIconHighlighted)
+aRect.Union(getPinnedIconArea());
+
+m_bPinnedIconHighlighted = false;
+}
+
 return aRect;
 }
 
@@ -265,6 +283,11 @@ 
RecentDocsViewItem::RecentDocsViewItem(sfx2::RecentDocsView , const OUStri
 aSize);
 }
 
+::tools::Rectangle RecentDocsViewItem::getPinnedIconArea() const
+{
+return ::tools::Rectangle(maPinPos, 
m_aPinnedDocumentBitmap.GetSizePixel());
+}
+
 OUString RecentDocsViewItem::getHelpText() const
 {
 return m_sHelpText;
@@ -274,10 +297,10 @@ void 
RecentDocsViewItem::Paint(drawinglayer::processor2d::BaseProcessor2D *pProc
 {
 ThumbnailViewItem::Paint(pProcessor, pAttrs);
 
-// paint the remove icon when hovered
+// paint the remove/pinned icon when hovered
 if (isHighlighted())
 {
-drawinglayer::primitive2d::Primitive2DContainer aSeq(1);
+drawinglayer::primitive2d::Primitive2DContainer aSeq(2);
 
 Point aIconPos(getRemoveIconArea().TopLeft());
 
@@ -285,6 +308,23 @@ void 
RecentDocsViewItem::Paint(drawinglayer::processor2d::BaseProcessor2D *pProc
 m_bRemoveIconHighlighted ? 
m_aRemoveRecentBitmapHighlighted : m_aRemoveRecentBitmap,
 B2DPoint(aIconPos.X(), aIconPos.Y(;
 
+// tdf#38742 - draw pinned icon
+

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

2023-08-31 Thread Noel Grandin (via logerrit)
 include/sfx2/thumbnailview.hxx|   10 ++
 sfx2/source/control/thumbnailview.cxx |   27 ++-
 2 files changed, 16 insertions(+), 21 deletions(-)

New commits:
commit eecf74196b852cddaaffbf7e0442fd2abbc36a5d
Author: Noel Grandin 
AuthorDate: Wed Aug 30 13:46:34 2023 +0200
Commit: Noel Grandin 
CommitDate: Thu Aug 31 08:34:42 2023 +0200

use concrete type for ThumbnailView::mxAccessible

avoid some unnecessary casting

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

diff --git a/include/sfx2/thumbnailview.hxx b/include/sfx2/thumbnailview.hxx
index 3da4af181ff5..a51db9df048b 100644
--- a/include/sfx2/thumbnailview.hxx
+++ b/include/sfx2/thumbnailview.hxx
@@ -25,8 +25,7 @@ class DataChangedEvent;
 class ScrollBar;
 class ThumbnailViewItem;
 typedef ::std::vector< ThumbnailViewItem* > ThumbnailValueItemList;
-
-
+class ThumbnailViewAcc;
 struct ThumbnailItemAttributes;
 
 /*
@@ -169,6 +168,9 @@ public:
 
 virtual ~ThumbnailView() override;
 
+ThumbnailView& operator=( ThumbnailView const & ) = delete; // MSVC 
workaround
+ThumbnailView( ThumbnailView const & ) = delete; // MSVC workaround
+
 virtual bool MouseMove(const MouseEvent& rMEvt) override;
 
 /// Updates information in the view; used only in RecentDocsView ATM.
@@ -252,7 +254,7 @@ protected:
 
 virtual css::uno::Reference< css::accessibility::XAccessible > 
CreateAccessible() override;
 
-const css::uno::Reference & 
getAccessible() const;
+const rtl::Reference & getAccessible() const;
 
 protected:
 
@@ -287,7 +289,7 @@ protected:
 protected:
 
 std::vector< std::unique_ptr > mItemList;
-css::uno::Reference mxAccessible;
+rtl::Reference mxAccessible;
 ThumbnailValueItemList mFilteredItemList; ///< Cache to store the filtered 
items
 ThumbnailValueItemList::iterator mpStartSelRange;
 tools::Long mnItemWidth;
diff --git a/sfx2/source/control/thumbnailview.cxx 
b/sfx2/source/control/thumbnailview.cxx
index 12bfcb327143..b0cc1efefb27 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -160,10 +160,8 @@ 
ThumbnailView::ThumbnailView(std::unique_ptr xWindow, std:
 
 ThumbnailView::~ThumbnailView()
 {
-css::uno::Reference< css::lang::XComponent> xComponent(mxAccessible, 
css::uno::UNO_QUERY);
-
-if (xComponent.is())
-xComponent->dispose();
+if (mxAccessible.is())
+mxAccessible->dispose();
 
 mpItemAttrs.reset();
 
@@ -328,7 +326,7 @@ css::uno::Reference< css::accessibility::XAccessible > 
ThumbnailView::CreateAcce
 return mxAccessible;
 }
 
-const css::uno::Reference< css::accessibility::XAccessible > & 
ThumbnailView::getAccessible() const
+const rtl::Reference< ThumbnailViewAcc > & ThumbnailView::getAccessible() const
 {
 return mxAccessible;
 }
@@ -550,16 +548,13 @@ ThumbnailViewItem* ThumbnailView::ImplGetVisibleItem( 
sal_uInt16 nVisiblePos )
 
 void ThumbnailView::ImplFireAccessibleEvent( short nEventId, const 
css::uno::Any& rOldValue, const css::uno::Any& rNewValue )
 {
-ThumbnailViewAcc* pAcc = ThumbnailViewAcc::getImplementation(mxAccessible);
-
-if( pAcc )
-pAcc->FireAccessibleEvent( nEventId, rOldValue, rNewValue );
+if( mxAccessible )
+mxAccessible->FireAccessibleEvent( nEventId, rOldValue, rNewValue );
 }
 
 bool ThumbnailView::ImplHasAccessibleListeners() const
 {
-ThumbnailViewAcc* pAcc = ThumbnailViewAcc::getImplementation(mxAccessible);
-return( pAcc && pAcc->HasAccessibleListeners() );
+return mxAccessible && mxAccessible->HasAccessibleListeners();
 }
 
 IMPL_LINK_NOARG(ThumbnailView, ImplScrollHdl, weld::ScrolledWindow&, void)
@@ -950,9 +945,8 @@ void ThumbnailView::GetFocus()
 }
 
 // Tell the accessible object that we got the focus.
-ThumbnailViewAcc* pAcc = ThumbnailViewAcc::getImplementation(mxAccessible);
-if( pAcc )
-pAcc->GetFocus();
+if( mxAccessible )
+mxAccessible->GetFocus();
 
 CustomWidgetController::GetFocus();
 }
@@ -962,9 +956,8 @@ void ThumbnailView::LoseFocus()
 CustomWidgetController::LoseFocus();
 
 // Tell the accessible object that we lost the focus.
-ThumbnailViewAcc* pAcc = ThumbnailViewAcc::getImplementation(mxAccessible);
-if( pAcc )
-pAcc->LoseFocus();
+if( mxAccessible )
+mxAccessible->LoseFocus();
 }
 
 void ThumbnailView::Resize()


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

2023-08-30 Thread Noel Grandin (via logerrit)
 include/sfx2/thumbnailviewitem.hxx|8 ++--
 sfx2/source/control/thumbnailview.cxx |   12 ++--
 sfx2/source/control/thumbnailviewitem.cxx |4 ++--
 3 files changed, 14 insertions(+), 10 deletions(-)

New commits:
commit dbe8597ce4f8c503ac10836570a76a607b2ebb9c
Author: Noel Grandin 
AuthorDate: Wed Aug 30 13:42:09 2023 +0200
Commit: Noel Grandin 
CommitDate: Wed Aug 30 21:33:35 2023 +0200

use concrete type for ThumbnailViewItem::mxAcc

avoid some unnecessary casting

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

diff --git a/include/sfx2/thumbnailviewitem.hxx 
b/include/sfx2/thumbnailviewitem.hxx
index 64644b772d64..7c84b344a8a0 100644
--- a/include/sfx2/thumbnailviewitem.hxx
+++ b/include/sfx2/thumbnailviewitem.hxx
@@ -27,6 +27,7 @@
 
 namespace com::sun::star::accessibility { class XAccessible; }
 namespace drawinglayer::primitive2d { class Primitive2DContainer; }
+class ThumbnailViewItemAcc;
 
 #define THUMBNAILVIEW_ITEM_NONEITEM  0xFFFE
 
@@ -76,7 +77,7 @@ public:
 BitmapEx maPreview1;
 OUString maTitle;
 OUString maHelpText;
-css::uno::Reference< css::accessibility::XAccessible > mxAcc;
+rtl::Reference< ThumbnailViewItemAcc > mxAcc;
 
 bool mbPinnedDocumentHighlighted;
 BitmapEx maPinnedDocumentBitmap;
@@ -86,6 +87,9 @@ public:
 
 virtual ~ThumbnailViewItem ();
 
+ThumbnailViewItem& operator=( ThumbnailViewItem const & ) = delete; // 
MSVC workaround
+ThumbnailViewItem( ThumbnailViewItem const & ) = delete; // MSVC workaround
+
 bool isVisible () const { return mbVisible; }
 
 void show (bool bVisible);
@@ -115,7 +119,7 @@ public:
 
 void setTitle (const OUString& rTitle);
 
-css::uno::Reference< css::accessibility::XAccessible > const &
+rtl::Reference< ThumbnailViewItemAcc > const &
 GetAccessible( bool bIsTransientChildrenDisabled );
 
 void setDrawArea (const tools::Rectangle );
diff --git a/sfx2/source/control/thumbnailview.cxx 
b/sfx2/source/control/thumbnailview.cxx
index ca839162f0a2..12bfcb327143 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -294,7 +294,7 @@ void ThumbnailView::ImplDeleteItems()
 {
 css::uno::Any aOldAny, aNewAny;
 
-aOldAny <<= pItem->GetAccessible( false );
+aOldAny <<= 
css::uno::Reference(pItem->GetAccessible( 
false ));
 ImplFireAccessibleEvent( 
css::accessibility::AccessibleEventId::CHILD, aOldAny, aNewAny );
 }
 
@@ -438,7 +438,7 @@ void ThumbnailView::CalculateItemPositions(bool 
bScrollBarUsed)
 {
 css::uno::Any aOldAny, aNewAny;
 
-aNewAny <<= pItem->GetAccessible( false );
+aNewAny <<= 
css::uno::Reference(pItem->GetAccessible( 
false ));
 ImplFireAccessibleEvent( 
css::accessibility::AccessibleEventId::CHILD, aOldAny, aNewAny );
 }
 
@@ -466,7 +466,7 @@ void ThumbnailView::CalculateItemPositions(bool 
bScrollBarUsed)
 {
 css::uno::Any aOldAny, aNewAny;
 
-aOldAny <<= pItem->GetAccessible( false );
+aOldAny <<= 
css::uno::Reference(pItem->GetAccessible( 
false ));
 ImplFireAccessibleEvent( 
css::accessibility::AccessibleEventId::CHILD, aOldAny, aNewAny );
 }
 
@@ -1124,12 +1124,12 @@ void ThumbnailView::SelectItem( sal_uInt16 nItemId )
 return;
 
 // focus event (select)
-ThumbnailViewItemAcc* pItemAcc = ThumbnailViewItemAcc::getImplementation( 
pItem->GetAccessible( false ) );
+const rtl::Reference & pItemAcc = 
pItem->GetAccessible( false );
 
 if( pItemAcc )
 {
 css::uno::Any aOldAny, aNewAny;
-aNewAny <<= css::uno::Reference(getXWeak( pItemAcc ));
+aNewAny <<= css::uno::Reference( 
pItemAcc );
 ImplFireAccessibleEvent( 
css::accessibility::AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, aOldAny, 
aNewAny );
 }
 
@@ -1207,7 +1207,7 @@ void ThumbnailView::filterItems(const std::functionGetAccessible( false );
+aOldAny <<= 
css::uno::Reference(pItem->GetAccessible( 
false ));
 ImplFireAccessibleEvent( 
css::accessibility::AccessibleEventId::CHILD, aOldAny, aNewAny );
 }
 
diff --git a/sfx2/source/control/thumbnailviewitem.cxx 
b/sfx2/source/control/thumbnailviewitem.cxx
index ca8920acafd2..9579889e7e9a 100644
--- a/sfx2/source/control/thumbnailviewitem.cxx
+++ b/sfx2/source/control/thumbnailviewitem.cxx
@@ -67,7 +67,7 @@ ThumbnailViewItem::~ThumbnailViewItem()
 {
 if( mxAcc.is() )
 {
-static_cast< ThumbnailViewItemAcc* >( mxAcc.get() )->ParentDestroyed();
+mxAcc->ParentDestroyed();
 }
 }
 
@@ -129,7 +129,7 @@ void 

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

2023-08-30 Thread Balazs Varga (via logerrit)
 include/sfx2/AccessibilityIssue.hxx  |3 +
 sw/source/core/access/AccessibilityCheck.cxx |8 -
 sw/source/core/access/AccessibilityIssue.cxx |   43 +++
 sw/source/core/inc/AccessibilityIssue.hxx|3 +
 sw/source/core/layout/atrfrm.cxx |   13 ++--
 5 files changed, 48 insertions(+), 22 deletions(-)

New commits:
commit bac847ded67941c6db21a2f041a0b9dad9d2b0bd
Author: Balazs Varga 
AuthorDate: Mon Aug 28 14:59:30 2023 +0200
Commit: Balazs Varga 
CommitDate: Wed Aug 30 12:13:15 2023 +0200

Related tdf#156116 - A11Y - show only one warning/textframes

Only give one warninig message (Anchor Frames/Text boxes “As Character“.)
per floating textframes.

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

diff --git a/include/sfx2/AccessibilityIssue.hxx 
b/include/sfx2/AccessibilityIssue.hxx
index f20ce70331be..ac9ad6adb73b 100644
--- a/include/sfx2/AccessibilityIssue.hxx
+++ b/include/sfx2/AccessibilityIssue.hxx
@@ -44,6 +44,7 @@ class SFX2_DLLPUBLIC AccessibilityIssue
 {
 public:
 AccessibilityIssue(AccessibilityIssueID eIssueID = 
AccessibilityIssueID::UNSPECIFIED);
+AccessibilityIssue(AccessibilityIssue const&) = default;
 virtual ~AccessibilityIssue();
 
 virtual bool canGotoIssue() const = 0;
@@ -54,6 +55,8 @@ public:
 
 void setParent(weld::Window* pParent) { m_pParent = pParent; }
 
+AccessibilityIssue& operator=(const AccessibilityIssue&) = default;
+
 AccessibilityIssueID m_eIssueID;
 OUString m_aIssueText;
 
diff --git a/sw/source/core/access/AccessibilityCheck.cxx 
b/sw/source/core/access/AccessibilityCheck.cxx
index 16981ccacb06..8c6f11678dd3 100644
--- a/sw/source/core/access/AccessibilityCheck.cxx
+++ b/sw/source/core/access/AccessibilityCheck.cxx
@@ -1176,6 +1176,10 @@ public:
 /// Check for floating text frames, as it causes problems with reading order.
 class FloatingTextCheck : public NodeCheck
 {
+private:
+// list of already added textframes.
+std::map m_vIdx;
+
 public:
 FloatingTextCheck(sfx::AccessibilityIssueCollection& rIssueCollection)
 : NodeCheck(rIssueCollection)
@@ -1192,7 +1196,9 @@ public:
 // If a node is in fly and if it is not anchored as char, throw 
warning.
 const SwNode* startFly = pCurrent->FindFlyStartNode();
 if (startFly
-&& startFly->GetFlyFormat()->GetAnchor().GetAnchorId() != 
RndStdIds::FLY_AS_CHAR)
+&& startFly->GetFlyFormat()->GetAnchor().GetAnchorId() != 
RndStdIds::FLY_AS_CHAR
+&& m_vIdx.insert(std::make_pair(SwNodeIndex(*startFly), 
SwNodeIndex(*pCurrent))).second
+   == true)
 {
 auto pIssue = lclAddIssue(m_rIssueCollection, 
SwResId(STR_FLOATING_TEXT));
 pIssue->setIssueObject(IssueObject::TEXTFRAME);
diff --git a/sw/source/core/access/AccessibilityIssue.cxx 
b/sw/source/core/access/AccessibilityIssue.cxx
index 1cb1a9a87213..edef0861c10c 100644
--- a/sw/source/core/access/AccessibilityIssue.cxx
+++ b/sw/source/core/access/AccessibilityIssue.cxx
@@ -62,22 +62,27 @@ void AccessibilityIssue::gotoIssue() const
 if (!m_pDoc)
 return;
 
-switch (m_eIssueObject)
+/* Copying the issueobject because the EnterSelFrameMode ends up calling 
some sidebar functions
+that recreate the list of a11y issues and the AccessibilityIssue objects 
are stored by value in a vector
+and the vector is being mutated there and so the instance is overwritten 
with something else. */
+AccessibilityIssue TempObject(*this);
+
+switch (TempObject.m_eIssueObject)
 {
 case IssueObject::GRAPHIC:
 case IssueObject::OLE:
 case IssueObject::TEXTFRAME:
 {
-SwWrtShell* pWrtShell = m_pDoc->GetDocShell()->GetWrtShell();
-bool bSelected = pWrtShell->GotoFly(m_sObjectID, FLYCNTTYPE_ALL, 
true);
+SwWrtShell* pWrtShell = 
TempObject.m_pDoc->GetDocShell()->GetWrtShell();
+bool bSelected = pWrtShell->GotoFly(TempObject.m_sObjectID, 
FLYCNTTYPE_ALL, true);
 if (bSelected && pWrtShell->IsFrameSelected())
 {
 pWrtShell->HideCursor();
 pWrtShell->EnterSelFrameMode();
 }
 
-if (!bSelected && m_eIssueObject == IssueObject::TEXTFRAME)
-pWrtShell->GotoDrawingObject(m_sObjectID);
+if (!bSelected && TempObject.m_eIssueObject == 
IssueObject::TEXTFRAME)
+pWrtShell->GotoDrawingObject(TempObject.m_sObjectID);
 
 if (comphelper::LibreOfficeKit::isActive())
 pWrtShell->ShowCursor();
@@ -85,21 +90,21 @@ void AccessibilityIssue::gotoIssue() const
 break;
 case IssueObject::SHAPE:
 {
-SwWrtShell* pWrtShell = m_pDoc->GetDocShell()->GetWrtShell();
-

[Libreoffice-commits] core.git: include/sfx2 officecfg/registry sc/inc sc/qa sc/source sc/uiconfig

2023-08-23 Thread Attila Szűcs (via logerrit)
 include/sfx2/docfilt.hxx  |1 
 officecfg/registry/schema/org/openoffice/Office/Calc.xcs  |7 
 sc/inc/appoptio.hxx   |4 
 sc/inc/sc.hrc |1 
 sc/qa/uitest/calc_tests9/tdf156611_hyperlink_interoper.py |  124 ++
 sc/source/core/tool/appoptio.cxx  |   13 +
 sc/source/ui/app/scmod.cxx|   10 +
 sc/source/ui/inc/editsh.hxx   |1 
 sc/source/ui/inc/tpcompatibility.hxx  |1 
 sc/source/ui/optdlg/tpcompatibility.cxx   |   15 +
 sc/source/ui/view/editsh.cxx  |   95 +-
 sc/uiconfig/scalc/ui/optcompatibilitypage.ui  |   60 ++
 12 files changed, 316 insertions(+), 16 deletions(-)

New commits:
commit 24cd55341bc3f3e8ed9d5ff23efd47a53532f283
Author: Attila Szűcs 
AuthorDate: Mon Jul 31 04:37:07 2023 +0200
Commit: Tomaž Vajngerl 
CommitDate: Wed Aug 23 15:23:16 2023 +0200

tdf#156611 SC: hyperlink option for MS behaviour

Added an options that can limit Calc to behave like MS excel in case
of inserting hyperlinks, when MS format document is used.
Tools -> Options -> LibreOfficeDev Calc -> Compatibility -> Hyperlinks

In MS excel, only cells can have a hyperlink, and only 1.
In Calc even textfields in a cell can have hyperlinks, so it can have
multiple links in a cell, but once saved as MS format, and reloaded,
textfield links will become cell links, if there was 1 link in the cell.
If there was more links in the cell, then all will be lost.

So, when MS excel format document is edited in calc, the ability to make
text field links is useless can be missleading, and confuse users.

If this option is set, and an MS file format is opened, then insering a
hyperlink will work like if we selected the whole cell to insert the
hyperlink.

Change-Id: I7174216d10cf250d48f23f71ae681c46f7610bbc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155079
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/sfx2/docfilt.hxx b/include/sfx2/docfilt.hxx
index 9dbbb37b87d2..45dd0efb9b29 100644
--- a/include/sfx2/docfilt.hxx
+++ b/include/sfx2/docfilt.hxx
@@ -80,6 +80,7 @@ public:
 bool GetSupportsSigning() const { return bool(nFormatType & 
SfxFilterFlags::SUPPORTSSIGNING); }
 bool GetGpgEncryption() const { return bool(nFormatType & 
SfxFilterFlags::GPGENCRYPTION); }
 bool IsOwnTemplateFormat() const { return bool(nFormatType & 
SfxFilterFlags::TEMPLATEPATH); }
+bool IsMSOFormat() const { return aTypeName.startsWith("MS"); }
 /// not our built-in format
 bool IsAlienFormat() const { return bool(nFormatType & 
SfxFilterFlags::ALIEN); }
 /// an unusual/legacy file to be loading
diff --git a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
index eff7ac7aa80a..a41de7a36b8a 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
@@ -1861,6 +1861,13 @@
   
 
   
+  
+
+  Insert link for the cell, instead of text fields in a 
cell.(Excel iteropability options)
+  Links like Excel
+
+false
+  
 
 
   
diff --git a/sc/inc/appoptio.hxx b/sc/inc/appoptio.hxx
index 793dc707a67f..d9e22c9cba78 100644
--- a/sc/inc/appoptio.hxx
+++ b/sc/inc/appoptio.hxx
@@ -77,6 +77,9 @@ public:
 ScOptionsUtil::KeyBindingType GetKeyBindingType() const { return 
meKeyBindingType; }
 voidSetKeyBindingType( ScOptionsUtil::KeyBindingType e ) { 
meKeyBindingType = e; }
 
+voidSetLinksInsertedLikeMSExcel(bool bNew) { 
mbLinksInsertedLikeMSExcel = bNew; }
+boolGetLinksInsertedLikeMSExcel() const { return 
mbLinksInsertedLikeMSExcel; }
+
 ScAppOptions& operator=   ( const ScAppOptions& rOpt );
 
 private:
@@ -99,6 +102,7 @@ private:
 sal_Int32   nDefaultObjectSizeHeight;
 boolmbShowSharedDocumentWarning;
 ScOptionsUtil::KeyBindingType meKeyBindingType;
+boolmbLinksInsertedLikeMSExcel;
 };
 
 //  Config Item containing app options
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index 534ff7ab6795..d1b13b767eb0 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -621,6 +621,7 @@ static_assert(SID_PREVIEW_END < SID_KEYFUNC_START, "calc 
slots ids trampling inf
 #define SID_GROUP_SPARKLINES(SID_NEW_SLOTS+114)
 #define SID_UNGROUP_SPARKLINES  (SID_NEW_SLOTS+115)
 #define SID_EDIT_SPARKLINE  (SID_NEW_SLOTS+116)
+#define SID_SC_OPT_LINKSTypedWhichId(SID_NEW_SLOTS + 
117)
 
 // idl parameter
 
diff --git a/sc/qa/uitest/calc_tests9/tdf156611_hyperlink_interoper.py 

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

2023-08-18 Thread Caolán McNamara (via logerrit)
 include/sfx2/lokhelper.hxx |3 +++
 sfx2/source/view/lokhelper.cxx |9 -
 2 files changed, 11 insertions(+), 1 deletion(-)

New commits:
commit 560b5112f6738f02a12adec7d5be04e2411c93b9
Author: Caolán McNamara 
AuthorDate: Thu Aug 17 20:22:02 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri Aug 18 18:32:18 2023 +0200

add a SfxLokHelper::notifyInvalidation which can take a 'part'

no change in behaviour intended

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

diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx
index b46097938695..26b222bc8aa9 100644
--- a/include/sfx2/lokhelper.hxx
+++ b/include/sfx2/lokhelper.hxx
@@ -138,6 +138,9 @@ public:
 /// Emits a LOK_CALLBACK_DOCUMENT_SIZE_CHANGED for all views of the same 
document with the same part
 static void notifyPartSizeChangedAllViews(vcl::ITiledRenderable* pDoc, int 
nPart);
 /// Emits a LOK_CALLBACK_INVALIDATE_TILES, but tweaks it according to 
setOptionalFeatures() if needed.
+static void notifyInvalidation(SfxViewShell const* pThisView, int nPart, 
tools::Rectangle const *);
+/// Emits a LOK_CALLBACK_INVALIDATE_TILES, but tweaks it according to 
setOptionalFeatures() if needed
+/// uses the Part reported by pThisView
 static void notifyInvalidation(SfxViewShell const* pThisView, 
tools::Rectangle const *);
 /// Notifies all views with the given type and payload.
 static void notifyAllViews(int nType, const OString& rPayload);
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index 5bf6e8a1a2c4..cc3920fd0f35 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -610,12 +610,19 @@ void SfxLokHelper::notifyWindow(const SfxViewShell* 
pThisView,
 }
 
 void SfxLokHelper::notifyInvalidation(SfxViewShell const* pThisView, 
tools::Rectangle const* pRect)
+{
+// -1 means all parts
+const int nPart = comphelper::LibreOfficeKit::isPartInInvalidation() ? 
pThisView->getPart() : INT_MIN;
+SfxLokHelper::notifyInvalidation(pThisView, nPart, pRect);
+}
+
+void SfxLokHelper::notifyInvalidation(SfxViewShell const* pThisView, const int 
nInPart, tools::Rectangle const* pRect)
 {
 if (DisableCallbacks::disabled())
 return;
 
 // -1 means all parts
-const int nPart = comphelper::LibreOfficeKit::isPartInInvalidation() ? 
pThisView->getPart() : INT_MIN;
+const int nPart = comphelper::LibreOfficeKit::isPartInInvalidation() ? 
nInPart : INT_MIN;
 const int nMode = pThisView->getEditMode();
 pThisView->libreOfficeKitViewInvalidateTilesCallback(pRect, nPart, nMode);
 }


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

2023-08-16 Thread Balazs Varga (via logerrit)
 include/sfx2/sfxsids.hrc |1 +
 sfx2/sdi/sfx.sdi |   18 ++
 sw/sdi/_docsh.sdi|6 ++
 sw/sdi/swriter.sdi   |6 +++---
 sw/source/core/access/AccessibilityCheck.cxx |8 ++--
 sw/source/core/access/AccessibilityIssue.cxx |   19 +--
 sw/source/core/inc/AccessibilityIssue.hxx|1 +
 sw/source/uibase/app/docst.cxx   |4 +++-
 8 files changed, 55 insertions(+), 8 deletions(-)

New commits:
commit b4cbf44e8d5072e79b62e6b4e3b1c2480e4a34f3
Author: Balazs Varga 
AuthorDate: Tue Aug 8 21:06:59 2023 +0200
Commit: Samuel Mehrbrodt 
CommitDate: Wed Aug 16 17:03:47 2023 +0200

tdf#156591 - A11Y - add fix button for "Style has no language set."

Open style language character settings if the language is set to 'None'.
Add EditStyleFont uno command for editing directly Font of paragraph styles.

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

diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc
index b88b778714a8..cc94d98ac664 100644
--- a/include/sfx2/sfxsids.hrc
+++ b/include/sfx2/sfxsids.hrc
@@ -374,6 +374,7 @@ class SvxZoomItem;
 #define SID_STYLE_APPLY 
TypedWhichId(SID_SFX_START + 552)
 #define SID_STYLE_FAMILY
TypedWhichId(SID_SFX_START + 553)
 #define SID_STYLE_FAMILYNAME
TypedWhichId(SID_SFX_START + 566)
+#define SID_STYLE_FONT  
TypedWhichId(SID_SFX_START + 558)
 #define SID_STYLE_WATERCAN  
TypedWhichId(SID_SFX_START + 554)
 #define SID_STYLE_NEW_BY_EXAMPLE
TypedWhichId(SID_SFX_START + 555)
 #define SID_STYLE_UPDATE_BY_EXAMPLE 
TypedWhichId(SID_SFX_START + 556)
diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi
index 4adb0f1b94fe..6541b39e47cd 100644
--- a/sfx2/sdi/sfx.sdi
+++ b/sfx2/sdi/sfx.sdi
@@ -1103,6 +1103,24 @@ SfxVoidItem EditStyle SID_STYLE_EDIT
 ]
 
 
+SfxVoidItem EditStyleFont SID_STYLE_FONT
+(SfxStringItem Param SID_STYLE_FONT,SfxUInt16Item Family SID_STYLE_FAMILY)
+[
+AutoUpdate = FALSE,
+FastCall = FALSE,
+ReadOnlyDoc = FALSE,
+Toggle = FALSE,
+Container = FALSE,
+RecordAbsolute = FALSE,
+RecordPerSet;
+
+AccelConfig = FALSE,
+MenuConfig = FALSE,
+ToolBoxConfig = FALSE,
+GroupId = SfxGroupId::Template;
+]
+
+
 SfxVoidItem HideStyle SID_STYLE_HIDE
 (SfxStringItem Param SID_STYLE_HIDE,SfxUInt16Item Family SID_STYLE_FAMILY)
 [
diff --git a/sw/sdi/_docsh.sdi b/sw/sdi/_docsh.sdi
index 60435805d761..5a398feff6d8 100644
--- a/sw/sdi/_docsh.sdi
+++ b/sw/sdi/_docsh.sdi
@@ -42,6 +42,12 @@ interface BaseTextDocument
 StateMethod = StateStyleSheet ;
 ]
 
+SID_STYLE_FONT
+[
+ExecMethod = ExecStyleSheet ;
+StateMethod = StateStyleSheet ;
+]
+
 SID_STYLE_DELETE
 [
 ExecMethod = ExecStyleSheet ;
diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi
index 92fc37a342a3..56b381881939 100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -4909,9 +4909,9 @@ SfxVoidItem PageAreaDialog FN_FORMAT_PAGE_AREA_DLG
 RecordPerSet;
 Asynchron;
 
-AccelConfig = TRUE,
-MenuConfig = TRUE,
-ToolBoxConfig = TRUE,
+AccelConfig = FALSE,
+MenuConfig = FALSE,
+ToolBoxConfig = FALSE,
 GroupId = SfxGroupId::Format;
 ]
 
diff --git a/sw/source/core/access/AccessibilityCheck.cxx 
b/sw/source/core/access/AccessibilityCheck.cxx
index c73de2bccfc6..1022337e73b7 100644
--- a/sw/source/core/access/AccessibilityCheck.cxx
+++ b/sw/source/core/access/AccessibilityCheck.cxx
@@ -1374,8 +1374,12 @@ public:
 OUString sName = pTextFormatCollection->GetName();
 OUString sIssueText
 = 
SwResId(STR_STYLE_NO_LANGUAGE).replaceAll("%STYLE_NAME%", sName);
-lclAddIssue(m_rIssueCollection, sIssueText,
-sfx::AccessibilityIssueID::STYLE_LANGUAGE);
+
+auto pIssue = lclAddIssue(m_rIssueCollection, sIssueText,
+  
sfx::AccessibilityIssueID::STYLE_LANGUAGE);
+pIssue->setIssueObject(IssueObject::LANGUAGE_NOT_SET);
+pIssue->setObjectID(sName);
+pIssue->setDoc(*pDoc);
 }
 }
 }
diff --git a/sw/source/core/access/AccessibilityIssue.cxx 
b/sw/source/core/access/AccessibilityIssue.cxx
index 6810cc05cdfc..5c1744ad 100644
--- a/sw/source/core/access/AccessibilityIssue.cxx
+++ b/sw/source/core/access/AccessibilityIssue.cxx
@@ -51,7 +51,8 @@ bool AccessibilityIssue::canGotoIssue() const
 {
 if (m_pDoc && m_eIssueObject != IssueObject::UNKNOWN
 && m_eIssueObject != IssueObject::DOCUMENT_TITLE
-&& 

[Libreoffice-commits] core.git: include/sfx2 sfx2/inc sfx2/source sfx2/uiconfig solenv/sanitizers

2023-08-15 Thread Jim Raykowski (via logerrit)
 include/sfx2/charwin.hxx   |7 
 sfx2/inc/charmapcontrol.hxx|3 
 sfx2/source/control/charmapcontrol.cxx |   22 +
 sfx2/source/control/charwin.cxx|   39 +++
 sfx2/uiconfig/ui/charmapcontrol.ui |  370 +
 solenv/sanitizers/ui/sfx.suppr |1 
 6 files changed, 260 insertions(+), 182 deletions(-)

New commits:
commit 717fa28e88f382ad86b2be2fdbc24f4f60bc524d
Author: Jim Raykowski 
AuthorDate: Fri Aug 4 21:27:15 2023 -0800
Commit: Jim Raykowski 
CommitDate: Wed Aug 16 07:50:25 2023 +0200

tdf#156538 Enhancement to show character information in the insert

special characters control

This patch makes a tooltip show when the mouse pointer is over a
character window in the special characters control. It also adds a
label that is used to display character information of the highlighted
character. Code for creating the character information text shown in
the tooltip and label was referenced from SvxCharacterMap.

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

diff --git a/include/sfx2/charwin.hxx b/include/sfx2/charwin.hxx
index d0a8f86d2e51..75a6fad12a38 100644
--- a/include/sfx2/charwin.hxx
+++ b/include/sfx2/charwin.hxx
@@ -35,6 +35,7 @@ private:
 boolmaHasInsert;
 OUStringm_sText;
 
+Link maFocusInHdl;
 Link maMouseClickHdl;
 Link maClearClickHdl;
 Link maClearAllClickHdl;
@@ -44,6 +45,7 @@ private:
 virtual bool MouseButtonDown(const MouseEvent&) override;
 virtual void GetFocus() override;
 virtual void LoseFocus() override;
+virtual OUString RequestHelp(tools::Rectangle) override;
 virtual bool KeyInput(const KeyEvent&) override;
 virtual bool Command(const CommandEvent&) override;
 virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override;
@@ -54,6 +56,7 @@ public:
 vcl::Font const & GetFont() const { return maFont; }
 voidSetText( const OUString& rText );
 OUString const & GetText() const { return m_sText; }
+OUString GetCharInfoText();
 voidSetHasInsert( bool bInsert );
 voidInsertCharToDoc();
 
@@ -61,6 +64,7 @@ public:
 
 Sizeget_preferred_size() const { return 
GetDrawingArea()->get_preferred_size(); }
 
+void setFocusInHdl(const Link );
 void setMouseClickHdl(const Link );
 void setClearClickHdl(const Link );
 void setClearAllClickHdl(const Link );
@@ -96,7 +100,8 @@ public:
 
 voidinit(bool bHasInsert, const Link 
,
  const Link ,
- const Link );
+ const Link ,
+ const Link  = 
Link());
 
 voidgetFavCharacterList();
 voidupdateFavCharControl();
diff --git a/sfx2/inc/charmapcontrol.hxx b/sfx2/inc/charmapcontrol.hxx
index c6045154583e..72f0328da2af 100644
--- a/sfx2/inc/charmapcontrol.hxx
+++ b/sfx2/inc/charmapcontrol.hxx
@@ -45,9 +45,12 @@ private:
 
 std::unique_ptr m_xRecentLabel;
 std::unique_ptr m_xDlgBtn;
+std::unique_ptr m_xCharInfoLabel;
 
+DECL_LINK(CharFocusInHdl, SvxCharView*, void);
 DECL_LINK(CharClickHdl, SvxCharView*, void);
 DECL_LINK(OpenDlgHdl, weld::Button&, void);
+DECL_LINK(DlgBtnFocusInHdl, weld::Widget&, void);
 DECL_LINK(UpdateRecentHdl, void*, void);
 };
 
diff --git a/sfx2/source/control/charmapcontrol.cxx 
b/sfx2/source/control/charmapcontrol.cxx
index c71dbc8bb402..76e37174fd49 100644
--- a/sfx2/source/control/charmapcontrol.cxx
+++ b/sfx2/source/control/charmapcontrol.cxx
@@ -105,7 +105,8 @@ SfxCharmapContainer::SfxCharmapContainer(weld::Builder& 
rBuilder, const VclPtr 
,
const Link& rUpdateFavHdl,
-   const Link& rUpdateRecentHdl)
+   const Link& rUpdateRecentHdl,
+   const Link )
 {
 m_aUpdateFavHdl = rUpdateFavHdl;
 m_aUpdateRecentHdl = rUpdateRecentHdl;
@@ -118,10 +119,12 @@ void SfxCharmapContainer::init(bool bHasInsert, const 
Link 
 for(int i = 0; i < 16; i++)
 {
 m_aRecentCharView[i].SetHasInsert(bHasInsert);
+m_aRecentCharView[i].setFocusInHdl(rFocusInHdl);
 m_aRecentCharView[i].setMouseClickHdl(rMouseClickHdl);
 m_aRecentCharView[i].setClearClickHdl(LINK(this, SfxCharmapContainer, 
RecentClearClickHdl));
 m_aRecentCharView[i].setClearAllClickHdl(LINK(this, 
SfxCharmapContainer, RecentClearAllClickHdl));
 m_aFavCharView[i].SetHasInsert(bHasInsert);
+m_aFavCharView[i].setFocusInHdl(rFocusInHdl);
 m_aFavCharView[i].setMouseClickHdl(rMouseClickHdl);
 m_aFavCharView[i].setClearClickHdl(LINK(this, SfxCharmapContainer, 
FavClearClickHdl));
 

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

2023-08-12 Thread Noel Grandin (via logerrit)
 include/sfx2/sfxbasemodel.hxx|   21 -
 include/sfx2/stbitem.hxx |3 ---
 sfx2/inc/templatedefaultview.hxx |2 --
 sfx2/source/control/templatedefaultview.cxx  |5 -
 sfx2/source/control/templatedlglocalview.cxx |2 +-
 sfx2/source/doc/SfxDocumentMetaData.cxx  |2 +-
 sfx2/source/doc/docundomanager.cxx   |4 ++--
 sfx2/source/doc/templatedlg.cxx  |2 +-
 sfx2/source/doc/zoomitem.cxx |2 +-
 sfx2/source/sidebar/SidebarToolBox.cxx   |2 +-
 sfx2/source/statbar/stbitem.cxx  |   12 
 11 files changed, 7 insertions(+), 50 deletions(-)

New commits:
commit 0f3b36bd2749f360df84d1594c01e619ba0f4930
Author: Noel Grandin 
AuthorDate: Fri Aug 11 15:10:28 2023 +0200
Commit: Noel Grandin 
CommitDate: Sat Aug 12 08:18:17 2023 +0200

clang-tidy bugprone-parent-virtual-call in sfx2

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

diff --git a/include/sfx2/sfxbasemodel.hxx b/include/sfx2/sfxbasemodel.hxx
index 2602387fad59..b134b8ac7ea7 100644
--- a/include/sfx2/sfxbasemodel.hxx
+++ b/include/sfx2/sfxbasemodel.hxx
@@ -184,27 +184,6 @@ public:
 
 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& rType 
) override ;
 
-
/**___
-@short  increment refcount
-@seealsoXInterface
-@seealsorelease()
-@onerrorA RuntimeException is thrown.
-*/
-
-virtual void SAL_CALL acquire() noexcept override
-{ OWeakObject::acquire(); }
-
-
/**___
-@short  decrement refcount
-@seealsoXInterface
-@seealsoacquire()
-@onerrorA RuntimeException is thrown.
-*/
-
-virtual void SAL_CALL release() noexcept override
-{ OWeakObject::release(); }
-
-
 //  XTypeProvider
 
 
diff --git a/include/sfx2/stbitem.hxx b/include/sfx2/stbitem.hxx
index 67c88c68710d..7325ca0959d8 100644
--- a/include/sfx2/stbitem.hxx
+++ b/include/sfx2/stbitem.hxx
@@ -63,9 +63,6 @@ class SFX2_DLLPUBLIC SfxStatusBarControl: public 
svt::StatusbarController
 
 public:
 // new controller API
-// XInterface
-virtual void   SAL_CALL acquire() noexcept override;
-virtual void   SAL_CALL release() noexcept override;
 
 protected:
 // XEventListener
diff --git a/sfx2/inc/templatedefaultview.hxx b/sfx2/inc/templatedefaultview.hxx
index 1771ad3d8759..07cd3d126639 100644
--- a/sfx2/inc/templatedefaultview.hxx
+++ b/sfx2/inc/templatedefaultview.hxx
@@ -19,8 +19,6 @@ public:
 
 virtual void showAllTemplates() override;
 
-virtual bool KeyInput(const KeyEvent& rKEvt) override;
-
 virtual bool MouseButtonDown(const MouseEvent& rMEvt) override;
 
 void createContextMenu();
diff --git a/sfx2/source/control/templatedefaultview.cxx 
b/sfx2/source/control/templatedefaultview.cxx
index 17ad2ba7cbda..b7e7c0edc4a6 100644
--- a/sfx2/source/control/templatedefaultview.cxx
+++ b/sfx2/source/control/templatedefaultview.cxx
@@ -47,11 +47,6 @@ void TemplateDefaultView::showAllTemplates()
 insertItems(maAllTemplates, false);
 }
 
-bool TemplateDefaultView::KeyInput( const KeyEvent& rKEvt )
-{
-return ThumbnailView::KeyInput(rKEvt);
-}
-
 bool TemplateDefaultView::MouseButtonDown( const MouseEvent& rMEvt )
 {
 if( rMEvt.IsLeft() && rMEvt.GetClicks() == 1 )
diff --git a/sfx2/source/control/templatedlglocalview.cxx 
b/sfx2/source/control/templatedlglocalview.cxx
index 52a12b4ef965..a4cac457cd0e 100644
--- a/sfx2/source/control/templatedlglocalview.cxx
+++ b/sfx2/source/control/templatedlglocalview.cxx
@@ -401,7 +401,7 @@ bool TemplateDlgLocalView::KeyInput(const KeyEvent& rKEvt)
 reload();
 }
 
-return ThumbnailView::KeyInput(rKEvt);
+return TemplateLocalView::KeyInput(rKEvt);
 }
 
 IMPL_LINK(TemplateDlgLocalView, KeyPressHdl, const KeyEvent&, rKEvt, bool)
diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx 
b/sfx2/source/doc/SfxDocumentMetaData.cxx
index 7d1f16c01fd9..56c47315ab54 100644
--- a/sfx2/source/doc/SfxDocumentMetaData.cxx
+++ b/sfx2/source/doc/SfxDocumentMetaData.cxx
@@ -1345,7 +1345,7 @@ void SAL_CALL SfxDocumentMetaData::dispose()
 if (!m_isInitialized) {
 return;
 }
-WeakComponentImplHelperBase::dispose(); // superclass
+PartialWeakComponentImplHelper::dispose(); // superclass
 m_NotifyListeners.disposeAndClear(css::lang::EventObject(
 getXWeak()));
 m_isInitialized = false;
diff --git a/sfx2/source/doc/docundomanager.cxx 
b/sfx2/source/doc/docundomanager.cxx
index 94f416c2d786..2370397e267c 100644
--- 

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

2023-08-11 Thread Marco Cecchetti (via logerrit)
 include/sfx2/viewsh.hxx |2 +
 sc/source/ui/view/tabvwshc.cxx  |3 +
 sd/source/ui/inc/ViewShellBase.hxx  |2 -
 sd/source/ui/view/ViewShellBase.cxx |5 ---
 sfx2/source/view/viewsh.cxx |   58 
 sw/source/uibase/uiview/view.cxx|4 ++
 6 files changed, 61 insertions(+), 13 deletions(-)

New commits:
commit 9de08c6f8f2b4150da628fe3e9311f5dc64137b0
Author: Marco Cecchetti 
AuthorDate: Mon Jun 5 21:33:55 2023 +0200
Commit: Miklos Vajna 
CommitDate: Fri Aug 11 19:13:38 2023 +0200

lok: a11y: get focused paragraph notified on document load

Usually, when the document is loaded, a CARET_CHANGED accessibility
event is automatically emitted for the first paragraph. That allows to
notify the paragraph content to the client, even if no input event
occurred yet. However, in Cypress tests no accessibility event is
automatically emitted until some input event occurs. So we use the
workaround in this patch to notify the content of the focused
paragraph, without waiting for an input event.

(cherry picked from commit d6f929c03ca08a0c1134937a1ff1a42f75221e93)

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

diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx
index 4adf62a196c4..c0628a0bd4fb 100644
--- a/include/sfx2/viewsh.hxx
+++ b/include/sfx2/viewsh.hxx
@@ -440,6 +440,8 @@ public:
 const LanguageTag& GetLOKLanguageTag() const { return maLOKLanguageTag; }
 /// Enable/Disable LibreOfficeKit AT support for this view.
 void SetLOKAccessibilityState(bool bEnabled);
+/// Get LibreOfficeKit AT support state for this view.
+bool GetLOKAccessibilityState() const { return mbLOKAccessibilityEnabled; }
 
 /// Get the LibreOfficeKit timezone of this view. See @SetLOKTimezone.
 std::pair GetLOKTimezone() const
diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx
index 997e710e18e9..56cfba5ddfdb 100644
--- a/sc/source/ui/view/tabvwshc.cxx
+++ b/sc/source/ui/view/tabvwshc.cxx
@@ -453,6 +453,9 @@ int ScTabViewShell::getPart() const
 
 void ScTabViewShell::afterCallbackRegistered()
 {
+// common tasks
+SfxViewShell::afterCallbackRegistered();
+
 UpdateInputHandler(true, false);
 
 ScInputHandler* pHdl = mpInputHandler ? mpInputHandler.get() : 
SC_MOD()->GetInputHdl();
diff --git a/sd/source/ui/inc/ViewShellBase.hxx 
b/sd/source/ui/inc/ViewShellBase.hxx
index 3f40123405f3..c2b2d16158e0 100644
--- a/sd/source/ui/inc/ViewShellBase.hxx
+++ b/sd/source/ui/inc/ViewShellBase.hxx
@@ -217,8 +217,6 @@ public:
 int getEditMode() const override;
 /// See SfxViewShell::setEditMode().
 void setEditMode(int nMode);
-/// See SfxViewShell::afterCallbackRegistered().
-void afterCallbackRegistered() override;
 /// See SfxViewShell::NotifyCursor().
 void NotifyCursor(SfxViewShell* pViewShell) const override;
 /// See SfxViewShell::GetColorConfigColor().
diff --git a/sd/source/ui/view/ViewShellBase.cxx 
b/sd/source/ui/view/ViewShellBase.cxx
index 460e102e7796..6ad6d454be57 100644
--- a/sd/source/ui/view/ViewShellBase.cxx
+++ b/sd/source/ui/view/ViewShellBase.cxx
@@ -1010,11 +1010,6 @@ void ViewShellBase::setEditMode(int nMode)
 }
 }
 
-void ViewShellBase::afterCallbackRegistered()
-{
-// TODO: Add theme color palette changed callback
-}
-
 void ViewShellBase::NotifyCursor(SfxViewShell* pOtherShell) const
 {
 ViewShell* pThisShell = 
framework::FrameworkHelper::Instance(*const_cast(this))->GetViewShell(FrameworkHelper::msCenterPaneURL).get();
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 0d61e2f3f005..f204b03c3721 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -554,8 +554,10 @@ public:
 int getCaretPosition() const;
 
 private:
-void updateParagraphInfo(const 
uno::Reference& xAccText,
+bool updateParagraphInfo(const 
uno::Reference& xAccText,
  bool force, std::string msg = "");
+void updateAndNotifyParagraph(const 
uno::Reference& xAccText,
+  bool force, std::string msg = "");
 };
 
 LOKDocumentFocusListener::LOKDocumentFocusListener(const SfxViewShell* 
pViewShell)
@@ -676,12 +678,13 @@ void LOKDocumentFocusListener::disposing( const 
lang::EventObject& aEvent )
 
 }
 
-void LOKDocumentFocusListener::updateParagraphInfo(const 
uno::Reference& xAccText,
+bool LOKDocumentFocusListener::updateParagraphInfo(const 
uno::Reference& xAccText,
bool force, std::string msg)
 {
 if (!xAccText.is())
-return;
+return false;
 
+bool bNotify = false;
 // If caret is present inside the paragraph (pos != -1), it means that 
paragraph has focus in the current view.
 

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

2023-08-04 Thread Thorsten Behrens (via logerrit)
 include/sfx2/LokControlHandler.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e25e27c85ed970cdb97c468bdac86c80964f4231
Author: Thorsten Behrens 
AuthorDate: Sat Aug 5 02:20:58 2023 +0200
Commit: Thorsten Behrens 
CommitDate: Sat Aug 5 04:06:36 2023 +0200

Fix crash in lokit form control mouse handler

Since 7adfecb0f5947ae258226c8d1652546f81577026

, clicking on form controls results in a crash like this one:

  0x7f7c81092a7c in __pthread_kill_implementation () at /lib64/libc.so.6
  0x7f7c81041226 in raise () at /lib64/libc.so.6
  0x7f7c81029897 in abort () at /lib64/libc.so.6
  0x7f7c812e4c60 in __gnu_debug::_Safe_sequence_base::_M_get_mutex() () 
at /lib64/libstdc++.so.6
  0x7f7c2aaaf36f in std::_Optional_base_impl >::_M_get()
  (this=0x7f7c2c673b50 )
  at /usr/include/c++/13/optional:477
  0x7f7c2aaa9b24 in std::optional::operator*() &
  (this=0x7f7c2c673b50 )
  at /usr/include/c++/13/optional:974
  0x7f7c2aaa66bb in LokControlHandler::postMouseEvent(SdrPage const*, 
SdrView const*, vcl::DocWindow&, int, Point, int, int, int)
  (pPage=0x7f7c6ec35910, pDrawView=0x7f7c6f097a40, rMainWindow=..., 
nType=0, aPointHmm=Point = {...}, nCount=1, nButtons=1, nModifier=0)
  at core/include/sfx2/LokControlHandler.hxx:79
  0x7f7c2aa9d784 in SwXTextDocument::postMouseEvent(int, int, int, int, 
int, int) (this=0x7f7c6eae94f0, nType=0, nX=1756, nY=4106, nCount=1, 
nButtons=1, nModifier=0)
  at core/sw/source/uibase/uno/unotxdoc.cxx:3741
  0x7f7c7c8fb074 in doc_postMouseEvent(LibreOfficeKitDocument*, int, 
int, int, int, int, int) (pThis=0x7f7c6f37fe90, nType=0, nX=1756, nY=4106, 
nCount=1, nButtons=1, nModifier=0)
  at core/desktop/source/lib/init.cxx:5062
  0x7f7c81642c9e in postMouseEventInThread(gpointer) (data=0x19aa340) 
at core/libreofficekit/source/gtk/lokdocview.cxx:2335
  0x7f7c816441fb in lokThreadFunc(gpointer, gpointer) (data=0x19aa340) 
at core/libreofficekit/source/gtk/lokdocview.cxx:2567

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

diff --git a/include/sfx2/LokControlHandler.hxx 
b/include/sfx2/LokControlHandler.hxx
index dc69787456e5..a292f137471b 100644
--- a/include/sfx2/LokControlHandler.hxx
+++ b/include/sfx2/LokControlHandler.hxx
@@ -76,7 +76,7 @@ public:
 // and set pointer style to arrow
 if (!eDocPointerStyle)
 {
-*eDocPointerStyle = rMainWindow.GetPointer();
+eDocPointerStyle = rMainWindow.GetPointer();
 rMainWindow.SetPointer(pWindow->GetPointer());
 }
 


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

2023-08-01 Thread Tomaž Vajngerl (via logerrit)
 include/sfx2/namedcolor.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 144d16443a74839f885dc9597bee1e48493b278f
Author: Tomaž Vajngerl 
AuthorDate: Sun Jul 30 08:44:02 2023 +0200
Commit: Tomaž Vajngerl 
CommitDate: Tue Aug 1 08:16:13 2023 +0200

fix C/P typo that allowed setting LumMod color transform value 0

should be m_nLumOff instead of m_nLumMod

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

diff --git a/include/sfx2/namedcolor.hxx b/include/sfx2/namedcolor.hxx
index 1235cf848827..c9a53cc37491 100644
--- a/include/sfx2/namedcolor.hxx
+++ b/include/sfx2/namedcolor.hxx
@@ -44,7 +44,7 @@ struct SFX2_DLLPUBLIC NamedColor
 if (m_nLumMod != 1)
 aComplexColor.addTransformation({ 
model::TransformationType::LumMod, m_nLumMod });
 
-if (m_nLumMod != 0)
+if (m_nLumOff != 0)
 aComplexColor.addTransformation({ 
model::TransformationType::LumOff, m_nLumOff });
 }
 else


[Libreoffice-commits] core.git: include/sfx2 sc/qa sc/source sd/source sfx2/source starmath/source svx/source sw/qa sw/source

2023-07-28 Thread Mike Kaganski (via logerrit)
 include/sfx2/docfile.hxx|2 
 sc/qa/unit/helper/scfiltertestbase.cxx  |3 
 sc/source/core/tool/progress.cxx|6 
 sc/source/filter/excel/excel.cxx|   12 -
 sc/source/filter/excel/impop.cxx|3 
 sc/source/filter/excel/xeroot.cxx   |4 
 sc/source/filter/excel/xlroot.cxx   |5 
 sc/source/filter/ftools/fapihelper.cxx  |   10 -
 sc/source/filter/orcus/orcusfiltersimpl.cxx |   11 -
 sc/source/filter/xml/xmlwrap.cxx|   18 +-
 sc/source/ui/docshell/docsh.cxx |   60 ++---
 sc/source/ui/docshell/docsh4.cxx|   10 -
 sc/source/ui/docshell/externalrefmgr.cxx|2 
 sc/source/ui/docshell/tablink.cxx   |4 
 sc/source/ui/view/viewfun5.cxx  |2 
 sd/source/filter/grf/sdgrffilter.cxx|   10 -
 sd/source/filter/html/sdhtmlfilter.cxx  |4 
 sd/source/filter/ppt/pptin.cxx  |   12 -
 sd/source/filter/sdfilter.cxx   |2 
 sd/source/filter/sdpptwrp.cxx   |8 -
 sd/source/filter/xml/sdxmlwrp.cxx   |   32 +
 sd/source/ui/app/sdmod1.cxx |8 -
 sd/source/ui/docshell/docshel4.cxx  |   83 -
 sd/source/ui/slideshow/slideshowimpl.cxx|2 
 sd/source/ui/view/ToolBarManager.cxx|2 
 sfx2/source/appl/appopen.cxx|  105 
 sfx2/source/appl/linkmgr2.cxx   |2 
 sfx2/source/appl/sfxpicklist.cxx|2 
 sfx2/source/appl/workwin.cxx|2 
 sfx2/source/bastyp/fltfnc.cxx   |8 -
 sfx2/source/bastyp/progress.cxx |4 
 sfx2/source/control/dispatch.cxx|2 
 sfx2/source/dialog/dinfdlg.cxx  |   15 --
 sfx2/source/dialog/versdlg.cxx  |8 -
 sfx2/source/doc/docfile.cxx |   91 +++---
 sfx2/source/doc/objcont.cxx |2 
 sfx2/source/doc/objmisc.cxx |   54 
 sfx2/source/doc/objserv.cxx |   14 +-
 sfx2/source/doc/objstor.cxx |  176 +---
 sfx2/source/doc/sfxbasemodel.cxx|   63 --
 sfx2/source/view/frame.cxx  |8 -
 sfx2/source/view/frame2.cxx |2 
 sfx2/source/view/frmload.cxx|6 
 sfx2/source/view/viewfrm.cxx|   42 +++---
 sfx2/source/view/viewsh.cxx |6 
 starmath/source/mathml/export.cxx   |6 
 starmath/source/mathml/import.cxx   |   21 +--
 starmath/source/mathml/mathmlexport.cxx |   22 +--
 starmath/source/mathml/mathmlimport.cxx |   21 +--
 svx/source/form/fmview.cxx  |2 
 sw/qa/core/filters-test.cxx |2 
 sw/source/core/docnode/section.cxx  |2 
 sw/source/core/unocore/unocrsrhelper.cxx|   12 -
 sw/source/filter/ascii/parasc.cxx   |4 
 sw/source/filter/ascii/wrtasc.cxx   |   16 --
 sw/source/filter/html/htmlform.cxx  |2 
 sw/source/filter/html/swhtml.cxx|8 -
 sw/source/filter/html/wrthtml.cxx   |6 
 sw/source/filter/ww8/wrtw8esh.cxx   |   10 -
 sw/source/filter/ww8/wrtww8.cxx |   10 -
 sw/source/filter/ww8/ww8par.cxx |   19 +--
 sw/source/filter/xml/swxml.cxx  |   16 --
 sw/source/filter/xml/wrtxml.cxx |2 
 sw/source/ui/dialog/ascfldlg.cxx|3 
 sw/source/ui/dialog/uiregionsw.cxx  |4 
 sw/source/uibase/app/apphdl.cxx |4 
 sw/source/uibase/app/docsh.cxx  |   24 +--
 sw/source/uibase/app/docsh2.cxx |6 
 sw/source/uibase/app/docshini.cxx   |2 
 sw/source/uibase/dbui/dbmgr.cxx |   15 --
 sw/source/uibase/uiview/view.cxx|2 
 sw/source/uibase/uno/unotxdoc.cxx   |3 
 72 files changed, 505 insertions(+), 666 deletions(-)

New commits:
commit f5dd4faef6c6ee23bb33a0662087e1892db78b3d
Author: Mike Kaganski 
AuthorDate: Thu Jul 27 19:12:45 2023 +0300
Commit: Mike Kaganski 
CommitDate: Fri Jul 28 08:13:40 2023 +0200

SfxMedium::GetItemSet never returns nullptr

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

diff --git a/include/sfx2/docfile.hxx b/include/sfx2/docfile.hxx
index e442f39d259a..2af13be14a0a 100644
--- a/include/sfx2/docfile.hxx
+++ b/include/sfx2/docfile.hxx
@@ -122,7 +122,7 @@ public:
 const std::shared_ptr& GetFilter() const;
 const OUString& GetOrigURL() const;
 
-SfxItemSet  *   GetItemSet() const;
+SfxItemSet& GetItemSet() const;
 void SetArgs(const css::uno::Sequence& rArgs);
 const css::uno::Sequence & GetArgs() const;
 voidClose(bool bInDestruction = false);

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

2023-07-21 Thread Balazs Varga (via logerrit)
 include/sfx2/basedlgs.hxx |1 +
 include/sfx2/childwin.hxx |2 --
 sc/source/ui/inc/validate.hxx |2 ++
 sfx2/source/appl/childwin.cxx |2 +-
 4 files changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 396cbd8cd017f883946f1a0be7285c89f84f40af
Author: Balazs Varga 
AuthorDate: Wed Jul 12 23:09:45 2023 +0200
Commit: Balazs Varga 
CommitDate: Fri Jul 21 18:07:46 2023 +0200

Related: tdf#155708 Clean-up - Fix validity dialog closes

Do not close Validation window if click on another Calc sheet.

Follow-up of commits:
1 - a5c61b143d53bb10430b8a486874856c16a2d86c
2 - efaa065eb7053954242c83760f897e7dba2e9fe8

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

diff --git a/include/sfx2/basedlgs.hxx b/include/sfx2/basedlgs.hxx
index f87fe22c1dbd..e182b9aa7789 100644
--- a/include/sfx2/basedlgs.hxx
+++ b/include/sfx2/basedlgs.hxx
@@ -49,6 +49,7 @@ public:
 virtual void ChildWinDispose() {} // called from the associated 
SfxChildWin dtor
 virtual void Close(); // called by the SfxChildWin when the dialog is 
closed
 virtual void EndDialog(int nResponse); // called by the SfxChildWin to 
close the dialog
+virtual bool CloseOnHide() const { return true; } // called from 
ScValidationDlg
 };
 
 class SfxModelessDialog_Impl;
diff --git a/include/sfx2/childwin.hxx b/include/sfx2/childwin.hxx
index 6e4b20037be0..57c2369233ef 100644
--- a/include/sfx2/childwin.hxx
+++ b/include/sfx2/childwin.hxx
@@ -156,8 +156,6 @@ public:
 };
 
 const int nCloseResponseToJustHide = -42;
-// sc.hrc --> SID_VALIDITY_REFERENCE: 26161
-const sal_uInt16 nScValidityWindowSlotID = 26161;
 
 #define SFX_DECL_CHILDWINDOW(Class) \
 public  :   \
diff --git a/sc/source/ui/inc/validate.hxx b/sc/source/ui/inc/validate.hxx
index c58ae53bbf7f..4a3a2e80e97c 100644
--- a/sc/source/ui/inc/validate.hxx
+++ b/sc/source/ui/inc/validate.hxx
@@ -180,6 +180,8 @@ public:
 
 virtual void EndDialog(int nResponse) override;
 
+virtual bool CloseOnHide() const override { return false; }
+
 virtual voidSetReference( const ScRange& rRef, ScDocument& 
rDoc ) override
 {
 if ( m_pHandler && m_pSetReferenceHdl )
diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx
index 633c33bb35c9..6bf2814599ec 100644
--- a/sfx2/source/appl/childwin.cxx
+++ b/sfx2/source/appl/childwin.cxx
@@ -522,7 +522,7 @@ void SfxChildWindow::Show( ShowFlags nFlags )
 {
 if (!xController->getDialog()->get_visible())
 {
-if (nScValidityWindowSlotID == GetType())
+if (!xController->CloseOnHide())
 {
 // tdf#155708 - do not run a new (Async) validation window,
 // because we already have one in sync mode, just show the 
running one


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

2023-07-18 Thread Justin Luth (via logerrit)
 include/sfx2/sfxsids.hrc   |1 -
 officecfg/registry/schema/org/openoffice/Office/Common.xcs |9 -
 sfx2/source/appl/appcfg.cxx|8 
 3 files changed, 18 deletions(-)

New commits:
commit 5aa4ec482cf9ebb22571b1e5e8af0ff46d6ad3eb
Author: Justin Luth 
AuthorDate: Mon Jul 17 20:19:22 2023 -0400
Commit: Justin Luth 
CommitDate: Tue Jul 18 14:04:06 2023 +0200

[API CHANGE] Drop unused AutoSavePrompt config key

Never been used since prior to 2004 AFAICS

git grep -i -C20 "auto.*save.*prompt"

A git log -S AutoSavePrompt indicates that a
seemingly superfluous use of it was removed with
commit 1507e3b63b80b541a241d0ce1c977abb45cbeef8
Author: Rüdiger Timm on Fri Nov 26 13:37:09 2004 +
INTEGRATION: CWS recovery04 (1.52.36); FILE MERGED

and the superfluous function itself was removed with
commit 36a665a6754bbc4bb0a2d612a15b1b8413af3721
Author: Caolán McNamara on Wed Jul 27 22:09:03 2011 +0100
callcatcher: remove various unused methods

This was probably all obsoleted by
// functionality moved to new AutoRecovery Service!

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

diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc
index f21e1141bce7..86dccda1d4eb 100644
--- a/include/sfx2/sfxsids.hrc
+++ b/include/sfx2/sfxsids.hrc
@@ -527,7 +527,6 @@ class SvxZoomItem;
 #define SID_ATTR_DOCINFO
TypedWhichId(SID_OPTIONS_START +  0)
 #define SID_ATTR_BACKUP 
TypedWhichId(SID_OPTIONS_START +  1)
 #define SID_ATTR_AUTOSAVE   
TypedWhichId(SID_OPTIONS_START +  2)
-#define SID_ATTR_AUTOSAVEPROMPT 
TypedWhichId(SID_OPTIONS_START +  3)
 #define SID_ATTR_USERAUTOSAVE   
TypedWhichId(SID_OPTIONS_START +  4)
 #define SID_ATTR_AUTOSAVEMINUTE 
TypedWhichId(SID_OPTIONS_START +  5)
 #define SID_ATTR_WORKINGSET 
TypedWhichId(SID_OPTIONS_START + 13)
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index 2219c4353faa..2e13f32a1fb3 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -2073,15 +2073,6 @@
   
   false
 
-
-  
-  
-Shows a prompt during AutoSave,even when the document has a
-filename.
-Prompt to save
-  
-  true
-
 
   
 Not used anymore
diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx
index 681d4e2bd576..8b622f6b3e04 100644
--- a/sfx2/source/appl/appcfg.cxx
+++ b/sfx2/source/appl/appcfg.cxx
@@ -163,10 +163,6 @@ void SfxApplication::GetOptions( SfxItemSet& rSet )
 bRet = 
toSet_ifRW(
 rSet, SID_ATTR_AUTOSAVE);
 break;
-case SID_ATTR_AUTOSAVEPROMPT:
-bRet = 
toSet_ifRW(
-rSet, SID_ATTR_AUTOSAVEPROMPT);
-break;
 case SID_ATTR_AUTOSAVEMINUTE:
 bRet = 
toSet_ifRW(
 rSet, SID_ATTR_AUTOSAVEMINUTE);
@@ -343,10 +339,6 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& 
rSet )
 // AutoSave
 toCfg_ifSet(rSet, 
SID_ATTR_AUTOSAVE, batch);
 
-// AutoSave-Prompt
-toCfg_ifSet(
-rSet, SID_ATTR_AUTOSAVEPROMPT, batch);
-
 // AutoSave-Time
 toCfg_ifSet(
 rSet, SID_ATTR_AUTOSAVEMINUTE, batch);


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

2023-07-05 Thread Noel Grandin (via logerrit)
 include/sfx2/filedlghelper.hxx   |1 -
 sfx2/source/dialog/filedlghelper.cxx |2 --
 2 files changed, 3 deletions(-)

New commits:
commit d9dc0e4abbd6c06ee886302b2052e1f6814dfa76
Author: Noel Grandin 
AuthorDate: Wed Jul 5 12:32:15 2023 +0200
Commit: Noel Grandin 
CommitDate: Wed Jul 5 18:08:35 2023 +0200

WriterInsertDoc constant is unused

ever since it was added in

commit d157c1bd70d630a58db33910d550bb8dee9fe62e
Author: Samuel Mehrbrodt 
Date:   Thu Jul 8 05:50:25 2021 +0200
tdf#126665 Remember last used file picker directory

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

diff --git a/include/sfx2/filedlghelper.hxx b/include/sfx2/filedlghelper.hxx
index ea84a9450de6..c535a6b7bb55 100644
--- a/include/sfx2/filedlghelper.hxx
+++ b/include/sfx2/filedlghelper.hxx
@@ -123,7 +123,6 @@ public:
 SignatureLine,
 TemplateImport,
 WriterCreateAddressList,
-WriterInsertDoc,
 WriterInsertImage,
 WriterInsertScript,
 WriterExport,
diff --git a/sfx2/source/dialog/filedlghelper.cxx 
b/sfx2/source/dialog/filedlghelper.cxx
index 5b799bc4e169..49a8a5b9a08f 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -2536,8 +2536,6 @@ OUString FileDialogHelper::contextToString(Context 
context)
 return "WriterExport";
 case WriterImportAutotext:
 return "WriterImportAutotext";
-case WriterInsertDoc:
-return "WriterInsertDoc";
 case WriterInsertHyperlink:
 return "WriterInsertHyperlink";
 case WriterInsertImage:


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

2023-07-05 Thread Balazs Varga (via logerrit)
 include/sfx2/childwin.hxx   |2 ++
 include/vcl/toolkit/dialog.hxx  |2 ++
 sc/source/ui/dbgui/validate.cxx |6 ++
 sc/source/ui/inc/validate.hxx   |2 ++
 sfx2/source/appl/childwin.cxx   |   21 +++--
 5 files changed, 27 insertions(+), 6 deletions(-)

New commits:
commit a5c61b143d53bb10430b8a486874856c16a2d86c
Author: Balazs Varga 
AuthorDate: Mon Jul 3 19:56:43 2023 +0200
Commit: Balazs Varga 
CommitDate: Wed Jul 5 14:30:14 2023 +0200

tdf#155708 Fix validity dialog closes when moving focus to another window

Do not close Validation window if click on another Calc sheet.

Change-Id: I75569cbb91ebd445ac57f7a52d914297c21349e3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153930
Tested-by: Balazs Varga 
Reviewed-by: Balazs Varga 

diff --git a/include/sfx2/childwin.hxx b/include/sfx2/childwin.hxx
index 57c2369233ef..6e4b20037be0 100644
--- a/include/sfx2/childwin.hxx
+++ b/include/sfx2/childwin.hxx
@@ -156,6 +156,8 @@ public:
 };
 
 const int nCloseResponseToJustHide = -42;
+// sc.hrc --> SID_VALIDITY_REFERENCE: 26161
+const sal_uInt16 nScValidityWindowSlotID = 26161;
 
 #define SFX_DECL_CHILDWINDOW(Class) \
 public  :   \
diff --git a/include/vcl/toolkit/dialog.hxx b/include/vcl/toolkit/dialog.hxx
index 5e11d2f783b5..640204acfe60 100644
--- a/include/vcl/toolkit/dialog.hxx
+++ b/include/vcl/toolkit/dialog.hxx
@@ -58,6 +58,8 @@ private:
 boolmbModalMode;
 InitFlagmnInitFlag; // used for deferred init
 
+const int nCloseResponseToJustHide = -42;
+
 VclPtr mpActionArea;
 VclPtr   mpContentArea;
 
diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx
index 4445f68245c8..f8565e964354 100644
--- a/sc/source/ui/dbgui/validate.cxx
+++ b/sc/source/ui/dbgui/validate.cxx
@@ -104,6 +104,12 @@ ScValidationDlg::ScValidationDlg(weld::Window* pParent, 
const SfxItemSet* pArgSe
 
 void ScValidationDlg::EndDialog(int nResponse)
 {
+// tdf#155708 - do not close, just hide validation window if we click in 
another sheet
+if (nResponse == nCloseResponseToJustHide && getDialog()->get_visible())
+{
+getDialog()->hide();
+return;
+}
 // tdf#137215 ensure original modality of true is restored before dialog 
loop ends
 if (m_bOwnRefHdlr)
 RemoveRefDlg(true);
diff --git a/sc/source/ui/inc/validate.hxx b/sc/source/ui/inc/validate.hxx
index c8ed4447c400..c58ae53bbf7f 100644
--- a/sc/source/ui/inc/validate.hxx
+++ b/sc/source/ui/inc/validate.hxx
@@ -154,6 +154,8 @@ class ScValidationDlg
 boolm_bOwnRefHdlr:1;
 boolm_bRefInputting:1;
 
+const int nCloseResponseToJustHide = -42;
+
 std::unique_ptr m_xHBox;
 
 boolEnterRefStatus();
diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx
index 1fe6c39a7a03..633c33bb35c9 100644
--- a/sfx2/source/appl/childwin.cxx
+++ b/sfx2/source/appl/childwin.cxx
@@ -522,12 +522,21 @@ void SfxChildWindow::Show( ShowFlags nFlags )
 {
 if (!xController->getDialog()->get_visible())
 {
-weld::DialogController::runAsync(xController,
-[this](sal_Int32 nResult) {
-if (nResult == nCloseResponseToJustHide)
-return;
-xController->Close();
-});
+if (nScValidityWindowSlotID == GetType())
+{
+// tdf#155708 - do not run a new (Async) validation window,
+// because we already have one in sync mode, just show the 
running one
+xController->getDialog()->show();
+}
+else
+{
+weld::DialogController::runAsync(xController,
+[this](sal_Int32 nResult) {
+if (nResult == nCloseResponseToJustHide)
+return;
+xController->Close();
+});
+}
 }
 }
 else


[Libreoffice-commits] core.git: include/sfx2 sc/source sd/source sfx2/source sw/inc sw/source

2023-07-05 Thread Paris Oplopoios (via logerrit)
 include/sfx2/viewsh.hxx |2 ++
 sc/source/ui/inc/tabvwsh.hxx|2 ++
 sc/source/ui/view/tabvwshc.cxx  |5 +
 sd/source/ui/inc/ViewShellBase.hxx  |2 ++
 sd/source/ui/view/ViewShellBase.cxx |   12 
 sfx2/source/appl/appserv.cxx|   20 ++--
 sfx2/source/view/viewsh.cxx |6 ++
 sw/inc/view.hxx |2 ++
 sw/inc/viewopt.hxx  |2 +-
 sw/source/core/view/vnew.cxx|   17 -
 sw/source/uibase/uiview/viewprt.cxx |   14 ++
 11 files changed, 80 insertions(+), 4 deletions(-)

New commits:
commit 63d019c6780733018ffc0b157a235cb57893d6d4
Author: Paris Oplopoios 
AuthorDate: Mon Jul 3 19:00:59 2023 +0300
Commit: Paris Oplopoios 
CommitDate: Wed Jul 5 10:17:03 2023 +0200

Make sure views get new themes on .uno:ChangeTheme

It would be that sometimes .uno:ChangeTheme would not load the new
scheme because it was using EditableConfig::GetCurrentSchemeName which
uses a static name - normally great except for when you need different
views to have different color schemes in tiled rendering

Change-Id: I5b149bd1a4776337f76753c6de98d5386a899d34
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153939
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Paris Oplopoios 
(cherry picked from commit 77f5b9259864798b6efc213f6dfa685cd440f71a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154001
Tested-by: Jenkins

diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx
index 08bc6cecc8cb..4adf62a196c4 100644
--- a/include/sfx2/viewsh.hxx
+++ b/include/sfx2/viewsh.hxx
@@ -431,6 +431,8 @@ public:
 virtual vcl::Window* GetEditWindowForActiveOLEObj() const override;
 /// Get a color config color from this view
 virtual ::Color GetColorConfigColor(svtools::ColorConfigEntry nColorType) 
const;
+/// Get the color scheme name of this view
+virtual OUString GetColorConfigName() const;
 
 /// Set the LibreOfficeKit language of this view.
 void SetLOKLanguageTag(const OUString& rBcp47LanguageTag);
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index d8434af53bc6..06e9f31e19cb 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -397,6 +397,8 @@ public:
 void NotifyCursor(SfxViewShell* pViewShell) const override;
 /// See SfxViewShell::GetColorConfigColor().
 ::Color GetColorConfigColor(svtools::ColorConfigEntry nColorType) const 
override;
+/// See SfxViewShell::GetColorConfigName().
+OUString GetColorConfigName() const override;
 /// Emits a LOK_CALLBACK_INVALIDATE_HEADER for all views whose current tab 
is equal to nCurrentTabIndex
 static void notifyAllViewsHeaderInvalidation(const SfxViewShell* 
pForViewShell, HeaderType eHeaderType, SCTAB nCurrentTabIndex);
 static bool isAnyEditViewInRange(const SfxViewShell* pForViewShell, bool 
bColumns, SCCOLROW nStart, SCCOLROW nEnd);
diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx
index 5397d9f4383e..997e710e18e9 100644
--- a/sc/source/ui/view/tabvwshc.cxx
+++ b/sc/source/ui/view/tabvwshc.cxx
@@ -511,6 +511,11 @@ void ScTabViewShell::NotifyCursor(SfxViewShell* 
pOtherShell) const
 }
 }
 
+OUString ScTabViewShell::GetColorConfigName() const
+{
+return GetViewData().GetOptions().GetColorSchemeName();
+}
+
 css::uno::Reference 
ScTabViewShell::GetClipData(vcl::Window* pWin)
 {
 SfxViewFrame* pViewFrame = nullptr;
diff --git a/sd/source/ui/inc/ViewShellBase.hxx 
b/sd/source/ui/inc/ViewShellBase.hxx
index e31429f6e41a..3f40123405f3 100644
--- a/sd/source/ui/inc/ViewShellBase.hxx
+++ b/sd/source/ui/inc/ViewShellBase.hxx
@@ -223,6 +223,8 @@ public:
 void NotifyCursor(SfxViewShell* pViewShell) const override;
 /// See SfxViewShell::GetColorConfigColor().
 ::Color GetColorConfigColor(svtools::ColorConfigEntry nColorType) const 
override;
+/// See SfxViewShell::GetColorConfigName().
+OUString GetColorConfigName() const override;
 
 void setLOKVisibleArea(const ::tools::Rectangle& rArea) { maLOKVisibleArea 
= rArea; }
 virtual ::tools::Rectangle getLOKVisibleArea() const override { return 
maLOKVisibleArea; }
diff --git a/sd/source/ui/view/ViewShellBase.cxx 
b/sd/source/ui/view/ViewShellBase.cxx
index 55ade0226213..460e102e7796 100644
--- a/sd/source/ui/view/ViewShellBase.cxx
+++ b/sd/source/ui/view/ViewShellBase.cxx
@@ -1084,6 +1084,18 @@ void ViewShellBase::NotifyCursor(SfxViewShell* 
pOtherShell) const
 return {};
 }
 
+OUString ViewShellBase::GetColorConfigName() const
+{
+if (DrawViewShell* pCurrentDrawShell = 
dynamic_cast(GetMainViewShell().get()))
+{
+const SdViewOptions& rViewOptions = 
pCurrentDrawShell->GetViewOptions();
+return rViewOptions.msColorSchemeName;
+}
+
+SAL_WARN("sd", "dynamic_cast to DrawViewShell failed");
+return {};
+}
+
 //= 

[Libreoffice-commits] core.git: include/sfx2 include/svx sfx2/Library_sfx.mk sfx2/source svx/inc svx/source

2023-07-04 Thread Maxim Monastirsky (via logerrit)
 include/sfx2/namedcolor.hxx|   57 +
 include/sfx2/objsh.hxx |4 ++
 include/svx/Palette.hxx|   46 --
 include/svx/PaletteManager.hxx |1 
 include/svx/colorwindow.hxx|3 -
 include/svx/tbcontrl.hxx   |1 
 sfx2/Library_sfx.mk|1 
 sfx2/source/doc/objcont.cxx|   15 
 sfx2/source/inc/objshimp.hxx   |4 ++
 svx/inc/tbxcolorupdate.hxx |8 +++-
 svx/source/tbxctrls/PaletteManager.cxx |9 -
 svx/source/tbxctrls/tbcontrl.cxx   |   15 +---
 svx/source/tbxctrls/tbxcolorupdate.cxx |   57 +++--
 13 files changed, 145 insertions(+), 76 deletions(-)

New commits:
commit 8ffb8e164d9d350a1b9887d0a75e0a82892008ee
Author: Maxim Monastirsky 
AuthorDate: Sun Jul 2 17:31:38 2023 +0300
Commit: Maxim Monastirsky 
CommitDate: Tue Jul 4 20:26:42 2023 +0200

tdf#154270 Sync toolbar button recent colors

As the last used color is stored per button instance, these
will go out of sync with several buttons being visible (e.g.
a toolbar and a sidebar, or a toolbar overflow popup), and
will reset whenever the toolbar resets (e.g. change in
selection, switch from print preview, or customization).

Fix that by storing the last colors per-document, and
notifying other buttons on changes. Keep the last color also
stored per-button for now, as a fallback for reportdesign
(which isn't sfx2 based).

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

diff --git a/include/sfx2/namedcolor.hxx b/include/sfx2/namedcolor.hxx
new file mode 100644
index ..fc7941686fbd
--- /dev/null
+++ b/include/sfx2/namedcolor.hxx
@@ -0,0 +1,57 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#pragma once
+
+#include 
+#include 
+
+#include 
+#include 
+
+struct SFX2_DLLPUBLIC NamedColor
+{
+Color m_aColor;
+OUString m_aName;
+sal_Int16 m_nThemeIndex = -1;
+sal_Int16 m_nLumMod = 1;
+sal_Int16 m_nLumOff = 0;
+
+NamedColor() = default;
+
+NamedColor(Color const& rColor, OUString const& rName)
+: m_aColor(rColor)
+, m_aName(rName)
+{
+}
+
+model::ComplexColor getComplexColor()
+{
+model::ComplexColor aComplexColor;
+
+auto eThemeColorType = model::convertToThemeColorType(m_nThemeIndex);
+
+if (eThemeColorType != model::ThemeColorType::Unknown)
+{
+aComplexColor.setSchemeColor(eThemeColorType);
+
+if (m_nLumMod != 1)
+aComplexColor.addTransformation({ 
model::TransformationType::LumMod, m_nLumMod });
+
+if (m_nLumMod != 0)
+aComplexColor.addTransformation({ 
model::TransformationType::LumOff, m_nLumOff });
+}
+
+aComplexColor.setFinalColor(m_aColor);
+
+return aComplexColor;
+}
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index 15533c2954ca..dfb69b264418 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -47,6 +47,7 @@
 
 namespace weld {class Button; }
 namespace model {class ColorSet; }
+struct NamedColor;
 class SbxValue;
 class SbxArray;
 class BasicManager;
@@ -564,6 +565,9 @@ public:
 GetDialogContainer();
 StarBASIC*  GetBasic() const;
 
+std::optional GetRecentColor(sal_uInt16 nSlotId);
+void SetRecentColor(sal_uInt16 nSlotId, const NamedColor& rColor);
+
 virtual std::set GetDocColors();
 virtual std::shared_ptr GetThemeColors();
 
diff --git a/include/svx/Palette.hxx b/include/svx/Palette.hxx
index 4858b47140c4..5bf63762b75c 100644
--- a/include/svx/Palette.hxx
+++ b/include/svx/Palette.hxx
@@ -20,56 +20,12 @@
 #pragma once
 
 #include 
+#include 
 
 #include 
 
-#include 
-#include 
-#include 
-
-#include 
-#include 
-
 class SvxColorValueSet;
 
-struct SVXCORE_DLLPUBLIC NamedColor
-{
-Color m_aColor;
-OUString m_aName;
-sal_Int16 m_nThemeIndex = -1;
-sal_Int16 m_nLumMod = 1;
-sal_Int16 m_nLumOff = 0;
-
-NamedColor() = default;
-
-NamedColor(Color const& rColor, OUString const& rName)
-: m_aColor(rColor)
-, m_aName(rName)
-{}
-
-model::ComplexColor getComplexColor()
-{
-model::ComplexColor aComplexColor;
-
-auto 

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

2023-06-29 Thread Noel Grandin (via logerrit)
 include/sfx2/charwin.hxx   |2 --
 sfx2/source/control/charmapcontrol.cxx |5 -
 2 files changed, 7 deletions(-)

New commits:
commit 26d191e8ee53a38d350c10d5666c6dd8629c8ab2
Author: Noel Grandin 
AuthorDate: Thu Jun 29 12:55:02 2023 +0200
Commit: Noel Grandin 
CommitDate: Thu Jun 29 17:45:42 2023 +0200

m_aMouseClickHdl is dead

It was added in

commit c706fde1c4ecc6974bcf32ce33aacf3093355ae1
Resolves: tdf#156067 merge special char dialog/popup logic

But is never assigned a useful value

Change-Id: I476b00a96c53298414239509b2ca5452f0bf08c5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153743
Reviewed-by: Caolán McNamara 
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/include/sfx2/charwin.hxx b/include/sfx2/charwin.hxx
index 515aa64a4acb..1e3672a9de4e 100644
--- a/include/sfx2/charwin.hxx
+++ b/include/sfx2/charwin.hxx
@@ -83,11 +83,9 @@ class SFX2_DLLPUBLIC SfxCharmapContainer
 std::unique_ptr m_xRecentGrid;
 std::unique_ptr m_xFavGrid;
 
-Link m_aMouseClickHdl;
 Link m_aUpdateFavHdl;
 Link m_aUpdateRecentHdl;
 
-DECL_DLLPRIVATE_LINK(CharClickHdl, SvxCharView*, void);
 DECL_DLLPRIVATE_LINK(RecentClearClickHdl, SvxCharView*, void);
 DECL_DLLPRIVATE_LINK(FavClearClickHdl, SvxCharView*, void);
 DECL_DLLPRIVATE_LINK(RecentClearAllClickHdl, SvxCharView*, void);
diff --git a/sfx2/source/control/charmapcontrol.cxx 
b/sfx2/source/control/charmapcontrol.cxx
index 359b81c49330..ae3018ecd089 100644
--- a/sfx2/source/control/charmapcontrol.cxx
+++ b/sfx2/source/control/charmapcontrol.cxx
@@ -394,11 +394,6 @@ bool SfxCharmapContainer::isFavChar(std::u16string_view 
sTitle, std::u16string_v
 return itChar != m_aFavCharList.end() && itFont != 
m_aFavCharFontList.end();
 }
 
-IMPL_LINK(SfxCharmapContainer, CharClickHdl, SvxCharView*, pView, void)
-{
-m_aMouseClickHdl.Call(pView);
-}
-
 IMPL_LINK(SfxCharmapContainer, RecentClearClickHdl, SvxCharView*, rView, void)
 {
 const OUString& sTitle = rView->GetText();


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

2023-06-26 Thread Ashod Nakashian (via logerrit)
 include/sfx2/lokhelper.hxx  |4 
 include/svx/svdomedia.hxx   |3 ---
 sfx2/source/view/lokhelper.cxx  |9 -
 svx/source/svdraw/svdmrkv.cxx   |   25 +++--
 svx/source/svdraw/svdomedia.cxx |   23 ---
 5 files changed, 15 insertions(+), 49 deletions(-)

New commits:
commit 097cf021cb946da7ebc6fe548fb035aec2d4eaa5
Author: Ashod Nakashian 
AuthorDate: Sat Feb 11 14:53:44 2023 -0500
Commit: Aron Budea 
CommitDate: Tue Jun 27 06:26:51 2023 +0200

lok: only publish MEDIA_SHAPE to selecting view

We now publish the url for the media shape
in the LOK_CALLBACK_GRAPHIC_SELECTION message.

This has many advantages, most notably that it
only sends the URL to the view selecting the
media. Also, it is now easier to handle
the message as there is no need for both
a LOK_CALLBACK_GRAPHIC_SELECTION and
a LOK_CALLBACK_MEDIA_SHAPE. However, the
latter is still defined as we might still
use it at some point.

Signed-off-by: Ashod Nakashian 
Change-Id: I8d4b8794d8e590628630f2b0bfbfb5debe02515f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146848
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153009
Reviewed-by: Pranam Lashkari 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153369
Tested-by: Jenkins
Reviewed-by: Aron Budea 

diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx
index 08d66fd538cc..b46097938695 100644
--- a/include/sfx2/lokhelper.hxx
+++ b/include/sfx2/lokhelper.hxx
@@ -182,10 +182,6 @@ public:
 /// Helper for diagnosing run-time problems
 static void dumpState(rtl::OStringBuffer );
 
-/// Notify all views of a media update.
-/// This could be a new insertion or property modifications to an existing 
one.
-static void notifyMediaUpdate(boost::property_tree::ptree& json);
-
 /// Process the mouse event in the currently active in-place component (if 
any).
 /// Returns true if the event has been processed, and no further 
processing is necessary.
 static bool testInPlaceComponentMouseEventHit(SfxViewShell* pViewShell, 
int nType, int nX,
diff --git a/include/svx/svdomedia.hxx b/include/svx/svdomedia.hxx
index e3120c672f3d..aead70568511 100644
--- a/include/svx/svdomedia.hxx
+++ b/include/svx/svdomedia.hxx
@@ -75,9 +75,6 @@ public:
 
 virtual bool shouldKeepAspectRatio() const override { return true; }
 
-/// When Lokit is enabled, notify the media details.
-void notifyPropertiesForLOKit();
-
 private:
 voidmediaPropertiesChanged( const 
::avmedia::MediaItem& rNewState );
 virtual std::unique_ptr 
CreateObjectSpecificViewContact() override;
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index 356925a6a341..0d598460d7c1 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -983,15 +983,6 @@ void SfxLokHelper::dumpState(rtl::OStringBuffer )
 }
 }
 
-void SfxLokHelper::notifyMediaUpdate(boost::property_tree::ptree& json)
-{
-std::stringstream aStream;
-boost::property_tree::write_json(aStream, json, /*pretty=*/ false);
-const std::string str = aStream.str();
-
-SfxLokHelper::notifyAllViews(LOK_CALLBACK_MEDIA_SHAPE, OString(str));
-}
-
 bool SfxLokHelper::testInPlaceComponentMouseEventHit(SfxViewShell* pViewShell, 
int nType, int nX,
  int nY, int nCount, int 
nButtons,
  int nModifier, double 
fScaleX, double fScaleY,
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index fa0ec5aa084f..7a623dca9c92 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -823,10 +823,12 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle 
const & rRect, const S
 }
 
 {
+OStringBuffer aExtraInfo;
 OString sSelectionText;
 OString sSelectionTextView;
 boost::property_tree::ptree aTableJsonTree;
 boost::property_tree::ptree aGluePointsTree;
+const bool bMediaObj = (mpMarkedObj && mpMarkedObj->GetObjIdentifier() 
== SdrObjKind::Media);
 bool bTableSelection = false;
 bool bConnectorSelection = false;
 
@@ -839,6 +841,7 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle 
const & rRect, const S
 {
 bConnectorSelection = dumpGluePointsToJSON(aGluePointsTree);
 }
+
 if (GetMarkedObjectCount())
 {
 SdrMark* pM = GetSdrMarkByIndex(0);
@@ -848,7 +851,6 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle 
const & rRect, const S
 // (SwVirtFlyDrawObj with a SwGrfNode)
 bool bWriterGraphic = pO->HasLimitedRotation();
 
-OStringBuffer aExtraInfo;
 OString 

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

2023-06-18 Thread TokieSan (via logerrit)
 include/sfx2/objsh.hxx |   10 +
 include/sfx2/strings.hrc   |1 
 sfx2/source/doc/guisaveas.cxx  |7 -
 sfx2/source/doc/objserv.cxx|   81 ++---
 xmlsecurity/source/component/documentdigitalsignatures.cxx |8 +
 5 files changed, 86 insertions(+), 21 deletions(-)

New commits:
commit 46722dbaa7795074e3c5043a76ae3f3a7782491e
Author: TokieSan 
AuthorDate: Tue Jun 6 21:51:42 2023 +0300
Commit: Thorsten Behrens 
CommitDate: Sun Jun 18 22:03:43 2023 +0200

tdf#155665 Adding option to remember signatures for each save

Added the option in digital signatures dialog to remember used
signature.

Implemented ResignDocument function in objserv.cxx to resign after
every save in case the option to remember signature is on.
Added a new dialog box that checks whether there is a need to
remember the signature.

Change-Id: Ia7dbcc952044e9542e3fe6cd84b5d6633fcd1461
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152687
Reviewed-by: Heiko Tietze 
Reviewed-by: Thorsten Behrens 
Tested-by: Thorsten Behrens 

diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index b29fb43d77e4..15533c2954ca 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -190,6 +190,7 @@ private:
   // sal_False := new object
 boolbIsInGenerateThumbnail; //optimize thumbnail 
generate and store procedure to improve odt saving performance, i120030
 boolmbAvoidRecentDocs; ///< Avoid adding to the 
recent documents list, if not necessary.
+boolbRememberSignature; // Do we want to remember 
the signature.
 
 enum TriState   {undefined, yes, no};
 TriStatembContinueImportOnFilterExceptions = 
undefined; // try to import as much as possible
@@ -199,6 +200,8 @@ private:
 SAL_DLLPRIVATE void UpdateTime_Impl(const css::uno::Reference<
 css::document::XDocumentProperties> & i_xDocProps);
 
+css::uno::Sequence< css::security::DocumentSignatureInformation > 
rSignatureInfosRemembered;
+
 SAL_DLLPRIVATE bool SaveTo_Impl(SfxMedium , const SfxItemSet* pSet 
);
 
 protected:
@@ -350,13 +353,14 @@ public:
 void AfterSigning(bool bSignSuccess, bool bSignScriptingContent);
 bool HasValidSignatures() const;
 SignatureState  GetDocumentSignatureState();
-voidSignDocumentContent(weld::Window* 
pDialogParent);
+boolSignDocumentContent(weld::Window* 
pDialogParent);
 css::uno::Sequence 
GetDocumentSignatureInformation(
 bool bScriptingContent,
 const css::uno::Reference& 
xSigner
 = css::uno::Reference());
 
 bool SignDocumentContentUsingCertificate(const 
css::uno::Reference& xCertificate);
+bool ResignDocument(css::uno::Sequence< 
css::security::DocumentSignatureInformation >& rSignaturesInfo);
 
 void SignSignatureLine(weld::Window* pDialogParent, const OUString& 
aSignatureLineId,
const 
css::uno::Reference& xCert,
@@ -364,7 +368,7 @@ public:
const css::uno::Reference& 
xInvalidGraphic,
const OUString& aComment);
 SignatureState  GetScriptingSignatureState();
-voidSignScriptingContent(weld::Window* 
pDialogParent);
+boolSignScriptingContent(weld::Window* 
pDialogParent);
 DECL_DLLPRIVATE_LINK(SignDocumentHandler, weld::Button&, void);
 
 virtual std::shared_ptr 
CreateDocumentInfoDialog(weld::Window* pParent, const SfxItemSet& rItemSet);
@@ -458,6 +462,8 @@ public:
 /// Don't add to the recent documents - it's an expensive operation, 
sometimes it is not wanted.
 boolIsAvoidRecentDocs() const { return 
mbAvoidRecentDocs; }
 
+boolIsRememberingSignature() const { return 
bRememberSignature; }
+
 /// Don't add to the recent documents - it's an expensive operation, 
sometimes it is not wanted.
 voidAvoidRecentDocs(bool bAvoid) { 
mbAvoidRecentDocs = bAvoid; }
 
diff --git a/include/sfx2/strings.hrc b/include/sfx2/strings.hrc
index bd2c0b5d5630..3ccc50cb0947 100644
--- a/include/sfx2/strings.hrc
+++ b/include/sfx2/strings.hrc
@@ -149,6 +149,7 @@
 #define RID_SVXSTR_XMLSEC_QUERY_LOSINGSIGNATURE 
NC_("RID_SVXSTR_XMLSEC_QUERY_LOSINGSIGNATURE", "Saving will remove all existing 
signatures.\nDo you want to continue saving the document?")
 #define RID_SVXSTR_XMLSEC_QUERY_SAVEBEFORESIGN  
NC_("RID_SVXSTR_XMLSEC_QUERY_SAVEBEFORESIGN", "The document has to be saved 
before it can be signed.\nDo you want to save the document?")
 #define STR_QUERY_CANCELCHECKOUT

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

2023-06-16 Thread Szymon Kłos (via logerrit)
 include/sfx2/notebookbar/SfxNotebookBar.hxx |2 -
 sfx2/source/notebookbar/SfxNotebookBar.cxx  |   32 
 2 files changed, 34 deletions(-)

New commits:
commit 97497ae3b402c83344c84ec70a34efbf57c7b62b
Author: Szymon Kłos 
AuthorDate: Fri Jun 16 09:44:39 2023 +0200
Commit: Caolán McNamara 
CommitDate: Fri Jun 16 20:19:33 2023 +0200

tdf#155720 remove old skip notebookbar init workaround

This was introduced due to not working Paste Special dialog
in LOK case. Now everything seems to be ok. Single initialization
should make loading process faster.

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

diff --git a/include/sfx2/notebookbar/SfxNotebookBar.hxx 
b/include/sfx2/notebookbar/SfxNotebookBar.hxx
index 96f5805f50e0..55a318e40bdd 100644
--- a/include/sfx2/notebookbar/SfxNotebookBar.hxx
+++ b/include/sfx2/notebookbar/SfxNotebookBar.hxx
@@ -77,8 +77,6 @@ private:
 static std::map>
 m_pNotebookBarWeldedWrapper;
 
-static void ResetActiveToolbarModeToDefault(vcl::EnumContext::Application 
eApp);
-
 DECL_DLLPRIVATE_STATIC_LINK(SfxNotebookBar, VclDisposeHdl, const 
SfxViewShell*, void);
 };
 
diff --git a/sfx2/source/notebookbar/SfxNotebookBar.cxx 
b/sfx2/source/notebookbar/SfxNotebookBar.cxx
index 3b33ef7dd781..7a9fef48cfca 100644
--- a/sfx2/source/notebookbar/SfxNotebookBar.cxx
+++ b/sfx2/source/notebookbar/SfxNotebookBar.cxx
@@ -290,26 +290,6 @@ bool SfxNotebookBar::IsActive(bool bConsiderSingleToolbar)
 return false;
 }
 
-void 
SfxNotebookBar::ResetActiveToolbarModeToDefault(vcl::EnumContext::Application 
eApp)
-{
-const OUString appName( lcl_getAppName( eApp ) );
-
-if ( appName.isEmpty() )
-return;
-
-const OUString aPath = 
"org.openoffice.Office.UI.ToolbarMode/Applications/" + appName;
-
-utl::OConfigurationTreeRoot aAppNode(
-
::comphelper::getProcessComponentContext(),
-aPath,
-true);
-if ( !aAppNode.isValid() )
-return;
-
-aAppNode.setNodeValue( "Active", Any( OUString( "Default" ) ) );
-aAppNode.commit();
-}
-
 void SfxNotebookBar::ExecMethod(SfxBindings& rBindings, const OUString& 
rUIName)
 {
 // Save active UI file name
@@ -379,18 +359,6 @@ bool SfxNotebookBar::StateMethod(SystemWindow* pSysWindow,
 {
 const SfxViewShell* pViewShell = SfxViewShell::Current();
 
-// Notebookbar was loaded too early what caused:
-//   * in LOK: Paste Special feature was incorrectly initialized
-// Skip first request so Notebookbar will be initialized after 
document was loaded
-static std::map bSkippedFirstInit;
-if (comphelper::LibreOfficeKit::isActive() && eApp == 
vcl::EnumContext::Application::Writer
-&& bSkippedFirstInit.find(pViewShell) == 
bSkippedFirstInit.end())
-{
-bSkippedFirstInit[pViewShell] = true;
-ResetActiveToolbarModeToDefault(eApp);
-return false;
-}
-
 RemoveListeners(pSysWindow);
 
 OUString aBuf = rUIFile + sFile;


[Libreoffice-commits] core.git: include/sfx2 include/svx sc/source sd/source sfx2/source svx/Library_svxcore.mk svx/source sw/inc sw/source

2023-06-05 Thread Tomaž Vajngerl (via logerrit)
 include/sfx2/objsh.hxx |3 
 include/svx/PaletteManager.hxx |   29 
 include/svx/theme/ThemeColorPaletteManager.hxx |   67 +++
 sc/source/ui/docshell/docsh.cxx|   15 +-
 sc/source/ui/inc/docsh.hxx |2 
 sd/source/ui/docshell/docshell.cxx |   14 --
 sd/source/ui/inc/DrawDocShell.hxx  |2 
 sfx2/source/doc/objcont.cxx|2 
 svx/Library_svxcore.mk |1 
 svx/source/tbxctrls/PaletteManager.cxx |  151 ++---
 svx/source/theme/ThemeColorPaletteManager.cxx  |  130 +
 sw/inc/docsh.hxx   |2 
 sw/source/uibase/app/docst.cxx |4 
 13 files changed, 242 insertions(+), 180 deletions(-)

New commits:
commit 6c4c040d2ebc4371a706c762e7e6707875c43535
Author: Tomaž Vajngerl 
AuthorDate: Sat Jun 3 10:44:51 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Mon Jun 5 12:06:23 2023 +0200

svx: extract theme color generation into ThemeColorPaletteManager

The generation of theme colors generation code is moved to the
ThemeColorPaletteManager class, so it can be reused.

Also change the GetThemeColors return type from std::vector
to std::shared_ptr as we can now safely do that
and simplifies things.

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

diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index 3a88131b8f27..b29fb43d77e4 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -46,6 +46,7 @@
 #include 
 
 namespace weld {class Button; }
+namespace model {class ColorSet; }
 class SbxValue;
 class SbxArray;
 class BasicManager;
@@ -558,7 +559,7 @@ public:
 StarBASIC*  GetBasic() const;
 
 virtual std::set GetDocColors();
-virtual std::vector GetThemeColors();
+virtual std::shared_ptr GetThemeColors();
 
 // Accessibility Check
 virtual sfx::AccessibilityIssueCollection runAccessibilityCheck();
diff --git a/include/svx/PaletteManager.hxx b/include/svx/PaletteManager.hxx
index 37d22b92ec64..5a5000bc0076 100644
--- a/include/svx/PaletteManager.hxx
+++ b/include/svx/PaletteManager.hxx
@@ -16,13 +16,13 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
-#ifndef INCLUDED_SVX_PALETTEMANAGER_HXX
-#define INCLUDED_SVX_PALETTEMANAGER_HXX
+#pragma once
 
 #include 
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -31,26 +31,7 @@
 namespace com::sun::star::uno { class XComponentContext; }
 namespace svx { class ToolboxButtonColorUpdaterBase; }
 namespace weld { class Window; }
-
-enum class ThemePaletteColorType
-{
-Black,
-White,
-Low,
-High,
-Normal
-};
-
-struct ThemePaletteData
-{
-ThemePaletteColorType meType = ThemePaletteColorType::Normal;
-Color maColor;
-};
-
-struct ThemePaletteCollection
-{
-std::array maData;
-};
+namespace model { class ColorSet; }
 
 class SVXCORE_DLLPUBLIC PaletteManager
 {
@@ -69,7 +50,7 @@ class SVXCORE_DLLPUBLIC PaletteManager
 ColorSelectFunction maColorSelectFunction;
 
 std::unique_ptr m_pColorDlg;
-std::optional moThemePaletteCollection;
+std::optional moThemePaletteCollection;
 
 PaletteManager(const PaletteManager* pClone);
 public:
@@ -106,6 +87,4 @@ public:
 static void DispatchColorCommand(const OUString& aCommand, const 
NamedColor& rColor);
 };
 
-#endif // INCLUDED_SVX_PALETTEMANAGER_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/theme/ThemeColorPaletteManager.hxx 
b/include/svx/theme/ThemeColorPaletteManager.hxx
new file mode 100644
index ..14fbda39248b
--- /dev/null
+++ b/include/svx/theme/ThemeColorPaletteManager.hxx
@@ -0,0 +1,67 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+#pragma once
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+namespace model
+{
+class ColorSet;
+}
+
+namespace svx
+{
+struct SVXCORE_DLLPUBLIC ThemePaletteEffect
+{
+Color maColor;
+OUString maColorName;
+sal_Int16 mnLumOff = 0;
+sal_Int16 mnLumMod = 10'000;
+
+sal_Int16 getPercentage()
+{
+if (mnLumOff > 0)
+return mnLumOff / 100;
+else
+return (-10'000 + mnLumMod) / 100;
+}
+};
+
+struct SVXCORE_DLLPUBLIC ThemePaletteColorData
+{
+Color maBaseColor;
+model::ThemeColorType meThemeColorType;
+

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

2023-05-16 Thread Heiko Tietze (via logerrit)
 include/sfx2/strings.hrc |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 7e3a9c7b82745f8765b5526f400243f0e8eff390
Author: Heiko Tietze 
AuthorDate: Tue May 16 13:30:51 2023 +0200
Commit: Heiko Tietze 
CommitDate: Tue May 16 17:28:40 2023 +0200

Resolves tdf#154787 - Ambiguous item on macOS quick start menu

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

diff --git a/include/sfx2/strings.hrc b/include/sfx2/strings.hrc
index 83e994bdde77..bd2c0b5d5630 100644
--- a/include/sfx2/strings.hrc
+++ b/include/sfx2/strings.hrc
@@ -136,7 +136,7 @@
 #define STR_QUICKSTART_EXIT NC_("STR_QUICKSTART_EXIT", 
"Exit Quickstarter")
 #define STR_QUICKSTART_TIP  NC_("STR_QUICKSTART_TIP", 
"%PRODUCTNAME %PRODUCTVERSION Quickstarter")
 #define STR_QUICKSTART_FILEOPEN NC_("STR_QUICKSTART_FILEOPEN", 
"Open Document...")
-#define STR_QUICKSTART_FROMTEMPLATE 
NC_("STR_QUICKSTART_FROMTEMPLATE", "From Template...")
+#define STR_QUICKSTART_FROMTEMPLATE 
NC_("STR_QUICKSTART_FROMTEMPLATE", "Template Manager...")
 #define STR_QUICKSTART_PRELAUNCH
NC_("STR_QUICKSTART_PRELAUNCH", "Load %PRODUCTNAME During System Start-Up")
 #define STR_QUICKSTART_LNKNAME  NC_("STR_QUICKSTART_LNKNAME", 
"%PRODUCTNAME %PRODUCTVERSION")
 #define STR_QUICKSTART_FILE NC_("STR_QUICKSTART_FILE", 
"File")


[Libreoffice-commits] core.git: include/sfx2 officecfg/registry sfx2/source sfx2/uiconfig sw/inc sw/sdi sw/source vcl/source

2023-04-25 Thread Jim Raykowski (via logerrit)
 include/sfx2/viewsh.hxx |9 
 officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu |8 
 sfx2/source/dialog/StyleList.cxx|  204 
--
 sfx2/source/dialog/templdlg.cxx |   62 ++-
 sfx2/source/inc/StyleList.hxx   |   15 
 sfx2/source/inc/templdgi.hxx|4 
 sfx2/uiconfig/ui/templatepanel.ui   |  196 
++---
 sw/inc/cmdid.h  |2 
 sw/inc/doc.hxx  |2 
 sw/inc/strings.hrc  |4 
 sw/inc/view.hxx |4 
 sw/sdi/_viewsh.sdi  |6 
 sw/sdi/swriter.sdi  |   17 
 sw/source/core/doc/doc.cxx  |   55 ++
 sw/source/core/inc/txtfrm.hxx   |6 
 sw/source/core/layout/paintfrm.cxx  |   89 
 sw/source/core/text/frmpaint.cxx|4 
 sw/source/core/text/inftxt.cxx  |  177 

 sw/source/core/text/inftxt.hxx  |2 
 sw/source/core/text/porexp.cxx  |3 
 sw/source/core/text/portxt.cxx  |2 
 sw/source/uibase/docvw/edtwin2.cxx  |  203 
+
 sw/source/uibase/uiview/view0.cxx   |   11 
 vcl/source/app/salvtables.cxx   |2 
 24 files changed, 981 insertions(+), 106 deletions(-)

New commits:
commit 4bc86f6477c3ed5f0e97b0a530acf7e102b613b3
Author: Jim Raykowski 
AuthorDate: Sat Apr 15 19:53:05 2023 -0800
Commit: Jim Raykowski 
CommitDate: Tue Apr 25 19:43:33 2023 +0200

tdf#38194 tdf#106556 Enhancement to highlight direct formatting,

paragraph style, and character style use in Writer documents

Initial commit to realize direct formatting, paragraph style, and
character style highlighting enhancement requests.

Highlighting of character direct formatting is turned on/off using
.uno:HighlightCharDF. Highlighting of paragraph styles and character
styles is turned on/off using a check box in the Sidebar Styles panel.
Closing the Sidebar also turns paragraph and character style
highlighting off. Paragraph direct formatting is indicated by a hatch
pattern over the paragraph style highlight bar and also by "+ Paragraph
Direct Formatting" appended to the tooltip that appears showing the
name of the paragraph style when the mouse pointer is over the style
highlight bar.

Colors used for styles highlighting are determined by a hash of the
style name. Lightgray is used for character direct formatting.

Known issue:

Tooltip doesn't show for paragraph style highlighting in tables and in
frames where the highlighting bar is drawn outside of the frame.

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

diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx
index 8589b9b0751b..a9713eb2375f 100644
--- a/include/sfx2/viewsh.hxx
+++ b/include/sfx2/viewsh.hxx
@@ -35,6 +35,7 @@
 #include 
 #include 
 #include 
+#include 
 
 class SfxTabPage;
 class SfxBaseController;
@@ -152,6 +153,8 @@ template bool checkSfxViewShell(const 
SfxViewShell* pShell)
 return dynamic_cast(pShell) != nullptr;
 }
 
+typedef std::unordered_map> 
StylesHighlighterColorMap;
+
 /**
  * One SfxViewShell more or less represents one edit window for a document, 
there can be multiple
  * ones for a single opened document (SfxObjectShell).
@@ -180,6 +183,9 @@ friend class SfxPrinterController;
 /// Used for async export
 std::shared_ptr m_xHelper;
 
+StylesHighlighterColorMap ParaStylesColorMap;
+StylesHighlighterColorMap CharStylesColorMap;
+
 protected:
 virtual voidActivate(bool IsMDIActivate) override;
 virtual voidDeactivate(bool IsMDIActivate) override;
@@ -457,6 +463,9 @@ public:
 bool isBlockedCommand(OUString command);
 
 void SetStoringHelper(std::shared_ptr xHelper) { 
m_xHelper = xHelper; }
+
+StylesHighlighterColorMap& GetStylesHighlighterParaColorMap() { return 
ParaStylesColorMap; }
+StylesHighlighterColorMap& GetStylesHighlighterCharColorMap() { return 
CharStylesColorMap; }
 };
 
 #endif // INCLUDED_SFX2_VIEWSH_HXX
diff --git 

[Libreoffice-commits] core.git: include/sfx2 svx/uiconfig sw/CppunitTest_sw_uwriter.mk sw/inc sw/Library_sw.mk sw/source

2023-04-20 Thread Samuel Mehrbrodt (via logerrit)
 include/sfx2/AccessibilityIssue.hxx   |   10 ++
 svx/uiconfig/ui/accessibilitycheckentry.ui|   13 
 sw/CppunitTest_sw_uwriter.mk  |1 
 sw/Library_sw.mk  |1 
 sw/inc/AccessibilityCheckStrings.hrc  |2 +
 sw/source/core/access/AccessibilityIssue.cxx  |   33 ++
 sw/source/core/inc/AccessibilityIssue.hxx |3 ++
 sw/source/uibase/sidebar/A11yCheckIssuesPanel.cxx |   10 ++
 sw/source/uibase/sidebar/A11yCheckIssuesPanel.hxx |2 +
 9 files changed, 75 insertions(+)

New commits:
commit ccd6415902ab2fd35658cb28258e0a7ce935d376
Author: Samuel Mehrbrodt 
AuthorDate: Mon Apr 3 22:42:57 2023 +0200
Commit: Samuel Mehrbrodt 
CommitDate: Thu Apr 20 11:24:51 2023 +0200

tdf#142978 Add quick fix action for missing alt text

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

diff --git a/include/sfx2/AccessibilityIssue.hxx 
b/include/sfx2/AccessibilityIssue.hxx
index d1bf1ee11766..f6290ae9a01e 100644
--- a/include/sfx2/AccessibilityIssue.hxx
+++ b/include/sfx2/AccessibilityIssue.hxx
@@ -11,7 +11,10 @@
 #pragma once
 
 #include 
+
+#include 
 #include 
+
 #include 
 #include 
 
@@ -46,8 +49,15 @@ public:
 virtual bool canGotoIssue() const = 0;
 virtual void gotoIssue() const = 0;
 
+virtual bool canQuickFixIssue() const = 0;
+virtual void quickFixIssue() const = 0;
+
+virtual void setParent(weld::Window* pParent) { m_pParent = pParent; }
+
 AccessibilityIssueID m_eIssueID;
 OUString m_aIssueText;
+
+weld::Window* m_pParent;
 };
 
 class SFX2_DLLPUBLIC AccessibilityIssueCollection
diff --git a/svx/uiconfig/ui/accessibilitycheckentry.ui 
b/svx/uiconfig/ui/accessibilitycheckentry.ui
index 410e639fab0a..19f14d8f3779 100644
--- a/svx/uiconfig/ui/accessibilitycheckentry.ui
+++ b/svx/uiconfig/ui/accessibilitycheckentry.ui
@@ -41,5 +41,18 @@
 1
   
 
+
+  
+Fix
+True
+True
+True
+  
+  
+False
+False
+2
+  
+
   
 
diff --git a/sw/CppunitTest_sw_uwriter.mk b/sw/CppunitTest_sw_uwriter.mk
index 7b328c998fe3..40e6db025fc6 100644
--- a/sw/CppunitTest_sw_uwriter.mk
+++ b/sw/CppunitTest_sw_uwriter.mk
@@ -30,6 +30,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_uwriter, \
$(call gb_Helper_optional,AVMEDIA,avmedia) \
 basegfx \
 comphelper \
+cui \
 cppu \
 cppuhelper \
 $(call gb_Helper_optional,DBCONNECTIVITY, \
diff --git a/sw/Library_sw.mk b/sw/Library_sw.mk
index 5abd6bb541d7..bc0067dcb8a8 100644
--- a/sw/Library_sw.mk
+++ b/sw/Library_sw.mk
@@ -56,6 +56,7 @@ $(eval $(call gb_Library_use_libraries,sw,\
 comphelper \
 cppu \
 cppuhelper \
+cui \
 $(call gb_Helper_optional,DBCONNECTIVITY, \
 dbtools) \
 docmodel \
diff --git a/sw/inc/AccessibilityCheckStrings.hrc 
b/sw/inc/AccessibilityCheckStrings.hrc
index bfd0557d8a98..805f525b37e2 100644
--- a/sw/inc/AccessibilityCheckStrings.hrc
+++ b/sw/inc/AccessibilityCheckStrings.hrc
@@ -41,6 +41,8 @@
 #define STR_STYLE_NO_LANGUAGE   NC_("STR_STYLE_NO_LANGUAGE", "Style 
“%STYLE_NAME%” has no language set.")
 #define STR_DOCUMENT_TITLE  NC_("STR_DOCUMENT_TITLE", "Document 
title is not set.")
 
+#define STR_ENTER_ALT   NC_("STR_ENTER_ALT", "Enter 
alternative text:")
+
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/AccessibilityIssue.cxx 
b/sw/source/core/access/AccessibilityIssue.cxx
index f8b8e3858013..628a77e4f2ff 100644
--- a/sw/source/core/access/AccessibilityIssue.cxx
+++ b/sw/source/core/access/AccessibilityIssue.cxx
@@ -9,9 +9,12 @@
  */
 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
+#include 
 
 namespace sw
 {
@@ -84,6 +87,36 @@ void AccessibilityIssue::gotoIssue() const
 }
 }
 
+bool AccessibilityIssue::canQuickFixIssue() const
+{
+return m_eIssueObject == IssueObject::GRAPHIC || m_eIssueObject == 
IssueObject::OLE;
+}
+
+void AccessibilityIssue::quickFixIssue() const
+{
+if (!m_pDoc)
+return;
+
+switch (m_eIssueObject)
+{
+case IssueObject::GRAPHIC:
+case IssueObject::OLE:
+{
+OUString aDesc = SwResId(STR_ENTER_ALT);
+SvxNameDialog aNameDialog(m_pParent, "", aDesc);
+if (aNameDialog.run() == RET_OK)
+{
+SwFlyFrameFormat* pFlyFormat
+= 
const_cast(m_pDoc->FindFlyByName(m_sObjectID));
+m_pDoc->SetFlyFrameTitle(*pFlyFormat, aNameDialog.GetName());
+}
+}
+break;
+default:
+break;
+}
+}
+
 } // end sw namespace
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git 

[Libreoffice-commits] core.git: include/sfx2 include/vcl sc/source sd/source sfx2/source svx/source sw/source vcl/Library_vcl.mk vcl/source

2023-03-07 Thread Marco Cecchetti (via logerrit)
 include/sfx2/LokControlHandler.hxx   |   70 ---
 include/sfx2/viewsh.hxx  |4 
 include/vcl/DocWindow.hxx|   30 ++
 include/vcl/IDialogRenderable.hxx|6 +
 include/vcl/ctrl.hxx |3 
 include/vcl/svapp.hxx|2 
 include/vcl/window.hxx   |2 
 sc/source/ui/inc/gridwin.hxx |3 
 sc/source/ui/view/gridwin.cxx|2 
 sd/source/ui/inc/Window.hxx  |4 
 sd/source/ui/unoidl/unomodel.cxx |   28 +-
 sd/source/ui/view/sdwindow.cxx   |2 
 sfx2/source/view/viewsh.cxx  |5 +
 svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx |7 +
 svx/source/svdraw/svdpntv.cxx|3 
 sw/source/uibase/docvw/edtwin.cxx|2 
 sw/source/uibase/inc/edtwin.hxx  |4 
 sw/source/uibase/uno/unotxdoc.cxx|   21 
 vcl/Library_vcl.mk   |1 
 vcl/source/app/svapp.cxx |3 
 vcl/source/control/ctrl.cxx  |   31 ++
 vcl/source/window/DocWindow.cxx  |   40 
 vcl/source/window/mouse.cxx  |   24 -
 23 files changed, 245 insertions(+), 52 deletions(-)

New commits:
commit 7adfecb0f5947ae258226c8d1652546f81577026
Author: Marco Cecchetti 
AuthorDate: Sun Feb 5 17:47:34 2023 +0100
Commit: Marco Cecchetti 
CommitDate: Tue Mar 7 19:30:11 2023 +

lok: form controls: rendering and mouse event forwarding

What we got
- Most controls rendered on Writer and Impress (on Calc already
implemented by Tomaž Vajngerl)
- Text labels rendered correctly
- Mouse events forwarded to controls
- Control state changed on click for Writer and Calc
- Control invalidation for all apps
- Fixed broken LOK_CALLBACK_MOUSE_POINTER msg
- Correct pointer style when mouse is hovering over a control

Need to be improved
- in impress click method for a control is not executed even if the
mouse event is forwarded correctly
- avoid not needed control invalidations (as the one occurring on
document autosaving)

Change-Id: I4d5012af7f90a2c726b6b6b5b068e2be1ed5568a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146569
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tomaž Vajngerl 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147320
Tested-by: Jenkins
Reviewed-by: Marco Cecchetti 

diff --git a/include/sfx2/LokControlHandler.hxx 
b/include/sfx2/LokControlHandler.hxx
index c422afc979cc..dc69787456e5 100644
--- a/include/sfx2/LokControlHandler.hxx
+++ b/include/sfx2/LokControlHandler.hxx
@@ -9,12 +9,13 @@
 
 #pragma once
 
+#include 
+#include 
 #include 
-#include 
 #include 
-#include 
+#include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -22,14 +23,22 @@
 #include 
 #include 
 #include 
+#include 
+
+#include 
+
+#include 
 
 class LokControlHandler
 {
 public:
 static bool postMouseEvent(const SdrPage* pPage, const SdrView* pDrawView,
-   vcl::Window const& rMainWindow, int nType, 
Point aPointHmm,
-   int nCount, int nButtons, int nModifier)
+   vcl::DocWindow& rMainWindow, int nType, Point 
aPointHmm, int nCount,
+   int nButtons, int nModifier)
 {
+static std::optional eDocPointerStyle;
+
+o3tl::Length eControlUnitLength = 
MapToO3tlLength(rMainWindow.GetMapMode().GetMapUnit());
 SdrObjListIter aIterator(pPage, SdrIterMode::Flat);
 while (aIterator.IsMore())
 {
@@ -37,7 +46,10 @@ public:
 SdrUnoObj* pUnoObect = dynamic_cast(pObject);
 if (pUnoObect)
 {
-tools::Rectangle aControlRectHMM = pUnoObect->GetLogicRect();
+tools::Rectangle aControlRect = pUnoObect->GetLogicRect();
+tools::Rectangle aControlRectHMM
+= o3tl::convert(aControlRect, eControlUnitLength, 
o3tl::Length::mm100);
+
 if (aControlRectHMM.Contains(aPointHmm))
 {
 css::uno::Reference xControl
@@ -55,6 +67,19 @@ public:
 VclPtr pWindow = 
VCLUnoHelper::GetWindow(xWindowPeer);
 if (pWindow)
 {
+tools::Rectangle aControlRectPx
+= o3tl::convert(aControlRectHMM, 
o3tl::Length::mm100, o3tl::Length::px);
+// used by Control::LogicInvalidate
+   

[Libreoffice-commits] core.git: include/sfx2 sfx2/Library_sfx.mk sfx2/source sw/qa

2023-02-21 Thread Jim Raykowski (via logerrit)
 include/sfx2/sidebar/TabBar.hxx   |2 +
 sfx2/Library_sfx.mk   |1 
 sfx2/source/sidebar/TabBar.cxx|9 
 sfx2/source/sidebar/uiobject.cxx  |   61 +
 sfx2/source/sidebar/uiobject.hxx  |   32 +
 sw/qa/uitest/sidebar/tdf152921.py |   70 ++
 6 files changed, 175 insertions(+)

New commits:
commit 88e29df0c216c300b9388ee2822003da2bee8679
Author: Jim Raykowski 
AuthorDate: Sat Jan 14 12:06:10 2023 -0900
Commit: Xisco Fauli 
CommitDate: Tue Feb 21 20:20:03 2023 +

tdf#152921 add uitest

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

diff --git a/include/sfx2/sidebar/TabBar.hxx b/include/sfx2/sidebar/TabBar.hxx
index fcbced33fa98..30da7852706f 100644
--- a/include/sfx2/sidebar/TabBar.hxx
+++ b/include/sfx2/sidebar/TabBar.hxx
@@ -39,6 +39,7 @@ class SidebarController;
 */
 class TabBar final : public InterimItemWindow
 {
+friend class TabBarUIObject;
 public:
 /** DeckMenuData has entries for display name, and a flag:
  - isCurrentDeck for the deck selection data
@@ -85,6 +86,7 @@ public:
 /// Enables/Disables the menu button. Used by LoKit.
 void EnableMenuButton(const bool bEnable);
 
+virtual FactoryFunction GetUITestFactory() const override;
 private:
 css::uno::Reference mxFrame;
 
diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk
index 7b1dee935ff3..72f6bbaa9f0c 100644
--- a/sfx2/Library_sfx.mk
+++ b/sfx2/Library_sfx.mk
@@ -287,6 +287,7 @@ $(eval $(call gb_Library_add_exception_objects,sfx,\
 sfx2/source/sidebar/TitleBar \
 sfx2/source/sidebar/Theme \
 sfx2/source/sidebar/Tools \
+sfx2/source/sidebar/uiobject\
 sfx2/source/sidebar/UnoPanel \
 sfx2/source/sidebar/UnoPanels \
 sfx2/source/sidebar/UnoDeck \
diff --git a/sfx2/source/sidebar/TabBar.cxx b/sfx2/source/sidebar/TabBar.cxx
index bd73322f9496..6b77096898c7 100644
--- a/sfx2/source/sidebar/TabBar.cxx
+++ b/sfx2/source/sidebar/TabBar.cxx
@@ -35,6 +35,8 @@
 #include 
 #include 
 
+#include "uiobject.hxx"
+
 using namespace css;
 using namespace css::uno;
 
@@ -58,6 +60,8 @@ TabBar::TabBar(vcl::Window* pParentWindow,
 , maPopupMenuProvider(std::move(aPopupMenuProvider))
 , pParentSidebarController(rParentSidebarController)
 {
+set_id("TabBar"); // for uitest
+
 InitControlBase(mxMenuButton.get());
 
 mxTempToplevel->move(mxContents.get(), m_xContainer.get());
@@ -378,6 +382,11 @@ void TabBar::EnableMenuButton(const bool bEnable)
 mxMenuButton->set_sensitive(bEnable);
 }
 
+FactoryFunction TabBar::GetUITestFactory() const
+{
+return TabBarUIObject::create;
+}
+
 } // end of namespace sfx2::sidebar
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/sidebar/uiobject.cxx b/sfx2/source/sidebar/uiobject.cxx
new file mode 100644
index ..13c21d2220b5
--- /dev/null
+++ b/sfx2/source/sidebar/uiobject.cxx
@@ -0,0 +1,61 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include "uiobject.hxx"
+#include 
+
+namespace sfx2::sidebar
+{
+TabBarUIObject::TabBarUIObject(const VclPtr& xTabBar)
+: WindowUIObject(xTabBar)
+, mxTabBar(xTabBar)
+{
+}
+
+StringMap TabBarUIObject::get_state()
+{
+StringMap aMap = WindowUIObject::get_state();
+OUString rsHighlightedTabsIds;
+for (auto const& item : mxTabBar->maItems)
+{
+if (item->mxButton->get_item_active("toggle"))
+{
+if (!rsHighlightedTabsIds.isEmpty())
+rsHighlightedTabsIds += ",";
+rsHighlightedTabsIds += item->msDeckId;
+}
+}
+aMap["HighlightedTabsIds"] = rsHighlightedTabsIds;
+return aMap;
+}
+
+void TabBarUIObject::execute(const OUString& rAction, const StringMap& 
rParameters)
+{
+if (rAction == "CLICK")
+{
+if (rParameters.find("POS") != rParameters.end())
+mxTabBar->pParentSidebarController->OpenThenToggleDeck(
+
mxTabBar->GetDeckIdForIndex(rParameters.find("POS")->second.toInt32()));
+}
+else
+WindowUIObject::execute(rAction, rParameters);
+}
+
+std::unique_ptr TabBarUIObject::create(vcl::Window* pWindow)
+{
+TabBar* pTabBar = dynamic_cast(pWindow);
+assert(pTabBar);
+return std::unique_ptr(new TabBarUIObject(pTabBar));
+}
+
+OUString TabBarUIObject::get_name() const { return "TabBarUIObject"; }
+
+} // namespace sidebar
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/sidebar/uiobject.hxx b/sfx2/source/sidebar/uiobject.hxx
new file 

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

2023-02-16 Thread Caolán McNamara (via logerrit)
 include/sfx2/request.hxx|2 +-
 sfx2/source/control/request.cxx |   16 +---
 2 files changed, 6 insertions(+), 12 deletions(-)

New commits:
commit 8c1a3422dbce3236ca310e0541ca9d1ead2fc166
Author: Caolán McNamara 
AuthorDate: Thu Feb 16 10:54:00 2023 +
Commit: Caolán McNamara 
CommitDate: Thu Feb 16 20:32:02 2023 +

SfxRequest::GetMacroRecorder arg is always derefed before passed

so null can never be seen in the function

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

diff --git a/include/sfx2/request.hxx b/include/sfx2/request.hxx
index 2d5939758eec..966974498065 100644
--- a/include/sfx2/request.hxx
+++ b/include/sfx2/request.hxx
@@ -98,7 +98,7 @@ public:
 voidSetReturnValue(const SfxPoolItem &);
 const SfxPoolItem*  GetReturnValue() const;
 
-static css::uno::Reference< css::frame::XDispatchRecorder > 
GetMacroRecorder( SfxViewFrame const * pFrame );
+static css::uno::Reference< css::frame::XDispatchRecorder > 
GetMacroRecorder(const SfxViewFrame& rFrame);
 static bool HasMacroRecorder(const SfxViewFrame& rFrame);
 SfxCallMode GetCallMode() const;
 voidAllowRecording( bool );
diff --git a/sfx2/source/control/request.cxx b/sfx2/source/control/request.cxx
index e7757adc82ef..4cfeb629121c 100644
--- a/sfx2/source/control/request.cxx
+++ b/sfx2/source/control/request.cxx
@@ -164,7 +164,7 @@ SfxRequest::SfxRequest
 if (pImpl->pViewFrame->GetDispatcher()->GetShellAndSlot_Impl(nSlot, 
>pShell, >pSlot, true, true))
 {
 pImpl->SetPool( >pShell->GetPool() );
-pImpl->xRecorder = SfxRequest::GetMacroRecorder(pImpl->pViewFrame);
+pImpl->xRecorder = SfxRequest::GetMacroRecorder(*pImpl->pViewFrame);
 if (pImpl->xRecorder)
 pImpl->xTransform = 
util::URLTransformer::create(comphelper::getProcessComponentContext());
 pImpl->aTarget = pImpl->pShell->GetName();
@@ -205,7 +205,7 @@ SfxRequest::SfxRequest
 if( pImpl->pViewFrame->GetDispatcher()->GetShellAndSlot_Impl( nSlotId, 
>pShell, >pSlot, true, true ) )
 {
 pImpl->SetPool( >pShell->GetPool() );
-pImpl->xRecorder = SfxRequest::GetMacroRecorder( pViewFrame );
+pImpl->xRecorder = SfxRequest::GetMacroRecorder(*pViewFrame);
 if (pImpl->xRecorder)
 pImpl->xTransform = 
util::URLTransformer::create(comphelper::getProcessComponentContext());
 pImpl->aTarget = pImpl->pShell->GetName();
@@ -673,7 +673,7 @@ bool SfxRequest::IsDone() const
 }
 
 
-css::uno::Reference< css::frame::XDispatchRecorder > 
SfxRequest::GetMacroRecorder( SfxViewFrame const * pView )
+css::uno::Reference< css::frame::XDispatchRecorder > 
SfxRequest::GetMacroRecorder(const SfxViewFrame& rView)
 
 /*  [Description]
 
@@ -687,14 +687,8 @@ css::uno::Reference< css::frame::XDispatchRecorder > 
SfxRequest::GetMacroRecorde
 {
 css::uno::Reference< css::frame::XDispatchRecorder > xRecorder;
 
-if (!pView)
-pView = SfxViewFrame::Current();
-
-if (!pView)
-return xRecorder;
-
 css::uno::Reference< css::beans::XPropertySet > xSet(
-pView->GetFrame().GetFrameInterface(),
+rView.GetFrame().GetFrameInterface(),
 css::uno::UNO_QUERY);
 
 if(xSet.is())
@@ -711,7 +705,7 @@ css::uno::Reference< css::frame::XDispatchRecorder > 
SfxRequest::GetMacroRecorde
 
 bool SfxRequest::HasMacroRecorder(const SfxViewFrame& rView)
 {
-return GetMacroRecorder().is();
+return GetMacroRecorder(rView).is();
 }
 
 bool SfxRequest::IsAPI() const


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

2023-02-16 Thread Caolán McNamara (via logerrit)
 include/sfx2/request.hxx   |2 +-
 sfx2/source/control/request.cxx|5 ++---
 sw/source/ui/misc/glossary.cxx |6 +++---
 sw/source/uibase/shells/basesh.cxx |2 +-
 4 files changed, 7 insertions(+), 8 deletions(-)

New commits:
commit 3e36caa1ec24a465a0918dd63976dfd970a41c1d
Author: Caolán McNamara 
AuthorDate: Thu Feb 16 10:50:36 2023 +
Commit: Caolán McNamara 
CommitDate: Thu Feb 16 19:18:29 2023 +

HasMacroRecorder can take a reference, never passed null

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

diff --git a/include/sfx2/request.hxx b/include/sfx2/request.hxx
index 5a97cb9e61b8..2d5939758eec 100644
--- a/include/sfx2/request.hxx
+++ b/include/sfx2/request.hxx
@@ -99,7 +99,7 @@ public:
 const SfxPoolItem*  GetReturnValue() const;
 
 static css::uno::Reference< css::frame::XDispatchRecorder > 
GetMacroRecorder( SfxViewFrame const * pFrame );
-static bool HasMacroRecorder( SfxViewFrame const * pFrame );
+static bool HasMacroRecorder(const SfxViewFrame& rFrame);
 SfxCallMode GetCallMode() const;
 voidAllowRecording( bool );
 boolAllowsRecording() const;
diff --git a/sfx2/source/control/request.cxx b/sfx2/source/control/request.cxx
index b43d1dd991bc..e7757adc82ef 100644
--- a/sfx2/source/control/request.cxx
+++ b/sfx2/source/control/request.cxx
@@ -709,12 +709,11 @@ css::uno::Reference< css::frame::XDispatchRecorder > 
SfxRequest::GetMacroRecorde
 return xRecorder;
 }
 
-bool SfxRequest::HasMacroRecorder( SfxViewFrame const * pView )
+bool SfxRequest::HasMacroRecorder(const SfxViewFrame& rView)
 {
-return GetMacroRecorder( pView ).is();
+return GetMacroRecorder().is();
 }
 
-
 bool SfxRequest::IsAPI() const
 
 /*  [Description]
diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx
index e76702250033..aa7b83caf1c5 100644
--- a/sw/source/ui/misc/glossary.cxx
+++ b/sw/source/ui/misc/glossary.cxx
@@ -413,7 +413,7 @@ IMPL_LINK(SwGlossaryDlg, GrpSelect, weld::TreeView&, rBox, 
void)
 ShowAutoText("", "");
 // update controls
 NameModify(*m_xShortNameEdit);
-if( SfxRequest::HasMacroRecorder( _pShell->GetView().GetViewFrame() ) )
+if (SfxRequest::HasMacroRecorder(m_pShell->GetView().GetViewFrame()))
 {
 SfxRequest aReq( _pShell->GetView().GetViewFrame(), 
FN_SET_ACT_GLOSSARY );
 aReq.AppendItem(SfxStringItem(FN_SET_ACT_GLOSSARY, 
getCurrentGlossary()));
@@ -436,7 +436,7 @@ void SwGlossaryDlg::Apply()
 {
 m_pGlossaryHdl->InsertGlossary(aGlosName);
 }
-if( SfxRequest::HasMacroRecorder( _pShell->GetView().GetViewFrame() ) )
+if (SfxRequest::HasMacroRecorder(m_pShell->GetView().GetViewFrame()))
 {
 SfxRequest aReq( _pShell->GetView().GetViewFrame(), 
FN_INSERT_GLOSSARY );
 aReq.AppendItem(SfxStringItem(FN_INSERT_GLOSSARY, 
getCurrentGlossary()));
@@ -593,7 +593,7 @@ IMPL_LINK(SwGlossaryDlg, MenuHdl, const OString&, 
rItemIdent, void)
 m_xShortNameEdit->set_text(aShortName);
 NameModify(*m_xNameED);   // for toggling the buttons
 
-if( SfxRequest::HasMacroRecorder( 
_pShell->GetView().GetViewFrame() ) )
+if 
(SfxRequest::HasMacroRecorder(m_pShell->GetView().GetViewFrame()))
 {
 SfxRequest aReq(_pShell->GetView().GetViewFrame(), 
FN_NEW_GLOSSARY);
 aReq.AppendItem(SfxStringItem(FN_NEW_GLOSSARY, 
getCurrentGlossary()));
diff --git a/sw/source/uibase/shells/basesh.cxx 
b/sw/source/uibase/shells/basesh.cxx
index 922e1c4c31ae..88cfb135ef84 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -1272,7 +1272,7 @@ void SwBaseShell::Execute(SfxRequest )
 bool bInserted = false;
 //recording:
 SfxViewFrame& rViewFrame = GetView().GetViewFrame();
-if( SfxRequest::HasMacroRecorder() )
+if (SfxRequest::HasMacroRecorder(rViewFrame))
 {
 SfxRequest aReq( , nSlot);
 aReq.AppendItem( SfxStringItem( FN_PARAM_1, 
OUString(cDelim) ));


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

2023-02-01 Thread Samuel Mehrbrodt (via logerrit)
 include/sfx2/strings.hrc |3 ++-
 sfx2/source/view/viewfrm.cxx |2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 4fa56b89cd1d306068a7ec8298b7ba1869e612a9
Author: Samuel Mehrbrodt 
AuthorDate: Mon Jan 30 13:55:01 2023 +0100
Commit: Samuel Mehrbrodt 
CommitDate: Thu Feb 2 07:05:26 2023 +

Own title for macro infobars

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

diff --git a/include/sfx2/strings.hrc b/include/sfx2/strings.hrc
index bafda3df1a6c..83e994bdde77 100644
--- a/include/sfx2/strings.hrc
+++ b/include/sfx2/strings.hrc
@@ -292,9 +292,10 @@
 #define STR_HYPHENATION_BUTTON  NC_("STR_HYPHENATION_BUTTON", 
"Learn more")
 #define STR_REFRESH_MASTER_PASSWORD 
NC_("STR_REFRESH_MASTER_PASSWORD", "The master password is stored in an 
outdated format, you should refresh it")
 #define STR_REFRESH_PASSWORDNC_("STR_REFRESH_PASSWORD", 
"Refresh Password")
+#define STR_MACROS_DISABLED_TITLE   
NC_("STR_MACROS_DISABLED_TITLE", "Macros disabled")
 #define STR_CONTAINS_MACROS NC_("STR_CONTAINS_MACROS", 
"Macros in this document are disabled due to the Macro Security settings.")
 #define STR_MACROS_DISABLED NC_("STR_MACROS_DISABLED", 
"Macros are disabled due to the Macro Security settings.")
-#define STR_MACROS_DISABLED_CONTENT_UNSIGNED
NC_("STR_MACROS_DISABLED_CONTENT_UNSIGNED", "Macros are disabled. Macros are 
signed, but the document (containing document events) is not signed.")
+#define STR_MACROS_DISABLED_CONTENT_UNSIGNED
NC_("STR_MACROS_DISABLED_CONTENT_UNSIGNED", "Macros are signed, but the 
document (containing document events) is not signed.")
 #define STR_MACROS  NC_("STR_MACROS", "Show 
Macros")
 #define STR_EVENTS  NC_("STR_EVENTS", "Show 
Events")
 
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 1e4df24f60b9..f45075112606 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -1331,7 +1331,7 @@ void SfxViewFrame::AppendContainsMacrosInfobar()
 aResId = STR_CONTAINS_MACROS;
 else if (pObjImpl->aMacroMode.hasUnsignedContentError())
 aResId = STR_MACROS_DISABLED_CONTENT_UNSIGNED;
-auto pInfoBar = AppendInfoBar("macro", 
SfxResId(RID_SECURITY_WARNING_TITLE),
+auto pInfoBar = AppendInfoBar("macro", 
SfxResId(STR_MACROS_DISABLED_TITLE),
   SfxResId(aResId), InfobarType::WARNING);
 if (!pInfoBar)
 return;


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

2023-01-30 Thread Samuel Mehrbrodt (via logerrit)
 include/sfx2/docmacromode.hxx|2 ++
 include/sfx2/strings.hrc |1 +
 include/svtools/sfxecode.hxx |1 -
 sfx2/source/doc/docmacromode.cxx |   30 --
 sfx2/source/view/viewfrm.cxx |6 +-
 svtools/inc/errtxt.hrc   |1 -
 6 files changed, 16 insertions(+), 25 deletions(-)

New commits:
commit 829f898f0076082c039494bc0fffe00e2dd4ac26
Author: Samuel Mehrbrodt 
AuthorDate: Mon Jan 30 09:35:46 2023 +0100
Commit: Samuel Mehrbrodt 
CommitDate: Mon Jan 30 12:26:07 2023 +

Show infobar instead of dialog when unsigned content is found

Follow up to f41627ab60372345be646c53d967b65be43b562f

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

diff --git a/include/sfx2/docmacromode.hxx b/include/sfx2/docmacromode.hxx
index 7ed42f6a14dd..2a0421aa0c90 100644
--- a/include/sfx2/docmacromode.hxx
+++ b/include/sfx2/docmacromode.hxx
@@ -255,6 +255,8 @@ namespace sfx2
 */
 boolhasMacroLibrary() const;
 
+bool hasUnsignedContentError() const;
+
 /** determines whether the given document storage has sub storages 
containing scripts
 or macros.
 
diff --git a/include/sfx2/strings.hrc b/include/sfx2/strings.hrc
index e4133eb69203..bafda3df1a6c 100644
--- a/include/sfx2/strings.hrc
+++ b/include/sfx2/strings.hrc
@@ -294,6 +294,7 @@
 #define STR_REFRESH_PASSWORDNC_("STR_REFRESH_PASSWORD", 
"Refresh Password")
 #define STR_CONTAINS_MACROS NC_("STR_CONTAINS_MACROS", 
"Macros in this document are disabled due to the Macro Security settings.")
 #define STR_MACROS_DISABLED NC_("STR_MACROS_DISABLED", 
"Macros are disabled due to the Macro Security settings.")
+#define STR_MACROS_DISABLED_CONTENT_UNSIGNED
NC_("STR_MACROS_DISABLED_CONTENT_UNSIGNED", "Macros are disabled. Macros are 
signed, but the document (containing document events) is not signed.")
 #define STR_MACROS  NC_("STR_MACROS", "Show 
Macros")
 #define STR_EVENTS  NC_("STR_EVENTS", "Show 
Events")
 
diff --git a/include/svtools/sfxecode.hxx b/include/svtools/sfxecode.hxx
index 4464d4230a35..8878b9d3f62f 100644
--- a/include/svtools/sfxecode.hxx
+++ b/include/svtools/sfxecode.hxx
@@ -34,7 +34,6 @@ class ErrCode;
 #define ERRCODE_SFX_CANTGETPASSWD   ErrCode(ErrCodeArea::Sfx, 
ErrCodeClass::Read, 42)
 #define ERRCODE_SFX_NOMOREDOCUMENTSALLOWED  ErrCode(WarningFlag::Yes, 
ErrCodeArea::Sfx, ErrCodeClass::NONE, 44)
 #define ERRCODE_SFX_CANTCREATEBACKUPErrCode(ErrCodeArea::Sfx, 
ErrCodeClass::Create, 50)
-#define ERRCODE_SFX_DOCUMENT_MACRO_DISABLED_CONTENT_UNSIGNED 
ErrCode(WarningFlag::Yes, ErrCodeArea::Sfx, ErrCodeClass::NONE, 53)
 #define ERRCODE_SFX_SHARED_NOPASSWORDCHANGE ErrCode(WarningFlag::Yes, 
ErrCodeArea::Sfx, ErrCodeClass::NONE, 54)
 #define ERRCODE_SFX_INCOMPLETE_ENCRYPTION   ErrCode(WarningFlag::Yes, 
ErrCodeArea::Sfx, ErrCodeClass::NONE, 55)
 #define ERRCODE_SFX_FORMAT_ROWCOL   ErrCode(ErrCodeArea::Sfx, 
ErrCodeClass::NONE, 57)
diff --git a/sfx2/source/doc/docmacromode.cxx b/sfx2/source/doc/docmacromode.cxx
index bf17a0497a5d..db527ef3a036 100644
--- a/sfx2/source/doc/docmacromode.cxx
+++ b/sfx2/source/doc/docmacromode.cxx
@@ -74,38 +74,19 @@ namespace sfx2
 IMacroDocumentAccess&   m_rDocumentAccess;
 boolm_bMacroDisabledMessageShown;
 boolm_bDocMacroDisabledMessageShown;
+bool m_bHasUnsignedContentError;
 
 explicit DocumentMacroMode_Data( IMacroDocumentAccess& rDocumentAccess 
)
 :m_rDocumentAccess( rDocumentAccess )
 ,m_bMacroDisabledMessageShown( false )
 ,m_bDocMacroDisabledMessageShown( false )
+,m_bHasUnsignedContentError( false )
 {
 }
 };
 
-
-//= helper
-
 namespace
 {
-
-void lcl_showGeneralSfxErrorOnce( const Reference< XInteractionHandler 
>& rxHandler, ErrCode nSfxErrorCode, bool& rbAlreadyShown )
-{
-if ( rbAlreadyShown )
-return;
-
-ErrorCodeRequest aErrorCodeRequest;
-aErrorCodeRequest.ErrCode = sal_uInt32(nSfxErrorCode);
-
-SfxMedium::CallApproveHandler( rxHandler, Any( aErrorCodeRequest 
), false );
-rbAlreadyShown = true;
-}
-
-void lcl_showMacrosDisabledUnsignedContentError( const Reference< 
XInteractionHandler >& rxHandler, bool& rbAlreadyShown )
-{
-lcl_showGeneralSfxErrorOnce( rxHandler, 
ERRCODE_SFX_DOCUMENT_MACRO_DISABLED_CONTENT_UNSIGNED, rbAlreadyShown );
-}
-
 bool lcl_showMacroWarning( const Reference< XInteractionHandler >& 
rxHandler,
 const OUString& rDocumentLocation )
 {
@@ -231,7 +212,7 @@ 

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

2023-01-30 Thread Samuel Mehrbrodt (via logerrit)
 include/sfx2/strings.hrc |1 
 include/svtools/sfxecode.hxx |4 ---
 sfx2/source/doc/docmacromode.cxx |   25 
 sfx2/source/view/viewfrm.cxx |   40 +--
 svtools/inc/errtxt.hrc   |3 --
 5 files changed, 27 insertions(+), 46 deletions(-)

New commits:
commit f41627ab60372345be646c53d967b65be43b562f
Author: Samuel Mehrbrodt 
AuthorDate: Fri Jan 27 10:34:29 2023 +0100
Commit: Samuel Mehrbrodt 
CommitDate: Mon Jan 30 08:15:09 2023 +

Show infobar instead of blocking dialog when macros are not allowed

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

diff --git a/include/sfx2/strings.hrc b/include/sfx2/strings.hrc
index 46131484099b..e4133eb69203 100644
--- a/include/sfx2/strings.hrc
+++ b/include/sfx2/strings.hrc
@@ -293,6 +293,7 @@
 #define STR_REFRESH_MASTER_PASSWORD 
NC_("STR_REFRESH_MASTER_PASSWORD", "The master password is stored in an 
outdated format, you should refresh it")
 #define STR_REFRESH_PASSWORDNC_("STR_REFRESH_PASSWORD", 
"Refresh Password")
 #define STR_CONTAINS_MACROS NC_("STR_CONTAINS_MACROS", 
"Macros in this document are disabled due to the Macro Security settings.")
+#define STR_MACROS_DISABLED NC_("STR_MACROS_DISABLED", 
"Macros are disabled due to the Macro Security settings.")
 #define STR_MACROS  NC_("STR_MACROS", "Show 
Macros")
 #define STR_EVENTS  NC_("STR_EVENTS", "Show 
Events")
 
diff --git a/include/svtools/sfxecode.hxx b/include/svtools/sfxecode.hxx
index fe6f26dc3623..4464d4230a35 100644
--- a/include/svtools/sfxecode.hxx
+++ b/include/svtools/sfxecode.hxx
@@ -34,13 +34,9 @@ class ErrCode;
 #define ERRCODE_SFX_CANTGETPASSWD   ErrCode(ErrCodeArea::Sfx, 
ErrCodeClass::Read, 42)
 #define ERRCODE_SFX_NOMOREDOCUMENTSALLOWED  ErrCode(WarningFlag::Yes, 
ErrCodeArea::Sfx, ErrCodeClass::NONE, 44)
 #define ERRCODE_SFX_CANTCREATEBACKUPErrCode(ErrCodeArea::Sfx, 
ErrCodeClass::Create, 50)
-#define ERRCODE_SFX_MACROS_SUPPORT_DISABLED ErrCode(WarningFlag::Yes, 
ErrCodeArea::Sfx, ErrCodeClass::NONE, 51)
-#define ERRCODE_SFX_DOCUMENT_MACRO_DISABLED ErrCode(WarningFlag::Yes, 
ErrCodeArea::Sfx, ErrCodeClass::NONE, 52)
 #define ERRCODE_SFX_DOCUMENT_MACRO_DISABLED_CONTENT_UNSIGNED 
ErrCode(WarningFlag::Yes, ErrCodeArea::Sfx, ErrCodeClass::NONE, 53)
 #define ERRCODE_SFX_SHARED_NOPASSWORDCHANGE ErrCode(WarningFlag::Yes, 
ErrCodeArea::Sfx, ErrCodeClass::NONE, 54)
 #define ERRCODE_SFX_INCOMPLETE_ENCRYPTION   ErrCode(WarningFlag::Yes, 
ErrCodeArea::Sfx, ErrCodeClass::NONE, 55)
-#define ERRCODE_SFX_DOCUMENT_MACRO_DISABLED_MAC \
-ErrCode(WarningFlag::Yes, 
ErrCodeArea::Sfx, ErrCodeClass::NONE, 56)
 #define ERRCODE_SFX_FORMAT_ROWCOL   ErrCode(ErrCodeArea::Sfx, 
ErrCodeClass::NONE, 57)
 
 
diff --git a/sfx2/source/doc/docmacromode.cxx b/sfx2/source/doc/docmacromode.cxx
index ae70c6a8c056..bf17a0497a5d 100644
--- a/sfx2/source/doc/docmacromode.cxx
+++ b/sfx2/source/doc/docmacromode.cxx
@@ -101,22 +101,6 @@ namespace sfx2
 rbAlreadyShown = true;
 }
 
-
-void lcl_showMacrosDisabledError( const Reference< XInteractionHandler 
>& rxHandler, bool& rbAlreadyShown )
-{
-lcl_showGeneralSfxErrorOnce( rxHandler, 
ERRCODE_SFX_MACROS_SUPPORT_DISABLED, rbAlreadyShown );
-}
-
-
-void lcl_showDocumentMacrosDisabledError( const Reference< 
XInteractionHandler >& rxHandler, bool& rbAlreadyShown )
-{
-#ifdef MACOSX
-lcl_showGeneralSfxErrorOnce( rxHandler, 
ERRCODE_SFX_DOCUMENT_MACRO_DISABLED_MAC, rbAlreadyShown );
-#else
-lcl_showGeneralSfxErrorOnce( rxHandler, 
ERRCODE_SFX_DOCUMENT_MACRO_DISABLED, rbAlreadyShown );
-#endif
-}
-
 void lcl_showMacrosDisabledUnsignedContentError( const Reference< 
XInteractionHandler >& rxHandler, bool& rbAlreadyShown )
 {
 lcl_showGeneralSfxErrorOnce( rxHandler, 
ERRCODE_SFX_DOCUMENT_MACRO_DISABLED_CONTENT_UNSIGNED, rbAlreadyShown );
@@ -156,7 +140,6 @@ namespace sfx2
 if ( SvtSecurityOptions::IsMacroDisabled() )
 {
 // no macro should be executed at all
-lcl_showMacrosDisabledError( rxInteraction, 
m_xData->m_bMacroDisabledMessageShown );
 return disallowMacroExecution();
 }
 
@@ -226,7 +209,6 @@ namespace sfx2
 // at this point it is clear that the document is not in the 
secure location
 if ( nMacroExecutionMode == MacroExecMode::FROM_LIST_NO_WARN )
 {
-lcl_showDocumentMacrosDisabledError( rxInteraction, 
m_xData->m_bDocMacroDisabledMessageShown );
 return disallowMacroExecution();
 }
 

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

2023-01-30 Thread Samuel Mehrbrodt (via logerrit)
 include/sfx2/strings.hrc |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 43737fd5ddfad4c5e52f5244aef7a468d7aa8d15
Author: Samuel Mehrbrodt 
AuthorDate: Fri Jan 27 09:32:44 2023 +0100
Commit: Samuel Mehrbrodt 
CommitDate: Mon Jan 30 08:14:35 2023 +

Macro Infobar: Make it clear that macros are disabled and why

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

diff --git a/include/sfx2/strings.hrc b/include/sfx2/strings.hrc
index b7e2c1bd1d65..46131484099b 100644
--- a/include/sfx2/strings.hrc
+++ b/include/sfx2/strings.hrc
@@ -292,9 +292,9 @@
 #define STR_HYPHENATION_BUTTON  NC_("STR_HYPHENATION_BUTTON", 
"Learn more")
 #define STR_REFRESH_MASTER_PASSWORD 
NC_("STR_REFRESH_MASTER_PASSWORD", "The master password is stored in an 
outdated format, you should refresh it")
 #define STR_REFRESH_PASSWORDNC_("STR_REFRESH_PASSWORD", 
"Refresh Password")
-#define STR_CONTAINS_MACROS NC_("STR_CONTAINS_MACROS", 
"The document contains macros.")
-#define STR_MACROS  NC_("STR_MACROS", "Macros")
-#define STR_EVENTS  NC_("STR_EVENTS", "Events")
+#define STR_CONTAINS_MACROS NC_("STR_CONTAINS_MACROS", 
"Macros in this document are disabled due to the Macro Security settings.")
+#define STR_MACROS  NC_("STR_MACROS", "Show 
Macros")
+#define STR_EVENTS  NC_("STR_EVENTS", "Show 
Events")
 
 // Translators: default Impress template names
 #define STR_TEMPLATE_NAME1  NC_("STR_TEMPLATE_NAME1", 
"Grey Elegant")


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

2023-01-26 Thread Caolán McNamara (via logerrit)
 include/sfx2/printopt.hxx|1 -
 include/svtools/restartdialog.hxx|3 ---
 sfx2/source/dialog/printopt.cxx  |   23 +--
 sfx2/uiconfig/ui/optprintpage.ui |   20 +++-
 svtools/source/dialogs/restartdialog.cxx |3 ---
 svtools/uiconfig/ui/restartdialog.ui |   17 +
 6 files changed, 5 insertions(+), 62 deletions(-)

New commits:
commit 2a40505d00fcd79bfa433c301ddc05a35287bfb1
Author: Caolán McNamara 
AuthorDate: Thu Jan 26 11:49:43 2023 +
Commit: Caolán McNamara 
CommitDate: Thu Jan 26 15:09:20 2023 +

remove option to toggle IsPDFAsStandardPrintJobFormat from UI

to deprecate it. Still possible to toggle from expert config for now,
but we should push on and remove this and all the postscript printing at
this point.

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

diff --git a/include/sfx2/printopt.hxx b/include/sfx2/printopt.hxx
index ef7fd4683a7d..2cc4b0a1ded6 100644
--- a/include/sfx2/printopt.hxx
+++ b/include/sfx2/printopt.hxx
@@ -46,7 +46,6 @@ private:
 std::unique_ptr m_xReduceBitmapsResolutionLB;
 std::unique_ptr m_xReduceBitmapsTransparencyCB;
 std::unique_ptr m_xConvertToGreyscalesCB;
-std::unique_ptr m_xPDFCB;
 std::unique_ptr m_xPaperSizeCB;
 std::unique_ptr m_xPaperOrientationCB;
 std::unique_ptr m_xTransparencyCB;
diff --git a/include/svtools/restartdialog.hxx 
b/include/svtools/restartdialog.hxx
index 001f322772a5..89178ad26e36 100644
--- a/include/svtools/restartdialog.hxx
+++ b/include/svtools/restartdialog.hxx
@@ -26,9 +26,6 @@ enum RestartReason {
 // "For the selected Java runtime environment to work properly,
 // %PRODUCTNAME must be restarted.":
 RESTART_REASON_JAVA,
-// For the modified default print job format to take effect,
-// %PRODUCTNAME must be restarted:
-RESTART_REASON_PDF_AS_STANDARD_JOB_FORMAT,
 // "For the bibliography to work properly,
 // %PRODUCTNAME must be restarted.":
 RESTART_REASON_BIBLIOGRAPHY_INSTALL,
diff --git a/sfx2/source/dialog/printopt.cxx b/sfx2/source/dialog/printopt.cxx
index 8d16edfc0e3e..d804bdf8f202 100644
--- a/sfx2/source/dialog/printopt.cxx
+++ b/sfx2/source/dialog/printopt.cxx
@@ -50,24 +50,14 @@ 
SfxCommonPrintOptionsTabPage::SfxCommonPrintOptionsTabPage(weld::Container* pPag
 , 
m_xReduceBitmapsResolutionLB(m_xBuilder->weld_combo_box("reducebitmapdpi"))
 , 
m_xReduceBitmapsTransparencyCB(m_xBuilder->weld_check_button("reducebitmaptrans"))
 , m_xConvertToGreyscalesCB(m_xBuilder->weld_check_button("converttogray"))
-, m_xPDFCB(m_xBuilder->weld_check_button("pdf"))
 , m_xPaperSizeCB(m_xBuilder->weld_check_button("papersize"))
 , m_xPaperOrientationCB(m_xBuilder->weld_check_button("paperorient"))
 , m_xTransparencyCB(m_xBuilder->weld_check_button("trans"))
 {
-#ifndef ENABLE_CUPS
-m_xPDFCB->hide();
-#endif
-
-if( bOutputForPrinter )
-{
+if (bOutputForPrinter)
 m_xPrinterOutputRB->set_active(true);
-}
 else
-{
 m_xPrintFileOutputRB->set_active(true);
-m_xPDFCB->set_sensitive(false);
-}
 
 m_xPrinterOutputRB->connect_toggled( LINK( this, 
SfxCommonPrintOptionsTabPage, ToggleOutputPrinterRBHdl ) );
 m_xPrintFileOutputRB->connect_toggled( LINK( this, 
SfxCommonPrintOptionsTabPage, ToggleOutputPrintFileRBHdl ) );
@@ -182,7 +172,6 @@ void SfxCommonPrintOptionsTabPage::ImplUpdateControls( 
const vcl::printer::Optio
 
 m_xReduceBitmapsTransparencyCB->set_active( 
pCurrentOptions->IsReducedBitmapIncludesTransparency() );
 m_xConvertToGreyscalesCB->set_active( 
pCurrentOptions->IsConvertToGreyscales() );
-m_xPDFCB->set_active( pCurrentOptions->IsPDFAsStandardPrintJobFormat() );
 
 ClickReduceTransparencyCBHdl(*m_xReduceTransparencyCB);
 ClickReduceGradientsCBHdl(*m_xReduceGradientsCB);
@@ -203,14 +192,6 @@ void SfxCommonPrintOptionsTabPage::ImplSaveControls( 
vcl::printer::Options* pCur

SAL_N_ELEMENTS(aDPIArray) - 1 ) ] );
 pCurrentOptions->SetReducedBitmapIncludesTransparency( 
m_xReduceBitmapsTransparencyCB->get_active() );
 pCurrentOptions->SetConvertToGreyscales( 
m_xConvertToGreyscalesCB->get_active() );
-bool bOrigBackEnd = pCurrentOptions->IsPDFAsStandardPrintJobFormat();
-if (bOrigBackEnd != m_xPDFCB->get_active())
-{
-pCurrentOptions->SetPDFAsStandardPrintJobFormat( 
m_xPDFCB->get_active() );
-svtools::executeRestartDialog(
-comphelper::getProcessComponentContext(), nullptr,
-svtools::RESTART_REASON_PDF_AS_STANDARD_JOB_FORMAT);
-}
 }
 
 IMPL_LINK_NOARG( SfxCommonPrintOptionsTabPage, ClickReduceTransparencyCBHdl, 
weld::Toggleable&, void )
@@ -278,12 +259,10 @@ IMPL_LINK( 

[Libreoffice-commits] core.git: include/sfx2 include/svx officecfg/registry svx/Library_svx.mk svx/sdi svx/source svx/uiconfig svx/UIConfig_svx.mk sw/sdi sw/source sw/uiconfig

2023-01-14 Thread Tomaž Vajngerl (via logerrit)
 include/sfx2/sfxsids.hrc |1 
 include/svx/dialog/ThemeDialog.hxx   |   42 ++
 include/svx/theme/IThemeColorChanger.hxx |   26 +
 officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu |8 
 svx/Library_svx.mk   |1 
 svx/UIConfig_svx.mk  |1 
 svx/sdi/svx.sdi  |   17 +
 svx/source/dialog/ThemeDialog.cxx|   63 

 svx/uiconfig/ui/themedialog.ui   |  145 
++
 sw/sdi/_basesh.sdi   |7 
 sw/source/core/inc/ThemeColorChanger.hxx |7 
 sw/source/core/model/ThemeColorChanger.cxx   |2 
 sw/source/uibase/shells/basesh.cxx   |   26 +
 sw/uiconfig/sglobal/menubar/menubar.xml  |1 
 sw/uiconfig/swriter/menubar/menubar.xml  |1 
 15 files changed, 346 insertions(+), 2 deletions(-)

New commits:
commit d4e4a2b96a787b4f99d68d7a417c37c97b47c170
Author: Tomaž Vajngerl 
AuthorDate: Tue Jan 10 20:21:31 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sat Jan 14 12:26:15 2023 +

ThemeDialog added which allows to change the theme used by the doc.

ThemeDialog is a common dialog that can be used to select the
theme used by the document. Currently it only implements colors
but in the future also the fonts and formats (for shapes) will
be adde.

The IThemeColorChanger interface is used by the dialog to change
the actual color values inside the document. For the writer the
existing ThemeColorChanger is now implementing the interface.

The dialog is accessible in Writer at Format -> Theme... in the
main menu.

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

diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc
index e911e1d0d65d..4fb5892ba84b 100644
--- a/include/sfx2/sfxsids.hrc
+++ b/include/sfx2/sfxsids.hrc
@@ -469,6 +469,7 @@ class SvxZoomItem;
 #define SID_ACCESSIBILITY_CHECK (SID_SFX_START + 812)
 #define SID_ASYNCHRON   (SID_SFX_START + 813)
 #define SID_ACCESSIBILITY_CHECK_ONLINE  (SID_SFX_START + 814)
+#define SID_THEME_DIALOG(SID_SFX_START + 815)
 
 // default-ids for configuration
 #define SID_CONFIG  (SID_SFX_START + 904)
diff --git a/include/svx/dialog/ThemeDialog.hxx 
b/include/svx/dialog/ThemeDialog.hxx
new file mode 100644
index ..968c54af9e98
--- /dev/null
+++ b/include/svx/dialog/ThemeDialog.hxx
@@ -0,0 +1,42 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#pragma once
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+namespace svx
+{
+class SVX_DLLPUBLIC ThemeDialog final : public weld::GenericDialogController
+{
+private:
+svx::Theme* mpTheme;
+svx::ColorSets maColorSets;
+std::shared_ptr mpChanger;
+
+std::unique_ptr mxValueSetThemeColors;
+std::unique_ptr mxValueSetThemeColorsWindow;
+
+public:
+ThemeDialog(weld::Window* pParent, svx::Theme* pTheme,
+std::shared_ptr const& pChanger);
+virtual ~ThemeDialog() override;
+
+DECL_LINK(DoubleClickValueSetHdl, ValueSet*, void);
+void DoubleClickHdl();
+};
+
+} // end svx namespace
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/theme/IThemeColorChanger.hxx 
b/include/svx/theme/IThemeColorChanger.hxx
new file mode 100644
index ..5f90f273ee37
--- /dev/null
+++ b/include/svx/theme/IThemeColorChanger.hxx
@@ -0,0 +1,26 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#pragma once
+
+#include 
+#include 
+
+namespace svx
+{
+class SVX_DLLPUBLIC IThemeColorChanger
+{
+public:
+virtual ~IThemeColorChanger() = default;
+virtual void apply(svx::ColorSet const& rColorSet) = 0;
+};
+
+} // end svx namespace
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git 

[Libreoffice-commits] core.git: include/sfx2 sc/source sd/qa sd/source svx/sdi sw/sdi sw/source

2023-01-04 Thread Caolán McNamara (via logerrit)
 include/sfx2/sfxsids.hrc |2 -
 sc/source/ui/drawfunc/drawsh.cxx |   39 +
 sc/source/ui/view/editsh.cxx |   16 ---
 sc/source/ui/view/formatsh.cxx   |   47 ++-
 sd/qa/unit/uiimpress.cxx |7 ++---
 sd/source/ui/view/drtxtob1.cxx   |   38 
 sd/source/ui/view/drviews2.cxx   |   27 
 sd/source/ui/view/drviews7.cxx   |   25 ++
 svx/sdi/svx.sdi  |   16 +--
 sw/sdi/swriter.sdi   |4 +-
 sw/source/uibase/shells/basesh.cxx   |   22 
 sw/source/uibase/shells/drawdlg.cxx  |   35 ++
 sw/source/uibase/shells/drwtxtex.cxx |   38 
 sw/source/uibase/shells/textsh1.cxx  |   18 -
 14 files changed, 30 insertions(+), 304 deletions(-)

New commits:
commit bd5cc6a50f2acdabc1c93bd49ce52c79a70c2144
Author: Caolán McNamara 
AuthorDate: Mon Jan 2 19:16:54 2023 +
Commit: Caolán McNamara 
CommitDate: Wed Jan 4 14:05:46 2023 +

Related: tdf#150339 remove SID_ATTR_COLOR_STR

re: https://gerrit.libreoffice.org/c/core/+/144866
"ColorString is not needed anymore (we used that in LOK previously)."

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

diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc
index a0289c0881ab..e911e1d0d65d 100644
--- a/include/sfx2/sfxsids.hrc
+++ b/include/sfx2/sfxsids.hrc
@@ -598,7 +598,7 @@ class SvxZoomItem;
 #define SID_ATTR_CHAR_COLOR_BACKGROUND  (SID_SVX_START + 489)
 #define SID_ATTR_CHAR_COLOR_BACKGROUND_EXT  (SID_SVX_START + 490)
 #define SID_ATTR_CHAR_COLOR2(SID_SVX_START + 537)
-#define SID_ATTR_COLOR_STR  
TypedWhichId(SID_SVX_START + 540)
+
 #define SID_COMP_BIBLIOGRAPHY   (SID_SVX_START + 880)
 #define SID_ADDRESS_DATA_SOURCE (SID_SVX_START + 934)
 #define SID_OPEN_SMARTTAGOPTIONS
TypedWhichId(SID_SVX_START + 1062)
diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx
index 53273c77c7cc..568218da662b 100644
--- a/sc/source/ui/drawfunc/drawsh.cxx
+++ b/sc/source/ui/drawfunc/drawsh.cxx
@@ -68,10 +68,8 @@ SFX_IMPL_INTERFACE(ScDrawShell, SfxShell)
 
 namespace
 {
-void lcl_convertStringArguments(sal_uInt16 nSlot, SfxItemSet& rArgs)
+void lcl_convertStringArguments(SfxItemSet& rArgs)
 {
-Color aColor;
-
 if (const SvxDoubleItem* pWidthItem = 
rArgs.GetItemIfSet(SID_ATTR_LINE_WIDTH_ARG, false))
 {
 double fValue = pWidthItem->GetValue();
@@ -82,39 +80,6 @@ namespace
 XLineWidthItem aItem(nValue);
 rArgs.Put(aItem);
 }
-else if (const SfxStringItem* pColorItem = 
rArgs.GetItemIfSet(SID_ATTR_COLOR_STR, false))
-{
-OUString sColor = pColorItem->GetValue();
-
-if (sColor == "transparent")
-aColor = COL_TRANSPARENT;
-else
-aColor = Color(ColorTransparency, sColor.toInt32(16));
-
-switch (nSlot)
-{
-case SID_ATTR_LINE_COLOR:
-{
-XLineColorItem aLineColorItem(OUString(), aColor);
-rArgs.Put(aLineColorItem);
-break;
-}
-
-case SID_ATTR_FILL_COLOR:
-{
-XFillColorItem aFillColorItem(OUString(), aColor);
-rArgs.Put(aFillColorItem);
-break;
-}
-
-case SID_ATTR_SHADOW_COLOR:
-{
-XColorItem aItem(SDRATTR_SHADOWCOLOR, aColor);
-rArgs.Put(aItem);
-break;
-}
-}
-}
 if (const SfxStringItem* pJSON = 
rArgs.GetItemIfSet(SID_FILL_GRADIENT_JSON, false))
 {
 XGradient aGradient = XGradient::fromJSON(pJSON->GetValue());
@@ -290,7 +255,7 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
 if( pView->AreObjectsMarked() )
 {
 SfxItemSet aNewArgs = rReq.GetArgs()->CloneAsValue();
-lcl_convertStringArguments( rReq.GetSlot(), aNewArgs );
+lcl_convertStringArguments(aNewArgs);
 pView->SetAttrToMarked( aNewArgs, false );
 }
 else
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index 2b36efa11ec8..52566f45d7b8 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -968,21 +968,7 @@ void ScEditShell::ExecuteAttr(SfxRequest& rReq)
 {
 if (pArgs)
 {
-

[Libreoffice-commits] core.git: include/sfx2 sfx2/source svx/sdi sw/source

2022-12-06 Thread Henry Castro (via logerrit)
 include/sfx2/sfxsids.hrc|1 +
 sfx2/source/doc/objserv.cxx |2 +-
 svx/sdi/svx.sdi |2 +-
 sw/source/uibase/app/docsh2.cxx |6 --
 4 files changed, 7 insertions(+), 4 deletions(-)

New commits:
commit 7a6445eedde28675c575f74c09ff236963525d20
Author: Henry Castro 
AuthorDate: Fri Nov 4 07:52:09 2022 -0400
Commit: Henry Castro 
CommitDate: Tue Dec 6 18:13:06 2022 +

sfx2: rename FN_PARAM_1 to FN_NOUPDATE

The parameter is intended to not update the fields
from data source otherwise it will reset to the first
record.

Signed-off-by: Henry Castro 
Change-Id: I204cd20b8eb0b3f26c204e139c72b479c83bbf0c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142276
Tested-by: Jenkins

diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc
index 4e9badc4346f..a0289c0881ab 100644
--- a/include/sfx2/sfxsids.hrc
+++ b/include/sfx2/sfxsids.hrc
@@ -673,6 +673,7 @@ class SvxZoomItem;
 #define FN_PARAM_4  (FN_PARAM+63)
 #define FN_PARAM_5  (FN_PARAM+64)
 #define FN_PARAM_6  (FN_PARAM+65)
+#define FN_NOUPDATE (FN_PARAM+66)
 #define FN_FAX  (SID_SW_START + 28)   /* Fax */
 
 #define SID_KEYFUNC_START   (SID_SC_START + 521)
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index bb2a01b77620..f0bc6172ab1d 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -1032,7 +1032,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest )
 if (bMailPrepareExport)
 {
 SfxRequest aRequest(SID_MAIL_PREPAREEXPORT, 
SfxCallMode::SYNCHRON, GetPool());
-aRequest.AppendItem(SfxBoolItem(FN_PARAM_1, true));
+aRequest.AppendItem(SfxBoolItem(FN_NOUPDATE, true));
 ExecuteSlot(aRequest);
 }
 
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index d4e4f62450b6..bc1d9e5c429f 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -11770,7 +11770,7 @@ SfxVoidItem InsertRowsAfter SID_TABLE_INSERT_ROW_AFTER
 ]
 
 SfxBoolItem PrepareMailExport SID_MAIL_PREPAREEXPORT
-(SfxBoolItem On FN_PARAM_1)
+(SfxBoolItem On FN_NOUPDATE)
 [
 AutoUpdate = FALSE,
 FastCall = FALSE,
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx
index 99eaf2249423..ef3c607444e5 100644
--- a/sw/source/uibase/app/docsh2.cxx
+++ b/sw/source/uibase/app/docsh2.cxx
@@ -881,13 +881,15 @@ void SwDocShell::Execute(SfxRequest& rReq)
 
 case SID_MAIL_PREPAREEXPORT:
 {
-const SfxPoolItem* pNoUpdate;
+const SfxBoolItem* pNoUpdate = pArgs ?
+pArgs->GetItem(FN_NOUPDATE, false) :
+nullptr;
 
 //pWrtShell is not set in page preview
 if (m_pWrtShell)
 m_pWrtShell->StartAllAction();
 
-if (!pArgs || (pArgs && !pArgs->HasItem(FN_PARAM_1, )))
+if (!pNoUpdate || !pNoUpdate->GetValue())
 {
 m_xDoc->getIDocumentFieldsAccess().UpdateFields( false );
 m_xDoc->getIDocumentLinksAdministration().EmbedAllLinks();


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

2022-12-01 Thread Xisco Fauli (via logerrit)
 include/sfx2/docfile.hxx|2 ++
 sc/qa/unit/filters-test.cxx |   25 -
 sc/qa/unit/subsequent_filters_test2.cxx |   24 
 sfx2/source/doc/docfile.cxx |   12 
 sfx2/source/doc/sfxbasemodel.cxx|2 ++
 5 files changed, 40 insertions(+), 25 deletions(-)

New commits:
commit 29dad1e4545c877bcf8e9bb23359d4eb39251938
Author: Xisco Fauli 
AuthorDate: Wed Nov 30 17:46:35 2022 +0100
Commit: Xisco Fauli 
CommitDate: Thu Dec 1 12:39:53 2022 +0100

sc: move test back where it belongs

This test was moved from sc/qa/unit/subsequent_filters_test2.cxx
to sc/qa/unit/filters-test.cxx in ad40ad91c5400391a0848832e91c596be8fbd811
"CppunitTest_sc_subsequent_filters_test2: inherit from UnoApiXmlTest".
As the commit message says:

I couldn't find a way to test testTooManyColsRows,
move it to sc/qa/unit/filters-test.cxx for the
time being

The problem is that using loadFromDestkop resets the Error in
sfx2/source/doc/sfxbasemodel.cxx:2005 - 
m_pData->m_pObjectShell->ResetError();
so add a way to log the WarningError in SfxMedium

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

diff --git a/include/sfx2/docfile.hxx b/include/sfx2/docfile.hxx
index ff3ea024e19b..15ec85a5f928 100644
--- a/include/sfx2/docfile.hxx
+++ b/include/sfx2/docfile.hxx
@@ -146,9 +146,11 @@ public:
 ErrCode GetErrorCode() const;
 ErrCode GetError() const
 { return GetErrorCode().IgnoreWarning(); }
+ErrCode GetWarningError() const;
 ErrCode const & GetLastStorageCreationState() const;
 
 voidSetError(ErrCode nError);
+voidSetWarningError(ErrCode nWarningError);
 
 voidCloseInStream();
 voidCloseOutStream();
diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx
index c165869a1afb..63ae46860c4d 100644
--- a/sc/qa/unit/filters-test.cxx
+++ b/sc/qa/unit/filters-test.cxx
@@ -53,13 +53,11 @@ public:
 void testCVEs();
 
 void testContentofz9704();
-void testTooManyColsRows();
 void testTdf90299();
 
 CPPUNIT_TEST_SUITE(ScFiltersTest);
 CPPUNIT_TEST(testCVEs);
 CPPUNIT_TEST(testContentofz9704);
-CPPUNIT_TEST(testTooManyColsRows);
 CPPUNIT_TEST(testTdf90299);
 
 CPPUNIT_TEST_SUITE_END();
@@ -133,29 +131,6 @@ void ScFiltersTest::testContentofz9704()
 TestImportWKS(aFileStream);
 }
 
-void ScFiltersTest::testTooManyColsRows()
-{
-// The intentionally doc has cells beyond our MAXROW/MAXCOL, so there
-// should be a warning on load.
-OUString aFileName;
-createFileURL(u"too-many-cols-rows.", u"ods", aFileName );
-ScDocShellRef xDocSh = loadDoc(aFileName, "calc8", OUString(), OUString(),
-ODS_FORMAT_TYPE, SotClipboardFormatId::STARCALC_8);
-
-CPPUNIT_ASSERT(xDocSh->GetErrorCode() == SCWARN_IMPORT_ROW_OVERFLOW
-   || xDocSh->GetErrorCode() == SCWARN_IMPORT_COLUMN_OVERFLOW);
-xDocSh->DoClose();
-
-createFileURL(u"too-many-cols-rows.", u"xlsx", aFileName );
-xDocSh = loadDoc(
-aFileName, "Calc Office Open XML", OUString(), OUString(),
-XLSX_FORMAT_TYPE, SotClipboardFormatId::STARCALC_8);
-
-CPPUNIT_ASSERT(xDocSh->GetErrorCode() == SCWARN_IMPORT_ROW_OVERFLOW
-   || xDocSh->GetErrorCode() == SCWARN_IMPORT_COLUMN_OVERFLOW);
-xDocSh->DoClose();
-}
-
 void ScFiltersTest::testTdf90299()
 {
 const OUString aTmpDirectory1URL = utl::CreateTempURL(nullptr, true);
diff --git a/sc/qa/unit/subsequent_filters_test2.cxx 
b/sc/qa/unit/subsequent_filters_test2.cxx
index fbaef3eb464f..e917d56ba836 100644
--- a/sc/qa/unit/subsequent_filters_test2.cxx
+++ b/sc/qa/unit/subsequent_filters_test2.cxx
@@ -14,6 +14,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -187,6 +188,7 @@ public:
 void testTdf139763ShapeAnchor();
 void testAutofilterNamedRangesXLSX();
 void testInvalidBareBiff5();
+void testTooManyColsRows();
 void testTdf83671_SmartArt_import();
 void testTdf83671_SmartArt_import2();
 void testTdf151818_SmartArtFontColor();
@@ -306,6 +308,7 @@ public:
 CPPUNIT_TEST(testTdf139763ShapeAnchor);
 CPPUNIT_TEST(testAutofilterNamedRangesXLSX);
 CPPUNIT_TEST(testInvalidBareBiff5);
+CPPUNIT_TEST(testTooManyColsRows);
 CPPUNIT_TEST(testTdf83671_SmartArt_import);
 CPPUNIT_TEST(testTdf83671_SmartArt_import2);
 CPPUNIT_TEST(testTdf151818_SmartArtFontColor);
@@ -2873,6 +2876,27 @@ void ScFiltersTest2::testInvalidBareBiff5()
 CPPUNIT_ASSERT_EQUAL(OUString(), pDoc->GetString(aPos));
 }
 
+void ScFiltersTest2::testTooManyColsRows()
+{
+// The intentionally doc has cells beyond our 

[Libreoffice-commits] core.git: include/sfx2 sc/inc sc/source sd/source starmath/inc svtools/inc

2022-11-24 Thread Noel Grandin (via logerrit)
 include/sfx2/lnkbase.hxx |7 --
 include/sfx2/objsh.hxx   |2 
 sc/inc/autoform.hxx  |3 
 sc/inc/chgtrack.hxx  |2 
 sc/source/filter/inc/xihelper.hxx|2 
 sc/source/ui/inc/tpsubt.hxx  |   29 -
 sd/source/filter/eppt/grouptable.hxx |2 
 sd/source/ui/inc/DrawDocShell.hxx|8 --
 sd/source/ui/inc/DrawViewShell.hxx   |  112 +++
 sd/source/ui/inc/ViewClipboard.hxx   |4 -
 sd/source/ui/inc/unopage.hxx |3 
 sd/source/ui/inc/unosrch.hxx |2 
 starmath/inc/node.hxx|2 
 svtools/inc/framestatuslistener.hxx  |2 
 14 files changed, 81 insertions(+), 99 deletions(-)

New commits:
commit 3de6d4d3c7b733fde0feef3d77aeb7c4c48724d0
Author: Noel Grandin 
AuthorDate: Thu Nov 24 12:58:51 2022 +0200
Commit: Noel Grandin 
CommitDate: Thu Nov 24 13:51:10 2022 +0100

loplugin:unusedfields make some fields private

this is one of the secondary analyses this plugin performs

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

diff --git a/include/sfx2/lnkbase.hxx b/include/sfx2/lnkbase.hxx
index cf108319758f..00f48067bbbe 100644
--- a/include/sfx2/lnkbase.hxx
+++ b/include/sfx2/lnkbase.hxx
@@ -88,6 +88,9 @@ private:
 boolbSynchron : 1;
 boolbWasLastEditOK : 1;
 boolm_bIsConnect : 1;
+boolm_bIsReadOnly;
+css::uno::Reference
+m_xInputStreamToLoadFrom;
 
 DECL_DLLPRIVATE_LINK( EndEditHdl, const OUString&, void );
 
@@ -99,10 +102,6 @@ protected:
 // Set LinkSourceName without action
 voidSetName( const OUString & rLn );
 
-boolm_bIsReadOnly;
-css::uno::Reference
-m_xInputStreamToLoadFrom;
-
 SvBaseLink();
 SvBaseLink( SfxLinkUpdateMode nLinkType, 
SotClipboardFormatId nContentType );
 virtual ~SvBaseLink() override;
diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index f27948d81b64..ef1a0a33e1dc 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -798,8 +798,10 @@ public:
 
 struct ModifyBlocker_Impl
 {
+private:
 SfxObjectShell* pPersist;
 bool bWasEnabled;
+public:
 ModifyBlocker_Impl( SfxObjectShell* pPersistP ) : pPersist( pPersistP )
 {
 bWasEnabled = pPersistP->IsEnableSetModified();
diff --git a/sc/inc/autoform.hxx b/sc/inc/autoform.hxx
index ee57b435f090..b6facd437e12 100644
--- a/sc/inc/autoform.hxx
+++ b/sc/inc/autoform.hxx
@@ -72,9 +72,10 @@ struct AutoFormatSwBlob
 /// Struct with version numbers of the Items
 struct ScAfVersions : public AutoFormatVersions
 {
-public:
+private:
 AutoFormatSwBlob swVersions;
 
+public:
 ScAfVersions();
 
 void Load( SvStream& rStream, sal_uInt16 nVer );
diff --git a/sc/inc/chgtrack.hxx b/sc/inc/chgtrack.hxx
index dde6beb837f6..24e4f653b165 100644
--- a/sc/inc/chgtrack.hxx
+++ b/sc/inc/chgtrack.hxx
@@ -104,8 +104,6 @@ class ScChangeActionLinkEntry
 ScChangeActionLinkEntry( const ScChangeActionLinkEntry& ) = delete;
 ScChangeActionLinkEntry& operator=( const ScChangeActionLinkEntry& ) = 
delete;
 
-protected:
-
 ScChangeActionLinkEntry*pNext;
 ScChangeActionLinkEntry**   ppPrev;
 ScChangeAction* pAction;
diff --git a/sc/source/filter/inc/xihelper.hxx 
b/sc/source/filter/inc/xihelper.hxx
index d887df2cd4da..746259e844e4 100644
--- a/sc/source/filter/inc/xihelper.hxx
+++ b/sc/source/filter/inc/xihelper.hxx
@@ -319,7 +319,7 @@ public:
 /** Returns the cached Calc error code, if this value has Error type, else 
0. */
 FormulaErrorGetScError() const;
 
-protected:
+private:
 typedef ::std::unique_ptr< const ScTokenArray >   ScTokenArrayPtr;
 
 OUStringmaStr;  /// Cached value is a string.
diff --git a/sc/source/ui/inc/tpsubt.hxx b/sc/source/ui/inc/tpsubt.hxx
index a6dfc3cb5a02..ecfa2ec18522 100644
--- a/sc/source/ui/inc/tpsubt.hxx
+++ b/sc/source/ui/inc/tpsubt.hxx
@@ -39,7 +39,20 @@ public:
   const SfxItemSet& rArgSet  );
 boolDoFillItemSet   ( sal_uInt16nGroupNo,
   SfxItemSet&   rArgSet  );
-protected:
+private:
+voidInit();
+voidFillListBoxes   ();
+static ScSubTotalFunc  LbPosToFunc ( sal_uInt16 nPos );
+static sal_uInt16  FuncToLbPos ( ScSubTotalFunc eFunc );
+sal_uInt16  GetFieldSelPos  ( SCCOL nField );
+
+// Handler 
+DECL_LINK( SelectListBoxHdl, weld::ComboBox&, void );
+DECL_LINK( SelectTreeListBoxHdl, weld::TreeView&, void );
+

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

2022-11-22 Thread Mike Kaganski (via logerrit)
 include/sfx2/lokcomponenthelpers.hxx   |6 +++
 sd/source/ui/unoidl/unomodel.cxx   |2 +
 sfx2/source/view/lokstarmathhelper.cxx |   59 +
 3 files changed, 67 insertions(+)

New commits:
commit d19816350dba8daffa2deb495d4e697062579456
Author: Mike Kaganski 
AuthorDate: Tue Nov 22 17:40:26 2022 +0300
Commit: Mike Kaganski 
CommitDate: Tue Nov 22 21:45:36 2022 +0100

lok: draw Math in-place widget in sd

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

diff --git a/include/sfx2/lokcomponenthelpers.hxx 
b/include/sfx2/lokcomponenthelpers.hxx
index 61a3812a9d2f..c76067bc1330 100644
--- a/include/sfx2/lokcomponenthelpers.hxx
+++ b/include/sfx2/lokcomponenthelpers.hxx
@@ -80,7 +80,13 @@ public:
 bool postMouseEvent(int nType, int nX, int nY, int nCount, int nButtons, 
int nModifier,
 double fPPTScaleX, double fPPTScaleY);
 
+static void PaintAllInPlaceOnTile(VirtualDevice& rDevice, int 
nOutputWidth, int nOutputHeight,
+  int nTilePosX, int nTilePosY, 
tools::Long nTileWidth,
+  tools::Long nTileHeight);
+
 private:
+void PaintTile(VirtualDevice& rDevice, const tools::Rectangle& rTileRect);
+
 const SfxViewShell* mpViewShell;
 const SfxInPlaceClient* mpIPClient = nullptr; // not nullptr when the 
object is valid
 css::uno::Reference mxFrame; // not empty when the 
object is valid
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index 2deb5d296c22..0106f00a98a6 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -2248,6 +2248,8 @@ void SdXImpressDocument::paintTile( VirtualDevice& 
rDevice,
 
 LokChartHelper::PaintAllChartsOnTile(rDevice, nOutputWidth, nOutputHeight,
  nTilePosX, nTilePosY, nTileWidth, 
nTileHeight);
+LokStarMathHelper::PaintAllInPlaceOnTile(rDevice, nOutputWidth, 
nOutputHeight, nTilePosX,
+ nTilePosY, nTileWidth, 
nTileHeight);
 
 if(patchedPageWindow != nullptr)
 patchedPageWindow->unpatchPaintWindow(previousPaintWindow);
diff --git a/sfx2/source/view/lokstarmathhelper.cxx 
b/sfx2/source/view/lokstarmathhelper.cxx
index 5586068d88b7..9b2df19ecdec 100644
--- a/sfx2/source/view/lokstarmathhelper.cxx
+++ b/sfx2/source/view/lokstarmathhelper.cxx
@@ -15,10 +15,12 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -185,4 +187,61 @@ bool LokStarMathHelper::postMouseEvent(int nType, int nX, 
int nY, int nCount, in
 return false;
 }
 
+void LokStarMathHelper::PaintTile(VirtualDevice& rDevice, const 
tools::Rectangle& rTileRect)
+{
+const tools::Rectangle aMathRect = GetBoundingBox();
+if (rTileRect.GetIntersection(aMathRect).IsEmpty())
+return;
+
+vcl::Window* pWidgetWindow = GetWidgetWindow();
+if (!pWidgetWindow)
+return;
+
+Point aOffset(aMathRect.Left() - rTileRect.Left(), aMathRect.Top() - 
rTileRect.Top());
+
+MapMode newMode = rDevice.GetMapMode();
+newMode.SetOrigin(aOffset);
+rDevice.SetMapMode(newMode); // Push/Pop is done in PaintAllInPlaceOnTile
+
+pWidgetWindow->Paint(rDevice, {}); // SmGraphicWidget::Paint does not use 
the passed rectangle
+}
+
+void LokStarMathHelper::PaintAllInPlaceOnTile(VirtualDevice& rDevice, int 
nOutputWidth,
+  int nOutputHeight, int 
nTilePosX, int nTilePosY,
+  tools::Long nTileWidth, 
tools::Long nTileHeight)
+{
+if (comphelper::LibreOfficeKit::isTiledAnnotations())
+return;
+
+SfxViewShell* pCurView = SfxViewShell::Current();
+if (!pCurView)
+return;
+const ViewShellDocId nDocId = pCurView->GetDocId();
+const int nPartForCurView = pCurView->getPart();
+
+// Resizes the virtual device to contain the entries context
+rDevice.SetOutputSizePixel({ nOutputWidth, nOutputHeight });
+
+rDevice.Push(vcl::PushFlags::MAPMODE);
+MapMode aMapMode(rDevice.GetMapMode());
+
+// Scaling. Must convert from pixels to twips. We know that VirtualDevices 
use a DPI of 96.
+const Fraction scale = conversionFract(o3tl::Length::px, 
o3tl::Length::twip);
+const Fraction scaleX = Fraction(nOutputWidth, nTileWidth) * scale;
+const Fraction scaleY = Fraction(nOutputHeight, nTileHeight) * scale;
+aMapMode.SetScaleX(scaleX);
+aMapMode.SetScaleY(scaleY);
+aMapMode.SetMapUnit(MapUnit::MapTwip);
+rDevice.SetMapMode(aMapMode);
+
+const tools::Rectangle aTileRect(Point(nTilePosX, nTilePosY), 
Size(nTileWidth, nTileHeight));
+
+for (SfxViewShell* pViewShell = SfxViewShell::GetFirst(); pViewShell;
+ pViewShell = 

[Libreoffice-commits] core.git: include/sfx2 officecfg/registry svx/sdi sw/inc sw/sdi sw/source sw/uiconfig

2022-11-17 Thread Tomaž Vajngerl (via logerrit)
 include/sfx2/sfxsids.hrc |   14 +--
 officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu |   14 +++
 svx/sdi/svx.sdi  |   18 

 sw/inc/OnlineAccessibilityCheck.hxx  |5 -
 sw/inc/node.hxx  |1 
 sw/sdi/_viewsh.sdi   |   11 ++
 sw/source/core/txtnode/OnlineAccessibilityCheck.cxx  |   42 
+-
 sw/source/uibase/uiview/view0.cxx|   24 
+
 sw/uiconfig/sglobal/menubar/menubar.xml  |1 
 sw/uiconfig/swriter/menubar/menubar.xml  |1 
 10 files changed, 119 insertions(+), 12 deletions(-)

New commits:
commit 00128f14c400b661444676410b2088aca357291c
Author: Tomaž Vajngerl 
AuthorDate: Fri Oct 28 22:11:59 2022 +0200
Commit: Tomaž Vajngerl 
CommitDate: Fri Nov 18 02:05:55 2022 +0100

sw: add a menu option to enable/disable online a11y check

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

diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc
index 8333ce792d9d..eb729e873fd2 100644
--- a/include/sfx2/sfxsids.hrc
+++ b/include/sfx2/sfxsids.hrc
@@ -459,15 +459,15 @@ class SvxZoomItem;
 #define SID_PASTE_ONLY_FORMULA  (SID_SFX_START + 803)
 #define SID_PASTE_ONLY_VALUE(SID_SFX_START + 804)
 #define SID_PASTE_TEXTIMPORT_DIALOG (SID_SFX_START + 805)
-#define SID_PASTE_TRANSPOSED(SID_SFX_START + 812)
-#define SID_PASTE_AS_LINK   (SID_SFX_START + 813)
+#define SID_PASTE_TRANSPOSED(SID_SFX_START + 808)
+#define SID_PASTE_AS_LINK   (SID_SFX_START + 809)
 
 // Used for redaction
-#define SID_SHAPE_NAME  (SID_SFX_START + 808)
-// FREE: SID_SFX_START + 809
-#define SID_GRAPHIC_SIZE_CHECK  (SID_SFX_START + 809)
-#define SID_ACCESSIBILITY_CHECK (SID_SFX_START + 810)
-#define SID_ASYNCHRON   (SID_SFX_START + 811)
+#define SID_SHAPE_NAME  (SID_SFX_START + 810)
+#define SID_GRAPHIC_SIZE_CHECK  (SID_SFX_START + 811)
+#define SID_ACCESSIBILITY_CHECK (SID_SFX_START + 812)
+#define SID_ASYNCHRON   (SID_SFX_START + 813)
+#define SID_ACCESSIBILITY_CHECK_ONLINE  (SID_SFX_START + 814)
 
 // default-ids for configuration
 #define SID_CONFIG  (SID_SFX_START + 904)
diff --git 
a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu 
b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
index 20817a9b4239..c355eb776ad3 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
@@ -5020,6 +5020,20 @@ bit 3 (0x8): #define 
UICOMMANDDESCRIPTION_PROPERTIES_TOGGLEBUTTON 8
   9
 
   
+  
+
+  Automatic Accessibility Checking
+
+
+  Automatic A~ccessibility Checking
+
+
+  Toggle Automatic Accessibility 
Checking
+
+
+  1
+
+  
   
 
   Do Not Mark Errors
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index 0be42759ae94..d4e4f62450b6 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -12546,6 +12546,24 @@ SfxVoidItem AccessibilityCheck SID_ACCESSIBILITY_CHECK
 GroupId = SfxGroupId::Modify;
 ]
 
+SfxBoolItem AccessibilityCheckOnline SID_ACCESSIBILITY_CHECK_ONLINE
+(SfxBoolItem Enable FN_PARAM_1)
+[
+AutoUpdate = TRUE,
+FastCall = FALSE,
+ReadOnlyDoc = TRUE,
+Toggle = TRUE,
+Container = FALSE,
+RecordAbsolute = FALSE,
+RecordPerSet;
+
+
+AccelConfig = TRUE,
+MenuConfig = TRUE,
+ToolBoxConfig = TRUE,
+GroupId = SfxGroupId::Options;
+]
+
 XColorItem GlowColor SID_ATTR_GLOW_COLOR
 
 [
diff --git a/sw/inc/OnlineAccessibilityCheck.hxx 
b/sw/inc/OnlineAccessibilityCheck.hxx
index 7a37f05cc432..fe4652949d64 100644
--- a/sw/inc/OnlineAccessibilityCheck.hxx
+++ b/sw/inc/OnlineAccessibilityCheck.hxx
@@ -52,15 +52,18 @@ private:
 SwNodeOffset m_nPreviousNodeIndex;
 sal_Int32 m_nAccessibilityIssues;
 bool m_bInitialCheck;
+bool m_bOnlineCheckStatus;
 
 void runAccessibilityCheck(SwNode* pNode);
 void updateStatusbar();
 void updateNodeStatus(SwNode* pContentNode);
 void initialCheck();
+void lookForPreviousNodeAndUpdate(SwPosition const& rNewPos);
+void clearAccessibilityIssuesFromAllNodes();
 
 public:
 OnlineAccessibilityCheck(SwDoc& rDocument);
-void update(const SwPosition& rNewPos);
+void 

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

2022-11-16 Thread Mike Kaganski (via logerrit)
 include/sfx2/lokhelper.hxx|   11 ++
 sc/source/ui/unoobj/docuno.cxx|   39 +
 sd/source/ui/unoidl/unomodel.cxx  |   23 ++---
 sfx2/source/view/lokhelper.cxx|   40 ++
 sw/source/uibase/uno/unotxdoc.cxx |   22 ++--
 5 files changed, 63 insertions(+), 72 deletions(-)

New commits:
commit a81e957f5026373f3935390c786c21416fc74fcc
Author: Mike Kaganski 
AuthorDate: Wed Nov 16 23:01:10 2022 +0300
Commit: Mike Kaganski 
CommitDate: Wed Nov 16 22:15:19 2022 +0100

lok: handle mouse/keyboard events in Math embedded in Calc

And extract the identical code used in all components into
static SfxLokHelper methods.

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

diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx
index b2bf16aa99ab..fb2d767b7b66 100644
--- a/include/sfx2/lokhelper.hxx
+++ b/include/sfx2/lokhelper.hxx
@@ -13,6 +13,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -163,6 +165,15 @@ public:
 /// This could be a new insertion or property modifications to an existing 
one.
 static void notifyMediaUpdate(boost::property_tree::ptree& json);
 
+/// Process the mouse event in the currently active in-place component (if 
any).
+/// Returns true if the event has been processed, and no further 
processing is necessary.
+static bool testInPlaceComponentMouseEventHit(SfxViewShell* pViewShell, 
int nType, int nX,
+  int nY, int nCount, int 
nButtons, int nModifier,
+  double fScaleX, double 
fScaleY,
+  bool bNegativeX = false);
+
+static VclPtr getInPlaceDocWindow(SfxViewShell* pViewShell);
+
 private:
 static int createView(SfxViewFrame* pViewFrame, ViewShellDocId docId);
 };
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 614eed94d891..bb8a1ce81e7b 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -635,20 +635,10 @@ VclPtr ScModelObj::getDocWindow()
 if (!pViewShell)
 return VclPtr();
 
-ScViewData* pViewData = >GetViewData();
-
-VclPtr pWindow;
-if (pViewData)
-{
-pWindow = pViewData->GetActiveWin();
+if (VclPtr pWindow = 
SfxLokHelper::getInPlaceDocWindow(pViewShell))
+return pWindow;
 
-LokChartHelper aChartHelper(pViewData->GetViewShell());
-vcl::Window* pChartWindow = aChartHelper.GetWindow();
-if (pChartWindow)
-pWindow = pChartWindow;
-}
-
-return pWindow;
+return pViewShell->GetViewData().GetActiveWin();
 }
 
 Size ScModelObj::getDocumentSize()
@@ -740,32 +730,15 @@ void ScModelObj::postMouseEvent(int nType, int nX, int 
nY, int nCount, int nButt
 if (!pGridWindow)
 return;
 
-// check if user hit a chart which is being edited by him
-ScTabViewShell * pTabViewShell = pViewData->GetViewShell();
 SCTAB nTab = pViewData->GetTabNo();
 const ScDocument& rDoc = pDocShell->GetDocument();
-// In LOK RTL mode draw/svx operates in negative X coordinates
-// But the coordinates from client is always positive, so negate nX for 
draw.
 bool bDrawNegativeX = rDoc.IsNegativePage(nTab);
-LokChartHelper aChartHelper(pTabViewShell, bDrawNegativeX);
-int nDrawX = bDrawNegativeX ? -nX : nX;
-if (aChartHelper.postMouseEvent(nType, nDrawX, nY,
-nCount, nButtons, nModifier,
-pViewData->GetPPTX(), 
pViewData->GetPPTY()))
-{
+if (SfxLokHelper::testInPlaceComponentMouseEventHit(pViewShell, nType, nX, 
nY, nCount,
+nButtons, nModifier, 
pViewData->GetPPTX(),
+pViewData->GetPPTY(), 
bDrawNegativeX))
 return;
-}
 
 Point aPointTwip(nX, nY);
-Point aPointTwipDraw(nDrawX, nY);
-
-// check if the user hit a chart which is being edited by someone else
-// and, if so, skip current mouse event
-if (nType != LOK_MOUSEEVENT_MOUSEMOVE)
-{
-if (LokChartHelper::HitAny(aPointTwipDraw, bDrawNegativeX))
-return;
-}
 
 // Check if a control is hit
 Point aPointHMM = o3tl::convert(aPointTwip, o3tl::Length::twip, 
o3tl::Length::mm100);
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index db972faeb633..36688e31640b 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -2432,10 +2432,7 @@ VclPtr SdXImpressDocument::getDocWindow()
 if (!pViewShell)
 return {};
 
-SfxViewShell* pSfxViewShell = 

[Libreoffice-commits] core.git: include/sfx2 officecfg/registry sfx2/source sw/inc sw/Library_sw.mk sw/source

2022-11-14 Thread Tomaž Vajngerl (via logerrit)
 include/sfx2/AccessibilityIssue.hxx|2 
 officecfg/registry/schema/org/openoffice/Office/Common.xcs |   10 +
 sfx2/source/accessibility/AccessibilityIssue.cxx   |2 
 sw/Library_sw.mk   |1 
 sw/inc/OnlineAccessibilityCheck.hxx|   43 
 sw/inc/doc.hxx |6 
 sw/inc/ndtxt.hxx   |   12 +
 sw/source/core/crsr/crsrsh.cxx |4 
 sw/source/core/doc/docnew.cxx  |4 
 sw/source/core/txtnode/OnlineAccessibilityCheck.cxx|  124 +
 10 files changed, 207 insertions(+), 1 deletion(-)

New commits:
commit 0b96a1747fc3f96ca70fd159594fe1a478369da0
Author: Tomaž Vajngerl 
AuthorDate: Thu Oct 20 22:33:22 2022 +0200
Commit: Tomaž Vajngerl 
CommitDate: Tue Nov 15 00:03:41 2022 +0100

sw: add online accessibility check implementation

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

diff --git a/include/sfx2/AccessibilityIssue.hxx 
b/include/sfx2/AccessibilityIssue.hxx
index 0c22d9e19238..d1bf1ee11766 100644
--- a/include/sfx2/AccessibilityIssue.hxx
+++ b/include/sfx2/AccessibilityIssue.hxx
@@ -59,6 +59,8 @@ public:
 AccessibilityIssueCollection() = default;
 
 std::vector>& getIssues();
+
+void clear();
 };
 
 } // end sfx namespace
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index 5c0ae14167c1..2505345a8a39 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -6338,6 +6338,16 @@
  
  false

+   
+
+  
+Enables online accessibility check, which checks for accessibility 
issues inside the document structure
+while the user edits the document.
+  
+  Enable/Disable online accessibility check.
+ 
+ false
+   
 
 
   
diff --git a/sfx2/source/accessibility/AccessibilityIssue.cxx 
b/sfx2/source/accessibility/AccessibilityIssue.cxx
index b276faf54c3f..aa58c3924476 100644
--- a/sfx2/source/accessibility/AccessibilityIssue.cxx
+++ b/sfx2/source/accessibility/AccessibilityIssue.cxx
@@ -24,6 +24,8 @@ std::vector>& 
AccessibilityIssueCollection::
 return m_aIssues;
 }
 
+void AccessibilityIssueCollection::clear() { m_aIssues.clear(); }
+
 } // end sfx namespace
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/Library_sw.mk b/sw/Library_sw.mk
index 483f00601b04..7785ba9b6254 100644
--- a/sw/Library_sw.mk
+++ b/sw/Library_sw.mk
@@ -430,6 +430,7 @@ $(eval $(call gb_Library_add_exception_objects,sw,\
 sw/source/core/tox/ToxTextGenerator \
 sw/source/core/tox/ToxWhitespaceStripper \
 sw/source/core/txtnode/GrammarContact \
+sw/source/core/txtnode/OnlineAccessibilityCheck \
 sw/source/core/txtnode/attrcontentcontrol \
 sw/source/core/txtnode/atrfld \
 sw/source/core/txtnode/atrflyin \
diff --git a/sw/inc/OnlineAccessibilityCheck.hxx 
b/sw/inc/OnlineAccessibilityCheck.hxx
new file mode 100644
index ..f27f867ce96b
--- /dev/null
+++ b/sw/inc/OnlineAccessibilityCheck.hxx
@@ -0,0 +1,43 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#pragma once
+
+#include "ndindex.hxx"
+#include "ndtxt.hxx"
+#include 
+#include 
+#include 
+
+struct SwPosition;
+class SwTextNode;
+
+namespace sw
+{
+class OnlineAccessibilityCheck : public SvtListener
+{
+private:
+SwDoc& m_rDocument;
+sw::AccessibilityCheck m_aAccessibilityCheck;
+SwTextNode* m_pCurrentTextNode;
+SwNodeOffset m_aCurrentNodeIndex;
+sal_Int32 m_nAccessibilityIssues;
+
+void runCheck(SwTextNode* pTextNode);
+
+public:
+OnlineAccessibilityCheck(SwDoc& rDocument);
+void update(const SwPosition& rNewPos);
+sal_Int32 getNumberOfAccessibilityIssues() { return 
m_nAccessibilityIssues; }
+};
+
+} // end sw
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index de5ec6112a00..80aa234cc6e3 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -163,6 +163,7 @@ namespace sw {
 class DocumentStylePoolManager;
 class DocumentExternalDataManager;
 class GrammarContact;
+class OnlineAccessibilityCheck;
 }
 
 namespace com::sun::star {
@@ -285,6 +286,7 @@ class SW_DLLPUBLIC SwDoc final
  

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

2022-11-09 Thread Szymon Kłos (via logerrit)
 include/sfx2/lokhelper.hxx  |2 ++
 include/sfx2/viewsh.hxx |2 ++
 include/vcl/ITiledRenderable.hxx|   13 +
 sd/source/ui/inc/ViewShellBase.hxx  |4 
 sd/source/ui/inc/unomodel.hxx   |6 +-
 sd/source/ui/unoidl/unomodel.cxx|   23 +++
 sd/source/ui/view/ViewShellBase.cxx |   36 
 sfx2/source/view/lokhelper.cxx  |   10 +-
 sfx2/source/view/viewsh.cxx |5 +
 9 files changed, 99 insertions(+), 2 deletions(-)

New commits:
commit 4c0e5d0be02ba25be0e8b4748fbf0060491de93c
Author: Szymon Kłos 
AuthorDate: Mon Aug 29 08:40:14 2022 +0200
Commit: Szymon Kłos 
CommitDate: Wed Nov 9 21:49:09 2022 +0100

lok: masterpage: introduce EditMode setter and getter for ViewShell

Change-Id: I74d3307aab8fc038bd2409b5f10a2d08db885223
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138957
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Henry Castro 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142472
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 

diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx
index eaa7abe9785c..b2bf16aa99ab 100644
--- a/include/sfx2/lokhelper.hxx
+++ b/include/sfx2/lokhelper.hxx
@@ -58,6 +58,8 @@ public:
 static void destroyView(int nId);
 /// Set a view shell as current one.
 static void setView(int nId);
+/// Set the edit mode for a document with callbacks disabled.
+static void setEditMode(int nMode, vcl::ITiledRenderable* pDoc);
 /// Get view shell with id
 static SfxViewShell* getViewOfId(int nId);
 /// Get the currently active view.
diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx
index 5d1a44ff07be..6196faa4ca4a 100644
--- a/include/sfx2/viewsh.hxx
+++ b/include/sfx2/viewsh.hxx
@@ -365,6 +365,8 @@ public:
 void setTiledSearching(bool bTiledSearching);
 /// See lok::Document::getPart().
 virtual int getPart() const;
+/// See lok::Document::getMode().
+virtual int getEditMode() const;
 virtual void dumpAsXml(xmlTextWriterPtr pWriter) const;
 /// See OutlinerViewShell::GetViewShellId().
 ViewShellId GetViewShellId() const override;
diff --git a/include/vcl/ITiledRenderable.hxx b/include/vcl/ITiledRenderable.hxx
index 2562ce8b187f..f06193172702 100644
--- a/include/vcl/ITiledRenderable.hxx
+++ b/include/vcl/ITiledRenderable.hxx
@@ -117,6 +117,19 @@ public:
 /// @see lok::Document::setPartMode().
 virtual void setPartMode(int) {}
 
+/**
+ * Get the currently used EditMode (supported in Impress).
+ */
+virtual int getEditMode()
+{
+return 0;
+}
+
+/**
+ * Set the currently used EditMode (supported in Impress).
+ */
+virtual void setEditMode(int) {}
+
 /**
  * Setup various document properties that are needed for the document to
  * be renderable via tiled rendering.
diff --git a/sd/source/ui/inc/ViewShellBase.hxx 
b/sd/source/ui/inc/ViewShellBase.hxx
index eab26ec8a1ba..7fc4af2a2da0 100644
--- a/sd/source/ui/inc/ViewShellBase.hxx
+++ b/sd/source/ui/inc/ViewShellBase.hxx
@@ -213,6 +213,10 @@ public:
 OUString RetrieveLabelFromCommand( const OUString& aCmdURL ) const;
 /// See SfxViewShell::getPart().
 int getPart() const override;
+/// See SfxViewShell::getEditMode().
+int getEditMode() const override;
+/// See SfxViewShell::setEditMode().
+void setEditMode(int nMode);
 /// See SfxViewShell::NotifyCursor().
 void NotifyCursor(SfxViewShell* pViewShell) const override;
 
diff --git a/sd/source/ui/inc/unomodel.hxx b/sd/source/ui/inc/unomodel.hxx
index 74e21ed44131..98d5c4473f9b 100644
--- a/sd/source/ui/inc/unomodel.hxx
+++ b/sd/source/ui/inc/unomodel.hxx
@@ -240,8 +240,12 @@ public:
 virtual VclPtr getDocWindow() override;
 bool isMasterViewMode();
 
+/// @see vcl::ITiledRenderable::setPartMode().
 virtual void setPartMode( int nPartMode ) override;
-
+/// @see vcl::ITiledRenderable::getEditMode().
+virtual int getEditMode() override;
+/// @see vcl::ITiledRenderable::setEditMode().
+virtual void setEditMode(int) override;
 /// @see vcl::ITiledRenderable::initializeForTiledRendering().
 virtual void initializeForTiledRendering(const 
css::uno::Sequence& rArguments) override;
 /// @see vcl::ITiledRenderable::postKeyEvent().
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index 990f9c84b625..2125fe109ed5 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -2339,7 +2339,10 @@ OUString SdXImpressDocument::getPartInfo(int nPart)
 OUString::number(static_cast(bIsSelected)) +
 "\", \"masterPageCount\": \"" +
 OUString::number(nMasterPageCount) +
+"\", \"mode\": \"" +
+OUString::number(getEditMode()) +
 "\" }";
+
 return aPartInfo;
 }
 
@@ -2456,6 +2459,26 @@ 

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

2022-11-05 Thread Mike Kaganski (via logerrit)
 include/sfx2/lokcomponenthelpers.hxx   |2 +-
 sfx2/source/view/lokstarmathhelper.cxx |   13 -
 2 files changed, 13 insertions(+), 2 deletions(-)

New commits:
commit f0a88a6d214ebdcc3617d24beb4bb5148f72c3a4
Author: Mike Kaganski 
AuthorDate: Sat Nov 5 15:17:00 2022 +0300
Commit: Mike Kaganski 
CommitDate: Sat Nov 5 14:06:46 2022 +0100

lok: properly treat zoom in LokStarMathHelper::postMouseEvent

Previous naive implementation was dropped in commit
033a342a630dbb6329962156727e621866b77b48 (lok: use twips in Math,
Wed Nov 02 11:03:08 2022 +0300). Unlike chart, Math expects twips,
so PPT (pixel per twip) factor must be converted into percentage.

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

diff --git a/include/sfx2/lokcomponenthelpers.hxx 
b/include/sfx2/lokcomponenthelpers.hxx
index 23bdcd44369e..61a3812a9d2f 100644
--- a/include/sfx2/lokcomponenthelpers.hxx
+++ b/include/sfx2/lokcomponenthelpers.hxx
@@ -78,7 +78,7 @@ public:
 void Dispatch(const OUString& cmd, const 
css::uno::Sequence& rArguments) const;
 
 bool postMouseEvent(int nType, int nX, int nY, int nCount, int nButtons, 
int nModifier,
-double fScaleX = 1.0, double fScaleY = 1.0);
+double fPPTScaleX, double fPPTScaleY);
 
 private:
 const SfxViewShell* mpViewShell;
diff --git a/sfx2/source/view/lokstarmathhelper.cxx 
b/sfx2/source/view/lokstarmathhelper.cxx
index 8ec65c45a274..a1ee4c2ccacb 100644
--- a/sfx2/source/view/lokstarmathhelper.cxx
+++ b/sfx2/source/view/lokstarmathhelper.cxx
@@ -139,7 +139,7 @@ tools::Rectangle LokStarMathHelper::GetBoundingBox() const
 }
 
 bool LokStarMathHelper::postMouseEvent(int nType, int nX, int nY, int nCount, 
int nButtons,
-   int nModifier, double /*fScaleX*/, 
double /*fScaleY*/)
+   int nModifier, double fPPTScaleX, 
double fPPTScaleY)
 {
 const tools::Rectangle rBBox = GetBoundingBox();
 if (Point aMousePos(nX, nY); rBBox.Contains(aMousePos))
@@ -147,6 +147,17 @@ bool LokStarMathHelper::postMouseEvent(int nType, int nX, 
int nY, int nCount, in
 if (vcl::Window* pWindow = GetWidgetWindow())
 {
 aMousePos -= rBBox.TopLeft();
+
+// In lok, Math does not convert coordinates (see 
SmGraphicWidget::SetDrawingArea,
+// which disables MapMode), and uses twips internally (see 
SmDocShell ctor and
+// SmMapUnit), but the conversion factor can depend on the client 
zoom.
+// 1. Remove the twip->pixel factor in the passed scales
+double fScaleX = o3tl::convert(fPPTScaleX, o3tl::Length::px, 
o3tl::Length::twip);
+double fScaleY = o3tl::convert(fPPTScaleY, o3tl::Length::px, 
o3tl::Length::twip);
+// 2. Adjust the position according to the scales
+aMousePos
+= Point(std::round(aMousePos.X() * fScaleX), 
std::round(aMousePos.Y() * fScaleY));
+
 LokMouseEventData aMouseEventData(
 nType, aMousePos, nCount, MouseEventModifiers::SIMPLECLICK, 
nButtons, nModifier);
 SfxLokHelper::postMouseEventAsync(pWindow, aMouseEventData);


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

2022-11-04 Thread Amarjargal Gundjalam (via logerrit)
 include/sfx2/strings.hrc  |2 ++
 sfx2/source/devtools/DevelopmentToolDockingWindow.cxx |4 
 2 files changed, 6 insertions(+)

New commits:
commit 670fa33edd7c9da77d5cbed5c7978ef24df59f15
Author: Amarjargal Gundjalam 
AuthorDate: Mon Oct 31 12:24:13 2022 +0800
Commit: Hossein 
CommitDate: Fri Nov 4 09:57:56 2022 +0100

tdf#143641 Fix UNO Object Inspector window title

When detaching the "UNO Object Inspector" window, the title is 
"LibreOfficeDev 7.x",
and not anything related to the window. This change fixes the window title.

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

diff --git a/include/sfx2/strings.hrc b/include/sfx2/strings.hrc
index 8303722fe467..25fec7b020cf 100644
--- a/include/sfx2/strings.hrc
+++ b/include/sfx2/strings.hrc
@@ -356,6 +356,8 @@
 #define STR_WINDOW_TITLE_RENAME_TEMPLATE
NC_("STR_WINDOW_TITLE_RENAME_TEMPLATE","Rename")
 #define STR_WINDOW_TITLE_RENAME_CATEGORY
NC_("STR_WINDOW_TITLE_RENAME_CATEGORY","Rename Category")
 #define STR_WINDOW_TITLE_RENAME_NEW_CATEGORY
NC_("STR_WINDOW_TITLE_RENAME_NEW_CATEGORY","New Category")
+
+#define STR_OBJECT_INSPECTORNC_("STR_OBJECT_INSPECTOR", 
"UNO Object Inspector")
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx 
b/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx
index 817647ca9754..de0950a7edaf 100644
--- a/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx
+++ b/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx
@@ -17,6 +17,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include "SelectionChangeHandler.hxx"
 
@@ -51,6 +53,8 @@ 
DevelopmentToolDockingWindow::DevelopmentToolDockingWindow(SfxBindings* pInputBi
 mxSelectionSupplier.set(xController, css::uno::UNO_QUERY);
 
 maObjectInspectorTreeHandler.introspect(mxRoot);
+
+SetText(SfxResId(STR_OBJECT_INSPECTOR));
 }
 
 IMPL_LINK(DevelopmentToolDockingWindow, DocumentModelTreeViewSelectionHandler, 
weld::TreeView&,


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

2022-11-03 Thread Paris Oplopoios (via logerrit)
 include/sfx2/AccessibilityIssue.hxx|1 
 sw/inc/AccessibilityCheckStrings.hrc   |1 
 sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx   |   11 ++
 sw/qa/core/accessibilitycheck/data/TableFormattingTest.odt |binary
 sw/source/core/access/AccessibilityCheck.cxx   |   49 +
 5 files changed, 62 insertions(+)

New commits:
commit 5c8934809ac60488d6160e27ff5962350c612a09
Author: Paris Oplopoios 
AuthorDate: Thu Nov 3 01:02:40 2022 +0200
Commit: Tomaž Vajngerl 
CommitDate: Thu Nov 3 07:53:53 2022 +0100

a11y: Add check for table used for text formatting

Add accessibility check and relevant test for a document that uses a
table for text formatting

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

diff --git a/include/sfx2/AccessibilityIssue.hxx 
b/include/sfx2/AccessibilityIssue.hxx
index b9e3266c73a2..0c22d9e19238 100644
--- a/include/sfx2/AccessibilityIssue.hxx
+++ b/include/sfx2/AccessibilityIssue.hxx
@@ -29,6 +29,7 @@ enum class AccessibilityIssueID
 NO_ALT_SHAPE,
 TABLE_MERGE_SPLIT,
 TEXT_FORMATTING,
+TABLE_FORMATTING,
 HYPERLINK_IS_TEXT,
 HYPERLINK_SHORT,
 FAKE_FOOTNOTE,
diff --git a/sw/inc/AccessibilityCheckStrings.hrc 
b/sw/inc/AccessibilityCheckStrings.hrc
index e63d304d1063..7245a2b8d3e0 100644
--- a/sw/inc/AccessibilityCheckStrings.hrc
+++ b/sw/inc/AccessibilityCheckStrings.hrc
@@ -34,6 +34,7 @@
 #define STR_HEADING_IN_TABLENC_("STR_HEADING_IN_TABLE", "Tables 
must not contain headings.")
 #define STR_HEADING_ORDER   NC_("STR_HEADING_ORDER", "Keep 
headings' levels ordered. Heading level %LEVEL_CURRENT% must not go after 
%LEVEL_PREV%.")
 #define STR_FONTWORKS   NC_("STR_FONTWORKS", "Avoid Fontwork 
objects in your documents. Make sure you use it for samples or other 
meaningless text.")
+#define STR_TABLE_FORMATTINGNC_("STR_TABLE_FORMATTING", "Avoid 
using empty table cells for formatting.")
 
 #define STR_DOCUMENT_DEFAULT_LANGUAGE   NC_("STR_DOCUMENT_DEFAULT_LANGUAGE", 
"Document default language is not set")
 #define STR_STYLE_NO_LANGUAGE   NC_("STR_STYLE_NO_LANGUAGE", "Style 
'%STYLE_NAME%' has no language set")
diff --git a/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx 
b/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx
index 02912e4c9d35..b7561ad01764 100644
--- a/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx
+++ b/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx
@@ -154,6 +154,17 @@ CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, 
testCheckFakeCaption)
 CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::FAKE_CAPTION, 
aIssues[0]->m_eIssueID);
 }
 
+CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testCheckTableFormatting)
+{
+SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "TableFormattingTest.odt");
+CPPUNIT_ASSERT(pDoc);
+sw::AccessibilityCheck aCheck(pDoc);
+aCheck.check();
+auto& aIssues = aCheck.getIssueCollection().getIssues();
+CPPUNIT_ASSERT_EQUAL(size_t(1), aIssues.size());
+CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TABLE_FORMATTING, 
aIssues[0]->m_eIssueID);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/core/accessibilitycheck/data/TableFormattingTest.odt 
b/sw/qa/core/accessibilitycheck/data/TableFormattingTest.odt
new file mode 100644
index ..adc63daaf7cb
Binary files /dev/null and 
b/sw/qa/core/accessibilitycheck/data/TableFormattingTest.odt differ
diff --git a/sw/source/core/access/AccessibilityCheck.cxx 
b/sw/source/core/access/AccessibilityCheck.cxx
index 0170003c4a48..ce0409d6ba5b 100644
--- a/sw/source/core/access/AccessibilityCheck.cxx
+++ b/sw/source/core/access/AccessibilityCheck.cxx
@@ -236,6 +236,50 @@ public:
 }
 };
 
+class TableFormattingCheck : public NodeCheck
+{
+private:
+void checkTableNode(SwTableNode* pTableNode)
+{
+if (!pTableNode)
+return;
+
+const SwTable& rTable = pTableNode->GetTable();
+if (!rTable.IsTableComplex())
+{
+size_t nEmptyBoxes = 0;
+size_t nBoxCount = 0;
+for (const SwTableLine* pTableLine : rTable.GetTabLines())
+{
+nBoxCount += pTableLine->GetTabBoxes().size();
+for (const SwTableBox* pBox : pTableLine->GetTabBoxes())
+if (pBox->IsEmpty())
+++nEmptyBoxes;
+}
+// If more than half of the boxes are empty we can assume that it 
is used for formatting
+if (nEmptyBoxes > nBoxCount / 2)
+lclAddIssue(m_rIssueCollection, SwResId(STR_TABLE_FORMATTING),
+sfx::AccessibilityIssueID::TABLE_FORMATTING);
+}
+}
+
+public:
+

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

2022-11-03 Thread Paris Oplopoios (via logerrit)
 include/sfx2/AccessibilityIssue.hxx  |1 
 sw/inc/AccessibilityCheckStrings.hrc |1 
 sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx |   11 ++
 sw/qa/core/accessibilitycheck/data/FakeCaptionTest.odt   |binary
 sw/source/core/access/AccessibilityCheck.cxx |   66 +++
 5 files changed, 79 insertions(+)

New commits:
commit 766151ff6ec759563583abfa43f5bb3755ee2603
Author: Paris Oplopoios 
AuthorDate: Fri Oct 28 13:14:36 2022 +0300
Commit: Tomaž Vajngerl 
CommitDate: Thu Nov 3 07:43:09 2022 +0100

a11y: Add check for fake captions

Add accessibility check and relevant test for a document that has
fake captions

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

diff --git a/include/sfx2/AccessibilityIssue.hxx 
b/include/sfx2/AccessibilityIssue.hxx
index 9d1023053515..b9e3266c73a2 100644
--- a/include/sfx2/AccessibilityIssue.hxx
+++ b/include/sfx2/AccessibilityIssue.hxx
@@ -32,6 +32,7 @@ enum class AccessibilityIssueID
 HYPERLINK_IS_TEXT,
 HYPERLINK_SHORT,
 FAKE_FOOTNOTE,
+FAKE_CAPTION,
 MANUAL_NUMBERING
 };
 
diff --git a/sw/inc/AccessibilityCheckStrings.hrc 
b/sw/inc/AccessibilityCheckStrings.hrc
index 86be8b494c90..e63d304d1063 100644
--- a/sw/inc/AccessibilityCheckStrings.hrc
+++ b/sw/inc/AccessibilityCheckStrings.hrc
@@ -22,6 +22,7 @@
 #define STR_TEXT_BLINKING   NC_("STR_TEXT_BLINKING", "Blinking 
text.")
 #define STR_AVOID_FOOTNOTES NC_("STR_AVOID_FOOTNOTES", "Avoid 
footnotes.")
 #define STR_AVOID_FAKE_FOOTNOTESNC_("STR_AVOID_FAKE_FOOTNOTES", "Avoid 
fake footnotes.")
+#define STR_AVOID_FAKE_CAPTIONS NC_("STR_AVOID_FAKE_CAPTIONS", "Avoid 
fake captions.")
 #define STR_AVOID_ENDNOTES  NC_("STR_AVOID_ENDNOTES", "Avoid 
endnotes.")
 #define STR_AVOID_BACKGROUND_IMAGES NC_("STR_AVOID_BACKGROUND_IMAGES", 
"Avoid background images.")
 #define STR_AVOID_NEWLINES_SPACENC_("STR_AVOID_NEWLINES_SPACE", "Avoid 
newlines to create space.")
diff --git a/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx 
b/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx
index 39f094a38c2a..02912e4c9d35 100644
--- a/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx
+++ b/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx
@@ -143,6 +143,17 @@ CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, 
testCheckFakeFootnote)
 CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::FAKE_FOOTNOTE, 
aIssues[1]->m_eIssueID);
 }
 
+CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testCheckFakeCaption)
+{
+SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "FakeCaptionTest.odt");
+CPPUNIT_ASSERT(pDoc);
+sw::AccessibilityCheck aCheck(pDoc);
+aCheck.check();
+auto& aIssues = aCheck.getIssueCollection().getIssues();
+CPPUNIT_ASSERT_EQUAL(size_t(1), aIssues.size());
+CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::FAKE_CAPTION, 
aIssues[0]->m_eIssueID);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/core/accessibilitycheck/data/FakeCaptionTest.odt 
b/sw/qa/core/accessibilitycheck/data/FakeCaptionTest.odt
new file mode 100644
index ..9630bfcf73d7
Binary files /dev/null and 
b/sw/qa/core/accessibilitycheck/data/FakeCaptionTest.odt differ
diff --git a/sw/source/core/access/AccessibilityCheck.cxx 
b/sw/source/core/access/AccessibilityCheck.cxx
index 3860eb8904e0..0170003c4a48 100644
--- a/sw/source/core/access/AccessibilityCheck.cxx
+++ b/sw/source/core/access/AccessibilityCheck.cxx
@@ -11,12 +11,14 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -26,11 +28,13 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -841,6 +845,67 @@ public:
 }
 };
 
+class FakeCaptionCheck : public NodeCheck
+{
+public:
+FakeCaptionCheck(sfx::AccessibilityIssueCollection& rIssueCollection)
+: NodeCheck(rIssueCollection)
+{
+}
+void check(SwNode* pCurrent) override
+{
+if (!pCurrent->IsTextNode())
+return;
+
+SwTextNode* pTextNode = pCurrent->GetTextNode();
+const OUString& sText = pTextNode->GetText();
+
+if (sText.getLength() == 0)
+return;
+
+// Check if it's a real caption
+const SwNode* aStartFly = pCurrent->FindFlyStartNode();
+if (aStartFly
+&& aStartFly->GetFlyFormat()->GetAnchor().GetAnchorId() != 
RndStdIds::FLY_AS_CHAR)
+return;
+
+auto aIter = SwIterator(*pTextNode);
+auto nCount = 0;
+for (auto aTextFrame = aIter.First(); aTextFrame; aTextFrame = 
aIter.Next())
+{
+

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

2022-11-03 Thread Paris Oplopoios (via logerrit)
 include/sfx2/AccessibilityIssue.hxx  |1 
 sw/inc/AccessibilityCheckStrings.hrc |1 
 sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx |   12 ++
 sw/qa/core/accessibilitycheck/data/FakeFootnoteTest.odt  |binary
 sw/source/core/access/AccessibilityCheck.cxx |   72 +++
 5 files changed, 86 insertions(+)

New commits:
commit a1ae31bd248ab62a0614f3a25f1abfcc214ff431
Author: Paris Oplopoios 
AuthorDate: Tue Oct 25 23:53:32 2022 +0300
Commit: Tomaž Vajngerl 
CommitDate: Thu Nov 3 07:41:22 2022 +0100

a11y: Add check for fake footnotes

Add accessibility check and relevant test for a document that has
fake footnotes

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

diff --git a/include/sfx2/AccessibilityIssue.hxx 
b/include/sfx2/AccessibilityIssue.hxx
index 7ca02ef3b7e9..9d1023053515 100644
--- a/include/sfx2/AccessibilityIssue.hxx
+++ b/include/sfx2/AccessibilityIssue.hxx
@@ -31,6 +31,7 @@ enum class AccessibilityIssueID
 TEXT_FORMATTING,
 HYPERLINK_IS_TEXT,
 HYPERLINK_SHORT,
+FAKE_FOOTNOTE,
 MANUAL_NUMBERING
 };
 
diff --git a/sw/inc/AccessibilityCheckStrings.hrc 
b/sw/inc/AccessibilityCheckStrings.hrc
index 77b93378869f..86be8b494c90 100644
--- a/sw/inc/AccessibilityCheckStrings.hrc
+++ b/sw/inc/AccessibilityCheckStrings.hrc
@@ -21,6 +21,7 @@
 #define STR_TEXT_CONTRAST   NC_("STR_TEXT_CONTRAST", "Text 
contrast is too low.")
 #define STR_TEXT_BLINKING   NC_("STR_TEXT_BLINKING", "Blinking 
text.")
 #define STR_AVOID_FOOTNOTES NC_("STR_AVOID_FOOTNOTES", "Avoid 
footnotes.")
+#define STR_AVOID_FAKE_FOOTNOTESNC_("STR_AVOID_FAKE_FOOTNOTES", "Avoid 
fake footnotes.")
 #define STR_AVOID_ENDNOTES  NC_("STR_AVOID_ENDNOTES", "Avoid 
endnotes.")
 #define STR_AVOID_BACKGROUND_IMAGES NC_("STR_AVOID_BACKGROUND_IMAGES", 
"Avoid background images.")
 #define STR_AVOID_NEWLINES_SPACENC_("STR_AVOID_NEWLINES_SPACE", "Avoid 
newlines to create space.")
diff --git a/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx 
b/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx
index 91d6be266a8c..39f094a38c2a 100644
--- a/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx
+++ b/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx
@@ -131,6 +131,18 @@ CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, 
testNumberingCheck)
 CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::MANUAL_NUMBERING, 
aIssues[4]->m_eIssueID);
 }
 
+CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testCheckFakeFootnote)
+{
+SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "FakeFootnoteTest.odt");
+CPPUNIT_ASSERT(pDoc);
+sw::AccessibilityCheck aCheck(pDoc);
+aCheck.check();
+auto& aIssues = aCheck.getIssueCollection().getIssues();
+CPPUNIT_ASSERT_EQUAL(size_t(2), aIssues.size());
+CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::FAKE_FOOTNOTE, 
aIssues[0]->m_eIssueID);
+CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::FAKE_FOOTNOTE, 
aIssues[1]->m_eIssueID);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/core/accessibilitycheck/data/FakeFootnoteTest.odt 
b/sw/qa/core/accessibilitycheck/data/FakeFootnoteTest.odt
new file mode 100644
index ..fdacf6cb35de
Binary files /dev/null and 
b/sw/qa/core/accessibilitycheck/data/FakeFootnoteTest.odt differ
diff --git a/sw/source/core/access/AccessibilityCheck.cxx 
b/sw/source/core/access/AccessibilityCheck.cxx
index 0763ff0e90c5..3860eb8904e0 100644
--- a/sw/source/core/access/AccessibilityCheck.cxx
+++ b/sw/source/core/access/AccessibilityCheck.cxx
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -770,6 +771,76 @@ public:
 }
 };
 
+class FakeFootnoteCheck : public NodeCheck
+{
+private:
+void checkAutoFormat(SwTextNode* pTextNode, const SwTextAttr* pTextAttr)
+{
+const SwFormatAutoFormat& rAutoFormat = pTextAttr->GetAutoFormat();
+SfxItemIter aItemIter(*rAutoFormat.GetStyleHandle());
+const SfxPoolItem* pItem = aItemIter.GetCurItem();
+while (pItem)
+{
+if (pItem->Which() == RES_CHRATR_ESCAPEMENT)
+{
+auto pEscapementItem = static_cast(pItem);
+if (pEscapementItem->GetEscapement() == 
SvxEscapement::Superscript
+&& pTextAttr->GetStart() == 0 && pTextAttr->GetAnyEnd() == 
1)
+{
+auto pIssue = lclAddIssue(m_rIssueCollection, 
SwResId(STR_AVOID_FAKE_FOOTNOTES),
+  
sfx::AccessibilityIssueID::FAKE_FOOTNOTE);
+pIssue->setIssueObject(IssueObject::TEXT);
+pIssue->setNode(pTextNode);
+SwDoc& rDocument 

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

2022-11-02 Thread Mike Kaganski (via logerrit)
 include/sfx2/lokcomponenthelpers.hxx   |   15 ++---
 sfx2/source/view/lokstarmathhelper.cxx |   86 +
 starmath/source/view.cxx   |3 -
 3 files changed, 32 insertions(+), 72 deletions(-)

New commits:
commit 5c5a2377038901204ec23e588f11e3592b1bea08
Author: Mike Kaganski 
AuthorDate: Wed Nov 2 07:39:47 2022 +0300
Commit: Mike Kaganski 
CommitDate: Wed Nov 2 11:35:56 2022 +0100

Simplify LokStarMathHelper

SfxInPlaceClient seems to have everything needed to check the OLE
bounds; OTOH, the embedded Math windows/widgets lack that info.

Set SmGraphicWidget MapMode to pixels when lok is active, as other
windows do.

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

diff --git a/include/sfx2/lokcomponenthelpers.hxx 
b/include/sfx2/lokcomponenthelpers.hxx
index ea81ea8f87c1..b26cd0a13fb8 100644
--- a/include/sfx2/lokcomponenthelpers.hxx
+++ b/include/sfx2/lokcomponenthelpers.hxx
@@ -18,8 +18,10 @@
 namespace com::sun::star::beans { struct PropertyValue; }
 namespace com::sun::star::frame { class XController; }
 namespace com::sun::star::frame { class XDispatch; }
+namespace com::sun::star::frame { class XFrame; }
 namespace com::sun::star::uno { template class Sequence; }
 
+class SfxInPlaceClient;
 class SfxViewShell;
 class VirtualDevice;
 
@@ -66,25 +68,20 @@ public:
 class SFX2_DLLPUBLIC LokStarMathHelper
 {
 public:
-LokStarMathHelper(const SfxViewShell* pViewShell)
-: mpViewShell(pViewShell)
-{
-}
+LokStarMathHelper(const SfxViewShell* pViewShell);
 
 vcl::Window* GetGraphicWindow();
 vcl::Window* GetWidgetWindow();
 
-void Dispatch(const OUString& cmd, const 
css::uno::Sequence& rArguments);
+void Dispatch(const OUString& cmd, const 
css::uno::Sequence& rArguments) const;
 
 bool postMouseEvent(int nType, int nX, int nY, int nCount, int nButtons, 
int nModifier,
 double fScaleX = 1.0, double fScaleY = 1.0);
 
 private:
-css::uno::Reference& GetXController();
-tools::Rectangle GetBoundingBox();
-
 const SfxViewShell* mpViewShell;
-css::uno::Reference mxController;
+const SfxInPlaceClient* mpIPClient = nullptr; // not nullptr when the 
object is valid
+css::uno::Reference mxFrame; // not empty when the 
object is valid
 VclPtr mpGraphicWindow;
 VclPtr mpWidgetWindow;
 };
diff --git a/sfx2/source/view/lokstarmathhelper.cxx 
b/sfx2/source/view/lokstarmathhelper.cxx
index 9a704683aaec..fb30d9cee449 100644
--- a/sfx2/source/view/lokstarmathhelper.cxx
+++ b/sfx2/source/view/lokstarmathhelper.cxx
@@ -23,9 +23,10 @@
 #include 
 #include 
 
-css::uno::Reference& 
LokStarMathHelper::GetXController()
+LokStarMathHelper::LokStarMathHelper(const SfxViewShell* pViewShell)
+: mpViewShell(pViewShell)
 {
-if (!mxController && mpViewShell)
+if (mpViewShell)
 {
 if (const SfxInPlaceClient* pIPClient = mpViewShell->GetIPClient())
 {
@@ -34,22 +35,27 @@ css::uno::Reference& 
LokStarMathHelper::GetXController(
 css::uno::Reference 
xComp(xEmbObj->getComponent(),

css::uno::UNO_QUERY);
 if (xComp && 
xComp->supportsService("com.sun.star.formula.FormulaProperties"))
+{
 if (css::uno::Reference xModel{ xComp,
 
css::uno::UNO_QUERY })
-mxController = xModel->getCurrentController();
+{
+if (auto xController = xModel->getCurrentController())
+{
+mpIPClient = pIPClient;
+mxFrame = xController->getFrame();
+}
+}
+}
 }
 }
 }
-
-return mxController;
 }
 
-void LokStarMathHelper::Dispatch(const OUString& cmd,
- const 
css::uno::Sequence& rArguments)
+void LokStarMathHelper::Dispatch(
+const OUString& cmd, const css::uno::Sequence& 
rArguments) const
 {
-if (const css::uno::Reference& xController = 
GetXController())
-if (const css::uno::Reference xFrame = 
xController->getFrame())
-comphelper::dispatchCommand(cmd, xFrame, rArguments);
+if (mxFrame)
+comphelper::dispatchCommand(cmd, mxFrame, rArguments);
 }
 
 namespace
@@ -98,13 +104,10 @@ vcl::Window* LokStarMathHelper::GetGraphicWindow()
 {
 if (!mpGraphicWindow)
 {
-if (const css::uno::Reference& xController = 
GetXController())
+if (mxFrame)
 {
-if (const css::uno::Reference xFrame = 
xController->getFrame())
-{
-css::uno::Reference xDockerWin = 

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

2022-10-21 Thread offtkp (via logerrit)
 include/sfx2/AccessibilityIssue.hxx  |2 +
 sw/inc/AccessibilityCheckStrings.hrc |1 
 sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx |   12 
 sw/qa/core/accessibilitycheck/data/HyperlinkTest.odt |binary
 sw/source/core/access/AccessibilityCheck.cxx |   21 ---
 5 files changed, 33 insertions(+), 3 deletions(-)

New commits:
commit de02e5560168060af0b0c9be847af01c4fadec0b
Author: offtkp 
AuthorDate: Thu Oct 13 19:35:06 2022 +0300
Commit: Tomaž Vajngerl 
CommitDate: Fri Oct 21 08:53:31 2022 +0200

a11y: Add check for short hyperlinks

Add accessibility check and relevant test for a document that uses
short hyperlinks

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

diff --git a/include/sfx2/AccessibilityIssue.hxx 
b/include/sfx2/AccessibilityIssue.hxx
index 085863cbd405..60700bad8d35 100644
--- a/include/sfx2/AccessibilityIssue.hxx
+++ b/include/sfx2/AccessibilityIssue.hxx
@@ -29,6 +29,8 @@ enum class AccessibilityIssueID
 NO_ALT_SHAPE,
 TABLE_MERGE_SPLIT,
 TEXT_FORMATTING,
+HYPERLINK_IS_TEXT,
+HYPERLINK_SHORT,
 };
 
 class SFX2_DLLPUBLIC AccessibilityIssue
diff --git a/sw/inc/AccessibilityCheckStrings.hrc 
b/sw/inc/AccessibilityCheckStrings.hrc
index 9c45cb84ecd9..77b93378869f 100644
--- a/sw/inc/AccessibilityCheckStrings.hrc
+++ b/sw/inc/AccessibilityCheckStrings.hrc
@@ -17,6 +17,7 @@
 #define STR_TABLE_MERGE_SPLIT   NC_("STR_TABLE_MERGE_SPLIT", "Table 
'%OBJECT_NAME%' contains merges or splits")
 #define STR_FAKE_NUMBERING  NC_("STR_FAKE_NUMBERING", "Fake 
numbering '%NUMBERING%'")
 #define STR_HYPERLINK_TEXT_IS_LINK  NC_("STR_HYPERLINK_TEXT_IS_LINK", 
"Hyperlink text is the same as the link address '%LINK%'")
+#define STR_HYPERLINK_TEXT_IS_SHORT NC_("STR_HYPERLINK_TEXT_IS_SHORT", 
"Hyperlink text is too short.")
 #define STR_TEXT_CONTRAST   NC_("STR_TEXT_CONTRAST", "Text 
contrast is too low.")
 #define STR_TEXT_BLINKING   NC_("STR_TEXT_BLINKING", "Blinking 
text.")
 #define STR_AVOID_FOOTNOTES NC_("STR_AVOID_FOOTNOTES", "Avoid 
footnotes.")
diff --git a/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx 
b/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx
index 98b08b5a207c..75cf071c1e69 100644
--- a/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx
+++ b/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx
@@ -93,6 +93,18 @@ CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, 
testCheckSpacebarSpace)
 CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TEXT_FORMATTING, 
aIssues[0]->m_eIssueID);
 }
 
+CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testHyperlinks)
+{
+SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "HyperlinkTest.odt");
+CPPUNIT_ASSERT(pDoc);
+sw::AccessibilityCheck aCheck(pDoc);
+aCheck.check();
+auto& aIssues = aCheck.getIssueCollection().getIssues();
+CPPUNIT_ASSERT_EQUAL(size_t(2), aIssues.size());
+CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::HYPERLINK_SHORT, 
aIssues[0]->m_eIssueID);
+CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::HYPERLINK_IS_TEXT, 
aIssues[1]->m_eIssueID);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/core/accessibilitycheck/data/HyperlinkTest.odt 
b/sw/qa/core/accessibilitycheck/data/HyperlinkTest.odt
new file mode 100644
index ..1eba1932ce21
Binary files /dev/null and 
b/sw/qa/core/accessibilitycheck/data/HyperlinkTest.odt differ
diff --git a/sw/source/core/access/AccessibilityCheck.cxx 
b/sw/source/core/access/AccessibilityCheck.cxx
index 9746e17c0794..9195fcfcbd52 100644
--- a/sw/source/core/access/AccessibilityCheck.cxx
+++ b/sw/source/core/access/AccessibilityCheck.cxx
@@ -254,7 +254,8 @@ public:
 class HyperlinkCheck : public NodeCheck
 {
 private:
-void checkTextRange(uno::Reference const& xTextRange)
+void checkTextRange(uno::Reference const& xTextRange, 
SwTextNode* pTextNode,
+sal_Int32 nStart)
 {
 uno::Reference xProperties(xTextRange, 
uno::UNO_QUERY);
 if 
(!xProperties->getPropertySetInfo()->hasPropertyByName("HyperLinkURL"))
@@ -269,7 +270,19 @@ private:
 {
 OUString sIssueText
 = 
SwResId(STR_HYPERLINK_TEXT_IS_LINK).replaceFirst("%LINK%", sHyperlink);
-lclAddIssue(m_rIssueCollection, sIssueText);
+lclAddIssue(m_rIssueCollection, sIssueText,
+sfx::AccessibilityIssueID::HYPERLINK_IS_TEXT);
+}
+else if (sText.getLength() <= 5)
+{
+auto pIssue = lclAddIssue(m_rIssueCollection, 
SwResId(STR_HYPERLINK_TEXT_IS_SHORT),
+  

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

2022-10-15 Thread offtkp (via logerrit)
 include/sfx2/AccessibilityIssue.hxx|1 
 sw/inc/AccessibilityCheckStrings.hrc   |1 
 sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx   |   11 +++
 sw/qa/core/accessibilitycheck/data/BackgroundImageTest.odt |binary
 sw/source/core/access/AccessibilityCheck.cxx   |   42 +
 5 files changed, 55 insertions(+)

New commits:
commit f9eb59a59723275f7057419d2c05393ac2781972
Author: offtkp 
AuthorDate: Tue Oct 11 19:02:39 2022 +0300
Commit: Tomaž Vajngerl 
CommitDate: Sat Oct 15 10:34:28 2022 +0200

a11y: Add check for background image

Add accessibility check and relevant test for a document with a
background image

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

diff --git a/include/sfx2/AccessibilityIssue.hxx 
b/include/sfx2/AccessibilityIssue.hxx
index 4cc9a72e7c19..085863cbd405 100644
--- a/include/sfx2/AccessibilityIssue.hxx
+++ b/include/sfx2/AccessibilityIssue.hxx
@@ -22,6 +22,7 @@ enum class AccessibilityIssueID
 UNSPECIFIED, // TODO: remove - temporary
 DOCUMENT_TITLE,
 DOCUMENT_LANGUAGE,
+DOCUMENT_BACKGROUND,
 STYLE_LANGUAGE,
 NO_ALT_OLE,
 NO_ALT_GRAPHIC,
diff --git a/sw/inc/AccessibilityCheckStrings.hrc 
b/sw/inc/AccessibilityCheckStrings.hrc
index 2c098e50edc8..858de1a47d93 100644
--- a/sw/inc/AccessibilityCheckStrings.hrc
+++ b/sw/inc/AccessibilityCheckStrings.hrc
@@ -21,6 +21,7 @@
 #define STR_TEXT_BLINKING   NC_("STR_TEXT_BLINKING", "Blinking 
text.")
 #define STR_AVOID_FOOTNOTES NC_("STR_AVOID_FOOTNOTES", "Avoid 
footnotes.")
 #define STR_AVOID_ENDNOTES  NC_("STR_AVOID_ENDNOTES", "Avoid 
endnotes.")
+#define STR_AVOID_BACKGROUND_IMAGES NC_("STR_AVOID_BACKGROUND_IMAGES", 
"Avoid background images.")
 #define STR_HEADINGS_NOT_IN_ORDER   NC_("STR_HEADINGS_NOT_IN_ORDER", 
"Headings not in order.")
 #define STR_TEXT_FORMATTING_CONVEYS_MEANING 
NC_("STR_TEXT_FORMATTING_CONVEYS_MEANING", "The text formatting conveys 
additional meaning.")
 #define STR_NON_INTERACTIVE_FORMS   NC_("STR_NON_INTERACTIVE_FORMS", "An 
input form is not interactive.")
diff --git a/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx 
b/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx
index d7ad7674c13b..2c36d2b5d4e7 100644
--- a/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx
+++ b/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx
@@ -59,6 +59,17 @@ CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, 
testCheckParagraphIssues)
 CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::TEXT_FORMATTING, 
aIssues[0]->m_eIssueID);
 }
 
+CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, testCheckBackgroundImage)
+{
+SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "BackgroundImageTest.odt");
+CPPUNIT_ASSERT(pDoc);
+sw::AccessibilityCheck aCheck(pDoc);
+aCheck.check();
+auto& aIssues = aCheck.getIssueCollection().getIssues();
+CPPUNIT_ASSERT_EQUAL(size_t(1), aIssues.size());
+CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::DOCUMENT_BACKGROUND, 
aIssues[0]->m_eIssueID);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/core/accessibilitycheck/data/BackgroundImageTest.odt 
b/sw/qa/core/accessibilitycheck/data/BackgroundImageTest.odt
new file mode 100644
index ..eff6f178394b
Binary files /dev/null and 
b/sw/qa/core/accessibilitycheck/data/BackgroundImageTest.odt differ
diff --git a/sw/source/core/access/AccessibilityCheck.cxx 
b/sw/source/core/access/AccessibilityCheck.cxx
index f6c6ec7b43d5..de0a5bf63472 100644
--- a/sw/source/core/access/AccessibilityCheck.cxx
+++ b/sw/source/core/access/AccessibilityCheck.cxx
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -898,6 +899,46 @@ public:
 }
 };
 
+class BackgroundImageCheck : public DocumentCheck
+{
+public:
+BackgroundImageCheck(sfx::AccessibilityIssueCollection& rIssueCollection)
+: DocumentCheck(rIssueCollection)
+{
+}
+void check(SwDoc* pDoc) override
+{
+uno::Reference xDoc = 
pDoc->GetDocShell()->GetBaseModel();
+uno::Reference 
xStyleFamiliesSupplier(xDoc, uno::UNO_QUERY);
+if (!xStyleFamiliesSupplier.is())
+return;
+uno::Reference xStyleFamilies
+= xStyleFamiliesSupplier->getStyleFamilies();
+uno::Reference 
xStyleFamily(xStyleFamilies->getByName("PageStyles"),
+uno::UNO_QUERY);
+if (!xStyleFamily.is())
+return;
+const uno::Sequence& xStyleFamilyNames = 
xStyleFamily->getElementNames();
+for (const OUString& rStyleFamilyName : xStyleFamilyNames)
+{
+uno::Reference xPropertySet(
+

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

2022-10-13 Thread Mike Kaganski (via logerrit)
 include/sfx2/lokcomponenthelpers.hxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit a09c5c69e3b5fbf448cae1d6c476f39067e40023
Author: Mike Kaganski 
AuthorDate: Fri Oct 14 07:40:28 2022 +0300
Commit: Mike Kaganski 
CommitDate: Fri Oct 14 07:37:27 2022 +0200

This can be const

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

diff --git a/include/sfx2/lokcomponenthelpers.hxx 
b/include/sfx2/lokcomponenthelpers.hxx
index 02e8750ca381..ea81ea8f87c1 100644
--- a/include/sfx2/lokcomponenthelpers.hxx
+++ b/include/sfx2/lokcomponenthelpers.hxx
@@ -66,7 +66,7 @@ public:
 class SFX2_DLLPUBLIC LokStarMathHelper
 {
 public:
-LokStarMathHelper(SfxViewShell* pViewShell)
+LokStarMathHelper(const SfxViewShell* pViewShell)
 : mpViewShell(pViewShell)
 {
 }
@@ -83,7 +83,7 @@ private:
 css::uno::Reference& GetXController();
 tools::Rectangle GetBoundingBox();
 
-SfxViewShell* mpViewShell;
+const SfxViewShell* mpViewShell;
 css::uno::Reference mxController;
 VclPtr mpGraphicWindow;
 VclPtr mpWidgetWindow;


  1   2   3   4   5   6   7   8   9   10   >