[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/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 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 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 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 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/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 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 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 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 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 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 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 sfx2/source

2022-09-23 Thread Caolán McNamara (via logerrit)
 include/sfx2/tabdlg.hxx   |3 +++
 sfx2/source/dialog/tabdlg.cxx |   12 ++--
 2 files changed, 13 insertions(+), 2 deletions(-)

New commits:
commit 03a970babc2df4957051af996d8a426e4d94f17d
Author: Caolán McNamara 
AuthorDate: Fri Sep 23 13:20:48 2022 +0100
Commit: Caolán McNamara 
CommitDate: Fri Sep 23 15:52:33 2022 +0200

rename SfxTabDialogController::ActivatePageHdlHdl contents and make virtual

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

diff --git a/include/sfx2/tabdlg.hxx b/include/sfx2/tabdlg.hxx
index 4c519964e275..fdfffbb8716e 100644
--- a/include/sfx2/tabdlg.hxx
+++ b/include/sfx2/tabdlg.hxx
@@ -94,6 +94,9 @@ protected:
 virtual SfxItemSet* CreateInputItemSet(const OString& rName);
 virtual voidPageCreated(const OString , SfxTabPage 
);
 
+virtual void ActivatePage(const OString& rPage);
+virtual bool DeactivatePage(const OString& rPage);
+
 std::unique_ptr m_xExampleSet;
 SfxItemSet* GetInputSetImpl();
 SfxTabPage* GetTabPage(std::string_view rPageId) const;
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index fb025ac21b6e..1dda5b9f3eb5 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -510,7 +510,11 @@ IMPL_LINK_NOARG(SfxTabDialogController, BaseFmtHdl, 
weld::Button&, void)
 }
 
 IMPL_LINK(SfxTabDialogController, ActivatePageHdl, const OString&, rPage, void)
+{
+ActivatePage(rPage);
+}
 
+void SfxTabDialogController::ActivatePage(const OString& rPage)
 /*  [Description]
 
 Handler that is called by StarView for switching to a different page.
@@ -545,7 +549,11 @@ IMPL_LINK(SfxTabDialogController, ActivatePageHdl, const 
OString&, rPage, void)
 }
 
 IMPL_LINK(SfxTabDialogController, DeactivatePageHdl, const OString&, rPage, 
bool)
+{
+return DeactivatePage(rPage);
+}
 
+bool SfxTabDialogController::DeactivatePage(const OString& rPage)
 /*  [Description]
 
 Handler that is called by StarView before leaving a page.
@@ -997,7 +1005,7 @@ void SfxTabDialogController::Start_Impl()
 m_xTabCtrl->set_current_page(aDlgOpt.GetPageID());
 }
 
-ActivatePageHdl(m_xTabCtrl->get_current_page_ident());
+ActivatePage(m_xTabCtrl->get_current_page_ident());
 
 m_pImpl->bStarted = true;
 }
@@ -1015,7 +1023,7 @@ void SfxTabDialogController::SetCurPageId(const OString& 
rIdent)
 void SfxTabDialogController::ShowPage(const OString& rIdent)
 {
 SetCurPageId(rIdent);
-ActivatePageHdl(rIdent);
+ActivatePage(rIdent);
 }
 
 OString SfxTabDialogController::GetCurPageId() const


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

2022-09-22 Thread Ashod Nakashian (via logerrit)
 include/sfx2/lokhelper.hxx |4 
 sfx2/source/doc/objstor.cxx|   33 +
 sfx2/source/view/lokhelper.cxx |8 
 3 files changed, 45 insertions(+)

New commits:
commit 90e3244aa6c15a42c5c86ebe5b36592085de9c79
Author: Ashod Nakashian 
AuthorDate: Sun May 1 16:52:30 2022 -0400
Commit: Miklos Vajna 
CommitDate: Thu Sep 22 08:29:16 2022 +0200

sw: restore UI language to en while saving

Because the XML writer used in sw invokes the
translation logic, which uses the UI language,
saving can fail in case there are multiple
views with different langauges. This restores
the language used for loading before saving
to avoid such issues.

Signed-off-by: Ashod Nakashian 
Change-Id: I6675204bb68ea33b1395c779a64ab3e9b339d73e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135482
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 
(cherry picked from commit 4b7b449bbdc51557f62131a3b467b34ad39e8547)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140361
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx
index 909b6335733d..1c5a94966776 100644
--- a/include/sfx2/lokhelper.hxx
+++ b/include/sfx2/lokhelper.hxx
@@ -76,6 +76,10 @@ public:
 static void setViewLanguage(int nId, const OUString& rBcp47LanguageTag);
 /// Set the default language for views.
 static void setDefaultLanguage(const OUString& rBcp47LanguageTag);
+/// Get the language used by the loading view (used for all save 
operations).
+static const LanguageTag & getLoadLanguage();
+/// Set the language used by the loading view (used for all save 
operations).
+static void setLoadLanguage(const OUString& rBcp47LanguageTag);
 /// Set the locale for the given view.
 static void setViewLocale(int nId, const OUString& rBcp47LanguageTag);
 /// Get the device form factor that should be used for a new view.
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 275f693a23f9..83d28956ebee 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -92,6 +92,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -103,6 +104,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -3208,6 +3210,37 @@ bool SfxObjectShell::SaveAsOwnFormat( SfxMedium& rMedium 
)
 pImpl->aBasicManager.storeLibrariesToStorage( xStorage );
 }
 #endif
+
+if (comphelper::LibreOfficeKit::isActive())
+{
+// Because XMLTextFieldExport::ExportFieldDeclarations (called 
from SwXMLExport)
+// calls SwXTextFieldMasters::getByName, which in turn maps 
property names by
+// calling SwStyleNameMapper::GetTextUINameArray, which uses
+// SvtSysLocale().GetUILanguageTag() to do the mapping, saving 
indirectly depends
+// on the UI language. This is an unfortunate depenency. Here we 
use the loader's language.
+const LanguageTag viewLanguage = 
comphelper::LibreOfficeKit::getLanguageTag();
+const LanguageTag loadLanguage = SfxLokHelper::getLoadLanguage();
+
+// Use the default language for saving and restore later if 
necessary.
+bool restoreLanguage = false;
+if (viewLanguage != loadLanguage)
+{
+restoreLanguage = true;
+comphelper::LibreOfficeKit::setLanguageTag(loadLanguage);
+}
+
+// Restore the view's original language automatically and as 
necessary.
+const ::comphelper::ScopeGuard aGuard(
+[, restoreLanguage]()
+{
+if (restoreLanguage
+&& viewLanguage != 
comphelper::LibreOfficeKit::getLanguageTag())
+
comphelper::LibreOfficeKit::setLanguageTag(viewLanguage);
+});
+
+return SaveAs(rMedium);
+}
+
 return SaveAs( rMedium );
 }
 else return false;
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index aa38c5dbee98..a082aeff110d 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -73,6 +73,7 @@ int DisableCallbacks::m_nDisabled = 0;
 namespace
 {
 LanguageTag g_defaultLanguageTag("en-US", true);
+LanguageTag g_loadLanguageTag("en-US", true); //< The language used to load.
 LOKDeviceFormFactor g_deviceFormFactor = LOKDeviceFormFactor::UNKNOWN;
 }
 
@@ -279,6 +280,13 @@ void SfxLokHelper::setDefaultLanguage(const OUString& 
rBcp47LanguageTag)
 g_defaultLanguageTag = LanguageTag(rBcp47LanguageTag, true);
 }
 
+const LanguageTag& SfxLokHelper::getLoadLanguage() { return g_loadLanguageTag; 
}
+
+void SfxLokHelper::setLoadLanguage(const OUString& rBcp47LanguageTag)
+{
+g_loadLanguageTag = LanguageTag(rBcp47LanguageTag, true);

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

2022-08-16 Thread Mike Kaganski (via logerrit)
 include/sfx2/sfxbasecontroller.hxx |4 
 include/sfx2/viewsh.hxx|1 +
 sfx2/source/view/sfxbasecontroller.cxx |   12 
 sfx2/source/view/viewsh.cxx|5 +
 starmath/inc/view.hxx  |1 +
 starmath/source/view.cxx   |   21 +
 6 files changed, 44 insertions(+)

New commits:
commit bb6c70f7a9af806347a1e1401a9cce2ad41bc81b
Author: Mike Kaganski 
AuthorDate: Mon Aug 15 14:31:15 2022 +0300
Commit: Mike Kaganski 
CommitDate: Wed Aug 17 07:19:01 2022 +0200

lok: register view callback also for nested sm view

This allows to send context change events that originate in the
embedded views.

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

diff --git a/include/sfx2/sfxbasecontroller.hxx 
b/include/sfx2/sfxbasecontroller.hxx
index ac4950e5a45a..978cd5669d45 100644
--- a/include/sfx2/sfxbasecontroller.hxx
+++ b/include/sfx2/sfxbasecontroller.hxx
@@ -196,6 +196,10 @@ public:
 SAL_DLLPRIVATE bool HasMouseClickListeners_Impl() const;
 SAL_DLLPRIVATE void SetCreationArguments_Impl( const css::uno::Sequence< 
css::beans::PropertyValue >& i_rCreationArgs );
 SAL_DLLPRIVATE css::uno::Reference< css::frame::XTitle > 
impl_getTitleHelper ();
+
+protected:
+void CopyLokViewCallbackFromFrameCreator();
+
 private:
 enum ConnectSfxFrame
 {
diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx
index 3faf7aeb2071..ea431a687b49 100644
--- a/include/sfx2/viewsh.hxx
+++ b/include/sfx2/viewsh.hxx
@@ -342,6 +342,7 @@ public:
 
 /// Set up a more efficient internal callback instead of 
LibreOfficeKitCallback.
 void setLibreOfficeKitViewCallback(SfxLokCallbackInterface* pCallback);
+SfxLokCallbackInterface* getLibreOfficeKitViewCallback() const;
 /// dump view state for diagnostics
 void dumpLibreOfficeKitViewState(rtl::OStringBuffer );
 /// Invokes the registered callback, if there are any.
diff --git a/sfx2/source/view/sfxbasecontroller.cxx 
b/sfx2/source/view/sfxbasecontroller.cxx
index e7c098fcda27..6db3b5570ec1 100644
--- a/sfx2/source/view/sfxbasecontroller.cxx
+++ b/sfx2/source/view/sfxbasecontroller.cxx
@@ -1021,6 +1021,18 @@ void SfxBaseController::ReleaseShell_Impl()
 attachFrame( aXFrame );
 }
 
+void SfxBaseController::CopyLokViewCallbackFromFrameCreator()
+{
+if (!m_pData->m_pViewShell)
+return;
+SfxLokCallbackInterface* pCallback = nullptr;
+if (m_pData->m_xFrame)
+if (auto xCreator = m_pData->m_xFrame->getCreator())
+if (auto parentVS = SfxViewShell::Get(xCreator->getController()))
+pCallback = parentVS->getLibreOfficeKitViewCallback();
+m_pData->m_pViewShell->setLibreOfficeKitViewCallback(pCallback);
+}
+
 SfxViewShell* SfxBaseController::GetViewShell_Impl() const
 {
 return m_pData->m_pViewShell;
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index d1f326c68b7f..bd04697fab89 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -1435,6 +1435,11 @@ void 
SfxViewShell::setLibreOfficeKitViewCallback(SfxLokCallbackInterface* pCallb
 }
 }
 
+SfxLokCallbackInterface* SfxViewShell::getLibreOfficeKitViewCallback() const
+{
+return pImpl->m_pLibreOfficeKitViewCallback;
+}
+
 void SfxViewShell::dumpLibreOfficeKitViewState(rtl::OStringBuffer )
 {
 if (pImpl->m_pLibreOfficeKitViewCallback)
diff --git a/starmath/inc/view.hxx b/starmath/inc/view.hxx
index 45df0f425574..0a18e0084435 100644
--- a/starmath/inc/view.hxx
+++ b/starmath/inc/view.hxx
@@ -289,6 +289,7 @@ class SmViewShell final : public SfxViewShell
 virtual void OuterResizePixel(const Point , const Size  ) 
override;
 virtual void QueryObjAreaPixel( tools::Rectangle& rRect ) const override;
 virtual void SetZoomFactor( const Fraction , const Fraction  ) 
override;
+virtual OString getLOKPayload(int nType, int nViewId, bool* ignore) const 
override;
 
 public:
 
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 39676971a93f..add20227a808 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -32,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -2121,6 +2122,9 @@ public:
 {
 SfxBaseController::attachFrame(xFrame);
 
+if (comphelper::LibreOfficeKit::isActive())
+CopyLokViewCallbackFromFrameCreator();
+
 // No need to call mpSelectionChangeHandler->Connect() unless 
SmController implements XSelectionSupplier
 mpSelectionChangeHandler->selectionChanged({}); // Installs the 
correct context
 }
@@ -2271,4 +2275,21 @@ void SmViewShell::ZoomByItemSet(const SfxItemSet *pSet)
 }
 }
 
+OString SmViewShell::getLOKPayload(int nType, int nViewId, bool* ignore) const
+{
+switch (nType)
+{
+  

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

2022-08-11 Thread Mike Kaganski (via logerrit)
 include/sfx2/lokhelper.hxx   |4 +++-
 sfx2/source/sidebar/ContextChangeBroadcaster.cxx |   13 ++---
 sfx2/source/view/lokhelper.cxx   |   11 ---
 svx/source/sidebar/ContextChangeEventMultiplexer.cxx |3 +--
 4 files changed, 18 insertions(+), 13 deletions(-)

New commits:
commit 0d9d0ca83fc072979ffda84d993055f44793d05d
Author: Mike Kaganski 
AuthorDate: Thu Aug 11 15:08:01 2022 +0300
Commit: Mike Kaganski 
CommitDate: Thu Aug 11 17:28:51 2022 +0200

lok: Simplify context change notification

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

diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx
index 0b18c0fa7b5e..909b6335733d 100644
--- a/include/sfx2/lokhelper.hxx
+++ b/include/sfx2/lokhelper.hxx
@@ -44,6 +44,8 @@ struct SFX2_DLLPUBLIC LokMouseEventData
 
 #include 
 
+namespace com::sun::star::ui { struct ContextChangeEventObject; };
+
 class SFX2_DLLPUBLIC SfxLokHelper
 {
 public:
@@ -115,7 +117,7 @@ public:
 static void notifyAllViews(int nType, const OString& rPayload);
 
 /// Notify about the editing context change.
-static void notifyContextChange(SfxViewShell const* pViewShell, const 
OUString& aApplication, const OUString& aContext);
+static void notifyContextChange(const css::ui::ContextChangeEventObject& 
rEvent);
 
 // Notify about the given type needing an update.
 static void notifyUpdate(SfxViewShell const* pViewShell, int nType);
diff --git a/sfx2/source/sidebar/ContextChangeBroadcaster.cxx 
b/sfx2/source/sidebar/ContextChangeBroadcaster.cxx
index 0350929eedf1..d2d55b700fbc 100644
--- a/sfx2/source/sidebar/ContextChangeBroadcaster.cxx
+++ b/sfx2/source/sidebar/ContextChangeBroadcaster.cxx
@@ -86,18 +86,17 @@ void ContextChangeBroadcaster::BroadcastContextChange (
 return;
 }
 
-// notify the LOK too
-if (comphelper::LibreOfficeKit::isActive())
-{
-if (SfxViewShell* pViewShell = 
SfxViewShell::Get(rxFrame->getController()))
-SfxLokHelper::notifyContextChange(pViewShell, rsModuleName, 
rsContextName);
-}
-
 const css::ui::ContextChangeEventObject aEvent(
 rxFrame->getController(),
 rsModuleName,
 rsContextName);
 
+// notify the LOK too
+if (comphelper::LibreOfficeKit::isActive())
+{
+SfxLokHelper::notifyContextChange(aEvent);
+}
+
 css::uno::Reference xMultiplexer (
 css::ui::ContextChangeEventMultiplexer::get(
 ::comphelper::getProcessComponentContext()));
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index 1d39838bfbf8..aa38c5dbee98 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -14,6 +14,7 @@
 #include 
 
 #include 
+#include 
 
 #include 
 #include 
@@ -608,15 +609,19 @@ void SfxLokHelper::notifyAllViews(int nType, const 
OString& rPayload)
 }
 }
 
-void SfxLokHelper::notifyContextChange(SfxViewShell const* pViewShell, const 
OUString& aApplication, const OUString& aContext)
+void SfxLokHelper::notifyContextChange(const 
css::ui::ContextChangeEventObject& rEvent)
 {
 if (DisableCallbacks::disabled())
 return;
 
+SfxViewShell* pViewShell = SfxViewShell::Get({ rEvent.Source, 
css::uno::UNO_QUERY });
+if (!pViewShell)
+return;
+
 OString aBuffer =
-OUStringToOString(aApplication.replace(' ', '_'), 
RTL_TEXTENCODING_UTF8) +
+OUStringToOString(rEvent.ApplicationName.replace(' ', '_'), 
RTL_TEXTENCODING_UTF8) +
 " " +
-OUStringToOString(aContext.replace(' ', '_'), RTL_TEXTENCODING_UTF8);
+OUStringToOString(rEvent.ContextName.replace(' ', '_'), 
RTL_TEXTENCODING_UTF8);
 pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CONTEXT_CHANGED, 
aBuffer.getStr());
 }
 
diff --git a/svx/source/sidebar/ContextChangeEventMultiplexer.cxx 
b/svx/source/sidebar/ContextChangeEventMultiplexer.cxx
index ce552b0ac837..dd44e706aeec 100644
--- a/svx/source/sidebar/ContextChangeEventMultiplexer.cxx
+++ b/svx/source/sidebar/ContextChangeEventMultiplexer.cxx
@@ -53,8 +53,7 @@ void ContextChangeEventMultiplexer::NotifyContextChange (
 // notify the LOK too after all the change have taken effect.
 if (comphelper::LibreOfficeKit::isActive())
 {
-if (SfxViewShell* pViewShell = SfxViewShell::Get(rxController))
-SfxLokHelper::notifyContextChange(pViewShell, 
GetModuleName(rxController->getFrame()), 
vcl::EnumContext::GetContextName(eContext));
+SfxLokHelper::notifyContextChange(aEvent);
 }
 }
 


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

2022-07-26 Thread Caolán McNamara (via logerrit)
 include/sfx2/viewfrm.hxx |1 +
 sfx2/source/view/viewfrm.cxx |   13 +
 2 files changed, 14 insertions(+)

New commits:
commit 61e4f8503c89e0933b294304320e371804b077c9
Author: Caolán McNamara 
AuthorDate: Mon Jul 25 15:48:37 2022 +0100
Commit: Caolán McNamara 
CommitDate: Tue Jul 26 10:02:21 2022 +0200

Resolves: tdf#149127 explain the infobar asking to refresh master password

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

diff --git a/include/sfx2/viewfrm.hxx b/include/sfx2/viewfrm.hxx
index 24d1c35dbe90..a7bb8bd7844c 100644
--- a/include/sfx2/viewfrm.hxx
+++ b/include/sfx2/viewfrm.hxx
@@ -69,6 +69,7 @@ class SFX2_DLLPUBLIC SfxViewFrame final : public SfxShell, 
public SfxListener
 DECL_DLLPRIVATE_LINK(HiddenTrackChangesHandler, weld::Button&, void);
 DECL_DLLPRIVATE_LINK(HyphenationMissingHandler, weld::Button&, void);
 DECL_DLLPRIVATE_LINK(RefreshMasterPasswordHdl, weld::Button&, void);
+DECL_DLLPRIVATE_STATIC_LINK(SfxViewFrame, HelpMasterPasswordHdl, 
weld::Button&, void);
 SAL_DLLPRIVATE void KillDispatcher_Impl();
 
 virtual ~SfxViewFrame() override;
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index da5477928f51..de3c32c50141 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -46,6 +46,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1468,6 +1469,12 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, 
const SfxHint& rHint )
 rButton.set_label(SfxResId(STR_REFRESH_PASSWORD));
 rButton.connect_clicked(LINK(this,
SfxViewFrame, 
RefreshMasterPasswordHdl));
+if (Application::GetHelp())
+{
+weld::Button& rHelp = 
pOldMasterPasswordInfoBar->addButton();
+rHelp.set_label(SfxResId(RID_STR_HELP));
+rHelp.connect_clicked(LINK(this, SfxViewFrame, 
HelpMasterPasswordHdl));
+}
 }
 }
 
@@ -1718,6 +1725,12 @@ IMPL_LINK_NOARG(SfxViewFrame, RefreshMasterPasswordHdl, 
weld::Button&, void)
 RemoveInfoBar(u"oldmasterpassword");
 }
 
+IMPL_STATIC_LINK_NOARG(SfxViewFrame, HelpMasterPasswordHdl, weld::Button&, 
void)
+{
+if (Help* pHelp = Application::GetHelp())
+pHelp->Start("cui/ui/optsecuritypage/savepassword");
+}
+
 void SfxViewFrame::Construct_Impl( SfxObjectShell *pObjSh )
 {
 m_pImpl->bResizeInToOut = true;


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

2022-07-04 Thread Henry Castro (via logerrit)
 include/sfx2/frame.hxx  |4 ++--
 sfx2/source/view/frame.cxx  |2 +-
 sfx2/source/view/frame2.cxx |6 +++---
 3 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit d22d86e266826543e9e7ca406bedcddae04074cb
Author: Henry Castro 
AuthorDate: Fri Jul 1 12:07:23 2022 -0400
Commit: Henry Castro 
CommitDate: Mon Jul 4 14:29:02 2022 +0200

sfx2: replace pWindow m_pWindow

SfxFrame class members

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

diff --git a/include/sfx2/frame.hxx b/include/sfx2/frame.hxx
index 7956fdd36d57..b9004bdb8b36 100644
--- a/include/sfx2/frame.hxx
+++ b/include/sfx2/frame.hxx
@@ -70,7 +70,7 @@ class SFX2_DLLPUBLIC SfxFrame final : public 
SvCompatWeakBase
 
 private:
 std::unique_ptr< SfxFrame_Impl > m_pImpl;
-VclPtr pWindow;
+VclPtr m_pWindow;
 
 virtual ~SfxFrame();
 
@@ -82,7 +82,7 @@ public:
 CreateBlankFrame();
 static SfxFrame*CreateHidden( SfxObjectShell const & rDoc, 
vcl::Window& rWindow, SfxInterfaceId nViewId );
 
-vcl::Window&GetWindow() const { return *pWindow;}
+vcl::Window&GetWindow() const { return *m_pWindow;}
 voidCancelTransfers();
 boolDoClose();
 
diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx
index 0abc76bc3271..ee9ed9a4bd3e 100644
--- a/sfx2/source/view/frame.cxx
+++ b/sfx2/source/view/frame.cxx
@@ -73,7 +73,7 @@ void SfxFrame::Construct_Impl()
 SfxFrame::~SfxFrame()
 {
 RemoveTopFrame_Impl( this );
-pWindow.disposeAndClear();
+m_pWindow.disposeAndClear();
 
 auto it = std::find( gaFramesArr_Impl.begin(), gaFramesArr_Impl.end(), 
this );
 if ( it != gaFramesArr_Impl.end() )
diff --git a/sfx2/source/view/frame2.cxx b/sfx2/source/view/frame2.cxx
index 01b29366ad1b..015414e3ad3e 100644
--- a/sfx2/source/view/frame2.cxx
+++ b/sfx2/source/view/frame2.cxx
@@ -290,7 +290,7 @@ SfxFrame* SfxFrame::Create( const Reference < XFrame >& 
i_rFrame )
 
 SfxFrame::SfxFrame( vcl::Window& i_rContainerWindow )
 :SvCompatWeakBase( this )
-,pWindow( nullptr )
+,m_pWindow( nullptr )
 {
 Construct_Impl();
 
@@ -298,13 +298,13 @@ SfxFrame::SfxFrame( vcl::Window& i_rContainerWindow )
 InsertTopFrame_Impl( this );
 m_pImpl->pExternalContainerWindow = _rContainerWindow;
 
-pWindow = VclPtr::Create( this, i_rContainerWindow );
+m_pWindow = VclPtr::Create( this, i_rContainerWindow 
);
 
 // always show pWindow, which is the ComponentWindow of the XFrame we live 
in
 // nowadays, since SfxFrames can be created with an XFrame only, hiding or 
showing the complete XFrame
 // is not done at level of the container window, not at SFX level. Thus, 
the component window can
 // always be visible.
-pWindow->Show();
+m_pWindow->Show();
 }
 
 void SfxFrame::SetPresentationMode( bool bSet )


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

2022-06-30 Thread Henry Castro (via logerrit)
 include/sfx2/frame.hxx  |2 
 sfx2/source/view/frame.cxx  |  110 ++--
 sfx2/source/view/frame2.cxx |   26 +-
 3 files changed, 69 insertions(+), 69 deletions(-)

New commits:
commit 965cb44506c3ff182203d49d06b96beb6194f707
Author: Henry Castro 
AuthorDate: Thu Jun 30 15:45:06 2022 -0400
Commit: Henry Castro 
CommitDate: Thu Jun 30 23:38:52 2022 +0200

sfx2: replace pImpl -> m_pImpl

Class SfxFrame

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

diff --git a/include/sfx2/frame.hxx b/include/sfx2/frame.hxx
index 86b5baaa756c..7956fdd36d57 100644
--- a/include/sfx2/frame.hxx
+++ b/include/sfx2/frame.hxx
@@ -69,7 +69,7 @@ class SFX2_DLLPUBLIC SfxFrame final : public 
SvCompatWeakBase
 friend class SfxFrameWindow_Impl;
 
 private:
-std::unique_ptr< SfxFrame_Impl > pImpl;
+std::unique_ptr< SfxFrame_Impl > m_pImpl;
 VclPtr pWindow;
 
 virtual ~SfxFrame();
diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx
index 8e577221c58f..0abc76bc3271 100644
--- a/sfx2/source/view/frame.cxx
+++ b/sfx2/source/view/frame.cxx
@@ -65,7 +65,7 @@ SfxPoolItem* SfxUnoFrameItem::CreateDefault()
 }
 void SfxFrame::Construct_Impl()
 {
-pImpl.reset(new SfxFrame_Impl);
+m_pImpl.reset(new SfxFrame_Impl);
 gaFramesArr_Impl.push_back( this );
 }
 
@@ -79,28 +79,28 @@ SfxFrame::~SfxFrame()
 if ( it != gaFramesArr_Impl.end() )
 gaFramesArr_Impl.erase( it );
 
-delete pImpl->pDescr;
+delete m_pImpl->pDescr;
 }
 
 bool SfxFrame::DoClose()
 {
 // Actually, one more PrepareClose is still needed!
 bool bRet = false;
-if ( !pImpl->bClosing )
+if ( !m_pImpl->bClosing )
 {
-pImpl->bClosing = true;
+m_pImpl->bClosing = true;
 CancelTransfers();
 
 // now close frame; it will be deleted if this call is successful, so 
don't use any members after that!
 bRet = true;
 try
 {
-Reference< XCloseable > xCloseable  ( pImpl->xFrame, UNO_QUERY );
+Reference< XCloseable > xCloseable  ( m_pImpl->xFrame, UNO_QUERY );
 if (xCloseable.is())
 xCloseable->close(true);
-else if ( pImpl->xFrame.is() )
+else if ( m_pImpl->xFrame.is() )
 {
-Reference < XFrame > xFrame = pImpl->xFrame;
+Reference < XFrame > xFrame = m_pImpl->xFrame;
 xFrame->setComponent( Reference < css::awt::XWindow >(), 
Reference < XController >() );
 xFrame->dispose();
 }
@@ -109,7 +109,7 @@ bool SfxFrame::DoClose()
 }
 catch( css::util::CloseVetoException& )
 {
-pImpl->bClosing = false;
+m_pImpl->bClosing = false;
 bRet = false;
 }
 catch( css::lang::DisposedException& )
@@ -123,17 +123,17 @@ bool SfxFrame::DoClose()
 void SfxFrame::DoClose_Impl()
 {
 SfxBindings* pBindings = nullptr;
-if ( pImpl->pCurrentViewFrame )
-pBindings = >pCurrentViewFrame->GetBindings();
+if ( m_pImpl->pCurrentViewFrame )
+pBindings = _pImpl->pCurrentViewFrame->GetBindings();
 
 // For internal tasks Controllers and Tools must be cleared
-if ( pImpl->pWorkWin )
-pImpl->pWorkWin->DeleteControllers_Impl();
+if ( m_pImpl->pWorkWin )
+m_pImpl->pWorkWin->DeleteControllers_Impl();
 
-if ( pImpl->pCurrentViewFrame )
-pImpl->pCurrentViewFrame->Close();
+if ( m_pImpl->pCurrentViewFrame )
+m_pImpl->pCurrentViewFrame->Close();
 
-if ( pImpl->bOwnsBindings )
+if ( m_pImpl->bOwnsBindings )
 {
 delete pBindings;
 pBindings = nullptr;
@@ -144,8 +144,8 @@ void SfxFrame::DoClose_Impl()
 
 bool SfxFrame::DocIsModified_Impl()
 {
-return pImpl->pCurrentViewFrame && 
pImpl->pCurrentViewFrame->GetObjectShell() &&
-pImpl->pCurrentViewFrame->GetObjectShell()->IsModified();
+return m_pImpl->pCurrentViewFrame && 
m_pImpl->pCurrentViewFrame->GetObjectShell() &&
+m_pImpl->pCurrentViewFrame->GetObjectShell()->IsModified();
 }
 
 bool SfxFrame::PrepareClose_Impl( bool bUI )
@@ -153,9 +153,9 @@ bool SfxFrame::PrepareClose_Impl( bool bUI )
 bool bRet = true;
 
 // prevent recursive calls
-if( !pImpl->bPrepClosing )
+if( !m_pImpl->bPrepClosing )
 {
-pImpl->bPrepClosing = true;
+m_pImpl->bPrepClosing = true;
 
 SfxObjectShell* pCur = GetCurrentDocument() ;
 if( pCur )
@@ -179,12 +179,12 @@ bool SfxFrame::PrepareClose_Impl( bool bUI )
 bRet = pCur->PrepareClose( bUI );
 }
 
-pImpl->bPrepClosing = false;
+m_pImpl->bPrepClosing = false;
 }
 
-if ( bRet && pImpl->pWorkWin )
+if ( bRet && m_pImpl->pWorkWin )
 

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

2022-05-21 Thread Jim Raykowski (via logerrit)
 include/sfx2/sidebar/TabBar.hxx |2 +-
 sfx2/source/sidebar/TabBar.cxx  |7 ++-
 2 files changed, 7 insertions(+), 2 deletions(-)

New commits:
commit bb1d48498c9fdedf8e78344765f6c6eda6f4707c
Author: Jim Raykowski 
AuthorDate: Wed May 18 22:22:06 2022 -0800
Commit: Jim Raykowski 
CommitDate: Sun May 22 03:13:20 2022 +0200

tdf#84502 related: Show keyboard shortcut in sidebar tab bar tab button

tooltip

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

diff --git a/include/sfx2/sidebar/TabBar.hxx b/include/sfx2/sidebar/TabBar.hxx
index d788f9f01c1b..5cc092c239de 100644
--- a/include/sfx2/sidebar/TabBar.hxx
+++ b/include/sfx2/sidebar/TabBar.hxx
@@ -119,7 +119,7 @@ private:
 const ::std::function 
maDeckActivationFunctor;
 PopupMenuProvider maPopupMenuProvider;
 
-static void CreateTabItem(weld::Toolbar& rButton, const DeckDescriptor& 
rDeckDescriptor);
+void CreateTabItem(weld::Toolbar& rButton, const DeckDescriptor& 
rDeckDescriptor);
 css::uno::Reference GetItemImage(const 
DeckDescriptor& rDeskDescriptor) const;
 void UpdateButtonIcons();
 
diff --git a/sfx2/source/sidebar/TabBar.cxx b/sfx2/source/sidebar/TabBar.cxx
index d874a3191300..59649ec152d3 100644
--- a/sfx2/source/sidebar/TabBar.cxx
+++ b/sfx2/source/sidebar/TabBar.cxx
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -226,7 +227,11 @@ void TabBar::CreateTabItem(weld::Toolbar& rItem, const 
DeckDescriptor& rDeckDesc
 rItem.set_accessible_name(rDeckDescriptor.msTitle);
 rItem.set_accessible_description(rDeckDescriptor.msHelpText);
 rItem.set_tooltip_text(rDeckDescriptor.msHelpText);
-rItem.set_item_tooltip_text("toggle", rDeckDescriptor.msHelpText);
+const OUString sCommand = ".uno:SidebarDeck." + rDeckDescriptor.msId;
+OUString sShortcut = 
vcl::CommandInfoProvider::GetCommandShortcut(sCommand, mxFrame);
+if (!sShortcut.isEmpty())
+sShortcut = u" (" + sShortcut + u")";
+rItem.set_item_tooltip_text("toggle", rDeckDescriptor.msHelpText + 
sShortcut);
 }
 
 css::uno::Reference TabBar::GetItemImage(const 
DeckDescriptor& rDeckDescriptor) const


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

2022-05-19 Thread Tomaž Vajngerl (via logerrit)
 include/sfx2/devtools/ObjectInspectorTreeHandler.hxx |8 
 sfx2/source/devtools/ObjectInspectorTreeHandler.cxx  |   31 ++-
 2 files changed, 38 insertions(+), 1 deletion(-)

New commits:
commit 66d8951df3c11ead0b9415eb292c3ae88689edf1
Author: Tomaž Vajngerl 
AuthorDate: Thu May 19 00:33:37 2022 +0900
Commit: Tomaž Vajngerl 
CommitDate: Fri May 20 06:19:16 2022 +0200

sfx2: use natural string sort for sorting in object inspector

Use a natural string sort for all strings in the object inspector
tree view. This is more useful for properties as those can have
indices, which are shown as numbers, so having them in natural
order makes the tree view easier to digest.

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

diff --git a/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx 
b/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
index 03188276a4b4..b6fa678de366 100644
--- a/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
+++ b/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
@@ -12,6 +12,7 @@
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -40,6 +41,13 @@ private:
 // just the current context
 css::uno::Reference mxContext;
 
+// treeview sort and compare
+comphelper::string::NaturalStringSorter mxSorter;
+void setSortFunction(std::unique_ptr& pTreeView);
+sal_Int32 compare(std::unique_ptr& pTreeView, const 
weld::TreeIter& rLeft,
+  const weld::TreeIter& rRight);
+
+// treeview manipulation
 static void clearObjectInspectorChildren(std::unique_ptr& 
pTreeView,
  weld::TreeIter const& rParent);
 static void handleExpanding(std::unique_ptr& pTreeView,
diff --git a/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx 
b/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx
index 79b69d612b79..18c4206e0730 100644
--- a/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx
+++ b/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx
@@ -44,6 +44,9 @@
 #include 
 #include 
 
+#include 
+#include 
+
 using namespace css;
 
 namespace
@@ -928,6 +931,7 @@ ObjectInspectorTreeHandler::ObjectInspectorTreeHandler(
 std::unique_ptr& pObjectInspectorWidgets)
 : mpObjectInspectorWidgets(pObjectInspectorWidgets)
 , mxContext(comphelper::getProcessComponentContext())
+, mxSorter(mxContext, 
Application::GetSettings().GetLanguageTag().getLocale())
 {
 mpObjectInspectorWidgets->mpInterfacesTreeView->connect_expanding(
 LINK(this, ObjectInspectorTreeHandler, ExpandingHandlerInterfaces));
@@ -955,6 +959,11 @@ ObjectInspectorTreeHandler::ObjectInspectorTreeHandler(
 mpObjectInspectorWidgets->mpPropertiesTreeView->make_sorted();
 mpObjectInspectorWidgets->mpMethodsTreeView->make_sorted();
 
+setSortFunction(mpObjectInspectorWidgets->mpInterfacesTreeView);
+setSortFunction(mpObjectInspectorWidgets->mpServicesTreeView);
+setSortFunction(mpObjectInspectorWidgets->mpPropertiesTreeView);
+setSortFunction(mpObjectInspectorWidgets->mpMethodsTreeView);
+
 mpObjectInspectorWidgets->mpInterfacesTreeView->connect_column_clicked(
 LINK(this, ObjectInspectorTreeHandler, HeaderBarClick));
 mpObjectInspectorWidgets->mpServicesTreeView->connect_column_clicked(
@@ -987,7 +996,27 @@ ObjectInspectorTreeHandler::ObjectInspectorTreeHandler(
  static_cast(nMethodsDigitWidth * 50) 
};
 
mpObjectInspectorWidgets->mpMethodsTreeView->set_column_fixed_widths(aMethodsWidths);
 
-pObjectInspectorWidgets->mpPaned->set_position(160);
+mpObjectInspectorWidgets->mpPaned->set_position(160);
+}
+
+void 
ObjectInspectorTreeHandler::setSortFunction(std::unique_ptr& 
pTreeView)
+{
+pTreeView->set_sort_func(
+[this, ](const weld::TreeIter& rLeft, const weld::TreeIter& 
rRight) {
+return compare(pTreeView, rLeft, rRight);
+});
+}
+
+sal_Int32 ObjectInspectorTreeHandler::compare(std::unique_ptr& 
pTreeView,
+  const weld::TreeIter& rLeft,
+  const weld::TreeIter& rRight)
+{
+int nSortColumn = pTreeView->get_sort_column();
+
+OUString sLeft = pTreeView->get_text(rLeft, nSortColumn);
+OUString sRight = pTreeView->get_text(rRight, nSortColumn);
+sal_Int32 nCompare = mxSorter.compare(sLeft, sRight);
+return nCompare;
 }
 
 void 
ObjectInspectorTreeHandler::handleExpanding(std::unique_ptr& 
pTreeView,


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

2022-05-19 Thread Caolán McNamara (via logerrit)
 include/sfx2/passwd.hxx   |6 ++
 sfx2/source/dialog/passwd.cxx |   12 
 sfx2/uiconfig/ui/password.ui  |   19 +++
 3 files changed, 33 insertions(+), 4 deletions(-)

New commits:
commit 48ecbe9f7b9e324e9acc544c9ad4121d30a232d7
Author: Caolán McNamara 
AuthorDate: Wed May 18 11:41:53 2022 +0100
Commit: Caolán McNamara 
CommitDate: Thu May 19 09:51:51 2022 +0200

tdf#50400 show an explanatory label if ascii-only password is required

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

diff --git a/include/sfx2/passwd.hxx b/include/sfx2/passwd.hxx
index cbbbf7a4a33d..3302c370b3b2 100644
--- a/include/sfx2/passwd.hxx
+++ b/include/sfx2/passwd.hxx
@@ -60,6 +60,7 @@ private:
 std::unique_ptr m_xConfirm2ED;
 
 std::unique_ptr m_xMinLengthFT;
+std::unique_ptr m_xOnlyAsciiFT;
 
 std::unique_ptr m_xOKBtn;
 
@@ -117,11 +118,8 @@ public:
 {
 mnExtras = nExtras;
 }
-void AllowAsciiOnly()
-{
-mbAsciiOnly = true;
-}
 
+void AllowAsciiOnly();
 void ShowMinLengthText(bool bShow);
 
 virtual short run() override;
diff --git a/sfx2/source/dialog/passwd.cxx b/sfx2/source/dialog/passwd.cxx
index da4dd80f0e6c..13822c4a94d4 100644
--- a/sfx2/source/dialog/passwd.cxx
+++ b/sfx2/source/dialog/passwd.cxx
@@ -56,7 +56,12 @@ IMPL_LINK(SfxPasswordDialog, InsertTextHdl, OUString&, 
rTest, bool)
 }
 
 if (bReset)
+{
 rTest = aFilter.makeStringAndClear();
+// upgrade from "Normal" to "Warning" if a invalid letter was
+// discarded
+m_xOnlyAsciiFT->set_label_type(weld::LabelType::Warning);
+}
 
 return true;
 }
@@ -97,6 +102,7 @@ SfxPasswordDialog::SfxPasswordDialog(weld::Widget* pParent, 
const OUString* pGro
 , m_xConfirm2FT(m_xBuilder->weld_label("confirm2ft"))
 , m_xConfirm2ED(m_xBuilder->weld_entry("confirm2ed"))
 , m_xMinLengthFT(m_xBuilder->weld_label("minlenft"))
+, m_xOnlyAsciiFT(m_xBuilder->weld_label("onlyascii"))
 , m_xOKBtn(m_xBuilder->weld_button("ok"))
 , maMinLenPwdStr(SfxResId(STR_PASSWD_MIN_LEN))
 , maMinLenPwdStr1(SfxResId(STR_PASSWD_MIN_LEN1))
@@ -153,6 +159,12 @@ void SfxPasswordDialog::ShowMinLengthText(bool bShow)
 m_xMinLengthFT->set_visible(bShow);
 }
 
+void SfxPasswordDialog::AllowAsciiOnly()
+{
+mbAsciiOnly = true;
+m_xOnlyAsciiFT->show();
+}
+
 short SfxPasswordDialog::run()
 {
 m_xUserFT->hide();
diff --git a/sfx2/uiconfig/ui/password.ui b/sfx2/uiconfig/ui/password.ui
index 4cc57090042b..ff7cfe9f1006 100644
--- a/sfx2/uiconfig/ui/password.ui
+++ b/sfx2/uiconfig/ui/password.ui
@@ -330,6 +330,25 @@
 2
   
 
+
+  
+False
+True
+6
+Only Basic Latin characters can be 
entered
+0
+
+  
+static
+  
+
+  
+  
+False
+True
+3
+  
+
   
   
 False


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

2022-05-01 Thread Szymon Kłos (via logerrit)
 include/sfx2/notebookbar/SfxNotebookBar.hxx |3 +++
 sfx2/source/notebookbar/SfxNotebookBar.cxx  |   27 ++-
 2 files changed, 29 insertions(+), 1 deletion(-)

New commits:
commit 22887ce7b1ea890e06f4b64bafc97686f30ec129
Author: Szymon Kłos 
AuthorDate: Tue Feb 22 13:03:24 2022 +0100
Commit: Szymon Kłos 
CommitDate: Sun May 1 20:19:23 2022 +0200

lok: reset ui mode state when switch to notebookbar cancelled

We have to keep state in the register in sync with the view.
When we cancelled notebookbar usage we need to revert Default state
so next time we will be able to activate notebookbar.

Change-Id: Ie5f7d0160c9c22c6621aca73b2cdd7197f86ff78
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133325
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133654
Tested-by: Jenkins

diff --git a/include/sfx2/notebookbar/SfxNotebookBar.hxx 
b/include/sfx2/notebookbar/SfxNotebookBar.hxx
index cbf7f92d3b9b..66286b87cdb9 100644
--- a/include/sfx2/notebookbar/SfxNotebookBar.hxx
+++ b/include/sfx2/notebookbar/SfxNotebookBar.hxx
@@ -13,6 +13,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -76,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 3f7bb9863314..58647afe2645 100644
--- a/sfx2/source/notebookbar/SfxNotebookBar.cxx
+++ b/sfx2/source/notebookbar/SfxNotebookBar.cxx
@@ -288,6 +288,26 @@ bool SfxNotebookBar::IsActive()
 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", makeAny( OUString( "Default" ) ) );
+aAppNode.commit();
+}
+
 void SfxNotebookBar::ExecMethod(SfxBindings& rBindings, const OUString& 
rUIName)
 {
 // Save active UI file name
@@ -333,9 +353,13 @@ bool SfxNotebookBar::StateMethod(SystemWindow* pSysWindow,
 const Reference xModuleManager  = 
frame::ModuleManager::create( xContext );
 OUString aModuleName = xModuleManager->identify( xFrame );
 vcl::EnumContext::Application eApp = 
vcl::EnumContext::GetApplicationEnum( aModuleName );
-OUString sFile = lcl_getNotebookbarFileName( eApp );
+
+OUString sFile;
 if (comphelper::LibreOfficeKit::isActive())
 sFile = "notebookbar_online.ui";
+else
+sFile = lcl_getNotebookbarFileName( eApp );
+
 OUString sNewFile = rUIFile + sFile;
 OUString sCurrentFile;
 VclPtr pNotebookBar = pSysWindow->GetNotebookBar();
@@ -357,6 +381,7 @@ bool SfxNotebookBar::StateMethod(SystemWindow* pSysWindow,
 && bSkippedFirstInit.find(pViewShell) == 
bSkippedFirstInit.end())
 {
 bSkippedFirstInit[pViewShell] = true;
+ResetActiveToolbarModeToDefault(eApp);
 return false;
 }
 


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

2022-04-13 Thread Noel Grandin (via logerrit)
 include/sfx2/childwin.hxx  |2 +-
 include/sfx2/sfxhtml.hxx   |2 +-
 sfx2/source/appl/childwin.cxx  |8 
 sfx2/source/bastyp/sfxhtml.cxx |6 +++---
 sfx2/source/view/frmload.cxx   |   21 +++--
 5 files changed, 20 insertions(+), 19 deletions(-)

New commits:
commit 1aced94715b73cc0de2ab91963a4f2a2102d845a
Author: Noel Grandin 
AuthorDate: Wed Apr 13 14:33:56 2022 +0200
Commit: Noel Grandin 
CommitDate: Wed Apr 13 19:02:00 2022 +0200

use more string_view in sfx2

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

diff --git a/include/sfx2/childwin.hxx b/include/sfx2/childwin.hxx
index ccfb32235e77..68ad6ff509f9 100644
--- a/include/sfx2/childwin.hxx
+++ b/include/sfx2/childwin.hxx
@@ -228,7 +228,7 @@ const int nCloseResponseToJustHide = -42;
 
 bool GetPosSizeFromString( std::u16string_view rStr, Point& rPos, Size& rSize 
);
 
-bool GetSplitSizeFromString( const OUString& rStr, Size& rSize );
+bool GetSplitSizeFromString( std::u16string_view rStr, Size& rSize );
 
 #endif
 
diff --git a/include/sfx2/sfxhtml.hxx b/include/sfx2/sfxhtml.hxx
index ff7ee4bfb96e..af22df207b83 100644
--- a/include/sfx2/sfxhtml.hxx
+++ b/include/sfx2/sfxhtml.hxx
@@ -68,7 +68,7 @@ public:
 // 
 static double GetTableDataOptionsValNum( sal_uInt32& nNumForm,
 LanguageType& eNumLang, const OUString& aValStr,
-const OUString& aNumStr, SvNumberFormatter& rFormatter );
+std::u16string_view aNumStr, SvNumberFormatter& rFormatter );
 
 protected:
 // Start a file download. This is done asynchronously or synchronously.
diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx
index 5cc448b2ccc3..a3c3a6ae1f73 100644
--- a/sfx2/source/appl/childwin.cxx
+++ b/sfx2/source/appl/childwin.cxx
@@ -121,12 +121,12 @@ bool GetPosSizeFromString( std::u16string_view rStr, 
Point& rPos, Size& rSize )
 return rSize.Width() >= 0 && rSize.Height() >= 0;
 }
 
-bool GetSplitSizeFromString( const OUString& rStr, Size& rSize )
+bool GetSplitSizeFromString( std::u16string_view rStr, Size& rSize )
 {
-sal_Int32 nIndex = rStr.indexOf( ',' );
-if ( nIndex != -1 )
+size_t nIndex = rStr.find( ',' );
+if ( nIndex != std::u16string_view::npos )
 {
-OUString aStr = rStr.copy( nIndex+1 );
+std::u16string_view aStr = rStr.substr( nIndex+1 );
 
 sal_Int32 nCount = comphelper::string::getTokenCount(aStr, ';');
 if ( nCount != 2 )
diff --git a/sfx2/source/bastyp/sfxhtml.cxx b/sfx2/source/bastyp/sfxhtml.cxx
index 9116ae8efa32..efaab39ff881 100644
--- a/sfx2/source/bastyp/sfxhtml.cxx
+++ b/sfx2/source/bastyp/sfxhtml.cxx
@@ -314,10 +314,10 @@ const OUString& SfxHTMLParser::GetScriptTypeString(
 }
 
 double SfxHTMLParser::GetTableDataOptionsValNum( sal_uInt32& nNumForm,
-LanguageType& eNumLang, const OUString& aValStr, const OUString& 
aNumStr,
+LanguageType& eNumLang, const OUString& aValStr, std::u16string_view 
aNumStr,
 SvNumberFormatter& rFormatter )
 {
-LanguageType eParseLang(aNumStr.toInt32());
+LanguageType eParseLang(o3tl::toInt32(aNumStr));
 sal_uInt32 nParseForm = rFormatter.GetFormatForLanguageIfBuiltIn( 0, 
eParseLang );
 double fVal;
 (void)rFormatter.IsNumberFormat(aValStr, nParseForm, fVal);
@@ -325,7 +325,7 @@ double SfxHTMLParser::GetTableDataOptionsValNum( 
sal_uInt32& nNumForm,
 {
 sal_Int32 nIdx {0};
 eNumLang = LanguageType(o3tl::toInt32(o3tl::getToken(aNumStr, 1, ';', 
nIdx )));
-OUString aFormat( aNumStr.copy( nIdx ) );
+OUString aFormat( aNumStr.substr( nIdx ) );
 sal_Int32 nCheckPos;
 SvNumFormatType nType;
 if ( eNumLang != LANGUAGE_SYSTEM )
diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx
index bd0329fb2ac3..f45124849241 100644
--- a/sfx2/source/view/frmload.cxx
+++ b/sfx2/source/view/frmload.cxx
@@ -62,6 +62,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace com::sun::star;
 using ::com::sun::star::beans::PropertyValue;
@@ -141,7 +142,7 @@ private:
 ) const;
 
 static sal_uInt16   impl_findSlotParam(
-const OUString& i_rFactoryURL
+std::u16string_view i_rFactoryURL
 );
 
 static SfxObjectShellRef   impl_findObjectShell(
@@ -444,20 +445,20 @@ bool SfxFrameLoader_Impl::impl_determineTemplateDocument( 
::comphelper::NamedVal
 }
 
 
-sal_uInt16 SfxFrameLoader_Impl::impl_findSlotParam( const OUString& 
i_rFactoryURL )
+sal_uInt16 SfxFrameLoader_Impl::impl_findSlotParam( std::u16string_view 
i_rFactoryURL )
 {
-OUString sSlotParam;
-const sal_Int32 nParamPos = i_rFactoryURL.indexOf( '?' );
-if ( nParamPos >= 0 )
+std::u16string_view sSlotParam;
+const size_t nParamPos = 

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

2022-03-30 Thread Caolán McNamara (via logerrit)
 include/sfx2/strings.hrc |2 ++
 include/sfx2/viewfrm.hxx |1 +
 sfx2/source/view/viewfrm.cxx |   37 +
 3 files changed, 40 insertions(+)

New commits:
commit bbd196ff82bda9f66b4ba32a412f10cefe6da60e
Author: Caolán McNamara 
AuthorDate: Wed Mar 23 13:03:30 2022 +
Commit: Caolán McNamara 
CommitDate: Wed Mar 30 12:25:22 2022 +0200

add infobar to prompt to refresh to replace old format

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

diff --git a/include/sfx2/strings.hrc b/include/sfx2/strings.hrc
index a55424982dda..d880fed4e0e3 100644
--- a/include/sfx2/strings.hrc
+++ b/include/sfx2/strings.hrc
@@ -290,6 +290,8 @@
 #define STR_TRACK_CHANGES_BUTTON
NC_("STR_TRACK_CHANGES_BUTTON", "Show Toolbar")
 #define STR_TRACK_CHANGES_BUTTON_HIDE   
NC_("STR_TRACK_CHANGES_BUTTON_HIDE", "Hide Toolbar")
 #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")
 
 // Translators: default Impress template names
 #define STR_TEMPLATE_NAME1  NC_("STR_TEMPLATE_NAME1", 
"Grey Elegant")
diff --git a/include/sfx2/viewfrm.hxx b/include/sfx2/viewfrm.hxx
index e52a1ec437a4..24d1c35dbe90 100644
--- a/include/sfx2/viewfrm.hxx
+++ b/include/sfx2/viewfrm.hxx
@@ -68,6 +68,7 @@ class SFX2_DLLPUBLIC SfxViewFrame final : public SfxShell, 
public SfxListener
 DECL_DLLPRIVATE_LINK(SignDocumentHandler, weld::Button&, void);
 DECL_DLLPRIVATE_LINK(HiddenTrackChangesHandler, weld::Button&, void);
 DECL_DLLPRIVATE_LINK(HyphenationMissingHandler, weld::Button&, void);
+DECL_DLLPRIVATE_LINK(RefreshMasterPasswordHdl, weld::Button&, void);
 SAL_DLLPRIVATE void KillDispatcher_Impl();
 
 virtual ~SfxViewFrame() override;
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 82404ce79246..95574c8892b0 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -34,6 +34,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1476,6 +1477,21 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, 
const SfxHint& rHint )
 batch->commit();
 }
 #endif
+if (officecfg::Office::Common::Passwords::HasMaster::get() &&
+
officecfg::Office::Common::Passwords::StorageVersion::get() == 0)
+{
+// master password stored in deprecated format
+VclPtr pOldMasterPasswordInfoBar =
+AppendInfoBar("oldmasterpassword", "",
+  SfxResId(STR_REFRESH_MASTER_PASSWORD), 
InfobarType::DANGER, false);
+if (pOldMasterPasswordInfoBar)
+{
+weld::Button& rButton = 
pOldMasterPasswordInfoBar->addButton();
+rButton.set_label(SfxResId(STR_REFRESH_PASSWORD));
+rButton.connect_clicked(LINK(this,
+   SfxViewFrame, 
RefreshMasterPasswordHdl));
+}
+}
 
 // read-only infobar if necessary
 const SfxViewShell *pVSh;
@@ -1689,6 +1705,27 @@ IMPL_LINK_NOARG(SfxViewFrame, HyphenationMissingHandler, 
weld::Button&, void)
 RemoveInfoBar(u"hyphenationmissing");
 }
 
+IMPL_LINK_NOARG(SfxViewFrame, RefreshMasterPasswordHdl, weld::Button&, void)
+{
+bool bChanged = false;
+try
+{
+Reference< task::XPasswordContainer2 > xMasterPasswd(
+
task::PasswordContainer::create(comphelper::getProcessComponentContext()));
+
+css::uno::Reference xFrame = 
GetFrame().GetFrameInterface();
+css::uno::Reference xContainerWindow = 
xFrame->getContainerWindow();
+
+uno::Reference 
xTmpHandler(task::InteractionHandler::createWithParent(comphelper::getProcessComponentContext(),
+  
xContainerWindow));
+bChanged = xMasterPasswd->changeMasterPassword(xTmpHandler);
+}
+catch (const Exception&)
+{}
+if (bChanged)
+RemoveInfoBar(u"oldmasterpassword");
+}
+
 void SfxViewFrame::Construct_Impl( SfxObjectShell *pObjSh )
 {
 m_pImpl->bResizeInToOut = true;


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

2022-02-02 Thread Mike Kaganski (via logerrit)
 include/sfx2/lokcomponenthelpers.hxx   |6 --
 sfx2/source/view/lokstarmathhelper.cxx |   25 ++---
 starmath/source/utility.cxx|   12 +++-
 sw/source/uibase/uno/unotxdoc.cxx  |2 +-
 4 files changed, 30 insertions(+), 15 deletions(-)

New commits:
commit fd7a84aca0c94044bbc3bfb8852a1ae5115845bf
Author: Mike Kaganski 
AuthorDate: Wed Feb 2 11:22:53 2022 +0300
Commit: Mike Kaganski 
CommitDate: Wed Feb 2 11:04:04 2022 +0100

lok: find active SmViewShell reliably

... even after SfxViewShell::Current() had been set to parent document
frame's viewshell (e.g., see LOKPostAsyncEvent grabbing focus, which
replaces current frame and its associated viewshell).

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

diff --git a/include/sfx2/lokcomponenthelpers.hxx 
b/include/sfx2/lokcomponenthelpers.hxx
index 114912253043..cace035b16a1 100644
--- a/include/sfx2/lokcomponenthelpers.hxx
+++ b/include/sfx2/lokcomponenthelpers.hxx
@@ -66,7 +66,8 @@ public:
 {
 }
 
-vcl::Window* GetWindow();
+vcl::Window* GetGraphicWindow();
+vcl::Window* GetWidgetWindow();
 
 bool postMouseEvent(int nType, int nX, int nY, int nCount, int nButtons, 
int nModifier,
 double fScaleX = 1.0, double fScaleY = 1.0);
@@ -77,7 +78,8 @@ private:
 
 SfxViewShell* mpViewShell;
 css::uno::Reference mxController;
-VclPtr mpWindow;
+VclPtr mpGraphicWindow;
+VclPtr mpWidgetWindow;
 };
 
 #endif
diff --git a/sfx2/source/view/lokstarmathhelper.cxx 
b/sfx2/source/view/lokstarmathhelper.cxx
index fedd931b08fd..885decdc2fea 100644
--- a/sfx2/source/view/lokstarmathhelper.cxx
+++ b/sfx2/source/view/lokstarmathhelper.cxx
@@ -83,28 +83,31 @@ vcl::Window* FindChildSmGraphicWidgetWindow(vcl::Window* 
pWin)
 }
 return nullptr;
 }
-
-vcl::Window* FindSmGraphicWidgetWindow(vcl::Window* pWin)
-{
-return FindChildSmGraphicWidgetWindow(FindSmGraphicWindow(pWin));
-}
 }
 
-vcl::Window* LokStarMathHelper::GetWindow()
+vcl::Window* LokStarMathHelper::GetGraphicWindow()
 {
-if (!mpWindow)
+if (!mpGraphicWindow)
 {
 if (const css::uno::Reference& xController = 
GetXController())
 {
 if (const css::uno::Reference xFrame = 
xController->getFrame())
 {
 css::uno::Reference xDockerWin = 
xFrame->getContainerWindow();
-
mpWindow.set(FindSmGraphicWidgetWindow(VCLUnoHelper::GetWindow(xDockerWin)));
+
mpGraphicWindow.set(FindSmGraphicWindow(VCLUnoHelper::GetWindow(xDockerWin)));
 }
 }
 }
 
-return mpWindow.get();
+return mpGraphicWindow.get();
+}
+
+vcl::Window* LokStarMathHelper::GetWidgetWindow()
+{
+if (!mpWidgetWindow)
+mpWidgetWindow.set(FindChildSmGraphicWidgetWindow(GetGraphicWindow()));
+
+return mpWidgetWindow.get();
 }
 
 tools::Rectangle LokStarMathHelper::GetBoundingBox()
@@ -115,7 +118,7 @@ tools::Rectangle LokStarMathHelper::GetBoundingBox()
 {
 if (vcl::Window* pRootWin = pIPClient->GetEditWin())
 {
-if (vcl::Window* pWindow = GetWindow())
+if (vcl::Window* pWindow = GetWidgetWindow())
 {
 // In all cases, the following code fragment
 // returns the bounding box in twips.
@@ -143,7 +146,7 @@ tools::Rectangle LokStarMathHelper::GetBoundingBox()
 bool LokStarMathHelper::postMouseEvent(int nType, int nX, int nY, int nCount, 
int nButtons,
int nModifier, double fScaleX, double 
fScaleY)
 {
-if (vcl::Window* pWindow = GetWindow())
+if (vcl::Window* pWindow = GetWidgetWindow())
 {
 Point aMousePos(nX, nY);
 tools::Rectangle rBBox = GetBoundingBox();
diff --git a/starmath/source/utility.cxx b/starmath/source/utility.cxx
index eab123d7829a..e8406c10380f 100644
--- a/starmath/source/utility.cxx
+++ b/starmath/source/utility.cxx
@@ -23,6 +23,9 @@
 #include 
 #include 
 
+#include 
+#include 
+
 // return pointer to active SmViewShell, if this is not possible
 // return 0 instead.
 //!! Since this method is based on the current focus it is somewhat
@@ -30,7 +33,14 @@
 SmViewShell * SmGetActiveView()
 {
 SfxViewShell *pView = SfxViewShell::Current();
-return  dynamic_cast( pView);
+SmViewShell* pSmView = dynamic_cast(pView);
+if (!pSmView && comphelper::LibreOfficeKit::isActive())
+{
+auto* pWindow = 
static_cast(LokStarMathHelper(pView).GetGraphicWindow());
+if (pWindow)
+pSmView = >GetGraphicWidget().GetView();
+}
+return pSmView;
 }
 
 
diff --git a/sw/source/uibase/uno/unotxdoc.cxx 
b/sw/source/uibase/uno/unotxdoc.cxx
index 4c732f1e5dee..0950722a0f59 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ 

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

2022-01-31 Thread Noel Grandin (via logerrit)
 include/sfx2/sfxsids.hrc|2 +-
 sfx2/source/appl/appuno.cxx |2 +-
 sfx2/source/doc/objstor.cxx |2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 663834876fd7dcc4d79240505e81f4b3ab1c5bab
Author: Noel Grandin 
AuthorDate: Mon Jan 31 10:55:18 2022 +0200
Commit: Noel Grandin 
CommitDate: Mon Jan 31 14:06:16 2022 +0100

SID_COPY_STREAM_IF_POSSIBLE is a SfxBoolItem

The cast in appuno.cxx has been wrong since this constant was introduced
in
commit e429183b999f2e488e991ef41bbee17604b6
Author: Oliver Bolte 
Date:   Mon Mar 27 08:33:39 2006 +
INTEGRATION: CWS fwk36 (1.113.44); FILE MERGED
2006/03/16 15:44:13 cd 1.113.44.2: #i46895# Fixed typos
2006/03/16 14:55:24 mav 1.113.44.1: #i46895# allow to create a copy of 
the document if possible

and I looked that cast when I added the TypedWhichId annotation.

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

diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc
index 90197dbcddf3..7f40ddc2284c 100644
--- a/include/sfx2/sfxsids.hrc
+++ b/include/sfx2/sfxsids.hrc
@@ -248,7 +248,7 @@ class SvxZoomItem;
 #define SID_APPLY_STYLE (SID_SFX_START + 1703)
 #define SID_MACRO_SIGNATURE (SID_SFX_START + 1704)
 #define SID_ATTR_WARNALIENFORMAT(SID_SFX_START + 1705)
-#define SID_COPY_STREAM_IF_POSSIBLE 
TypedWhichId(SID_SFX_START + 1706)
+#define SID_COPY_STREAM_IF_POSSIBLE 
TypedWhichId(SID_SFX_START + 1706)
 #define SID_MAIL_SENDDOCASFORMAT(SID_SFX_START + 1707)
 #define SID_MAIL_SENDDOCASMS(SID_SFX_START + 1708)
 #define SID_MAIL_SENDDOCASOOO   (SID_SFX_START + 1709)
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index 17c2304ed10a..72076871ee98 100644
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
@@ -1621,7 +1621,7 @@ void TransformItems( sal_uInt16 nSlotId, const 
SfxItemSet& rSet, uno::Sequence(pItem)->GetValue();
+pValue[nActProp++].Value <<= static_cast(pItem)->GetValue();
 }
 if ( rSet.GetItemState( SID_NOAUTOSAVE, false,  ) == 
SfxItemState::SET )
 {
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 76e7734b402c..d07d406ec271 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -2712,7 +2712,7 @@ bool SfxObjectShell::CommonSaveAs_Impl(const 
INetURLObject& aURL, const OUString
 }
 
 
-const SfxBoolItem* pCopyStreamItem = 
rItemSet.GetItem(SID_COPY_STREAM_IF_POSSIBLE, false);
+const SfxBoolItem* pCopyStreamItem = 
rItemSet.GetItem(SID_COPY_STREAM_IF_POSSIBLE, false);
 if ( bSaveTo && pCopyStreamItem && pCopyStreamItem->GetValue() && 
!IsModified() )
 {
 if 
(pMedium->TryDirectTransfer(aURL.GetMainURL(INetURLObject::DecodeMechanism::NONE),
 rItemSet))


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

2022-01-25 Thread Caolán McNamara (via logerrit)
 include/sfx2/basedlgs.hxx   |2 +-
 sfx2/source/dialog/basedlgs.cxx |7 +++
 2 files changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 9446b3ccd1240dbd44cbe1f1ccdfca04b61c85af
Author: Caolán McNamara 
AuthorDate: Mon Jan 24 15:46:50 2022 +0200
Commit: Caolán McNamara 
CommitDate: Tue Jan 25 10:04:38 2022 +0100

tdf#146571 Ignore focus changes after closing Manage changes dialog

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

diff --git a/include/sfx2/basedlgs.hxx b/include/sfx2/basedlgs.hxx
index e7cf250d1159..2adc649a8ec8 100644
--- a/include/sfx2/basedlgs.hxx
+++ b/include/sfx2/basedlgs.hxx
@@ -47,7 +47,7 @@ public:
 
 // when the dialog has an associated SfxChildWin, typically for Modeless 
interaction
 virtual void ChildWinDispose() {} // called from the associated 
SfxChildWin dtor
-virtual void Close() {} // called by the SfxChildWin when the dialog is 
closed
+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
 };
 
diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx
index 7319b9981419..2fefb02ff125 100644
--- a/sfx2/source/dialog/basedlgs.cxx
+++ b/sfx2/source/dialog/basedlgs.cxx
@@ -197,6 +197,7 @@ void SfxModelessDialogController::Close()
 m_pBindings->GetDispatcher_Impl()->ExecuteList(
 m_xImpl->pMgr->GetType(),
 SfxCallMode::RECORD|SfxCallMode::SYNCHRON, {  } );
+SfxDialogController::Close();
 }
 
 SfxDialogController::SfxDialogController(weld::Widget* pParent, const 
OUString& rUIFile,
@@ -210,6 +211,12 @@ SfxDialogController::SfxDialogController(weld::Widget* 
pParent, const OUString&
 m_xDialog->connect_container_focus_changed(LINK(this, SfxDialogController, 
FocusChangeHdl));
 }
 
+void SfxDialogController::Close()
+{
+// tdf3146571 ignore focus changes after we've closed
+m_xDialog->connect_container_focus_changed(Link());
+}
+
 IMPL_STATIC_LINK_NOARG(SfxDialogController, InstallLOKNotifierHdl, void*, 
vcl::ILibreOfficeKitNotifier*)
 {
 return SfxViewShell::Current();


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

2022-01-24 Thread Caolán McNamara (via logerrit)
 include/sfx2/titledockwin.hxx   |3 ++-
 sfx2/source/dialog/titledockwin.cxx |4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 7679820af5739d3b6d5de0c4cb771d081407f406
Author: Caolán McNamara 
AuthorDate: Mon Jan 24 15:29:00 2022 +
Commit: Caolán McNamara 
CommitDate: Mon Jan 24 18:14:16 2022 +0100

can use a forward decl here

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

diff --git a/include/sfx2/titledockwin.hxx b/include/sfx2/titledockwin.hxx
index fe87e81cf9c4..0ba02278b694 100644
--- a/include/sfx2/titledockwin.hxx
+++ b/include/sfx2/titledockwin.hxx
@@ -23,10 +23,11 @@
 #include 
 #include 
 
-#include 
 #include 
 #include 
 
+class ToolBox;
+
 namespace sfx2
 {
 class SFX2_DLLPUBLIC TitledDockingWindow : public SfxDockingWindow
diff --git a/sfx2/source/dialog/titledockwin.cxx 
b/sfx2/source/dialog/titledockwin.cxx
index 69f530c49592..f9209b8e26a3 100644
--- a/sfx2/source/dialog/titledockwin.cxx
+++ b/sfx2/source/dialog/titledockwin.cxx
@@ -26,9 +26,9 @@
 #include 
 
 #include 
-#include 
 #include 
-
+#include 
+#include 
 
 namespace sfx2
 {


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

2022-01-24 Thread Szymon Kłos (via logerrit)
 include/sfx2/objsh.hxx |2 
 sfx2/source/doc/objserv.cxx|   27 ++---
 vcl/jsdialog/enabled.cxx   |3 -
 xmlsecurity/inc/digitalsignaturesdialog.hxx|1 
 xmlsecurity/source/component/documentdigitalsignatures.cxx |   19 ++---
 xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx |   14 ++
 6 files changed, 52 insertions(+), 14 deletions(-)

New commits:
commit 71a8bad4b96627fd965b23288dea14aae3f0f468
Author: Szymon Kłos 
AuthorDate: Wed Oct 20 11:01:41 2021 +0200
Commit: Szymon Kłos 
CommitDate: Mon Jan 24 09:43:53 2022 +0100

jsdialog: enable Digital Signatures dialog

In LOK case run it in the readonly mode.
In readonly mode we can run it asynchronously.

Change-Id: I721dd14fa23d4e30255dd976e0cc2a4f30470a3b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124058
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128838
Tested-by: Jenkins

diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index 553489e14aa9..7440674d6656 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -344,7 +344,7 @@ public:
 
 /** Returns true if preparing was successful, else false. */
 bool PrepareForSigning(weld::Window* pDialogParent);
-bool CheckIsReadonly(bool bSignScriptingContent);
+bool CheckIsReadonly(bool bSignScriptingContent, weld::Window* 
pDialogParent = nullptr);
 void RecheckSignature(bool bAlsoRecheckScriptingSignature);
 void AfterSigning(bool bSignSuccess, bool bSignScriptingContent);
 bool HasValidSignatures() const;
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index ac6717b921fe..d3db98802433 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -1888,9 +1888,10 @@ void SfxObjectShell::AfterSigning(bool bSignSuccess, 
bool bSignScriptingContent)
 EnableSetModified();
 }
 
-bool SfxObjectShell::CheckIsReadonly(bool bSignScriptingContent)
+bool SfxObjectShell::CheckIsReadonly(bool bSignScriptingContent, weld::Window* 
pDialogParent)
 {
-if (GetMedium()->IsOriginallyReadOnly())
+// in LOK case we support only viewer / readonly mode so far
+if (GetMedium()->IsOriginallyReadOnly() || 
comphelper::LibreOfficeKit::isActive())
 {
 // If the file is physically read-only, we just show the existing 
signatures
 try
@@ -1900,6 +1901,10 @@ bool SfxObjectShell::CheckIsReadonly(bool 
bSignScriptingContent)
 uno::Reference xSigner(
 
security::DocumentDigitalSignatures::createWithVersionAndValidSignature(
 comphelper::getProcessComponentContext(), aODFVersion, 
HasValidSignatures()));
+
+if (pDialogParent)
+xSigner->setParentWindow(pDialogParent->GetXWindow());
+
 if (bSignScriptingContent)
 
xSigner->showScriptingContentSignatures(GetMedium()->GetZipStorageToSign_Impl(),
 
uno::Reference());
@@ -1913,6 +1918,18 @@ bool SfxObjectShell::CheckIsReadonly(bool 
bSignScriptingContent)
 {
 std::unique_ptr pStream(
 utl::UcbStreamHelper::CreateStream(GetName(), 
StreamMode::READ));
+
+if (!pStream)
+{
+pStream = 
utl::UcbStreamHelper::CreateStream(GetMedium()->GetName(), StreamMode::READ);
+
+if (!pStream)
+{
+SAL_WARN( "sfx.doc", "Couldn't use signing 
functionality!" );
+return true;
+}
+}
+
 uno::Reference xStream(new 
utl::OStreamWrapper(*pStream));
 
xSigner->showDocumentContentSignatures(uno::Reference(),
xStream);
@@ -1945,7 +1962,7 @@ void SfxObjectShell::SignDocumentContent(weld::Window* 
pDialogParent)
 if (!PrepareForSigning(pDialogParent))
 return;
 
-if (CheckIsReadonly(false))
+if (CheckIsReadonly(false, pDialogParent))
 return;
 
 bool bSignSuccess = GetMedium()->SignContents_Impl(pDialogParent, false, 
HasValidSignatures());
@@ -2041,7 +2058,7 @@ void SfxObjectShell::SignSignatureLine(weld::Window* 
pDialogParent,
 if (!PrepareForSigning(pDialogParent))
 return;
 
-if (CheckIsReadonly(false))
+if (CheckIsReadonly(false, pDialogParent))
 return;
 
 bool bSignSuccess = GetMedium()->SignContents_Impl(pDialogParent,
@@ -2066,7 +2083,7 @@ void SfxObjectShell::SignScriptingContent(weld::Window* 
pDialogParent)
 if (!PrepareForSigning(pDialogParent))
 return;
 
-if (CheckIsReadonly(true))
+if (CheckIsReadonly(true, 

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

2021-11-29 Thread Julien Nabet (via logerrit)
 include/sfx2/sfxbasemodel.hxx|2 +-
 sfx2/source/doc/sfxbasemodel.cxx |   12 +---
 sfx2/source/view/viewprn.cxx |1 -
 3 files changed, 10 insertions(+), 5 deletions(-)

New commits:
commit 774c6a6e1603bf3f12f1573b0778e0f0f9783169
Author: Julien Nabet 
AuthorDate: Mon Nov 29 10:18:52 2021 +0100
Commit: Julien Nabet 
CommitDate: Mon Nov 29 17:21:38 2021 +0100

tdf#117280: fix multiple Macro execution when triggered by Document print 
event

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

diff --git a/include/sfx2/sfxbasemodel.hxx b/include/sfx2/sfxbasemodel.hxx
index b55705b57e1d..8ccd59292e58 100644
--- a/include/sfx2/sfxbasemodel.hxx
+++ b/include/sfx2/sfxbasemodel.hxx
@@ -721,7 +721,7 @@ private:
 SAL_DLLPRIVATE void ListenForStorage_Impl( const css::uno::Reference< 
css::embed::XStorage >& xStorage );
 SAL_DLLPRIVATE OUString GetMediumFilterName_Impl() const;
 
-SAL_DLLPRIVATE void postEvent_Impl( const OUString& aName, const 
css::uno::Reference< css::frame::XController2 >& xController = 
css::uno::Reference< css::frame::XController2 >() );
+SAL_DLLPRIVATE void postEvent_Impl( const OUString& aName, const 
css::uno::Reference< css::frame::XController2 >& xController = 
css::uno::Reference< css::frame::XController2 >(), const css::uno::Any& 
aSupplement = css::uno::Any());
 
 SAL_DLLPRIVATE css::uno::Reference< css::frame::XTitle > 
impl_getTitleHelper ();
 SAL_DLLPRIVATE css::uno::Reference< css::frame::XUntitledNumbers > 
impl_getUntitledHelper ();
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 28afbd7e5bad..44cd4216bece 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -2896,7 +2896,13 @@ void SfxBaseModel::Notify(  SfxBroadcaster& rBC  
   ,
 }
 
 const SfxViewEventHint* pViewHint = dynamic_cast();
-postEvent_Impl( pNamedHint->GetEventName(), pViewHint ? 
pViewHint->GetController() : Reference< frame::XController2 >() );
+if (pViewHint)
+{
+const SfxPrintingHint* pPrintingHint = dynamic_cast();
+postEvent_Impl( pNamedHint->GetEventName(), 
pViewHint->GetController(), pPrintingHint? Any(pPrintingHint->GetWhich()) : 
Any() );
+}
+else
+postEvent_Impl( pNamedHint->GetEventName(), Reference< 
frame::XController2 >() );
 }
 
 if ( rHint.GetId() == SfxHintId::TitleChanged )
@@ -3223,7 +3229,7 @@ public:
 };
 } // anonymous namespace
 
-void SfxBaseModel::postEvent_Impl( const OUString& aName, const Reference< 
frame::XController2 >& xController )
+void SfxBaseModel::postEvent_Impl( const OUString& aName, const Reference< 
frame::XController2 >& xController, const Any& supplement )
 {
 // object already disposed?
 if ( impl_isDisposed() )
@@ -3245,7 +3251,7 @@ void SfxBaseModel::postEvent_Impl( const OUString& aName, 
const Reference< frame
 {
 SAL_INFO("sfx.doc", "SfxDocumentEvent: " + aName);
 
-document::DocumentEvent aDocumentEvent( 
static_cast(this), aName, xController, Any() );
+document::DocumentEvent aDocumentEvent( 
static_cast(this), aName, xController, supplement );
 
 pIC->forEach< document::XDocumentEventListener, 
NotifySingleListenerIgnoreRE< document::XDocumentEventListener, 
document::DocumentEvent > >(
 NotifySingleListenerIgnoreRE< document::XDocumentEventListener, 
document::DocumentEvent >(
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx
index dbf84dde0d3c..f6cd8936ee84 100644
--- a/sfx2/source/view/viewprn.cxx
+++ b/sfx2/source/view/viewprn.cxx
@@ -313,7 +313,6 @@ void SfxPrinterController::jobStarted()
 
 xDocProps->setPrintDate( now.GetUNODateTime() );
 
-SfxGetpApp()->NotifyEvent( SfxEventHint(SfxEventHintId::PrintDoc, 
GlobalEventConfig::GetEventName( GlobalEventId::PRINTDOC ), mpObjectShell ) );
 uno::Sequence < beans::PropertyValue > aOpts;
 aOpts = getJobProperties( aOpts );
 


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

2021-10-29 Thread Stephan Bergmann (via logerrit)
 include/sfx2/strings.hrc   |1 
 sfx2/source/appl/openuriexternally.cxx |   73 +++--
 2 files changed, 44 insertions(+), 30 deletions(-)

New commits:
commit 70009098fd70df021048c540d1796c928554b494
Author: Stephan Bergmann 
AuthorDate: Fri Oct 29 11:17:09 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Oct 29 13:26:36 2021 +0200

tdf#128969: Let the user explicitly decide to execute an external program

...bringing up a warning dialog now in cases where it would have before only
brought up a failure message

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

diff --git a/include/sfx2/strings.hrc b/include/sfx2/strings.hrc
index 4b95c8505d87..82bd1c2168a1 100644
--- a/include/sfx2/strings.hrc
+++ b/include/sfx2/strings.hrc
@@ -103,6 +103,7 @@
 #define STR_GB  NC_("STR_GB", "GB")
 #define STR_QUERY_LASTVERSION   NC_("STR_QUERY_LASTVERSION", 
"Cancel all changes?")
 #define STR_NO_WEBBROWSER_FOUND NC_("STR_NO_WEBBROWSER_FOUND", 
"Opening \"$(ARG1)\" failed with error code $(ARG2) and message: 
\"$(ARG3)\"\nMaybe no web browser could be found on your system. In that case, 
please check your Desktop Preferences or install a web browser (for example, 
Firefox) in the default location requested during the browser installation.")
+#define STR_DANGEROUS_TO_OPEN   NC_("STR_DANGEROUS_TO_OPEN", 
"It might be dangerous to open \"$(ARG1)\".\nDo you really want to open it?")
 #define STR_NO_ABS_URI_REF  NC_("STR_NO_ABS_URI_REF", 
"\"$(ARG1)\" cannot be passed to an external application to open it (e.g., it 
might not be an absolute URL, or might denote no existing file).")
 #define STR_GID_INTERN  NC_("STR_GID_INTERN", 
"Internal")
 #define STR_GID_APPLICATION NC_("STR_GID_APPLICATION", 
"Application")
diff --git a/sfx2/source/appl/openuriexternally.cxx 
b/sfx2/source/appl/openuriexternally.cxx
index d149f63d257d..0425da7208be 100644
--- a/sfx2/source/appl/openuriexternally.cxx
+++ b/sfx2/source/appl/openuriexternally.cxx
@@ -80,37 +80,50 @@ IMPL_LINK_NOARG(URITools, onOpenURI, Timer*, void)
 std::unique_ptr guard(this);
 css::uno::Reference< css::system::XSystemShellExecute > exec(
 
css::system::SystemShellExecute::create(comphelper::getProcessComponentContext()));
-try {
-exec->execute(
-msURI, OUString(),
-css::system::SystemShellExecuteFlags::URIS_ONLY);
-} catch (css::lang::IllegalArgumentException & e) {
-if (e.ArgumentPosition != 0) {
-throw css::uno::RuntimeException(
-"unexpected IllegalArgumentException: " + e.Message);
+for (sal_Int32 flags = css::system::SystemShellExecuteFlags::URIS_ONLY;;) {
+try {
+exec->execute(msURI, OUString(), flags);
+} catch (css::lang::IllegalArgumentException & e) {
+if (e.ArgumentPosition != 0) {
+throw css::uno::RuntimeException(
+"unexpected IllegalArgumentException: " + e.Message);
+}
+SolarMutexGuard g;
+weld::Window *pWindow = SfxGetpApp()->GetTopWindow();
+if (flags == css::system::SystemShellExecuteFlags::URIS_ONLY) {
+std::unique_ptr eb(
+Application::CreateMessageDialog(
+pWindow, VclMessageType::Warning, 
VclButtonsType::OkCancel,
+SfxResId(STR_DANGEROUS_TO_OPEN)));
+
eb->set_primary_text(eb->get_primary_text().replaceFirst("$(ARG1)", msURI));
+if (eb->run() == RET_OK) {
+flags = 0;
+continue;
+}
+} else {
+std::unique_ptr 
eb(Application::CreateMessageDialog(pWindow,
+ 
VclMessageType::Warning, VclButtonsType::Ok,
+ 
SfxResId(STR_NO_ABS_URI_REF)));
+
eb->set_primary_text(eb->get_primary_text().replaceFirst("$(ARG1)", msURI));
+eb->run();
+}
+} catch (css::system::SystemShellExecuteException & e) {
+if (!mbHandleSystemShellExecuteException) {
+throw;
+}
+SolarMutexGuard g;
+weld::Window *pWindow = SfxGetpApp()->GetTopWindow();
+std::unique_ptr 
eb(Application::CreateMessageDialog(pWindow,
+ 
VclMessageType::Warning, VclButtonsType::Ok,
+ 
SfxResId(STR_NO_WEBBROWSER_FOUND)));
+eb->set_primary_text(
+   

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

2021-10-11 Thread Caolán McNamara (via logerrit)
 include/sfx2/objitem.hxx|3 +++
 sfx2/source/doc/objitem.cxx |   10 ++
 2 files changed, 13 insertions(+)

New commits:
commit 8fb4889840a6c79f6bad7bb7a322d86b751cdd93
Author: Caolán McNamara 
AuthorDate: Mon Oct 11 14:12:48 2021 +0100
Commit: Caolán McNamara 
CommitDate: Mon Oct 11 17:10:10 2021 +0200

Related: tdf#145033 don't print "There is no implementation..." warning

don't output "There is no implementation for QueryValue for this item!"
for SfxObjectItem

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

diff --git a/include/sfx2/objitem.hxx b/include/sfx2/objitem.hxx
index 7fb199c88ab1..17b7f0cf1de2 100644
--- a/include/sfx2/objitem.hxx
+++ b/include/sfx2/objitem.hxx
@@ -36,6 +36,9 @@ public:
 virtual bool operator==( const SfxPoolItem& ) const override;
 virtual SfxObjectItem*   Clone( SfxItemPool *pPool = nullptr ) const 
override;
 
+virtual bool QueryValue(css::uno::Any&, sal_uInt8 nMemberId = 
0) const override;
+virtual bool PutValue(const css::uno::Any&, sal_uInt8) 
override;
+
 SfxShell*GetShell() const
  { return _pSh; }
 };
diff --git a/sfx2/source/doc/objitem.cxx b/sfx2/source/doc/objitem.cxx
index 7165a475e291..e776e6608788 100644
--- a/sfx2/source/doc/objitem.cxx
+++ b/sfx2/source/doc/objitem.cxx
@@ -84,4 +84,14 @@ SfxObjectItem* SfxObjectItem::Clone( SfxItemPool *) const
 return new SfxObjectItem( *this );
 }
 
+bool SfxObjectItem::QueryValue(css::uno::Any&, sal_uInt8) const
+{
+return false;
+}
+
+bool SfxObjectItem::PutValue(const css::uno::Any&, sal_uInt8)
+{
+  return false;
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2021-10-11 Thread Noel Grandin (via logerrit)
 include/sfx2/sidebar/Deck.hxx |2 +-
 sfx2/source/sidebar/Deck.cxx  |4 ++--
 sfx2/source/sidebar/SidebarController.cxx |2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 433492d50a1db601b0c2b7e375cead5f59910a31
Author: Noel Grandin 
AuthorDate: Mon Oct 11 12:48:04 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Oct 11 14:57:08 2021 +0200

loplugin:moveparam in sfx2

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

diff --git a/include/sfx2/sidebar/Deck.hxx b/include/sfx2/sidebar/Deck.hxx
index c8cd298b9229..fe73e6332d90 100644
--- a/include/sfx2/sidebar/Deck.hxx
+++ b/include/sfx2/sidebar/Deck.hxx
@@ -46,7 +46,7 @@ public:
 
 DeckTitleBar* GetTitleBar() const;
 tools::Rectangle GetContentArea() const;
-void ResetPanels(const SharedPanelContainer& rPanels);
+void ResetPanels(SharedPanelContainer&& rPanels);
 const SharedPanelContainer& GetPanels() const { return maPanels; }
 
 std::shared_ptr GetPanel(std::u16string_view panelId);
diff --git a/sfx2/source/sidebar/Deck.cxx b/sfx2/source/sidebar/Deck.cxx
index 450cfe57fe19..6a5e45eb6be7 100644
--- a/sfx2/source/sidebar/Deck.cxx
+++ b/sfx2/source/sidebar/Deck.cxx
@@ -170,7 +170,7 @@ void Deck::DumpAsPropertyTree(tools::JsonWriter& 
rJsonWriter)
  * This container may contain existing panels that are
  * being re-used, and new ones too.
  */
-void Deck::ResetPanels(const SharedPanelContainer& rPanelContainer)
+void Deck::ResetPanels(SharedPanelContainer&& rPanelContainer)
 {
 SharedPanelContainer aHiddens;
 
@@ -186,7 +186,7 @@ void Deck::ResetPanels(const SharedPanelContainer& 
rPanelContainer)
 aHiddens.push_back(rpPanel);
 }
 }
-maPanels = rPanelContainer;
+maPanels = std::move(rPanelContainer);
 
 // Hidden ones always at the end
 maPanels.insert(std::end(maPanels), std::begin(aHiddens), 
std::end(aHiddens));
diff --git a/sfx2/source/sidebar/SidebarController.cxx 
b/sfx2/source/sidebar/SidebarController.cxx
index d1245bc489a2..279b602cb2a6 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -787,7 +787,7 @@ void SidebarController::CreatePanels(std::u16string_view 
rDeckId, const Context&
 
 // mpCurrentPanels - may miss stuff (?)
 aNewPanels.resize(nWriteIndex);
-pDeck->ResetPanels(aNewPanels);
+pDeck->ResetPanels(std::move(aNewPanels));
 }
 
 void SidebarController::SwitchToDeck (


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

2021-09-22 Thread Stephan Bergmann (via logerrit)
 include/sfx2/classificationhelper.hxx |   26 +-
 include/sfx2/sfxhelp.hxx  |6 +-
 sfx2/source/appl/sfxhelp.cxx  |   13 -
 sfx2/source/doc/graphhelp.cxx |   13 +++--
 sfx2/source/doc/graphhelp.hxx |3 ++-
 sfx2/source/view/classificationhelper.cxx |7 ---
 6 files changed, 43 insertions(+), 25 deletions(-)

New commits:
commit ea29e9936a3e628f95ca4ae1d5816adfce87318f
Author: Stephan Bergmann 
AuthorDate: Wed Sep 22 20:01:38 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Wed Sep 22 21:14:15 2021 +0200

Extend loplugin:stringviewparam to starts/endsWith: sfx2

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

diff --git a/include/sfx2/classificationhelper.hxx 
b/include/sfx2/classificationhelper.hxx
index ca9ffc386b5d..5a4fa6b1eeab 100644
--- a/include/sfx2/classificationhelper.hxx
+++ b/include/sfx2/classificationhelper.hxx
@@ -11,8 +11,10 @@
 #define INCLUDED_SFX2_CLASSIFICATIONHELPER_HXX
 
 #include 
+#include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -100,7 +102,7 @@ public:
 std::vector const& GetIntellectualPropertyPartNumbers() const;
 
 /// Does a best-effort conversion of rType to SfxClassificationPolicyType.
-static SfxClassificationPolicyType stringToPolicyType(const OUString& 
rType);
+static SfxClassificationPolicyType stringToPolicyType(std::u16string_view 
rType);
 /// Returns the string representation of a SfxClassificationPolicyType 
element.
 static const OUString& policyTypeToString(SfxClassificationPolicyType 
eType);
 
@@ -154,16 +156,19 @@ public:
 return makeTextKey() + ":n" + OUString::number(m_nTextNumber++);
 }
 
-bool isMarkingTextKey(OUString const& aKey) const { return 
aKey.startsWith(makeTextKey()); }
+bool isMarkingTextKey(std::u16string_view aKey) const
+{
+return o3tl::starts_with(aKey, makeTextKey());
+}
 
 OUString makeCategoryNameKey() const
 {
 return getPolicyKey() + "BusinessAuthorizationCategory:Name";
 }
 
-bool isCategoryNameKey(OUString const& aKey) const
+bool isCategoryNameKey(std::u16string_view aKey) const
 {
-return aKey.startsWith(makeCategoryNameKey());
+return o3tl::starts_with(aKey, makeCategoryNameKey());
 }
 
 OUString makeCategoryIdentifierKey() const
@@ -171,9 +176,9 @@ public:
 return getPolicyKey() + "BusinessAuthorizationCategory:Identifier";
 }
 
-bool isCategoryIdentifierKey(OUString const& aKey) const
+bool isCategoryIdentifierKey(std::u16string_view aKey) const
 {
-return aKey.startsWith(makeCategoryIdentifierKey());
+return o3tl::starts_with(aKey, makeCategoryIdentifierKey());
 }
 
 OUString makeMarkingKey() const { return getPolicyKey() + 
"Custom:Marking"; }
@@ -183,7 +188,10 @@ public:
 return makeMarkingKey() + ":n" + OUString::number(m_nMarkingNumber++);
 }
 
-bool isMarkingKey(OUString const& aKey) const { return 
aKey.startsWith(makeMarkingKey()); }
+bool isMarkingKey(std::u16string_view aKey) const
+{
+return o3tl::starts_with(aKey, makeMarkingKey());
+}
 
 OUString makeIntellectualPropertyPartKey() const
 {
@@ -195,9 +203,9 @@ public:
 return makeIntellectualPropertyPartKey() + ":n" + 
OUString::number(m_nIPPartNumber++);
 }
 
-bool isIntellectualPropertyPartKey(OUString const& aKey) const
+bool isIntellectualPropertyPartKey(std::u16string_view aKey) const
 {
-return aKey.startsWith(makeIntellectualPropertyPartKey());
+return o3tl::starts_with(aKey, makeIntellectualPropertyPartKey());
 }
 
 OUString makeFullTextualRepresentationKey() const
diff --git a/include/sfx2/sfxhelp.hxx b/include/sfx2/sfxhelp.hxx
index b0f3ff00657f..a8f725d067a6 100644
--- a/include/sfx2/sfxhelp.hxx
+++ b/include/sfx2/sfxhelp.hxx
@@ -19,6 +19,10 @@
 #ifndef INCLUDED_SFX2_SFXHELP_HXX
 #define INCLUDED_SFX2_SFXHELP_HXX
 
+#include 
+
+#include 
+
 #include 
 #include 
 #include 
@@ -34,7 +38,7 @@ private:
 SAL_DLLPRIVATE static bool Start_Impl(const OUString& rURL, weld::Widget* 
pWidget, const OUString& rKeyword);
 SAL_DLLPRIVATE virtual void SearchKeyword( const OUString& rKeyWord ) 
override;
 SAL_DLLPRIVATE virtual bool Start(const OUString& rURL, weld::Widget* 
pWidget = nullptr) override;
-SAL_DLLPRIVATE static OUString GetHelpModuleName_Impl(const OUString 
);
+SAL_DLLPRIVATE static OUString GetHelpModuleName_Impl(std::u16string_view 
rHelpId);
 SAL_DLLPRIVATE static OUString CreateHelpURL_Impl( const OUString& 
aCommandURL, const OUString& rModuleName );
 
 SAL_DLLPRIVATE static bool Start_Impl( const OUString& rURL, const 
vcl::Window* pWindow );
diff --git a/sfx2/source/appl/sfxhelp.cxx 

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

2021-09-11 Thread Julien Nabet (via logerrit)
 include/sfx2/mailmodelapi.hxx|2 +-
 sfx2/source/dialog/bluthsnd.cxx  |2 +-
 sfx2/source/dialog/mailmodel.cxx |   14 +++---
 3 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit f5ba9f5b7bbf74df14e5ed51af43392d6091aba1
Author: Julien Nabet 
AuthorDate: Sat Sep 11 20:39:44 2021 +0200
Commit: Julien Nabet 
CommitDate: Sun Sep 12 07:51:14 2021 +0200

Typo: SAVE_SUCCESSFULL->SAVE_SUCCESSFUL

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

diff --git a/include/sfx2/mailmodelapi.hxx b/include/sfx2/mailmodelapi.hxx
index f701b98972ae..47d5b408659f 100644
--- a/include/sfx2/mailmodelapi.hxx
+++ b/include/sfx2/mailmodelapi.hxx
@@ -43,7 +43,7 @@ class SFX2_DLLPUBLIC SfxMailModel
 protected:
 enum SaveResult
 {
-SAVE_SUCCESSFULL,
+SAVE_SUCCESSFUL,
 SAVE_CANCELLED,
 SAVE_ERROR
 };
diff --git a/sfx2/source/dialog/bluthsnd.cxx b/sfx2/source/dialog/bluthsnd.cxx
index ded98ceb0a1e..0083f0749768 100644
--- a/sfx2/source/dialog/bluthsnd.cxx
+++ b/sfx2/source/dialog/bluthsnd.cxx
@@ -20,7 +20,7 @@ SfxBluetoothModel::SendMailResult 
SfxBluetoothModel::SaveAndSend( const css::uno
 OUString   aFileName;
 
 eSaveResult  = SaveDocumentAsFormat( OUString(), xFrame, OUString(), 
aFileName );
-if( eSaveResult == SAVE_SUCCESSFULL )
+if( eSaveResult == SAVE_SUCCESSFUL )
 {
 maAttachedDocuments.push_back( aFileName );
 return Send();
diff --git a/sfx2/source/dialog/mailmodel.cxx b/sfx2/source/dialog/mailmodel.cxx
index 5e5d079fd934..f361d92b858d 100644
--- a/sfx2/source/dialog/mailmodel.cxx
+++ b/sfx2/source/dialog/mailmodel.cxx
@@ -187,7 +187,7 @@ SfxMailModel::SaveResult 
SfxMailModel::ShowFilterOptionsDialog(
 rArgs[rNumArgs-1].Name = pProp->Name;
 rArgs[rNumArgs-1].Value = pProp->Value;
 }
-eRet = SAVE_SUCCESSFULL;
+eRet = SAVE_SUCCESSFUL;
 }
 else
 {
@@ -541,13 +541,13 @@ SfxMailModel::SaveResult 
SfxMailModel::SaveDocumentAsFormat(
 xSMGR, xModel, 
aFilterName, rType, bModified, nNumArgs, aArgs );
 
 // don't continue on dialog cancel or error
-if ( eShowPDFFilterDialog != SAVE_SUCCESSFULL )
+if ( eShowPDFFilterDialog != SAVE_SUCCESSFUL )
 return eShowPDFFilterDialog;
 }
 
 xStorable->storeToURL( aFileURL, aArgs );
 rFileNamePath = aFileURL;
-eRet = SAVE_SUCCESSFULL;
+eRet = SAVE_SUCCESSFUL;
 
 if( !bSendAsPDF )
 {
@@ -607,7 +607,7 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat(
 {
 xStorable->storeToURL( aFileURL, aArgs );
 rFileNamePath = aFileURL;
-eRet = SAVE_SUCCESSFULL;
+eRet = SAVE_SUCCESSFUL;
 }
 catch ( css::io::IOException& )
 {
@@ -649,9 +649,9 @@ SfxMailModel::SendMailResult SfxMailModel::AttachDocument(
 OUString sFileName;
 
 SaveResult eSaveResult = SaveDocumentAsFormat( sAttachmentTitle, 
xFrameOrModel, OUString()/*sDocumentType*/, sFileName );
-if ( eSaveResult == SAVE_SUCCESSFULL &&  !sFileName.isEmpty() )
+if ( eSaveResult == SAVE_SUCCESSFUL &&  !sFileName.isEmpty() )
 maAttachedDocuments.push_back(sFileName);
-return eSaveResult == SAVE_SUCCESSFULL ? SEND_MAIL_OK : SEND_MAIL_ERROR;
+return eSaveResult == SAVE_SUCCESSFUL ? SEND_MAIL_OK : SEND_MAIL_ERROR;
 }
 
 SfxMailModel::SendMailResult SfxMailModel::Send( const css::uno::Reference< 
css::frame::XFrame >& xFrame )
@@ -781,7 +781,7 @@ SfxMailModel::SendMailResult SfxMailModel::SaveAndSend( 
const css::uno::Referenc
 
 eSaveResult = SaveDocumentAsFormat( OUString(), xFrame, rTypeName, 
aFileName );
 
-if ( eSaveResult == SAVE_SUCCESSFULL )
+if ( eSaveResult == SAVE_SUCCESSFUL )
 {
 maAttachedDocuments.push_back( aFileName );
 return Send( xFrame );


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

2021-09-01 Thread Caolán McNamara (via logerrit)
 include/sfx2/sidebar/Deck.hxx |1 +
 sfx2/source/sidebar/Deck.cxx  |   18 ++
 2 files changed, 19 insertions(+)

New commits:
commit 0b16224062c0434087c3b904cc57d44e5723394b
Author: Caolán McNamara 
AuthorDate: Tue Aug 31 10:25:08 2021 +0100
Commit: Caolán McNamara 
CommitDate: Wed Sep 1 09:30:59 2021 +0200

tdf#142458 minimal width not including extra width needed by scrolledwindow

its only including the width of the panels and not the extra space
possibly required by the container window. Which is 2x the
m_nBorderWidth of 1pixel of VclScrolledWindow in this case.

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

diff --git a/include/sfx2/sidebar/Deck.hxx b/include/sfx2/sidebar/Deck.hxx
index 47f3d6434eb2..c8cd298b9229 100644
--- a/include/sfx2/sidebar/Deck.hxx
+++ b/include/sfx2/sidebar/Deck.hxx
@@ -72,6 +72,7 @@ private:
 private:
 const OUString msId;
 sal_Int32 mnMinimalWidth;
+sal_Int32 mnScrolledWindowExtraWidth;
 sal_Int32 mnMinimalHeight;
 SharedPanelContainer maPanels;
 
diff --git a/sfx2/source/sidebar/Deck.cxx b/sfx2/source/sidebar/Deck.cxx
index 0fec11ef4e89..2267b222d82e 100644
--- a/sfx2/source/sidebar/Deck.cxx
+++ b/sfx2/source/sidebar/Deck.cxx
@@ -46,6 +46,7 @@ Deck::Deck(const DeckDescriptor& rDeckDescriptor, 
SidebarDockingWindow* pParentW
 : InterimItemWindow(pParentWindow, "sfx/ui/deck.ui", "Deck")
 , msId(rDeckDescriptor.msId)
 , mnMinimalWidth(0)
+, mnScrolledWindowExtraWidth(0)
 , mnMinimalHeight(0)
 , maPanels()
 , mxParentWindow(pParentWindow)
@@ -59,6 +60,15 @@ Deck::Deck(const DeckDescriptor& rDeckDescriptor, 
SidebarDockingWindow* pParentW
 
 mxVerticalScrollBar->vadjustment_set_step_increment(10);
 mxVerticalScrollBar->vadjustment_set_page_increment(100);
+
+// tdf#142458 Measure the preferred width of an empty ScrolledWindow
+// to add to the width of the union of panel widths when calculating
+// the minimal width of the deck
+mxVerticalScrollBar->set_hpolicy(VclPolicyType::NEVER);
+mxVerticalScrollBar->set_vpolicy(VclPolicyType::NEVER);
+mnScrolledWindowExtraWidth = 
mxVerticalScrollBar->get_preferred_size().Width();
+mxVerticalScrollBar->set_hpolicy(VclPolicyType::AUTOMATIC);
+mxVerticalScrollBar->set_vpolicy(VclPolicyType::AUTOMATIC);
 }
 
 Deck::~Deck()
@@ -192,6 +202,14 @@ void Deck::RequestLayoutInternal()
 DeckLayouter::LayoutDeck(mxParentWindow.get(), GetContentArea(),
  mnMinimalWidth, mnMinimalHeight, maPanels,
  *GetTitleBar(), *mxVerticalScrollBar);
+
+if (mnMinimalWidth)
+{
+// tdf#142458 at this point mnMinimalWidth contains the width required
+// by the panels, but extra space may be needed by the scrolledwindow
+// that will contain the panels
+mnMinimalWidth += mnScrolledWindowExtraWidth;
+}
 }
 
 void Deck::RequestLayout()


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

2021-08-31 Thread Noel Grandin (via logerrit)
 include/sfx2/app.hxx   |3 +--
 sfx2/source/appl/app.cxx   |4 ++--
 sfx2/source/appl/appinit.cxx   |1 -
 sfx2/source/appl/appquit.cxx   |2 +-
 sfx2/source/appl/shellimpl.cxx |   36 
 sfx2/source/inc/appdata.hxx|3 +--
 sfx2/source/inc/shellimpl.hxx  |   21 -
 sfx2/source/view/lokhelper.cxx |   10 +-
 sfx2/source/view/viewsh.cxx|   10 +-
 9 files changed, 15 insertions(+), 75 deletions(-)

New commits:
commit 5d64720ce7571cb491e8c477e3744e1c19894625
Author: Noel Grandin 
AuthorDate: Mon Aug 30 21:43:12 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Aug 31 14:30:01 2021 +0200

flatten SfxViewShellArr_Impl

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

diff --git a/include/sfx2/app.hxx b/include/sfx2/app.hxx
index 824cc65c2559..de32df639728 100644
--- a/include/sfx2/app.hxx
+++ b/include/sfx2/app.hxx
@@ -46,7 +46,6 @@ class SfxObjectShellLock;
 class SfxProgress;
 class SfxSlotPool;
 class SfxViewFrame;
-class SfxViewShellArr_Impl;
 class StarBASIC;
 class SfxWorkWindow;
 class SfxFilterMatcher;
@@ -174,7 +173,7 @@ public:
 SAL_DLLPRIVATE SfxStbCtrlFactory* GetStbCtrlFactory(const std::type_info& 
rSlotType, sal_uInt16 nSlotID) const;
 SAL_DLLPRIVATE SfxChildWinFactory* GetChildWinFactoryById(sal_uInt16 nId) 
const;
 SAL_DLLPRIVATE std::vector& GetViewFrames_Impl() const;
-SAL_DLLPRIVATE SfxViewShellArr_Impl& GetViewShells_Impl() const;
+SAL_DLLPRIVATE std::vector& GetViewShells_Impl() const;
 SAL_DLLPRIVATE SfxObjectShellArr_Impl& GetObjectShells_Impl() const;
 SAL_DLLPRIVATE void SetViewFrame_Impl(SfxViewFrame *pViewFrame);
 
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
index 69b2b9522820..342ee1aa2e70 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -379,9 +379,9 @@ std::vector& 
SfxApplication::GetViewFrames_Impl() const
 return pImpl->maViewFrames;
 }
 
-SfxViewShellArr_Impl&   SfxApplication::GetViewShells_Impl() const
+std::vector& SfxApplication::GetViewShells_Impl() const
 {
-return *pImpl->pViewShells;
+return pImpl->maViewShells;
 }
 
 SfxObjectShellArr_Impl& SfxApplication::GetObjectShells_Impl() const
diff --git a/sfx2/source/appl/appinit.cxx b/sfx2/source/appl/appinit.cxx
index 64fd807c0178..8291239659b7 100644
--- a/sfx2/source/appl/appinit.cxx
+++ b/sfx2/source/appl/appinit.cxx
@@ -208,7 +208,6 @@ void SfxApplication::Initialize_Impl()
 DBG_ASSERT( !pImpl->pAppDispat, "AppDispatcher already exists" );
 pImpl->pAppDispat.reset(new SfxDispatcher);
 pImpl->pSlotPool.reset(new SfxSlotPool);
-pImpl->pViewShells.reset(new SfxViewShellArr_Impl);
 pImpl->pObjShells.reset(new SfxObjectShellArr_Impl);
 
 Registrations_Impl();
diff --git a/sfx2/source/appl/appquit.cxx b/sfx2/source/appl/appquit.cxx
index a16e4d381f31..8a1d3b780f2b 100644
--- a/sfx2/source/appl/appquit.cxx
+++ b/sfx2/source/appl/appquit.cxx
@@ -89,7 +89,7 @@ void SfxApplication::Deinitialize()
 pImpl->maTbxCtrlFactories.clear();
 pImpl->maStbCtrlFactories.clear();
 pImpl->maViewFrames.clear();
-pImpl->pViewShells.reset();
+pImpl->maViewShells.clear();
 pImpl->pObjShells.reset();
 
 //TODO/CLEANUP
diff --git a/sfx2/source/appl/shellimpl.cxx b/sfx2/source/appl/shellimpl.cxx
index 83698a179f75..e2f41e5ef3d8 100644
--- a/sfx2/source/appl/shellimpl.cxx
+++ b/sfx2/source/appl/shellimpl.cxx
@@ -54,40 +54,4 @@ size_t SfxObjectShellArr_Impl::size() const
 return maData.size();
 }
 
-
-SfxViewShellArr_Impl::iterator SfxViewShellArr_Impl::begin()
-{
-return maData.begin();
-}
-
-SfxViewShellArr_Impl::iterator SfxViewShellArr_Impl::end()
-{
-return maData.end();
-}
-
-const SfxViewShell* SfxViewShellArr_Impl::operator[] ( size_t i ) const
-{
-return maData[i];
-}
-
-SfxViewShell* SfxViewShellArr_Impl::operator[] ( size_t i )
-{
-return maData[i];
-}
-
-void SfxViewShellArr_Impl::erase( const iterator& it )
-{
-maData.erase(it);
-}
-
-void SfxViewShellArr_Impl::push_back( SfxViewShell* p )
-{
-maData.push_back(p);
-}
-
-size_t SfxViewShellArr_Impl::size() const
-{
-return maData.size();
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/inc/appdata.hxx b/sfx2/source/inc/appdata.hxx
index 1a68c1a52b66..cd5effc040f7 100644
--- a/sfx2/source/inc/appdata.hxx
+++ b/sfx2/source/inc/appdata.hxx
@@ -99,8 +99,7 @@ public:
 std::vector
 maStbCtrlFactories;
 std::vector  maViewFrames;
-std::unique_ptr
-pViewShells;
+std::vector  maViewShells;
 std::unique_ptr
 pObjShells;
 std::unique_ptr
diff --git a/sfx2/source/inc/shellimpl.hxx b/sfx2/source/inc/shellimpl.hxx
index 

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

2021-08-31 Thread Noel Grandin (via logerrit)
 include/sfx2/app.hxx   |3 +--
 sfx2/source/appl/app.cxx   |4 ++--
 sfx2/source/appl/appinit.cxx   |1 -
 sfx2/source/appl/appquit.cxx   |2 +-
 sfx2/source/appl/shellimpl.cxx |   34 --
 sfx2/source/inc/appdata.hxx|3 +--
 sfx2/source/inc/shellimpl.hxx  |   20 
 sfx2/source/view/viewfrm.cxx   |   13 +
 sfx2/source/view/viewsh.cxx|6 +++---
 9 files changed, 13 insertions(+), 73 deletions(-)

New commits:
commit 4b64d6ac2a186a68f5360d31ae21aefcceb84d12
Author: Noel Grandin 
AuthorDate: Mon Aug 30 21:36:37 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Aug 31 09:15:06 2021 +0200

flatten SfxViewFrameArr_Impl

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

diff --git a/include/sfx2/app.hxx b/include/sfx2/app.hxx
index b2cd45dd5756..824cc65c2559 100644
--- a/include/sfx2/app.hxx
+++ b/include/sfx2/app.hxx
@@ -46,7 +46,6 @@ class SfxObjectShellLock;
 class SfxProgress;
 class SfxSlotPool;
 class SfxViewFrame;
-class SfxViewFrameArr_Impl;
 class SfxViewShellArr_Impl;
 class StarBASIC;
 class SfxWorkWindow;
@@ -174,7 +173,7 @@ public:
 SAL_DLLPRIVATE SfxTbxCtrlFactory* GetTbxCtrlFactory(const std::type_info& 
rSlotType, sal_uInt16 nSlotID) const;
 SAL_DLLPRIVATE SfxStbCtrlFactory* GetStbCtrlFactory(const std::type_info& 
rSlotType, sal_uInt16 nSlotID) const;
 SAL_DLLPRIVATE SfxChildWinFactory* GetChildWinFactoryById(sal_uInt16 nId) 
const;
-SAL_DLLPRIVATE SfxViewFrameArr_Impl& GetViewFrames_Impl() const;
+SAL_DLLPRIVATE std::vector& GetViewFrames_Impl() const;
 SAL_DLLPRIVATE SfxViewShellArr_Impl& GetViewShells_Impl() const;
 SAL_DLLPRIVATE SfxObjectShellArr_Impl& GetObjectShells_Impl() const;
 SAL_DLLPRIVATE void SetViewFrame_Impl(SfxViewFrame *pViewFrame);
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
index 1e45a6ed1586..69b2b9522820 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -374,9 +374,9 @@ SfxStbCtrlFactory* SfxApplication::GetStbCtrlFactory(const 
std::type_info& rSlot
 return nullptr;
 }
 
-SfxViewFrameArr_Impl&   SfxApplication::GetViewFrames_Impl() const
+std::vector& SfxApplication::GetViewFrames_Impl() const
 {
-return *pImpl->pViewFrames;
+return pImpl->maViewFrames;
 }
 
 SfxViewShellArr_Impl&   SfxApplication::GetViewShells_Impl() const
diff --git a/sfx2/source/appl/appinit.cxx b/sfx2/source/appl/appinit.cxx
index 343da98c8585..64fd807c0178 100644
--- a/sfx2/source/appl/appinit.cxx
+++ b/sfx2/source/appl/appinit.cxx
@@ -208,7 +208,6 @@ void SfxApplication::Initialize_Impl()
 DBG_ASSERT( !pImpl->pAppDispat, "AppDispatcher already exists" );
 pImpl->pAppDispat.reset(new SfxDispatcher);
 pImpl->pSlotPool.reset(new SfxSlotPool);
-pImpl->pViewFrames.reset(new SfxViewFrameArr_Impl);
 pImpl->pViewShells.reset(new SfxViewShellArr_Impl);
 pImpl->pObjShells.reset(new SfxObjectShellArr_Impl);
 
diff --git a/sfx2/source/appl/appquit.cxx b/sfx2/source/appl/appquit.cxx
index 1245ef6e1c7d..a16e4d381f31 100644
--- a/sfx2/source/appl/appquit.cxx
+++ b/sfx2/source/appl/appquit.cxx
@@ -88,7 +88,7 @@ void SfxApplication::Deinitialize()
 
 pImpl->maTbxCtrlFactories.clear();
 pImpl->maStbCtrlFactories.clear();
-pImpl->pViewFrames.reset();
+pImpl->maViewFrames.clear();
 pImpl->pViewShells.reset();
 pImpl->pObjShells.reset();
 
diff --git a/sfx2/source/appl/shellimpl.cxx b/sfx2/source/appl/shellimpl.cxx
index 2ef1a7fe31c2..83698a179f75 100644
--- a/sfx2/source/appl/shellimpl.cxx
+++ b/sfx2/source/appl/shellimpl.cxx
@@ -54,40 +54,6 @@ size_t SfxObjectShellArr_Impl::size() const
 return maData.size();
 }
 
-SfxViewFrameArr_Impl::iterator SfxViewFrameArr_Impl::begin()
-{
-return maData.begin();
-}
-
-SfxViewFrameArr_Impl::iterator SfxViewFrameArr_Impl::end()
-{
-return maData.end();
-}
-
-const SfxViewFrame* SfxViewFrameArr_Impl::operator[] ( size_t i ) const
-{
-return maData[i];
-}
-
-SfxViewFrame* SfxViewFrameArr_Impl::operator[] ( size_t i )
-{
-return maData[i];
-}
-
-void SfxViewFrameArr_Impl::erase( const iterator& it )
-{
-maData.erase(it);
-}
-
-void SfxViewFrameArr_Impl::push_back( SfxViewFrame* p )
-{
-maData.push_back(p);
-}
-
-size_t SfxViewFrameArr_Impl::size() const
-{
-return maData.size();
-}
 
 SfxViewShellArr_Impl::iterator SfxViewShellArr_Impl::begin()
 {
diff --git a/sfx2/source/inc/appdata.hxx b/sfx2/source/inc/appdata.hxx
index 589497b757d2..1a68c1a52b66 100644
--- a/sfx2/source/inc/appdata.hxx
+++ b/sfx2/source/inc/appdata.hxx
@@ -98,8 +98,7 @@ public:
 maTbxCtrlFactories;
 std::vector
 maStbCtrlFactories;
-std::unique_ptr
-pViewFrames;
+std::vector  maViewFrames;
 

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

2021-08-31 Thread Noel Grandin (via logerrit)
 include/sfx2/app.hxx|3 +--
 include/sfx2/module.hxx |3 +--
 sfx2/source/appl/app.cxx|8 ++--
 sfx2/source/appl/appinit.cxx|1 -
 sfx2/source/appl/appquit.cxx|2 +-
 sfx2/source/appl/appreg.cxx |6 +++---
 sfx2/source/appl/module.cxx |   21 +++--
 sfx2/source/control/ctrlfactoryimpl.cxx |   20 
 sfx2/source/inc/appdata.hxx |4 ++--
 sfx2/source/inc/ctrlfactoryimpl.hxx |   14 --
 sfx2/source/statbar/stbitem.cxx |   22 ++
 11 files changed, 31 insertions(+), 73 deletions(-)

New commits:
commit 48cff413e21830e3da4df8cb55540e68a4f009a6
Author: Noel Grandin 
AuthorDate: Mon Aug 30 21:00:33 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Aug 31 08:11:05 2021 +0200

flatten SfxStbCtrlFactArr_Impl

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

diff --git a/include/sfx2/app.hxx b/include/sfx2/app.hxx
index 573eef573246..541e9cf94159 100644
--- a/include/sfx2/app.hxx
+++ b/include/sfx2/app.hxx
@@ -45,7 +45,6 @@ class SfxObjectShellArr_Impl;
 class SfxObjectShellLock;
 class SfxProgress;
 class SfxSlotPool;
-class SfxStbCtrlFactArr_Impl;
 class SfxTbxCtrlFactArr_Impl;
 class SfxViewFrame;
 class SfxViewFrameArr_Impl;
@@ -174,7 +173,7 @@ public:
 SAL_DLLPRIVATE void RegisterStatusBarControl_Impl(SfxModule*, 
const SfxStbCtrlFactory&);
 SAL_DLLPRIVATE void RegisterToolBoxControl_Impl( SfxModule*, const 
SfxTbxCtrlFactory&);
 SAL_DLLPRIVATE SfxTbxCtrlFactArr_Impl& GetTbxCtrlFactories_Impl() const;
-SAL_DLLPRIVATE SfxStbCtrlFactArr_Impl& GetStbCtrlFactories_Impl() const;
+SAL_DLLPRIVATE SfxStbCtrlFactory* GetStbCtrlFactory(const std::type_info& 
rSlotType, sal_uInt16 nSlotID) const;
 SAL_DLLPRIVATE SfxChildWinFactory* GetChildWinFactoryById(sal_uInt16 nId) 
const;
 SAL_DLLPRIVATE SfxViewFrameArr_Impl& GetViewFrames_Impl() const;
 SAL_DLLPRIVATE SfxViewShellArr_Impl& GetViewShells_Impl() const;
diff --git a/include/sfx2/module.hxx b/include/sfx2/module.hxx
index 707d03cc4a25..c24d1acac4e9 100644
--- a/include/sfx2/module.hxx
+++ b/include/sfx2/module.hxx
@@ -37,7 +37,6 @@ struct SfxStbCtrlFactory;
 struct SfxTbxCtrlFactory;
 class SfxTabPage;
 class SfxTbxCtrlFactArr_Impl;
-class SfxStbCtrlFactArr_Impl;
 
 namespace com::sun::star::frame {
 class XFrame;
@@ -96,7 +95,7 @@ public:
 FieldUnit   GetFieldUnit() const;
 
 SAL_DLLPRIVATE SfxTbxCtrlFactArr_Impl* GetTbxCtrlFactories_Impl() const;
-SAL_DLLPRIVATE SfxStbCtrlFactArr_Impl* GetStbCtrlFactories_Impl() const;
+SAL_DLLPRIVATE SfxStbCtrlFactory* GetStbCtrlFactory(const std::type_info& 
rSlotType, sal_uInt16 nSlotID) const;
 SAL_DLLPRIVATE SfxChildWinFactory* GetChildWinFactoryById(sal_uInt16 nId) 
const;
 };
 
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
index 6624beb2d078..d226a03b1f6d 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -354,9 +354,13 @@ SfxTbxCtrlFactArr_Impl& 
SfxApplication::GetTbxCtrlFactories_Impl() const
 return *pImpl->pTbxCtrlFac;
 }
 
-SfxStbCtrlFactArr_Impl& SfxApplication::GetStbCtrlFactories_Impl() const
+SfxStbCtrlFactory* SfxApplication::GetStbCtrlFactory(const std::type_info& 
rSlotType, sal_uInt16 nSlotID) const
 {
-return *pImpl->pStbCtrlFac;
+for (auto& rFactory : pImpl->maStbCtrlFactories)
+if ( rFactory.nTypeId == rSlotType &&
+ ( rFactory.nSlotId == 0 || rFactory.nSlotId == nSlotID ) )
+return 
+return nullptr;
 }
 
 SfxViewFrameArr_Impl&   SfxApplication::GetViewFrames_Impl() const
diff --git a/sfx2/source/appl/appinit.cxx b/sfx2/source/appl/appinit.cxx
index 97b85ef84a92..228ef03ec5c3 100644
--- a/sfx2/source/appl/appinit.cxx
+++ b/sfx2/source/appl/appinit.cxx
@@ -210,7 +210,6 @@ void SfxApplication::Initialize_Impl()
 pImpl->pAppDispat.reset(new SfxDispatcher);
 pImpl->pSlotPool.reset(new SfxSlotPool);
 pImpl->pTbxCtrlFac.reset(new SfxTbxCtrlFactArr_Impl);
-pImpl->pStbCtrlFac.reset(new SfxStbCtrlFactArr_Impl);
 pImpl->pViewFrames.reset(new SfxViewFrameArr_Impl);
 pImpl->pViewShells.reset(new SfxViewShellArr_Impl);
 pImpl->pObjShells.reset(new SfxObjectShellArr_Impl);
diff --git a/sfx2/source/appl/appquit.cxx b/sfx2/source/appl/appquit.cxx
index d4716c14d66c..bdd9e2cae08a 100644
--- a/sfx2/source/appl/appquit.cxx
+++ b/sfx2/source/appl/appquit.cxx
@@ -86,7 +86,7 @@ void SfxApplication::Deinitialize()
 pImpl->maFactories.clear();
 
 pImpl->pTbxCtrlFac.reset();
-pImpl->pStbCtrlFac.reset();
+pImpl->maStbCtrlFactories.clear();
 pImpl->pViewFrames.reset();
 pImpl->pViewShells.reset();
 pImpl->pObjShells.reset();
diff --git 

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

2021-08-24 Thread Noel Grandin (via logerrit)
 include/sfx2/lnkbase.hxx  |   14 
 sfx2/source/appl/lnkbase2.cxx |   72 +-
 2 files changed, 38 insertions(+), 48 deletions(-)

New commits:
commit fa15b0e86a5e78a2cb56aa36f161e1b9769e3441
Author: Noel Grandin 
AuthorDate: Tue Aug 24 10:07:14 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Aug 24 21:25:41 2021 +0200

remove one of the pimpls in SvBaseLink

two pimpl's and some internal fields seems a little messy

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

diff --git a/include/sfx2/lnkbase.hxx b/include/sfx2/lnkbase.hxx
index 332702b8893f..38b1ef57dfe2 100644
--- a/include/sfx2/lnkbase.hxx
+++ b/include/sfx2/lnkbase.hxx
@@ -69,21 +69,25 @@ constexpr bool isClientFileType(SvBaseLinkObjectType t)
 return (static_cast(t) & check) == check;
 }
 
-struct BaseLink_Impl;
-
 class SFX2_DLLPUBLIC SvBaseLink : public SvRefBase
 {
 private:
 friend class LinkManager;
 friend class SvLinkSource;
 
+Link  m_aEndEditLink;
+LinkManager*m_pLinkMgr;
+weld::Window*   m_pParentWin;
+std::unique_ptr
+m_pFileDlg;
 SvLinkSourceRef xObj;
 OUStringaLinkName;
-std::unique_ptr  pImpl;
+std::unique_ptr pImplData;
 SvBaseLinkObjectTypemnObjType;
 boolbVisible : 1;
 boolbSynchron : 1;
 boolbWasLastEditOK : 1;
+boolm_bIsConnect : 1;
 
 DECL_LINK( EndEditHdl, const OUString&, void );
 
@@ -95,8 +99,6 @@ protected:
 // Set LinkSourceName without action
 voidSetName( const OUString & rLn );
 
-std::unique_ptr pImplData;
-
 boolm_bIsReadOnly;
 css::uno::Reference
 m_xInputStreamToLoadFrom;
@@ -169,7 +171,7 @@ public:
 voidclearStreamToLoadFrom();
 
 bool WasLastEditOK() const   { return bWasLastEditOK; }
-FileDialogHelper & GetInsertFileDialog(const OUString& rFactory) const;
+FileDialogHelper & GetInsertFileDialog(const OUString& rFactory);
 };
 
 }
diff --git a/sfx2/source/appl/lnkbase2.cxx b/sfx2/source/appl/lnkbase2.cxx
index 8df00b9bd788..7fd3b3d530d5 100644
--- a/sfx2/source/appl/lnkbase2.cxx
+++ b/sfx2/source/appl/lnkbase2.cxx
@@ -41,27 +41,9 @@ namespace sfx2
 {
 
 namespace {
-
-class  ImplDdeItem;
-
+class ImplDdeItem;
 }
 
-struct BaseLink_Impl
-{
-Link m_aEndEditLink;
-LinkManager*m_pLinkMgr;
-weld::Window*   m_pParentWin;
-std::unique_ptr
-m_pFileDlg;
-boolm_bIsConnect;
-
-BaseLink_Impl() :
-  m_pLinkMgr( nullptr )
-, m_pParentWin( nullptr )
-, m_bIsConnect( false )
-{}
-};
-
 // only for internal management
 struct ImplBaseLinkData
 {
@@ -126,8 +108,10 @@ public:
 }
 
 SvBaseLink::SvBaseLink()
-: pImpl ( new BaseLink_Impl ),
-  m_bIsReadOnly(false)
+: m_pLinkMgr( nullptr )
+, m_pParentWin( nullptr )
+, m_bIsConnect( false )
+, m_bIsReadOnly(false)
 {
 mnObjType = SvBaseLinkObjectType::ClientSo;
 pImplData.reset( new ImplBaseLinkData );
@@ -137,8 +121,10 @@ SvBaseLink::SvBaseLink()
 
 
 SvBaseLink::SvBaseLink( SfxLinkUpdateMode nUpdateMode, SotClipboardFormatId 
nContentType )
-   : pImpl( new BaseLink_Impl ),
- m_bIsReadOnly(false)
+: m_pLinkMgr( nullptr )
+, m_pParentWin( nullptr )
+, m_bIsConnect( false )
+, m_bIsReadOnly(false)
 {
 mnObjType = SvBaseLinkObjectType::ClientSo;
 pImplData.reset( new ImplBaseLinkData );
@@ -184,7 +170,9 @@ static DdeTopic* FindTopic( const OUString & rLinkName, 
sal_uInt16* pItemStt )
 }
 
 SvBaseLink::SvBaseLink( const OUString& rLinkName, SvBaseLinkObjectType 
nObjectType, SvLinkSource* pObj )
-: pImpl()
+: m_pLinkMgr( nullptr )
+, m_pParentWin( nullptr )
+, m_bIsConnect( false )
 , m_bIsReadOnly(false)
 {
 bVisible = bSynchron = true;
@@ -241,7 +229,7 @@ IMPL_LINK( SvBaseLink, EndEditHdl, const OUString&, 
_rNewName, void )
 if ( !ExecuteEdit( sNewName ) )
 sNewName.clear();
 bWasLastEditOK = !sNewName.isEmpty();
-pImpl->m_aEndEditLink.Call( *this );
+m_aEndEditLink.Call( *this );
 }
 
 
@@ -364,7 +352,7 @@ SfxLinkUpdateMode SvBaseLink::GetUpdateMode() const
 
 void SvBaseLink::GetRealObject_( bool bConnect)
 {
-if( !pImpl->m_pLinkMgr )
+if( !m_pLinkMgr )
 return;
 
 DBG_ASSERT( !xObj.is(), "object already exist" );
@@ -414,17 +402,17 @@ void SvBaseLink::SetContentType( SotClipboardFormatId 
nType )
 
 LinkManager* SvBaseLink::GetLinkManager()
 {
-return pImpl->m_pLinkMgr;
+return m_pLinkMgr;
 }
 
 const LinkManager* SvBaseLink::GetLinkManager() const
 {
-return pImpl->m_pLinkMgr;
+return m_pLinkMgr;
 }
 
 void 

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

2021-08-18 Thread Szymon Kłos (via logerrit)
 include/sfx2/sidebar/SidebarController.hxx |2 ++
 sfx2/source/sidebar/SidebarController.cxx  |   10 ++
 sfx2/source/sidebar/Theme.cxx  |6 +-
 3 files changed, 13 insertions(+), 5 deletions(-)

New commits:
commit e34ec3e196b3265ea640e1730c7d42dd6182e65f
Author: Szymon Kłos 
AuthorDate: Thu Jul 15 10:35:24 2021 +0200
Commit: Szymon Kłos 
CommitDate: Wed Aug 18 13:18:36 2021 +0200

Don't crash on SidebarController dispose when app is closing

When app is closing it is possible SfxGetpApp() will return null. So
GetCurrentTheme() cannot return reference to correct theme.
Remember which theme has registered SidebarController to unregister when
disposing.

Change-Id: If223233f621601f445472b0413a56e9c51e59673
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118970
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Pranam Lashkari 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120630
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 

diff --git a/include/sfx2/sidebar/SidebarController.hxx 
b/include/sfx2/sidebar/SidebarController.hxx
index 133c1f5806c6..3df8d8fb2e45 100644
--- a/include/sfx2/sidebar/SidebarController.hxx
+++ b/include/sfx2/sidebar/SidebarController.hxx
@@ -29,6 +29,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -194,6 +195,7 @@ private:
 OUString msCurrentDeckId;
 AsynchronousCall maPropertyChangeForwarder;
 AsynchronousCall maContextChangeUpdate;
+css::uno::Reference mxThemePropertySet;
 
 /** Two flags control whether the deck is displayed or if only the
 tab bar remains visible.
diff --git a/sfx2/source/sidebar/SidebarController.cxx 
b/sfx2/source/sidebar/SidebarController.cxx
index 803d1c10a739..c03b2a96acdb 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -157,7 +157,8 @@ rtl::Reference 
SidebarController::create(SidebarDockingWindow
 instance->mpParentWindow->AddEventListener(LINK(instance.get(), 
SidebarController, WindowEventHandler));
 
 // Listen for theme property changes.
-Theme::GetPropertySet()->addPropertyChangeListener(
+instance->mxThemePropertySet = Theme::GetPropertySet();
+instance->mxThemePropertySet->addPropertyChangeListener(
 "",
 static_cast(instance.get()));
 
@@ -312,9 +313,10 @@ void SAL_CALL SidebarController::disposing()
 if (mxReadOnlyModeDispatch.is())
 mxReadOnlyModeDispatch->removeStatusListener(this, 
Tools::GetURL(gsReadOnlyCommandName));
 
-Theme::GetPropertySet()->removePropertyChangeListener(
-"",
-static_cast(this));
+if (mxThemePropertySet.is())
+mxThemePropertySet->removePropertyChangeListener(
+"",
+static_cast(this));
 
 if (mpParentWindow != nullptr)
 {
diff --git a/sfx2/source/sidebar/Theme.cxx b/sfx2/source/sidebar/Theme.cxx
index cd4ce36bd658..6d6fe7bc517f 100644
--- a/sfx2/source/sidebar/Theme.cxx
+++ b/sfx2/source/sidebar/Theme.cxx
@@ -32,6 +32,7 @@ namespace sfx2::sidebar {
 
 Theme& Theme::GetCurrentTheme()
 {
+OSL_ASSERT(SfxGetpApp());
 return SfxGetpApp()->GetSidebarTheme();
 }
 
@@ -177,7 +178,10 @@ void SAL_CALL Theme::disposing()
 
 Reference Theme::GetPropertySet()
 {
-return 
Reference(static_cast(()), 
UNO_QUERY);
+if (SfxGetpApp())
+return 
Reference(static_cast(()), 
UNO_QUERY);
+else
+return Reference();
 }
 
 Reference SAL_CALL Theme::getPropertySetInfo()


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

2021-08-06 Thread Vert D (via logerrit)
 include/sfx2/templatedlg.hxx  |1 
 include/sfx2/templatelocalview.hxx|2 
 sfx2/source/control/templatelocalview.cxx |   36 -
 sfx2/source/doc/templatedlg.cxx   |   83 +++---
 4 files changed, 59 insertions(+), 63 deletions(-)

New commits:
commit 8d8450f0c14db26fb8eb44677c2887e619200904
Author: Vert D 
AuthorDate: Mon May 24 23:01:38 2021 -0500
Commit: Caolán McNamara 
CommitDate: Fri Aug 6 15:15:20 2021 +0200

tdf#139647 refresh renamed items

*Update templates names after rename (faster than reload).
*Fix some warnings.

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

diff --git a/include/sfx2/templatedlg.hxx b/include/sfx2/templatedlg.hxx
index 588a307af139..940973f84f05 100644
--- a/include/sfx2/templatedlg.hxx
+++ b/include/sfx2/templatedlg.hxx
@@ -78,7 +78,6 @@ protected:
 DECL_LINK(ExportTemplateHdl, void*, void);
 
 void SearchUpdate();
-void FilterSearch();
 
 DECL_LINK(SearchUpdateHdl, weld::Entry&, void);
 DECL_LINK(GetFocusHdl, weld::Widget&, void);
diff --git a/include/sfx2/templatelocalview.hxx 
b/include/sfx2/templatelocalview.hxx
index fbf730af6b81..2ad81391e97d 100644
--- a/include/sfx2/templatelocalview.hxx
+++ b/include/sfx2/templatelocalview.hxx
@@ -126,6 +126,8 @@ public:
 
 sal_uInt16 getCurRegionId () const { return mnCurRegionId;}
 
+void setCurRegionId (sal_uInt16 nCurRegionId) { mnCurRegionId = 
nCurRegionId;}
+
 void setOpenRegionHdl(const Link );
 
 void setCreateContextMenuHdl(const Link );
diff --git a/sfx2/source/control/templatelocalview.cxx 
b/sfx2/source/control/templatelocalview.cxx
index 0ba60c0d758b..4d0571eeaca1 100644
--- a/sfx2/source/control/templatelocalview.cxx
+++ b/sfx2/source/control/templatelocalview.cxx
@@ -613,7 +613,41 @@ bool TemplateLocalView::renameItem(ThumbnailViewItem* 
pItem, const OUString& sNe
 nDocId = pDocItem->mnDocId;
 }
 
-return mpDocTemplates->SetName( sNewTitle, nRegionId, nDocId );
+bool bRes = mpDocTemplates->SetName( sNewTitle, nRegionId, nDocId );
+if(bRes)
+{
+for (auto & pRegion : maRegions)
+{
+if (pRegion->mnId == nRegionId + 1 )
+{
+for(auto & aTemplate : pRegion->maTemplates)
+{
+if(aTemplate.nId == nDocId + 1)
+{
+aTemplate.aName = sNewTitle;
+break;
+}
+}
+break;
+}
+}
+OUString sRegionName;
+for (auto & aTemplate : maAllTemplates)
+{
+if (aTemplate.nRegionId == nRegionId && aTemplate.nDocId == nDocId)
+{
+aTemplate.aName = sNewTitle;
+sRegionName = aTemplate.aRegionName;
+break;
+}
+}
+
+OUString sHelpText = SfxResId(STR_TEMPLATE_TOOLTIP);
+sHelpText = (sHelpText.replaceFirst("$1", 
sNewTitle)).replaceFirst("$2", sRegionName);
+pItem->setHelpText(sHelpText);
+pItem->maTitle = sNewTitle;
+}
+return bRes;
 }
 
 void TemplateLocalView::insertItems(const std::vector 
, bool isRegionSelected, bool bShowCategoryInTooltip)
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index c4dbc7c51fff..5f5760ca6f43 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -68,9 +68,7 @@ constexpr OUStringLiteral TM_SETTING_VIEWMODE = u"ViewMode";
 #define MNI_ACTION_DEFAULT_CALC   "default calc"
 #define MNI_ACTION_DEFAULT_IMPRESS   "default impress"
 #define MNI_ACTION_DEFAULT_DRAW   "default draw"
-#define MNI_ACTION_MOVE   "move template"
 #define MNI_ACTION_IMPORT   "import template"
-#define MNI_ACTION_EXPORT   "export template"
 #define MNI_ACTION_EXTENSIONS   "extensions"
 #define MNI_ALL_APPLICATIONS 0
 #define MNI_WRITER   1
@@ -231,10 +229,8 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg(weld::Window 
*pParent)
 fillFolderComboBox();
 
 mxActionBar->set_item_visible(MNI_ACTION_EXTENSIONS, true);
-mxActionBar->set_item_visible(MNI_ACTION_EXPORT, true);
-mxActionBar->set_item_visible(MNI_ACTION_MOVE, true);
-mxActionBar->set_item_visible(MNI_ACTION_RENAME_FOLDER, true);
-mxActionBar->set_item_visible(MNI_ACTION_DELETE_FOLDER, true);
+mxActionBar->set_item_visible(MNI_ACTION_IMPORT, true);
+mxActionBar->set_item_visible(MNI_ACTION_NEW_FOLDER, true);
 
 mxOKButton->set_label(SfxResId(STR_OPEN));
 
@@ -493,18 +489,16 @@ IMPL_LINK_NOARG(SfxTemplateManagerDlg, SelectRegionHdl, 
weld::ComboBox&, void)
 
 if(mxCBFolder->get_active() == 0)
 {
-mxLocalView->showAllTemplates();
 mxActionBar->set_item_sensitive(MNI_ACTION_RENAME_FOLDER, false);
 

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

2021-07-29 Thread Szymon Kłos (via logerrit)
 include/sfx2/sidebar/Deck.hxx |2 -
 include/sfx2/sidebar/SidebarDockingWindow.hxx |5 ---
 sfx2/source/sidebar/Deck.cxx  |   14 ---
 sfx2/source/sidebar/SidebarController.cxx |2 -
 sfx2/source/sidebar/SidebarDockingWindow.cxx  |   33 --
 5 files changed, 56 deletions(-)

New commits:
commit 88d6e6873fe05ada6ee7178811b0b6f0a3f14635
Author: Szymon Kłos 
AuthorDate: Fri Jul 2 12:56:09 2021 +0200
Commit: Szymon Kłos 
CommitDate: Thu Jul 29 22:02:19 2021 +0200

lok sidebar: remove unused code

Change-Id: I88325246d4997d44b4a1ca681627ca00ade1f030
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118285
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119664
Tested-by: Jenkins

diff --git a/include/sfx2/sidebar/Deck.hxx b/include/sfx2/sidebar/Deck.hxx
index 1c6d2faae379..47f3d6434eb2 100644
--- a/include/sfx2/sidebar/Deck.hxx
+++ b/include/sfx2/sidebar/Deck.hxx
@@ -62,8 +62,6 @@ public:
 
 virtual void DataChanged(const DataChangedEvent& rEvent) override;
 
-virtual void Resize() override;
-
 virtual void DumpAsPropertyTree(tools::JsonWriter&) override;
 
 sal_Int32 GetMinimalWidth() const { return mnMinimalWidth; }
diff --git a/include/sfx2/sidebar/SidebarDockingWindow.hxx 
b/include/sfx2/sidebar/SidebarDockingWindow.hxx
index ff7f2d2aff38..9bad1f5a8464 100644
--- a/include/sfx2/sidebar/SidebarDockingWindow.hxx
+++ b/include/sfx2/sidebar/SidebarDockingWindow.hxx
@@ -45,22 +45,17 @@ public:
 /// Force generation of all panels by completion.
 void SyncUpdate();
 
-void NotifyResize();
 auto& GetSidebarController() const { return mpSidebarController; }
 using SfxDockingWindow::Close;
 
 private:
 // Window overridables
 virtual void GetFocus() override;
-virtual void Resize() override;
 
 virtual SfxChildAlignment CheckAlignment (
 SfxChildAlignment eCurrentAlignment,
 SfxChildAlignment eRequestedAlignment) override;
 
-/// Notify LOKit that we closed and release the LOKNotifier.
-void LOKClose();
-
 ::rtl::Reference mpSidebarController;
 bool mbIsReadyToDrag;
 std::unique_ptr mpAccel;
diff --git a/sfx2/source/sidebar/Deck.cxx b/sfx2/source/sidebar/Deck.cxx
index 82c0c8f350c7..7494e99c7feb 100644
--- a/sfx2/source/sidebar/Deck.cxx
+++ b/sfx2/source/sidebar/Deck.cxx
@@ -114,20 +114,6 @@ void Deck::DataChanged(const DataChangedEvent&)
 RequestLayoutInternal();
 }
 
-void Deck::Resize()
-{
-InterimItemWindow::Resize();
-
-if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier())
-{
-std::vector aItems;
-aItems.emplace_back("type", "deck");
-aItems.emplace_back(std::make_pair("position", 
Point(GetOutOffXPixel(), GetOutOffYPixel()).toString()));
-aItems.emplace_back(std::make_pair("size", GetSizePixel().toString()));
-pNotifier->notifyWindow(GetLOKWindowId(), "size_changed", aItems);
-}
-}
-
 /*
  * Get the ordering as is shown in the layout, and our type as 'deck'
  * also elide nested panel windows.
diff --git a/sfx2/source/sidebar/SidebarController.cxx 
b/sfx2/source/sidebar/SidebarController.cxx
index 116af3e8c8bf..b81080c546cd 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -503,8 +503,6 @@ void SidebarController::NotifyResize()
 }
 
 RestrictWidth(nMinimalWidth);
-
-mpParentWindow->NotifyResize();
 }
 
 void SidebarController::ProcessNewWidth (const sal_Int32 nNewWidth)
diff --git a/sfx2/source/sidebar/SidebarDockingWindow.cxx 
b/sfx2/source/sidebar/SidebarDockingWindow.cxx
index f8405e7989a9..48ef151b9d61 100644
--- a/sfx2/source/sidebar/SidebarDockingWindow.cxx
+++ b/sfx2/source/sidebar/SidebarDockingWindow.cxx
@@ -67,9 +67,6 @@ SidebarDockingWindow::~SidebarDockingWindow()
 
 void SidebarDockingWindow::dispose()
 {
-if (comphelper::LibreOfficeKit::isActive())
-LOKClose();
-
 Reference xComponent 
(static_cast(mpSidebarController.get()), UNO_QUERY);
 mpSidebarController.clear();
 if (xComponent.is())
@@ -78,13 +75,6 @@ void SidebarDockingWindow::dispose()
 SfxDockingWindow::dispose();
 }
 
-void SidebarDockingWindow::LOKClose()
-{
-assert(comphelper::LibreOfficeKit::isActive());
-if (GetLOKNotifier())
-ReleaseLOKNotifier();
-}
-
 void SidebarDockingWindow::GetFocus()
 {
 if (mpSidebarController.is())
@@ -104,35 +94,12 @@ bool SidebarDockingWindow::Close()
 return SfxDockingWindow::Close();
 }
 
-void SidebarDockingWindow::Resize()
-{
-SfxDockingWindow::Resize();
-
-NotifyResize();
-}
-
 void SidebarDockingWindow::SyncUpdate()
 {
 if (mpSidebarController.is())
 mpSidebarController->SyncUpdate();
 }
 
-void SidebarDockingWindow::NotifyResize()
-{
-if (!(comphelper::LibreOfficeKit::isActive() && mpSidebarController.is() 
&& 

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

2021-07-22 Thread Luboš Luňák (via logerrit)
 include/sfx2/titledockwin.hxx   |6 --
 sfx2/source/dialog/titledockwin.cxx |   18 +++---
 2 files changed, 3 insertions(+), 21 deletions(-)

New commits:
commit 2f961c7a811bdff66a94c20573798d58b565195a
Author: Luboš Luňák 
AuthorDate: Tue Jun 1 11:56:32 2021 +0200
Commit: Luboš Luňák 
CommitDate: Thu Jul 22 22:03:05 2021 +0200

do not use delayed layout in TitledDockingWindow

The layout is only performed in Paint(), so if something uses
geometry before that happens (may happen with tiled rendering),
then is not up to date. I don't see why delay it anyway, there
seems to be usually just one resize, and only during init I see
two of them, which can presumably be fixed if needed.

Change-Id: I7133f3c6be41bc6480f86d1053b455d42c40b9ba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116529
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/include/sfx2/titledockwin.hxx b/include/sfx2/titledockwin.hxx
index 976c4bb9f665..cb2d73542bac 100644
--- a/include/sfx2/titledockwin.hxx
+++ b/include/sfx2/titledockwin.hxx
@@ -73,7 +73,6 @@ namespace sfx2
 DECL_LINK( OnToolboxItemSelected, ToolBox*, void );
 
 voidimpl_layout();
-voidimpl_scheduleLayout();
 
 private:
 OUStringm_sTitle;
@@ -86,11 +85,6 @@ namespace sfx2
 */
 SvBorderm_aBorder;
 
-/** Remember that a layout is pending, i.e. Resize() has been called
-since the last Paint().
-*/
-boolm_bLayoutPending;
-
 /** Height of the title bar.  Calculated in impl_layout().
 */
 int m_nTitleBarHeight;
diff --git a/sfx2/source/dialog/titledockwin.cxx 
b/sfx2/source/dialog/titledockwin.cxx
index 2ab7833d628a..30dd8907933c 100644
--- a/sfx2/source/dialog/titledockwin.cxx
+++ b/sfx2/source/dialog/titledockwin.cxx
@@ -39,7 +39,6 @@ namespace sfx2
 ,m_aToolbox( VclPtr::Create(this) )
 ,m_aContentWindow( VclPtr::Create(this, WB_DIALOGCONTROL) 
)
 ,m_aBorder( 3, 1, 3, 3 )
-,m_bLayoutPending( false )
 ,m_nTitleBarHeight(0)
 {
 SetBackground( Wallpaper() );
@@ -83,20 +82,12 @@ namespace sfx2
 void TitledDockingWindow::Resize()
 {
 SfxDockingWindow::Resize();
-impl_scheduleLayout();
-}
-
-
-void TitledDockingWindow::impl_scheduleLayout()
-{
-m_bLayoutPending = true;
+impl_layout();
 }
 
 
 void TitledDockingWindow::impl_layout()
 {
-m_bLayoutPending = false;
-
 m_aToolbox->ShowItem( ToolBoxItemId(1), !IsFloatingMode() );
 
 const Size aToolBoxSize( m_aToolbox->CalcWindowSizePixel() );
@@ -143,9 +134,6 @@ namespace sfx2
 {
 const StyleSettings& rStyleSettings = 
rRenderContext.GetSettings().GetStyleSettings();
 
-if (m_bLayoutPending)
-impl_layout();
-
 SfxDockingWindow::Paint(rRenderContext, i_rArea);
 
 rRenderContext.Push(PushFlags::FONT | PushFlags::FILLCOLOR | 
PushFlags::LINECOLOR);
@@ -240,7 +228,7 @@ namespace sfx2
 switch ( i_nType )
 {
 case StateChangedType::InitShow:
-impl_scheduleLayout();
+impl_layout();
 break;
 default:;
 }
@@ -260,7 +248,7 @@ namespace sfx2
 case DataChangedEventType::FONTS:
 case DataChangedEventType::FONTSUBSTITUTION:
 {
-impl_scheduleLayout();
+impl_layout();
 Invalidate();
 }
 break;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-07-14 Thread Andrea Gelmini (via logerrit)
 include/sfx2/viewfrm.hxx |2 +-
 sfx2/source/view/viewfrm.cxx |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 6c94eeb92fa0ea14814175276f35a25512cc6f2b
Author: Andrea Gelmini 
AuthorDate: Wed Jul 14 18:13:09 2021 +0200
Commit: Julien Nabet 
CommitDate: Wed Jul 14 20:35:19 2021 +0200

Fix typo in code

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

diff --git a/include/sfx2/viewfrm.hxx b/include/sfx2/viewfrm.hxx
index 1bd0cbca39eb..1e3bc1b19796 100644
--- a/include/sfx2/viewfrm.hxx
+++ b/include/sfx2/viewfrm.hxx
@@ -67,7 +67,7 @@ class SFX2_DLLPUBLIC SfxViewFrame final : public SfxShell, 
public SfxListener
 DECL_LINK(SwitchReadOnlyHandler, weld::Button&, void);
 DECL_LINK(SignDocumentHandler, weld::Button&, void);
 DECL_LINK(HiddenTrackChangesHandler, weld::Button&, void);
-DECL_LINK(HypenationMissingHandler, weld::Button&, void);
+DECL_LINK(HyphenationMissingHandler, weld::Button&, void);
 SAL_DLLPRIVATE void KillDispatcher_Impl();
 
 virtual ~SfxViewFrame() override;
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 37b090429425..95d1d5d1dfeb 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -1510,7 +1510,7 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const 
SfxHint& rHint )
 weld::Button& rHyphenationButton = 
pInfoBar->addButton();
 
rHyphenationButton.set_label(SfxResId(STR_HYPHENATION_BUTTON));
 rHyphenationButton.connect_clicked(LINK(this,
-   SfxViewFrame, 
HypenationMissingHandler));
+   SfxViewFrame, 
HyphenationMissingHandler));
 }
 
 aPendingInfobars.pop_back();
@@ -1653,7 +1653,7 @@ IMPL_LINK(SfxViewFrame, HiddenTrackChangesHandler, 
weld::Button&, rButton, void)
 }
 }
 
-IMPL_LINK_NOARG(SfxViewFrame, HypenationMissingHandler, weld::Button&, void)
+IMPL_LINK_NOARG(SfxViewFrame, HyphenationMissingHandler, weld::Button&, void)
 {
 GetDispatcher()->Execute(SID_HYPHENATIONMISSING);
 RemoveInfoBar(u"hyphenationmissing");
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-07-06 Thread Caolán McNamara (via logerrit)
 include/sfx2/sidebar/Deck.hxx  |2 +-
 include/sfx2/sidebar/Panel.hxx |6 +++---
 sfx2/source/sidebar/Deck.cxx   |2 +-
 sfx2/source/sidebar/Panel.cxx  |6 +++---
 sfx2/uiconfig/ui/panel.ui  |   14 --
 5 files changed, 16 insertions(+), 14 deletions(-)

New commits:
commit 93bda63aaadedda64dfb8f4a6f9d7f3a08d49aab
Author: Caolán McNamara 
AuthorDate: Tue Jul 6 12:34:45 2021 +0100
Commit: Caolán McNamara 
CommitDate: Tue Jul 6 16:46:54 2021 +0200

use box instead of grid

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

diff --git a/include/sfx2/sidebar/Deck.hxx b/include/sfx2/sidebar/Deck.hxx
index a3d3a63aff01..1c6d2faae379 100644
--- a/include/sfx2/sidebar/Deck.hxx
+++ b/include/sfx2/sidebar/Deck.hxx
@@ -80,7 +80,7 @@ private:
 VclPtr mxParentWindow;
 std::unique_ptr mxTitleBar;
 std::unique_ptr mxVerticalScrollBar;
-std::unique_ptr mxContents;
+std::unique_ptr mxContents;
 };
 
 } // end of namespace sfx2::sidebar
diff --git a/include/sfx2/sidebar/Panel.hxx b/include/sfx2/sidebar/Panel.hxx
index 8ab43b330130..485063f2152d 100644
--- a/include/sfx2/sidebar/Panel.hxx
+++ b/include/sfx2/sidebar/Panel.hxx
@@ -61,7 +61,7 @@ public:
 ~Panel();
 
 PanelTitleBar* GetTitleBar() const;
-weld::Container* GetContents() const;
+weld::Box* GetContents() const;
 void Show(bool bShow);
 bool IsTitleBarOptional() const { return mbIsTitleBarOptional; }
 void SetUIElement(const css::uno::Reference& 
rxElement);
@@ -108,9 +108,9 @@ private:
 const css::uno::Reference& mxFrame;
 weld::Widget* mpParentWindow;
 VclPtr mxDeck;
-std::unique_ptr mxContainer;
+std::unique_ptr mxContainer;
 std::unique_ptr mxTitleBar;
-std::unique_ptr mxContents;
+std::unique_ptr mxContents;
 css::uno::Reference mxXWindow;
 
 DECL_LINK(DumpAsPropertyTreeHdl, tools::JsonWriter&, void);
diff --git a/sfx2/source/sidebar/Deck.cxx b/sfx2/source/sidebar/Deck.cxx
index 074a0bad7466..394c767001c2 100644
--- a/sfx2/source/sidebar/Deck.cxx
+++ b/sfx2/source/sidebar/Deck.cxx
@@ -51,7 +51,7 @@ Deck::Deck(const DeckDescriptor& rDeckDescriptor, 
SidebarDockingWindow* pParentW
 , mxParentWindow(pParentWindow)
 , mxTitleBar(new DeckTitleBar(rDeckDescriptor.msTitle, *m_xBuilder, 
rCloserAction))
 , mxVerticalScrollBar(m_xBuilder->weld_scrolled_window("scrolledwindow"))
-, mxContents(m_xBuilder->weld_container("contents"))
+, mxContents(m_xBuilder->weld_box("contents"))
 {
 SetStyle(GetStyle() | WB_DIALOGCONTROL);
 
diff --git a/sfx2/source/sidebar/Panel.cxx b/sfx2/source/sidebar/Panel.cxx
index 2d799a32d10a..61b9370f8e26 100644
--- a/sfx2/source/sidebar/Panel.cxx
+++ b/sfx2/source/sidebar/Panel.cxx
@@ -63,9 +63,9 @@ Panel::Panel(const PanelDescriptor& rPanelDescriptor,
 , mxFrame(rxFrame)
 , mpParentWindow(pParentWindow)
 , mxDeck(pDeck)
-, mxContainer(mxBuilder->weld_container("Panel"))
+, mxContainer(mxBuilder->weld_box("Panel"))
 , mxTitleBar(new PanelTitleBar(rPanelDescriptor.msTitle, *mxBuilder, this))
-, mxContents(mxBuilder->weld_container("contents"))
+, mxContents(mxBuilder->weld_box("contents"))
 {
 mxContents->set_visible(mbIsExpanded);
 mxContainer->connect_get_property_tree(LINK(this, Panel, 
DumpAsPropertyTreeHdl));
@@ -149,7 +149,7 @@ PanelTitleBar* Panel::GetTitleBar() const
 return mxTitleBar.get();
 }
 
-weld::Container* Panel::GetContents() const
+weld::Box* Panel::GetContents() const
 {
 return mxContents.get();
 }
diff --git a/sfx2/uiconfig/ui/panel.ui b/sfx2/uiconfig/ui/panel.ui
index b6995f386bbd..769acfddc2b2 100644
--- a/sfx2/uiconfig/ui/panel.ui
+++ b/sfx2/uiconfig/ui/panel.ui
@@ -2,10 +2,10 @@
 
 
   
-  
-  
+  
 True
 False
+vertical
 
   
 True
@@ -96,8 +96,9 @@
 
   
   
-0
-0
+False
+True
+0
   
 
 
@@ -111,8 +112,9 @@
 
   
   
-0
-1
+False
+True
+1
   
 
   
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-07-06 Thread Caolán McNamara (via logerrit)
 include/sfx2/sidebar/TabBar.hxx|2 
 sfx2/source/sidebar/TabBar.cxx |2 
 sfx2/uiconfig/ui/tabbarcontents.ui |   82 +
 3 files changed, 49 insertions(+), 37 deletions(-)

New commits:
commit c420b05745a507d6649c84279b6de5455d7d6ecb
Author: Caolán McNamara 
AuthorDate: Tue Jul 6 12:22:30 2021 +0100
Commit: Caolán McNamara 
CommitDate: Tue Jul 6 15:20:55 2021 +0200

gtk4: insert an intermediate GtkBox as 'toplevel'

so we only have to concern outselves about GtkBox and GtkGrid as
containers

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

diff --git a/include/sfx2/sidebar/TabBar.hxx b/include/sfx2/sidebar/TabBar.hxx
index 4c9b30e3f6e8..d788f9f01c1b 100644
--- a/include/sfx2/sidebar/TabBar.hxx
+++ b/include/sfx2/sidebar/TabBar.hxx
@@ -92,7 +92,7 @@ private:
 // gtk will warn on loading a .ui with an accelerator defined, so use a
 // temporary toplevel to suppress that and move the contents after load
 std::unique_ptr mxAuxBuilder;
-std::unique_ptr mxTempToplevel;
+std::unique_ptr mxTempToplevel;
 std::unique_ptr mxContents;
 
 std::unique_ptr mxMenuButton;
diff --git a/sfx2/source/sidebar/TabBar.cxx b/sfx2/source/sidebar/TabBar.cxx
index eda97378bcae..a233519f4752 100644
--- a/sfx2/source/sidebar/TabBar.cxx
+++ b/sfx2/source/sidebar/TabBar.cxx
@@ -48,7 +48,7 @@ TabBar::TabBar(vcl::Window* pParentWindow,
 : InterimItemWindow(pParentWindow, "sfx/ui/tabbar.ui", "TabBar")
 , mxFrame(rxFrame)
 , mxAuxBuilder(Application::CreateBuilder(m_xContainer.get(), 
"sfx/ui/tabbarcontents.ui"))
-, mxTempToplevel(mxAuxBuilder->weld_container("toplevel"))
+, mxTempToplevel(mxAuxBuilder->weld_box("toplevel"))
 , mxContents(mxAuxBuilder->weld_widget("TabBarContents"))
 , mxMenuButton(mxAuxBuilder->weld_menu_button("menubutton"))
 , mxMainMenu(mxAuxBuilder->weld_menu("mainmenu"))
diff --git a/sfx2/uiconfig/ui/tabbarcontents.ui 
b/sfx2/uiconfig/ui/tabbarcontents.ui
index 31a8ceb818b4..d1fe113122b4 100644
--- a/sfx2/uiconfig/ui/tabbarcontents.ui
+++ b/sfx2/uiconfig/ui/tabbarcontents.ui
@@ -1,5 +1,5 @@
 
-
+
 
   
   
@@ -72,65 +72,77 @@
   
 
   
-  
+  
 False
 
-  
+  
 True
 False
 vertical
 
-  
+  
 True
 False
-2
 vertical
 
-  
-True
-True
-True
-Sidebar Settings
-center
-center
-3
-image6
-none
-True
-mainmenu
-False
-  
-  
-False
-True
-0
-  
-
-
-  
+  
 True
 False
-center
+2
 vertical
-icons
-False
 
-  
+  
+True
+True
+True
+Sidebar Settings
+center
+center
+3
+image6
+none
+True
+mainmenu
+False
+  
+  
+False
+True
+0
+  
+
+
+  
 True
 False
-True
-sfx2/res/symphony/sidebar-property-large.png
+center
+vertical
+icons
+False
+
+  
+True
+False
+True
+sfx2/res/symphony/sidebar-property-large.png
+  
+  
+False
+True
+  
+
   
   
 False
-True
+True
+1
   
 
   
   
 False
 True
-1
+0
   
 
   
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-07-06 Thread Andrea Gelmini (via logerrit)
 include/sfx2/strings.hrc|2 +-
 sfx2/source/doc/templatedlg.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 25598c819b9a591f2fad1ec6ea2c8729027c9e3f
Author: Andrea Gelmini 
AuthorDate: Mon Jul 5 19:47:27 2021 +0200
Commit: Andrea Gelmini 
CommitDate: Tue Jul 6 09:00:22 2021 +0200

Fix typo in code

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

diff --git a/include/sfx2/strings.hrc b/include/sfx2/strings.hrc
index 676ff541059b..d8af44e6a2e9 100644
--- a/include/sfx2/strings.hrc
+++ b/include/sfx2/strings.hrc
@@ -353,7 +353,7 @@
 #define STR_RECENT  NC_("STR_RECENT", "Recently 
used")
 #define STR_NORECENTNC_("STR_NORECENT", "No recent 
characters")
 
-#define STR_ACTION_RESET_ALL_DEAULT_TEMPLATES   
NC_("STR_ACTION_RESET_ALL_DEAULT_TEMPLATES","Reset All De~fault Templates")
+#define STR_ACTION_RESET_ALL_DEFAULT_TEMPLATES  
NC_("STR_ACTION_RESET_ALL_DEFAULT_TEMPLATES","Reset All De~fault Templates")
 #define STR_ACTION_RESET_WRITER_TEMPLATE
NC_("STR_ACTION_RESET_WRITER_TEMPLATE","Reset De~fault Text Document")
 #define STR_ACTION_RESET_CALC_TEMPLATE  
NC_("STR_ACTION_RESET_CALC_TEMPLATE","Reset De~fault Spreadsheet")
 #define STR_ACTION_RESET_IMPRESS_TEMPLATE   
NC_("STR_ACTION_RESET_IMPRESS_TEMPLATE","Reset De~fault Presentation")
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 34011c454f3a..b7390e2dd359 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -180,7 +180,7 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg(weld::Window 
*pParent)
 mxActionBar->append_item(MNI_ACTION_DELETE_FOLDER, 
SfxResId(STR_CATEGORY_DELETE), BMP_ACTION_DELETE_CATEGORY);
 mxActionBar->append_separator("separator");
 mxActionBar->append_item(MNI_ACTION_REFRESH, SfxResId(STR_ACTION_REFRESH), 
BMP_ACTION_REFRESH);
-mxActionBar->append_item(MNI_ACTION_DEFAULT, 
SfxResId(STR_ACTION_RESET_ALL_DEAULT_TEMPLATES));
+mxActionBar->append_item(MNI_ACTION_DEFAULT, 
SfxResId(STR_ACTION_RESET_ALL_DEFAULT_TEMPLATES));
 mxActionBar->append_item(MNI_ACTION_DEFAULT_WRITER, 
SfxResId(STR_ACTION_RESET_WRITER_TEMPLATE), BMP_ACTION_DEFAULT_WRITER);
 mxActionBar->append_item(MNI_ACTION_DEFAULT_CALC, 
SfxResId(STR_ACTION_RESET_CALC_TEMPLATE), BMP_ACTION_DEFAULT_CALC);
 mxActionBar->append_item(MNI_ACTION_DEFAULT_IMPRESS, 
SfxResId(STR_ACTION_RESET_IMPRESS_TEMPLATE), BMP_ACTION_DEFAULT_IMPRESS);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-07-01 Thread Noel Grandin (via logerrit)
 include/sfx2/filedlghelper.hxx   |8 +---
 sfx2/source/appl/appopen.cxx |4 ++--
 sfx2/source/dialog/filedlghelper.cxx |   18 +-
 sfx2/source/dialog/filedlgimpl.hxx   |2 +-
 sfx2/source/doc/guisaveas.cxx|6 +++---
 5 files changed, 20 insertions(+), 18 deletions(-)

New commits:
commit 5021a10f75870e7fa8f34e58512fd7c027debc68
Author: Noel Grandin 
AuthorDate: Thu Jul 1 10:29:22 2021 +0200
Commit: Noel Grandin 
CommitDate: Thu Jul 1 15:00:16 2021 +0200

sfx2::FileDialogHelper allocate SfxItemSet on stack

and pass around the explicit sub-type, instead of doing static_cast in
various places

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

diff --git a/include/sfx2/filedlghelper.hxx b/include/sfx2/filedlghelper.hxx
index 356beb49c4ff..4985b7bf045e 100644
--- a/include/sfx2/filedlghelper.hxx
+++ b/include/sfx2/filedlghelper.hxx
@@ -32,6 +32,7 @@
 #include 
 
 #include 
+#include 
 #include 
 
 namespace com::sun::star::ui::dialogs
@@ -49,6 +50,7 @@ namespace weld { class Window; }
 class Graphic;
 class SfxFilter;
 class SfxItemSet;
+class SfxAllItemSet;
 
 enum class FileDialogFlags {
 NONE  = 0x00,
@@ -222,10 +224,10 @@ public:
DECL_LINK( ExecuteSystemFilePicker, void*, void );
 
ErrCode  Execute( std::vector& rpURLList,
- std::unique_ptr& rpSet,
+ std::optional& rpSet,
  OUString& rFilter,
  const OUString&   rDirPath );
-   ErrCode  Execute( std::unique_ptr& rpSet,
+   ErrCode  Execute( std::optional& rpSet,
  OUString& rFilter );
 };
 
@@ -239,7 +241,7 @@ ErrCode FileOpenDialog_Impl( weld::Window* pParent,
  FileDialogFlags nFlags,
  std::vector& rpURLList,
  OUString& rFilter,
- std::unique_ptr& rpSet,
+ std::optional& rpSet,
  const OUString* pPath,
  sal_Int16 nDialog,
  const OUString& rStandardDir,
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index 08431c29eaaa..f26b88a1b06c 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -608,7 +608,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
 // get FileName from dialog
 std::vector aURLList;
 OUString aFilter;
-std::unique_ptr pSet;
+std::optional pSet;
 OUString aPath;
 const SfxStringItem* pFolderNameItem = 
rReq.GetArg(SID_PATH);
 if ( pFolderNameItem )
@@ -662,7 +662,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
 return;
 }
 
-rReq.SetArgs( *static_cast(pSet.get()) );
+rReq.SetArgs( *pSet );
 if ( !aFilter.isEmpty() )
 rReq.AppendItem( SfxStringItem( SID_FILTER_NAME, aFilter ) );
 rReq.AppendItem( SfxStringItem( SID_TARGETNAME, "_default" ) );
diff --git a/sfx2/source/dialog/filedlghelper.cxx 
b/sfx2/source/dialog/filedlghelper.cxx
index 939863816142..c388b909a3a4 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -1395,7 +1395,7 @@ void FileDialogHelper_Impl::implGetAndCacheFiles(const 
uno::Reference< XInterfac
 }
 
 ErrCode FileDialogHelper_Impl::execute( std::vector& rpURLList,
-std::unique_ptr& rpSet,
+std::optional& rpSet,
 OUString&   rFilter )
 {
 // rFilter is a pure output parameter, it shouldn't be used for anything 
else
@@ -1411,15 +1411,15 @@ ErrCode FileDialogHelper_Impl::execute( 
std::vector& rpURLList,
 // check password checkbox if the document had password before
 if( mbHasPassword )
 {
-const SfxBoolItem* pPassItem = 
SfxItemSet::GetItem(rpSet.get(), SID_PASSWORDINTERACTION, false);
+const SfxBoolItem* pPassItem = 
SfxItemSet::GetItem(&*rpSet, SID_PASSWORDINTERACTION, false);
 mbPwdCheckBoxState = ( pPassItem != nullptr && 
pPassItem->GetValue() );
 
 // in case the document has password to modify, the dialog should 
be shown
-const SfxUnoAnyItem* pPassToModifyItem = 
SfxItemSet::GetItem(rpSet.get(), SID_MODIFYPASSWORDINFO, false);
+const SfxUnoAnyItem* pPassToModifyItem = 
SfxItemSet::GetItem(&*rpSet, SID_MODIFYPASSWORDINFO, false);
 mbPwdCheckBoxState |= ( pPassToModifyItem && 
pPassToModifyItem->GetValue().hasValue() );
 }
 
-const 

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

2021-07-01 Thread Noel Grandin (via logerrit)
 include/sfx2/bindings.hxx|3 ++-
 sfx2/source/control/bindings.cxx |   14 +++---
 2 files changed, 9 insertions(+), 8 deletions(-)

New commits:
commit c94d45cd08e2d5db5c007b9a77352f7621f84a09
Author: Noel Grandin 
AuthorDate: Thu Jul 1 10:11:40 2021 +0200
Commit: Noel Grandin 
CommitDate: Thu Jul 1 14:24:44 2021 +0200

can pass this SfxItemSet around on the stack

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

diff --git a/include/sfx2/bindings.hxx b/include/sfx2/bindings.hxx
index f4f44bd1af7a..47b904d6d113 100644
--- a/include/sfx2/bindings.hxx
+++ b/include/sfx2/bindings.hxx
@@ -23,6 +23,7 @@
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -101,7 +102,7 @@ private:
 SfxCallMode nCall, const SfxPoolItem 
**pInternalArgs, bool bGlobalOnly=false);
 SAL_DLLPRIVATE void SetSubBindings_Impl( SfxBindings* );
 SAL_DLLPRIVATE void UpdateSlotServer_Impl(); // Update SlotServer
-SAL_DLLPRIVATE std::unique_ptr CreateSet_Impl(SfxStateCache& 
rCache, const SfxSlot* ,
+SAL_DLLPRIVATE std::optional CreateSet_Impl(SfxStateCache& 
rCache, const SfxSlot* ,
   const SfxSlotServer**, 
SfxFoundCacheArr_Impl&);
 SAL_DLLPRIVATE std::size_t GetSlotPos( sal_uInt16 nId, std::size_t 
nStartSearchAt = 0 );
 SAL_DLLPRIVATE void Update_Impl(SfxStateCache& rCache);
diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx
index b75d0dbcae02..ca8366f26539 100644
--- a/sfx2/source/control/bindings.cxx
+++ b/sfx2/source/control/bindings.cxx
@@ -252,7 +252,7 @@ void SfxBindings::Update_Impl(SfxStateCache& rCache /*The 
up to date SfxStatusCa
 const SfxSlot *pRealSlot = nullptr;
 const SfxSlotServer* pMsgServer = nullptr;
 SfxFoundCacheArr_Impl aFound;
-std::unique_ptr pSet = CreateSet_Impl(rCache, pRealSlot, 
, aFound);
+std::optional pSet = CreateSet_Impl(rCache, pRealSlot, 
, aFound);
 bool bUpdated = false;
 if ( pSet )
 {
@@ -1090,7 +1090,7 @@ void SfxBindings::UpdateSlotServer_Impl()
 }
 
 
-std::unique_ptr SfxBindings::CreateSet_Impl
+std::optional SfxBindings::CreateSet_Impl
 (
 SfxStateCache&  rCache, // in: Status-Cache from nId
 const SfxSlot*& pRealSlot,  // out: RealSlot to nId
@@ -1103,7 +1103,7 @@ std::unique_ptr SfxBindings::CreateSet_Impl
 
 const SfxSlotServer* pMsgSvr = rCache.GetSlotServer(*pDispatcher, 
pImpl->xProv);
 if (!pMsgSvr)
-return nullptr;
+return {};
 
 pRealSlot = nullptr;
 *pMsgServer = pMsgSvr;
@@ -,7 +,7 @@ std::unique_ptr SfxBindings::CreateSet_Impl
 sal_uInt16 nShellLevel = pMsgSvr->GetShellLevel();
 SfxShell *pShell = pDispatcher->GetShell( nShellLevel );
 if ( !pShell ) // rare GPF when browsing through update from Inet-Notify
-return nullptr;
+return {};
 
 SfxItemPool  = pShell->GetPool();
 
@@ -1167,7 +1167,7 @@ std::unique_ptr SfxBindings::CreateSet_Impl
 
 // Create a Set from the ranges
 size_t i = 0;
-auto pSet(std::make_unique(rPool, nullptr));
+SfxItemSet aSet(rPool, nullptr);
 while ( i < rFound.size() )
 {
 const sal_uInt16 nWhich1 = rFound[i].nWhichId;
@@ -1176,9 +1176,9 @@ std::unique_ptr SfxBindings::CreateSet_Impl
 if ( rFound[i].nWhichId+1 != rFound[i+1].nWhichId )
 break;
 const sal_uInt16 nWhich2 = rFound[i++].nWhichId;
-pSet->MergeRange(nWhich1, nWhich2);
+aSet.MergeRange(nWhich1, nWhich2);
 }
-return pSet;
+return aSet;
 }
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-05-19 Thread Caolán McNamara (via logerrit)
 include/sfx2/printopt.hxx   |6 +++---
 include/sfx2/templatedlg.hxx|4 ++--
 sfx2/source/dialog/printopt.cxx |   12 ++--
 sfx2/source/dialog/templdlg.cxx |4 ++--
 sfx2/source/dialog/versdlg.cxx  |   16 ++--
 sfx2/source/doc/templatedlg.cxx |8 
 sfx2/source/inc/templdgi.hxx|2 +-
 sfx2/source/inc/versdlg.hxx |1 +
 8 files changed, 29 insertions(+), 24 deletions(-)

New commits:
commit 747394659c5f0aa71053d84fc9fc4bee75fc34ef
Author: Caolán McNamara 
AuthorDate: Wed May 19 14:16:46 2021 +0100
Commit: Caolán McNamara 
CommitDate: Wed May 19 17:07:09 2021 +0200

use toggle instead of click for ToggleButton

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

diff --git a/include/sfx2/printopt.hxx b/include/sfx2/printopt.hxx
index d93284f345a5..2a9992d26daf 100644
--- a/include/sfx2/printopt.hxx
+++ b/include/sfx2/printopt.hxx
@@ -60,9 +60,9 @@ private:
 DECL_DLLPRIVATE_LINK( ToggleOutputPrinterRBHdl, 
weld::ToggleButton&, void );
 DECL_DLLPRIVATE_LINK( ToggleOutputPrintFileRBHdl, 
weld::ToggleButton&, void);
 
-DECL_DLLPRIVATE_LINK( ClickReduceTransparencyCBHdl, 
weld::Button&, void );
-DECL_DLLPRIVATE_LINK( ClickReduceGradientsCBHdl, 
weld::Button&, void );
-DECL_DLLPRIVATE_LINK( ClickReduceBitmapsCBHdl, 
weld::Button&, void );
+DECL_DLLPRIVATE_LINK( ClickReduceTransparencyCBHdl, 
weld::ToggleButton&, void );
+DECL_DLLPRIVATE_LINK( ClickReduceGradientsCBHdl, 
weld::ToggleButton&, void );
+DECL_DLLPRIVATE_LINK( ClickReduceBitmapsCBHdl, 
weld::ToggleButton&, void );
 
 DECL_DLLPRIVATE_LINK( 
ToggleReduceGradientsStripesRBHdl, weld::ToggleButton&, void );
 DECL_DLLPRIVATE_LINK( 
ToggleReduceBitmapsResolutionRBHdl, weld::ToggleButton&, void );
diff --git a/include/sfx2/templatedlg.hxx b/include/sfx2/templatedlg.hxx
index 05a693611603..c83b2ab05880 100644
--- a/include/sfx2/templatedlg.hxx
+++ b/include/sfx2/templatedlg.hxx
@@ -86,8 +86,8 @@ protected:
 DECL_LINK(ImplUpdateDataHdl, Timer*, void);
 DECL_LINK(KeyInputHdl, const KeyEvent&, bool);
 
-DECL_LINK(ListViewHdl, weld::Button&, void);
-DECL_LINK(ThumbnailViewHdl, weld::Button&, void);
+DECL_LINK(ListViewHdl, weld::ToggleButton&, void);
+DECL_LINK(ThumbnailViewHdl, weld::ToggleButton&, void);
 DECL_LINK(FocusRectLocalHdl, weld::Widget&, tools::Rectangle);
 DECL_LINK(FocusRectSearchHdl, weld::Widget&, tools::Rectangle);
 
diff --git a/sfx2/source/dialog/printopt.cxx b/sfx2/source/dialog/printopt.cxx
index 5f4025fb57c0..2b106f9c5081 100644
--- a/sfx2/source/dialog/printopt.cxx
+++ b/sfx2/source/dialog/printopt.cxx
@@ -72,9 +72,9 @@ 
SfxCommonPrintOptionsTabPage::SfxCommonPrintOptionsTabPage(weld::Container* pPag
 m_xPrinterOutputRB->connect_toggled( LINK( this, 
SfxCommonPrintOptionsTabPage, ToggleOutputPrinterRBHdl ) );
 m_xPrintFileOutputRB->connect_toggled( LINK( this, 
SfxCommonPrintOptionsTabPage, ToggleOutputPrintFileRBHdl ) );
 
-m_xReduceTransparencyCB->connect_clicked( LINK( this, 
SfxCommonPrintOptionsTabPage, ClickReduceTransparencyCBHdl ) );
-m_xReduceGradientsCB->connect_clicked( LINK( this, 
SfxCommonPrintOptionsTabPage, ClickReduceGradientsCBHdl ) );
-m_xReduceBitmapsCB->connect_clicked( LINK( this, 
SfxCommonPrintOptionsTabPage, ClickReduceBitmapsCBHdl ) );
+m_xReduceTransparencyCB->connect_toggled( LINK( this, 
SfxCommonPrintOptionsTabPage, ClickReduceTransparencyCBHdl ) );
+m_xReduceGradientsCB->connect_toggled( LINK( this, 
SfxCommonPrintOptionsTabPage, ClickReduceGradientsCBHdl ) );
+m_xReduceBitmapsCB->connect_toggled( LINK( this, 
SfxCommonPrintOptionsTabPage, ClickReduceBitmapsCBHdl ) );
 
 m_xReduceGradientsStripesRB->connect_toggled( LINK( this, 
SfxCommonPrintOptionsTabPage, ToggleReduceGradientsStripesRBHdl ) );
 m_xReduceBitmapsResolutionRB->connect_toggled( LINK( this, 
SfxCommonPrintOptionsTabPage, ToggleReduceBitmapsResolutionRBHdl ) );
@@ -216,7 +216,7 @@ void SfxCommonPrintOptionsTabPage::ImplSaveControls( 
PrinterOptions* pCurrentOpt
 }
 }
 
-IMPL_LINK_NOARG( SfxCommonPrintOptionsTabPage, ClickReduceTransparencyCBHdl, 
weld::Button&, void )
+IMPL_LINK_NOARG( SfxCommonPrintOptionsTabPage, ClickReduceTransparencyCBHdl, 
weld::ToggleButton&, void )
 {
 const bool bReduceTransparency = m_xReduceTransparencyCB->get_active();
 
@@ -226,7 +226,7 @@ IMPL_LINK_NOARG( SfxCommonPrintOptionsTabPage, 
ClickReduceTransparencyCBHdl, wel
 m_xTransparencyCB->set_sensitive( !bReduceTransparency );
 }
 
-IMPL_LINK_NOARG( SfxCommonPrintOptionsTabPage, ClickReduceGradientsCBHdl, 
weld::Button&, void )
+IMPL_LINK_NOARG( 

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

2021-05-17 Thread Gülşah Köse (via logerrit)
 include/sfx2/devtools/ObjectInspectorTreeHandler.hxx |2 +
 sfx2/source/devtools/ObjectInspectorTreeHandler.cxx  |   32 +++
 sfx2/uiconfig/ui/developmenttool.ui  |   10 -
 3 files changed, 34 insertions(+), 10 deletions(-)

New commits:
commit b1c0734ffe0f395757b6e0cea7830d820231afeb
Author: Gülşah Köse 
AuthorDate: Mon May 17 00:08:12 2021 +0300
Commit: Gülşah Köse 
CommitDate: Mon May 17 23:57:17 2021 +0200

tdf#141677 Make columns sortable

Change-Id: Ib4cb8aaba4c59a7afa347f8010deef41477b77f9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115688
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 

diff --git a/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx 
b/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
index a9cf5be3dae6..03188276a4b4 100644
--- a/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
+++ b/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
@@ -83,6 +83,8 @@ public:
 DECL_LINK(NotebookEnterPage, const OString&, void);
 DECL_LINK(NotebookLeavePage, const OString&, bool);
 
+DECL_LINK(HeaderBarClick, int, void);
+
 void introspect(css::uno::Reference const& 
xInterface);
 
 void dispose();
diff --git a/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx 
b/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx
index 60a81be9ab60..d7d4895e5d6b 100644
--- a/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx
+++ b/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx
@@ -956,6 +956,15 @@ ObjectInspectorTreeHandler::ObjectInspectorTreeHandler(
 mpObjectInspectorWidgets->mpPropertiesTreeView->make_sorted();
 mpObjectInspectorWidgets->mpMethodsTreeView->make_sorted();
 
+mpObjectInspectorWidgets->mpInterfacesTreeView->connect_column_clicked(
+LINK(this, ObjectInspectorTreeHandler, HeaderBarClick));
+mpObjectInspectorWidgets->mpServicesTreeView->connect_column_clicked(
+LINK(this, ObjectInspectorTreeHandler, HeaderBarClick));
+mpObjectInspectorWidgets->mpPropertiesTreeView->connect_column_clicked(
+LINK(this, ObjectInspectorTreeHandler, HeaderBarClick));
+mpObjectInspectorWidgets->mpMethodsTreeView->connect_column_clicked(
+LINK(this, ObjectInspectorTreeHandler, HeaderBarClick));
+
 mpObjectInspectorWidgets->mpToolbar->connect_clicked(
 LINK(this, ObjectInspectorTreeHandler, ToolbarButtonClicked));
 mpObjectInspectorWidgets->mpToolbar->set_item_sensitive("inspect", false);
@@ -1040,6 +1049,29 @@ IMPL_LINK(ObjectInspectorTreeHandler, SelectionChanged, 
weld::TreeView&, rTreeVi
 mpObjectInspectorWidgets->mpToolbar->set_item_sensitive("inspect", 
bHaveNodeWithObject);
 }
 
+static void updateOrder(std::unique_ptr& pTreeView, sal_Int32 
nColumn)
+{
+pTreeView->set_sort_column(nColumn);
+
+bool bSortAtoZ = pTreeView->get_sort_order();
+pTreeView->set_sort_order(!bSortAtoZ);
+pTreeView->set_sort_indicator(!bSortAtoZ ? TRISTATE_TRUE : TRISTATE_FALSE, 
nColumn);
+}
+
+IMPL_LINK(ObjectInspectorTreeHandler, HeaderBarClick, int, nColumn, void)
+{
+auto rPageId = 
mpObjectInspectorWidgets->mpNotebook->get_current_page_ident();
+
+if (rPageId == "object_inspector_interfaces_tab")
+updateOrder(mpObjectInspectorWidgets->mpInterfacesTreeView, nColumn);
+else if (rPageId == "object_inspector_services_tab")
+updateOrder(mpObjectInspectorWidgets->mpServicesTreeView, nColumn);
+else if (rPageId == "object_inspector_properties_tab")
+updateOrder(mpObjectInspectorWidgets->mpPropertiesTreeView, nColumn);
+else if (rPageId == "object_inspector_methods_tab")
+updateOrder(mpObjectInspectorWidgets->mpMethodsTreeView, nColumn);
+}
+
 IMPL_LINK(ObjectInspectorTreeHandler, PopupMenuHandler, const CommandEvent&, 
rCommandEvent, bool)
 {
 if (rCommandEvent.GetCommand() != CommandEventId::ContextMenu)
diff --git a/sfx2/uiconfig/ui/developmenttool.ui 
b/sfx2/uiconfig/ui/developmenttool.ui
index 58e03b3cf21a..27962e5863e7 100644
--- a/sfx2/uiconfig/ui/developmenttool.ui
+++ b/sfx2/uiconfig/ui/developmenttool.ui
@@ -320,7 +320,6 @@
 Name
 True
 True
-0
 
   
   
@@ -366,7 +365,6 @@
 Name
 True
 True
-0
 
   
   
@@ -421,7 +419,6 @@
 Object
 True
 True
-0
 
   
   
@@ -436,7 +433,6 @@
 Value
 True
  

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

2021-05-12 Thread Gülşah Köse (via logerrit)
 include/sfx2/devtools/ObjectInspectorTreeHandler.hxx |5 
 sfx2/source/devtools/ObjectInspectorTreeHandler.cxx  |   21 -
 sfx2/uiconfig/ui/developmenttool.ui  |  359 +--
 3 files changed, 181 insertions(+), 204 deletions(-)

New commits:
commit db35b9086476259fa2c047f2e4dfe7862d026530
Author: Gülşah Köse 
AuthorDate: Tue May 11 23:34:59 2021 +0300
Commit: Gülşah Köse 
CommitDate: Wed May 12 11:19:25 2021 +0200

tdf#141426 Remove GtkPaned struct unnecessary tabs.

In development tool we need GtkPaned for only properties tab.
Unnecessary hide() show() calls for the other tabs(Interfaces, Services,
Methods) causes complex problems about inital height of the second pane
with gen plugin.

Change-Id: I7523ef0bc425d7fc97ec5bd9e30e874f88e354f7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115450
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 

diff --git a/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx 
b/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
index 0919bbfa3b9a..a9cf5be3dae6 100644
--- a/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
+++ b/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
@@ -40,9 +40,6 @@ private:
 // just the current context
 css::uno::Reference mxContext;
 
-// should the paned size be reset to default on resize
-bool mbPanedResetSize;
-
 static void clearObjectInspectorChildren(std::unique_ptr& 
pTreeView,
  weld::TreeIter const& rParent);
 static void handleExpanding(std::unique_ptr& pTreeView,
@@ -86,8 +83,6 @@ public:
 DECL_LINK(NotebookEnterPage, const OString&, void);
 DECL_LINK(NotebookLeavePage, const OString&, bool);
 
-DECL_LINK(PanedSizeChange, const Size&, void);
-
 void introspect(css::uno::Reference const& 
xInterface);
 
 void dispose();
diff --git a/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx 
b/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx
index 62fb08229798..de81bd7df432 100644
--- a/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx
+++ b/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx
@@ -929,7 +929,6 @@ ObjectInspectorTreeHandler::ObjectInspectorTreeHandler(
 std::unique_ptr& pObjectInspectorWidgets)
 : mpObjectInspectorWidgets(pObjectInspectorWidgets)
 , mxContext(comphelper::getProcessComponentContext())
-, mbPanedResetSize(true)
 {
 mpObjectInspectorWidgets->mpInterfacesTreeView->connect_expanding(
 LINK(this, ObjectInspectorTreeHandler, ExpandingHandlerInterfaces));
@@ -962,15 +961,12 @@ ObjectInspectorTreeHandler::ObjectInspectorTreeHandler(
 mpObjectInspectorWidgets->mpToolbar->set_item_sensitive("inspect", false);
 mpObjectInspectorWidgets->mpToolbar->set_item_sensitive("back", false);
 
-mpObjectInspectorWidgets->mpTextView->hide();
-
 mpObjectInspectorWidgets->mpNotebook->connect_leave_page(
 LINK(this, ObjectInspectorTreeHandler, NotebookLeavePage));
 mpObjectInspectorWidgets->mpNotebook->connect_enter_page(
 LINK(this, ObjectInspectorTreeHandler, NotebookEnterPage));
 
-mpObjectInspectorWidgets->mpPaned->connect_size_allocate(
-LINK(this, ObjectInspectorTreeHandler, PanedSizeChange));
+pObjectInspectorWidgets->mpPaned->set_position(160);
 }
 
 void 
ObjectInspectorTreeHandler::handleExpanding(std::unique_ptr& 
pTreeView,
@@ -1085,8 +1081,6 @@ IMPL_LINK(ObjectInspectorTreeHandler, 
ToolbarButtonClicked, const OString&, rSel
 
 IMPL_LINK(ObjectInspectorTreeHandler, NotebookEnterPage, const OString&, 
rPageId, void)
 {
-mpObjectInspectorWidgets->mpTextView->hide();
-
 uno::Any aAny = maInspectionStack.back();
 if (!aAny.hasValue())
 return;
@@ -1108,12 +1102,10 @@ IMPL_LINK(ObjectInspectorTreeHandler, 
NotebookEnterPage, const OString&, rPageId
 }
 else if (rPageId == "object_inspector_properties_tab")
 {
-mbPanedResetSize = true;
 mpObjectInspectorWidgets->mpPropertiesTreeView->freeze();
 clearAll(mpObjectInspectorWidgets->mpPropertiesTreeView);
 appendProperties(xInterface);
 mpObjectInspectorWidgets->mpPropertiesTreeView->thaw();
-mpObjectInspectorWidgets->mpTextView->show();
 }
 else if (rPageId == "object_inspector_methods_tab")
 {
@@ -1153,17 +1145,6 @@ IMPL_LINK(ObjectInspectorTreeHandler, NotebookLeavePage, 
const OString&, rPageId
 return true;
 }
 
-IMPL_LINK(ObjectInspectorTreeHandler, PanedSizeChange, const Size&, rSize, 
void)
-{
-if (mbPanedResetSize)
-{
-// Set position at 90% of the height
-tools::Long nHeight = rSize.Height();
-mpObjectInspectorWidgets->mpPaned->set_position(nHeight * 0.9);
-mbPanedResetSize = false;
-}
-}
-
 void ObjectInspectorTreeHandler::clearObjectInspectorChildren(
 std::unique_ptr& pTreeView, weld::TreeIter const& rParent)
 {
diff --git a/sfx2/uiconfig/ui/developmenttool.ui 

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

2021-04-27 Thread Vert D (via logerrit)
 include/sfx2/inputdlg.hxx|6 
 include/sfx2/strings.hrc |1 
 sfx2/source/control/templatedlglocalview.cxx |   20 ++-
 sfx2/source/control/templatelocalview.cxx|   18 +
 sfx2/source/dialog/inputdlg.cxx  |   36 +++
 5 files changed, 80 insertions(+), 1 deletion(-)

New commits:
commit 99482297c7dd497e41fad2e7193759043e305101
Author: Vert D 
AuthorDate: Tue Apr 6 19:26:21 2021 -0500
Commit: Heiko Tietze 
CommitDate: Tue Apr 27 13:57:00 2021 +0200

tdf#138883 Prevent renaming Templates

*Disable ok button added a tooltip when renaming to an existing template
*Check while typing.

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

diff --git a/include/sfx2/inputdlg.hxx b/include/sfx2/inputdlg.hxx
index 1ca2b9b39461..adf9c2a2e850 100644
--- a/include/sfx2/inputdlg.hxx
+++ b/include/sfx2/inputdlg.hxx
@@ -19,12 +19,18 @@ private:
 std::unique_ptr m_xEntry;
 std::unique_ptr m_xLabel;
 std::unique_ptr m_xHelp;
+std::unique_ptr m_xOk;
+std::function mCheckEntry;
+DECL_LINK(EntryChangedHdl, weld::Entry&, void);
 
 public:
 InputDialog(weld::Widget* pParent, const OUString& rLabelText);
 OUString GetEntryText() const;
 void SetEntryText(const OUString& rStr);
 void HideHelpBtn();
+void SetEntryMessageType(weld::EntryMessageType aType);
+void SetTooltip(const OUString& rStr);
+void setCheckEntry(std::function aFunc);
 };
 
 #endif // INCLUDED_SFX2_SOURCE_INC_INPUTDLG_HXX
diff --git a/include/sfx2/strings.hrc b/include/sfx2/strings.hrc
index c5d3c003e313..0967a31c1109 100644
--- a/include/sfx2/strings.hrc
+++ b/include/sfx2/strings.hrc
@@ -70,6 +70,7 @@
 #define STR_MSG_ERROR_IMPORTNC_("STR_MSG_ERROR_IMPORT", 
"Error importing the following templates to $1:\n$2")
 #define STR_MSG_ERROR_DELETE_TEMPLATE   
NC_("STR_MSG_ERROR_DELETE_TEMPLATE", "The following templates cannot be 
deleted:\n$1")
 #define STR_MSG_ERROR_DELETE_FOLDER 
NC_("STR_MSG_ERROR_DELETE_FOLDER", "The following folders cannot be 
deleted:\n$1")
+#define STR_TOOLTIP_ERROR_RENAME_TEMPLATE   
NC_("STR_TOOLTIP_ERROR_RENAME_TEMPLATE", "There is another template with the 
name $1 in $2.")
 #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?")
diff --git a/sfx2/source/control/templatedlglocalview.cxx 
b/sfx2/source/control/templatedlglocalview.cxx
index 0adc30d8b97e..d4a8f949ed4d 100644
--- a/sfx2/source/control/templatedlglocalview.cxx
+++ b/sfx2/source/control/templatedlglocalview.cxx
@@ -142,6 +142,24 @@ void 
TemplateDlgLocalView::ContextMenuSelectHdl(std::string_view rIdent)
 aTitleEditDlg.SetEntryText(sOldTitle);
 aTitleEditDlg.HideHelpBtn();
 
+auto aCurRegionItems = getFilteredItems([&](const 
TemplateItemProperties& rItem) {
+return rItem.aRegionName == 
getRegionName(maSelectedItem->mnRegionId);
+});
+OUString sTooltip(SfxResId(STR_TOOLTIP_ERROR_RENAME_TEMPLATE));
+sTooltip = sTooltip.replaceFirst("$2", 
getRegionName(maSelectedItem->mnRegionId));
+aTitleEditDlg.setCheckEntry([&](OUString sNewTitle) {
+if (sNewTitle.isEmpty() || sNewTitle == sOldTitle)
+return true;
+for (const auto& rItem : aCurRegionItems)
+{
+if (rItem.aName == sNewTitle)
+{
+aTitleEditDlg.SetTooltip(sTooltip.replaceFirst("$1", 
sNewTitle));
+return false;
+}
+}
+return true;
+});
 if (!aTitleEditDlg.run())
 return;
 OUString sNewTitle = 
comphelper::string::strip(aTitleEditDlg.GetEntryText(), ' ');
@@ -149,8 +167,8 @@ void 
TemplateDlgLocalView::ContextMenuSelectHdl(std::string_view rIdent)
 if (!sNewTitle.isEmpty() && sNewTitle != sOldTitle)
 {
 maSelectedItem->setTitle(sNewTitle);
+ListView::rename(OUString::number(maSelectedItem->mnId), 
maSelectedItem->maTitle);
 }
-ListView::rename(OUString::number(maSelectedItem->mnId), 
maSelectedItem->maTitle);
 }
 else if (rIdent == "delete")
 {
diff --git a/sfx2/source/control/templatelocalview.cxx 
b/sfx2/source/control/templatelocalview.cxx
index 4dcbaa3ba0b6..baf630c7fff0 100644
--- a/sfx2/source/control/templatelocalview.cxx
+++ b/sfx2/source/control/templatelocalview.cxx
@@ 

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

2021-04-12 Thread Heiko Tietze (via logerrit)
 include/sfx2/dinfdlg.hxx |2 
 sfx2/source/dialog/dinfdlg.cxx   |   12 -
 sfx2/uiconfig/ui/documentinfopage.ui |  283 +--
 3 files changed, 149 insertions(+), 148 deletions(-)

New commits:
commit dc78803e2fc757fc3ddd97b59e698bf1385c
Author: Heiko Tietze 
AuthorDate: Fri Apr 9 11:25:54 2021 +0200
Commit: Heiko Tietze 
CommitDate: Mon Apr 12 08:24:45 2021 +0200

Resolves tdf#135896 - Add hyperlink to file location

File > Properties: Document Location is now a hyperlink
opening the file browser for local files or the internet
browser for remote content

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

diff --git a/include/sfx2/dinfdlg.hxx b/include/sfx2/dinfdlg.hxx
index 04fe4131216b..6f332f7112e0 100644
--- a/include/sfx2/dinfdlg.hxx
+++ b/include/sfx2/dinfdlg.hxx
@@ -167,7 +167,7 @@ private:
 std::unique_ptr m_xChangePassBtn;
 
 std::unique_ptr m_xShowTypeFT;
-std::unique_ptr m_xFileValEd;
+std::unique_ptr m_xFileValEd;
 std::unique_ptr m_xShowSizeFT;
 
 std::unique_ptr m_xCreateValFt;
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index c08c0dfa5cd8..ca5897df8a0a 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -689,7 +689,7 @@ SfxDocumentPage::SfxDocumentPage(weld::Container* pPage, 
weld::DialogController*
 , m_xNameED(m_xBuilder->weld_label("nameed"))
 , m_xChangePassBtn(m_xBuilder->weld_button("changepass"))
 , m_xShowTypeFT(m_xBuilder->weld_label("showtype"))
-, m_xFileValEd(m_xBuilder->weld_label("showlocation"))
+, m_xFileValEd(m_xBuilder->weld_link_button("showlocation"))
 , m_xShowSizeFT(m_xBuilder->weld_label("showsize"))
 , m_xCreateValFt(m_xBuilder->weld_label("showcreate"))
 , m_xChangeValFt(m_xBuilder->weld_label("showmodify"))
@@ -974,10 +974,14 @@ void SfxDocumentPage::Reset( const SfxItemSet* rSet )
 // we know it's a folder -> don't need the final slash, but it's 
better for WB_PATHELLIPSIS
 aPath.removeFinalSlash();
 OUString aText( aPath.PathToFileName() ); //! (pb) MaxLen?
-m_xFileValEd->set_label( aText );
+m_xFileValEd->set_label(aText);
+m_xFileValEd->set_uri("file://" + aText);
+}
+else if (aURL.GetProtocol() != INetProtocol::PrivSoffice)
+{
+m_xFileValEd->set_label(aURL.GetPartBeforeLastName());
+m_xFileValEd->set_uri(m_xFileValEd->get_label());
 }
-else if ( aURL.GetProtocol() != INetProtocol::PrivSoffice )
-m_xFileValEd->set_label( aURL.GetPartBeforeLastName() );
 
 // handle access data
 bool bUseUserData = rInfoItem.IsUseUserData();
diff --git a/sfx2/uiconfig/ui/documentinfopage.ui 
b/sfx2/uiconfig/ui/documentinfopage.ui
index 7fd64c4df456..49a4f8ab1c07 100644
--- a/sfx2/uiconfig/ui/documentinfopage.ui
+++ b/sfx2/uiconfig/ui/documentinfopage.ui
@@ -1,191 +1,191 @@
 
-
+
 
   
-  
+  
   
 True
-False
+False
 True
 True
-12
-6
-12
+12
+6
+12
 
   
 True
-False
+False
 end
 _Created:
-True
-showcreate
+True
+showcreate
   
   
-0
-4
+0
+4
   
 
 
   
 True
-False
+False
 end
 _Modified:
-True
-showmodify
+True
+showmodify
   
   
-0
-5
+0
+5
   
 
 
   
 True
-False
+False
 end
 _Digitally signed:
-True
-showsigned
+True
+showsigned
   
   
-0
-7
+0
+7
   
 
 
   
 True
-False
+False
 end
 Last pri_nted:
-True
-showprint
+True
+showprint
   
   
-0
-8
+0
+8
   
 
 
   
 True
-False
+False
 end
 Total _editing time:
-True
-showedittime
+True
+showedittime
   
   
-0
-9
+0
+9
   
 
 
   
 True
-False
+False
 end
 Re_vision number:
-True
-showrevision
+True
+showrevision
   
   
-0
-10
+0
+10
   
 
 
   
 True
-False
+False
 True
 True
 0
   
   
-1
-4
+1
+4
 2
   
 
 
   
 True
-False
+False
 True
 True
 0
   
   
-1
-5
+1
+5
 2
   
 

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

2021-03-26 Thread Vert D (via logerrit)
 include/sfx2/listview.hxx|2 
 include/sfx2/templatedlglocalview.hxx|6 +
 sfx2/source/control/templatedlglocalview.cxx |  107 +--
 sfx2/source/control/templatesearchview.cxx   |   37 -
 sfx2/source/doc/templatedlg.cxx  |   10 ++
 sfx2/source/inc/templatesearchview.hxx   |2 
 6 files changed, 156 insertions(+), 8 deletions(-)

New commits:
commit 18aa2169c9adf41fa5c9a02ad81d4f68a34509e3
Author: Vert D 
AuthorDate: Sat Dec 26 20:41:53 2020 -0500
Commit: Noel Grandin 
CommitDate: Fri Mar 26 08:46:28 2021 +0100

Added delete keyinput to listview, fixed reload() issues: solves tdf#138884

*Added delete keyinput to listview.
*Views Buttons set focus to the appropiate widget.
*Fixed listview reload() issues.

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

diff --git a/include/sfx2/listview.hxx b/include/sfx2/listview.hxx
index cb7eb23b5a73..4f7e37a49671 100644
--- a/include/sfx2/listview.hxx
+++ b/include/sfx2/listview.hxx
@@ -53,6 +53,8 @@ public:
 
 void unselect_all() { mxTreeView->unselect_all(); }
 
+void grab_focus() { mxTreeView->grab_focus(); }
+
 void remove(const OUString& rId);
 
 void rename(const OUString& rId, const OUString& rTitle);
diff --git a/include/sfx2/templatedlglocalview.hxx 
b/include/sfx2/templatedlglocalview.hxx
index c6caca46f519..bdae9eb44e35 100644
--- a/include/sfx2/templatedlglocalview.hxx
+++ b/include/sfx2/templatedlglocalview.hxx
@@ -26,6 +26,10 @@ public:
 
 void showRegion(std::u16string_view rName);
 
+void reload();
+
+virtual bool KeyInput(const KeyEvent& rKEvt) override;
+
 void createContextMenu(const bool bIsDefault, const bool bIsBuiltIn);
 
 virtual void Show() override;
@@ -56,6 +60,8 @@ private:
 
 DECL_LINK(PopupMenuHdl, const CommandEvent&, bool);
 
+DECL_LINK(KeyPressHdl, const KeyEvent&, bool);
+
 TemplateViewMode mViewMode;
 };
 
diff --git a/sfx2/source/control/templatedlglocalview.cxx 
b/sfx2/source/control/templatedlglocalview.cxx
index 39b88774cade..d444ec49464b 100644
--- a/sfx2/source/control/templatedlglocalview.cxx
+++ b/sfx2/source/control/templatedlglocalview.cxx
@@ -17,6 +17,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 
TemplateDlgLocalView::TemplateDlgLocalView(std::unique_ptr
 xWindow,
std::unique_ptr xMenu,
@@ -29,6 +31,7 @@ 
TemplateDlgLocalView::TemplateDlgLocalView(std::unique_ptr
 mxTreeView->connect_column_clicked(LINK(this, ListView, ColumnClickedHdl));
 mxTreeView->connect_changed(LINK(this, TemplateDlgLocalView, 
ListViewChangedHdl));
 mxTreeView->connect_popup_menu(LINK(this, TemplateDlgLocalView, 
PopupMenuHdl));
+mxTreeView->connect_key_press(LINK(this, TemplateDlgLocalView, 
KeyPressHdl));
 }
 
 void TemplateDlgLocalView::showAllTemplates()
@@ -63,6 +66,34 @@ void TemplateDlgLocalView::showRegion(std::u16string_view 
rName)
 }
 }
 
+void TemplateDlgLocalView::reload()
+{
+mpDocTemplates->Update();
+
+Populate();
+
+// Check if we are currently browsing a region or root folder
+if (mnCurRegionId)
+{
+sal_uInt16 nRegionId = mnCurRegionId - 1; //Is offset by 1
+
+for (auto const& pRegion : maRegions)
+{
+if (pRegion->mnRegionId == nRegionId)
+{
+showRegion(pRegion.get());
+break;
+}
+}
+}
+else
+showAllTemplates();
+
+//No items should be selected by default
+ThumbnailView::deselectItems();
+ListView::unselect_all();
+}
+
 void TemplateDlgLocalView::createContextMenu(const bool bIsDefault, const bool 
bIsBuiltIn)
 {
 mxContextMenu->clear();
@@ -129,11 +160,6 @@ void 
TemplateDlgLocalView::ContextMenuSelectHdl(std::string_view rIdent)
 return;
 
 maDeleteTemplateHdl.Call(maSelectedItem);
-// this remove is probably redundant because reload would throw away
-// the old contents anyway. Maybe there is an argument that removing it
-// immediately means there is possibility to show it missing while the
-// possibly slow reload is operating if a repaint could occur
-ListView::remove(OUString::number(maSelectedItem->mnId));
 reload();
 }
 else if (rIdent == "default")
@@ -300,4 +326,75 @@ IMPL_LINK_NOARG(TemplateDlgLocalView, ListViewChangedHdl, 
weld::TreeView&, void)
 updateSelection();
 }
 
+bool TemplateDlgLocalView::KeyInput(const KeyEvent& rKEvt)
+{
+vcl::KeyCode aKeyCode = rKEvt.GetKeyCode();
+
+if (aKeyCode == (KEY_MOD1 | KEY_A))
+{
+for (ThumbnailViewItem* pItem : mFilteredItemList)
+{
+if (!pItem->isSelected())
+{
+pItem->setSelection(true);
+

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

2021-03-25 Thread Caolán McNamara (via logerrit)
 include/sfx2/dockwin.hxx   |2 +-
 sfx2/source/dialog/dockwin.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit ed3a13ac9837b52e899bd82ccae1244988e99f47
Author: Caolán McNamara 
AuthorDate: Wed Mar 24 20:36:08 2021 +
Commit: Caolán McNamara 
CommitDate: Thu Mar 25 09:43:26 2021 +0100

use weld::Box so we can reorder contents

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

diff --git a/include/sfx2/dockwin.hxx b/include/sfx2/dockwin.hxx
index a7c87c408958..6a996db64873 100644
--- a/include/sfx2/dockwin.hxx
+++ b/include/sfx2/dockwin.hxx
@@ -41,7 +41,7 @@ class SFX2_DLLPUBLIC SfxDockingWindow : public 
ResizableDockingWindow
 {
 protected:
 std::unique_ptr m_xBuilder;
-std::unique_ptr m_xContainer;
+std::unique_ptr m_xContainer;
 
 private:
 tools::Rectangle   aInnerRect;
diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx
index d824cbfe4be7..8198d5e837cf 100644
--- a/sfx2/source/dialog/dockwin.cxx
+++ b/sfx2/source/dialog/dockwin.cxx
@@ -771,7 +771,7 @@ SfxDockingWindow::SfxDockingWindow( SfxBindings *pBindinx, 
SfxChildWindow *pCW,
 , pMgr(pCW)
 {
 m_xBuilder.reset(Application::CreateInterimBuilder(m_xBox, 
rUIXMLDescription, true));
-m_xContainer = m_xBuilder->weld_container(rID);
+m_xContainer = m_xBuilder->weld_box(rID);
 
 pImpl.reset(new SfxDockingWindow_Impl(this));
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-03-22 Thread Caolán McNamara (via logerrit)
 include/sfx2/sfxhelp.hxx |1 +
 sfx2/source/appl/sfxhelp.cxx |   19 +++
 2 files changed, 16 insertions(+), 4 deletions(-)

New commits:
commit 60dd4825ba8fbab211fbb31961ea11873406a280
Author: Caolán McNamara 
AuthorDate: Mon Mar 22 16:16:36 2021 +
Commit: Caolán McNamara 
CommitDate: Mon Mar 22 21:00:55 2021 +0100

tdf#140539 don't allow help to be relaunched during launch

its fine once it is launched to fire help again, just not during
the launch itself via the yield-call done during html load that
probably exists to let the progress bar redraw

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

diff --git a/include/sfx2/sfxhelp.hxx b/include/sfx2/sfxhelp.hxx
index f07c2017287f..c71b643d162e 100644
--- a/include/sfx2/sfxhelp.hxx
+++ b/include/sfx2/sfxhelp.hxx
@@ -28,6 +28,7 @@
 class SFX2_DLLPUBLIC SfxHelp final : public Help
 {
 boolbIsDebug;
+boolbLaunchingHelp; // tdf#140539 don't allow help to be 
re-launched during help launch
 
 private:
 SAL_DLLPRIVATE static bool Start_Impl(const OUString& rURL, weld::Widget* 
pWidget, const OUString& rKeyword);
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index 6732fb5b0e63..e16d5cab7865 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -338,8 +338,9 @@ OUString SfxHelp_Impl::GetHelpText( const OUString& 
aCommandURL, const OUString&
 return SfxContentHelper::GetActiveHelpString( 
aHelpURL.makeStringAndClear() );
 }
 
-SfxHelp::SfxHelp() :
-bIsDebug( false )
+SfxHelp::SfxHelp()
+: bIsDebug(false)
+, bLaunchingHelp(false)
 {
 // read the environment variable "HELP_DEBUG"
 // if it's set, you will see debug output on active help
@@ -691,12 +692,22 @@ void SfxHelp::SearchKeyword( const OUString& rKeyword )
 
 bool SfxHelp::Start( const OUString& rURL, const vcl::Window* pWindow )
 {
-return Start_Impl( rURL, pWindow, OUString() );
+if (bLaunchingHelp)
+return true;
+bLaunchingHelp = true;
+bool bRet = Start_Impl( rURL, pWindow, OUString() );
+bLaunchingHelp = false;
+return bRet;
 }
 
 bool SfxHelp::Start(const OUString& rURL, weld::Widget* pWidget)
 {
-return Start_Impl(rURL, pWidget, OUString());
+if (bLaunchingHelp)
+return true;
+bLaunchingHelp = true;
+bool bRet = Start_Impl(rURL, pWidget, OUString());
+bLaunchingHelp = false;
+return bRet;
 }
 
 /// Redirect the vnd.sun.star.help:// urls to http://help.libreoffice.org
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-03-21 Thread Caolán McNamara (via logerrit)
 include/sfx2/request.hxx |2 --
 sfx2/source/appl/appserv.cxx |   35 +++
 2 files changed, 7 insertions(+), 30 deletions(-)

New commits:
commit e9054a0ec00c4281c8f908ffb9cbe7d9e199c35b
Author: Caolán McNamara 
AuthorDate: Sat Mar 20 15:45:56 2021 +
Commit: Caolán McNamara 
CommitDate: Sun Mar 21 15:30:21 2021 +0100

elide extracting vcl::Window from awt::XWindow

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

diff --git a/include/sfx2/request.hxx b/include/sfx2/request.hxx
index 90058a5b1f7f..e6411d2d3ec1 100644
--- a/include/sfx2/request.hxx
+++ b/include/sfx2/request.hxx
@@ -38,7 +38,6 @@ enum class SfxCallMode : sal_uInt16;
 namespace com::sun::star::beans { struct PropertyValue; }
 namespace com::sun::star::frame { class XDispatchRecorder; }
 namespace com::sun::star::uno { template  class Sequence; }
-namespace vcl { class Window; }
 namespace weld { class Window; }
 
 class SFX2_DLLPUBLIC SfxRequest final : public SfxHint
@@ -115,7 +114,6 @@ public:
 
 /** Return the window that should be used as the parent for any dialogs 
this request creates
 */
-vcl::Window* GetFrameWindow() const;
 weld::Window* GetFrameWeld() const;
 private:
 const SfxRequest&   operator=(const SfxRequest &) = delete;
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index 74c3767c405e..cf875e1d16c1 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -67,7 +67,6 @@
 
 #include 
 #include 
-#include 
 #include 
 
 #include 
@@ -252,26 +251,6 @@ namespace
 return xFrame;
 }
 
-vcl::Window* getFrameWindow(const Reference& rFrame)
-{
-if (rFrame.is())
-{
-try
-{
-Reference< awt::XWindow > 
xContainerWindow(rFrame->getContainerWindow(), UNO_SET_THROW);
-VclPtr pWindow = 
VCLUnoHelper::GetWindow(xContainerWindow);
-return pWindow;
-}
-catch (const Exception&)
-{
-DBG_UNHANDLED_EXCEPTION("sfx.appl");
-}
-}
-
-SAL_WARN( "sfx.appl", "no parent for dialogs" );
-return nullptr;
-}
-
 class LicenseDialog : public weld::GenericDialogController
 {
 public:
@@ -312,11 +291,6 @@ namespace
 };
 }
 
-vcl::Window* SfxRequest::GetFrameWindow() const
-{
-return getFrameWindow(GetRequestFrame(*this));
-}
-
 weld::Window* SfxRequest::GetFrameWeld() const
 {
 const SfxItemSet* pIntArgs = GetInternalArgs_Impl();
@@ -330,8 +304,13 @@ weld::Window* SfxRequest::GetFrameWeld() const
 return Application::GetFrameWeld(xWindow);
 }
 
-vcl::Window* pWin = GetFrameWindow();
-return pWin ? pWin->GetFrameWeld() : nullptr;
+Reference xFrame(GetRequestFrame(*this));
+if (!xFrame)
+{
+SAL_WARN("sfx.appl", "no parent for dialogs");
+return nullptr;
+}
+return Application::GetFrameWeld(xFrame->getContainerWindow());
 }
 
 void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-03-20 Thread Tomaž Vajngerl (via logerrit)
 include/sfx2/devtools/DevelopmentToolDockingWindow.hxx |1 
 sfx2/source/devtools/DevelopmentToolDockingWindow.cxx  |   17 -
 sfx2/uiconfig/ui/developmenttool.ui|   31 +
 3 files changed, 27 insertions(+), 22 deletions(-)

New commits:
commit 7cd99750a3174c7953d851eb9b5c4b5675aa0d0e
Author: Tomaž Vajngerl 
AuthorDate: Wed Mar 17 16:35:19 2021 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sun Mar 21 02:35:10 2021 +0100

devtools: change "Current Selection" button to toolbar

Change "Current Selection" toggle button and add it to the toolbar
instead.

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

diff --git a/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx 
b/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx
index 171ff96ad5fb..894772a3fd74 100644
--- a/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx
+++ b/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx
@@ -37,7 +37,6 @@ class SFX2_DLLPUBLIC DevelopmentToolDockingWindow final : 
public SfxDockingWindo
 private:
 std::unique_ptr mpObjectInspectorWidgets;
 std::unique_ptr mpDocumentModelTreeView;
-std::unique_ptr mpSelectionToggle;
 std::unique_ptr mpDomToolbar;
 
 // Reference to the root object for the current document
diff --git a/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx 
b/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx
index 32ef347eded7..69711cc32b0c 100644
--- a/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx
+++ b/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx
@@ -29,7 +29,6 @@ 
DevelopmentToolDockingWindow::DevelopmentToolDockingWindow(SfxBindings* pInputBi
"sfx/ui/developmenttool.ui")
 , mpObjectInspectorWidgets(new ObjectInspectorWidgets(m_xBuilder))
 , 
mpDocumentModelTreeView(m_xBuilder->weld_tree_view("leftside_treeview_id"))
-, mpSelectionToggle(m_xBuilder->weld_toggle_button("dom_selection_toggle"))
 , mpDomToolbar(m_xBuilder->weld_toolbar("dom_toolbar"))
 , maDocumentModelTreeHandler(
   mpDocumentModelTreeView,
@@ -38,7 +37,6 @@ 
DevelopmentToolDockingWindow::DevelopmentToolDockingWindow(SfxBindings* pInputBi
 {
 mpDocumentModelTreeView->connect_changed(
 LINK(this, DevelopmentToolDockingWindow, 
DocumentModelTreeViewSelectionHandler));
-mpSelectionToggle->connect_toggled(LINK(this, 
DevelopmentToolDockingWindow, SelectionToggled));
 mpDomToolbar->connect_clicked(
 LINK(this, DevelopmentToolDockingWindow, DomToolbarButtonClicked));
 
@@ -58,7 +56,7 @@ 
DevelopmentToolDockingWindow::DevelopmentToolDockingWindow(SfxBindings* pInputBi
 IMPL_LINK(DevelopmentToolDockingWindow, DocumentModelTreeViewSelectionHandler, 
weld::TreeView&,
   rView, void)
 {
-if (mpSelectionToggle->get_state() == TRISTATE_TRUE)
+if (mpDomToolbar->get_item_active("dom_current_selection_toggle"))
 return;
 
 OUString sID = rView.get_selected_id();
@@ -78,6 +76,10 @@ IMPL_LINK(DevelopmentToolDockingWindow, 
DomToolbarButtonClicked, const OString&,
 {
 maDocumentModelTreeHandler.inspectDocument();
 }
+else if (rSelectionId == "dom_current_selection_toggle")
+{
+updateSelection();
+}
 }
 
 DevelopmentToolDockingWindow::~DevelopmentToolDockingWindow() { disposeOnce(); 
}
@@ -96,7 +98,6 @@ void DevelopmentToolDockingWindow::dispose()
 
 // dispose welded objects
 mpObjectInspectorWidgets.reset();
-mpSelectionToggle.reset();
 mpDomToolbar.reset();
 mpDocumentModelTreeView.reset();
 
@@ -105,8 +106,8 @@ void DevelopmentToolDockingWindow::dispose()
 
 void DevelopmentToolDockingWindow::updateSelection()
 {
-TriState eTriState = mpSelectionToggle->get_state();
-if (eTriState == TRISTATE_TRUE)
+bool bActive = 
mpDomToolbar->get_item_active("dom_current_selection_toggle");
+if (bActive)
 {
 maObjectInspectorTreeHandler.introspect(mxCurrentSelection);
 maDocumentModelTreeHandler.selectObject(mxCurrentSelection);
@@ -145,12 +146,12 @@ void 
DevelopmentToolDockingWindow::changeToCurrentSelection()
 if (xInterface.is())
 {
 maObjectInspectorTreeHandler.introspect(xInterface);
-mpSelectionToggle->set_state(TRISTATE_TRUE);
+mpDomToolbar->set_item_active("dom_current_selection_toggle", 
true);
 return;
 }
 }
 }
-mpSelectionToggle->set_state(TRISTATE_FALSE);
+mpDomToolbar->set_item_active("dom_current_selection_toggle", false);
 maObjectInspectorTreeHandler.introspect(mxRoot);
 }
 
diff --git a/sfx2/uiconfig/ui/developmenttool.ui 
b/sfx2/uiconfig/ui/developmenttool.ui
index 62df00e9d708..b73ad19bbe68 100644
--- a/sfx2/uiconfig/ui/developmenttool.ui
+++ b/sfx2/uiconfig/ui/developmenttool.ui
@@ 

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

2021-03-18 Thread Noel (via logerrit)
 include/sfx2/shell.hxx   |5 -
 sfx2/source/control/bindings.cxx |4 ++--
 sfx2/source/control/dispatch.cxx |4 ++--
 sfx2/source/control/shell.cxx|6 +++---
 4 files changed, 7 insertions(+), 12 deletions(-)

New commits:
commit 6e4238018bf0408f2961e5708212e09a8c3597dc
Author: Noel 
AuthorDate: Thu Mar 18 11:06:57 2021 +0200
Commit: Noel Grandin 
CommitDate: Thu Mar 18 20:49:26 2021 +0100

inline some tiny sfx2 functions

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

diff --git a/include/sfx2/shell.hxx b/include/sfx2/shell.hxx
index 60de3579e8d3..3266c989a7d4 100644
--- a/include/sfx2/shell.hxx
+++ b/include/sfx2/shell.hxx
@@ -193,11 +193,6 @@ public:
 */
 SfxViewShell*   GetViewShell() const;
 
-voidCallExec( SfxExecFunc pFunc, SfxRequest  )
-{ (*pFunc)(this, rReq); }
-voidCallState( SfxStateFunc pFunc, SfxItemSet 
 )
-{ (*pFunc)(this, rSet); }
-
 static void EmptyExecStub(SfxShell *pShell, SfxRequest &);
 static void EmptyStateStub(SfxShell *pShell, SfxItemSet &);
 
diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx
index 6ac0bb9c59cc..aa565d9c4a96 100644
--- a/sfx2/source/control/bindings.cxx
+++ b/sfx2/source/control/bindings.cxx
@@ -988,8 +988,8 @@ void SfxBindings::Execute_Impl( SfxRequest& aReq, const 
SfxSlot* pSlot, SfxShell
 // The value is attached to a toggleable attribute (Bools)
 sal_uInt16 nWhich = pSlot->GetWhich(rPool);
 SfxItemSet aSet(rPool, {{nWhich, nWhich}});
-SfxStateFunc aFunc  = pSlot->GetStateFnc();
-pShell->CallState( aFunc, aSet );
+SfxStateFunc pFunc = pSlot->GetStateFnc();
+(*pFunc)(pShell, aSet);
 const SfxPoolItem *pOldItem;
 SfxItemState eState = aSet.GetItemState(nWhich, true, );
 if ( eState == SfxItemState::DISABLED )
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index 9939b01f0b90..613b8cf0f7b7 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -250,7 +250,7 @@ void SfxDispatcher::Call_Impl(SfxShell& rShell, const 
SfxSlot , SfxRequest
 xImp->pInCallAliveFlag = 
 
 SfxExecFunc pFunc = rSlot.GetExecFnc();
-rShell.CallExec( pFunc, rReq );
+(*pFunc)(, rReq);
 
 // If 'this' is still alive
 if ( bThisDispatcherAlive )
@@ -1655,7 +1655,7 @@ bool SfxDispatcher::FillState_(const SfxSlotServer& rSvr, 
SfxItemSet& rState,
 else
 pFunc = pSlot->GetStateFnc();
 
-pSh->CallState( pFunc, rState );
+(*pFunc)(pSh, rState);
 #ifdef DBG_UTIL
 // To examine the conformity of IDL (SlotMap) and current Items
 if ( rState.Count() )
diff --git a/sfx2/source/control/shell.cxx b/sfx2/source/control/shell.cxx
index 353dde1a8d07..795f25f708aa 100644
--- a/sfx2/source/control/shell.cxx
+++ b/sfx2/source/control/shell.cxx
@@ -381,7 +381,7 @@ bool SfxShell::CanExecuteSlot_Impl( const SfxSlot  )
 const sal_uInt16 nId = rSlot.GetWhich( rPool );
 SfxItemSet aSet(rPool, {{nId, nId}});
 SfxStateFunc pFunc = rSlot.GetStateFnc();
-CallState( pFunc, aSet );
+(*pFunc)( this, aSet );
 return aSet.GetItemState(nId) != SfxItemState::DISABLED;
 }
 
@@ -437,7 +437,7 @@ const SfxPoolItem* SfxShell::ExecuteSlot
 
 SfxExecFunc pFunc = pSlot->GetExecFnc();
 if ( pFunc )
-CallExec( pFunc, rReq );
+(*pFunc)( this, rReq );
 
 return rReq.GetReturnValue();
 }
@@ -472,7 +472,7 @@ const SfxPoolItem* SfxShell::GetSlotState
 // Call Status method
 SfxStateFunc pFunc = pSlot->GetStateFnc();
 if ( pFunc )
-CallState( pFunc, aSet );
+(*pFunc)( this, aSet );
 eState = aSet.GetItemState( nSlotId, true,  );
 
 // get default Item if possible
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-03-16 Thread Tomaž Vajngerl (via logerrit)
 include/sfx2/devtools/DevelopmentToolDockingWindow.hxx |2 
 include/sfx2/devtools/DocumentModelTreeHandler.hxx |3 +
 sfx2/source/devtools/DevelopmentToolDockingWindow.cxx  |   14 -
 sfx2/source/devtools/DocumentModelTreeHandler.cxx  |   14 +
 sfx2/uiconfig/ui/developmenttool.ui|   47 +++--
 5 files changed, 74 insertions(+), 6 deletions(-)

New commits:
commit a873ef61534353df3251dd879f8deabde9295145
Author: Tomaž Vajngerl 
AuthorDate: Tue Mar 16 23:12:51 2021 +0900
Commit: Tomaž Vajngerl 
CommitDate: Wed Mar 17 00:27:11 2021 +0100

devtools: add refresh button for the DocumentObjectTreeView

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

diff --git a/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx 
b/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx
index 1c4826f975f6..171ff96ad5fb 100644
--- a/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx
+++ b/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx
@@ -38,6 +38,7 @@ private:
 std::unique_ptr mpObjectInspectorWidgets;
 std::unique_ptr mpDocumentModelTreeView;
 std::unique_ptr mpSelectionToggle;
+std::unique_ptr mpDomToolbar;
 
 // Reference to the root object for the current document
 css::uno::Reference mxRoot;
@@ -53,6 +54,7 @@ private:
 
 DECL_LINK(DocumentModelTreeViewSelectionHandler, weld::TreeView&, void);
 DECL_LINK(SelectionToggled, weld::ToggleButton&, void);
+DECL_LINK(DomToolbarButtonClicked, const OString&, void);
 
 void updateSelection();
 
diff --git a/include/sfx2/devtools/DocumentModelTreeHandler.hxx 
b/include/sfx2/devtools/DocumentModelTreeHandler.hxx
index 17b853b36c6f..c63986ad1476 100644
--- a/include/sfx2/devtools/DocumentModelTreeHandler.hxx
+++ b/include/sfx2/devtools/DocumentModelTreeHandler.hxx
@@ -33,6 +33,9 @@ private:
 // identified by the input tree iter.
 void clearChildren(weld::TreeIter const& rParent);
 
+// Clear all tree view nodes.
+void clearAll();
+
 public:
 DocumentModelTreeHandler(std::unique_ptr& 
pDocumentModelTree,
  css::uno::Reference const& 
xDocument);
diff --git a/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx 
b/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx
index 6fcbcc68812d..32ef347eded7 100644
--- a/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx
+++ b/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx
@@ -29,7 +29,8 @@ 
DevelopmentToolDockingWindow::DevelopmentToolDockingWindow(SfxBindings* pInputBi
"sfx/ui/developmenttool.ui")
 , mpObjectInspectorWidgets(new ObjectInspectorWidgets(m_xBuilder))
 , 
mpDocumentModelTreeView(m_xBuilder->weld_tree_view("leftside_treeview_id"))
-, mpSelectionToggle(m_xBuilder->weld_toggle_button("selection_toggle"))
+, mpSelectionToggle(m_xBuilder->weld_toggle_button("dom_selection_toggle"))
+, mpDomToolbar(m_xBuilder->weld_toolbar("dom_toolbar"))
 , maDocumentModelTreeHandler(
   mpDocumentModelTreeView,
   
pInputBindings->GetDispatcher()->GetFrame()->GetObjectShell()->GetBaseModel())
@@ -38,6 +39,8 @@ 
DevelopmentToolDockingWindow::DevelopmentToolDockingWindow(SfxBindings* pInputBi
 mpDocumentModelTreeView->connect_changed(
 LINK(this, DevelopmentToolDockingWindow, 
DocumentModelTreeViewSelectionHandler));
 mpSelectionToggle->connect_toggled(LINK(this, 
DevelopmentToolDockingWindow, SelectionToggled));
+mpDomToolbar->connect_clicked(
+LINK(this, DevelopmentToolDockingWindow, DomToolbarButtonClicked));
 
 auto* pViewFrame = pInputBindings->GetDispatcher()->GetFrame();
 
@@ -69,6 +72,14 @@ IMPL_LINK_NOARG(DevelopmentToolDockingWindow, 
SelectionToggled, weld::ToggleButt
 updateSelection();
 }
 
+IMPL_LINK(DevelopmentToolDockingWindow, DomToolbarButtonClicked, const 
OString&, rSelectionId, void)
+{
+if (rSelectionId == "dom_refresh_button")
+{
+maDocumentModelTreeHandler.inspectDocument();
+}
+}
+
 DevelopmentToolDockingWindow::~DevelopmentToolDockingWindow() { disposeOnce(); 
}
 
 void DevelopmentToolDockingWindow::dispose()
@@ -86,6 +97,7 @@ void DevelopmentToolDockingWindow::dispose()
 // dispose welded objects
 mpObjectInspectorWidgets.reset();
 mpSelectionToggle.reset();
+mpDomToolbar.reset();
 mpDocumentModelTreeView.reset();
 
 SfxDockingWindow::dispose();
diff --git a/sfx2/source/devtools/DocumentModelTreeHandler.cxx 
b/sfx2/source/devtools/DocumentModelTreeHandler.cxx
index 047b1d97b19d..7645fc327686 100644
--- a/sfx2/source/devtools/DocumentModelTreeHandler.cxx
+++ b/sfx2/source/devtools/DocumentModelTreeHandler.cxx
@@ -719,6 +719,18 @@ uno::Reference 
DocumentModelTreeHandler::getObjectByID(OUString
 return pEntry->getMainObject();
 }
 
+void DocumentModelTreeHandler::clearAll()
+{

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

2021-03-15 Thread Tomaž Vajngerl (via logerrit)
 include/sfx2/devtools/DevelopmentToolDockingWindow.hxx |4 
 include/sfx2/devtools/ObjectInspectorTreeHandler.hxx   |5 
 include/sfx2/devtools/ObjectInspectorWidgets.hxx   |6 
 sfx2/source/devtools/ObjectInspectorTreeHandler.cxx|   24 
 sfx2/uiconfig/ui/developmenttool.ui|  657 -
 5 files changed, 383 insertions(+), 313 deletions(-)

New commits:
commit 2b9cf977810193b642761328ec15ec78ce245016
Author: Tomaž Vajngerl 
AuthorDate: Mon Mar 15 16:16:05 2021 +0900
Commit: Tomaž Vajngerl 
CommitDate: Tue Mar 16 03:41:39 2021 +0100

devtools: add a text view to show the value of selected property

Sometimes the property value in textual form can take a lot of
space, which can't be shown completely in the tree view. To solve
this problem, this change adds a text view at the bottom of the
tree view, that shows the complete value of currently selected
property.

The text view can be expanded if necessary, but to not require
constant changing of the pane, the position of the text view is
always reset to 90% of the total height.

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

diff --git a/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx 
b/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx
index 656e46fedada..1c4826f975f6 100644
--- a/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx
+++ b/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx
@@ -62,9 +62,9 @@ public:
 
 virtual ~DevelopmentToolDockingWindow() override;
 
-virtual void dispose() override;
+void dispose() override;
 
-virtual void ToggleFloatingMode() override;
+void ToggleFloatingMode() override;
 
 // Inspect the input object in the object inspector
 void introspect(css::uno::Reference const& 
xInterface);
diff --git a/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx 
b/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
index 2cfb572eb3a2..4fd340887855 100644
--- a/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
+++ b/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
@@ -42,6 +42,9 @@ private:
 // just the current context
 css::uno::Reference mxContext;
 
+// should the paned size be reset to default on resize
+bool mbPanedResetSize;
+
 static void clearObjectInspectorChildren(std::unique_ptr& 
pTreeView,
  weld::TreeIter const& rParent);
 static void handleExpanding(std::unique_ptr& pTreeView,
@@ -85,6 +88,8 @@ public:
 DECL_LINK(NotebookEnterPage, const OString&, void);
 DECL_LINK(NotebookLeavePage, const OString&, bool);
 
+DECL_LINK(PanedSizeChange, const Size&, void);
+
 void introspect(css::uno::Reference const& 
xInterface);
 
 void dispose();
diff --git a/include/sfx2/devtools/ObjectInspectorWidgets.hxx 
b/include/sfx2/devtools/ObjectInspectorWidgets.hxx
index 6d7bf8cf9e9f..6481d786a222 100644
--- a/include/sfx2/devtools/ObjectInspectorWidgets.hxx
+++ b/include/sfx2/devtools/ObjectInspectorWidgets.hxx
@@ -22,6 +22,8 @@ struct ObjectInspectorWidgets
 , 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"))
 {
 }
 
@@ -35,6 +37,8 @@ struct ObjectInspectorWidgets
 mpMethodsTreeView.reset();
 mpToolbar.reset();
 mpNotebook.reset();
+mpTextView.reset();
+mpPaned.reset();
 }
 
 std::unique_ptr mpClassNameLabel;
@@ -44,6 +48,8 @@ struct ObjectInspectorWidgets
 std::unique_ptr mpMethodsTreeView;
 std::unique_ptr mpToolbar;
 std::unique_ptr mpNotebook;
+std::unique_ptr mpTextView;
+std::unique_ptr mpPaned;
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx 
b/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx
index b7f1391ff17f..d5a9c9b990cf 100644
--- a/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx
+++ b/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx
@@ -780,6 +780,7 @@ ObjectInspectorTreeHandler::ObjectInspectorTreeHandler(
 std::unique_ptr& pObjectInspectorWidgets)
 : mpObjectInspectorWidgets(pObjectInspectorWidgets)
 , mxContext(comphelper::getProcessComponentContext())
+, mbPanedResetSize(true)
 {
 mpObjectInspectorWidgets->mpInterfacesTreeView->connect_expanding(
 LINK(this, ObjectInspectorTreeHandler, ExpandingHandlerInterfaces));
@@ -812,10 +813,15 @@ ObjectInspectorTreeHandler::ObjectInspectorTreeHandler(
 

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

2021-03-15 Thread Tomaž Vajngerl (via logerrit)
 include/sfx2/devtools/DevelopmentToolDockingWindow.hxx |9 
 include/sfx2/devtools/ObjectInspectorTreeHandler.hxx   |   18 -
 include/sfx2/devtools/ObjectInspectorWidgets.hxx   |   49 +
 sfx2/source/devtools/DevelopmentToolDockingWindow.cxx  |   19 --
 sfx2/source/devtools/ObjectInspectorTreeHandler.cxx|  155 -
 5 files changed, 132 insertions(+), 118 deletions(-)

New commits:
commit 173697822d6a598461f79da2e2f77f24723d40ab
Author: Tomaž Vajngerl 
AuthorDate: Mon Mar 15 14:56:57 2021 +0900
Commit: Tomaž Vajngerl 
CommitDate: Tue Mar 16 03:41:15 2021 +0100

devtools: put ObjectInspector widgets into it's own class

This is needed so they can be shared between ObjectInspectorHandler
and DevelopmentToolDockingWindow, otherwise we have to add each
widget as a parameter to the constructor and for each make a
referenced member. This worked for a while but with more a nd
ore widgets it is becoming ugly.

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

diff --git a/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx 
b/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx
index 1d05948cd51f..656e46fedada 100644
--- a/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx
+++ b/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx
@@ -15,6 +15,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 
@@ -34,15 +35,9 @@
 class SFX2_DLLPUBLIC DevelopmentToolDockingWindow final : public 
SfxDockingWindow
 {
 private:
-std::unique_ptr mpClassNameLabel;
-std::unique_ptr mpInterfacesTreeView;
-std::unique_ptr mpServicesTreeView;
-std::unique_ptr mpPropertiesTreeView;
-std::unique_ptr mpMethodsTreeView;
+std::unique_ptr mpObjectInspectorWidgets;
 std::unique_ptr mpDocumentModelTreeView;
 std::unique_ptr mpSelectionToggle;
-std::unique_ptr mpObjectInspectorToolbar;
-std::unique_ptr mpObjectInspectorNotebook;
 
 // Reference to the root object for the current document
 css::uno::Reference mxRoot;
diff --git a/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx 
b/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
index 1d7000371eba..2cfb572eb3a2 100644
--- a/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
+++ b/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
@@ -19,6 +19,8 @@
 #include 
 #include 
 
+#include 
+
 #include 
 #include 
 
@@ -31,13 +33,7 @@
 class ObjectInspectorTreeHandler
 {
 private:
-std::unique_ptr& mpInterfacesTreeView;
-std::unique_ptr& mpServicesTreeView;
-std::unique_ptr& mpPropertiesTreeView;
-std::unique_ptr& mpMethodsTreeView;
-std::unique_ptr& mpClassNameLabel;
-std::unique_ptr& mpObjectInspectorToolbar;
-std::unique_ptr& mpObjectInspectorNotebook;
+std::unique_ptr& mpObjectInspectorWidgets;
 
 // object stack to remember previously inspected objects so it is
 // possible to return back to them
@@ -67,13 +63,7 @@ private:
 void updateBackButtonState();
 
 public:
-ObjectInspectorTreeHandler(std::unique_ptr& 
pInterfacesTreeView,
-   std::unique_ptr& 
pServicesTreeView,
-   std::unique_ptr& 
pPropertiesTreeView,
-   std::unique_ptr& 
pMethodsTreeView,
-   std::unique_ptr& pClassNameLabel,
-   std::unique_ptr& 
pObjectInspectorToolbar,
-   std::unique_ptr& 
pObjectInspectorNotebook);
+ObjectInspectorTreeHandler(std::unique_ptr& 
pObjectInspectorWidgets);
 
 // callbacks when a node in the tree view is expanded
 DECL_LINK(ExpandingHandlerInterfaces, const weld::TreeIter&, bool);
diff --git a/include/sfx2/devtools/ObjectInspectorWidgets.hxx 
b/include/sfx2/devtools/ObjectInspectorWidgets.hxx
new file mode 100644
index ..6d7bf8cf9e9f
--- /dev/null
+++ b/include/sfx2/devtools/ObjectInspectorWidgets.hxx
@@ -0,0 +1,49 @@
+/* -*- 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 
+
+struct ObjectInspectorWidgets
+{
+ObjectInspectorWidgets(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"))
+, 

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

2021-03-15 Thread Andrea Gelmini (via logerrit)
 include/sfx2/objsh.hxx   |2 +-
 sfx2/source/doc/objstor.cxx  |2 +-
 sfx2/source/doc/sfxbasemodel.cxx |2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 058d4f77bd74690cd66504b681cbede6af82de6b
Author: Andrea Gelmini 
AuthorDate: Wed Feb 17 18:18:06 2021 +0100
Commit: Noel Grandin 
CommitDate: Mon Mar 15 18:48:10 2021 +0100

Fix typo in code

It passed make check on Linux

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

diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index 40715f29e6ac..5d95f29bf3ea 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -316,7 +316,7 @@ public:
 virtual boolSave();
 virtual boolSaveAs( SfxMedium   );
 virtual boolSaveCompleted( const css::uno::Reference< 
css::embed::XStorage >& xStorage );
-boolSwitchPersistance(
+boolSwitchPersistence(
 const css::uno::Reference< 
css::embed::XStorage >& xStorage );
 virtual voidUpdateLinks();
 virtual boolLoadExternal( SfxMedium& rMedium );
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index bc5e80224d84..653ea8877a94 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -3423,7 +3423,7 @@ static bool StoragesOfUnknownMediaTypeAreCopied_Impl( 
const uno::Reference< embe
 return true;
 }
 
-bool SfxObjectShell::SwitchPersistance( const uno::Reference< embed::XStorage 
>& xStorage )
+bool SfxObjectShell::SwitchPersistence( const uno::Reference< embed::XStorage 
>& xStorage )
 {
 bool bResult = false;
 // check for wrong creation of object container
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index dd0d7b54caf6..5971b7729413 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -3798,7 +3798,7 @@ void SAL_CALL SfxBaseModel::switchToStorage( const 
Reference< embed::XStorage >&
 // the persistence should be switched only if the storage is different
 if ( xStorage != m_pData->m_pObjectShell->GetStorage() )
 {
-if ( !m_pData->m_pObjectShell->SwitchPersistance( xStorage ) )
+if ( !m_pData->m_pObjectShell->SwitchPersistence( xStorage ) )
 {
 ErrCode nError = m_pData->m_pObjectShell->GetErrorCode();
 nError = nError ? nError : ERRCODE_IO_GENERAL;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-03-14 Thread Mike Kaganski (via logerrit)
 include/sfx2/tabdlg.hxx   |2 ++
 sfx2/source/dialog/tabdlg.cxx |7 ++-
 sw/source/ui/fldui/flddb.cxx  |4 
 sw/source/ui/fldui/flddb.hxx  |1 +
 4 files changed, 13 insertions(+), 1 deletion(-)

New commits:
commit 0adf52a644aaf85ba2bd666147c62c134234ffbb
Author: Mike Kaganski 
AuthorDate: Sun Mar 14 14:42:15 2021 +0300
Commit: Mike Kaganski 
CommitDate: Sun Mar 14 14:55:24 2021 +0100

tdf#141011: Postpone SwFieldDBPage::Reset to tab activation

This way, it will only ask for password when dialog is switched to that tab.

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

diff --git a/include/sfx2/tabdlg.hxx b/include/sfx2/tabdlg.hxx
index 6397868a21d0..daa092b8d9b7 100644
--- a/include/sfx2/tabdlg.hxx
+++ b/include/sfx2/tabdlg.hxx
@@ -213,6 +213,8 @@ public:
 
 virtual boolFillItemSet( SfxItemSet* );
 virtual voidReset( const SfxItemSet* );
+// Allows to postpone some initialization to the first activation
+virtual boolDeferResetToFirstActivation();
 
 boolHasExchangeSupport() const
 { return bHasExchangeSupport; }
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index 6f71e91fea88..47fa332390db 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -169,6 +169,8 @@ void SfxTabPage::Reset( const SfxItemSet* )
 {
 }
 
+bool SfxTabPage::DeferResetToFirstActivation() { return false; }
+
 void SfxTabPage::ActivatePage( const SfxItemSet& )
 /*  [Description]
 
@@ -920,7 +922,10 @@ void SfxTabDialogController::CreatePages()
 pDataObject->xTabPage->SetUserData(sUserData);
 
 PageCreated(pDataObject->sId, *pDataObject->xTabPage);
-pDataObject->xTabPage->Reset(m_pSet.get());
+if (pDataObject->xTabPage->DeferResetToFirstActivation())
+pDataObject->bRefresh = true; // Reset will be called in 
ActivatePageHdl
+else
+pDataObject->xTabPage->Reset(m_pSet.get());
 }
 }
 
diff --git a/sw/source/ui/fldui/flddb.cxx b/sw/source/ui/fldui/flddb.cxx
index 963e1834533e..14492377629b 100644
--- a/sw/source/ui/fldui/flddb.cxx
+++ b/sw/source/ui/fldui/flddb.cxx
@@ -178,6 +178,10 @@ void SwFieldDBPage::Reset(const SfxItemSet*)
 }
 }
 
+// SwFieldDBPage may ask for password to select current document's data source,
+// so only do that when activating the page, not when dialog is creating all 
pages
+bool SwFieldDBPage::DeferResetToFirstActivation() { return true; }
+
 bool SwFieldDBPage::FillItemSet(SfxItemSet* )
 {
 OUString sTableName;
diff --git a/sw/source/ui/fldui/flddb.hxx b/sw/source/ui/fldui/flddb.hxx
index e507fcb86ee0..b25c38699234 100644
--- a/sw/source/ui/fldui/flddb.hxx
+++ b/sw/source/ui/fldui/flddb.hxx
@@ -70,6 +70,7 @@ public:
 
 virtual boolFillItemSet( SfxItemSet* rSet ) override;
 virtual voidReset( const SfxItemSet* rSet ) override;
+virtual boolDeferResetToFirstActivation() override;
 
 virtual voidFillUserData() override;
 voidActivateMailMergeAddress();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-03-13 Thread Tomaž Vajngerl (via logerrit)
 include/sfx2/devtools/DevelopmentToolChildWindow.hxx   |3 
 include/sfx2/devtools/DevelopmentToolDockingWindow.hxx |   14 +++
 include/sfx2/devtools/DocumentModelTreeHandler.hxx |9 ++
 include/sfx2/devtools/ObjectInspectorTreeHandler.hxx   |   19 +
 sfx2/source/devtools/DevelopmentToolDockingWindow.cxx  |   40 +--
 sfx2/source/devtools/DocumentModelTreeHandler.cxx  |   60 +++--
 sfx2/source/devtools/ObjectInspectorTreeHandler.cxx|   50 +-
 sfx2/source/devtools/SelectionChangeHandler.hxx|5 +
 8 files changed, 155 insertions(+), 45 deletions(-)

New commits:
commit 9932cd89ae238b97090b8447ed50fd1ee8bf19cc
Author: Tomaž Vajngerl 
AuthorDate: Fri Mar 12 19:27:11 2021 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sat Mar 13 16:30:28 2021 +0100

devtools: document classes and method, remove unneeded methods

This documents DevTools classes and methods. In addition it also
removes some methods that aren't needed anymore.

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

diff --git a/include/sfx2/devtools/DevelopmentToolChildWindow.hxx 
b/include/sfx2/devtools/DevelopmentToolChildWindow.hxx
index adf5adf44980..d78ac5c2e2ce 100644
--- a/include/sfx2/devtools/DevelopmentToolChildWindow.hxx
+++ b/include/sfx2/devtools/DevelopmentToolChildWindow.hxx
@@ -13,6 +13,9 @@
 #include 
 #include 
 
+/**
+ * Necessary child window for the development tools docking window
+ */
 class SAL_WARN_UNUSED SFX2_DLLPUBLIC DevelopmentToolChildWindow final : public 
SfxChildWindow
 {
 SFX_DECL_CHILDWINDOW_WITHID(DevelopmentToolChildWindow);
diff --git a/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx 
b/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx
index f5c214949c6a..1d05948cd51f 100644
--- a/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx
+++ b/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx
@@ -26,6 +26,11 @@
 
 #include 
 
+/** Development tool main docking window
+ *
+ * Contains two sides. Left side contains the simplified DOM tree and
+ * the right side the object inspector tree.
+ */
 class SFX2_DLLPUBLIC DevelopmentToolDockingWindow final : public 
SfxDockingWindow
 {
 private:
@@ -39,20 +44,22 @@ private:
 std::unique_ptr mpObjectInspectorToolbar;
 std::unique_ptr mpObjectInspectorNotebook;
 
+// Reference to the root object for the current document
 css::uno::Reference mxRoot;
+// Stores the current selected object in the document
 css::uno::Reference mxCurrentSelection;
 css::uno::Reference 
mxSelectionListener;
 css::uno::Reference mxSelectionSupplier;
 
+// Handler for the DOM tree
 DocumentModelTreeHandler maDocumentModelTreeHandler;
+// Handler for the object inspector tree
 ObjectInspectorTreeHandler maObjectInspectorTreeHandler;
 
 DECL_LINK(DocumentModelTreeViewSelectionHandler, weld::TreeView&, void);
 DECL_LINK(SelectionToggled, weld::ToggleButton&, void);
 
-void inspectDocument();
 void updateSelection();
-void inspectSelectionOrRoot();
 
 public:
 DevelopmentToolDockingWindow(SfxBindings* pBindings, SfxChildWindow* 
pChildWindow,
@@ -64,10 +71,13 @@ public:
 
 virtual void ToggleFloatingMode() override;
 
+// Inspect the input object in the object inspector
 void introspect(css::uno::Reference const& 
xInterface);
 
+// Signals that the selected object in the document changes
 void selectionChanged(css::uno::Reference const& 
xInterface);
 
+// Signals to change to the current selected object in the object inspector
 void changeToCurrentSelection();
 };
 
diff --git a/include/sfx2/devtools/DocumentModelTreeHandler.hxx 
b/include/sfx2/devtools/DocumentModelTreeHandler.hxx
index 03f5ed274aa4..17b853b36c6f 100644
--- a/include/sfx2/devtools/DocumentModelTreeHandler.hxx
+++ b/include/sfx2/devtools/DocumentModelTreeHandler.hxx
@@ -18,12 +18,19 @@
 
 #include 
 
+/** Document model tree handler
+ *
+ * Handles the DOM tree part of DevTools, which includes interaction with
+ * the DOM tree view UI elements and the DOM model.
+ */
 class DocumentModelTreeHandler
 {
 private:
 std::unique_ptr& mpDocumentModelTree;
 css::uno::Reference mxDocument;
 
+// Clears all children of a tree node, where the parent is
+// identified by the input tree iter.
 void clearChildren(weld::TreeIter const& rParent);
 
 public:
@@ -37,6 +44,8 @@ public:
 static css::uno::Reference getObjectByID(OUString 
const& rID);
 
 void dispose();
+
+// selects the input object if it exists in the DOM tree view
 void selectObject(css::uno::Reference const& 
xInterface);
 };
 
diff --git a/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx 
b/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
index 58b4c833961c..1d7000371eba 100644
--- 

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

2021-03-13 Thread Tomaž Vajngerl (via logerrit)
 include/sfx2/devtools/ObjectInspectorTreeHandler.hxx |5 +
 sfx2/source/devtools/ObjectInspectorTreeHandler.cxx  |   68 ++-
 sfx2/uiconfig/ui/developmenttool.ui  |1 
 3 files changed, 56 insertions(+), 18 deletions(-)

New commits:
commit 1beb97dfc2d8c8e9ee06001ac59a22a3208214d1
Author: Tomaž Vajngerl 
AuthorDate: Thu Mar 11 23:26:29 2021 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sat Mar 13 12:47:54 2021 +0100

devtools: show superclass tree in interface and services tree view

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

diff --git a/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx 
b/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
index 65a16be8c890..58b4c833961c 100644
--- a/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
+++ b/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
@@ -15,8 +15,9 @@
 #include 
 #include 
 
-#include 
 #include 
+#include 
+#include 
 
 #include 
 #include 
@@ -34,6 +35,8 @@ private:
 
 std::deque maInspectionStack;
 
+css::uno::Reference mxContext;
+
 static void clearObjectInspectorChildren(std::unique_ptr& 
pTreeView,
  weld::TreeIter const& rParent);
 static void handleExpanding(std::unique_ptr& pTreeView,
diff --git a/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx 
b/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx
index 33f2b5c90e85..553e7616308b 100644
--- a/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx
+++ b/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx
@@ -12,9 +12,6 @@
 
 #include 
 
-#include 
-#include 
-
 #include 
 #include 
 #include 
@@ -190,6 +187,14 @@ OUString getAnyType(const uno::Any& aValue)
 return aTypeName.replaceAll("com.sun.star", "css");
 }
 
+uno::Reference
+convertTypeToIdlClass(const uno::Type& rType,
+  const uno::Reference& xContext)
+{
+auto xReflection = reflection::theCoreReflection::get(xContext);
+return xReflection->forName(rType.getTypeName());
+}
+
 // Object inspector nodes
 
 class ObjectInspectorNodeInterface
@@ -346,6 +351,43 @@ public:
 }
 };
 
+class ClassNode : public ObjectInspectorNodeInterface
+{
+private:
+uno::Reference mxClass;
+
+static bool isXInterface(uno::Reference const& 
xClass)
+{
+return xClass->getName() == "com.sun.star.uno.XInterface";
+}
+
+public:
+ClassNode(uno::Reference const& xClass)
+: mxClass(xClass)
+{
+}
+
+bool shouldShowExpander() override
+{
+auto const& xSuperClasses = mxClass->getSuperclasses();
+return xSuperClasses.getLength() > 2
+   || (xSuperClasses.getLength() == 1 && 
!isXInterface(xSuperClasses[0]));
+}
+
+OUString getObjectName() override { return mxClass->getName(); }
+
+void fillChildren(std::unique_ptr& rTree,
+  const weld::TreeIter* pParent) override
+{
+auto const& xSuperClasses = mxClass->getSuperclasses();
+for (auto const& xSuper : xSuperClasses)
+{
+if (!isXInterface(xSuper))
+lclAppendNodeToParent(rTree, pParent, new ClassNode(xSuper));
+}
+}
+};
+
 class BasicValueNode : public SimpleStringNode
 {
 protected:
@@ -434,9 +476,7 @@ public:
  uno::Reference const& xContext)
 : BasicValueNode(rName, rAny, rInfo, xContext)
 {
-auto xReflection = reflection::theCoreReflection::get(mxContext);
-OUString aTypeName = maAny.getValueType().getTypeName();
-auto xClass = xReflection->forName(aTypeName);
+auto xClass = convertTypeToIdlClass(maAny.getValueType(), mxContext);
 mxIdlArray = xClass->getArray();
 }
 
@@ -717,6 +757,7 @@ ObjectInspectorTreeHandler::ObjectInspectorTreeHandler(
 , mpClassNameLabel(pClassNameLabel)
 , mpObjectInspectorToolbar(pObjectInspectorToolbar)
 , mpObjectInspectorNotebook(pObjectInspectorNotebook)
+, mxContext(comphelper::getProcessComponentContext())
 {
 mpInterfacesTreeView->connect_expanding(
 LINK(this, ObjectInspectorTreeHandler, ExpandingHandlerInterfaces));
@@ -965,14 +1006,15 @@ void 
ObjectInspectorTreeHandler::appendInterfaces(uno::Reference xTypeProvider(xInterface, 
uno::UNO_QUERY);
 if (xTypeProvider.is())
 {
 const auto xSequenceTypes = xTypeProvider->getTypes();
 for (auto const& xType : xSequenceTypes)
 {
-OUString aName = xType.getTypeName();
-lclAppendNode(mpInterfacesTreeView, new SimpleStringNode(aName));
+auto xClass = convertTypeToIdlClass(xType, mxContext);
+lclAppendNode(mpInterfacesTreeView, new ClassNode(xClass));
 }
 }
 }
@@ -994,8 +1036,7 @@ void 
ObjectInspectorTreeHandler::appendProperties(uno::Reference c
 if (!xInterface.is())
 

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

2021-03-11 Thread Caolán McNamara (via logerrit)
 include/sfx2/objsh.hxx   |4 ++--
 sfx2/source/appl/appopen.cxx |6 +++---
 sfx2/source/doc/objcont.cxx  |4 +---
 sfx2/source/doc/objmisc.cxx  |   24 +++-
 4 files changed, 21 insertions(+), 17 deletions(-)

New commits:
commit 3f66a801aeab257705922998e518398d27e4d698
Author: Caolán McNamara 
AuthorDate: Thu Mar 11 09:52:56 2021 +
Commit: Caolán McNamara 
CommitDate: Thu Mar 11 18:35:27 2021 +0100

keep SfxObjectShell::GetDialogParent ret as an awt::XWindow

instead of extracting the vcl::Window impl details from it

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

diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index b21f7bf4bb69..40715f29e6ac 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -88,7 +88,7 @@ namespace sfx2
 class StyleManager;
 }
 
-namespace vcl { class Window; }
+namespace com::sun::star::awt { class XWindow; }
 namespace com::sun::star::beans { struct PropertyValue; }
 namespace com::sun::star::document { struct CmisVersion; }
 namespace com::sun::star::document { class XDocumentProperties; }
@@ -574,7 +574,7 @@ public:
 
 virtual css::uno::Sequence< OUString > GetEventNames();
 
-vcl::Window*GetDialogParent( SfxMedium const * 
pMedium=nullptr );
+css::uno::Reference GetDialogParent(SfxMedium const* 
pMedium = nullptr);
 static SfxObjectShell*  CreateObject( const OUString& rServiceName, 
SfxObjectCreateMode = SfxObjectCreateMode::STANDARD );
 static SfxObjectShell*  CreateObjectByFactoryName( const OUString& 
rURL, SfxObjectCreateMode = SfxObjectCreateMode::STANDARD );
 static css::uno::Reference< css::lang::XComponent >
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index 4a6c1f403bbb..025316846d3d 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -206,9 +206,9 @@ ErrCode CheckPasswd_Impl
 
 if ( bIsEncrypted )
 {
-vcl::Window* pWin = pDoc ? pDoc->GetDialogParent( pFile ) 
: nullptr;
-if ( pWin )
-pWin->Show();
+css::uno::Reference xWin(pDoc ? 
pDoc->GetDialogParent(pFile) : nullptr);
+if (xWin)
+xWin->setVisible(true);
 
 nRet = ERRCODE_SFX_CANTGETPASSWD;
 
diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx
index 04255063fd3f..f7f69f595e85 100644
--- a/sfx2/source/doc/objcont.cxx
+++ b/sfx2/source/doc/objcont.cxx
@@ -26,7 +26,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include 
@@ -523,8 +522,7 @@ void SfxObjectShell::UpdateFromTemplate_Impl(  )
 else if ( bCanUpdateFromTemplate == 
document::UpdateDocMode::ACCORDING_TO_CONFIG )
 {
 const OUString sMessage( 
SfxResId(STR_QRYTEMPL_MESSAGE).replaceAll( "$(ARG1)", aTemplName ) );
-vcl::Window *pWin = GetDialogParent();
-QueryTemplateBox aBox(pWin ? pWin->GetFrameWeld() : nullptr, 
sMessage);
+QueryTemplateBox 
aBox(Application::GetFrameWeld(GetDialogParent()), sMessage);
 if (RET_YES == aBox.run())
 bLoad = true;
 }
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index b4321576b3b8..81298eb8ff11 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -28,6 +28,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -1602,18 +1603,18 @@ bool SfxObjectShell::AdjustMacroMode()
 return pImpl->aMacroMode.adjustMacroMode( xInteraction );
 }
 
-vcl::Window* SfxObjectShell::GetDialogParent( SfxMedium const * pLoadingMedium 
)
+css::uno::Reference SfxObjectShell::GetDialogParent( 
SfxMedium const * pLoadingMedium )
 {
-VclPtr pWindow;
+css::uno::Reference xWindow;
 SfxItemSet* pSet = pLoadingMedium ? pLoadingMedium->GetItemSet() : 
GetMedium()->GetItemSet();
 const SfxUnoFrameItem* pUnoItem = 
SfxItemSet::GetItem(pSet, SID_FILLFRAME, false);
 if ( pUnoItem )
 {
 const uno::Reference < frame::XFrame >& xFrame( pUnoItem->GetFrame() );
-pWindow = VCLUnoHelper::GetWindow( xFrame->getContainerWindow() );
+xWindow = xFrame->getContainerWindow();
 }
 
-if ( !pWindow )
+if (!xWindow)
 {
 SfxFrame* pFrame = nullptr;
 const SfxFrameItem* pFrameItem = 
SfxItemSet::GetItem(pSet, SID_DOCFRAME, false);
@@ -1632,22 +1633,27 @@ vcl::Window* SfxObjectShell::GetDialogParent( SfxMedium 
const * pLoadingMedium )
 }
 
 if ( pFrame )
+{
 // get topmost window
-pWindow = VCLUnoHelper::GetWindow( 
pFrame->GetFrameInterface()->getContainerWindow() );
+xWindow = 

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

2021-03-11 Thread Caolán McNamara (via logerrit)
 include/sfx2/sidebar/Panel.hxx |4 ++--
 include/sfx2/sidebar/SidebarController.hxx |4 ++--
 sfx2/source/sidebar/Panel.cxx  |   16 +---
 sfx2/source/sidebar/SidebarController.cxx  |5 ++---
 4 files changed, 19 insertions(+), 10 deletions(-)

New commits:
commit 5649c4b26401b56736b9eb56ef47b73b95e43c67
Author: Caolán McNamara 
AuthorDate: Wed Mar 3 14:03:12 2021 +
Commit: Caolán McNamara 
CommitDate: Thu Mar 11 14:30:23 2021 +0100

create GetElementParentWindow on demand

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

diff --git a/include/sfx2/sidebar/Panel.hxx b/include/sfx2/sidebar/Panel.hxx
index cd820ff937b2..92e57abc13fd 100644
--- a/include/sfx2/sidebar/Panel.hxx
+++ b/include/sfx2/sidebar/Panel.hxx
@@ -70,7 +70,7 @@ public:
 {
 return mxPanelComponent;
 }
-css::uno::Reference GetElementParentWindow() const { 
return mxXWindow; }
+css::uno::Reference GetElementParentWindow();
 css::uno::Reference GetElementWindow();
 void SetExpanded(const bool bIsExpanded);
 bool IsExpanded() const { return mbIsExpanded; }
@@ -98,7 +98,7 @@ private:
 const css::uno::Reference& mxFrame;
 std::unique_ptr mxTitleBar;
 std::unique_ptr mxContents;
-css::uno::Reference mxXWindow;
+css::uno::Reference mxAwtXWindow;
 };
 typedef std::vector> SharedPanelContainer;
 
diff --git a/include/sfx2/sidebar/SidebarController.hxx 
b/include/sfx2/sidebar/SidebarController.hxx
index 1c38211d11c1..8bcaa858ff1c 100644
--- a/include/sfx2/sidebar/SidebarController.hxx
+++ b/include/sfx2/sidebar/SidebarController.hxx
@@ -39,7 +39,7 @@
 #include 
 #include 
 
-namespace com::sun::star::awt { class XWindowPeer; }
+namespace com::sun::star::awt { class XWindow; }
 namespace com::sun::star::frame { class XDispatch; }
 namespace com::sun::star::ui { class XUIElement; }
 
@@ -231,7 +231,7 @@ private:
 void UpdateConfigurations();
 
 css::uno::Reference CreateUIElement (
-const css::uno::Reference& rxWindow,
+const css::uno::Reference& rxWindow,
 const OUString& rsImplementationURL,
 const bool bWantsCanvas,
 const Context& rContext);
diff --git a/sfx2/source/sidebar/Panel.cxx b/sfx2/source/sidebar/Panel.cxx
index 7c66838b2d8e..41cfbc096abb 100644
--- a/sfx2/source/sidebar/Panel.cxx
+++ b/sfx2/source/sidebar/Panel.cxx
@@ -60,7 +60,7 @@ Panel::Panel(const PanelDescriptor& rPanelDescriptor,
 , mxFrame(rxFrame)
 , mxTitleBar(new PanelTitleBar(rPanelDescriptor.msTitle, *m_xBuilder, 
this))
 , mxContents(m_xBuilder->weld_container("contents"))
-, mxXWindow(mxContents->CreateChildFrame())
+, mxAwtXWindow(mxContents->CreateChildFrame())
 {
 SetText(rPanelDescriptor.msTitle);
 mxContents->set_visible(mbIsExpanded);
@@ -111,8 +111,11 @@ void Panel::dispose()
 
 mxTitleBar.reset();
 
-mxXWindow->dispose();
-mxXWindow.clear();
+if (mxAwtXWindow)
+{
+mxAwtXWindow->dispose();
+mxAwtXWindow.clear();
+}
 mxContents.reset();
 
 InterimItemWindow::dispose();
@@ -181,6 +184,13 @@ Reference Panel::GetElementWindow()
 return nullptr;
 }
 
+Reference Panel::GetElementParentWindow()
+{
+if (!mxAwtXWindow)
+mxAwtXWindow = mxContents->CreateChildFrame();
+return mxAwtXWindow;
+}
+
 } // end of namespace sfx2::sidebar
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/sidebar/SidebarController.cxx 
b/sfx2/source/sidebar/SidebarController.cxx
index e6a24e3b632a..dce668892c16 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -954,9 +954,8 @@ VclPtr SidebarController::CreatePanel (
 mxFrame);
 
 // Create the XUIElement.
-Reference xPeer(pPanel->GetElementParentWindow(), 
UNO_QUERY);
 Reference xUIElement (CreateUIElement(
-xPeer,
+pPanel->GetElementParentWindow(),
 xPanelDescriptor->msImplementationURL,
 xPanelDescriptor->mbWantsCanvas,
 rContext));
@@ -974,7 +973,7 @@ VclPtr SidebarController::CreatePanel (
 }
 
 Reference SidebarController::CreateUIElement (
-const Reference& rxWindow,
+const Reference& rxWindow,
 const OUString& rsImplementationURL,
 const bool bWantsCanvas,
 const Context& rContext)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-02-27 Thread Tomaž Vajngerl (via logerrit)
 include/sfx2/devtools/DevelopmentToolDockingWindow.hxx |1 
 include/sfx2/devtools/ObjectInspectorTreeHandler.hxx   |6 -
 sfx2/source/devtools/DevelopmentToolDockingWindow.cxx  |4 
 sfx2/source/devtools/ObjectInspectorTreeHandler.cxx|   97 +
 sfx2/uiconfig/ui/developmenttool.ui|   10 -
 5 files changed, 90 insertions(+), 28 deletions(-)

New commits:
commit 129deefc1f4ab9b3bc5005d6646ed07064a6aec1
Author: Tomaž Vajngerl 
AuthorDate: Thu Feb 25 21:11:39 2021 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sun Feb 28 01:13:47 2021 +0100

devtools: on demand create the content of tab pages

Until now all the tree views in each tab page were populated at
once when the object was inspected.
With this change, the tree views are filled on demand when the
user enters a tab page, and is cleaned when the user leaves a
tab page.

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

diff --git a/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx 
b/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx
index 97b0c8e06e68..f5c214949c6a 100644
--- a/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx
+++ b/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx
@@ -37,6 +37,7 @@ private:
 std::unique_ptr mpDocumentModelTreeView;
 std::unique_ptr mpSelectionToggle;
 std::unique_ptr mpObjectInspectorToolbar;
+std::unique_ptr mpObjectInspectorNotebook;
 
 css::uno::Reference mxRoot;
 css::uno::Reference mxCurrentSelection;
diff --git a/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx 
b/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
index c61da73aa6e4..65a16be8c890 100644
--- a/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
+++ b/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
@@ -30,6 +30,7 @@ private:
 std::unique_ptr& mpMethodsTreeView;
 std::unique_ptr& mpClassNameLabel;
 std::unique_ptr& mpObjectInspectorToolbar;
+std::unique_ptr& mpObjectInspectorNotebook;
 
 std::deque maInspectionStack;
 
@@ -58,7 +59,8 @@ public:
std::unique_ptr& 
pPropertiesTreeView,
std::unique_ptr& 
pMethodsTreeView,
std::unique_ptr& pClassNameLabel,
-   std::unique_ptr& 
pObjectInspectorToolbar);
+   std::unique_ptr& 
pObjectInspectorToolbar,
+   std::unique_ptr& 
pObjectInspectorNotebook);
 
 DECL_LINK(ExpandingHandlerInterfaces, const weld::TreeIter&, bool);
 DECL_LINK(ExpandingHandlerServices, const weld::TreeIter&, bool);
@@ -68,6 +70,8 @@ public:
 
 DECL_LINK(PopupMenuHandler, const CommandEvent&, bool);
 DECL_LINK(ToolbarButtonClicked, const OString&, void);
+DECL_LINK(NotebookEnterPage, const OString&, void);
+DECL_LINK(NotebookLeavePage, const OString&, bool);
 
 void introspect(css::uno::Reference const& 
xInterface);
 
diff --git a/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx 
b/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx
index d7d02198d331..a6b34091fcca 100644
--- a/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx
+++ b/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx
@@ -35,11 +35,13 @@ 
DevelopmentToolDockingWindow::DevelopmentToolDockingWindow(SfxBindings* pInputBi
 , 
mpDocumentModelTreeView(m_xBuilder->weld_tree_view("leftside_treeview_id"))
 , mpSelectionToggle(m_xBuilder->weld_toggle_button("selection_toggle"))
 , 
mpObjectInspectorToolbar(m_xBuilder->weld_toolbar("object_inspector_toolbar"))
+, 
mpObjectInspectorNotebook(m_xBuilder->weld_notebook("object_inspector_notebookbar"))
 , maDocumentModelTreeHandler(
   mpDocumentModelTreeView,
   
pInputBindings->GetDispatcher()->GetFrame()->GetObjectShell()->GetBaseModel())
 , maObjectInspectorTreeHandler(mpInterfacesTreeView, mpServicesTreeView, 
mpPropertiesTreeView,
-   mpMethodsTreeView, mpClassNameLabel, 
mpObjectInspectorToolbar)
+   mpMethodsTreeView, mpClassNameLabel, 
mpObjectInspectorToolbar,
+   mpObjectInspectorNotebook)
 {
 mpDocumentModelTreeView->connect_changed(
 LINK(this, DevelopmentToolDockingWindow, 
DocumentModelTreeViewSelectionHandler));
diff --git a/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx 
b/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx
index c100ed5fff31..c00ddc645a10 100644
--- a/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx
+++ b/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx
@@ -629,13 +629,15 @@ ObjectInspectorTreeHandler::ObjectInspectorTreeHandler(
 std::unique_ptr& pPropertiesTreeView,
 std::unique_ptr& pMethodsTreeView,
 std::unique_ptr& 

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

2021-02-27 Thread Tomaž Vajngerl (via logerrit)
 include/sfx2/devtools/DevelopmentToolDockingWindow.hxx |1 
 include/sfx2/devtools/ObjectInspectorTreeHandler.hxx   |   21 ++
 sfx2/source/devtools/DevelopmentToolDockingWindow.cxx  |4 
 sfx2/source/devtools/ObjectInspectorTreeHandler.cxx|  152 ++---
 sfx2/uiconfig/ui/developmenttool.ui|  123 +
 5 files changed, 238 insertions(+), 63 deletions(-)

New commits:
commit eb3789bd35e9dc62e92008467bfaa0650cd8d6be
Author: Tomaž Vajngerl 
AuthorDate: Thu Feb 25 20:58:42 2021 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sun Feb 28 01:13:30 2021 +0100

devtools: object inspector toolbar and object stack

This change adds a toolbar to the object inspector with buttons
for inspect (which just links to the same action added to the
context menu) and back. Back uses the newly added object stack
to return to the previously inspected object. Only the objects
which we used the "inspect" command in the object inspector tree
are added to the object stack.

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

diff --git a/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx 
b/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx
index f3633189c9b6..97b0c8e06e68 100644
--- a/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx
+++ b/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx
@@ -36,6 +36,7 @@ private:
 std::unique_ptr mpMethodsTreeView;
 std::unique_ptr mpDocumentModelTreeView;
 std::unique_ptr mpSelectionToggle;
+std::unique_ptr mpObjectInspectorToolbar;
 
 css::uno::Reference mxRoot;
 css::uno::Reference mxCurrentSelection;
diff --git a/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx 
b/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
index 7008a398df5a..c61da73aa6e4 100644
--- a/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
+++ b/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
@@ -18,6 +18,9 @@
 #include 
 #include 
 
+#include 
+#include 
+
 class ObjectInspectorTreeHandler
 {
 private:
@@ -25,8 +28,10 @@ private:
 std::unique_ptr& mpServicesTreeView;
 std::unique_ptr& mpPropertiesTreeView;
 std::unique_ptr& mpMethodsTreeView;
-
 std::unique_ptr& mpClassNameLabel;
+std::unique_ptr& mpObjectInspectorToolbar;
+
+std::deque maInspectionStack;
 
 static void clearObjectInspectorChildren(std::unique_ptr& 
pTreeView,
  weld::TreeIter const& rParent);
@@ -39,18 +44,30 @@ private:
 void appendProperties(css::uno::Reference const& 
xInterface);
 void appendMethods(css::uno::Reference const& 
xInterface);
 
+void inspectObject(css::uno::Reference const& 
xInterface);
+
+void clearStack();
+void addToStack(css::uno::Any const& rAny);
+css::uno::Any popFromStack();
+
+void updateBackButtonState();
+
 public:
 ObjectInspectorTreeHandler(std::unique_ptr& 
pInterfacesTreeView,
std::unique_ptr& 
pServicesTreeView,
std::unique_ptr& 
pPropertiesTreeView,
std::unique_ptr& 
pMethodsTreeView,
-   std::unique_ptr& pClassNameLabel);
+   std::unique_ptr& pClassNameLabel,
+   std::unique_ptr& 
pObjectInspectorToolbar);
 
 DECL_LINK(ExpandingHandlerInterfaces, const weld::TreeIter&, bool);
 DECL_LINK(ExpandingHandlerServices, const weld::TreeIter&, bool);
 DECL_LINK(ExpandingHandlerProperties, const weld::TreeIter&, bool);
 DECL_LINK(ExpandingHandlerMethods, const weld::TreeIter&, bool);
+DECL_LINK(SelectionChanged, weld::TreeView&, void);
+
 DECL_LINK(PopupMenuHandler, const CommandEvent&, bool);
+DECL_LINK(ToolbarButtonClicked, const OString&, void);
 
 void introspect(css::uno::Reference const& 
xInterface);
 
diff --git a/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx 
b/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx
index 6bd92f17256d..d7d02198d331 100644
--- a/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx
+++ b/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx
@@ -34,11 +34,12 @@ 
DevelopmentToolDockingWindow::DevelopmentToolDockingWindow(SfxBindings* pInputBi
 , mpMethodsTreeView(m_xBuilder->weld_tree_view("methods_treeview_id"))
 , 
mpDocumentModelTreeView(m_xBuilder->weld_tree_view("leftside_treeview_id"))
 , mpSelectionToggle(m_xBuilder->weld_toggle_button("selection_toggle"))
+, 
mpObjectInspectorToolbar(m_xBuilder->weld_toolbar("object_inspector_toolbar"))
 , maDocumentModelTreeHandler(
   mpDocumentModelTreeView,
   
pInputBindings->GetDispatcher()->GetFrame()->GetObjectShell()->GetBaseModel())
 , maObjectInspectorTreeHandler(mpInterfacesTreeView, mpServicesTreeView, 

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

2021-02-25 Thread Tomaž Vajngerl (via logerrit)
 include/sfx2/devtools/ObjectInspectorTreeHandler.hxx |3 +
 sfx2/UIConfig_sfx.mk |1 
 sfx2/source/devtools/ObjectInspectorTreeHandler.cxx  |   42 +++
 sfx2/uiconfig/ui/devtoolsmenu.ui |   17 +++
 4 files changed, 63 insertions(+)

New commits:
commit c68631373e491936260f2e3b4abc9826d634e410
Author: Tomaž Vajngerl 
AuthorDate: Tue Feb 23 22:54:06 2021 +0900
Commit: Tomaž Vajngerl 
CommitDate: Fri Feb 26 08:05:21 2021 +0100

devtools: add popup menu for properties to inspect objects

With this change it is possible to inspect an object that is
listed in the properties (instead of expanding the tree view
node).

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

diff --git a/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx 
b/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
index 9bb27e4a72cc..7008a398df5a 100644
--- a/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
+++ b/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
@@ -12,6 +12,8 @@
 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 #include 
@@ -48,6 +50,7 @@ public:
 DECL_LINK(ExpandingHandlerServices, const weld::TreeIter&, bool);
 DECL_LINK(ExpandingHandlerProperties, const weld::TreeIter&, bool);
 DECL_LINK(ExpandingHandlerMethods, const weld::TreeIter&, bool);
+DECL_LINK(PopupMenuHandler, const CommandEvent&, bool);
 
 void introspect(css::uno::Reference const& 
xInterface);
 
diff --git a/sfx2/UIConfig_sfx.mk b/sfx2/UIConfig_sfx.mk
index ac2a3f8c9010..7bdbd7a85a1e 100644
--- a/sfx2/UIConfig_sfx.mk
+++ b/sfx2/UIConfig_sfx.mk
@@ -25,6 +25,7 @@ $(eval $(call gb_UIConfig_add_uifiles,sfx,\
sfx2/uiconfig/ui/decktitlebar \
sfx2/uiconfig/ui/descriptioninfopage \
sfx2/uiconfig/ui/developmenttool \
+   sfx2/uiconfig/ui/devtoolsmenu \
sfx2/uiconfig/ui/documentfontspage \
sfx2/uiconfig/ui/documentinfopage \
sfx2/uiconfig/ui/documentpropertiesdialog \
diff --git a/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx 
b/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx
index 98ed6cd2bae4..52e6111a65f4 100644
--- a/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx
+++ b/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx
@@ -367,6 +367,8 @@ public:
 {
 }
 
+uno::Any getAny() { return maAny; }
+
 bool shouldShowExpander() override
 {
 if (maAny.hasValue())
@@ -607,6 +609,9 @@ ObjectInspectorTreeHandler::ObjectInspectorTreeHandler(
 LINK(this, ObjectInspectorTreeHandler, ExpandingHandlerProperties));
 mpMethodsTreeView->connect_expanding(
 LINK(this, ObjectInspectorTreeHandler, ExpandingHandlerMethods));
+
+mpPropertiesTreeView->connect_popup_menu(
+LINK(this, ObjectInspectorTreeHandler, PopupMenuHandler));
 }
 
 void 
ObjectInspectorTreeHandler::handleExpanding(std::unique_ptr& 
pTreeView,
@@ -648,6 +653,43 @@ IMPL_LINK(ObjectInspectorTreeHandler, 
ExpandingHandlerMethods, weld::TreeIter co
 return true;
 }
 
+IMPL_LINK(ObjectInspectorTreeHandler, PopupMenuHandler, const CommandEvent&, 
rCommandEvent, bool)
+{
+if (rCommandEvent.GetCommand() != CommandEventId::ContextMenu)
+return false;
+
+uno::Any aAny;
+OUString sID = mpPropertiesTreeView->get_selected_id();
+if (sID.isEmpty())
+return false;
+
+auto* pNode = 
reinterpret_cast(sID.toInt64());
+if (pNode)
+{
+auto* pBasicValueNode = dynamic_cast(pNode);
+if (pBasicValueNode)
+{
+aAny = pBasicValueNode->getAny();
+uno::Reference xInterface(aAny, uno::UNO_QUERY);
+if (xInterface.is())
+{
+std::unique_ptr 
xBuilder(Application::CreateBuilder(
+mpPropertiesTreeView.get(), "sfx/ui/devtoolsmenu.ui"));
+std::unique_ptr 
xMenu(xBuilder->weld_menu("inspect_menu"));
+
+OString sCommand(xMenu->popup_at_rect(
+mpPropertiesTreeView.get(),
+tools::Rectangle(rCommandEvent.GetMousePosPixel(), Size(1, 
1;
+if (sCommand == "inspect")
+{
+introspect(xInterface);
+}
+}
+}
+}
+return true;
+}
+
 void ObjectInspectorTreeHandler::clearObjectInspectorChildren(
 std::unique_ptr& pTreeView, weld::TreeIter const& rParent)
 {
diff --git a/sfx2/uiconfig/ui/devtoolsmenu.ui b/sfx2/uiconfig/ui/devtoolsmenu.ui
new file mode 100644
index ..608de5bd2639
--- /dev/null
+++ b/sfx2/uiconfig/ui/devtoolsmenu.ui
@@ -0,0 +1,17 @@
+
+
+
+  
+  
+True
+False
+
+  
+True
+False
+Inspect
+True
+  
+
+  
+
___

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

2021-02-21 Thread Tomaž Vajngerl (via logerrit)
 include/sfx2/devtools/DevelopmentToolDockingWindow.hxx |5 
 include/sfx2/devtools/ObjectInspectorTreeHandler.hxx   |   27 +
 sfx2/source/devtools/DevelopmentToolDockingWindow.cxx  |   13 
 sfx2/source/devtools/ObjectInspectorTreeHandler.cxx|  325 +++-
 sfx2/uiconfig/ui/developmenttool.ui|  338 +++--
 5 files changed, 502 insertions(+), 206 deletions(-)

New commits:
commit 28115cec387e4a548844a7402be798d6ff47f9ac
Author: Tomaž Vajngerl 
AuthorDate: Wed Feb 17 11:49:56 2021 +0900
Commit: Tomaž Vajngerl 
CommitDate: Mon Feb 22 06:28:00 2021 +0100

devtools: change the object inspector view to tabs

Until now we had only one tree view with top-level nodes for
services, interfaces, properties and methods. The problem with
this is that each one category has it's own distinct columns
(especially methods) so they can't fit well into just one tree
view. Services and interfaces categories are very simple so they
can be presented in a simpler way.

This change adds a tab-bar on top, for all the categories and each
one is now presented in its own tree view, which makes it possible
to modify the tree view to the specific category. Tree views are
currently copies, but they will be modified in the future into
what is more appropriate for the category.

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

diff --git a/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx 
b/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx
index 987bc053a878..f3633189c9b6 100644
--- a/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx
+++ b/include/sfx2/devtools/DevelopmentToolDockingWindow.hxx
@@ -30,7 +30,10 @@ class SFX2_DLLPUBLIC DevelopmentToolDockingWindow final : 
public SfxDockingWindo
 {
 private:
 std::unique_ptr mpClassNameLabel;
-std::unique_ptr mpClassListBox;
+std::unique_ptr mpInterfacesTreeView;
+std::unique_ptr mpServicesTreeView;
+std::unique_ptr mpPropertiesTreeView;
+std::unique_ptr mpMethodsTreeView;
 std::unique_ptr mpDocumentModelTreeView;
 std::unique_ptr mpSelectionToggle;
 
diff --git a/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx 
b/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
index 69769cc261d9..9bb27e4a72cc 100644
--- a/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
+++ b/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
@@ -19,16 +19,35 @@
 class ObjectInspectorTreeHandler
 {
 private:
-std::unique_ptr& mpObjectInspectorTree;
+std::unique_ptr& mpInterfacesTreeView;
+std::unique_ptr& mpServicesTreeView;
+std::unique_ptr& mpPropertiesTreeView;
+std::unique_ptr& mpMethodsTreeView;
+
 std::unique_ptr& mpClassNameLabel;
 
-void clearObjectInspectorChildren(weld::TreeIter const& rParent);
+static void clearObjectInspectorChildren(std::unique_ptr& 
pTreeView,
+ weld::TreeIter const& rParent);
+static void handleExpanding(std::unique_ptr& pTreeView,
+weld::TreeIter const& rParent);
+static void clearAll(std::unique_ptr& pTreeView);
+
+void appendInterfaces(css::uno::Reference const& 
xInterface);
+void appendServices(css::uno::Reference const& 
xInterface);
+void appendProperties(css::uno::Reference const& 
xInterface);
+void appendMethods(css::uno::Reference const& 
xInterface);
 
 public:
-ObjectInspectorTreeHandler(std::unique_ptr& 
pObjectInspectorTree,
+ObjectInspectorTreeHandler(std::unique_ptr& 
pInterfacesTreeView,
+   std::unique_ptr& 
pServicesTreeView,
+   std::unique_ptr& 
pPropertiesTreeView,
+   std::unique_ptr& 
pMethodsTreeView,
std::unique_ptr& pClassNameLabel);
 
-DECL_LINK(ExpandingHandler, const weld::TreeIter&, bool);
+DECL_LINK(ExpandingHandlerInterfaces, const weld::TreeIter&, bool);
+DECL_LINK(ExpandingHandlerServices, const weld::TreeIter&, bool);
+DECL_LINK(ExpandingHandlerProperties, const weld::TreeIter&, bool);
+DECL_LINK(ExpandingHandlerMethods, const weld::TreeIter&, bool);
 
 void introspect(css::uno::Reference const& 
xInterface);
 
diff --git a/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx 
b/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx
index 5a5134548f11..6bd92f17256d 100644
--- a/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx
+++ b/sfx2/source/devtools/DevelopmentToolDockingWindow.cxx
@@ -28,13 +28,17 @@ 
DevelopmentToolDockingWindow::DevelopmentToolDockingWindow(SfxBindings* pInputBi
 : SfxDockingWindow(pInputBindings, pChildWindow, pParent, 
"DevelopmentTool",
"sfx/ui/developmenttool.ui")
 , 

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

2021-02-20 Thread Noel (via logerrit)
 include/sfx2/stbitem.hxx |3 ++-
 sfx2/source/appl/appdispatchprovider.cxx |2 +-
 sfx2/source/appl/appopen.cxx |4 ++--
 sfx2/source/appl/helpinterceptor.cxx |3 +--
 sfx2/source/appl/workwin.cxx |5 ++---
 sfx2/source/control/thumbnailviewacc.cxx |4 ++--
 sfx2/source/dialog/infobar.cxx   |9 ++---
 sfx2/source/dialog/mailmodel.cxx |7 +++
 sfx2/source/doc/docfile.cxx  |8 +++-
 sfx2/source/doc/doctemplateslocal.cxx|   16 +++-
 sfx2/source/doc/objmisc.cxx  |8 
 sfx2/source/doc/objstor.cxx  |   10 --
 sfx2/source/doc/sfxbasemodel.cxx |   12 +---
 sfx2/source/view/sfxbasecontroller.cxx   |4 ++--
 sfx2/source/view/viewprn.cxx |2 +-
 15 files changed, 41 insertions(+), 56 deletions(-)

New commits:
commit d49277fc7c017c5a62a0c28af782cfc04a6460ab
Author: Noel 
AuthorDate: Sat Feb 20 12:50:48 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Feb 20 19:21:52 2021 +0100

loplugin:refcounting in sfx2

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

diff --git a/include/sfx2/stbitem.hxx b/include/sfx2/stbitem.hxx
index 8929e2efb2f3..060866e4c3eb 100644
--- a/include/sfx2/stbitem.hxx
+++ b/include/sfx2/stbitem.hxx
@@ -61,12 +61,13 @@ class SFX2_DLLPUBLIC SfxStatusBarControl: public 
svt::StatusbarController
 sal_uInt16 nId;
 VclPtr  pBar;
 
-protected:
+public:
 // new controller API
 // XInterface
 virtual void   SAL_CALL acquire() throw() override;
 virtual void   SAL_CALL release() throw() override;
 
+protected:
 // XEventListener
 using svt::StatusbarController::disposing;
 
diff --git a/sfx2/source/appl/appdispatchprovider.cxx 
b/sfx2/source/appl/appdispatchprovider.cxx
index a62872a9a420..af86f8bcc02c 100644
--- a/sfx2/source/appl/appdispatchprovider.cxx
+++ b/sfx2/source/appl/appdispatchprovider.cxx
@@ -133,7 +133,7 @@ Reference < XDispatch > SAL_CALL 
SfxAppDispatchProvider::queryDispatch(
 
 if ( pSlot )
 {
-SfxOfficeDispatch* pDispatch = new SfxOfficeDispatch( pAppDisp, pSlot, 
aURL ) ;
+rtl::Reference pDispatch = new SfxOfficeDispatch( 
pAppDisp, pSlot, aURL ) ;
 pDispatch->SetFrame(m_xFrame);
 pDispatch->SetMasterUnoCommand( bMasterCommand );
 xDisp = pDispatch;
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index e59e58b08033..4a6c1f403bbb 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -676,8 +676,8 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
 // intercept all incoming interactions and provide useful 
information
 // later if the following transaction was finished.
 
-sfx2::PreventDuplicateInteraction* pHandler = new 
sfx2::PreventDuplicateInteraction(comphelper::getProcessComponentContext());
-uno::Reference xHandler(static_cast< 
css::task::XInteractionHandler* >(pHandler), css::uno::UNO_QUERY);
+rtl::Reference pHandler = new 
sfx2::PreventDuplicateInteraction(comphelper::getProcessComponentContext());
+uno::Reference xHandler(pHandler);
 uno::Reference xWrappedHandler;
 
 // wrap existing handler or create new UUI handler
diff --git a/sfx2/source/appl/helpinterceptor.cxx 
b/sfx2/source/appl/helpinterceptor.cxx
index ccab2578e750..7fd631b05951 100644
--- a/sfx2/source/appl/helpinterceptor.cxx
+++ b/sfx2/source/appl/helpinterceptor.cxx
@@ -112,8 +112,7 @@ Reference< XDispatch > SAL_CALL 
HelpInterceptor_Impl::queryDispatch(
 if ( bHelpURL )
 {
 DBG_ASSERT( xResult.is(), "invalid dispatch" );
-HelpDispatch_Impl* pHelpDispatch = new HelpDispatch_Impl( *this, 
xResult );
-xResult.set( static_cast< ::cppu::OWeakObject* >(pHelpDispatch), 
UNO_QUERY );
+xResult = new HelpDispatch_Impl( *this, xResult );
 }
 
 return xResult;
diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx
index 217ae75436bf..d3af7dfa6950 100644
--- a/sfx2/source/appl/workwin.cxx
+++ b/sfx2/source/appl/workwin.cxx
@@ -485,9 +485,8 @@ SfxWorkWindow::SfxWorkWindow( vcl::Window *pWin, SfxFrame 
*pFrm, SfxFrame* pMast
 
 // create and initialize layout manager listener
 Reference< css::frame::XFrame > xFrame = GetFrameInterface();
-LayoutManagerListener* pLayoutManagerListener = new LayoutManagerListener( 
this );
-m_xLayoutManagerListener.set( static_cast< cppu::OWeakObject* >( 
pLayoutManagerListener ),
-  css::uno::UNO_QUERY );
+rtl::Reference pLayoutManagerListener = new 
LayoutManagerListener( this );
+m_xLayoutManagerListener = pLayoutManagerListener;
 

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

2021-02-15 Thread Caolán McNamara (via logerrit)
 include/sfx2/strings.hrc  |3 ---
 sfx2/source/sidebar/DeckTitleBar.cxx  |   12 +---
 sfx2/source/sidebar/PanelTitleBar.cxx |2 --
 sfx2/uiconfig/ui/decktitlebar.ui  |9 -
 sfx2/uiconfig/ui/paneltitlebar.ui |9 -
 solenv/sanitizers/ui/sfx.suppr|2 --
 6 files changed, 17 insertions(+), 20 deletions(-)

New commits:
commit 2f80334f1d4fe0d486f858776687c1180077a5fa
Author: Caolán McNamara 
AuthorDate: Mon Feb 15 14:26:44 2021 +
Commit: Caolán McNamara 
CommitDate: Mon Feb 15 17:23:28 2021 +0100

Related: tdf#140387 give toolbuttons a11y names

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

diff --git a/include/sfx2/strings.hrc b/include/sfx2/strings.hrc
index ddf2745ebb05..0fc589d8d4a6 100644
--- a/include/sfx2/strings.hrc
+++ b/include/sfx2/strings.hrc
@@ -295,9 +295,6 @@
 
 #define STR_CLOSE_PANE  NC_("STR_CLOSE_PANE", "Close 
Pane")
 
-#define SFX_STR_SIDEBAR_MORE_OPTIONS
NC_("SFX_STR_SIDEBAR_MORE_OPTIONS", "More Options")
-#define SFX_STR_SIDEBAR_CLOSE_DECK  
NC_("SFX_STR_SIDEBAR_CLOSE_DECK", "Close Sidebar Deck")
-
 // Translators: default Impress template names
 #define STR_TEMPLATE_NAME1  NC_("STR_TEMPLATE_NAME1", "")
 #define STR_TEMPLATE_NAME2  NC_("STR_TEMPLATE_NAME2", 
"Beehive")
diff --git a/sfx2/source/sidebar/DeckTitleBar.cxx 
b/sfx2/source/sidebar/DeckTitleBar.cxx
index f7e0a8df7b7e..91d95d69f264 100644
--- a/sfx2/source/sidebar/DeckTitleBar.cxx
+++ b/sfx2/source/sidebar/DeckTitleBar.cxx
@@ -119,17 +119,7 @@ void DeckTitleBar::SetCloserVisible (const bool 
bIsCloserVisible)
 
 mbIsCloserVisible = bIsCloserVisible;
 
-if (mbIsCloserVisible)
-{
-mxToolBox->set_item_visible("button", true);
-mxToolBox->set_item_icon_name("button", "sfx2/res/closedoc.png");
-mxToolBox->set_item_tooltip_text("button",
-SfxResId(SFX_STR_SIDEBAR_CLOSE_DECK));
-}
-else
-{
-mxToolBox->set_item_visible("button", false);
-}
+mxToolBox->set_item_visible("button", mbIsCloserVisible);
 }
 
 void DeckTitleBar::HandleToolBoxItemClick()
diff --git a/sfx2/source/sidebar/PanelTitleBar.cxx 
b/sfx2/source/sidebar/PanelTitleBar.cxx
index a9ddbc79fcb5..7f2ff3214722 100644
--- a/sfx2/source/sidebar/PanelTitleBar.cxx
+++ b/sfx2/source/sidebar/PanelTitleBar.cxx
@@ -109,8 +109,6 @@ void PanelTitleBar::SetMoreOptionsCommand(const OUString& 
rsCommandName,
 *mxToolBox, *m_xBuilder, msMoreOptionsCommand, rxFrame, 
rxController, true);
 
 mxToolBox->set_item_visible(msIdent, true);
-mxToolBox->set_item_icon_name(msIdent, "sfx2/res/symphony/morebutton.png");
-mxToolBox->set_item_tooltip_text(msIdent, 
SfxResId(SFX_STR_SIDEBAR_MORE_OPTIONS));
 }
 
 void PanelTitleBar::HandleToolBoxItemClick()
diff --git a/sfx2/uiconfig/ui/decktitlebar.ui b/sfx2/uiconfig/ui/decktitlebar.ui
index 68ecdc6469be..bbfcba7bf69b 100644
--- a/sfx2/uiconfig/ui/decktitlebar.ui
+++ b/sfx2/uiconfig/ui/decktitlebar.ui
@@ -1,5 +1,5 @@
 
-
+
 
   
   
@@ -61,7 +61,14 @@
   
 True
 False
+Close Sidebar Deck
 True
+sfx2/res/closedoc.png
+
+  
+Close Sidebar Deck
+  
+
   
   
 False
diff --git a/sfx2/uiconfig/ui/paneltitlebar.ui 
b/sfx2/uiconfig/ui/paneltitlebar.ui
index 6fd621856b82..2e352bf21a4f 100644
--- a/sfx2/uiconfig/ui/paneltitlebar.ui
+++ b/sfx2/uiconfig/ui/paneltitlebar.ui
@@ -1,5 +1,5 @@
 
-
+
 
   
   
@@ -68,7 +68,14 @@
   
 True
 False
+More Options
 True
+sfx2/res/symphony/morebutton.png
+
+  
+More Options
+  
+
   
   
 False
diff --git a/solenv/sanitizers/ui/sfx.suppr b/solenv/sanitizers/ui/sfx.suppr
index 58a6dc14654f..31def4bb9fb1 100644
--- a/solenv/sanitizers/ui/sfx.suppr
+++ b/solenv/sanitizers/ui/sfx.suppr
@@ -12,7 +12,6 @@ sfx2/uiconfig/ui/custominfopage.ui://GtkLabel[@id='type'] 
orphan-label
 sfx2/uiconfig/ui/custominfopage.ui://GtkLabel[@id='value'] orphan-label
 sfx2/uiconfig/ui/decktitlebar.ui://GtkImage[@id='addonimage'] no-labelled-by
 sfx2/uiconfig/ui/decktitlebar.ui://GtkLabel[@id='label'] orphan-label
-sfx2/uiconfig/ui/decktitlebar.ui://GtkToolButton[@id='button'] button-no-label
 sfx2/uiconfig/ui/documentinfopage.ui://GtkLabel[@id='showcreate'] orphan-label
 sfx2/uiconfig/ui/documentinfopage.ui://GtkLabel[@id='showmodify'] orphan-label
 sfx2/uiconfig/ui/documentinfopage.ui://GtkLabel[@id='showsigned'] orphan-label
@@ -47,7 +46,6 @@ 
sfx2/uiconfig/ui/templatepanel.ui://GtkToggleToolButton[@id='6'] 

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

2021-02-11 Thread Tomaž Vajngerl (via logerrit)
 include/sfx2/devtools/DocumentModelTreeHandler.hxx   |8 +---
 include/sfx2/devtools/ObjectInspectorTreeHandler.hxx |8 +---
 sfx2/source/devtools/DocumentModelTreeHandler.cxx|9 +
 sfx2/source/devtools/ObjectInspectorTreeHandler.cxx  |   10 ++
 4 files changed, 21 insertions(+), 14 deletions(-)

New commits:
commit 5a3b9b4b34984f86b14050eb8ece2350b54b5b8e
Author: Tomaž Vajngerl 
AuthorDate: Tue Feb 9 17:43:42 2021 +0900
Commit: Tomaž Vajngerl 
CommitDate: Thu Feb 11 15:43:21 2021 +0100

devtools: move constructors implementation into cxx

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

diff --git a/include/sfx2/devtools/DocumentModelTreeHandler.hxx 
b/include/sfx2/devtools/DocumentModelTreeHandler.hxx
index 5b752b172b4e..03f5ed274aa4 100644
--- a/include/sfx2/devtools/DocumentModelTreeHandler.hxx
+++ b/include/sfx2/devtools/DocumentModelTreeHandler.hxx
@@ -28,13 +28,7 @@ private:
 
 public:
 DocumentModelTreeHandler(std::unique_ptr& 
pDocumentModelTree,
- css::uno::Reference const& 
xDocument)
-: mpDocumentModelTree(pDocumentModelTree)
-, mxDocument(xDocument)
-{
-mpDocumentModelTree->connect_expanding(
-LINK(this, DocumentModelTreeHandler, ExpandingHandler));
-}
+ css::uno::Reference const& 
xDocument);
 
 DECL_LINK(ExpandingHandler, const weld::TreeIter&, bool);
 
diff --git a/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx 
b/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
index aa6e353e6549..69769cc261d9 100644
--- a/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
+++ b/include/sfx2/devtools/ObjectInspectorTreeHandler.hxx
@@ -26,13 +26,7 @@ private:
 
 public:
 ObjectInspectorTreeHandler(std::unique_ptr& 
pObjectInspectorTree,
-   std::unique_ptr& pClassNameLabel)
-: mpObjectInspectorTree(pObjectInspectorTree)
-, mpClassNameLabel(pClassNameLabel)
-{
-mpObjectInspectorTree->connect_expanding(
-LINK(this, ObjectInspectorTreeHandler, ExpandingHandler));
-}
+   std::unique_ptr& pClassNameLabel);
 
 DECL_LINK(ExpandingHandler, const weld::TreeIter&, bool);
 
diff --git a/sfx2/source/devtools/DocumentModelTreeHandler.cxx 
b/sfx2/source/devtools/DocumentModelTreeHandler.cxx
index e29ce03ad47a..a170e3551bc5 100644
--- a/sfx2/source/devtools/DocumentModelTreeHandler.cxx
+++ b/sfx2/source/devtools/DocumentModelTreeHandler.cxx
@@ -566,6 +566,15 @@ public:
 
 } // end anonymous namespace
 
+DocumentModelTreeHandler::DocumentModelTreeHandler(
+std::unique_ptr& pDocumentModelTree,
+css::uno::Reference const& xDocument)
+: mpDocumentModelTree(pDocumentModelTree)
+, mxDocument(xDocument)
+{
+mpDocumentModelTree->connect_expanding(LINK(this, 
DocumentModelTreeHandler, ExpandingHandler));
+}
+
 uno::Reference 
DocumentModelTreeHandler::getObjectByID(OUString const& rID)
 {
 uno::Reference xObject;
diff --git a/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx 
b/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx
index d69f8130f82b..98e92fb46cbf 100644
--- a/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx
+++ b/sfx2/source/devtools/ObjectInspectorTreeHandler.cxx
@@ -428,6 +428,16 @@ public:
 
 } // end anonymous namespace
 
+ObjectInspectorTreeHandler::ObjectInspectorTreeHandler(
+std::unique_ptr& pObjectInspectorTree,
+std::unique_ptr& pClassNameLabel)
+: mpObjectInspectorTree(pObjectInspectorTree)
+, mpClassNameLabel(pClassNameLabel)
+{
+mpObjectInspectorTree->connect_expanding(
+LINK(this, ObjectInspectorTreeHandler, ExpandingHandler));
+}
+
 IMPL_LINK(ObjectInspectorTreeHandler, ExpandingHandler, weld::TreeIter const&, 
rParent, bool)
 {
 OUString sID = mpObjectInspectorTree->get_id(rParent);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-01-22 Thread Caolán McNamara (via logerrit)
 include/sfx2/ctrlitem.hxx|8 ++-
 sfx2/source/control/ctrlitem.cxx |   29 ++-
 sw/source/uibase/sidebar/PageFormatPanel.cxx |1 
 3 files changed, 19 insertions(+), 19 deletions(-)

New commits:
commit 41372210fbbc497eb6353c998fca0b5502b331d9
Author: Caolán McNamara 
AuthorDate: Fri Jan 22 10:18:38 2021 +
Commit: Caolán McNamara 
CommitDate: Fri Jan 22 15:27:21 2021 +0100

tdf#135590 MapUnit::Map100thMM fallback is inappropiate for writer

which uses MapUnit::Twip

so directly after insert, envelope, ok the new document sidebar
was using MapUnit::Map100thMM to lookup paper sizes instead of
MapUnit::Twip giving inconsistent results against format, page

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

diff --git a/include/sfx2/ctrlitem.hxx b/include/sfx2/ctrlitem.hxx
index 489fdb9461a8..da9f86f93e1c 100644
--- a/include/sfx2/ctrlitem.hxx
+++ b/include/sfx2/ctrlitem.hxx
@@ -30,9 +30,10 @@ class SfxBindings;
 class SFX2_DLLPUBLIC SfxControllerItem
 {
 private:
-sal_uInt16  nId;
+sal_uInt16  nId;
 SfxControllerItem*  pNext; // to notify next ControllerItem
 SfxBindings*pBindings;
+MapUnit eFallbackCoreMetric;
 
 public:
 SfxBindings &   GetBindings() {
@@ -67,6 +68,11 @@ public:
 virtual voidGetControlState( sal_uInt16 nSID, 
boost::property_tree::ptree& );
 
 MapUnit GetCoreMetric() const;
+// override what GetCoreMetric will return if it cannot determine the 
current CoreMetric
+voidSetFallbackCoreMetric(MapUnit eFallback)
+{
+eFallbackCoreMetric = eFallback;
+}
 
 static SfxItemState GetItemState( const SfxPoolItem* pState );
 
diff --git a/sfx2/source/control/ctrlitem.cxx b/sfx2/source/control/ctrlitem.cxx
index 1b039e44ad9d..308706f95b8c 100644
--- a/sfx2/source/control/ctrlitem.cxx
+++ b/sfx2/source/control/ctrlitem.cxx
@@ -152,9 +152,7 @@ void SfxControllerItem::ClearCache()
 pBindings->ClearCache_Impl( GetId() );
 }
 
-
 // replaces the successor in the list of bindings of the same id
-
 SfxControllerItem* SfxControllerItem::ChangeItemLink( SfxControllerItem* 
pNewLink )
 {
 SfxControllerItem* pOldLink = pNext;
@@ -164,37 +162,32 @@ SfxControllerItem* SfxControllerItem::ChangeItemLink( 
SfxControllerItem* pNewLin
 
 
 // changes the id of unbound functions (e.g. for sub-menu-ids)
-
 void SfxControllerItem::SetId( sal_uInt16 nItemId )
 {
 DBG_ASSERT( !IsBound(), "changing id of bound binding" );
 nId = nItemId;
 }
 
-
 // creates an atomic item for a controller without registration.
-
-SfxControllerItem::SfxControllerItem():
-nId(0),
-pNext(this),
-pBindings(nullptr)
+SfxControllerItem::SfxControllerItem()
+: nId(0)
+, pNext(this)
+, pBindings(nullptr)
+, eFallbackCoreMetric(MapUnit::Map100thMM)
 {
 }
 
-
 // creates a representation of the function nId and registers it
-
-SfxControllerItem::SfxControllerItem( sal_uInt16 nID, SfxBindings  ):
-nId(nID),
-pNext(this),
-pBindings()
+SfxControllerItem::SfxControllerItem(sal_uInt16 nID, SfxBindings )
+: nId(nID)
+, pNext(this)
+, pBindings()
+, eFallbackCoreMetric(MapUnit::Map100thMM)
 {
 Bind(nId, );
 }
 
-
 // unregisters the item in the bindings
-
 SfxControllerItem::~SfxControllerItem()
 {
 dispose();
@@ -345,7 +338,7 @@ MapUnit SfxControllerItem::GetCoreMetric() const
 }
 
 SAL_INFO( "sfx.control", "W1: Can not find ItemPool!" );
-return MapUnit::Map100thMM;
+return eFallbackCoreMetric;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/sidebar/PageFormatPanel.cxx 
b/sw/source/uibase/sidebar/PageFormatPanel.cxx
index 45019db48e9d..31d556ca15ee 100644
--- a/sw/source/uibase/sidebar/PageFormatPanel.cxx
+++ b/sw/source/uibase/sidebar/PageFormatPanel.cxx
@@ -139,6 +139,7 @@ void PageFormatPanel::dispose()
 void PageFormatPanel::Initialize()
 {
 mxPaperSizeBox->FillPaperSizeEntries( PaperSizeApp::Std );
+maPaperSizeController.SetFallbackCoreMetric(MapUnit::MapTwip);
 meUnit = maPaperSizeController.GetCoreMetric();
 mxPaperWidth->SetFieldUnit(meFUnit);
 mxPaperHeight->SetFieldUnit(meFUnit);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-12-23 Thread Vert D (via logerrit)
 include/sfx2/templatedlglocalview.hxx|2 +-
 include/sfx2/templatelocalview.hxx   |2 ++
 sfx2/source/control/templatedlglocalview.cxx |8 +++-
 sfx2/source/control/templatelocalview.cxx|   22 ++
 sfx2/source/control/templatesearchview.cxx   |7 ++-
 sfx2/source/doc/templatedlg.cxx  |4 ++--
 sfx2/source/inc/templatesearchview.hxx   |2 +-
 7 files changed, 41 insertions(+), 6 deletions(-)

New commits:
commit 86f3fa919a6de6767177193d5b7714f8f6dbd5c4
Author: Vert D 
AuthorDate: Sat Dec 12 00:39:51 2020 -0500
Commit: Heiko Tietze 
CommitDate: Wed Dec 23 11:38:50 2020 +0100

tdf#138246 Disable edit rename delete contextmenu items for built-in 
templates

Change-Id: I7bcaa8acc034a3d3e9926db2f1f54bbeceddca2d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107611
Tested-by: Jenkins
Tested-by: Heiko Tietze 
Reviewed-by: Noel Grandin 
Reviewed-by: Heiko Tietze 

diff --git a/include/sfx2/templatedlglocalview.hxx 
b/include/sfx2/templatedlglocalview.hxx
index b3a50eeff50c..c6caca46f519 100644
--- a/include/sfx2/templatedlglocalview.hxx
+++ b/include/sfx2/templatedlglocalview.hxx
@@ -26,7 +26,7 @@ public:
 
 void showRegion(std::u16string_view rName);
 
-void createContextMenu(const bool bIsDefault);
+void createContextMenu(const bool bIsDefault, const bool bIsBuiltIn);
 
 virtual void Show() override;
 
diff --git a/include/sfx2/templatelocalview.hxx 
b/include/sfx2/templatelocalview.hxx
index 9304e858ad9b..a37d72d1cf50 100644
--- a/include/sfx2/templatelocalview.hxx
+++ b/include/sfx2/templatelocalview.hxx
@@ -153,6 +153,8 @@ public:
 
 static bool IsDefaultTemplate(const OUString& rPath);
 
+static bool IsInternalTemplate(const OUString& rPath);
+
 protected:
 virtual void OnItemDblClicked(ThumbnailViewItem *pItem) override;
 
diff --git a/sfx2/source/control/templatedlglocalview.cxx 
b/sfx2/source/control/templatedlglocalview.cxx
index 0949e684c414..39b88774cade 100644
--- a/sfx2/source/control/templatedlglocalview.cxx
+++ b/sfx2/source/control/templatedlglocalview.cxx
@@ -63,7 +63,7 @@ void TemplateDlgLocalView::showRegion(std::u16string_view 
rName)
 }
 }
 
-void TemplateDlgLocalView::createContextMenu(const bool bIsDefault)
+void TemplateDlgLocalView::createContextMenu(const bool bIsDefault, const bool 
bIsBuiltIn)
 {
 mxContextMenu->clear();
 mxContextMenu->append("open", SfxResId(STR_OPEN));
@@ -77,6 +77,12 @@ void TemplateDlgLocalView::createContextMenu(const bool 
bIsDefault)
 mxContextMenu->append_separator("separator");
 mxContextMenu->append("rename", SfxResId(STR_SFX_RENAME));
 mxContextMenu->append("delete", SfxResId(STR_DELETE));
+if (bIsBuiltIn)
+{
+mxContextMenu->set_sensitive("rename", false);
+mxContextMenu->set_sensitive("edit", false);
+mxContextMenu->set_sensitive("delete", false);
+}
 if (mViewMode == TemplateViewMode::eThumbnailView)
 {
 deselectItems();
diff --git a/sfx2/source/control/templatelocalview.cxx 
b/sfx2/source/control/templatelocalview.cxx
index 5faba8b552d1..87e07fd30642 100644
--- a/sfx2/source/control/templatelocalview.cxx
+++ b/sfx2/source/control/templatelocalview.cxx
@@ -26,6 +26,11 @@
 #include 
 #include 
 
+#include 
+#include 
+#include 
+#include 
+
 using namespace ::com::sun::star;
 
 bool ViewFilter_Application::isFilteredExtension(FILTER_APPLICATION filter, 
std::u16string_view rExt)
@@ -919,5 +924,22 @@ void TemplateLocalView::OnItemDblClicked 
(ThumbnailViewItem *pItem)
 maOpenTemplateHdl.Call(pViewItem);
 }
 
+bool TemplateLocalView::IsInternalTemplate(const OUString& rPath)
+{
+uno::Reference< uno::XComponentContext > xContext = 
::comphelper::getProcessComponentContext();
+css::uno::Reference< css::util::XPathSettings > xPathSettings = 
css::util::thePathSettings::get(xContext);
+uno::Sequence aInternalTemplateDirs;
+uno::Any aAny = xPathSettings->getPropertyValue("Template_internal");
+aAny >>= aInternalTemplateDirs;
+SfxURLRelocator_Impl aRelocator(xContext);
+for (auto& rInternalTemplateDir : aInternalTemplateDirs)
+{
+aRelocator.makeRelocatableURL(rInternalTemplateDir);
+aRelocator.makeAbsoluteURL(rInternalTemplateDir);
+if(::utl::UCBContentHelper::IsSubPath(rInternalTemplateDir, rPath))
+return true;
+}
+return false;
+}
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/control/templatesearchview.cxx 
b/sfx2/source/control/templatesearchview.cxx
index e1d2f8083fac..bde9769cd751 100644
--- a/sfx2/source/control/templatesearchview.cxx
+++ b/sfx2/source/control/templatesearchview.cxx
@@ -131,7 +131,7 @@ bool TemplateSearchView::Command(const CommandEvent& rCEvt)
 return true;
 }
 
-void TemplateSearchView::createContextMenu(const bool bIsDefault)
+void TemplateSearchView::createContextMenu(const bool 

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

2020-12-01 Thread Caolán McNamara (via logerrit)
 include/sfx2/sidebar/TabBar.hxx |2 --
 include/sfx2/sidebar/Theme.hxx  |3 ---
 sfx2/source/sidebar/TabBar.cxx  |   10 --
 sfx2/source/sidebar/Theme.cxx   |   22 --
 4 files changed, 37 deletions(-)

New commits:
commit e5529e3a89df2b9bd5d76e3b8fbbfa17c4203d28
Author: Caolán McNamara 
AuthorDate: Tue Dec 1 10:22:09 2020 +
Commit: Caolán McNamara 
CommitDate: Tue Dec 1 14:01:45 2020 +0100

cid#1470362 Uninitialized scalar field

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

diff --git a/include/sfx2/sidebar/TabBar.hxx b/include/sfx2/sidebar/TabBar.hxx
index e52202ac1bb0..1738df1e2bfe 100644
--- a/include/sfx2/sidebar/TabBar.hxx
+++ b/include/sfx2/sidebar/TabBar.hxx
@@ -69,7 +69,6 @@ public:
 virtual ~TabBar() override;
 virtual void dispose() override;
 
-virtual void Paint (vcl::RenderContext& /*rRenderContext*/, const 
tools::Rectangle& rUpdateArea) override;
 virtual void DataChanged (const DataChangedEvent& rDataChangedEvent) 
override;
 virtual bool EventNotify (NotifyEvent& rEvent) override;
 
@@ -120,7 +119,6 @@ private:
 typedef ::std::vector> ItemContainer;
 ItemContainer maItems;
 const ::std::function 
maDeckActivationFunctor;
-sal_Int32 mnMenuSeparatorY;
 PopupMenuProvider maPopupMenuProvider;
 
 static void CreateTabItem(weld::Toolbar& rButton, const DeckDescriptor& 
rDeckDescriptor);
diff --git a/include/sfx2/sidebar/Theme.hxx b/include/sfx2/sidebar/Theme.hxx
index 9b35ce7aa6dd..c59d71233b00 100644
--- a/include/sfx2/sidebar/Theme.hxx
+++ b/include/sfx2/sidebar/Theme.hxx
@@ -61,7 +61,6 @@ public:
 
 Color_DeckTitleFont,
 Color_PanelTitleFont,
-Color_TabMenuSeparator,
 Color_Highlight,
 Color_HighlightText,
 Color_DeckBackground,
@@ -79,8 +78,6 @@ public:
 Int_DeckBorderSize,
 Int_DeckSeparatorHeight,
 Int_PanelTitleBarHeight,
-Int_TabMenuPadding,
-Int_TabMenuSeparatorPadding,
 Int_DeckLeftPadding,
 Int_DeckTopPadding,
 Int_DeckRightPadding,
diff --git a/sfx2/source/sidebar/TabBar.cxx b/sfx2/source/sidebar/TabBar.cxx
index 6efe1133bda9..11567b228eb0 100644
--- a/sfx2/source/sidebar/TabBar.cxx
+++ b/sfx2/source/sidebar/TabBar.cxx
@@ -95,16 +95,6 @@ void TabBar::dispose()
 InterimItemWindow::dispose();
 }
 
-void TabBar::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& 
rUpdateArea)
-{
-InterimItemWindow::Paint(rRenderContext, rUpdateArea);
-
-const sal_Int32 
nHorizontalPadding(Theme::GetInteger(Theme::Int_TabMenuSeparatorPadding));
-
rRenderContext.SetLineColor(Theme::GetColor(Theme::Color_TabMenuSeparator));
-rRenderContext.DrawLine(Point(nHorizontalPadding, mnMenuSeparatorY),
-Point(GetSizePixel().Width() - nHorizontalPadding, 
mnMenuSeparatorY));
-}
-
 sal_Int32 TabBar::GetDefaultWidth()
 {
 if (!gDefaultWidth)
diff --git a/sfx2/source/sidebar/Theme.cxx b/sfx2/source/sidebar/Theme.cxx
index 063572b5c97e..bd64a87b7907 100644
--- a/sfx2/source/sidebar/Theme.cxx
+++ b/sfx2/source/sidebar/Theme.cxx
@@ -180,16 +180,6 @@ void Theme::UpdateTheme()
 maPropertyIdToNameMap[Color_TabBarBackground],
 Any(sal_Int32(aBaseBackgroundColor.GetRGBColor(;
 
-setPropertyValue(
-maPropertyIdToNameMap[Int_TabMenuPadding],
-Any(sal_Int32(3)));
-setPropertyValue(
-maPropertyIdToNameMap[Color_TabMenuSeparator],
-Any(sal_Int32(aBorderColor.GetRGBColor(;
-setPropertyValue(
-maPropertyIdToNameMap[Int_TabMenuSeparatorPadding],
-Any(sal_Int32(3)));
-
 setPropertyValue(
 maPropertyIdToNameMap[Color_DropDownBackground],
 Any(sal_Int32(aBaseBackgroundColor.GetRGBColor(;
@@ -512,9 +502,6 @@ void Theme::SetupPropertyMaps()
 maPropertyNameToIdMap["Color_PanelTitleFont"]=Color_PanelTitleFont;
 maPropertyIdToNameMap[Color_PanelTitleFont]="Color_PanelTitleFont";
 
-maPropertyNameToIdMap["Color_TabMenuSeparator"]=Color_TabMenuSeparator;
-maPropertyIdToNameMap[Color_TabMenuSeparator]="Color_TabMenuSeparator";
-
 maPropertyNameToIdMap["Color_Highlight"]=Color_Highlight;
 maPropertyIdToNameMap[Color_Highlight]="Color_Highlight";
 
@@ -559,12 +546,6 @@ void Theme::SetupPropertyMaps()
 maPropertyNameToIdMap["Int_PanelTitleBarHeight"]=Int_PanelTitleBarHeight;
 maPropertyIdToNameMap[Int_PanelTitleBarHeight]="Int_PanelTitleBarHeight";
 
-maPropertyNameToIdMap["Int_TabMenuPadding"]=Int_TabMenuPadding;
-maPropertyIdToNameMap[Int_TabMenuPadding]="Int_TabMenuPadding";
-
-
maPropertyNameToIdMap["Int_TabMenuSeparatorPadding"]=Int_TabMenuSeparatorPadding;
-

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

2020-11-25 Thread Stephan Bergmann (via logerrit)
 include/sfx2/app.hxx|2 +-
 include/sfx2/objsh.hxx  |2 +-
 sfx2/source/appl/appdde.cxx |   15 +++
 3 files changed, 9 insertions(+), 10 deletions(-)

New commits:
commit 9a68ae949c8db91fad463df6d84e4eb89b3be4f7
Author: Stephan Bergmann 
AuthorDate: Wed Nov 25 11:20:59 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Wed Nov 25 15:59:41 2020 +0100

SfxObjectShell::DdeExecute and SfxApplication::DdeExecute should return bool

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

diff --git a/include/sfx2/app.hxx b/include/sfx2/app.hxx
index 9714ad8e13d5..26b14e2ca2d4 100644
--- a/include/sfx2/app.hxx
+++ b/include/sfx2/app.hxx
@@ -120,7 +120,7 @@ public:
 
 // DDE
 #if defined(_WIN32)
-static long DdeExecute( const OUString& rCmd );
+static bool DdeExecute( const OUString& rCmd );
 #endif
 boolInitializeDde();
 const DdeService*   GetDdeService() const;
diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index c4ec915588b4..8d3897b29d07 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -532,7 +532,7 @@ public:
 
 #if defined(_WIN32)
 // DDE-Interface
-longDdeExecute( const OUString& rCmd );
+boolDdeExecute( const OUString& rCmd );
 virtual boolDdeGetData( const OUString& rItem,
 const OUString& rMimeType,
 css::uno::Any & rValue );
diff --git a/sfx2/source/appl/appdde.cxx b/sfx2/source/appl/appdde.cxx
index 9c2e21dcc426..0746c19755d2 100644
--- a/sfx2/source/appl/appdde.cxx
+++ b/sfx2/source/appl/appdde.cxx
@@ -297,7 +297,7 @@ bool SfxAppEvent_Impl( const OUString& rCmd, const 
OUString& rEvent,
 relevant SfxApplication subclass in BASIC syntax. Return values can
 not be transferred, unfortunately.
 */
-long SfxApplication::DdeExecute( const OUString&   rCmd )  // Expressed in our 
BASIC-Syntax
+bool SfxApplication::DdeExecute( const OUString&   rCmd )  // Expressed in our 
BASIC-Syntax
 {
 // Print or Open-Event?
 if ( !( SfxAppEvent_Impl( rCmd, "Print", ApplicationEvent::Type::Print ) ||
@@ -310,10 +310,10 @@ long SfxApplication::DdeExecute( const OUString&   rCmd ) 
 // Expressed in our B
 if( !pRet )
 {
 SbxBase::ResetError();
-return 0;
+return false;
 }
 }
-return 1;
+return true;
 }
 
 /*  [Description]
@@ -323,7 +323,7 @@ long SfxApplication::DdeExecute( const OUString&   rCmd )  
// Expressed in our B
 
 The base implementation does nothing and returns 0.
 */
-long SfxObjectShell::DdeExecute( const OUString&   rCmd )  // Expressed in our 
BASIC-Syntax
+bool SfxObjectShell::DdeExecute( const OUString&   rCmd )  // Expressed in our 
BASIC-Syntax
 {
 #if !HAVE_FEATURE_SCRIPTING
 (void) rCmd;
@@ -334,10 +334,10 @@ long SfxObjectShell::DdeExecute( const OUString&   rCmd ) 
 // Expressed in our B
 if( !pRet )
 {
 SbxBase::ResetError();
-return 0;
+return false;
 }
 #endif
-return 1;
+return true;
 }
 
 /*  [Description]
@@ -537,8 +537,7 @@ bool SfxDdeDocTopic_Impl::Put( const DdeData* pData )
 
 bool SfxDdeDocTopic_Impl::Execute( const OUString* pStr )
 {
-long nRet = pStr ? pSh->DdeExecute( *pStr ) : 0;
-return 0 != nRet;
+return pStr && pSh->DdeExecute( *pStr );
 }
 
 bool SfxDdeDocTopic_Impl::MakeItem( const OUString& rItem )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-11-17 Thread Stephan Bergmann (via logerrit)
 include/sfx2/frmdescr.hxx|2 +-
 sfx2/source/doc/frmdescr.cxx |4 ++--
 sfx2/source/view/frame.cxx   |2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 32625c819b60318934f27df628fe35f10d5eb25a
Author: Stephan Bergmann 
AuthorDate: Tue Nov 17 16:16:31 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Nov 17 19:34:49 2020 +0100

Remove unused SfxFrameDescriptor::SetActualURL parameter

It got technically unused when e79e8117dcc7475d8d90afeaaac9eb7050ff244e
"loplugin:unusedfields in sfx2" removed SfxFrameDescriptor::aActualURL, 
which in
turn had apparently become unused over a series of commits cleaning up 
unused
code.  The function looks like a misnomer now, and it is not clear to me 
whether
what it does is still useful (and whether or not all the clean-up that 
brought
us here was actually good), but lets leave the remains as they are for now.

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

diff --git a/include/sfx2/frmdescr.hxx b/include/sfx2/frmdescr.hxx
index 50df431b4c24..3901961fb639 100644
--- a/include/sfx2/frmdescr.hxx
+++ b/include/sfx2/frmdescr.hxx
@@ -66,7 +66,7 @@ public:
 const INetURLObject&GetURL() const
 { return aURL; }
 voidSetURL( const OUString& rURL );
-voidSetActualURL( std::u16string_view rURL );
+voidSetActualURL();
 
 // FrameName
 const OUString& GetName() const
diff --git a/sfx2/source/doc/frmdescr.cxx b/sfx2/source/doc/frmdescr.cxx
index a9acefa8ad44..b97d3b6bbdcc 100644
--- a/sfx2/source/doc/frmdescr.cxx
+++ b/sfx2/source/doc/frmdescr.cxx
@@ -45,10 +45,10 @@ SfxItemSet* SfxFrameDescriptor::GetArgs()
 void SfxFrameDescriptor::SetURL( const OUString& rURL )
 {
 aURL = INetURLObject(rURL);
-SetActualURL(aURL.GetMainURL( INetURLObject::DecodeMechanism::ToIUri ));
+SetActualURL();
 }
 
-void SfxFrameDescriptor::SetActualURL( std::u16string_view )
+void SfxFrameDescriptor::SetActualURL()
 {
 if ( m_pArgs )
 m_pArgs->ClearItem();
diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx
index 385b20ef967f..efd6a4e67a96 100644
--- a/sfx2/source/view/frame.cxx
+++ b/sfx2/source/view/frame.cxx
@@ -308,7 +308,7 @@ void SfxFrame::UpdateDescriptor( SfxObjectShell const *pDoc 
)
 assert(pDoc && "NULL-Document inserted ?!");
 
 const SfxMedium *pMed = pDoc->GetMedium();
-GetDescriptor()->SetActualURL( pMed->GetOrigURL() );
+GetDescriptor()->SetActualURL();
 
 // Mark FileOpen parameter
 SfxItemSet* pItemSet = pMed->GetItemSet();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-11-06 Thread Caolán McNamara (via logerrit)
 include/sfx2/sidebar/Theme.hxx |   15 ---
 sfx2/source/sidebar/Theme.cxx  |   85 -
 2 files changed, 4 insertions(+), 96 deletions(-)

New commits:
commit 124da70f50b526381a979d059e8e5f54c8717208
Author: Caolán McNamara 
AuthorDate: Fri Nov 6 13:14:48 2020 +
Commit: Caolán McNamara 
CommitDate: Fri Nov 6 17:16:29 2020 +0100

drop some unused sidebar theme properties and enums

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

diff --git a/include/sfx2/sidebar/Theme.hxx b/include/sfx2/sidebar/Theme.hxx
index a1500364d7d2..ebe5ec8b496a 100644
--- a/include/sfx2/sidebar/Theme.hxx
+++ b/include/sfx2/sidebar/Theme.hxx
@@ -87,10 +87,6 @@ public:
 Paint_TabItemBackgroundHighlight,
 Paint_HorizontalBorder,
 Paint_VerticalBorder,
-Paint_ToolBoxBackground,
-Paint_ToolBoxBorderTopLeft,
-Paint_ToolBoxBorderCenterCorners,
-Paint_ToolBoxBorderBottomRight,
 Paint_DropDownBackground,
 
 Paint_Int_,
@@ -118,13 +114,8 @@ public:
 Bool_UseSystemColors,
 Bool_IsHighContrastModeActive,
 
-Bool_Rect_,
-
-Rect_ToolBoxPadding,
-Rect_ToolBoxBorder,
-
-Post_Rect_,
-End_=Post_Rect_
+Post_Bool_,
+End_=Post_Bool_
 };
 
 static Image GetImage (const ThemeItem eItem);
@@ -182,7 +173,6 @@ private:
 std::vector maPaints;
 std::vector maIntegers;
 std::vector maBooleans;
-std::vector maRectangles;
 bool mbIsHighContrastMode;
 bool mbIsHighContrastModeSetManually;
 
@@ -207,7 +197,6 @@ private:
 PT_Paint,
 PT_Integer,
 PT_Boolean,
-PT_Rectangle,
 PT_Invalid
 };
 
diff --git a/sfx2/source/sidebar/Theme.cxx b/sfx2/source/sidebar/Theme.cxx
index 51a0debdc997..a19b60f3d5d7 100644
--- a/sfx2/source/sidebar/Theme.cxx
+++ b/sfx2/source/sidebar/Theme.cxx
@@ -279,40 +279,6 @@ void Theme::UpdateTheme()
 setPropertyValue(
 maPropertyIdToNameMap[Image_CloseIndicator],
 
Any(OUString("private:graphicrepository/cmd/lc_decrementlevel.png")));
-
-// Gradient style
-Color aGradientStop2 (aBaseBackgroundColor);
-aGradientStop2.IncreaseLuminance(17);
-Color aToolBoxBorderColor (aBaseBackgroundColor);
-aToolBoxBorderColor.DecreaseLuminance(12);
-setPropertyValue(
-maPropertyIdToNameMap[Paint_ToolBoxBackground],
-Any(Tools::VclToAwtGradient(Gradient(
-GradientStyle::Linear,
-aBaseBackgroundColor.GetRGBColor(),
-aGradientStop2.GetRGBColor()
-;
-setPropertyValue(
-maPropertyIdToNameMap[Paint_ToolBoxBorderTopLeft],
-mbIsHighContrastMode
-? Any(util::Color(sal_uInt32(0x00ff00)))
-: Any(util::Color(aToolBoxBorderColor.GetRGBColor(;
-setPropertyValue(
-maPropertyIdToNameMap[Paint_ToolBoxBorderCenterCorners],
-mbIsHighContrastMode
-? Any(util::Color(sal_uInt32(0x00ff00)))
-: Any(util::Color(aToolBoxBorderColor.GetRGBColor(;
-setPropertyValue(
-maPropertyIdToNameMap[Paint_ToolBoxBorderBottomRight],
-mbIsHighContrastMode
-? Any(util::Color(sal_uInt32(0x00ff00)))
-: Any(util::Color(aToolBoxBorderColor.GetRGBColor(;
-setPropertyValue(
-maPropertyIdToNameMap[Rect_ToolBoxPadding],
-Any(awt::Rectangle(2,2,2,2)));
-setPropertyValue(
-maPropertyIdToNameMap[Rect_ToolBoxBorder],
-Any(awt::Rectangle(1,1,1,1)));
 }
 catch(beans::UnknownPropertyException const &)
 {
@@ -578,13 +544,12 @@ sal_Bool SAL_CALL Theme::hasPropertyByName (const 
OUString& rsPropertyName)
 
 void Theme::SetupPropertyMaps()
 {
-maPropertyIdToNameMap.resize(Post_Rect_);
+maPropertyIdToNameMap.resize(Post_Bool_);
 maImages.resize(Image_Color_ - Pre_Image_ - 1);
 maColors.resize(Color_Paint_ - Image_Color_ - 1);
 maPaints.resize(Paint_Int_ - Color_Paint_ - 1);
 maIntegers.resize(Int_Bool_ - Paint_Int_ - 1);
-maBooleans.resize(Bool_Rect_ - Int_Bool_ - 1);
-maRectangles.resize(Post_Rect_ - Bool_Rect_ - 1);
+maBooleans.resize(Post_Bool_ - Int_Bool_ - 1);
 
 maPropertyNameToIdMap["Image_Grip"]=Image_Grip;
 maPropertyIdToNameMap[Image_Grip]="Image_Grip";
@@ -657,18 +622,6 @@ void Theme::SetupPropertyMaps()
 maPropertyNameToIdMap["Paint_VerticalBorder"]=Paint_VerticalBorder;
 maPropertyIdToNameMap[Paint_VerticalBorder]="Paint_VerticalBorder";
 
-maPropertyNameToIdMap["Paint_ToolBoxBackground"]=Paint_ToolBoxBackground;
-

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

2020-10-22 Thread Caolán McNamara (via logerrit)
 include/sfx2/templatelocalview.hxx |   72 -
 sfx2/source/control/recentdocsviewitem.cxx |4 
 sfx2/source/control/templatelocalview.cxx  |  393 -
 sfx2/source/control/templatesearchview.cxx |2 
 4 files changed, 5 insertions(+), 466 deletions(-)

New commits:
commit 2a635ba02b51a2523feef71fb28643cad540f942
Author: Caolán McNamara 
AuthorDate: Sat Oct 17 17:36:07 2020 +0100
Commit: Caolán McNamara 
CommitDate: Thu Oct 22 20:35:41 2020 +0200

drop newly unused TemplateLocalView

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

diff --git a/include/sfx2/templatelocalview.hxx 
b/include/sfx2/templatelocalview.hxx
index 997a67823a44..5ce620bed4a2 100644
--- a/include/sfx2/templatelocalview.hxx
+++ b/include/sfx2/templatelocalview.hxx
@@ -63,78 +63,6 @@ private:
 FILTER_APPLICATION mApp;
 };
 
-
-class TemplateLocalView : public ThumbnailView
-{
-typedef bool (*selection_cmp_fn)(const ThumbnailViewItem*,const 
ThumbnailViewItem*);
-
-public:
-
-TemplateLocalView ( vcl::Window* pParent );
-
-virtual ~TemplateLocalView () override;
-virtual void dispose() override;
-
-// Fill view with new item list
-void insertItems (const std::vector , 
bool isRegionSelected = true, bool bShowCategoryInTooltip = false);
-
-// Fill view with template folders thumbnails
-void Populate ();
-
-virtual void reload ();
-
-virtual void showAllTemplates ();
-
-void showRegion (TemplateContainerItem const *pItem);
-
-DECL_LINK(ContextMenuSelectHdl, Menu*, bool);
-
-virtual bool renameItem(ThumbnailViewItem* pItem, const OUString& 
sNewTitle) override;
-
-virtual void MouseButtonDown( const MouseEvent& rMEvt ) override;
-
-virtual void RequestHelp( const HelpEvent& rHEvt ) override;
-
-virtual void Command( const CommandEvent& rCEvt ) override;
-
-virtual void KeyInput( const KeyEvent& rKEvt ) override;
-
-void setCreateContextMenuHdl(const Link );
-
-void setOpenTemplateHdl(const Link );
-
-void setEditTemplateHdl(const Link );
-
-static BitmapEx scaleImg (const BitmapEx , tools::Long width, 
tools::Long height);
-
-static BitmapEx getDefaultThumbnail( const OUString& rPath );
-
-static BitmapEx fetchThumbnail (const OUString , tools::Long width, 
tools::Long height);
-
-static bool IsDefaultTemplate(const OUString& rPath);
-
-protected:
-virtual void OnItemDblClicked(ThumbnailViewItem *pItem) override;
-
-protected:
-sal_uInt16 mnCurRegionId;
-
-TemplateViewItem *maSelectedItem;
-
-tools::Long mnThumbnailWidth;
-tools::Long mnThumbnailHeight;
-
-Point maPosition; //store the point of click event
-
-Link maCreateContextMenuHdl;
-Link maOpenTemplateHdl;
-Link maEditTemplateHdl;
-
-std::unique_ptr mpDocTemplates;
-std::vector > maRegions;
-std::vector maAllTemplates;
-};
-
 class SfxTemplateLocalView : public SfxThumbnailView
 {
 typedef bool (*selection_cmp_fn)(const ThumbnailViewItem*,const 
ThumbnailViewItem*);
diff --git a/sfx2/source/control/recentdocsviewitem.cxx 
b/sfx2/source/control/recentdocsviewitem.cxx
index 8a047b20ee8d..9b73ef2c88ef 100644
--- a/sfx2/source/control/recentdocsviewitem.cxx
+++ b/sfx2/source/control/recentdocsviewitem.cxx
@@ -84,7 +84,7 @@ RecentDocsViewItem::RecentDocsViewItem(sfx2::RecentDocsView 
, const OUStri
 
 if (aExtSize.Width() > aThumbnailSize.Width() || aExtSize.Height() > 
aThumbnailSize.Height())
 {
-aExt = TemplateLocalView::scaleImg(aExt, aThumbnailSize.Width(), 
aThumbnailSize.Height());
+aExt = SfxTemplateLocalView::scaleImg(aExt, 
aThumbnailSize.Width(), aThumbnailSize.Height());
 aExtSize = aExt.GetSizePixel();
 }
 
@@ -99,7 +99,7 @@ RecentDocsViewItem::RecentDocsViewItem(sfx2::RecentDocsView 
, const OUStri
 }
 
 maTitle = aTitle;
-maPreview1 = TemplateLocalView::scaleImg(aThumbnail, nThumbnailSize, 
nThumbnailSize);
+maPreview1 = SfxTemplateLocalView::scaleImg(aThumbnail, nThumbnailSize, 
nThumbnailSize);
 }
 
 ::tools::Rectangle RecentDocsViewItem::updateHighlight(bool bVisible, const 
Point& rPoint)
diff --git a/sfx2/source/control/templatelocalview.cxx 
b/sfx2/source/control/templatelocalview.cxx
index 1657a3bae43c..40f0418b9206 100644
--- a/sfx2/source/control/templatelocalview.cxx
+++ b/sfx2/source/control/templatelocalview.cxx
@@ -27,12 +27,6 @@
 #include 
 #include 
 
-#define MNI_OPEN   1
-#define MNI_EDIT   2
-//#define MNI_DEFAULT_TEMPLATE   3
-#define MNI_DELETE 4
-#define MNI_RENAME 5
-
 using namespace ::com::sun::star;
 
 bool ViewFilter_Application::isFilteredExtension(FILTER_APPLICATION filter, 
const OUString )
@@ -77,395 +71,12 @@ bool ViewFilter_Application::operator () (const 
ThumbnailViewItem *pItem)
 

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

2020-10-14 Thread Heiko Tietze (via logerrit)
 include/sfx2/templatedlg.hxx|4 
 sfx2/source/doc/templatedlg.cxx |   40 +--
 sfx2/uiconfig/ui/templatedlg.ui |  211 +++-
 3 files changed, 114 insertions(+), 141 deletions(-)

New commits:
commit 9eaaf97ab32068a619b5c36772619b7e66268800
Author: Heiko Tietze 
AuthorDate: Wed Oct 14 15:12:36 2020 +0200
Commit: Heiko Tietze 
CommitDate: Wed Oct 14 16:52:33 2020 +0200

Resolves tdf#137477 - Access templates via tight extensions

UI modified and code added

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

diff --git a/include/sfx2/templatedlg.hxx b/include/sfx2/templatedlg.hxx
index b6e8bca39b84..9d2f637ad51c 100644
--- a/include/sfx2/templatedlg.hxx
+++ b/include/sfx2/templatedlg.hxx
@@ -84,7 +84,7 @@ protected:
 DECL_LINK(KeyInputHdl, const KeyEvent&, bool);
 
 void OnTemplateImportCategory(const OUString& sCategory);
-static void OnTemplateLink ();
+//static void OnTemplateLink ();
 void OnTemplateOpen ();
 void OnTemplateExport ();
 
@@ -130,7 +130,7 @@ protected:
 std::unique_ptr mxMoveButton;
 std::unique_ptr mxExportButton;
 std::unique_ptr mxImportButton;
-std::unique_ptr mxLinkButton;
+std::unique_ptr mxMoreTemplatesButton;
 std::unique_ptr mxCBXHideDlg;
 std::unique_ptr mxActionBar;
 std::unique_ptr mxSearchView;
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 9ee57afc..78910b8cf374 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -55,6 +55,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -162,7 +163,7 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg(weld::Window 
*pParent)
 , mxMoveButton(m_xBuilder->weld_button("move_btn"))
 , mxExportButton(m_xBuilder->weld_button("export_btn"))
 , mxImportButton(m_xBuilder->weld_button("import_btn"))
-, mxLinkButton(m_xBuilder->weld_button("online_link"))
+, mxMoreTemplatesButton(m_xBuilder->weld_button("btnMoreTemplates"))
 , mxCBXHideDlg(m_xBuilder->weld_check_button("hidedialogcb"))
 , mxActionBar(m_xBuilder->weld_menu_button("action_menu"))
 , mxSearchView(new 
TemplateSearchView(m_xBuilder->weld_scrolled_window("scrollsearch", true),
@@ -214,7 +215,7 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg(weld::Window 
*pParent)
 mxMoveButton->connect_clicked(LINK(this, SfxTemplateManagerDlg, 
MoveClickHdl));
 mxExportButton->connect_clicked(LINK(this, SfxTemplateManagerDlg, 
ExportClickHdl));
 mxImportButton->connect_clicked(LINK(this, SfxTemplateManagerDlg, 
ImportClickHdl));
-mxLinkButton->connect_clicked(LINK(this, SfxTemplateManagerDlg, 
LinkClickHdl));
+mxMoreTemplatesButton->connect_clicked(LINK(this, SfxTemplateManagerDlg, 
LinkClickHdl));
 
 mxSearchFilter->connect_changed(LINK(this, SfxTemplateManagerDlg, 
SearchUpdateHdl));
 mxSearchFilter->connect_focus_in(LINK( this, SfxTemplateManagerDlg, 
GetFocusHdl ));
@@ -581,7 +582,10 @@ IMPL_LINK_NOARG(SfxTemplateManagerDlg, ImportClickHdl, 
weld::Button&, void)
 
 IMPL_STATIC_LINK_NOARG(SfxTemplateManagerDlg, LinkClickHdl, weld::Button&, 
void)
 {
-OnTemplateLink();
+uno::Sequence aArgs(1);
+aArgs[0].Name = "AdditionsTag";
+aArgs[0].Value <<= OUString("Templates");
+comphelper::dispatchCommand(".uno:AdditionsDialog", aArgs);
 }
 
 IMPL_LINK_NOARG(SfxTemplateManagerDlg, OpenRegionHdl, void*, void)
@@ -1027,34 +1031,6 @@ void SfxTemplateManagerDlg::OnTemplateExport()
 }
 }
 
-void SfxTemplateManagerDlg::OnTemplateLink ()
-{
-try
-{
-Reference xConfig = 
configuration::theDefaultProvider::get( 
comphelper::getProcessComponentContext() );
-uno::Sequence args(comphelper::InitAnyPropertySequence(
-{
-{"nodepath", 
uno::Any(OUString("/org.openoffice.Office.Common/Help/StartCenter"))}
-}));
-Reference 
xNameAccess(xConfig->createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess",
 args), UNO_QUERY);
-if( xNameAccess.is() )
-{
-OUString sURL;
-//throws css::container::NoSuchElementException, 
css::lang::WrappedTargetException
-Any value( xNameAccess->getByName("TemplateRepositoryURL") );
-sURL = value.get ();
-localizeWebserviceURI(sURL);
-
-Reference< css::system::XSystemShellExecute > xSystemShellExecute(
-
css::system::SystemShellExecute::create(comphelper::getProcessComponentContext()));
-xSystemShellExecute->execute( sURL, OUString(), 
css::system::SystemShellExecuteFlags::URIS_ONLY);
-}
-}
-catch (const Exception&)
-{
-}
-}
-
 void SfxTemplateManagerDlg::OnTemplateOpen ()
 {
 ThumbnailViewItem *pItem = 
const_cast(*maSelTemplates.begin());
@@ -1359,7 

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

2020-10-12 Thread Luboš Luňák (via logerrit)
 include/sfx2/objsh.hxx   |8 +++
 sfx2/source/appl/sfxpicklist.cxx |5 --
 sfx2/source/doc/objcont.cxx  |   83 +++
 sfx2/source/doc/sfxbasemodel.cxx |2 
 4 files changed, 77 insertions(+), 21 deletions(-)

New commits:
commit 59cca1a28df4cdc94450d68cc1e247a8fb5ff6f3
Author: Luboš Luňák 
AuthorDate: Fri Oct 9 13:21:34 2020 +0200
Commit: Luboš Luňák 
CommitDate: Mon Oct 12 15:13:17 2020 +0200

render document thumbnail directly to bitmap, without metafile

I don't see the point of taking the detour via GDIMetaFile and
then immediately drawing using it to a bitmap. Simply draw directly
to a bitmap. Especially given that when drawing to a metafile
some fast cases are skipped, e.g. DrawTransformedBitmapEx()
avoids DrawTransformBitmapExDirect() and resorts to using the slow
BitmapEx::getTransformed(). E.g. with tdf#136223. this makes
SfxPickListImpl::AddDocumentToPickList() go from 30% to 13%
of the total document loading time.

Change-Id: Ib1643eddfc2b75a3d7be60138fb5226352805826
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104114
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index 78a1f3eb22e6..e106d7f3a367 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -26,6 +26,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -64,6 +65,7 @@ class Color;
 class Fraction;
 class SvGlobalName;
 class InfobarData;
+class VirtualDevice;
 
 enum class SfxModelFlags;
 enum class SfxEventHintId;
@@ -445,6 +447,10 @@ public:
 SizeGetFirstPageSize() const;
 boolDoClose();
 std::shared_ptr GetPreviewMetaFile( bool bFullContent = false 
) const;
+BitmapExGetPreviewBitmap(
+bool bFullContent = false,
+BmpConversion nColorConversion = 
BmpConversion::N24Bit,
+BmpScaleFlag nScaleFlag = 
BmpScaleFlag::BestQuality) const;
 virtual voidCancelTransfers();
 
 boolGenerateAndStoreThumbnail(
@@ -681,7 +687,7 @@ public:
 bool bShowCloseButton = true);
 std::vector& getPendingInfobars();
 
-SAL_DLLPRIVATE std::shared_ptr 
CreatePreviewMetaFile_Impl(bool bFullContent) const;
+SAL_DLLPRIVATE bool CreatePreview_Impl(bool bFullContent, VirtualDevice* 
pDevice, GDIMetaFile* pFile) const;
 
 SAL_DLLPRIVATE static bool IsPackageStorageFormat_Impl(const SfxMedium &);
 
diff --git a/sfx2/source/appl/sfxpicklist.cxx b/sfx2/source/appl/sfxpicklist.cxx
index ec32dd038d3d..82775fd9a328 100644
--- a/sfx2/source/appl/sfxpicklist.cxx
+++ b/sfx2/source/appl/sfxpicklist.cxx
@@ -118,9 +118,8 @@ void SfxPickListImpl::AddDocumentToPickList( const 
SfxObjectShell* pDocSh )
 }
 else
 {
-std::shared_ptr xMetaFile = 
pDocSh->GetPreviewMetaFile();
-BitmapEx aResultBitmap;
-if (xMetaFile->CreateThumbnail(aResultBitmap))
+BitmapEx aResultBitmap = pDocSh->GetPreviewBitmap();
+if (!aResultBitmap.IsEmpty())
 {
 SvMemoryStream aStream(65535, 65535);
 vcl::PNGWriter aWriter(aResultBitmap);
diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx
index 0a98bab1263d..3159f6d7ac84 100644
--- a/sfx2/source/doc/objcont.cxx
+++ b/sfx2/source/doc/objcont.cxx
@@ -35,6 +35,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -94,11 +95,32 @@ bool operator> (const util::DateTime& i_rLeft, const 
util::DateTime& i_rRight)
 std::shared_ptr
 SfxObjectShell::GetPreviewMetaFile( bool bFullContent ) const
 {
-return CreatePreviewMetaFile_Impl( bFullContent );
+auto xFile = std::make_shared();
+ScopedVclPtrInstance< VirtualDevice > pDevice;
+pDevice->EnableOutput( false );
+if(!CreatePreview_Impl(bFullContent, pDevice, xFile.get()))
+return std::shared_ptr();
+return xFile;
 }
 
-std::shared_ptr
-SfxObjectShell::CreatePreviewMetaFile_Impl( bool bFullContent ) const
+BitmapEx SfxObjectShell::GetPreviewBitmap( bool bFullContent, BmpConversion 
nColorConversion,
+BmpScaleFlag nScaleFlag) const
+{
+ScopedVclPtrInstance< VirtualDevice > pDevice;
+pDevice->SetAntialiasing(AntialiasingFlags::Enable | 
pDevice->GetAntialiasing());
+if(!CreatePreview_Impl(bFullContent, pDevice, nullptr))
+return BitmapEx();
+Size size = pDevice->GetOutputSizePixel();
+BitmapEx aBitmap = pDevice->GetBitmapEx( Point(), size);
+// Scale down the image to the desired size from the 4*size from 
CreatePreview_Impl().
+size = Size( size.Width() / 4, size.Height() / 4 );
+aBitmap.Scale(size, nScaleFlag);
+if (!aBitmap.IsEmpty())
+

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

2020-09-15 Thread Andrea Gelmini (via logerrit)
 include/sfx2/AccessibilityCheck.hxx  |2 +-
 sfx2/source/accessibility/AccessibilityCheck.cxx |5 -
 sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx |4 ++--
 sw/source/uibase/app/docst.cxx   |2 +-
 sw/source/uibase/shells/basesh.cxx   |2 +-
 5 files changed, 9 insertions(+), 6 deletions(-)

New commits:
commit bc2cec8162a184b1a44cc37766924d65e57c4ce7
Author: Andrea Gelmini 
AuthorDate: Mon Aug 31 17:05:11 2020 +0200
Commit: Julien Nabet 
CommitDate: Tue Sep 15 15:12:47 2020 +0200

Fix typo in code

It passed "make check" on Linux

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

diff --git a/include/sfx2/AccessibilityCheck.hxx 
b/include/sfx2/AccessibilityCheck.hxx
index 185bc050d771..959601c9872e 100644
--- a/include/sfx2/AccessibilityCheck.hxx
+++ b/include/sfx2/AccessibilityCheck.hxx
@@ -27,7 +27,7 @@ public:
 
 virtual void check() = 0;
 
-AccessibilityIssueCollection& getIssueCollecton();
+AccessibilityIssueCollection& getIssueCollection();
 };
 
 } // end sfx namespace
diff --git a/sfx2/source/accessibility/AccessibilityCheck.cxx 
b/sfx2/source/accessibility/AccessibilityCheck.cxx
index 7e6c3209053c..adb0ddf282d6 100644
--- a/sfx2/source/accessibility/AccessibilityCheck.cxx
+++ b/sfx2/source/accessibility/AccessibilityCheck.cxx
@@ -14,7 +14,10 @@ namespace sfx
 {
 AccessibilityCheck::~AccessibilityCheck() = default;
 
-AccessibilityIssueCollection& AccessibilityCheck::getIssueCollecton() { return 
m_aIssueCollection; }
+AccessibilityIssueCollection& AccessibilityCheck::getIssueCollection()
+{
+return m_aIssueCollection;
+}
 
 } // end sfx namespace
 
diff --git a/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx 
b/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx
index 40cf5d905bac..e7d96f8ea993 100644
--- a/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx
+++ b/sw/qa/core/accessibilitycheck/AccessibilityCheckTest.cxx
@@ -31,7 +31,7 @@ CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, 
testCheckDocumentIssues)
 CPPUNIT_ASSERT(pDoc);
 sw::AccessibilityCheck aCheck(pDoc);
 aCheck.check();
-auto& aIssues = aCheck.getIssueCollecton().getIssues();
+auto& aIssues = aCheck.getIssueCollection().getIssues();
 CPPUNIT_ASSERT_EQUAL(size_t(2), aIssues.size());
 CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::DOCUMENT_LANGUAGE, 
aIssues[0]->m_eIssueID);
 CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::DOCUMENT_TITLE, 
aIssues[1]->m_eIssueID);
@@ -43,7 +43,7 @@ CPPUNIT_TEST_FIXTURE(AccessibilityCheckTest, 
testTableSplitMergeAndAltText)
 CPPUNIT_ASSERT(pDoc);
 sw::AccessibilityCheck aCheck(pDoc);
 aCheck.check();
-auto& aIssues = aCheck.getIssueCollecton().getIssues();
+auto& aIssues = aCheck.getIssueCollection().getIssues();
 CPPUNIT_ASSERT_EQUAL(size_t(7), aIssues.size());
 
 CPPUNIT_ASSERT_EQUAL(sfx::AccessibilityIssueID::NO_ALT_GRAPHIC, 
aIssues[0]->m_eIssueID);
diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx
index 6886b548ba56..666db6b0d9a9 100644
--- a/sw/source/uibase/app/docst.cxx
+++ b/sw/source/uibase/app/docst.cxx
@@ -1471,7 +1471,7 @@ sfx::AccessibilityIssueCollection 
SwDocShell::runAccessibilityCheck()
 {
 sw::AccessibilityCheck aCheck(m_xDoc.get());
 aCheck.check();
-return aCheck.getIssueCollecton();
+return aCheck.getIssueCollection();
 }
 
 std::set SwDocShell::GetDocColors()
diff --git a/sw/source/uibase/shells/basesh.cxx 
b/sw/source/uibase/shells/basesh.cxx
index 4dfd92584a0e..b0ba28e53074 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -2674,7 +2674,7 @@ void SwBaseShell::ExecDlg(SfxRequest )
 {
 sw::AccessibilityCheck aCheck(rSh.GetDoc());
 aCheck.check();
-svx::AccessibilityCheckDialog aDialog(pMDI, 
aCheck.getIssueCollecton());
+svx::AccessibilityCheckDialog aDialog(pMDI, 
aCheck.getIssueCollection());
 aDialog.run();
 }
 break;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-08-25 Thread Caolán McNamara (via logerrit)
 include/sfx2/thumbnailviewitem.hxx|1 
 sfx2/source/control/thumbnailviewitem.cxx |   32 --
 2 files changed, 19 insertions(+), 14 deletions(-)

New commits:
commit e8acd00ba910cae2b91ee396048381e3897c6776
Author: Caolán McNamara 
AuthorDate: Wed Aug 19 20:31:32 2020 +0100
Commit: Caolán McNamara 
CommitDate: Tue Aug 25 10:10:40 2020 +0200

make drawing item border optional

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

diff --git a/include/sfx2/thumbnailviewitem.hxx 
b/include/sfx2/thumbnailviewitem.hxx
index d10bdbb14dc6..d1e1a7a97089 100644
--- a/include/sfx2/thumbnailviewitem.hxx
+++ b/include/sfx2/thumbnailviewitem.hxx
@@ -68,6 +68,7 @@ public:
 ThumbnailViewBase 
 sal_uInt16 mnId;
 bool mbVisible;
+bool mbBorder;
 bool mbSelected;
 bool mbHover;
 BitmapEx maPreview1;
diff --git a/sfx2/source/control/thumbnailviewitem.cxx 
b/sfx2/source/control/thumbnailviewitem.cxx
index 0830689498e8..444d4c3387a5 100644
--- a/sfx2/source/control/thumbnailviewitem.cxx
+++ b/sfx2/source/control/thumbnailviewitem.cxx
@@ -43,6 +43,7 @@ ThumbnailViewItem::ThumbnailViewItem(ThumbnailViewBase 
, sal_uInt16 nId)
 : mrParent(rView)
 , mnId(nId)
 , mbVisible(true)
+, mbBorder(true)
 , mbSelected(false)
 , mbHover(false)
 , mxAcc()
@@ -176,20 +177,23 @@ void ThumbnailViewItem::Paint 
(drawinglayer::processor2d::BaseProcessor2D *pProc
 false)
 ));
 
-// draw thumbnail borders
-float fWidth = aImageSize.Width() - 1;
-float fHeight = aImageSize.Height() - 1;
-float fPosX = maPrev1Pos.getX();
-float fPosY = maPrev1Pos.getY();
-
-B2DPolygon aBounds;
-aBounds.append(B2DPoint(fPosX,fPosY));
-aBounds.append(B2DPoint(fPosX+fWidth,fPosY));
-aBounds.append(B2DPoint(fPosX+fWidth,fPosY+fHeight));
-aBounds.append(B2DPoint(fPosX,fPosY+fHeight));
-aBounds.setClosed(true);
-
-aSeq[nPrimitive++] = 
drawinglayer::primitive2d::Primitive2DReference(createBorderLine(aBounds));
+if (mbBorder)
+{
+// draw thumbnail borders
+float fWidth = aImageSize.Width() - 1;
+float fHeight = aImageSize.Height() - 1;
+float fPosX = maPrev1Pos.getX();
+float fPosY = maPrev1Pos.getY();
+
+B2DPolygon aBounds;
+aBounds.append(B2DPoint(fPosX,fPosY));
+aBounds.append(B2DPoint(fPosX+fWidth,fPosY));
+aBounds.append(B2DPoint(fPosX+fWidth,fPosY+fHeight));
+aBounds.append(B2DPoint(fPosX,fPosY+fHeight));
+aBounds.setClosed(true);
+
+aSeq[nPrimitive++] = 
drawinglayer::primitive2d::Primitive2DReference(createBorderLine(aBounds));
+}
 
 // Draw text below thumbnail
 addTextPrimitives(maTitle, pAttrs, maTextPos, aSeq);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-08-13 Thread Noel Grandin (via logerrit)
 include/sfx2/msgpool.hxx|1 -
 sfx2/source/appl/app.cxx|2 +-
 sfx2/source/appl/appchild.cxx   |4 ++--
 sfx2/source/appl/appdata.cxx|   29 ++---
 sfx2/source/appl/appinit.cxx|   26 +-
 sfx2/source/appl/appmain.cxx|4 ++--
 sfx2/source/appl/appmisc.cxx|2 +-
 sfx2/source/appl/appquit.cxx|   26 +-
 sfx2/source/control/msgpool.cxx |   10 --
 sfx2/source/control/objface.cxx |   14 --
 sfx2/source/inc/appdata.hxx |   34 +-
 11 files changed, 63 insertions(+), 89 deletions(-)

New commits:
commit eaf094f7f2699e786deaa8cfadad26507b30a92b
Author: Noel Grandin 
AuthorDate: Wed Aug 12 14:40:09 2020 +0200
Commit: Noel Grandin 
CommitDate: Thu Aug 13 15:21:29 2020 +0200

use unique_ptr in SfxAppData_Impl

and simplify the destruction - we only ever called ReleaseInterface
on destruction, so no need to bother with that, and risk touching
pointers that might be nullptr

Specifically, the problem is this code
pImpl->pSlotPool.reset();
which triggered the path
~SfxSlotPool -> ~SfxInterface -> SfxGetpApp()->GetAppSlotPool_Impl()
which crashes because the pSlotPool pointer is null at that point

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

diff --git a/include/sfx2/msgpool.hxx b/include/sfx2/msgpool.hxx
index 357d86d67bed..7aa38904c35d 100644
--- a/include/sfx2/msgpool.hxx
+++ b/include/sfx2/msgpool.hxx
@@ -47,7 +47,6 @@ public:
 ~SfxSlotPool();
 
 voidRegisterInterface( SfxInterface& rFace );
-voidReleaseInterface( SfxInterface& rFace );
 
 static SfxSlotPool& GetSlotPool( SfxViewFrame *pFrame=nullptr );
 
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
index 6844f919c4b2..fbd45b3e49b3 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -235,7 +235,7 @@ void SfxApplication::ResetLastDir()
 
 SfxDispatcher* SfxApplication::GetDispatcher_Impl()
 {
-return pImpl->pViewFrame? pImpl->pViewFrame->GetDispatcher(): 
pImpl->pAppDispat;
+return pImpl->pViewFrame ? pImpl->pViewFrame->GetDispatcher() : 
pImpl->pAppDispat.get();
 }
 
 
diff --git a/sfx2/source/appl/appchild.cxx b/sfx2/source/appl/appchild.cxx
index 0aaf722ba700..9ee356566479 100644
--- a/sfx2/source/appl/appchild.cxx
+++ b/sfx2/source/appl/appchild.cxx
@@ -39,7 +39,7 @@ void SfxApplication::RegisterChildWindow_Impl( SfxModule 
*pMod, std::unique_ptr<
 }
 
 if (!pImpl->pFactArr)
-pImpl->pFactArr = new SfxChildWinFactArr_Impl;
+pImpl->pFactArr.reset(new SfxChildWinFactArr_Impl);
 
 for (size_t nFactory=0; nFactorypFactArr->size(); ++nFactory)
 {
@@ -83,7 +83,7 @@ void SfxApplication::RegisterChildWindowContext_Impl( 
SfxModule *pMod, sal_uInt1
 DBG_ASSERT( pImpl, "No AppData!" );
 DBG_ASSERT( pImpl->pFactArr, "No Factories!" );
 
-pFactories = pImpl->pFactArr;
+pFactories = pImpl->pFactArr.get();
 sal_uInt16 nCount = pFactories->size();
 for (sal_uInt16 nFactory=0; nFactory
 #include 
+#include 
 #include 
+#include 
 #include 
+#include 
 #include 
 #include 
-#include 
 #include 
+#include 
+#include 
+#include 
+#include 
 #include 
 
 #include 
@@ -68,28 +74,13 @@ void 
SfxBasicManagerCreationListener::onBasicManagerCreated( const Reference< XM
 }
 
 SfxAppData_Impl::SfxAppData_Impl()
-: pFactArr(nullptr)
-, pMatcher( nullptr )
-, m_pToolsErrorHdl(nullptr)
-, m_pSoErrorHdl(nullptr)
-#if HAVE_FEATURE_SCRIPTING
-, m_pSbxErrorHdl(nullptr)
-#endif
-, pTemplates( nullptr )
-, pPool(nullptr)
+: pPool(nullptr)
 , pProgress(nullptr)
 , nDocModalMode(0)
 , nRescheduleLocks(0)
-, pTbxCtrlFac(nullptr)
-, pStbCtrlFac(nullptr)
-, pViewFrames(nullptr)
-, pViewShells(nullptr)
-, pObjShells(nullptr)
 , pBasicManager( new SfxBasicManagerHolder )
 , pBasMgrListener( new SfxBasicManagerCreationListener( *this ) )
 , pViewFrame( nullptr )
-, pSlotPool( nullptr )
-, pAppDispat( nullptr )
 , bDowning( true )
 , bInQuit( false )
 
@@ -117,10 +108,10 @@ SfxAppData_Impl::~SfxAppData_Impl()
 SfxDocumentTemplates* SfxAppData_Impl::GetDocumentTemplates()
 {
 if ( !pTemplates )
-pTemplates = new SfxDocumentTemplates;
+pTemplates.reset(new SfxDocumentTemplates);
 else
 pTemplates->ReInitFromComponent();
-return pTemplates;
+return pTemplates.get();
 }
 
 void SfxAppData_Impl::OnApplicationBasicManagerCreated( BasicManager& 
_rBasicManager )
diff --git a/sfx2/source/appl/appinit.cxx b/sfx2/source/appl/appinit.cxx
index 3ebc6a83bf5d..fbecd9d66b61 100644
--- a/sfx2/source/appl/appinit.cxx
+++ b/sfx2/source/appl/appinit.cxx
@@ 

  1   2   3   4   5   >