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

2023-08-04 Thread Rafael Lima (via logerrit)
 sfx2/inc/sidebar/DeckDescriptor.hxx |1 
 sfx2/inc/sidebar/DeckTitleBar.hxx   |3 -
 sfx2/inc/sidebar/TitleBar.hxx   |2 
 sfx2/source/sidebar/Deck.cxx|3 -
 sfx2/source/sidebar/DeckDescriptor.cxx  |1 
 sfx2/source/sidebar/DeckTitleBar.cxx|   16 +-
 sfx2/source/sidebar/FocusManager.cxx|   84 +---
 sfx2/source/sidebar/ResourceManager.cxx |1 
 sfx2/source/sidebar/TitleBar.cxx|   13 
 sfx2/uiconfig/ui/deck.ui|   26 -
 sw/qa/uitest/sidebar/tdf152921.py   |6 +-
 11 files changed, 97 insertions(+), 59 deletions(-)

New commits:
commit 9ca60dc90958001c078ed6331bd432c36961a425
Author: Rafael Lima 
AuthorDate: Wed Jul 26 02:00:40 2023 +0200
Commit: Rafael Lima 
CommitDate: Sat Aug 5 00:05:56 2023 +0200

tdf#156156 Add Help button to sidebar decks

This patch adds a Help button to the sidebar deck, so that each deck has 
its own Help ID, which can later be used as reference to write help pages.

The Help IDs of each sidebar deck is a combination of the string "SIDEBAR_" 
+ the deck ID (as defined in Sidebar.xcu).

Change-Id: Ib7f106ff917e41130bde136e1e6f04bb2af40daf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154918
Tested-by: Jenkins
Reviewed-by: Stéphane Guillou 
Reviewed-by: Olivier Hallot 

diff --git a/sfx2/inc/sidebar/DeckDescriptor.hxx 
b/sfx2/inc/sidebar/DeckDescriptor.hxx
index 5381b4ea2cd7..8fde0c0330f7 100644
--- a/sfx2/inc/sidebar/DeckDescriptor.hxx
+++ b/sfx2/inc/sidebar/DeckDescriptor.hxx
@@ -34,6 +34,7 @@ public:
 OUString msTitleBarIconURL;
 OUString msHighContrastTitleBarIconURL;
 OUString msHelpText;
+OUString msHelpId;
 ContextList maContextList;
 bool mbIsEnabled;
 sal_Int32 mnOrderIndex;
diff --git a/sfx2/inc/sidebar/DeckTitleBar.hxx 
b/sfx2/inc/sidebar/DeckTitleBar.hxx
index 72eda5cb7d7b..2834dda1e350 100644
--- a/sfx2/inc/sidebar/DeckTitleBar.hxx
+++ b/sfx2/inc/sidebar/DeckTitleBar.hxx
@@ -29,7 +29,7 @@ class GripWidget;
 class DeckTitleBar final : public TitleBar
 {
 public:
-DeckTitleBar(const OUString& rsTitle, weld::Builder& rBuilder,
+DeckTitleBar(const OUString& rsTitle, weld::Builder& rBuilder, const 
OUString& rsHelpId,
  std::function aCloserAction);
 virtual ~DeckTitleBar() override;
 
@@ -48,6 +48,7 @@ private:
 std::unique_ptr mxGripWeld;
 std::unique_ptr mxLabel;
 
+OUString msHelpId;
 const std::function maCloserAction;
 bool mbIsCloserVisible;
 };
diff --git a/sfx2/inc/sidebar/TitleBar.hxx b/sfx2/inc/sidebar/TitleBar.hxx
index 2cd7224bda12..7836a57be17a 100644
--- a/sfx2/inc/sidebar/TitleBar.hxx
+++ b/sfx2/inc/sidebar/TitleBar.hxx
@@ -56,10 +56,12 @@ protected:
 std::unique_ptr mxAddonImage;
 std::unique_ptr mxToolBox;
 Theme::ThemeItem meThemeItem;
+OUString msToolBoxRId;
 
 virtual void HandleToolBoxItemClick() = 0;
 
 DECL_LINK(SelectionHandler, const OUString&, void);
+static void ShowHelp(const OUString& rHelpId);
 
 private:
 void SetBackground();
diff --git a/sfx2/source/sidebar/Deck.cxx b/sfx2/source/sidebar/Deck.cxx
index 629a1d76d3d0..c45ab52e574e 100644
--- a/sfx2/source/sidebar/Deck.cxx
+++ b/sfx2/source/sidebar/Deck.cxx
@@ -55,7 +55,8 @@ Deck::Deck(const DeckDescriptor& rDeckDescriptor, 
SidebarDockingWindow* pParentW
 , mnMinimalHeight(0)
 , maPanels()
 , mxParentWindow(pParentWindow)
-, mxTitleBar(new DeckTitleBar(rDeckDescriptor.msTitle, *m_xBuilder, 
rCloserAction))
+, mxTitleBar(new DeckTitleBar(rDeckDescriptor.msTitle, *m_xBuilder,
+ rDeckDescriptor.msHelpId, rCloserAction))
 , mxVerticalScrollBar(m_xBuilder->weld_scrolled_window("scrolledwindow"))
 , mxContents(m_xBuilder->weld_box("contents"))
 {
diff --git a/sfx2/source/sidebar/DeckDescriptor.cxx 
b/sfx2/source/sidebar/DeckDescriptor.cxx
index fee839f08ad0..29af33e33f22 100644
--- a/sfx2/source/sidebar/DeckDescriptor.cxx
+++ b/sfx2/source/sidebar/DeckDescriptor.cxx
@@ -36,6 +36,7 @@ DeckDescriptor::DeckDescriptor (const DeckDescriptor& rOther)
   msTitleBarIconURL(rOther.msTitleBarIconURL),
   msHighContrastTitleBarIconURL(rOther.msHighContrastTitleBarIconURL),
   msHelpText(rOther.msHelpText),
+  msHelpId(rOther.msHelpId),
   maContextList(rOther.maContextList),
   mbIsEnabled(rOther.mbIsEnabled),
   mnOrderIndex(rOther.mnOrderIndex),
diff --git a/sfx2/source/sidebar/DeckTitleBar.cxx 
b/sfx2/source/sidebar/DeckTitleBar.cxx
index 44b9387dc14d..9e12fd15c6ab 100644
--- a/sfx2/source/sidebar/DeckTitleBar.cxx
+++ b/sfx2/source/sidebar/DeckTitleBar.cxx
@@ -61,11 +61,13 @@ public:
 
 DeckTitleBar::DeckTitleBar (const OUString& rsTitle,
 weld::Builder& rBuilder,
+const OUString& rsHelpId,
 std::function aCloserAction)
 : TitleBar(rBuilder, 

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

2023-01-17 Thread Noel Grandin (via logerrit)
 sfx2/inc/unoctitm.hxx |7 +--
 sfx2/source/control/bindings.cxx  |   11 +++
 sfx2/source/control/sfxstatuslistener.cxx |3 +--
 sfx2/source/control/statcach.cxx  |3 +--
 sfx2/source/control/unoctitm.cxx  |   14 --
 sfx2/source/statbar/stbitem.cxx   |3 +--
 sfx2/source/toolbox/tbxitem.cxx   |3 +--
 7 files changed, 8 insertions(+), 36 deletions(-)

New commits:
commit 3fdfee3268aeae5c9a06527c0f973d258c2188c6
Author: Noel Grandin 
AuthorDate: Tue Jan 17 09:48:10 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue Jan 17 16:10:45 2023 +

XUnoTunnel->dynamic_cast in SfxOfficeDispatch

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

diff --git a/sfx2/inc/unoctitm.hxx b/sfx2/inc/unoctitm.hxx
index 812dbce7077d..d23b8c9fd714 100644
--- a/sfx2/inc/unoctitm.hxx
+++ b/sfx2/inc/unoctitm.hxx
@@ -20,7 +20,6 @@
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -67,7 +66,7 @@ public:
 
 class SfxSlotServer;
 class SfxDispatchController_Impl;
-class SfxOfficeDispatch final : public 
cppu::ImplInheritanceHelper
+class SfxOfficeDispatch final : public 
cppu::ImplInheritanceHelper
 {
 friend class SfxDispatchController_Impl;
 std::unique_ptr  pImpl;
@@ -89,10 +88,6 @@ public:
 virtual void   SAL_CALL addStatusListener( const css::uno::Reference< 
css::frame::XStatusListener > & xControl,
const css::util::URL& aURL) 
override;
 
-// XUnoTunnel
-virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< 
sal_Int8 >& aIdentifier ) override ;
-static const css::uno::Sequence< sal_Int8 >& getUnoTunnelId();
-
 static bool IsMasterUnoCommand( const css::util::URL& aURL );
 static OUString GetMasterUnoCommand( const css::util::URL& aURL );
 
diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx
index 4ea06231562a..51d6b36d237f 100644
--- a/sfx2/source/control/bindings.cxx
+++ b/sfx2/source/control/bindings.cxx
@@ -1529,7 +1529,7 @@ SfxItemState SfxBindings::QueryState( sal_uInt16 nSlot, 
std::unique_ptr(xDisp))
+if (!dynamic_cast(xDisp.get()))
 {
 bool bDeleteCache = false;
 if ( !pCache )
@@ -1648,15 +1648,10 @@ sal_uInt16 SfxBindings::QuerySlotId( const util::URL& 
aURL )
 if (!xDispatch.is())
 return 0;
 
-css::uno::Reference xTunnel(xDispatch, 
css::uno::UNO_QUERY);
-if (!xTunnel.is())
+SfxOfficeDispatch* pDispatch = 
dynamic_cast(xDispatch.get());
+if (!pDispatch)
 return 0;
 
-sal_Int64 nHandle = 
xTunnel->getSomething(SfxOfficeDispatch::getUnoTunnelId());
-if (!nHandle)
-return 0;
-
-SfxOfficeDispatch* pDispatch = 
reinterpret_cast(sal::static_int_cast(nHandle));
 return pDispatch->GetId();
 }
 
diff --git a/sfx2/source/control/sfxstatuslistener.cxx 
b/sfx2/source/control/sfxstatuslistener.cxx
index 5ee3d471f21a..7cc4e8dd688b 100644
--- a/sfx2/source/control/sfxstatuslistener.cxx
+++ b/sfx2/source/control/sfxstatuslistener.cxx
@@ -142,8 +142,7 @@ void SAL_CALL SfxStatusListener::statusChanged( const 
FeatureStateEvent& rEvent)
 SfxViewFrame* pViewFrame = nullptr;
 if ( m_xDispatch.is() )
 {
-Reference< XUnoTunnel > xTunnel( m_xDispatch, UNO_QUERY );
-if (auto pDisp = 
comphelper::getFromUnoTunnel(xTunnel))
+if (auto pDisp = dynamic_cast(m_xDispatch.get()))
 pViewFrame = pDisp->GetDispatcher_Impl()->GetFrame();
 }
 
diff --git a/sfx2/source/control/statcach.cxx b/sfx2/source/control/statcach.cxx
index 3360ebbabfdf..ee20d38c5d81 100644
--- a/sfx2/source/control/statcach.cxx
+++ b/sfx2/source/control/statcach.cxx
@@ -263,8 +263,7 @@ const SfxSlotServer* SfxStateCache::GetSlotServer( 
SfxDispatcher  , cons
 if ( xDisp.is() )
 {
 // test the dispatch object if it is just a wrapper for a 
SfxDispatcher
-css::uno::Reference< css::lang::XUnoTunnel > xTunnel( xDisp, 
css::uno::UNO_QUERY );
-if (auto pDisp = 
comphelper::getFromUnoTunnel(xTunnel))
+if (auto pDisp = dynamic_cast(xDisp.get()))
 {
 // The intercepting object is an SFX component
 // If this dispatch object does not use the wanted 
dispatcher or the AppDispatcher, it's treated like any other UNO component
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 20934ecf8f56..bcee2360e268 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -173,12 +173,6 @@ void SAL_CALL SfxStatusDispatcher::removeStatusListener( 
const css::uno::Referen
 }
 
 
-// XUnoTunnel
-sal_Int64 SAL_CALL 

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

2022-12-21 Thread Caolán McNamara (via logerrit)
 sfx2/inc/guisaveas.hxx|1 -
 sfx2/source/doc/guisaveas.cxx |   11 +--
 2 files changed, 5 insertions(+), 7 deletions(-)

New commits:
commit 87e7a2f60ec823aed6738fb081ad358b5d0536e6
Author: Caolán McNamara 
AuthorDate: Wed Dec 21 14:07:37 2022 +
Commit: Caolán McNamara 
CommitDate: Wed Dec 21 16:18:54 2022 +

cid#1517813 Uninitialized scalar field

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

diff --git a/sfx2/inc/guisaveas.hxx b/sfx2/inc/guisaveas.hxx
index 88a69711c8fd..7e848a579313 100644
--- a/sfx2/inc/guisaveas.hxx
+++ b/sfx2/inc/guisaveas.hxx
@@ -62,7 +62,6 @@ private:
 css::uno::Reference< css::container::XContainerQuery > const & 
GetFilterQuery();
 css::uno::Reference< css::frame::XModuleManager2 > const & 
GetModuleManager();
 
-bool m_xDialogUsed;
 bool m_bRemote;
 bool m_bPreselectPassword;
 bool m_bDialogUsed;
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index c0f951d62206..dc32d10c103b 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -1349,14 +1349,15 @@ OUString ModelData_Impl::GetRecommendedName( const 
OUString& aSuggestedName, con
 return aRecommendedName;
 }
 
-
-
-
 SfxStoringHelper::SfxStoringHelper()
+: m_bRemote(false)
+, m_bPreselectPassword(false)
+, m_bDialogUsed(false)
+, m_bSetStandardName(false)
+, m_nStoreMode(0)
 {
 }
 
-
 uno::Reference< container::XNameAccess > const & 
SfxStoringHelper::GetFilterConfiguration()
 {
 if ( !m_xFilterCFG.is() )
@@ -1368,7 +1369,6 @@ uno::Reference< container::XNameAccess > const & 
SfxStoringHelper::GetFilterConf
 return m_xFilterCFG;
 }
 
-
 uno::Reference< container::XContainerQuery > const & 
SfxStoringHelper::GetFilterQuery()
 {
 if ( !m_xFilterQuery.is() )
@@ -1379,7 +1379,6 @@ uno::Reference< container::XContainerQuery > const & 
SfxStoringHelper::GetFilter
 return m_xFilterQuery;
 }
 
-
 uno::Reference< css::frame::XModuleManager2 > const & 
SfxStoringHelper::GetModuleManager()
 {
 if ( !m_xModuleManager.is() )


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

2022-09-28 Thread Rafael Lima (via logerrit)
 sfx2/inc/doctempl.hrc|3 ++-
 sfx2/source/doc/doctemplates.cxx |3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 03809a4338f4a1e9e5ad5088fdeedc4c3fe0f7b5
Author: Rafael Lima 
AuthorDate: Sun Sep 25 21:12:08 2022 +0200
Commit: Rafael Lima 
CommitDate: Wed Sep 28 18:51:32 2022 +0200

Related tdf#132576 Fix "draw" string in Template Manager and make it 
translatable

The Templates Manager has a category name "draw" which cannot be 
translated. It also looks weird because all other categories have full names 
whereas this one is a lowercase string.

The reason the word "draw" is used is because it is the name of the folder 
where the template is located. This patch maps a string "Drawings" to give a 
proper translatable name for this category.

For this patch to take effect, the user needs to be on a fresh profile (or 
at least reset the user UI modifications).

Change-Id: I2223dfe8761a5687b02e843957ebf7fb07f4a626
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140506
Tested-by: Jenkins
Reviewed-by: Laurent Balland 

diff --git a/sfx2/inc/doctempl.hrc b/sfx2/inc/doctempl.hrc
index d6b98a0e2a6b..10a10d0de0c6 100644
--- a/sfx2/inc/doctempl.hrc
+++ b/sfx2/inc/doctempl.hrc
@@ -37,7 +37,8 @@ const TranslateId TEMPLATE_LONG_NAMES_ARY[] =
 NC_("TEMPLATE_LONG_NAMES_ARY", "Presentation Backgrounds"),
 NC_("TEMPLATE_LONG_NAMES_ARY", "Presentations"),
 NC_("TEMPLATE_LONG_NAMES_ARY", "Miscellaneous"),
-NC_("TEMPLATE_LONG_NAMES_ARY", "Labels")
+NC_("TEMPLATE_LONG_NAMES_ARY", "Labels"),
+NC_("TEMPLATE_LONG_NAMES_ARY", "Drawings")
 };
 
 #endif
diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index 858e37a32812..45d7d1015a97 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -493,7 +493,8 @@ const char* TEMPLATE_SHORT_NAMES_ARY[] =
 "layout",
 "presnt",
 "misc",
-"labels"
+"labels",
+"draw"
 };
 
 void SfxDocTplService_Impl::readFolderList()


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

2022-09-16 Thread Heiko Tietze (via logerrit)
 sfx2/inc/recentdocsview.hxx|2 
 sfx2/source/control/recentdocsview.cxx |9 +-
 sfx2/source/dialog/backingwindow.cxx   |  132 
 sfx2/source/dialog/backingwindow.hxx   |   11 ++
 sfx2/uiconfig/ui/startcenter.ui|  135 +++--
 5 files changed, 168 insertions(+), 121 deletions(-)

New commits:
commit 164a1f4c3315fc44161128d3d9ca886f767f7d30
Author: Heiko Tietze 
AuthorDate: Fri Sep 9 16:07:28 2022 +0200
Commit: Heiko Tietze 
CommitDate: Fri Sep 16 10:31:45 2022 +0200

Resolves tdf#80934 - GUI means to filter thumbnails in start center

Resolves also tdf#92499 by removing the (badly placed) context menus
from the left pane into the new "toolbar"

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

diff --git a/sfx2/inc/recentdocsview.hxx b/sfx2/inc/recentdocsview.hxx
index 44165afbe38a..119bf6ee7267 100644
--- a/sfx2/inc/recentdocsview.hxx
+++ b/sfx2/inc/recentdocsview.hxx
@@ -82,6 +82,8 @@ public:
 
 void clearUnavailableFiles();
 
+void setFilter(ApplicationType aFilter);
+
 private:
 virtual bool MouseButtonDown( const MouseEvent& rMEvt ) override;
 
diff --git a/sfx2/source/control/recentdocsview.cxx 
b/sfx2/source/control/recentdocsview.cxx
index 61b9b55a64a6..c7c9efeb1c16 100644
--- a/sfx2/source/control/recentdocsview.cxx
+++ b/sfx2/source/control/recentdocsview.cxx
@@ -161,7 +161,8 @@ void RecentDocsView::Reload()
 OUString aURL = rRecentEntry.sURL;
 const INetURLObject aURLObj(aURL);
 
-if (!isAcceptedFile(aURLObj))
+if ((mnFileTypes != ApplicationType::TYPE_NONE) &&
+(!isAcceptedFile(aURLObj)))
 continue;
 
 //Remove extension from url's last segment and use it as title
@@ -174,6 +175,12 @@ void RecentDocsView::Reload()
 Invalidate();
 }
 
+void RecentDocsView::setFilter(ApplicationType aFilter)
+{
+mnFileTypes = aFilter;
+Reload();
+}
+
 void RecentDocsView::clearUnavailableFiles(){
 std::vector< SvtHistoryOptions::HistoryItem > aHistoryList = 
SvtHistoryOptions::GetList( EHistoryType::PickList );
 for ( size_t i = 0; i < aHistoryList.size(); i++ )
diff --git a/sfx2/source/dialog/backingwindow.cxx 
b/sfx2/source/dialog/backingwindow.cxx
index 6b68370b0bae..a19529fea4f0 100644
--- a/sfx2/source/dialog/backingwindow.cxx
+++ b/sfx2/source/dialog/backingwindow.cxx
@@ -143,11 +143,13 @@ float const g_fMultiplier = 1.2f;
 BackingWindow::BackingWindow(vcl::Window* i_pParent)
 : InterimItemWindow(i_pParent, "sfx/ui/startcenter.ui", "StartCenter", 
false)
 , mxOpenButton(m_xBuilder->weld_button("open_all"))
-, mxRecentButton(m_xBuilder->weld_menu_toggle_button("open_recent"))
+, mxRecentButton(m_xBuilder->weld_toggle_button("open_recent"))
 , mxRemoteButton(m_xBuilder->weld_button("open_remote"))
-, mxTemplateButton(m_xBuilder->weld_menu_toggle_button("templates_all"))
+, mxTemplateButton(m_xBuilder->weld_toggle_button("templates_all"))
 , mxCreateLabel(m_xBuilder->weld_label("create_label"))
 , mxAltHelpLabel(m_xBuilder->weld_label("althelplabel"))
+, mxFilter(m_xBuilder->weld_combo_box("cbFilter"))
+, mxActions(m_xBuilder->weld_menu_button("mbActions"))
 , mxWriterAllButton(m_xBuilder->weld_button("writer_all"))
 , mxCalcAllButton(m_xBuilder->weld_button("calc_all"))
 , mxImpressAllButton(m_xBuilder->weld_button("impress_all"))
@@ -174,6 +176,10 @@ BackingWindow::BackingWindow(vcl::Window* i_pParent)
 SetPaintTransparent(false);
 
SetBackground(svtools::ColorConfig().GetColorValue(::svtools::APPBACKGROUND).nColor);
 
+// square action button
+auto nHeight = mxFilter->get_preferred_size().getHeight();
+mxActions->set_size_request(nHeight, nHeight);
+
 //set an alternative help label that doesn't hotkey the H of the Help menu
 mxHelpButton->set_label(mxAltHelpLabel->get_label());
 mxHelpButton->connect_clicked(LINK(this, BackingWindow, ClickHelpHdl));
@@ -227,6 +233,8 @@ void BackingWindow::dispose()
 mxTemplateButton.reset();
 mxCreateLabel.reset();
 mxAltHelpLabel.reset();
+mxFilter.reset();
+mxActions.reset();
 mxWriterAllButton.reset();
 mxCalcAllButton.reset();
 mxImpressAllButton.reset();
@@ -278,11 +286,12 @@ void BackingWindow::initControls()
 mxAllRecentThumbnails->mnFileTypes |= sfx2::ApplicationType::TYPE_OTHER;
 mxAllRecentThumbnails->Reload();
 mxAllRecentThumbnails->ShowTooltips( true );
-mxRecentButton->set_active(true);
-mxRecentButton->grab_focus();
+mxAllRecentThumbnails->GrabFocus();
+mxRecentButton->set_highlight_background();
 
 //initialize Template view
 mxLocalView->Hide();
+mxActions->set_sensitive(true);
 
 //set handlers
 mxLocalView->setCreateContextMenuHdl(LINK(this, BackingWindow, 

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

2022-08-31 Thread oguzbalkaya (via logerrit)
 sfx2/inc/recentdocsview.hxx|2 ++
 sfx2/source/control/recentdocsview.cxx |   13 +
 sfx2/source/dialog/backingwindow.cxx   |3 +++
 sfx2/uiconfig/ui/startcenter.ui|7 +++
 4 files changed, 25 insertions(+)

New commits:
commit 2839b604af94dbd1ee59dc6d47dc2f4c6ebd8dc6
Author: oguzbalkaya 
AuthorDate: Tue Aug 30 23:29:53 2022 +0200
Commit: Hossein 
CommitDate: Wed Aug 31 13:23:53 2022 +0200

tdf#101302: Add option to clear unavailable files in menu/start center

This patch adresses tdf#101302. It essentially adds a menu item to clear
unavailable files from the menu and start center. Previously, they were
visible as recent documents in the menu and start center, and caused
error when selected.

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

diff --git a/sfx2/inc/recentdocsview.hxx b/sfx2/inc/recentdocsview.hxx
index 3ee34eabc41a..44165afbe38a 100644
--- a/sfx2/inc/recentdocsview.hxx
+++ b/sfx2/inc/recentdocsview.hxx
@@ -80,6 +80,8 @@ public:
 // received on load of recently used file
 void DispatchedLoadRecentUsedFile();
 
+void clearUnavailableFiles();
+
 private:
 virtual bool MouseButtonDown( const MouseEvent& rMEvt ) override;
 
diff --git a/sfx2/source/control/recentdocsview.cxx 
b/sfx2/source/control/recentdocsview.cxx
index 9eea0e1c2488..61b9b55a64a6 100644
--- a/sfx2/source/control/recentdocsview.cxx
+++ b/sfx2/source/control/recentdocsview.cxx
@@ -18,6 +18,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -173,6 +174,18 @@ void RecentDocsView::Reload()
 Invalidate();
 }
 
+void RecentDocsView::clearUnavailableFiles(){
+std::vector< SvtHistoryOptions::HistoryItem > aHistoryList = 
SvtHistoryOptions::GetList( EHistoryType::PickList );
+for ( size_t i = 0; i < aHistoryList.size(); i++ )
+{
+const SvtHistoryOptions::HistoryItem& rPickListEntry = aHistoryList[i];
+if ( !comphelper::DirectoryHelper::fileExists(rPickListEntry.sURL) ){
+
SvtHistoryOptions::DeleteItem(EHistoryType::PickList,rPickListEntry.sURL);
+}
+}
+Reload();
+}
+
 bool RecentDocsView::MouseButtonDown( const MouseEvent& rMEvt )
 {
 if (rMEvt.IsLeft())
diff --git a/sfx2/source/dialog/backingwindow.cxx 
b/sfx2/source/dialog/backingwindow.cxx
index 163c5c298e4f..6b68370b0bae 100644
--- a/sfx2/source/dialog/backingwindow.cxx
+++ b/sfx2/source/dialog/backingwindow.cxx
@@ -603,6 +603,9 @@ IMPL_LINK (BackingWindow, MenuSelectHdl, const OString&, 
rId, void)
 mxAllRecentThumbnails->Reload();
 return;
 }
+else if(rId == "clear_unavailable"){
+mxAllRecentThumbnails->clearUnavailableFiles();
+}
 else if (!rId.isEmpty())
 {
 initializeLocalView();
diff --git a/sfx2/uiconfig/ui/startcenter.ui b/sfx2/uiconfig/ui/startcenter.ui
index e65eba9e9aba..89b4653dffa7 100644
--- a/sfx2/uiconfig/ui/startcenter.ui
+++ b/sfx2/uiconfig/ui/startcenter.ui
@@ -17,6 +17,13 @@
 Clear Recent Documents
   
 
+
+  
+True
+False
+Clear Unavailable Files
+  
+
   
   
 True


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

2022-06-09 Thread Noel Grandin (via logerrit)
 sfx2/inc/sidebar/UnoDeck.hxx |4 ++--
 sfx2/inc/sidebar/UnoPanel.hxx|4 ++--
 sfx2/source/sidebar/UnoDeck.cxx  |   12 ++--
 sfx2/source/sidebar/UnoPanel.cxx |   12 ++--
 4 files changed, 16 insertions(+), 16 deletions(-)

New commits:
commit e9f407fbf0ede1760518b2e58931eba381879717
Author: Noel Grandin 
AuthorDate: Thu Jun 9 09:01:17 2022 +0200
Commit: Noel Grandin 
CommitDate: Thu Jun 9 11:27:03 2022 +0200

can pass by const& here

no need to copy

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

diff --git a/sfx2/inc/sidebar/UnoDeck.hxx b/sfx2/inc/sidebar/UnoDeck.hxx
index 88497c03ae3d..42c975c44d3b 100644
--- a/sfx2/inc/sidebar/UnoDeck.hxx
+++ b/sfx2/inc/sidebar/UnoDeck.hxx
@@ -54,8 +54,8 @@ private:
 
 const OUString mDeckId;
 
-sal_Int32 
GetMaxOrderIndex(sfx2::sidebar::ResourceManager::DeckContextDescriptorContainer 
aDecks);
-sal_Int32 
GetMinOrderIndex(sfx2::sidebar::ResourceManager::DeckContextDescriptorContainer 
aDecks);
+sal_Int32 GetMaxOrderIndex(const 
sfx2::sidebar::ResourceManager::DeckContextDescriptorContainer& rDecks);
+sal_Int32 GetMinOrderIndex(const 
sfx2::sidebar::ResourceManager::DeckContextDescriptorContainer& rDecks);
 
 };
 
diff --git a/sfx2/inc/sidebar/UnoPanel.hxx b/sfx2/inc/sidebar/UnoPanel.hxx
index 2b1197eb95f7..4e148befdf8d 100644
--- a/sfx2/inc/sidebar/UnoPanel.hxx
+++ b/sfx2/inc/sidebar/UnoPanel.hxx
@@ -62,8 +62,8 @@ private:
 VclPtr mpDeck;
 std::weak_ptr mxPanel;
 
-sal_Int32 
GetMaxOrderIndex(sfx2::sidebar::ResourceManager::PanelContextDescriptorContainer
 aPanels);
-sal_Int32 
GetMinOrderIndex(sfx2::sidebar::ResourceManager::PanelContextDescriptorContainer
 aPanels);
+sal_Int32 GetMaxOrderIndex(const 
sfx2::sidebar::ResourceManager::PanelContextDescriptorContainer& rPanels);
+sal_Int32 GetMinOrderIndex(const 
sfx2::sidebar::ResourceManager::PanelContextDescriptorContainer& rPanels);
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/sidebar/UnoDeck.cxx b/sfx2/source/sidebar/UnoDeck.cxx
index 30a68cdc385c..deb4552b4cdf 100644
--- a/sfx2/source/sidebar/UnoDeck.cxx
+++ b/sfx2/source/sidebar/UnoDeck.cxx
@@ -247,14 +247,14 @@ void SAL_CALL SfxUnoDeck::moveDown()
 }
 }
 
-sal_Int32 
SfxUnoDeck::GetMinOrderIndex(ResourceManager::DeckContextDescriptorContainer 
aDecks)
+sal_Int32 SfxUnoDeck::GetMinOrderIndex(const 
ResourceManager::DeckContextDescriptorContainer& rDecks)
 {
 SidebarController* pSidebarController = getSidebarController();
 
-ResourceManager::DeckContextDescriptorContainer::const_iterator iDeck = 
aDecks.begin();
+ResourceManager::DeckContextDescriptorContainer::const_iterator iDeck = 
rDecks.begin();
 sal_Int32 minIndex = 
pSidebarController->GetResourceManager()->GetDeckDescriptor(iDeck->msId)->mnOrderIndex;
 
-for (auto const& deck : aDecks)
+for (auto const& deck : rDecks)
 {
 sal_Int32 index = 
pSidebarController->GetResourceManager()->GetDeckDescriptor(deck.msId)->mnOrderIndex;
 if(minIndex > index)
@@ -263,13 +263,13 @@ sal_Int32 
SfxUnoDeck::GetMinOrderIndex(ResourceManager::DeckContextDescriptorCon
 return minIndex;
 }
 
-sal_Int32 
SfxUnoDeck::GetMaxOrderIndex(ResourceManager::DeckContextDescriptorContainer 
aDecks)
+sal_Int32 SfxUnoDeck::GetMaxOrderIndex(const 
ResourceManager::DeckContextDescriptorContainer& rDecks)
 {
 SidebarController* pSidebarController = getSidebarController();
 
-sal_Int32 maxIndex = 
pSidebarController->GetResourceManager()->GetDeckDescriptor(aDecks.begin()->msId)->mnOrderIndex;
+sal_Int32 maxIndex = 
pSidebarController->GetResourceManager()->GetDeckDescriptor(rDecks.begin()->msId)->mnOrderIndex;
 
-for (auto const& deck : aDecks)
+for (auto const& deck : rDecks)
 {
 sal_Int32 index = 
pSidebarController->GetResourceManager()->GetDeckDescriptor(deck.msId)->mnOrderIndex;
 if(maxIndex < index)
diff --git a/sfx2/source/sidebar/UnoPanel.cxx b/sfx2/source/sidebar/UnoPanel.cxx
index d47399b85b5d..4af0b0b89264 100644
--- a/sfx2/source/sidebar/UnoPanel.cxx
+++ b/sfx2/source/sidebar/UnoPanel.cxx
@@ -261,13 +261,13 @@ void SAL_CALL SfxUnoPanel::moveDown()
 }
 }
 
-sal_Int32 
SfxUnoPanel::GetMinOrderIndex(ResourceManager::PanelContextDescriptorContainer 
aPanels)
+sal_Int32 SfxUnoPanel::GetMinOrderIndex(const 
ResourceManager::PanelContextDescriptorContainer& rPanels)
 {
 SidebarController* pSidebarController = getSidebarController();
 
-sal_Int32 minIndex = 
pSidebarController->GetResourceManager()->GetPanelDescriptor(aPanels.begin()->msId)->mnOrderIndex;
+sal_Int32 minIndex = 
pSidebarController->GetResourceManager()->GetPanelDescriptor(rPanels.begin()->msId)->mnOrderIndex;
 
-for (auto const& panel : aPanels)
+for (auto const& panel : rPanels)
 {
 

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

2022-05-08 Thread Noel Grandin (via logerrit)
 sfx2/inc/preventduplicateinteraction.hxx |3 ++-
 sfx2/source/appl/preventduplicateinteraction.cxx |   18 +-
 2 files changed, 11 insertions(+), 10 deletions(-)

New commits:
commit 40b0cf86c23d72af90f964597ac814ceaf846259
Author: Noel Grandin 
AuthorDate: Sat May 7 21:06:33 2022 +0200
Commit: Noel Grandin 
CommitDate: Sun May 8 16:38:31 2022 +0200

osl::Mutex->std::mutex in sfx2::PreventDuplicateInteraction

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

diff --git a/sfx2/inc/preventduplicateinteraction.hxx 
b/sfx2/inc/preventduplicateinteraction.hxx
index a5eb448eca60..62e59dd96c2e 100644
--- a/sfx2/inc/preventduplicateinteraction.hxx
+++ b/sfx2/inc/preventduplicateinteraction.hxx
@@ -34,6 +34,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace com::sun::star::uno {
 class XComponentContext;
@@ -152,7 +153,7 @@ public:
 class PreventDuplicateInteraction final :
   public 
::cppu::WeakImplHelper
 {
-mutable ::osl::Mutex m_aLock;
+mutable std::mutex m_aLock;
 
 // structs, types etc.
 public:
diff --git a/sfx2/source/appl/preventduplicateinteraction.cxx 
b/sfx2/source/appl/preventduplicateinteraction.cxx
index 0c32b34f3503..31dcd113b66b 100644
--- a/sfx2/source/appl/preventduplicateinteraction.cxx
+++ b/sfx2/source/appl/preventduplicateinteraction.cxx
@@ -39,7 +39,7 @@ PreventDuplicateInteraction::~PreventDuplicateInteraction()
 void PreventDuplicateInteraction::setHandler(const css::uno::Reference< 
css::task::XInteractionHandler >& xHandler)
 {
 // SAFE ->
-osl::MutexGuard aLock(m_aLock);
+std::unique_lock aLock(m_aLock);
 m_xWarningDialogsParent.reset();
 m_xHandler = xHandler;
 // <- SAFE
@@ -54,7 +54,7 @@ void PreventDuplicateInteraction::useDefaultUUIHandler()
 m_xContext, m_xWarningDialogsParent->GetDialogParent()), 
css::uno::UNO_QUERY_THROW);
 
 // SAFE ->
-osl::MutexGuard aLock(m_aLock);
+std::unique_lock aLock(m_aLock);
 m_xHandler = xHandler;
 // <- SAFE
 }
@@ -63,7 +63,7 @@ css::uno::Any SAL_CALL 
PreventDuplicateInteraction::queryInterface( const css::u
 {
 if ( aType.equals( cppu::UnoType::get() ) )
 {
-osl::MutexGuard aLock(m_aLock);
+std::unique_lock aLock(m_aLock);
 css::uno::Reference< css::task::XInteractionHandler2 > xHandler( 
m_xHandler, css::uno::UNO_QUERY );
 if ( !xHandler.is() )
 return css::uno::Any();
@@ -77,7 +77,7 @@ void SAL_CALL PreventDuplicateInteraction::handle(const 
css::uno::Reference< css
 bool  bHandleIt = true;
 
 // SAFE ->
-osl::ClearableMutexGuard aLock(m_aLock);
+std::unique_lock aLock(m_aLock);
 
 auto pIt = std::find_if(m_lInteractionRules.begin(), 
m_lInteractionRules.end(),
 [](const InteractionInfo& rInfo) { return 
aRequest.isExtractableTo(rInfo.m_aInteraction); });
@@ -92,7 +92,7 @@ void SAL_CALL PreventDuplicateInteraction::handle(const 
css::uno::Reference< css
 
 css::uno::Reference< css::task::XInteractionHandler > xHandler = 
m_xHandler;
 
-aLock.clear();
+aLock.unlock();
 // <- SAFE
 
 if ( bHandleIt && xHandler.is() )
@@ -120,7 +120,7 @@ sal_Bool SAL_CALL 
PreventDuplicateInteraction::handleInteractionRequest( const c
 bool  bHandleIt = true;
 
 // SAFE ->
-osl::ClearableMutexGuard aLock(m_aLock);
+std::unique_lock aLock(m_aLock);
 
 auto pIt = std::find_if(m_lInteractionRules.begin(), 
m_lInteractionRules.end(),
 [](const InteractionInfo& rInfo) { return 
aRequest.isExtractableTo(rInfo.m_aInteraction); });
@@ -137,7 +137,7 @@ sal_Bool SAL_CALL 
PreventDuplicateInteraction::handleInteractionRequest( const c
 OSL_ENSURE( xHandler.is() || !m_xHandler.is(),
 "PreventDuplicateInteraction::handleInteractionRequest: 
inconsistency!" );
 
-aLock.clear();
+aLock.unlock();
 // <- SAFE
 
 if ( bHandleIt && xHandler.is() )
@@ -163,7 +163,7 @@ sal_Bool SAL_CALL 
PreventDuplicateInteraction::handleInteractionRequest( const c
 void PreventDuplicateInteraction::addInteractionRule(const 
PreventDuplicateInteraction::InteractionInfo& aInteractionInfo)
 {
 // SAFE ->
-osl::MutexGuard aLock(m_aLock);
+std::unique_lock aLock(m_aLock);
 
 auto pIt = std::find_if(m_lInteractionRules.begin(), 
m_lInteractionRules.end(),
 [](const InteractionInfo& rInfo) { return 
rInfo.m_aInteraction == aInteractionInfo.m_aInteraction; });
@@ -183,7 +183,7 @@ bool PreventDuplicateInteraction::getInteractionInfo(const 
css::uno::Type&

PreventDuplicateInteraction::InteractionInfo* pReturn ) const
 {
 // SAFE ->
-osl::MutexGuard aLock(m_aLock);
+std::unique_lock aLock(m_aLock);
 
 auto pIt = std::find_if(m_lInteractionRules.begin(), 

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

2022-03-15 Thread Mike Kaganski (via logerrit)
 sfx2/inc/bitmaps.hlst  |   24 +++-
 sfx2/inc/recentdocsview.hxx|6 -
 sfx2/source/control/recentdocsview.cxx |  144 +
 sfx2/source/control/recentdocsviewitem.cxx |  141 ++--
 sfx2/source/control/recentdocsviewitem.hxx |2 
 sfx2/source/control/templatelocalview.cxx  |2 
 6 files changed, 164 insertions(+), 155 deletions(-)

New commits:
commit 1dbed50a6ed73570ca2d8a1e37237205e2394c34
Author: Mike Kaganski 
AuthorDate: Tue Mar 15 15:45:15 2022 +0300
Commit: Mike Kaganski 
CommitDate: Tue Mar 15 21:19:17 2022 +0100

tdf#134065, tdf#147998: fix thumbnail generation code

This moves the code drawing thumbnails and overlay icons away from
RecentDocsView to RecentDocsViewItem, where the final size of the
thumbnail is defined, so that no scaling of pre-painted icon would
happen.

This also restores the SFX_FILE_THUMBNAIL_* to state before commit
d43c6fa220524a09c0b24cbb5bc03c4456cd2515, and introduces a new set
of SFX_FILE_OVERLAY_* to be used for the overlay icons. This fixes
the display when RecentDocsThumbnail is disabled.

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

diff --git a/sfx2/inc/bitmaps.hlst b/sfx2/inc/bitmaps.hlst
index c3fb205bb7bb..af7f9705e2ce 100644
--- a/sfx2/inc/bitmaps.hlst
+++ b/sfx2/inc/bitmaps.hlst
@@ -43,13 +43,23 @@ inline constexpr OUStringLiteral SFX_THUMBNAIL_TEXT = 
u"res/ott_96_8.png";
 inline constexpr OUStringLiteral SFX_THUMBNAIL_SHEET = u"res/ots_96_8.png";
 inline constexpr OUStringLiteral SFX_THUMBNAIL_PRESENTATION = 
u"res/otp_96_8.png";
 inline constexpr OUStringLiteral SFX_THUMBNAIL_DRAWING = u"res/otg_96_8.png";
-inline constexpr OUStringLiteral SFX_FILE_THUMBNAIL_TEXT = u"res/odt_48_8.png";
-inline constexpr OUStringLiteral SFX_FILE_THUMBNAIL_SHEET = 
u"res/ods_48_8.png";
-inline constexpr OUStringLiteral SFX_FILE_THUMBNAIL_PRESENTATION = 
u"res/odp_48_8.png";
-inline constexpr OUStringLiteral SFX_FILE_THUMBNAIL_DRAWING = 
u"res/odg_48_8.png";
-inline constexpr OUStringLiteral SFX_FILE_THUMBNAIL_DATABASE = 
u"res/odb_48_8.png";
-inline constexpr OUStringLiteral SFX_FILE_THUMBNAIL_MATH = u"res/odf_48_8.png";
-inline constexpr OUStringLiteral SFX_FILE_THUMBNAIL_DEFAULT = 
u"res/mainapp_48_8.png";
+
+inline constexpr OUStringLiteral SFX_FILE_THUMBNAIL_TEXT = 
u"res/writer128.png";
+inline constexpr OUStringLiteral SFX_FILE_THUMBNAIL_SHEET = u"res/calc128.png";
+inline constexpr OUStringLiteral SFX_FILE_THUMBNAIL_PRESENTATION = 
u"res/impress128.png";
+inline constexpr OUStringLiteral SFX_FILE_THUMBNAIL_DRAWING = 
u"res/draw128.png";
+inline constexpr OUStringLiteral SFX_FILE_THUMBNAIL_DATABASE = 
u"res/base128.png";
+inline constexpr OUStringLiteral SFX_FILE_THUMBNAIL_MATH = u"res/math128.png";
+inline constexpr OUStringLiteral SFX_FILE_THUMBNAIL_DEFAULT = 
u"res/main128.png";
+
+inline constexpr OUStringLiteral SFX_FILE_OVERLAY_TEXT = u"res/odt_48_8.png";
+inline constexpr OUStringLiteral SFX_FILE_OVERLAY_SHEET = u"res/ods_48_8.png";
+inline constexpr OUStringLiteral SFX_FILE_OVERLAY_PRESENTATION = 
u"res/odp_48_8.png";
+inline constexpr OUStringLiteral SFX_FILE_OVERLAY_DRAWING = 
u"res/odg_48_8.png";
+inline constexpr OUStringLiteral SFX_FILE_OVERLAY_DATABASE = 
u"res/odb_48_8.png";
+inline constexpr OUStringLiteral SFX_FILE_OVERLAY_MATH = u"res/odf_48_8.png";
+inline constexpr OUStringLiteral SFX_FILE_OVERLAY_DEFAULT = 
u"res/mainapp_48_8.png";
+
 inline constexpr OUStringLiteral SFX_THUMBNAIL_BASE_192 = 
u"res/base_thumbnail_192.png";
 inline constexpr OUStringLiteral SFX_THUMBNAIL_BASE_256 = 
u"res/base_thumbnail_256.png";
 
diff --git a/sfx2/inc/recentdocsview.hxx b/sfx2/inc/recentdocsview.hxx
index 44cda470b7bc..28b1f77e7c27 100644
--- a/sfx2/inc/recentdocsview.hxx
+++ b/sfx2/inc/recentdocsview.hxx
@@ -17,6 +17,7 @@
 #include 
 #include 
 
+class INetURLObject;
 struct ImplSVEvent;
 namespace com::sun::star::frame { class XDispatch; }
 
@@ -62,10 +63,9 @@ public:
 RecentDocsView(std::unique_ptr xWindow, 
std::unique_ptr xMenu);
 virtual ~RecentDocsView() override;
 
-void insertItem(const OUString , const OUString , const 
BitmapEx , sal_uInt16 nId);
+void insertItem(const OUString , const OUString , const 
OUString& rThumbnail, sal_uInt16 nId);
 
 static bool typeMatchesExtension(ApplicationType type, std::u16string_view 
rExt);
-static BitmapEx getDefaultThumbnail(const OUString , bool 
bCheckEncrypted = true);
 
 ApplicationType mnFileTypes;
 
@@ -91,7 +91,7 @@ private:
 
 virtual void LoseFocus() override;
 
-bool isAcceptedFile(const OUString ) const;
+bool isAcceptedFile(const INetURLObject& rURL) const;
 
 DECL_LINK( ExecuteHdl_Impl, void*, void );
 
diff --git a/sfx2/source/control/recentdocsview.cxx 

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

2022-01-24 Thread Verne-Lai (via logerrit)
 sfx2/inc/autoredactdialog.hxx|7 ++-
 sfx2/source/doc/autoredactdialog.cxx |8 +++-
 2 files changed, 13 insertions(+), 2 deletions(-)

New commits:
commit 687cfd51ac785c2ab2cb8e49dea28aa7f53cbdfb
Author: Verne-Lai 
AuthorDate: Thu Oct 14 09:01:58 2021 +0800
Commit: Eike Rathke 
CommitDate: Mon Jan 24 23:03:05 2022 +0100

tdf#131327 Add double clicked event on auto-redact table

Change-Id: Id927244fcd7e985edadb2b9f9cfdd61ba93066e4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123570
Tested-by: Jenkins
Reviewed-by: Eike Rathke 

diff --git a/sfx2/inc/autoredactdialog.hxx b/sfx2/inc/autoredactdialog.hxx
index fe43eef840f0..28c2c561f60d 100644
--- a/sfx2/inc/autoredactdialog.hxx
+++ b/sfx2/inc/autoredactdialog.hxx
@@ -76,6 +76,11 @@ public:
 
 // Sync data on the targets box with the data on the target
 void setRowData(int nRowIndex, const RedactionTarget* pTarget);
+
+void connect_row_activated(const Link& rLink)
+{
+m_xControl->connect_row_activated(rLink);
+};
 };
 
 namespace sfx2
@@ -110,7 +115,7 @@ class SfxAutoRedactDialog final : public SfxDialogController
 DECL_LINK(AddHdl, weld::Button&, void);
 DECL_LINK(EditHdl, weld::Button&, void);
 DECL_LINK(DeleteHdl, weld::Button&, void);
-
+DECL_LINK(DoubleClickEditHdl, weld::TreeView&, bool);
 DECL_LINK(LoadHdl, sfx2::FileDialogHelper*, void);
 DECL_LINK(SaveHdl, sfx2::FileDialogHelper*, void);
 
diff --git a/sfx2/source/doc/autoredactdialog.cxx 
b/sfx2/source/doc/autoredactdialog.cxx
index a951217fe665..4acbb8ea7816 100644
--- a/sfx2/source/doc/autoredactdialog.cxx
+++ b/sfx2/source/doc/autoredactdialog.cxx
@@ -317,7 +317,12 @@ IMPL_LINK_NOARG(SfxAutoRedactDialog, EditHdl, 
weld::Button&, void)
 // And sync the targets box row with the actual target data
 m_xTargetsBox->setRowData(nSelectedRow, pTarget);
 }
-
+IMPL_LINK_NOARG(SfxAutoRedactDialog, DoubleClickEditHdl, weld::TreeView&, bool)
+{
+if (m_xEditBtn->get_sensitive())
+m_xEditBtn->clicked();
+return true;
+}
 IMPL_LINK_NOARG(SfxAutoRedactDialog, DeleteHdl, weld::Button&, void)
 {
 std::vector aSelectedRows = m_xTargetsBox->get_selected_rows();
@@ -576,6 +581,7 @@ SfxAutoRedactDialog::SfxAutoRedactDialog(weld::Window* 
pParent)
 m_xAddBtn->connect_clicked(LINK(this, SfxAutoRedactDialog, AddHdl));
 m_xEditBtn->connect_clicked(LINK(this, SfxAutoRedactDialog, EditHdl));
 m_xDeleteBtn->connect_clicked(LINK(this, SfxAutoRedactDialog, DeleteHdl));
+m_xTargetsBox->connect_row_activated(LINK(this, SfxAutoRedactDialog, 
DoubleClickEditHdl));
 }
 
 SfxAutoRedactDialog::~SfxAutoRedactDialog()


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

2022-01-03 Thread Noel Grandin (via logerrit)
 sfx2/inc/unoctitm.hxx|   15 +
 sfx2/source/control/unoctitm.cxx |   60 +++
 2 files changed, 44 insertions(+), 31 deletions(-)

New commits:
commit 7d87312ab6b39c3c03e93d305a1e6d7f0b78f9a7
Author: Noel Grandin 
AuthorDate: Mon Dec 20 19:59:46 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Jan 3 20:54:39 2022 +0100

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

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

diff --git a/sfx2/inc/unoctitm.hxx b/sfx2/inc/unoctitm.hxx
index 6eb9e7147945..1a53091b2b74 100644
--- a/sfx2/inc/unoctitm.hxx
+++ b/sfx2/inc/unoctitm.hxx
@@ -21,14 +21,14 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
 
 #include 
 #include 
-#include 
+#include 
 
 namespace com::sun::star::frame { class XFrame; }
 namespace com::sun::star::frame { class XNotifyingDispatch; }
@@ -39,13 +39,14 @@ class SfxBindings;
 class SfxDispatcher;
 class SfxSlot;
 
-typedef 
comphelper::OMultiTypeInterfaceContainerHelperVar3
+typedef comphelper::OMultiTypeInterfaceContainerHelperVar4
 SfxStatusDispatcher_Impl_ListenerContainer;
 
 class SfxStatusDispatcher   :   public 
cppu::WeakImplHelper
 {
-::osl::MutexaMutex;
-SfxStatusDispatcher_Impl_ListenerContainer  aListeners;
+protected:
+std::mutexmaMutex;
+SfxStatusDispatcher_Impl_ListenerContainer  maListeners;
 
 public:
 
@@ -61,8 +62,8 @@ public:
 
 // Something else
 voidReleaseAll();
-SfxStatusDispatcher_Impl_ListenerContainer& GetListeners()
-{ return aListeners; }
+voidsendStatusChanged(const OUString& rURL, const 
css::frame::FeatureStateEvent& rEvent);
+std::vector getContainedTypes() { return 
maListeners.getContainedTypes(); };
 };
 
 class SfxSlotServer;
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index cecfb4c639e1..5ae4e87f77e4 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -124,7 +124,29 @@ void SfxStatusDispatcher::ReleaseAll()
 {
 css::lang::EventObject aObject;
 aObject.Source = static_cast(this);
-aListeners.disposeAndClear( aObject );
+std::unique_lock aGuard(maMutex);
+maListeners.disposeAndClear( aGuard, aObject );
+}
+
+void SfxStatusDispatcher::sendStatusChanged(const OUString& rURL, const 
css::frame::FeatureStateEvent& rEvent)
+{
+std::unique_lock aGuard(maMutex);
+::comphelper::OInterfaceContainerHelper4* 
pContnr = maListeners.getContainer(rURL);
+if (!pContnr)
+return;
+::comphelper::OInterfaceIteratorHelper4 aIt(*pContnr);
+aGuard.unlock();
+while (aIt.hasMoreElements())
+{
+try
+{
+aIt.next()->statusChanged(rEvent);
+}
+catch (const css::uno::RuntimeException&)
+{
+aIt.remove();
+}
+}
 }
 
 void SAL_CALL SfxStatusDispatcher::dispatch( const css::util::URL&, const 
css::uno::Sequence< css::beans::PropertyValue >& )
@@ -139,13 +161,15 @@ void SAL_CALL 
SfxStatusDispatcher::dispatchWithNotification(
 }
 
 SfxStatusDispatcher::SfxStatusDispatcher()
-: aListeners( aMutex )
 {
 }
 
 void SAL_CALL SfxStatusDispatcher::addStatusListener(const 
css::uno::Reference< css::frame::XStatusListener > & aListener, const 
css::util::URL& aURL)
 {
-aListeners.addInterface( aURL.Complete, aListener );
+{
+std::unique_lock aGuard(maMutex);
+maListeners.addInterface( aURL.Complete, aListener );
+}
 if ( aURL.Complete == ".uno:LifeTime" )
 {
 css::frame::FeatureStateEvent aEvent;
@@ -159,7 +183,8 @@ void SAL_CALL SfxStatusDispatcher::addStatusListener(const 
css::uno::Reference<
 
 void SAL_CALL SfxStatusDispatcher::removeStatusListener( const 
css::uno::Reference< css::frame::XStatusListener > & aListener, const 
css::util::URL& aURL )
 {
-aListeners.removeInterface( aURL.Complete, aListener );
+std::unique_lock aGuard(maMutex);
+maListeners.removeInterface( aURL.Complete, aListener );
 }
 
 
@@ -273,7 +298,10 @@ void SAL_CALL SfxOfficeDispatch::dispatchWithNotification( 
const css::util::URL&
 
 void SAL_CALL SfxOfficeDispatch::addStatusListener(const css::uno::Reference< 
css::frame::XStatusListener > & aListener, const css::util::URL& aURL)
 {
-GetListeners().addInterface( aURL.Complete, aListener );
+{
+std::unique_lock aGuard(maMutex);
+maListeners.addInterface( aURL.Complete, aListener );
+}
 if ( pImpl )
 {
 // ControllerItem is the Impl class
@@ -382,9 +410,7 @@ SfxDispatchController_Impl::~SfxDispatchController_Impl()
 pDispatch->pImpl = nullptr;
 
 // force all listeners to release the dispatch object
-css::lang::EventObject aObject;
-aObject.Source = 

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

2021-12-14 Thread Mike Kaganski (via logerrit)
 sfx2/inc/recentdocsview.hxx|2 +-
 sfx2/source/control/recentdocsview.cxx |8 +---
 2 files changed, 6 insertions(+), 4 deletions(-)

New commits:
commit 2f848eb5dc6f6f9344f250ac9860065130aaf436
Author: Mike Kaganski 
AuthorDate: Wed Dec 15 09:22:13 2021 +0300
Commit: Mike Kaganski 
CommitDate: Wed Dec 15 08:17:25 2021 +0100

tdf#131850: avoid encryption check for recent docs overlay

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

diff --git a/sfx2/inc/recentdocsview.hxx b/sfx2/inc/recentdocsview.hxx
index b87a0cce679c..b347fc25029a 100644
--- a/sfx2/inc/recentdocsview.hxx
+++ b/sfx2/inc/recentdocsview.hxx
@@ -65,7 +65,7 @@ public:
 void insertItem(const OUString , const OUString , const 
BitmapEx , sal_uInt16 nId);
 
 static bool typeMatchesExtension(ApplicationType type, std::u16string_view 
rExt);
-static BitmapEx getDefaultThumbnail(const OUString );
+static BitmapEx getDefaultThumbnail(const OUString , bool 
bCheckEncrypted = true);
 
 ApplicationType mnFileTypes;
 
diff --git a/sfx2/source/control/recentdocsview.cxx 
b/sfx2/source/control/recentdocsview.cxx
index f942b1ffbb15..0957cabbdc6f 100644
--- a/sfx2/source/control/recentdocsview.cxx
+++ b/sfx2/source/control/recentdocsview.cxx
@@ -206,13 +206,15 @@ bool RecentDocsView::isAcceptedFile(const OUString ) 
const
(mnFileTypes & ApplicationType::TYPE_OTHER&& 
typeMatchesExtension(ApplicationType::TYPE_OTHER,   aExt));
 }
 
-BitmapEx RecentDocsView::getDefaultThumbnail(const OUString )
+BitmapEx RecentDocsView::getDefaultThumbnail(const OUString , bool 
bCheckEncrypted)
 {
 BitmapEx aImg;
 INetURLObject aUrl(rURL);
 OUString aExt = aUrl.getExtension();
 
-const std::map& rWhichMap = IsDocEncrypted( 
rURL) ?
+// tdf#131850: avoid reading the file to check if it's encrypted,
+// if we only need its generic "module" thumbnail
+const std::map& rWhichMap = bCheckEncrypted && 
IsDocEncrypted(rURL) ?
 EncryptedBitmapForExtension : BitmapForExtension;
 
 std::map::const_iterator mIt =
@@ -269,7 +271,7 @@ void RecentDocsView::Reload()
 }
 }
 
-aModule = getDefaultThumbnail(aURL);
+aModule = getDefaultThumbnail(aURL, false); // We don't need an 
"encrypted" icon here
 if (!aModule.IsEmpty() && !aThumbnail.IsEmpty()) {
 ScopedVclPtr 
m_pVirDev(VclPtr::Create());
 Size aSize(aThumbnail.GetSizePixel());


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

2021-12-06 Thread Noel Grandin (via logerrit)
 sfx2/inc/unoctitm.hxx|4 ++--
 sfx2/source/control/unoctitm.cxx |6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 962c9cb5cf9127ccad2c9d947ea03d40e4e556ce
Author: Noel Grandin 
AuthorDate: Wed Dec 1 21:33:06 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Dec 4 12:05:13 2021 +0100

use OMultiTypeInterfaceContainerHelperVar3 in SfxStatusDispatcher

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

diff --git a/sfx2/inc/unoctitm.hxx b/sfx2/inc/unoctitm.hxx
index a88a64c261ef..6eb9e7147945 100644
--- a/sfx2/inc/unoctitm.hxx
+++ b/sfx2/inc/unoctitm.hxx
@@ -21,7 +21,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -39,7 +39,7 @@ class SfxBindings;
 class SfxDispatcher;
 class SfxSlot;
 
-typedef comphelper::OMultiTypeInterfaceContainerHelperVar2
+typedef 
comphelper::OMultiTypeInterfaceContainerHelperVar3
 SfxStatusDispatcher_Impl_ListenerContainer;
 
 class SfxStatusDispatcher   :   public 
cppu::WeakImplHelper
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index b01500814bc9..cecfb4c639e1 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -794,15 +794,15 @@ void SfxDispatchController_Impl::addStatusListener(const 
css::uno::Reference< cs
 
 void SfxDispatchController_Impl::sendStatusChanged(const OUString& rURL, const 
css::frame::FeatureStateEvent& rEvent)
 {
-::comphelper::OInterfaceContainerHelper2* pContnr = 
pDispatch->GetListeners().getContainer(rURL);
+::comphelper::OInterfaceContainerHelper3* 
pContnr = pDispatch->GetListeners().getContainer(rURL);
 if (!pContnr)
 return;
-::comphelper::OInterfaceIteratorHelper2 aIt(*pContnr);
+::comphelper::OInterfaceIteratorHelper3 aIt(*pContnr);
 while (aIt.hasMoreElements())
 {
 try
 {
-
static_cast(aIt.next())->statusChanged(rEvent);
+aIt.next()->statusChanged(rEvent);
 }
 catch (const css::uno::RuntimeException&)
 {


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

2021-11-24 Thread Julien Nabet (via logerrit)
 sfx2/inc/dinfdlg.hrc   |   30 ---
 sfx2/source/dialog/dinfdlg.cxx |   53 -
 2 files changed, 43 insertions(+), 40 deletions(-)

New commits:
commit ae6b3cf568157ec37574fdc8491e5d385a88cd94
Author: Julien Nabet 
AuthorDate: Tue Nov 23 22:12:53 2021 +0100
Commit: Julien Nabet 
CommitDate: Wed Nov 24 21:28:33 2021 +0100

Convert sal_IntPtr into int + use constexpr int in sfx2/dinfdlg

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

diff --git a/sfx2/inc/dinfdlg.hrc b/sfx2/inc/dinfdlg.hrc
index 5b838ce56652..819892da6d5a 100644
--- a/sfx2/inc/dinfdlg.hrc
+++ b/sfx2/inc/dinfdlg.hrc
@@ -56,22 +56,24 @@ const TranslateId SFX_CB_PROPERTY_STRINGARRAY[] =
 NC_("SFX_CB_PROPERTY_STRINGARRAY", "URL")
 };
 
-#define CUSTOM_TYPE_UNKNOWN 0
-#define CUSTOM_TYPE_TEXT1
-#define CUSTOM_TYPE_NUMBER  2
-#define CUSTOM_TYPE_DATE3
-#define CUSTOM_TYPE_BOOLEAN 4
-#define CUSTOM_TYPE_DURATION5
-#define CUSTOM_TYPE_DATETIME6
+enum CustomProperties : sal_Int32 {
+Custom_Type_Unknown = 0,
+Custom_Type_Text = 1,
+Custom_Type_Number = 2,
+Custom_Type_Date = 3,
+Custom_Type_Boolean = 4,
+Custom_Type_Duration = 5,
+Custom_Type_Datetime = 6
+};
 
-const std::pair SFX_LB_PROPERTY_STRINGARRAY[] =
+const std::pair SFX_LB_PROPERTY_STRINGARRAY[] =
 {
-{ NC_("SFX_CB_PROPERTY_STRINGARRAY", "Text"), CUSTOM_TYPE_TEXT },
-{ NC_("SFX_CB_PROPERTY_STRINGARRAY", "DateTime"), CUSTOM_TYPE_DATETIME 
},
-{ NC_("SFX_CB_PROPERTY_STRINGARRAY", "Date"), CUSTOM_TYPE_DATE },
-{ NC_("SFX_CB_PROPERTY_STRINGARRAY", "Duration"), CUSTOM_TYPE_DURATION 
},
-{ NC_("SFX_CB_PROPERTY_STRINGARRAY", "Number")  , CUSTOM_TYPE_NUMBER },
-{ NC_("SFX_CB_PROPERTY_STRINGARRAY", "Yes or no")   , CUSTOM_TYPE_BOOLEAN }
+{ NC_("SFX_CB_PROPERTY_STRINGARRAY", "Text"), Custom_Type_Text },
+{ NC_("SFX_CB_PROPERTY_STRINGARRAY", "DateTime"), Custom_Type_Datetime 
},
+{ NC_("SFX_CB_PROPERTY_STRINGARRAY", "Date"), Custom_Type_Date },
+{ NC_("SFX_CB_PROPERTY_STRINGARRAY", "Duration"), Custom_Type_Duration 
},
+{ NC_("SFX_CB_PROPERTY_STRINGARRAY", "Number")  , Custom_Type_Number },
+{ NC_("SFX_CB_PROPERTY_STRINGARRAY", "Yes or no")   , Custom_Type_Boolean }
 };
 
 #endif
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index e702c7c9457f..04d70eadc0b8 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -1323,13 +1323,13 @@ CustomPropertiesWindow::~CustomPropertiesWindow()
 void CustomPropertyLine::DoTypeHdl(const weld::ComboBox& rBox)
 {
 auto nType = rBox.get_active_id().toInt32();
-m_xValueEdit->set_visible( (CUSTOM_TYPE_TEXT == nType) || 
(CUSTOM_TYPE_NUMBER  == nType) );
-m_xDateTimeBox->set_visible( (CUSTOM_TYPE_DATE == nType) || 
(CUSTOM_TYPE_DATETIME  == nType) );
-m_xDateField->set_visible( (CUSTOM_TYPE_DATE == nType) || 
(CUSTOM_TYPE_DATETIME  == nType) );
-m_xTimeField->set_visible( CUSTOM_TYPE_DATETIME  == nType );
-m_xDurationBox->set_visible( CUSTOM_TYPE_DURATION == nType );
-m_xDurationField->set_visible( CUSTOM_TYPE_DURATION == nType );
-m_xYesNoButton->set_visible( CUSTOM_TYPE_BOOLEAN == nType );
+m_xValueEdit->set_visible( (Custom_Type_Text == nType) || 
(Custom_Type_Number == nType) );
+m_xDateTimeBox->set_visible( (Custom_Type_Date == nType) || 
(Custom_Type_Datetime == nType) );
+m_xDateField->set_visible( (Custom_Type_Date == nType) || 
(Custom_Type_Datetime == nType) );
+m_xTimeField->set_visible( Custom_Type_Datetime == nType );
+m_xDurationBox->set_visible( Custom_Type_Duration == nType );
+m_xDurationField->set_visible( Custom_Type_Duration == nType );
+m_xYesNoButton->set_visible( Custom_Type_Boolean == nType );
 }
 
 IMPL_LINK(CustomPropertyLine, TypeHdl, weld::ComboBox&, rBox, void)
@@ -1405,11 +1405,11 @@ bool CustomPropertiesWindow::IsLineValid( 
CustomPropertyLine* pLine ) const
 return true;
 
 sal_uInt32 nIndex = NUMBERFORMAT_ENTRY_NOT_FOUND;
-if ( CUSTOM_TYPE_NUMBER == nType )
+if ( Custom_Type_Number == nType )
 // tdf#116214 Scientific format allows to use also standard numbers
 nIndex = const_cast< SvNumberFormatter& >(
 m_aNumberFormatter ).GetFormatIndex( NF_SCIENTIFIC_000E00 );
-else if ( CUSTOM_TYPE_DATE == nType )
+else if ( Custom_Type_Date == nType )
 nIndex = const_cast< SvNumberFormatter& >(
 m_aNumberFormatter).GetFormatIndex( NF_DATE_SYS_DDMM );
 
@@ -1436,7 +1436,7 @@ void CustomPropertiesWindow::ValidateLine( 
CustomPropertyLine* pLine, bool bIsFr
 std::unique_ptr 
xMessageBox(Application::CreateMessageDialog(_rBody,
 

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

2021-08-10 Thread Stephan Bergmann (via logerrit)
 sfx2/inc/pch/precompiled_sfx.hxx  |1 -
 sfx2/source/appl/shutdownicon.cxx |   24 
 2 files changed, 8 insertions(+), 17 deletions(-)

New commits:
commit 0a666480276f704d5127f578333659893517abe7
Author: Stephan Bergmann 
AuthorDate: Tue Aug 10 13:27:24 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Aug 10 15:35:52 2021 +0200

Replace a use of boost::logic::tribool with std::call_once

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

diff --git a/sfx2/inc/pch/precompiled_sfx.hxx b/sfx2/inc/pch/precompiled_sfx.hxx
index fc1d910d520e..dc98200fdf49 100644
--- a/sfx2/inc/pch/precompiled_sfx.hxx
+++ b/sfx2/inc/pch/precompiled_sfx.hxx
@@ -47,7 +47,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #endif // PCH_LEVEL >= 1
diff --git a/sfx2/source/appl/shutdownicon.cxx 
b/sfx2/source/appl/shutdownicon.cxx
index fcebfe809d1e..cbae2881122a 100644
--- a/sfx2/source/appl/shutdownicon.cxx
+++ b/sfx2/source/appl/shutdownicon.cxx
@@ -20,9 +20,8 @@
 #include 
 #include 
 
-#include 
+#include 
 
-#include 
 #include "shutdownicon.hxx"
 #include 
 #include 
@@ -113,28 +112,20 @@ extern "C" {
 
 namespace {
 
-boost::logic::tribool loaded(boost::logic::indeterminate); // 
loplugin:constvars:ignore
 oslGenericFunction pInitSystray = disabled_initSystray;
 oslGenericFunction pDeInitSystray = disabled_deInitSystray;
 
-bool LoadModule()
+void LoadModule()
 {
-if (boost::logic::indeterminate(loaded))
-{
 #ifdef ENABLE_QUICKSTART_APPLET
 #  ifdef _WIN32
-pInitSystray = win32_init_sys_tray;
-pDeInitSystray = win32_shutdown_sys_tray;
-loaded = true;
+pInitSystray = win32_init_sys_tray;
+pDeInitSystray = win32_shutdown_sys_tray;
 #  elif defined MACOSX
-pInitSystray = aqua_init_systray;
-pDeInitSystray = aqua_shutdown_systray;
-loaded = true;
+pInitSystray = aqua_init_systray;
+pDeInitSystray = aqua_shutdown_systray;
 #  endif // MACOSX
 #endif // ENABLE_QUICKSTART_APPLET
-}
-assert(!boost::logic::indeterminate(loaded));
-return bool(loaded);
 }
 
 }
@@ -145,7 +136,8 @@ void ShutdownIcon::initSystray()
 return;
 m_bInitialized = true;
 
-(void) LoadModule();
+static std::once_flag flag;
+std::call_once(flag, LoadModule);
 m_bVeto = true;
 pInitSystray();
 }


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

2021-08-04 Thread Tomaž Vajngerl (via logerrit)
 sfx2/inc/commandpopup/CommandPopup.hxx|   15 -
 sfx2/source/commandpopup/CommandPopup.cxx |   86 +++---
 2 files changed, 69 insertions(+), 32 deletions(-)

New commits:
commit fc0d2136aee6c1749d780de09df025251703b59e
Author: Tomaž Vajngerl 
AuthorDate: Wed Aug 4 16:17:46 2021 +0900
Commit: Tomaž Vajngerl 
CommitDate: Wed Aug 4 16:38:48 2021 +0200

tdf#142532 search string at any position not just start

In the first implementation, we check if the search string is at
the start of the command string. Mainly this is done to find the
right command with a better accuracy. The problem with this is
that it discards other hits where the search word occurs at an
other position in the command text.

This change adds the command where the search string doesn't occur
at the start of the command string, but it adds those hits to the
end of the list, so the best matches are still added at the
beginning.

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

diff --git a/sfx2/inc/commandpopup/CommandPopup.hxx 
b/sfx2/inc/commandpopup/CommandPopup.hxx
index 5d1d74aff860..143f0de25adb 100644
--- a/sfx2/inc/commandpopup/CommandPopup.hxx
+++ b/sfx2/inc/commandpopup/CommandPopup.hxx
@@ -23,6 +23,9 @@
 #include 
 #include 
 
+#include 
+#include 
+
 struct CurrentEntry final
 {
 OUString m_aCommandURL;
@@ -56,6 +59,7 @@ private:
 MenuContent m_aMenuContent;
 OUString m_sModuleLongName;
 OUString toLower(OUString const& rString);
+std::unordered_set m_aAdded;
 
 public:
 MenuContentHandler(css::uno::Reference const& xFrame);
@@ -67,9 +71,14 @@ public:
 std::vector& rCommandList);
 
 private:
-void findInMenuRecursive(MenuContent const& rMenuContent, OUString const& 
rText,
- std::unique_ptr& 
rpCommandTreeView,
- std::vector& rCommandList);
+void findInMenuRecursive(
+MenuContent const& rMenuContent, OUString const& rText,
+std::unique_ptr& rpCommandTreeView, 
std::vector& rCommandList,
+std::function const& 
rSearchCriterium);
+
+void addCommandIfPossible(MenuContent const& rMenuContent,
+  std::unique_ptr& 
rpCommandTreeView,
+  std::vector& rCommandList);
 };
 
 class CommandListBox final
diff --git a/sfx2/source/commandpopup/CommandPopup.cxx 
b/sfx2/source/commandpopup/CommandPopup.cxx
index 518e73a132b1..152e5b9959b4 100644
--- a/sfx2/source/commandpopup/CommandPopup.cxx
+++ b/sfx2/source/commandpopup/CommandPopup.cxx
@@ -107,47 +107,75 @@ void MenuContentHandler::findInMenu(OUString const& rText,
 std::unique_ptr& 
rpCommandTreeView,
 std::vector& rCommandList)
 {
-findInMenuRecursive(m_aMenuContent, toLower(rText), rpCommandTreeView, 
rCommandList);
+m_aAdded.clear();
+
+OUString aLowerCaseText = toLower(rText);
+
+auto aTextStartCriterium = [](MenuContent const& rMenuContent, OUString 
const& rSearchText) {
+return rMenuContent.m_aSearchableMenuLabel.startsWith(rSearchText);
+};
+
+findInMenuRecursive(m_aMenuContent, aLowerCaseText, rpCommandTreeView, 
rCommandList,
+aTextStartCriterium);
+
+auto aTextAllCriterium = [](MenuContent const& rMenuContent, OUString 
const& rSearchText) {
+return rMenuContent.m_aSearchableMenuLabel.indexOf(rSearchText) > 0;
+};
+
+findInMenuRecursive(m_aMenuContent, aLowerCaseText, rpCommandTreeView, 
rCommandList,
+aTextAllCriterium);
 }
 
-void MenuContentHandler::findInMenuRecursive(MenuContent const& rMenuContent, 
OUString const& rText,
- std::unique_ptr& 
rpCommandTreeView,
- std::vector& 
rCommandList)
+void MenuContentHandler::findInMenuRecursive(
+MenuContent const& rMenuContent, OUString const& rText,
+std::unique_ptr& rpCommandTreeView, 
std::vector& rCommandList,
+std::function const& 
rSearchCriterium)
 {
 for (MenuContent const& aSubContent : rMenuContent.m_aSubMenuContent)
 {
-if (aSubContent.m_aSearchableMenuLabel.startsWith(rText))
+if (rSearchCriterium(aSubContent, rText))
 {
-OUString sCommandURL = aSubContent.m_aCommandURL;
-util::URL aCommandURL;
-aCommandURL.Complete = sCommandURL;
+addCommandIfPossible(aSubContent, rpCommandTreeView, rCommandList);
+}
+findInMenuRecursive(aSubContent, rText, rpCommandTreeView, 
rCommandList, rSearchCriterium);
+}
+}
+
+void MenuContentHandler::addCommandIfPossible(MenuContent const& rMenuContent,
+  std::unique_ptr& 

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

2021-07-06 Thread Caolán McNamara (via logerrit)
 sfx2/inc/sidebar/TitleBar.hxx|2 +-
 sfx2/source/sidebar/TitleBar.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit a0ae4bb38cedf5f30a2bb6b6578024bb299112fe
Author: Caolán McNamara 
AuthorDate: Tue Jul 6 12:28:05 2021 +0100
Commit: Caolán McNamara 
CommitDate: Tue Jul 6 15:21:11 2021 +0200

use an explicit box instead of container

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

diff --git a/sfx2/inc/sidebar/TitleBar.hxx b/sfx2/inc/sidebar/TitleBar.hxx
index 590cf549571e..8264acc24e65 100644
--- a/sfx2/inc/sidebar/TitleBar.hxx
+++ b/sfx2/inc/sidebar/TitleBar.hxx
@@ -53,7 +53,7 @@ public:
 
 protected:
 weld::Builder& mrBuilder;
-std::unique_ptr mxTitlebar;
+std::unique_ptr mxTitlebar;
 std::unique_ptr mxAddonImage;
 std::unique_ptr mxToolBox;
 Theme::ThemeItem meThemeItem;
diff --git a/sfx2/source/sidebar/TitleBar.cxx b/sfx2/source/sidebar/TitleBar.cxx
index 9dc13d3aa274..dd00d42175b9 100644
--- a/sfx2/source/sidebar/TitleBar.cxx
+++ b/sfx2/source/sidebar/TitleBar.cxx
@@ -23,7 +23,7 @@ namespace sfx2::sidebar {
 
 TitleBar::TitleBar(weld::Builder& rBuilder, Theme::ThemeItem eThemeItem)
 : mrBuilder(rBuilder)
-, mxTitlebar(rBuilder.weld_container("titlebar"))
+, mxTitlebar(rBuilder.weld_box("titlebar"))
 , mxAddonImage(rBuilder.weld_image("addonimage"))
 , mxToolBox(rBuilder.weld_toolbar("toolbar"))
 , meThemeItem(eThemeItem)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-06-25 Thread Noel Grandin (via logerrit)
 sfx2/inc/templatedefaultview.hxx   |2 +-
 sfx2/inc/unoctitm.hxx  |2 +-
 sfx2/source/inc/alienwarn.hxx  |2 +-
 sfx2/source/inc/appbaslib.hxx  |2 +-
 sfx2/source/inc/appdata.hxx|2 +-
 sfx2/source/inc/documentfontsdialog.hxx|5 ++---
 sfx2/source/inc/docundomanager.hxx |2 +-
 sfx2/source/inc/eventsupplier.hxx  |2 +-
 sfx2/source/inc/fltoptint.hxx  |4 ++--
 sfx2/source/inc/macroloader.hxx|2 +-
 sfx2/source/inc/objshimp.hxx   |4 ++--
 sfx2/source/inc/openurlhint.hxx|2 +-
 sfx2/source/inc/partwnd.hxx|5 ++---
 sfx2/source/inc/preview.hxx|2 +-
 sfx2/source/inc/recfloat.hxx   |4 ++--
 sfx2/source/inc/splitwin.hxx   |4 +---
 sfx2/source/inc/statcach.hxx   |2 +-
 sfx2/source/inc/templatesearchviewitem.hxx |2 +-
 sfx2/source/inc/templdgi.hxx   |3 +--
 sfx2/source/inc/tplcitem.hxx   |4 ++--
 sfx2/source/inc/versdlg.hxx|6 +++---
 sfx2/source/inc/workwin.hxx|2 +-
 22 files changed, 30 insertions(+), 35 deletions(-)

New commits:
commit 5a0e9dd75e1c266714177d1178c0a035fcc193b9
Author: Noel Grandin 
AuthorDate: Thu Jun 24 15:13:44 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Jun 25 12:25:34 2021 +0200

loplugin:finalclasses in sfx2

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

diff --git a/sfx2/inc/templatedefaultview.hxx b/sfx2/inc/templatedefaultview.hxx
index e53910044176..1771ad3d8759 100644
--- a/sfx2/inc/templatedefaultview.hxx
+++ b/sfx2/inc/templatedefaultview.hxx
@@ -11,7 +11,7 @@
 
 #include 
 
-class TemplateDefaultView : public TemplateLocalView
+class TemplateDefaultView final : public TemplateLocalView
 {
 public:
 TemplateDefaultView(std::unique_ptr xWindow,
diff --git a/sfx2/inc/unoctitm.hxx b/sfx2/inc/unoctitm.hxx
index 8259329e9e18..805ff22b3124 100644
--- a/sfx2/inc/unoctitm.hxx
+++ b/sfx2/inc/unoctitm.hxx
@@ -101,7 +101,7 @@ public:
 SfxDispatcher*  GetDispatcher_Impl();
 };
 
-class SfxDispatchController_Impl : public SfxControllerItem
+class SfxDispatchController_Impl final : public SfxControllerItem
 {
 css::util::URL  aDispatchURL;
 SfxDispatcher*  pDispatcher;
diff --git a/sfx2/source/inc/alienwarn.hxx b/sfx2/source/inc/alienwarn.hxx
index 5cf662b09d0f..7c4f8cb364ee 100644
--- a/sfx2/source/inc/alienwarn.hxx
+++ b/sfx2/source/inc/alienwarn.hxx
@@ -21,7 +21,7 @@
 
 #include 
 
-class SfxAlienWarningDialog : public weld::MessageDialogController
+class SfxAlienWarningDialog final : public weld::MessageDialogController
 {
 private:
 std::unique_ptr m_xKeepCurrentBtn;
diff --git a/sfx2/source/inc/appbaslib.hxx b/sfx2/source/inc/appbaslib.hxx
index f1ca81d29d57..30473f2af94a 100644
--- a/sfx2/source/inc/appbaslib.hxx
+++ b/sfx2/source/inc/appbaslib.hxx
@@ -30,7 +30,7 @@ class BasicManager;
 
 /** helper class which holds and manipulates a BasicManager
 */
-class SfxBasicManagerHolder
+class SfxBasicManagerHolder final
 : public SfxListener
 {
 private:
diff --git a/sfx2/source/inc/appdata.hxx b/sfx2/source/inc/appdata.hxx
index f36a25f176e6..0861ad69758f 100644
--- a/sfx2/source/inc/appdata.hxx
+++ b/sfx2/source/inc/appdata.hxx
@@ -136,7 +136,7 @@ public:
 voidOnApplicationBasicManagerCreated( 
BasicManager& _rManager );
 };
 
-class SfxDdeTriggerTopic_Impl : public DdeTopic
+class SfxDdeTriggerTopic_Impl final : public DdeTopic
 {
 #if defined(_WIN32)
 public:
diff --git a/sfx2/source/inc/documentfontsdialog.hxx 
b/sfx2/source/inc/documentfontsdialog.hxx
index 6f7b3fb221ae..9ce447669a71 100644
--- a/sfx2/source/inc/documentfontsdialog.hxx
+++ b/sfx2/source/inc/documentfontsdialog.hxx
@@ -24,7 +24,7 @@
 /**
  Tab page for document font settings in the document properties dialog.
 */
-class SfxDocumentFontsPage : public SfxTabPage
+class SfxDocumentFontsPage final : public SfxTabPage
 {
 public:
 SfxDocumentFontsPage(weld::Container* pPage, weld::DialogController* 
pController,
@@ -33,11 +33,10 @@ public:
 static std::unique_ptr
 Create(weld::Container* pPage, weld::DialogController* pController, const 
SfxItemSet* set);
 
-protected:
+private:
 virtual bool FillItemSet(SfxItemSet* set) override;
 virtual void Reset(const SfxItemSet* set) override;
 
-private:
 std::unique_ptr embedFontsCheckbox;
 std::unique_ptr embedUsedFontsCheckbox;
 std::unique_ptr embedLatinScriptFontsCheckbox;
diff --git a/sfx2/source/inc/docundomanager.hxx 
b/sfx2/source/inc/docundomanager.hxx
index 9145e5967d51..98bf827fb14e 100644
--- a/sfx2/source/inc/docundomanager.hxx
+++ b/sfx2/source/inc/docundomanager.hxx
@@ -95,7 

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

2021-06-17 Thread Noel Grandin (via logerrit)
 sfx2/inc/recentdocsview.hxx|4 +++-
 sfx2/source/control/recentdocsview.cxx |8 ++--
 2 files changed, 9 insertions(+), 3 deletions(-)

New commits:
commit 2176084192dc46a1ef5d6dd79effa5cd5d1dcca2
Author: Noel Grandin 
AuthorDate: Thu Jun 17 13:38:07 2021 +0200
Commit: Noel Grandin 
CommitDate: Thu Jun 17 19:07:17 2021 +0200

fix potential write-after-free in RecentDocsView

spotted while running a valgrind session

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

diff --git a/sfx2/inc/recentdocsview.hxx b/sfx2/inc/recentdocsview.hxx
index 77c350d40b83..b87a0cce679c 100644
--- a/sfx2/inc/recentdocsview.hxx
+++ b/sfx2/inc/recentdocsview.hxx
@@ -17,6 +17,7 @@
 #include 
 #include 
 
+struct ImplSVEvent;
 namespace com::sun::star::frame { class XDispatch; }
 
 namespace sfx2
@@ -92,7 +93,7 @@ private:
 
 bool isAcceptedFile(const OUString ) const;
 
-DECL_STATIC_LINK( RecentDocsView, ExecuteHdl_Impl, void*, void );
+DECL_LINK( ExecuteHdl_Impl, void*, void );
 
 tools::Long mnItemMaxSize;
 size_t mnLastMouseDownItem;
@@ -103,6 +104,7 @@ private:
 OUString maWelcomeLine2;
 
 sfx2::LoadRecentFile* mpLoadRecentFile;
+ImplSVEvent* m_nExecuteHdlId;
 };
 
 } // namespace sfx2
diff --git a/sfx2/source/control/recentdocsview.cxx 
b/sfx2/source/control/recentdocsview.cxx
index 137591a43991..0b01603d3914 100644
--- a/sfx2/source/control/recentdocsview.cxx
+++ b/sfx2/source/control/recentdocsview.cxx
@@ -130,6 +130,7 @@ 
RecentDocsView::RecentDocsView(std::unique_ptr xWindow, st
 , maWelcomeLine1(SfxResId(STR_WELCOME_LINE1))
 , maWelcomeLine2(SfxResId(STR_WELCOME_LINE2))
 , mpLoadRecentFile(nullptr)
+, m_nExecuteHdlId(nullptr)
 {
 tools::Rectangle aScreen = 
Application::GetScreenPosSizePixel(Application::GetDisplayBuiltInScreen());
 mnItemMaxSize = std::min(aScreen.GetWidth(),aScreen.GetHeight()) > 800 ? 
256 : 192;
@@ -148,6 +149,8 @@ 
RecentDocsView::RecentDocsView(std::unique_ptr xWindow, st
 
 RecentDocsView::~RecentDocsView()
 {
+Application::RemoveUserEvent(m_nExecuteHdlId);
+m_nExecuteHdlId = nullptr;
 if (mpLoadRecentFile)
 {
 mpLoadRecentFile->pView = nullptr;
@@ -408,7 +411,7 @@ void RecentDocsView::PostLoadRecentUsedFile(LoadRecentFile* 
pLoadRecentFile)
 {
 assert(!mpLoadRecentFile);
 mpLoadRecentFile = pLoadRecentFile;
-Application::PostUserEvent(LINK(nullptr, RecentDocsView, ExecuteHdl_Impl), 
pLoadRecentFile);
+m_nExecuteHdlId = Application::PostUserEvent(LINK(this, RecentDocsView, 
ExecuteHdl_Impl), pLoadRecentFile);
 }
 
 void RecentDocsView::DispatchedLoadRecentUsedFile()
@@ -416,8 +419,9 @@ void RecentDocsView::DispatchedLoadRecentUsedFile()
 mpLoadRecentFile = nullptr;
 }
 
-IMPL_STATIC_LINK( RecentDocsView, ExecuteHdl_Impl, void*, p, void )
+IMPL_LINK( RecentDocsView, ExecuteHdl_Impl, void*, p, void )
 {
+m_nExecuteHdlId = nullptr;
 LoadRecentFile* pLoadRecentFile = static_cast(p);
 try
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-05-30 Thread Tomaž Vajngerl (via logerrit)
 sfx2/inc/commandpopup/CommandPopup.hxx|   11 +-
 sfx2/source/commandpopup/CommandPopup.cxx |   32 +++---
 2 files changed, 31 insertions(+), 12 deletions(-)

New commits:
commit a39947102bac8430b13b10b3f11c34b5ebf576b0
Author: Tomaž Vajngerl 
AuthorDate: Mon May 31 10:36:09 2021 +0900
Commit: Tomaž Vajngerl 
CommitDate: Mon May 31 05:30:19 2021 +0200

tdf#142243 HUD - Use XCharacterClassification to convert case

This should use international case conversion, not just ascii one
that was used before.

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

diff --git a/sfx2/inc/commandpopup/CommandPopup.hxx 
b/sfx2/inc/commandpopup/CommandPopup.hxx
index 85208e37608e..5d1d74aff860 100644
--- a/sfx2/inc/commandpopup/CommandPopup.hxx
+++ b/sfx2/inc/commandpopup/CommandPopup.hxx
@@ -17,8 +17,11 @@
 #include 
 #include 
 
-#include 
+#include 
 #include 
+#include 
+#include 
+#include 
 
 struct CurrentEntry final
 {
@@ -36,6 +39,7 @@ struct MenuContent final
 {
 OUString m_aCommandURL;
 OUString m_aMenuLabel;
+OUString m_aSearchableMenuLabel;
 OUString m_aFullLabelWithPath;
 OUString m_aTooltip;
 std::vector m_aSubMenuContent;
@@ -44,9 +48,14 @@ struct MenuContent final
 class MenuContentHandler final
 {
 private:
+css::uno::Reference m_xContext;
 css::uno::Reference m_xFrame;
+css::uno::Reference 
m_xCharacterClassification;
+css::uno::Reference m_xURLTransformer;
+
 MenuContent m_aMenuContent;
 OUString m_sModuleLongName;
+OUString toLower(OUString const& rString);
 
 public:
 MenuContentHandler(css::uno::Reference const& xFrame);
diff --git a/sfx2/source/commandpopup/CommandPopup.cxx 
b/sfx2/source/commandpopup/CommandPopup.cxx
index aa2555252b26..a903a0b12628 100644
--- a/sfx2/source/commandpopup/CommandPopup.cxx
+++ b/sfx2/source/commandpopup/CommandPopup.cxx
@@ -25,19 +25,23 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
+#include 
+#include 
 
 using namespace css;
 
 MenuContentHandler::MenuContentHandler(uno::Reference const& 
xFrame)
-: m_xFrame(xFrame)
+: m_xContext(comphelper::getProcessComponentContext())
+, m_xFrame(xFrame)
+, 
m_xCharacterClassification(i18n::CharacterClassification::create(m_xContext))
+, m_xURLTransformer(util::URLTransformer::create(m_xContext))
 , m_sModuleLongName(vcl::CommandInfoProvider::GetModuleIdentifier(xFrame))
 {
-auto xComponentContext = comphelper::getProcessComponentContext();
-
 uno::Reference 
xModuleConfigSupplier;
-
xModuleConfigSupplier.set(ui::theModuleUIConfigurationManagerSupplier::get(xComponentContext));
+
xModuleConfigSupplier.set(ui::theModuleUIConfigurationManagerSupplier::get(m_xContext));
 
 uno::Reference xConfigurationManager;
 xConfigurationManager = 
xModuleConfigSupplier->getUIConfigurationManager(m_sModuleLongName);
@@ -83,6 +87,7 @@ void MenuContentHandler::gatherMenuContent(
 aNewContent.m_aCommandURL, m_sModuleLongName);
 OUString aLabel = 
vcl::CommandInfoProvider::GetLabelForCommand(aCommandProperties);
 aNewContent.m_aMenuLabel = aLabel;
+aNewContent.m_aSearchableMenuLabel = toLower(aLabel);
 
 if (!rMenuContent.m_aFullLabelWithPath.isEmpty())
 aNewContent.m_aFullLabelWithPath = 
rMenuContent.m_aFullLabelWithPath + " / ";
@@ -102,7 +107,7 @@ void MenuContentHandler::findInMenu(OUString const& rText,
 std::unique_ptr& 
rpCommandTreeView,
 std::vector& rCommandList)
 {
-findInMenuRecursive(m_aMenuContent, rText, rpCommandTreeView, 
rCommandList);
+findInMenuRecursive(m_aMenuContent, toLower(rText), rpCommandTreeView, 
rCommandList);
 }
 
 void MenuContentHandler::findInMenuRecursive(MenuContent const& rMenuContent, 
OUString const& rText,
@@ -111,15 +116,13 @@ void MenuContentHandler::findInMenuRecursive(MenuContent 
const& rMenuContent, OU
 {
 for (MenuContent const& aSubContent : rMenuContent.m_aSubMenuContent)
 {
-if (aSubContent.m_aMenuLabel.toAsciiLowerCase().startsWith(rText))
+if (aSubContent.m_aSearchableMenuLabel.startsWith(rText))
 {
 OUString sCommandURL = aSubContent.m_aCommandURL;
 util::URL aCommandURL;
 aCommandURL.Complete = sCommandURL;
-uno::Reference xContext
-= comphelper::getProcessComponentContext();
-uno::Reference xParser = 
util::URLTransformer::create(xContext);
-xParser->parseStrict(aCommandURL);
+
+m_xURLTransformer->parseStrict(aCommandURL);
 
 auto* pViewFrame = SfxViewFrame::Current();
 
@@ -148,6 +151,13 @@ void MenuContentHandler::findInMenuRecursive(MenuContent 
const& rMenuContent, OU
 }
 }
 
+OUString 

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

2021-05-26 Thread Noel Grandin (via logerrit)
 sfx2/inc/SfxRedactionHelper.hxx|8 +++
 sfx2/inc/autoredactdialog.hxx  |2 -
 sfx2/source/doc/SfxRedactionHelper.cxx |   37 +
 sfx2/source/doc/autoredactdialog.cxx   |5 ++--
 sfx2/source/doc/objserv.cxx|2 -
 5 files changed, 24 insertions(+), 30 deletions(-)

New commits:
commit 085c97c986336bc622d6b3d72e6a587e1ae4b844
Author: Noel Grandin 
AuthorDate: Wed May 26 10:42:18 2021 +0200
Commit: Noel Grandin 
CommitDate: Wed May 26 15:17:49 2021 +0200

fix leak in SfxAutoRedactDialog

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

diff --git a/sfx2/inc/SfxRedactionHelper.hxx b/sfx2/inc/SfxRedactionHelper.hxx
index c6631a053566..07e752d173ad 100644
--- a/sfx2/inc/SfxRedactionHelper.hxx
+++ b/sfx2/inc/SfxRedactionHelper.hxx
@@ -76,7 +76,7 @@ public:
 addPagesToDraw(const uno::Reference& xComponent, sal_Int32 
nPages,
const std::vector& aMetaFiles,
const std::vector<::Size>& aPageSizes, const PageMargins& 
aPageMargins,
-   const std::vector>& 
r_aTableTargets,
+   const std::vector>& 
r_aTableTargets,
bool bIsAutoRedact);
 /*
  * Makes the Redaction toolbar visible to the user.
@@ -102,7 +102,7 @@ public:
  * Used to find the text portions to be redacted. Returns a list of 
rectangles to cover those
  * areas to be redacted. Probably the most crucial part of the 
auto-redaction process.
  * */
-static void searchInMetaFile(const RedactionTarget* pRedactionTarget, 
const GDIMetaFile& rMtf,
+static void searchInMetaFile(const RedactionTarget& rRedactionTarget, 
const GDIMetaFile& rMtf,
  std::vector& 
aRedactionRectangles,
  const uno::Reference& xComponent);
 
@@ -117,14 +117,14 @@ public:
  * Search for the given term through the gdimetafile, which has the whole 
content of a draw page,
  * and draw redaction rectangles to the appropriate positions with 
suitable sizes.
  * */
-static void autoRedactPage(const RedactionTarget* pRedactionTarget,
+static void autoRedactPage(const RedactionTarget& rRedactionTarget,
const GDIMetaFile& rGDIMetaFile,
const uno::Reference& xPage,
const uno::Reference& xComponent);
 
 /// Fill the search options based on the given redaction target
 static void fillSearchOptions(i18nutil::SearchOptions2& rSearchOpt,
-  const RedactionTarget* pTarget);
+  const RedactionTarget& rTarget);
 
 private:
 static constexpr std::u16string_view m_aPredefinedTargets[6] = {
diff --git a/sfx2/inc/autoredactdialog.hxx b/sfx2/inc/autoredactdialog.hxx
index eef638538e80..657881979df2 100644
--- a/sfx2/inc/autoredactdialog.hxx
+++ b/sfx2/inc/autoredactdialog.hxx
@@ -132,7 +132,7 @@ public:
  *  Does a shallow copy.
  *  Returns true if successful.
  */
-bool getTargets(std::vector>& 
r_aTargets);
+bool getTargets(std::vector>& 
r_aTargets);
 };
 
 class SfxAddTargetDialog final : public weld::GenericDialogController
diff --git a/sfx2/source/doc/SfxRedactionHelper.cxx 
b/sfx2/source/doc/SfxRedactionHelper.cxx
index 98f5d9b37c6b..ca82fc484767 100644
--- a/sfx2/source/doc/SfxRedactionHelper.cxx
+++ b/sfx2/source/doc/SfxRedactionHelper.cxx
@@ -216,7 +216,7 @@ void SfxRedactionHelper::addPagesToDraw(
 const uno::Reference& xComponent, sal_Int32 nPages,
 const std::vector& aMetaFiles, const std::vector<::Size>& 
aPageSizes,
 const PageMargins& aPageMargins,
-const std::vector>& r_aTableTargets, 
bool bIsAutoRedact)
+const std::vector>& r_aTableTargets, 
bool bIsAutoRedact)
 {
 // Access the draw pages
 uno::Reference xDrawPagesSupplier(xComponent, 
uno::UNO_QUERY);
@@ -413,14 +413,14 @@ SfxRedactionHelper::getPageMarginsForCalc(const 
css::uno::Reference& 
aRedactionRectangles,
   const uno::Reference& 
xComponent)
 {
 // Initialize search
 i18nutil::SearchOptions2 aSearchOptions;
-fillSearchOptions(aSearchOptions, pRedactionTarget);
+fillSearchOptions(aSearchOptions, rRedactionTarget);
 
 utl::TextSearch textSearch(aSearchOptions);
 static tools::Long aLastFontHeight = 0;
@@ -508,17 +508,17 @@ void SfxRedactionHelper::addRedactionRectToPage(
 }
 }
 
-void SfxRedactionHelper::autoRedactPage(const RedactionTarget* 
pRedactionTarget,
+void SfxRedactionHelper::autoRedactPage(const RedactionTarget& 
rRedactionTarget,
 const GDIMetaFile& rGDIMetaFile,
 const 
uno::Reference& xPage,
 const 

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

2021-05-19 Thread Caolán McNamara (via logerrit)
 sfx2/inc/emojicontrol.hxx|4 ++--
 sfx2/source/control/emojicontrol.cxx |   22 +++---
 2 files changed, 13 insertions(+), 13 deletions(-)

New commits:
commit 749be84cefbce1c24b46ab8cc296064216087312
Author: Caolán McNamara 
AuthorDate: Wed May 19 14:06:14 2021 +0100
Commit: Caolán McNamara 
CommitDate: Wed May 19 17:06:52 2021 +0200

use toggle instead of click for ToggleButton

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

diff --git a/sfx2/inc/emojicontrol.hxx b/sfx2/inc/emojicontrol.hxx
index 2e2ab150762f..787405d101fb 100644
--- a/sfx2/inc/emojicontrol.hxx
+++ b/sfx2/inc/emojicontrol.hxx
@@ -36,9 +36,9 @@ public:
 private:
 static void ConvertLabelToUnicode(weld::ToggleButton& rBtn);
 
-FILTER_CATEGORY getFilter(const weld::Button& rBtn) const;
+FILTER_CATEGORY getFilter(const weld::ToggleButton& rBtn) const;
 
-DECL_LINK(ActivatePageHdl, weld::Button&, void);
+DECL_LINK(ActivatePageHdl, weld::ToggleButton&, void);
 DECL_STATIC_LINK(SfxEmojiControl, InsertHdl, ThumbnailViewItem*, void);
 
 std::unique_ptr mxPeopleBtn;
diff --git a/sfx2/source/control/emojicontrol.cxx 
b/sfx2/source/control/emojicontrol.cxx
index c3e9910ddacd..0d51ce805e68 100644
--- a/sfx2/source/control/emojicontrol.cxx
+++ b/sfx2/source/control/emojicontrol.cxx
@@ -62,15 +62,15 @@ SfxEmojiControl::SfxEmojiControl(const EmojiPopup* 
pControl, weld::Widget* pPare
 ConvertLabelToUnicode(*mxFlagsBtn);
 ConvertLabelToUnicode(*mxUnicode9Btn);
 
-mxPeopleBtn->connect_clicked(LINK(this, SfxEmojiControl, ActivatePageHdl));
-mxNatureBtn->connect_clicked(LINK(this, SfxEmojiControl, ActivatePageHdl));
-mxFoodBtn->connect_clicked(LINK(this, SfxEmojiControl, ActivatePageHdl));
-mxActivityBtn->connect_clicked(LINK(this, SfxEmojiControl, 
ActivatePageHdl));
-mxTravelBtn->connect_clicked(LINK(this, SfxEmojiControl, ActivatePageHdl));
-mxObjectsBtn->connect_clicked(LINK(this, SfxEmojiControl, 
ActivatePageHdl));
-mxSymbolsBtn->connect_clicked(LINK(this, SfxEmojiControl, 
ActivatePageHdl));
-mxFlagsBtn->connect_clicked(LINK(this, SfxEmojiControl, ActivatePageHdl));
-mxUnicode9Btn->connect_clicked(LINK(this, SfxEmojiControl, 
ActivatePageHdl));
+mxPeopleBtn->connect_toggled(LINK(this, SfxEmojiControl, ActivatePageHdl));
+mxNatureBtn->connect_toggled(LINK(this, SfxEmojiControl, ActivatePageHdl));
+mxFoodBtn->connect_toggled(LINK(this, SfxEmojiControl, ActivatePageHdl));
+mxActivityBtn->connect_toggled(LINK(this, SfxEmojiControl, 
ActivatePageHdl));
+mxTravelBtn->connect_toggled(LINK(this, SfxEmojiControl, ActivatePageHdl));
+mxObjectsBtn->connect_toggled(LINK(this, SfxEmojiControl, 
ActivatePageHdl));
+mxSymbolsBtn->connect_toggled(LINK(this, SfxEmojiControl, 
ActivatePageHdl));
+mxFlagsBtn->connect_toggled(LINK(this, SfxEmojiControl, ActivatePageHdl));
+mxUnicode9Btn->connect_toggled(LINK(this, SfxEmojiControl, 
ActivatePageHdl));
 
 mxEmojiView->setItemMaxTextLength(ITEM_MAX_TEXT_LENGTH);
 mxEmojiView->setItemDimensions(ITEM_MAX_WIDTH, 0, ITEM_MAX_HEIGHT, 
ITEM_PADDING);
@@ -99,7 +99,7 @@ void 
SfxEmojiControl::ConvertLabelToUnicode(weld::ToggleButton& rBtn)
 rBtn.set_label(sHexText.toString());
 }
 
-FILTER_CATEGORY SfxEmojiControl::getFilter(const weld::Button& rCurPageId) 
const
+FILTER_CATEGORY SfxEmojiControl::getFilter(const weld::ToggleButton& 
rCurPageId) const
 {
 if ( == mxPeopleBtn.get())
 return FILTER_CATEGORY::PEOPLE;
@@ -123,7 +123,7 @@ FILTER_CATEGORY SfxEmojiControl::getFilter(const 
weld::Button& rCurPageId) const
 return FILTER_CATEGORY::PEOPLE;
 }
 
-IMPL_LINK(SfxEmojiControl, ActivatePageHdl, weld::Button&, rButton, void)
+IMPL_LINK(SfxEmojiControl, ActivatePageHdl, weld::ToggleButton&, rButton, void)
 {
 mxPeopleBtn->set_active( == mxPeopleBtn.get());
 mxNatureBtn->set_active( == mxNatureBtn.get());
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-02-16 Thread Noel (via logerrit)
 sfx2/inc/preventduplicateinteraction.hxx |4 -
 sfx2/source/appl/appuno.cxx  |   10 ++--
 sfx2/source/control/bindings.cxx |4 -
 sfx2/source/control/statcach.cxx |2 
 sfx2/source/dialog/filedlghelper.cxx |2 
 sfx2/source/doc/DocumentMetadataAccess.cxx   |   58 +--
 sfx2/source/doc/docfile.cxx  |6 +-
 sfx2/source/doc/objmisc.cxx  |2 
 sfx2/source/doc/objserv.cxx  |4 -
 sfx2/source/doc/objstor.cxx  |3 -
 sfx2/source/doc/objxtor.cxx  |6 +-
 sfx2/source/doc/sfxbasemodel.cxx |4 -
 sfx2/source/sidebar/SidebarController.cxx|4 -
 sfx2/source/sidebar/SidebarDockingWindow.cxx |2 
 sfx2/source/view/classificationhelper.cxx|3 -
 sfx2/source/view/frame2.cxx  |2 
 sfx2/source/view/frmload.cxx |   12 ++---
 sfx2/source/view/ipclient.cxx|   12 ++---
 sfx2/source/view/viewfrm.cxx |3 -
 sfx2/source/view/viewsh.cxx  |2 
 20 files changed, 71 insertions(+), 74 deletions(-)

New commits:
commit 97fa8702c6f8325685bdfb46f6197b9739ebe327
Author: Noel 
AuthorDate: Tue Feb 16 12:56:09 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Feb 16 14:45:40 2021 +0100

loplugin:referencecasting in sfx2

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

diff --git a/sfx2/inc/preventduplicateinteraction.hxx 
b/sfx2/inc/preventduplicateinteraction.hxx
index edd503d0129e..970a93b159ef 100644
--- a/sfx2/inc/preventduplicateinteraction.hxx
+++ b/sfx2/inc/preventduplicateinteraction.hxx
@@ -127,7 +127,7 @@ public:
 : m_xDesktop(css::frame::Desktop::create(rContext), 
css::uno::UNO_QUERY_THROW)
 , m_xListener(new WarningDialogsParent)
 {
-m_xDesktop->addTerminateListener(m_xListener.get());
+m_xDesktop->addTerminateListener(m_xListener);
 }
 
 const css::uno::Reference& GetDialogParent() const
@@ -137,7 +137,7 @@ public:
 
 ~WarningDialogsParentScope()
 {
-m_xDesktop->removeTerminateListener(m_xListener.get());
+m_xDesktop->removeTerminateListener(m_xListener);
 }
 };
 
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index 559cadd8f534..413dd7d41736 100644
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
@@ -1735,7 +1735,7 @@ uno::Any SAL_CALL RequestFilterOptions::getRequest()
 uno::Sequence< uno::Reference< task::XInteractionContinuation > >
 SAL_CALL RequestFilterOptions::getContinuations()
 {
-return { m_xAbort.get(), m_xOptions.get() };
+return { m_xAbort, m_xOptions };
 }
 
 
@@ -1774,7 +1774,7 @@ uno::Any SAL_CALL 
RequestPackageReparation_Impl::getRequest()
 uno::Sequence< uno::Reference< task::XInteractionContinuation > >
 SAL_CALL RequestPackageReparation_Impl::getContinuations()
 {
-return { m_xApprove.get(), m_xDisapprove.get() };
+return { m_xApprove, m_xDisapprove };
 }
 
 RequestPackageReparation::RequestPackageReparation( const OUString& aName )
@@ -1793,7 +1793,7 @@ bool RequestPackageReparation::isApproved() const
 
 css::uno::Reference < task::XInteractionRequest > 
RequestPackageReparation::GetRequest()
 {
-return mxImpl.get();
+return mxImpl;
 }
 
 
@@ -1824,7 +1824,7 @@ uno::Any SAL_CALL NotifyBrokenPackage_Impl::getRequest()
 uno::Sequence< uno::Reference< task::XInteractionContinuation > >
 SAL_CALL NotifyBrokenPackage_Impl::getContinuations()
 {
-return { m_xAbort.get() };
+return { m_xAbort };
 }
 
 NotifyBrokenPackage::NotifyBrokenPackage( const OUString& aName )
@@ -1838,7 +1838,7 @@ NotifyBrokenPackage::~NotifyBrokenPackage()
 
 css::uno::Reference < task::XInteractionRequest > 
NotifyBrokenPackage::GetRequest()
 {
-return mxImpl.get();
+return mxImpl;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx
index 32021d47285c..6ac0bb9c59cc 100644
--- a/sfx2/source/control/bindings.cxx
+++ b/sfx2/source/control/bindings.cxx
@@ -1552,7 +1552,7 @@ SfxItemState SfxBindings::QueryState( sal_uInt16 nSlot, 
std::unique_ptr xBind(new BindDispatch_Impl( 
xDisp, aURL, pCache, pSlot ));
-xDisp->addStatusListener( xBind.get(), aURL );
+xDisp->addStatusListener( xBind, aURL );
 if ( !xBind->GetStatus().IsEnabled )
 {
 eState = SfxItemState::DISABLED;
@@ -1590,7 +1590,7 @@ SfxItemState SfxBindings::QueryState( sal_uInt16 nSlot, 
std::unique_ptrremoveStatusListener( xBind.get(), aURL );
+xDisp->removeStatusListener( xBind, aURL );
 xBind->Release();
 xBind.clear();
 if ( bDeleteCache )
diff 

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

2020-11-19 Thread Caolán McNamara (via logerrit)
 sfx2/inc/sidebar/ControllerFactory.hxx|1 
 sfx2/inc/sidebar/PanelTitleBar.hxx|7 +++-
 sfx2/source/sidebar/ControllerFactory.cxx |6 ++-
 sfx2/source/sidebar/PanelTitleBar.cxx |   50 --
 sfx2/source/sidebar/SidebarController.cxx |2 -
 sfx2/source/toolbox/weldutils.cxx |4 +-
 6 files changed, 40 insertions(+), 30 deletions(-)

New commits:
commit 60b568714eebcdfd53b3da5c23664909e64c42dc
Author: Caolán McNamara 
AuthorDate: Thu Nov 19 11:42:37 2020 +
Commit: Caolán McNamara 
CommitDate: Thu Nov 19 16:51:43 2020 +0100

tdf#138315 make More options buttons in Chart Sidebar deck work again

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

diff --git a/sfx2/inc/sidebar/ControllerFactory.hxx 
b/sfx2/inc/sidebar/ControllerFactory.hxx
index dbf609775a39..d33f00d2e8b6 100644
--- a/sfx2/inc/sidebar/ControllerFactory.hxx
+++ b/sfx2/inc/sidebar/ControllerFactory.hxx
@@ -54,6 +54,7 @@ public:
 weld::Builder& rBuilder,
 const OUString& rsCommandName,
 const css::uno::Reference& rxFrame,
+const css::uno::Reference& rxController,
 bool bSideBar);
 
 private:
diff --git a/sfx2/inc/sidebar/PanelTitleBar.hxx 
b/sfx2/inc/sidebar/PanelTitleBar.hxx
index 7be18d71f1fd..63b7a3b9e7af 100644
--- a/sfx2/inc/sidebar/PanelTitleBar.hxx
+++ b/sfx2/inc/sidebar/PanelTitleBar.hxx
@@ -19,6 +19,7 @@
 #pragma once
 
 #include 
+#include 
 
 namespace com::sun::star::frame { class XController; }
 namespace com::sun::star::frame { class XFrame; }
@@ -39,7 +40,8 @@ public:
 virtual OUString GetTitle() const override;
 
 void SetMoreOptionsCommand(const OUString& rsCommandName,
-   const css::uno::Reference& 
rxFrame);
+   const css::uno::Reference& 
rxFrame,
+   const 
css::uno::Reference& rxController);
 
 void UpdateExpandedState();
 
@@ -51,10 +53,11 @@ private:
 DECL_LINK(ExpandHdl, weld::Expander&, void);
 
 std::unique_ptr mxExpander;
+css::uno::Reference mxController;
 
 VclPtr mpPanel;
-static const sal_uInt16 mnMenuItemIndex = 1;
 css::uno::Reference mxFrame;
+OString msIdent;
 OUString msMoreOptionsCommand;
 };
 
diff --git a/sfx2/source/sidebar/ControllerFactory.cxx 
b/sfx2/source/sidebar/ControllerFactory.cxx
index 692ee10628d4..24bb15c3ec98 100644
--- a/sfx2/source/sidebar/ControllerFactory.cxx
+++ b/sfx2/source/sidebar/ControllerFactory.cxx
@@ -142,7 +142,9 @@ Reference 
ControllerFactory::CreateToolBoxController(
 Reference 
ControllerFactory::CreateToolBoxController(
 weld::Toolbar& rToolbar, weld::Builder& rBuilder,
 const OUString& rsCommandName,
-const Reference& rxFrame, bool bSideBar)
+const Reference& rxFrame,
+const Reference& rxController,
+bool bSideBar)
 {
 css::uno::Reference xWidget(new 
weld::TransportAsXWindow(, ));
 
@@ -150,7 +152,7 @@ Reference 
ControllerFactory::CreateToolBoxController(
 CreateToolBarController(
 xWidget,
 rsCommandName,
-rxFrame, rxFrame->getController(),
+rxFrame, rxController,
 -1, bSideBar));
 
 if (!xController.is())
diff --git a/sfx2/source/sidebar/PanelTitleBar.cxx 
b/sfx2/source/sidebar/PanelTitleBar.cxx
index 3cf1cff8fbb1..d1ce0ef700e0 100644
--- a/sfx2/source/sidebar/PanelTitleBar.cxx
+++ b/sfx2/source/sidebar/PanelTitleBar.cxx
@@ -44,6 +44,7 @@ PanelTitleBar::PanelTitleBar(const OUString& rsTitle,
   mxExpander(m_xBuilder->weld_expander("expander")),
   mpPanel(pPanel),
   mxFrame(),
+  msIdent("button"),
   msMoreOptionsCommand()
 {
 mxExpander->set_label(rsTitle);
@@ -80,49 +81,52 @@ PanelTitleBar::~PanelTitleBar()
 
 void PanelTitleBar::dispose()
 {
+Reference xComponent(mxController, UNO_QUERY);
+if (xComponent.is())
+xComponent->dispose();
+mxController.clear();
 mpPanel.clear();
 mxExpander.reset();
 TitleBar::dispose();
 }
 
 void PanelTitleBar::SetMoreOptionsCommand(const OUString& rsCommandName,
-  const 
css::uno::Reference& rxFrame)
+  const 
css::uno::Reference& rxFrame,
+  const 
css::uno::Reference& rxController)
 {
 if (rsCommandName == msMoreOptionsCommand)
 return;
 
-if (msMoreOptionsCommand.getLength() > 0)
-mxToolBox->set_item_visible("button", false);
+if (!msMoreOptionsCommand.isEmpty())
+mxToolBox->set_item_visible(msIdent, false);
 
 msMoreOptionsCommand = rsCommandName;
 mxFrame = rxFrame;
 
-if (msMoreOptionsCommand.getLength() <= 0)
+if (msMoreOptionsCommand.isEmpty())
 return;
 
-mxToolBox->set_item_visible("button", true);
-

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

2020-06-03 Thread Heiko Tietze (via logerrit)
 sfx2/inc/bitmaps.hlst  |   15 ---
 sfx2/source/control/recentdocsview.cxx |2 +-
 2 files changed, 9 insertions(+), 8 deletions(-)

New commits:
commit 997a504f33bbd43c02a96a2a593a03e58bd3b72c
Author: Heiko Tietze 
AuthorDate: Thu May 28 13:48:22 2020 +0200
Commit: Heiko Tietze 
CommitDate: Wed Jun 3 11:50:30 2020 +0200

Resolves tdf#130936 - Proper Icon Size for MIME type Icon in Start Center

Icons are now in 48px

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

diff --git a/sfx2/inc/bitmaps.hlst b/sfx2/inc/bitmaps.hlst
index 6ec00cd863de..7e97d1219996 100644
--- a/sfx2/inc/bitmaps.hlst
+++ b/sfx2/inc/bitmaps.hlst
@@ -67,13 +67,13 @@
 #define SFX_THUMBNAIL_SHEET "res/ots_96_8.png"
 #define SFX_THUMBNAIL_PRESENTATION  "res/otp_96_8.png"
 #define SFX_THUMBNAIL_DRAWING   "res/otg_96_8.png"
-#define SFX_FILE_THUMBNAIL_TEXT "res/writer128.png"
-#define SFX_FILE_THUMBNAIL_SHEET"res/calc128.png"
-#define SFX_FILE_THUMBNAIL_PRESENTATION "res/impress128.png"
-#define SFX_FILE_THUMBNAIL_DRAWING  "res/draw128.png"
-#define SFX_FILE_THUMBNAIL_DATABASE "res/base128.png"
-#define SFX_FILE_THUMBNAIL_MATH "res/math128.png"
-#define SFX_FILE_THUMBNAIL_DEFAULT  "res/main128.png"
+#define SFX_FILE_THUMBNAIL_TEXT "res/odt_48_8.png"
+#define SFX_FILE_THUMBNAIL_SHEET"res/ods_48_8.png"
+#define SFX_FILE_THUMBNAIL_PRESENTATION "res/odp_48_8.png"
+#define SFX_FILE_THUMBNAIL_DRAWING  "res/odg_48_8.png"
+#define SFX_FILE_THUMBNAIL_DATABASE "res/odb_48_8.png"
+#define SFX_FILE_THUMBNAIL_MATH "res/odf_48_8.png"
+#define SFX_FILE_THUMBNAIL_DEFAULT  "res/mainapp_48_8.png"
 
 #define BMP_RECENTDOC_REMOVE"res/recentdoc_remove.png"
 #define BMP_RECENTDOC_REMOVE_HIGHLIGHTED
"res/recentdoc_remove_highlighted.png"
@@ -88,6 +88,7 @@
 
 #define SFX_BMP_CLOSE_DOC   "sfx2/res/closedoc.png"
 
+
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/sfx2/source/control/recentdocsview.cxx 
b/sfx2/source/control/recentdocsview.cxx
index 468c03b8b632..a5aae89acb7c 100644
--- a/sfx2/source/control/recentdocsview.cxx
+++ b/sfx2/source/control/recentdocsview.cxx
@@ -266,7 +266,7 @@ void RecentDocsView::Reload()
 Size aSize(aThumbnail.GetSizePixel());
 m_pVirDev->SetOutputSizePixel(aSize);
 m_pVirDev->DrawBitmapEx(Point(), aThumbnail);
-m_pVirDev->DrawBitmapEx(Point(aSize.Width()-50,aSize.Height()-50), 
Size(40,40), aModule);
+m_pVirDev->DrawBitmapEx(Point(aSize.Width()-53,aSize.Height()-53), 
Size(48, 48), aModule);
 aThumbnail = m_pVirDev->GetBitmapEx(Point(), aSize);
 m_pVirDev.disposeAndClear();
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-05-01 Thread andreas kainz (via logerrit)
 sfx2/inc/doctempl.hrc|4 ++--
 sfx2/source/doc/doctemplates.cxx |4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit e5e64558322b0e6efc75c7fca1cbd0af40044153
Author: andreas kainz 
AuthorDate: Fri May 1 11:19:54 2020 +0200
Commit: andreas_kainz 
CommitDate: Fri May 1 21:28:52 2020 +0200

Template: update category list sort

Change-Id: I6e3b25d65fa0fa57c4bfdac38c3cb6f24aa78f01
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93246
Tested-by: Jenkins
Reviewed-by: andreas_kainz 

diff --git a/sfx2/inc/doctempl.hrc b/sfx2/inc/doctempl.hrc
index 23a199ef47ce..46773035e9b7 100644
--- a/sfx2/inc/doctempl.hrc
+++ b/sfx2/inc/doctempl.hrc
@@ -25,6 +25,7 @@
 const char* TEMPLATE_LONG_NAMES_ARY[] =
 {
 NC_("TEMPLATE_LONG_NAMES_ARY", "My Templates"),
+NC_("TEMPLATE_LONG_NAMES_ARY", "Styles"),
 NC_("TEMPLATE_LONG_NAMES_ARY", "Business Correspondence"),
 NC_("TEMPLATE_LONG_NAMES_ARY", "Other Business Documents"),
 NC_("TEMPLATE_LONG_NAMES_ARY", "Personal Correspondence and Documents"),
@@ -34,8 +35,7 @@ const char* TEMPLATE_LONG_NAMES_ARY[] =
 NC_("TEMPLATE_LONG_NAMES_ARY", "Presentation Backgrounds"),
 NC_("TEMPLATE_LONG_NAMES_ARY", "Presentations"),
 NC_("TEMPLATE_LONG_NAMES_ARY", "Miscellaneous"),
-NC_("TEMPLATE_LONG_NAMES_ARY", "Labels"),
-NC_("TEMPLATE_LONG_NAMES_ARY", "Styles")
+NC_("TEMPLATE_LONG_NAMES_ARY", "Labels")
 };
 
 #endif
diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index fb193080652e..966293d4de23 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -481,6 +481,7 @@ void SfxDocTplService_Impl::getDefaultLocale()
 const char* TEMPLATE_SHORT_NAMES_ARY[] =
 {
 "standard",
+"styles",
 "officorr",
 "offimisc",
 "personal",
@@ -490,8 +491,7 @@ const char* TEMPLATE_SHORT_NAMES_ARY[] =
 "layout",
 "presnt",
 "misc",
-"labels",
-"styles"
+"labels"
 };
 
 void SfxDocTplService_Impl::readFolderList()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sfx2/inc sfx2/source solenv/clang-format

2020-02-16 Thread Muhammet Kara (via logerrit)
 sfx2/inc/arrdecl.hxx|2 +-
 sfx2/inc/sfxbasecontroller_internal.hxx |1 -
 sfx2/source/doc/objstor.hxx |2 +-
 sfx2/source/doc/syspath.hxx |2 +-
 sfx2/source/doc/syspathw32.hxx  |2 +-
 sfx2/source/inc/itemdel.hxx |2 +-
 sfx2/source/inc/preview.hxx |3 ++-
 sfx2/source/inc/sfxpicklist.hxx |3 ++-
 sfx2/source/notebookbar/DropdownBox.hxx |2 +-
 sfx2/source/styles/StyleManager.cxx |1 -
 solenv/clang-format/blacklist   |   10 --
 11 files changed, 10 insertions(+), 20 deletions(-)

New commits:
commit 5c30117af73db865da11876c53de60bd613b2973
Author: Muhammet Kara 
AuthorDate: Sun Feb 16 15:41:27 2020 +0300
Commit: Muhammet Kara 
CommitDate: Sun Feb 16 15:14:16 2020 +0100

clang-format sfx2 with under 5-percent lines of change

Files which could become clang-format conformant with
under 5-percent lines of change relative to the total
count of lines in the file are found by using bin/find-clang-format.py,
and fixed with /opt/lo/bin/clang-format -i 

There will be follow-up patches to fix all 'under-5-percent' files.

Change-Id: I6b2e99a6485031e33c781be896e9426fffd08edf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88779
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 

diff --git a/sfx2/inc/arrdecl.hxx b/sfx2/inc/arrdecl.hxx
index 67387e0f071e..b777fad7aa48 100644
--- a/sfx2/inc/arrdecl.hxx
+++ b/sfx2/inc/arrdecl.hxx
@@ -23,7 +23,7 @@
 #include 
 
 class SfxFilter;
-typedef ::std::vector< std::shared_ptr > SfxFilterList_Impl;
+typedef ::std::vector> SfxFilterList_Impl;
 
 #endif
 
diff --git a/sfx2/inc/sfxbasecontroller_internal.hxx 
b/sfx2/inc/sfxbasecontroller_internal.hxx
index 2f593414154d..0de26d5e98ad 100644
--- a/sfx2/inc/sfxbasecontroller_internal.hxx
+++ b/sfx2/inc/sfxbasecontroller_internal.hxx
@@ -14,7 +14,6 @@
 
 extern sal_uInt32 Get10ThSec();
 
-
 #endif // INCLUDED_SFX2_INC_SFXBASECONTROLLER_INTERNAL_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/doc/objstor.hxx b/sfx2/source/doc/objstor.hxx
index d4b8683682ef..4692dbf71f7a 100644
--- a/sfx2/source/doc/objstor.hxx
+++ b/sfx2/source/doc/objstor.hxx
@@ -22,7 +22,7 @@
 
 #include 
 
-void impl_addToModelCollection(const css::uno::Reference< css::frame::XModel 
>& xModel);
+void impl_addToModelCollection(const css::uno::Reference& 
xModel);
 
 #endif // INCLUDED_SFX2_SOURCE_DOC_OBJSTOR_HXX
 
diff --git a/sfx2/source/doc/syspath.hxx b/sfx2/source/doc/syspath.hxx
index 7837b03e20b0..9c135993cb63 100644
--- a/sfx2/source/doc/syspath.hxx
+++ b/sfx2/source/doc/syspath.hxx
@@ -24,7 +24,7 @@
 
 namespace SystemPath
 {
-bool GetUserTemplateLocation(sal_Unicode*, int nSize);
+bool GetUserTemplateLocation(sal_Unicode*, int nSize);
 };
 
 #endif
diff --git a/sfx2/source/doc/syspathw32.hxx b/sfx2/source/doc/syspathw32.hxx
index 5707a80cec00..7a06950c5f01 100644
--- a/sfx2/source/doc/syspathw32.hxx
+++ b/sfx2/source/doc/syspathw32.hxx
@@ -25,7 +25,7 @@
 #include 
 
 #if defined _WIN32
-bool GetUserTemplateLocation(sal_Unicode *, int nSize);
+bool GetUserTemplateLocation(sal_Unicode*, int nSize);
 #endif
 
 #endif
diff --git a/sfx2/source/inc/itemdel.hxx b/sfx2/source/inc/itemdel.hxx
index 1884c83c38cc..b8ea325010e4 100644
--- a/sfx2/source/inc/itemdel.hxx
+++ b/sfx2/source/inc/itemdel.hxx
@@ -23,7 +23,7 @@
 
 class SfxPoolItem;
 
-void DeleteItemOnIdle( std::unique_ptr pItem );
+void DeleteItemOnIdle(std::unique_ptr pItem);
 
 #endif
 
diff --git a/sfx2/source/inc/preview.hxx b/sfx2/source/inc/preview.hxx
index 89dfa55b0e73..b3065831982b 100644
--- a/sfx2/source/inc/preview.hxx
+++ b/sfx2/source/inc/preview.hxx
@@ -29,9 +29,10 @@ class SfxPreviewWin_Impl : public 
weld::CustomWidgetController
 private:
 virtual void Paint(vcl::RenderContext& rRenderContext, const 
tools::Rectangle&) override;
 std::shared_ptr xMetaFile;
+
 public:
 SfxPreviewWin_Impl();
-voidSetObjectShell( SfxObjectShell const * pObj );
+void SetObjectShell(SfxObjectShell const* pObj);
 static void ImpPaint(vcl::RenderContext& rRenderContext, GDIMetaFile* 
pFile);
 };
 
diff --git a/sfx2/source/inc/sfxpicklist.hxx b/sfx2/source/inc/sfxpicklist.hxx
index 6a6e818a613b..b8af2310d467 100644
--- a/sfx2/source/inc/sfxpicklist.hxx
+++ b/sfx2/source/inc/sfxpicklist.hxx
@@ -22,7 +22,7 @@
 
 #include 
 
-#define PICKLIST_MAXSIZE  100
+#define PICKLIST_MAXSIZE 100
 
 class SfxApplication;
 class SfxPickListImpl;
@@ -31,6 +31,7 @@ class SfxPickList
 {
 private:
 std::unique_ptr mxImpl;
+
 public:
 SfxPickList(SfxApplication& rApp);
 ~SfxPickList();
diff --git a/sfx2/source/notebookbar/DropdownBox.hxx 
b/sfx2/source/notebookbar/DropdownBox.hxx
index d66d798d8d14..769cd2e42fae 100644
--- a/sfx2/source/notebookbar/DropdownBox.hxx
+++ b/sfx2/source/notebookbar/DropdownBox.hxx
@@ -32,7 +32,7 @@ private:
 VclPtr 

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

2019-10-30 Thread Caolán McNamara (via logerrit)
 sfx2/inc/guisaveas.hxx|4 ++--
 sfx2/source/doc/guisaveas.cxx |   30 +++---
 sfx2/source/view/ipclient.cxx |3 +--
 sfx2/source/view/viewprn.cxx  |3 +--
 4 files changed, 15 insertions(+), 25 deletions(-)

New commits:
commit d465d5b1cc962f56534d685fe8af5f26083fb7ba
Author: Caolán McNamara 
AuthorDate: Wed Oct 30 09:40:23 2019 +
Commit: Caolán McNamara 
CommitDate: Wed Oct 30 16:58:19 2019 +0100

can avoid intermediate vcl::Window use

Change-Id: I51d1a84fdf7a8c7d204691d52dec10db051c3b00
Reviewed-on: https://gerrit.libreoffice.org/81745
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sfx2/inc/guisaveas.hxx b/sfx2/inc/guisaveas.hxx
index ac9df75aea61..5e7355709680 100644
--- a/sfx2/inc/guisaveas.hxx
+++ b/sfx2/inc/guisaveas.hxx
@@ -37,7 +37,7 @@ namespace com { namespace sun { namespace star {
 }
 } } }
 
-namespace vcl { class Window; }
+namespace weld { class Window; }
 class ModelData_Impl;
 
 class SfxStoringHelper
@@ -79,7 +79,7 @@ public:
 bool rDefaultIsAlien );
 
 static css::uno::Reference GetModelXWindow(const 
css::uno::Reference& rModel);
-static vcl::Window* GetModelWindow( const css::uno::Reference< 
css::frame::XModel >& xModel );
+static weld::Window* GetModelWindow( const css::uno::Reference< 
css::frame::XModel >& xModel );
 
 };
 
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 573ee808d474..6a9012f63c1f 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -650,8 +650,7 @@ sal_Int8 ModelData_Impl::CheckSaveAcceptable( sal_Int8 
nCurStatus )
   && GetMediaDescr().find( OUString("VersionComment") ) == 
GetMediaDescr().end() )
 {
 // notify the user that SaveAs is going to be done
-vcl::Window* pWin = SfxStoringHelper::GetModelWindow(m_xModel);
-std::unique_ptr 
xMessageBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : 
nullptr,
+std::unique_ptr 
xMessageBox(Application::CreateMessageDialog(SfxStoringHelper::GetModelWindow(m_xModel),
  
VclMessageType::Question, VclButtonsType::OkCancel, 
SfxResId(STR_NEW_FILENAME_SAVE)));
 if (xMessageBox->run() == RET_OK)
 nResult = STATUS_SAVEAS;
@@ -848,8 +847,7 @@ bool ModelData_Impl::OutputFileDialog( sal_Int16 nStoreMode,
 
 SfxFilterFlags nMust = getMustFlags( nStoreMode );
 SfxFilterFlags nDont = getDontFlags( nStoreMode );
-vcl::Window* pWin = SfxStoringHelper::GetModelWindow( m_xModel );
-weld::Window* pFrameWin = pWin ? pWin->GetFrameWeld() : nullptr;
+weld::Window* pFrameWin = SfxStoringHelper::GetModelWindow(m_xModel);
 if ( ( nStoreMode & EXPORT_REQUESTED ) && !( nStoreMode & 
WIDEEXPORT_REQUESTED ) )
 {
 if ( ( nStoreMode & PDFEXPORT_REQUESTED ) && 
!aPreselectedFilterPropsHM.empty() )
@@ -1390,8 +1388,7 @@ bool SfxStoringHelper::GUIStoreModel( const 
uno::Reference< frame::XModel >& xMo
|| SignatureState::NOTVALIDATED == nDocumentSignatureState
|| SignatureState::PARTIAL_OK == nDocumentSignatureState)
 {
-vcl::Window* pWin = SfxStoringHelper::GetModelWindow( xModel );
-std::unique_ptr 
xMessageBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : 
nullptr,
+std::unique_ptr 
xMessageBox(Application::CreateMessageDialog(SfxStoringHelper::GetModelWindow(xModel),
  
VclMessageType::Question, VclButtonsType::YesNo, 
SfxResId(RID_SVXSTR_XMLSEC_QUERY_LOSINGSIGNATURE)));
 if (xMessageBox->run() != RET_YES)
 {
@@ -1796,8 +1793,8 @@ bool SfxStoringHelper::WarnUnacceptableFormat( const 
uno::Reference< frame::XMod
 if ( !SvtSaveOptions().IsWarnAlienFormat() )
 return true;
 
-vcl::Window* pWin = SfxStoringHelper::GetModelWindow( xModel );
-SfxAlienWarningDialog aDlg(pWin ? pWin->GetFrameWeld() : nullptr, 
aOldUIName, aDefExtension, bDefIsAlien);
+weld::Window* pWin = SfxStoringHelper::GetModelWindow(xModel);
+SfxAlienWarningDialog aDlg(pWin, aOldUIName, aDefExtension, bDefIsAlien);
 
 return aDlg.run() == RET_OK;
 }
@@ -1825,20 +1822,15 @@ uno::Reference 
SfxStoringHelper::GetModelXWindow(const uno::Refere
 return uno::Reference();
 }
 
-vcl::Window* SfxStoringHelper::GetModelWindow( const uno::Reference< 
frame::XModel >& xModel )
+weld::Window* SfxStoringHelper::GetModelWindow( const uno::Reference< 
frame::XModel >& xModel )
 {
-VclPtr pWin;
+weld::Window* pWin = nullptr;
 
-try {
-uno::Reference xWindow = GetModelXWindow(xModel);
-if ( xWindow.is() )
-{
-VCLXWindow* pVCLWindow = 
comphelper::getUnoTunnelImplementation( xWindow );
-if ( pVCLWindow )
-  

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

2019-06-18 Thread Muhammet Kara (via logerrit)
 sfx2/inc/autoredactdialog.hxx|   12 
 sfx2/source/doc/autoredactdialog.cxx |   25 -
 sfx2/source/doc/objserv.cxx  |2 +-
 3 files changed, 13 insertions(+), 26 deletions(-)

New commits:
commit 881e6fdd47386e430ad4c5489e3a6bbf0b46c85f
Author: Muhammet Kara 
AuthorDate: Tue Jun 18 21:04:26 2019 +0300
Commit: Muhammet Kara 
CommitDate: Tue Jun 18 21:59:35 2019 +0200

Copy targets instead of moving during redaction

To allow properly remembering the last state.

* And some clean-up.

Change-Id: Id0b0f4251e3578b8baced1e6e6b1161f46e324dc
Reviewed-on: https://gerrit.libreoffice.org/74302
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 

diff --git a/sfx2/inc/autoredactdialog.hxx b/sfx2/inc/autoredactdialog.hxx
index 9734f236de10..f7cdecc15cce 100644
--- a/sfx2/inc/autoredactdialog.hxx
+++ b/sfx2/inc/autoredactdialog.hxx
@@ -106,6 +106,7 @@ class SFX2_DLLPUBLIC SfxAutoRedactDialog : public 
SfxDialogController
 std::vector> m_aTableTargets;
 std::unique_ptr m_pFileDlg;
 bool m_bIsValidState;
+bool m_bTargetsCopied;
 
 std::unique_ptr m_xRedactionTargetsLabel;
 std::unique_ptr m_xTargetsBox;
@@ -138,16 +139,11 @@ public:
 bool hasTargets() const;
 /// Check if the dialog is in a valid state.
 bool isValidState() const { return m_bIsValidState; }
-/** Literally moves targets into the given vector.
- *  At the end of the operation, m_aTableTargets vector becomes empty.
- *  The contents of the given vector will be erased before being filled in.
+/** Copies targets vector
+ *  Does a shallow copy.
  *  Returns true if successful.
  */
-bool moveTargets(std::vector>& 
r_aTargets);
-
-// TODO: Some method(s) to check emptiness/validity
-// TODO: Some method(s) to get the search params/objects
-// TODO: Some method(s) to load/save redaction target sets
+bool getTargets(std::vector>& 
r_aTargets);
 };
 
 class SfxAddTargetDialog : public weld::GenericDialogController
diff --git a/sfx2/source/doc/autoredactdialog.cxx 
b/sfx2/source/doc/autoredactdialog.cxx
index 950684ac4d1c..54f40fc35abd 100644
--- a/sfx2/source/doc/autoredactdialog.cxx
+++ b/sfx2/source/doc/autoredactdialog.cxx
@@ -545,6 +545,7 @@ void SfxAutoRedactDialog::clearTargets()
 SfxAutoRedactDialog::SfxAutoRedactDialog(weld::Window* pParent)
 : SfxDialogController(pParent, "sfx/ui/autoredactdialog.ui", 
"AutoRedactDialog")
 , m_bIsValidState(true)
+, m_bTargetsCopied(false)
 , m_xRedactionTargetsLabel(m_xBuilder->weld_label("labelRedactionTargets"))
 , m_xTargetsBox(new TargetsTable(m_xBuilder->weld_tree_view("targets")))
 , m_xLoadBtn(m_xBuilder->weld_button("btnLoadTargets"))
@@ -636,7 +637,8 @@ SfxAutoRedactDialog::~SfxAutoRedactDialog()
OStringToOUString(m_xDialog->get_help_id(), 
RTL_TEXTENCODING_UTF8));
 aDlgOpt.SetUserItem("UserItem", css::uno::makeAny(sUserDataStr));
 
-clearTargets();
+if (!m_bTargetsCopied)
+clearTargets();
 }
 catch (css::uno::Exception& e)
 {
@@ -656,24 +658,13 @@ bool SfxAutoRedactDialog::hasTargets() const
 return true;
 }
 
-bool SfxAutoRedactDialog::moveTargets(
-std::vector>& r_aTargets)
+bool SfxAutoRedactDialog::getTargets(std::vector>& r_aTargets)
 {
-try
-{
-r_aTargets.clear();
-r_aTargets.insert(r_aTargets.end(), 
std::make_move_iterator(m_aTableTargets.begin()),
-  std::make_move_iterator(m_aTableTargets.end()));
-m_aTableTargets.clear();
-m_bIsValidState = false;
-}
-catch (const css::uno::Exception& e)
-{
-SAL_WARN("sfx.doc", "Exception caught while moving redaction targets: 
" << e.Message);
-m_bIsValidState = false;
-return false;
-}
+if (m_aTableTargets.empty())
+return true;
 
+r_aTargets = m_aTableTargets;
+m_bTargetsCopied = true;
 return true;
 }
 
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 24eee80787f8..74edeb4d57da 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -561,7 +561,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest )
 
 // else continue with normal redaction
 bIsAutoRedact = true;
-aDlg.moveTargets(aRedactionTargets);
+aDlg.getTargets(aRedactionTargets);
 
 [[fallthrough]];
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-06-15 Thread Muhammet Kara (via logerrit)
 sfx2/inc/SfxRedactionHelper.hxx|   14 +
 sfx2/inc/autoredactdialog.hxx  |7 ++
 sfx2/source/doc/SfxRedactionHelper.cxx |   17 +-
 sfx2/source/doc/autoredactdialog.cxx   |   89 +++--
 sfx2/uiconfig/ui/addtargetdialog.ui|   52 +--
 5 files changed, 167 insertions(+), 12 deletions(-)

New commits:
commit b61a1ca837223ba9d7da1aa8936f228d89bde60a
Author: Muhammet Kara 
AuthorDate: Sat Jun 15 12:08:35 2019 +0300
Commit: Muhammet Kara 
CommitDate: Sun Jun 16 01:26:32 2019 +0200

Add predefined targets to auto redaction

Change-Id: Ib8cf8b50944667d6a87a5cafb6995ad195699358
Reviewed-on: https://gerrit.libreoffice.org/74092
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 

diff --git a/sfx2/inc/SfxRedactionHelper.hxx b/sfx2/inc/SfxRedactionHelper.hxx
index 2f470386d2dc..ae72c39f4886 100644
--- a/sfx2/inc/SfxRedactionHelper.hxx
+++ b/sfx2/inc/SfxRedactionHelper.hxx
@@ -120,6 +120,20 @@ public:
 /// Fill the search options based on the given redaction target
 static void fillSearchOptions(i18nutil::SearchOptions2& rSearchOpt,
   const RedactionTarget* pTarget);
+
+private:
+static constexpr OUStringLiteral m_aPredefinedTargets[6] = {
+"\\b(?:\\d[ -]*?){13,16}\\b", //Credit card numbers
+"\\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,}\\b", //Email addresses
+
"\\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)"
+
"\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)"
+"\\b", //IP addresses
+"([12]\\d{3}[./-](0[1-9]|1[0-2])[./"
+
"-](0[1-9]|[12]\\d|3[01]))|((0[1-9]|[12]\\d|3[01])[./-](0[1-9]|1[0-2])[./"
+"-][12]\\d{3})", //Dates (numerical)
+"\\s*[a-zA-Z]{2}(?:\\s*\\d\\s*){6}[a-zA-Z]?\\s*", //National Insurance 
Number (UK)
+"([1-9])(?!\\1{2}-\\1{2}-\\1{4})[1-9]{2}-[1-9]{2}-[1-9]{4}" //Social 
Security Number (US)
+};
 };
 
 #endif // INCLUDED_CUI_SOURCE_INC_SFXREDACTIONHELPER_HXX
diff --git a/sfx2/inc/autoredactdialog.hxx b/sfx2/inc/autoredactdialog.hxx
index 3b6b45c99032..bb633b9a9bb1 100644
--- a/sfx2/inc/autoredactdialog.hxx
+++ b/sfx2/inc/autoredactdialog.hxx
@@ -155,10 +155,15 @@ class SfxAddTargetDialog : public 
weld::GenericDialogController
 private:
 std::unique_ptr m_xName;
 std::unique_ptr m_xType;
+std::unique_ptr m_xLabelContent;
 std::unique_ptr m_xContent;
+std::unique_ptr m_xLabelPredefContent;
+std::unique_ptr m_xPredefContent;
 std::unique_ptr m_xCaseSensitive;
 std::unique_ptr m_xWholeWords;
 
+DECL_LINK(SelectTypeHdl, weld::ComboBox&, void);
+
 public:
 SfxAddTargetDialog(weld::Window* pWindow, const OUString& rName);
 SfxAddTargetDialog(weld::Window* pWindow, const OUString& sName,
@@ -167,7 +172,7 @@ public:
 
 OUString getName() const { return m_xName->get_text(); }
 RedactionTargetType getType() const;
-OUString getContent() const { return m_xContent->get_text(); }
+OUString getContent() const;
 bool isCaseSensitive() const
 {
 return m_xCaseSensitive->get_state() == TriState::TRISTATE_TRUE;
diff --git a/sfx2/source/doc/SfxRedactionHelper.cxx 
b/sfx2/source/doc/SfxRedactionHelper.cxx
index b6c3264d769a..efd06b14fccd 100644
--- a/sfx2/source/doc/SfxRedactionHelper.cxx
+++ b/sfx2/source/doc/SfxRedactionHelper.cxx
@@ -533,7 +533,8 @@ void 
SfxRedactionHelper::fillSearchOptions(i18nutil::SearchOptions2& rSearchOpt,
 return;
 }
 
-if (pTarget->sType == RedactionTargetType::REDACTION_TARGET_REGEX)
+if (pTarget->sType == RedactionTargetType::REDACTION_TARGET_REGEX
+|| pTarget->sType == RedactionTargetType::REDACTION_TARGET_PREDEFINED)
 {
 rSearchOpt.algorithmType = util::SearchAlgorithms_REGEXP;
 rSearchOpt.AlgorithmType2 = util::SearchAlgorithms2::REGEXP;
@@ -545,10 +546,20 @@ void 
SfxRedactionHelper::fillSearchOptions(i18nutil::SearchOptions2& rSearchOpt,
 }
 
 rSearchOpt.Locale = GetAppLanguageTag().getLocale();
-rSearchOpt.searchString = pTarget->sContent;
+if (pTarget->sType == RedactionTargetType::REDACTION_TARGET_PREDEFINED)
+{
+sal_Int32 nPredefIndex = pTarget->sContent.getToken(0, ';').toInt32();
+//sal_Int32 nPredefIndex = sContent.toInt32();
+
+rSearchOpt.searchString = m_aPredefinedTargets[nPredefIndex];
+}
+else
+rSearchOpt.searchString = pTarget->sContent;
+
 rSearchOpt.replaceString.clear();
 
-if (!pTarget->bCaseSensitive && pTarget->sType != 
RedactionTargetType::REDACTION_TARGET_REGEX)
+if (!pTarget->bCaseSensitive && pTarget->sType != 
RedactionTargetType::REDACTION_TARGET_REGEX
+&& pTarget->sType != RedactionTargetType::REDACTION_TARGET_PREDEFINED)
 rSearchOpt.transliterateFlags |= TransliterationFlags::IGNORE_CASE;
 if (pTarget->bWholeWords)
 rSearchOpt.searchFlag |= 

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

2019-06-14 Thread Muhammet Kara (via logerrit)
 sfx2/inc/SfxRedactionHelper.hxx|   11 +++
 sfx2/source/doc/SfxRedactionHelper.cxx |   92 ++---
 2 files changed, 85 insertions(+), 18 deletions(-)

New commits:
commit f8a325eff30b40fdd3f76d82d10b5eed8659afd2
Author: Muhammet Kara 
AuthorDate: Thu Jun 13 18:32:27 2019 +0300
Commit: Muhammet Kara 
CommitDate: Fri Jun 14 20:14:44 2019 +0200

Use utl::TextSearch in the auto redaction process

* Add support for:
  * Case sensitive and insensitive text search
  * Regex search (always case sensitive) regarless of the choice
  * Multiple occurences of the same target on a single TEXTARRAY

Change-Id: I580059f77286e8c4226cafdd1eb9472f8e1a9a9d
Reviewed-on: https://gerrit.libreoffice.org/74049
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 

diff --git a/sfx2/inc/SfxRedactionHelper.hxx b/sfx2/inc/SfxRedactionHelper.hxx
index 9be54ca8ac22..2f470386d2dc 100644
--- a/sfx2/inc/SfxRedactionHelper.hxx
+++ b/sfx2/inc/SfxRedactionHelper.hxx
@@ -33,6 +33,11 @@ class DocumentToGraphicRenderer;
 class SfxViewFrame;
 struct RedactionTarget;
 
+namespace i18nutil
+{
+struct SearchOptions2;
+}
+
 struct PageMargins
 {
 // Page margins in mm100th
@@ -92,7 +97,7 @@ public:
  * */
 static PageMargins 
getPageMarginsForCalc(css::uno::Reference& xModel);
 
-static void searchInMetaFile(const OUString& sSearchTerm, const 
GDIMetaFile& rMtf,
+static void searchInMetaFile(const RedactionTarget* pRedactionTarget, 
const GDIMetaFile& rMtf,
  std::vector& 
aRedactionRectangles,
  uno::Reference& xComponent);
 
@@ -111,6 +116,10 @@ public:
const GDIMetaFile& rGDIMetaFile,
uno::Reference& xPage,
uno::Reference& xComponent);
+
+/// Fill the search options based on the given redaction target
+static void fillSearchOptions(i18nutil::SearchOptions2& rSearchOpt,
+  const RedactionTarget* pTarget);
 };
 
 #endif // INCLUDED_CUI_SOURCE_INC_SFXREDACTIONHELPER_HXX
diff --git a/sfx2/source/doc/SfxRedactionHelper.cxx 
b/sfx2/source/doc/SfxRedactionHelper.cxx
index 413cf3b0a84d..244c5ababd26 100644
--- a/sfx2/source/doc/SfxRedactionHelper.cxx
+++ b/sfx2/source/doc/SfxRedactionHelper.cxx
@@ -24,6 +24,18 @@
 #include 
 #include 
 
+// Search util
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
 #include 
 #include 
 #include 
@@ -116,7 +128,7 @@ void setPageMargins(uno::Reference& 
xPageProperySet,
 
 // #i10613# Extracted from ImplCheckRect::ImplCreate
 tools::Rectangle ImplCalcActionBounds(const MetaAction& rAct, const 
OutputDevice& rOut,
-  const OUString& sSubString, const 
sal_Int32& nStrPos)
+  const sal_Int32& nStrStartPos, const 
sal_Int32& nStrEndPos)
 {
 tools::Rectangle aActionBounds;
 
@@ -131,17 +143,16 @@ tools::Rectangle ImplCalcActionBounds(const MetaAction& 
rAct, const OutputDevice
 {
 // #105987# ImplLayout takes everything in logical coordinates
 std::unique_ptr pSalLayout1 = rOut.ImplLayout(
-aString, 0, nStrPos, rTextAct.GetPoint(), 0, 
rTextAct.GetDXArray());
-std::unique_ptr pSalLayout2
-= rOut.ImplLayout(aString, 0, nStrPos + 
sSubString.getLength(),
-  rTextAct.GetPoint(), 0, 
rTextAct.GetDXArray());
+aString, 0, nStrStartPos, rTextAct.GetPoint(), 0, 
rTextAct.GetDXArray());
+std::unique_ptr pSalLayout2 = rOut.ImplLayout(
+aString, 0, nStrEndPos, rTextAct.GetPoint(), 0, 
rTextAct.GetDXArray());
 if (pSalLayout2)
 {
 tools::Rectangle aBoundRect2(
 
const_cast(rOut).ImplGetTextBoundRect(*pSalLayout2));
 aActionBounds = rOut.PixelToLogic(aBoundRect2);
 }
-if (pSalLayout1 && nStrPos > 0)
+if (pSalLayout1 && nStrStartPos > 0)
 {
 tools::Rectangle aBoundRect1(
 
const_cast(rOut).ImplGetTextBoundRect(*pSalLayout1));
@@ -409,10 +420,17 @@ 
SfxRedactionHelper::getPageMarginsForCalc(css::uno::Reference& 
aRedactionRectangles,
   uno::Reference& 
xComponent)
 {
+// Initialize search
+i18nutil::SearchOptions2 aSearchOptions;
+fillSearchOptions(aSearchOptions, pRedactionTarget);
+
+utl::TextSearch textSearch(aSearchOptions);
+
 MetaAction* pCurrAct;
 
 // Watch for TEXTARRAY actions.
@@ -424,22 +442,28 @@ void SfxRedactionHelper::searchInMetaFile(const 
rtl::OUString& sSearchTerm, cons
 {
 MetaTextArrayAction* pMetaTextArrayAction 

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

2019-06-12 Thread Muhammet Kara (via logerrit)
 sfx2/inc/SfxRedactionHelper.hxx|   14 +-
 sfx2/inc/autoredactdialog.hxx  |   13 ++---
 sfx2/source/doc/SfxRedactionHelper.cxx |   29 +
 sfx2/source/doc/autoredactdialog.cxx   |   22 ++
 sfx2/source/doc/objserv.cxx|   12 
 5 files changed, 70 insertions(+), 20 deletions(-)

New commits:
commit b26489a8a30f2c3e299ef45f17ef4fc64102a0c7
Author: Muhammet Kara 
AuthorDate: Wed Jun 12 21:21:26 2019 +0300
Commit: Muhammet Kara 
CommitDate: Thu Jun 13 07:35:20 2019 +0200

Auto redaction dialog 6th iteration

* Binds everything together.
* The auto redaction process works end to end now.
* Only for case sensitive text content (no regex support yet)

Change-Id: I6edd67472d376e2c0d91ac4b1ff90d98c49b13ac
Reviewed-on: https://gerrit.libreoffice.org/73908
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 

diff --git a/sfx2/inc/SfxRedactionHelper.hxx b/sfx2/inc/SfxRedactionHelper.hxx
index 44a78ab9b877..9be54ca8ac22 100644
--- a/sfx2/inc/SfxRedactionHelper.hxx
+++ b/sfx2/inc/SfxRedactionHelper.hxx
@@ -31,6 +31,7 @@ class SfxStringItem;
 class GDIMetaFile;
 class DocumentToGraphicRenderer;
 class SfxViewFrame;
+struct RedactionTarget;
 
 struct PageMargins
 {
@@ -66,10 +67,12 @@ public:
  * Creates one shape and one draw page for each gdimetafile,
  * and inserts the shapes into the newly created draw pages.
  * */
-static void addPagesToDraw(uno::Reference& xComponent, const 
sal_Int32& nPages,
-   const std::vector& aMetaFiles,
-   const std::vector<::Size>& aPageSizes,
-   const PageMargins& aPageMargins);
+static void
+addPagesToDraw(uno::Reference& xComponent, const sal_Int32& 
nPages,
+   const std::vector& aMetaFiles,
+   const std::vector<::Size>& aPageSizes, const PageMargins& 
aPageMargins,
+   const std::vector>& 
r_aTableTargets,
+   const bool& bIsAutoRedact);
 /*
  * Makes the Redaction toolbar visible to the user.
  * Meant to be called after converting a document to a Draw doc
@@ -104,7 +107,8 @@ public:
  * Search for the given term through the gdimetafile, which has the whole 
content of a draw page,
  * and draw redaction rectangles to the appropriate positions with 
suitable sizes.
  * */
-static void autoRedactPage(const OUString& sRedactionTerm, const 
GDIMetaFile& rGDIMetaFile,
+static void autoRedactPage(const RedactionTarget* pRedactionTarget,
+   const GDIMetaFile& rGDIMetaFile,
uno::Reference& xPage,
uno::Reference& xComponent);
 };
diff --git a/sfx2/inc/autoredactdialog.hxx b/sfx2/inc/autoredactdialog.hxx
index 2336d66c4063..bab00cf536a3 100644
--- a/sfx2/inc/autoredactdialog.hxx
+++ b/sfx2/inc/autoredactdialog.hxx
@@ -105,6 +105,7 @@ class SFX2_DLLPUBLIC SfxAutoRedactDialog : public 
SfxDialogController
 SfxObjectShellLock m_xDocShell;
 std::vector> m_aTableTargets;
 std::unique_ptr m_pFileDlg;
+bool m_bIsValidState;
 
 std::unique_ptr m_xRedactionTargetsLabel;
 std::unique_ptr m_xTargetsBox;
@@ -133,10 +134,16 @@ public:
 SfxAutoRedactDialog(weld::Window* pParent);
 virtual ~SfxAutoRedactDialog() override;
 
-/*
- * Check if the dialog has any valid redaction targets.
- */
+/// Check if the dialog has any valid redaction targets.
 bool hasTargets() const;
+/// Check if the dialog is in a valid state.
+bool isValidState() const { return m_bIsValidState; }
+/** Literally moves targets into the given vector.
+ *  At the end of the operation, m_aTableTargets vector becomes empty.
+ *  The contents of the given vector will be erased before being filled in.
+ *  Returns true if successfull.
+ */
+bool moveTargets(std::vector>& 
r_aTargets);
 
 // TODO: Some method(s) to check emptiness/validity
 // TODO: Some method(s) to get the search params/objects
diff --git a/sfx2/source/doc/SfxRedactionHelper.cxx 
b/sfx2/source/doc/SfxRedactionHelper.cxx
index 427972047c02..413cf3b0a84d 100644
--- a/sfx2/source/doc/SfxRedactionHelper.cxx
+++ b/sfx2/source/doc/SfxRedactionHelper.cxx
@@ -8,6 +8,7 @@
  */
 
 #include 
+#include 
 
 #include 
 #include 
@@ -206,11 +207,12 @@ void 
SfxRedactionHelper::getPageMetaFilesFromDoc(std::vector& aMeta
 }
 }
 
-void SfxRedactionHelper::addPagesToDraw(uno::Reference& xComponent,
-const sal_Int32& nPages,
-const std::vector& 
aMetaFiles,
-const std::vector<::Size>& aPageSizes,
-const PageMargins& aPageMargins)
+void SfxRedactionHelper::addPagesToDraw(
+uno::Reference& 

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

2019-06-11 Thread Muhammet Kara (via logerrit)
 sfx2/inc/autoredactdialog.hxx|4 +
 sfx2/source/doc/autoredactdialog.cxx |   97 ---
 2 files changed, 95 insertions(+), 6 deletions(-)

New commits:
commit 7b82727f0286d8ea2ee4d962750105022d839ead
Author: Muhammet Kara 
AuthorDate: Tue Jun 11 15:20:55 2019 +0300
Commit: Muhammet Kara 
CommitDate: Tue Jun 11 21:18:32 2019 +0200

Auto redaction dialog 5th iteration

* Add the Load handler, and the related bits

* The dialog can be considered fully functional now,
  as all buttons are working.

* Next is to handle its output in the redaction phase.

Change-Id: Idd558e13b50f82a95f5f6e226bc855257837b351
Reviewed-on: https://gerrit.libreoffice.org/73822
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 

diff --git a/sfx2/inc/autoredactdialog.hxx b/sfx2/inc/autoredactdialog.hxx
index 99c956246d69..2336d66c4063 100644
--- a/sfx2/inc/autoredactdialog.hxx
+++ b/sfx2/inc/autoredactdialog.hxx
@@ -124,6 +124,10 @@ class SFX2_DLLPUBLIC SfxAutoRedactDialog : public 
SfxDialogController
 DECL_LINK(SaveHdl, sfx2::FileDialogHelper*, void);
 
 void StartFileDialog(StartFileDialogType nType, const OUString& rTitle);
+/// Carry out proper addition both to the targets box, and to the 
tabletargets vector.
+void addTarget(RedactionTarget* pTarget);
+/// Clear all targets both visually and from the targets vector
+void clearTargets();
 
 public:
 SfxAutoRedactDialog(weld::Window* pParent);
diff --git a/sfx2/source/doc/autoredactdialog.cxx 
b/sfx2/source/doc/autoredactdialog.cxx
index a294f1cd2601..e9b94d724c9d 100644
--- a/sfx2/source/doc/autoredactdialog.cxx
+++ b/sfx2/source/doc/autoredactdialog.cxx
@@ -185,7 +185,6 @@ void TargetsTable::setRowData(const int& nRowIndex, const 
RedactionTarget* pTarg
 
 IMPL_LINK_NOARG(SfxAutoRedactDialog, Load, weld::Button&, void)
 {
-//TODO: Implement
 //Load a targets list from a previously saved file (a json file?)
 // ask for filename, where we should load the new config data from
 StartFileDialog(StartFileDialogType::Open, "Load Targets");
@@ -193,7 +192,6 @@ IMPL_LINK_NOARG(SfxAutoRedactDialog, Load, weld::Button&, 
void)
 
 IMPL_LINK_NOARG(SfxAutoRedactDialog, Save, weld::Button&, void)
 {
-//TODO: Implement
 //Allow saving the targets into a file
 StartFileDialog(StartFileDialogType::SaveAs, "Save Targets");
 }
@@ -365,15 +363,70 @@ boost::property_tree::ptree 
redactionTargetToJSON(RedactionTarget* pTarget)
 
 return aNode;
 }
+
+RedactionTarget* JSONtoRedactionTarget(const 
boost::property_tree::ptree::value_type& rValue)
+{
+OUString sName = 
OUString::fromUtf8(rValue.second.get("sName").c_str());
+RedactionTargetType eType
+= 
static_cast(atoi(rValue.second.get("sName").c_str()));
+OUString sContent = 
OUString::fromUtf8(rValue.second.get("sContent").c_str());
+bool bCaseSensitive
+= 
OUString::fromUtf8(rValue.second.get("bCaseSensitive").c_str()).toBoolean();
+bool bWholeWords
+= 
OUString::fromUtf8(rValue.second.get("bWholeWords").c_str()).toBoolean();
+sal_uInt32 nID = atoi(rValue.second.get("nID").c_str());
+
+RedactionTarget* pTarget
+= new RedactionTarget({ sName, eType, sContent, bCaseSensitive, 
bWholeWords, nID });
+
+return pTarget;
+}
 }
 
 IMPL_LINK_NOARG(SfxAutoRedactDialog, LoadHdl, sfx2::FileDialogHelper*, void)
 {
-//TODO: Implement
-bool bDummy = hasTargets();
+assert(m_pFileDlg);
+
+OUString sTargetsFile;
+if (ERRCODE_NONE == m_pFileDlg->GetError())
+sTargetsFile = m_pFileDlg->GetPath();
+
+if (sTargetsFile.isEmpty())
+return;
 
-if (bDummy)
-void();
+OUString sSysPath;
+osl::File::getSystemPathFromFileURL(sTargetsFile, sSysPath);
+sTargetsFile = sSysPath;
+
+weld::WaitObject aWaitObject(getDialog());
+
+try
+{
+// Create path string, and read JSON from file
+std::string sPathStr(OUStringToOString(sTargetsFile, 
RTL_TEXTENCODING_UTF8).getStr());
+
+boost::property_tree::ptree aTargetsJSON;
+
+boost::property_tree::read_json(sPathStr, aTargetsJSON);
+
+// Clear the dialog
+clearTargets();
+
+// Recreate & add the targets to the dialog
+for (const boost::property_tree::ptree::value_type& rValue :
+ aTargetsJSON.get_child("RedactionTargets"))
+{
+RedactionTarget* pTarget = JSONtoRedactionTarget(rValue);
+addTarget(pTarget);
+}
+}
+catch (css::uno::Exception& e)
+{
+SAL_WARN("sfx.doc",
+ "Exception caught while trying to load the targets JSON from 
file: " << e.Message);
+return;
+//TODO: Warn the user with a message box
+}
 }
 
 IMPL_LINK_NOARG(SfxAutoRedactDialog, SaveHdl, sfx2::FileDialogHelper*, void)
@@ -441,6 +494,38 @@ void 
SfxAutoRedactDialog::StartFileDialog(StartFileDialogType nType, const 

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

2019-06-10 Thread Muhammet Kara (via logerrit)
 sfx2/inc/autoredactdialog.hxx|   21 -
 sfx2/source/doc/autoredactdialog.cxx |  142 +--
 2 files changed, 138 insertions(+), 25 deletions(-)

New commits:
commit d5bdb4a84e741bb60f1cc9557b7a2eb590ba8a44
Author: Muhammet Kara 
AuthorDate: Sat Jun 8 23:27:56 2019 +0300
Commit: Muhammet Kara 
CommitDate: Mon Jun 10 21:58:57 2019 +0200

Auto redaction dialog 4th iteration

* Add the Save & SaveHdl handlers
* Add stubs for Load & LoadHdl handlers

Change-Id: I5f58213c86e99f8bfc9075e04eedbb5cb546d9ad
Reviewed-on: https://gerrit.libreoffice.org/73724
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 

diff --git a/sfx2/inc/autoredactdialog.hxx b/sfx2/inc/autoredactdialog.hxx
index 267427c90b21..99c956246d69 100644
--- a/sfx2/inc/autoredactdialog.hxx
+++ b/sfx2/inc/autoredactdialog.hxx
@@ -89,10 +89,22 @@ public:
 //void connect_row_activated(const Link& rLink) { 
m_xControl->connect_row_activated(rLink); }
 };
 
+namespace sfx2
+{
+class FileDialogHelper;
+}
+
+enum class StartFileDialogType
+{
+Open,
+SaveAs
+};
+
 class SFX2_DLLPUBLIC SfxAutoRedactDialog : public SfxDialogController
 {
 SfxObjectShellLock m_xDocShell;
 std::vector> m_aTableTargets;
+std::unique_ptr m_pFileDlg;
 
 std::unique_ptr m_xRedactionTargetsLabel;
 std::unique_ptr m_xTargetsBox;
@@ -102,12 +114,17 @@ class SFX2_DLLPUBLIC SfxAutoRedactDialog : public 
SfxDialogController
 std::unique_ptr m_xEditBtn;
 std::unique_ptr m_xDeleteBtn;
 
-/*DECL_LINK(LoadHdl, weld::Button&, void);
-DECL_LINK(SaveHdl, weld::Button&, void);*/
+DECL_LINK(Load, weld::Button&, void);
+DECL_LINK(Save, weld::Button&, void);
 DECL_LINK(AddHdl, weld::Button&, void);
 DECL_LINK(EditHdl, weld::Button&, void);
 DECL_LINK(DeleteHdl, weld::Button&, void);
 
+DECL_LINK(LoadHdl, sfx2::FileDialogHelper*, void);
+DECL_LINK(SaveHdl, sfx2::FileDialogHelper*, void);
+
+void StartFileDialog(StartFileDialogType nType, const OUString& rTitle);
+
 public:
 SfxAutoRedactDialog(weld::Window* pParent);
 virtual ~SfxAutoRedactDialog() override;
diff --git a/sfx2/source/doc/autoredactdialog.cxx 
b/sfx2/source/doc/autoredactdialog.cxx
index ee7f09a1d269..a294f1cd2601 100644
--- a/sfx2/source/doc/autoredactdialog.cxx
+++ b/sfx2/source/doc/autoredactdialog.cxx
@@ -7,31 +7,34 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#include 
 #include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
 
-#include 
-#include 
+#include 
 #include 
+#include 
+#include 
 #include 
 #include 
-#include 
-#include 
-#include 
-#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
-#include 
+#include 
+
+#include 
 
 int TargetsTable::GetRowByTargetName(const OUString& sName)
 {
@@ -180,17 +183,20 @@ void TargetsTable::setRowData(const int& nRowIndex, const 
RedactionTarget* pTarg
 m_xControl->set_text(nRowIndex, pTarget->bWholeWords ? OUString("Yes") : 
OUString("No"), 4);
 }
 
-/*IMPL_LINK_NOARG(SfxAutoRedactDialog, LoadHdl, weld::Button&, void)
+IMPL_LINK_NOARG(SfxAutoRedactDialog, Load, weld::Button&, void)
 {
 //TODO: Implement
-//Load a targets list from a previously saved file (a json file in the 
user profile dir?)
+//Load a targets list from a previously saved file (a json file?)
+// ask for filename, where we should load the new config data from
+StartFileDialog(StartFileDialogType::Open, "Load Targets");
 }
 
-IMPL_LINK_NOARG(SfxAutoRedactDialog, SaveHdl, weld::Button&, void)
+IMPL_LINK_NOARG(SfxAutoRedactDialog, Save, weld::Button&, void)
 {
 //TODO: Implement
 //Allow saving the targets into a file
-}*/
+StartFileDialog(StartFileDialogType::SaveAs, "Save Targets");
+}
 
 IMPL_LINK_NOARG(SfxAutoRedactDialog, AddHdl, weld::Button&, void)
 {
@@ -345,6 +351,96 @@ IMPL_LINK_NOARG(SfxAutoRedactDialog, DeleteHdl, 
weld::Button&, void)
 }
 }
 
+namespace
+{
+boost::property_tree::ptree redactionTargetToJSON(RedactionTarget* pTarget)
+{
+boost::property_tree::ptree aNode;
+aNode.put("sName", pTarget->sName.toUtf8().getStr());
+aNode.put("eType", pTarget->sType);
+aNode.put("sContent", pTarget->sContent.toUtf8().getStr());
+aNode.put("bWholeWords", pTarget->bWholeWords);
+aNode.put("bCaseSensitive", pTarget->bCaseSensitive);
+aNode.put("nID", pTarget->nID);
+
+return aNode;
+}
+}
+
+IMPL_LINK_NOARG(SfxAutoRedactDialog, LoadHdl, sfx2::FileDialogHelper*, void)
+{
+//TODO: Implement
+bool bDummy = hasTargets();
+
+if (bDummy)
+void();
+}
+
+IMPL_LINK_NOARG(SfxAutoRedactDialog, SaveHdl, sfx2::FileDialogHelper*, void)
+{
+assert(m_pFileDlg);
+
+OUString sTargetsFile;
+if (ERRCODE_NONE == m_pFileDlg->GetError())
+sTargetsFile = 

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

2019-06-08 Thread Muhammet Kara (via logerrit)
 sfx2/inc/autoredactdialog.hxx|8 +-
 sfx2/source/doc/autoredactdialog.cxx |  131 +--
 2 files changed, 133 insertions(+), 6 deletions(-)

New commits:
commit 670130039c5b100acabe08bc2077980c5c63f82f
Author: Muhammet Kara 
AuthorDate: Sat Jun 8 16:37:04 2019 +0300
Commit: Muhammet Kara 
CommitDate: Sat Jun 8 19:34:49 2019 +0200

Auto redaction dialog 3rd iteration

* Add the Edit handler

Change-Id: Id900d2aab6fa6795455012aaf2bcaf755ccca139
Reviewed-on: https://gerrit.libreoffice.org/73705
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 

diff --git a/sfx2/inc/autoredactdialog.hxx b/sfx2/inc/autoredactdialog.hxx
index 26b29bf10cf5..267427c90b21 100644
--- a/sfx2/inc/autoredactdialog.hxx
+++ b/sfx2/inc/autoredactdialog.hxx
@@ -82,6 +82,9 @@ public:
 void select(int nRow) { m_xControl->select(nRow); }
 OUString get_id(int nRow) const { return m_xControl->get_id(nRow); }
 
+// Sync data on the targets box with the data on the target
+void setRowData(const int& nRowIndex, const RedactionTarget* pTarget);
+
 //void connect_changed(const Link& rLink) { 
m_xControl->connect_changed(rLink); }
 //void connect_row_activated(const Link& rLink) { 
m_xControl->connect_row_activated(rLink); }
 };
@@ -102,7 +105,7 @@ class SFX2_DLLPUBLIC SfxAutoRedactDialog : public 
SfxDialogController
 /*DECL_LINK(LoadHdl, weld::Button&, void);
 DECL_LINK(SaveHdl, weld::Button&, void);*/
 DECL_LINK(AddHdl, weld::Button&, void);
-//DECL_LINK(EditHdl, weld::Button&, void);
+DECL_LINK(EditHdl, weld::Button&, void);
 DECL_LINK(DeleteHdl, weld::Button&, void);
 
 public:
@@ -130,6 +133,9 @@ private:
 
 public:
 SfxAddTargetDialog(weld::Window* pWindow, const OUString& rName);
+SfxAddTargetDialog(weld::Window* pWindow, const OUString& sName,
+   const RedactionTargetType& eTargetType, const OUString& 
sContent,
+   const bool& bCaseSensitive, const bool& bWholeWords);
 
 OUString getName() const { return m_xName->get_text(); }
 RedactionTargetType getType() const;
diff --git a/sfx2/source/doc/autoredactdialog.cxx 
b/sfx2/source/doc/autoredactdialog.cxx
index 30977b82e878..2849f525e0e2 100644
--- a/sfx2/source/doc/autoredactdialog.cxx
+++ b/sfx2/source/doc/autoredactdialog.cxx
@@ -85,6 +85,30 @@ OUString getTypeName(RedactionTargetType nType)
 
 return sTypeName;
 }
+
+/// Returns TypeID to be used in the add/edit target dialog
+OUString getTypeID(RedactionTargetType nType)
+{
+OUString sTypeID("unknown");
+
+switch (nType)
+{
+case RedactionTargetType::REDACTION_TARGET_TEXT:
+sTypeID = "text";
+break;
+case RedactionTargetType::REDACTION_TARGET_REGEX:
+sTypeID = "regex";
+break;
+case RedactionTargetType::REDACTION_TARGET_PREDEFINED:
+sTypeID = "predefined";
+break;
+case RedactionTargetType::REDACTION_TARGET_UNKNOWN:
+sTypeID = "unknown";
+break;
+}
+
+return sTypeID;
+}
 }
 
 void TargetsTable::InsertTarget(RedactionTarget* pTarget)
@@ -147,6 +171,15 @@ OUString TargetsTable::GetNameProposal()
 return sDefaultTargetName + " " + OUString::number(nHighestTargetId + 1);
 }
 
+void TargetsTable::setRowData(const int& nRowIndex, const RedactionTarget* 
pTarget)
+{
+m_xControl->set_text(nRowIndex, pTarget->sName, 0);
+m_xControl->set_text(nRowIndex, getTypeName(pTarget->sType), 1);
+m_xControl->set_text(nRowIndex, pTarget->sContent, 2);
+m_xControl->set_text(nRowIndex, pTarget->bCaseSensitive ? OUString("Yes") 
: OUString("No"), 3);
+m_xControl->set_text(nRowIndex, pTarget->bWholeWords ? OUString("Yes") : 
OUString("No"), 4);
+}
+
 /*IMPL_LINK_NOARG(SfxAutoRedactDialog, LoadHdl, weld::Button&, void)
 {
 //TODO: Implement
@@ -214,11 +247,75 @@ IMPL_LINK_NOARG(SfxAutoRedactDialog, AddHdl, 
weld::Button&, void)
 }
 }
 
-/*IMPL_LINK_NOARG(SfxAutoRedactDialog, EditHdl, weld::Button&, void)
+IMPL_LINK_NOARG(SfxAutoRedactDialog, EditHdl, weld::Button&, void)
 {
-//TODO: Implement
-//Reuse the Add Target dialog
-}*/
+sal_Int32 nSelectedRow = m_xTargetsBox->get_selected_index();
+
+// No selection, nothing to edit
+if (nSelectedRow < 0)
+return;
+
+// Only one entry should be selected for editing
+if (m_xTargetsBox->get_selected_rows().size() > 1)
+{
+OUString sMsg(
+"You have selected multiple targets, but only one target can be 
edited at once.");
+//Warn the user about multiple selections
+std::unique_ptr 
xBox(Application::CreateMessageDialog(
+getDialog(), VclMessageType::Error, VclButtonsType::Ok, sMsg));
+xBox->run();
+return;
+}
+
+// Get the redaction target to be edited
+RedactionTarget* pTarget
+= 

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

2019-05-13 Thread Muhammet Kara (via logerrit)
 sfx2/inc/SfxRedactionHelper.hxx|   20 
 sfx2/source/doc/SfxRedactionHelper.cxx |  148 +
 2 files changed, 168 insertions(+)

New commits:
commit 57667603c52e7d6bb82f5040151c8b7defcc6f8a
Author: Muhammet Kara 
AuthorDate: Fri Mar 1 21:56:31 2019 +0300
Commit: Muhammet Kara 
CommitDate: Mon May 13 12:48:38 2019 +0200

Auto-redact - First stab

Add a SfxRedactionHelper::autoRedactPage method which searches for the 
given term
through the gdimetafile which has the whole content of an xPage (a Draw 
page),
and draws redaction rectangles at proper positions with proper sizes.

The search is case sensitive, and finds only the first occurences on a line.
Will switch to a proper search provider via a follow-up patch.

Change-Id: If3db62e50994670143785b6727fdcf1ccd4c6f8e
Reviewed-on: https://gerrit.libreoffice.org/68597
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 

diff --git a/sfx2/inc/SfxRedactionHelper.hxx b/sfx2/inc/SfxRedactionHelper.hxx
index ac15bb790fe9..44a78ab9b877 100644
--- a/sfx2/inc/SfxRedactionHelper.hxx
+++ b/sfx2/inc/SfxRedactionHelper.hxx
@@ -14,6 +14,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -87,6 +88,25 @@ public:
  * pages inserted into Draw for redaction.
  * */
 static PageMargins 
getPageMarginsForCalc(css::uno::Reference& xModel);
+
+static void searchInMetaFile(const OUString& sSearchTerm, const 
GDIMetaFile& rMtf,
+ std::vector& 
aRedactionRectangles,
+ uno::Reference& xComponent);
+
+/*
+ * Draws a redaction rectangle on the draw page referenced with its page 
number (0-based)
+ * */
+static void addRedactionRectToPage(uno::Reference& xComponent,
+   uno::Reference& 
xPage,
+   const std::vector& 
aNewRectangles);
+
+/*
+ * Search for the given term through the gdimetafile, which has the whole 
content of a draw page,
+ * and draw redaction rectangles to the appropriate positions with 
suitable sizes.
+ * */
+static void autoRedactPage(const OUString& sRedactionTerm, const 
GDIMetaFile& rGDIMetaFile,
+   uno::Reference& xPage,
+   uno::Reference& xComponent);
 };
 
 #endif // INCLUDED_CUI_SOURCE_INC_SFXREDACTIONHELPER_HXX
diff --git a/sfx2/source/doc/SfxRedactionHelper.cxx 
b/sfx2/source/doc/SfxRedactionHelper.cxx
index 4f1c01da4907..59203b6467ec 100644
--- a/sfx2/source/doc/SfxRedactionHelper.cxx
+++ b/sfx2/source/doc/SfxRedactionHelper.cxx
@@ -10,6 +10,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -31,12 +32,17 @@
 
 #include 
 
+#include 
+
 #include 
 #include 
 #include 
 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::lang;
@@ -105,8 +111,66 @@ void setPageMargins(uno::Reference& 
xPageProperySet,
 xPageProperySet->setPropertyValue("BorderLeft", 
css::uno::makeAny(aPageMargins.nLeft));
 xPageProperySet->setPropertyValue("BorderRight", 
css::uno::makeAny(aPageMargins.nRight));
 }
+
+// #i10613# Extracted from ImplCheckRect::ImplCreate
+tools::Rectangle ImplCalcActionBounds(const MetaAction& rAct, const 
OutputDevice& rOut,
+  const OUString& sSubString, const 
sal_Int32& nStrPos)
+{
+tools::Rectangle aActionBounds;
+
+switch (rAct.GetType())
+{
+case MetaActionType::TEXTARRAY:
+{
+const MetaTextArrayAction& rTextAct = static_cast(rAct);
+const OUString 
aString(rTextAct.GetText().copy(rTextAct.GetIndex(), rTextAct.GetLen()));
+
+if (!aString.isEmpty())
+{
+// #105987# ImplLayout takes everything in logical coordinates
+std::unique_ptr pSalLayout1 = rOut.ImplLayout(
+aString, 0, nStrPos, rTextAct.GetPoint(), 0, 
rTextAct.GetDXArray());
+std::unique_ptr pSalLayout2
+= rOut.ImplLayout(aString, 0, nStrPos + 
sSubString.getLength(),
+  rTextAct.GetPoint(), 0, 
rTextAct.GetDXArray());
+if (pSalLayout2)
+{
+tools::Rectangle aBoundRect2(
+
const_cast(rOut).ImplGetTextBoundRect(*pSalLayout2));
+aActionBounds = rOut.PixelToLogic(aBoundRect2);
+}
+if (pSalLayout1 && nStrPos > 0)
+{
+tools::Rectangle aBoundRect1(
+
const_cast(rOut).ImplGetTextBoundRect(*pSalLayout1));
+aActionBounds.SetLeft(rOut.PixelToLogic(aBoundRect1).getX()
+  + 
rOut.PixelToLogic(aBoundRect1).getWidth());
+}
+
+// FIXME: Is 

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

2019-05-10 Thread Sumit Chauhan (via logerrit)
 sfx2/inc/bitmaps.hlst  |1 +
 sfx2/source/notebookbar/PriorityMergedHBox.cxx |5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 96dd1cd36c2f9446d3455a06b5f77a3954950c03
Author: Sumit Chauhan 
AuthorDate: Fri May 10 14:08:10 2019 +0530
Commit: Szymon Kłos 
CommitDate: Fri May 10 12:06:09 2019 +0200

tdf#116629 added chevron icon for noteboookbar hide button

To test the patch , cherry pick this icon-patch first
https://gerrit.libreoffice.org/#/c/72082/

Change-Id: I706aee5695a2e275095832070382a9def4d89611
Reviewed-on: https://gerrit.libreoffice.org/72107
Reviewed-by: Szymon Kłos 
Tested-by: Szymon Kłos 

diff --git a/sfx2/inc/bitmaps.hlst b/sfx2/inc/bitmaps.hlst
index c420ba89bd78..654a41df125c 100644
--- a/sfx2/inc/bitmaps.hlst
+++ b/sfx2/inc/bitmaps.hlst
@@ -32,6 +32,7 @@
 #define BMP_HELP_TOOLBOX_L_SEARCHDIALOG "res/lc05961.png"
 
 //start, sfx2/source/sidebar/Theme.cxx
+#define CHEVRON "sfx2/res/chevron.png"
 #define CLOSEDOC"sfx2/res/closedoc.png"
 #define GRIP"sfx2/res/grip.png"
 #define OPEN_MORE   "sfx2/res/symphony/open_more.png"
diff --git a/sfx2/source/notebookbar/PriorityMergedHBox.cxx 
b/sfx2/source/notebookbar/PriorityMergedHBox.cxx
index e52c467b6c23..4e7fa0c16d2a 100644
--- a/sfx2/source/notebookbar/PriorityMergedHBox.cxx
+++ b/sfx2/source/notebookbar/PriorityMergedHBox.cxx
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 #include "OptionalBox.hxx"
 #include "PriorityHBox.hxx"
 #include "NotebookbarPopup.hxx"
@@ -43,8 +44,8 @@ public:
 {
 m_pButton = VclPtr::Create(this, WB_FLATBUTTON);
 m_pButton->SetClickHdl(LINK(this, PriorityMergedHBox, PBClickHdl));
-m_pButton->SetSymbol(SymbolType::NEXT);
-m_pButton->set_width_request(15);
+m_pButton->SetModeImage(Image(StockImage::Yes, CHEVRON));
+m_pButton->set_width_request(25);
 m_pButton->set_pack_type(VclPackType::End);
 m_pButton->Show();
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-05-08 Thread Muhammet Kara (via logerrit)
 sfx2/inc/SfxRedactionHelper.hxx|   26 +
 sfx2/source/doc/SfxRedactionHelper.cxx |  152 -
 sfx2/source/doc/objserv.cxx|9 +
 3 files changed, 182 insertions(+), 5 deletions(-)

New commits:
commit 141e33bc1d56f7b7af5037988eeb5ca36864a511
Author: Muhammet Kara 
AuthorDate: Tue May 7 22:03:25 2019 +0300
Commit: Muhammet Kara 
CommitDate: Wed May 8 13:25:29 2019 +0200

Respect page margins of the source doc during redaction

Change-Id: Ieaa50a2eba17145180ddd5d2bfc77add4801c43a
Reviewed-on: https://gerrit.libreoffice.org/71929
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 

diff --git a/sfx2/inc/SfxRedactionHelper.hxx b/sfx2/inc/SfxRedactionHelper.hxx
index 8b1bdd57e247..ac15bb790fe9 100644
--- a/sfx2/inc/SfxRedactionHelper.hxx
+++ b/sfx2/inc/SfxRedactionHelper.hxx
@@ -12,6 +12,8 @@
 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 #include 
@@ -29,6 +31,15 @@ class GDIMetaFile;
 class DocumentToGraphicRenderer;
 class SfxViewFrame;
 
+struct PageMargins
+{
+// Page margins in mm100th
+sal_Int32 nTop;
+sal_Int32 nBottom;
+sal_Int32 nLeft;
+sal_Int32 nRight;
+};
+
 /*
  * Mostly a bunch of static methods to handle the redaction functionality at
  * different points of the process.
@@ -56,13 +67,26 @@ public:
  * */
 static void addPagesToDraw(uno::Reference& xComponent, const 
sal_Int32& nPages,
const std::vector& aMetaFiles,
-   const std::vector<::Size>& aPageSizes);
+   const std::vector<::Size>& aPageSizes,
+   const PageMargins& aPageMargins);
 /*
  * Makes the Redaction toolbar visible to the user.
  * Meant to be called after converting a document to a Draw doc
  * for redaction purposes.
  * */
 static void showRedactionToolbar(SfxViewFrame* pViewFrame);
+
+/*
+ * Used to get the page margins from the original/source Writer document. 
Then we apply these values to the
+ * pages inserted into Draw for redaction.
+ * */
+static PageMargins 
getPageMarginsForWriter(css::uno::Reference& xModel);
+
+/*
+ * Used to get the page margins from the original/source Calc document. 
Then we apply these values to the
+ * pages inserted into Draw for redaction.
+ * */
+static PageMargins 
getPageMarginsForCalc(css::uno::Reference& xModel);
 };
 
 #endif // INCLUDED_CUI_SOURCE_INC_SFXREDACTIONHELPER_HXX
diff --git a/sfx2/source/doc/SfxRedactionHelper.cxx 
b/sfx2/source/doc/SfxRedactionHelper.cxx
index b63340c4913f..8f0b2ca5d1c0 100644
--- a/sfx2/source/doc/SfxRedactionHelper.cxx
+++ b/sfx2/source/doc/SfxRedactionHelper.cxx
@@ -11,10 +11,17 @@
 
 #include 
 #include 
-#include 
 #include 
 #include 
 
+// For page margin related methods
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
 #include 
 #include 
 #include 
@@ -66,6 +73,12 @@ OUString SfxRedactionHelper::getStringParam(const 
SfxRequest& rReq, const sal_uI
 
 namespace
 {
+/*
+ * Roundtrip the gdimetafile to and from WMF
+ * to get rid of the position and size irregularities
+ * We better check the conversion method to see what it
+ * actually does to correct these issues, and do it ourselves.
+ * */
 void fixMetaFile(GDIMetaFile& tmpMtf)
 {
 SvMemoryStream aDestStrm(65535, 65535);
@@ -76,6 +89,22 @@ void fixMetaFile(GDIMetaFile& tmpMtf)
 
 ReadWindowMetafile(aDestStrm, tmpMtf);
 }
+
+/*
+ * Sets page margins for a Draw page. Negative values are considered erronous.
+ * */
+void setPageMargins(uno::Reference& xPageProperySet,
+const PageMargins& aPageMargins)
+{
+if (aPageMargins.nTop < 0 || aPageMargins.nBottom < 0 || 
aPageMargins.nLeft < 0
+|| aPageMargins.nRight < 0)
+return;
+
+xPageProperySet->setPropertyValue("BorderTop", 
css::uno::makeAny(aPageMargins.nTop));
+xPageProperySet->setPropertyValue("BorderBottom", 
css::uno::makeAny(aPageMargins.nBottom));
+xPageProperySet->setPropertyValue("BorderLeft", 
css::uno::makeAny(aPageMargins.nLeft));
+xPageProperySet->setPropertyValue("BorderRight", 
css::uno::makeAny(aPageMargins.nRight));
+}
 }
 
 void SfxRedactionHelper::getPageMetaFilesFromDoc(std::vector& 
aMetaFiles,
@@ -115,7 +144,8 @@ void 
SfxRedactionHelper::getPageMetaFilesFromDoc(std::vector& aMeta
 void SfxRedactionHelper::addPagesToDraw(uno::Reference& xComponent,
 const sal_Int32& nPages,
 const std::vector& 
aMetaFiles,
-const std::vector<::Size>& aPageSizes)
+const std::vector<::Size>& aPageSizes,
+const PageMargins& aPageMargins)
 {
 // Access the draw pages
 uno::Reference xDrawPagesSupplier(xComponent, 
uno::UNO_QUERY);
@@ -134,11 +164,13 @@ void 

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

2019-05-06 Thread Muhammet Kara (via logerrit)
 sfx2/inc/SfxRedactionHelper.hxx|5 +--
 sfx2/source/doc/SfxRedactionHelper.cxx |   50 +++--
 sfx2/source/doc/objserv.cxx|7 +---
 3 files changed, 27 insertions(+), 35 deletions(-)

New commits:
commit 2ff22c0bf4c23c4bed9ccfcfa79dff848086650d
Author: Muhammet Kara 
AuthorDate: Fri May 3 22:07:59 2019 +0300
Commit: Muhammet Kara 
CommitDate: Mon May 6 16:49:16 2019 +0200

tdf#125135: Standardize content placement for redaction

Correct the position & size by roundtrip conversion
from/to wmf as a temporary solution.

Simplify a bit.

Change-Id: I59f32bd29750f9ac759800893583308f29b8aad5
Reviewed-on: https://gerrit.libreoffice.org/71860
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 

diff --git a/sfx2/inc/SfxRedactionHelper.hxx b/sfx2/inc/SfxRedactionHelper.hxx
index 1cd653650557..8b1bdd57e247 100644
--- a/sfx2/inc/SfxRedactionHelper.hxx
+++ b/sfx2/inc/SfxRedactionHelper.hxx
@@ -49,15 +49,14 @@ public:
  * */
 static void getPageMetaFilesFromDoc(std::vector& aMetaFiles,
 std::vector<::Size>& aPageSizes, const 
sal_Int32& nPages,
-DocumentToGraphicRenderer& aRenderer, 
bool bIsWriter,
-bool bIsCalc);
+DocumentToGraphicRenderer& aRenderer);
 /*
  * Creates one shape and one draw page for each gdimetafile,
  * and inserts the shapes into the newly created draw pages.
  * */
 static void addPagesToDraw(uno::Reference& xComponent, const 
sal_Int32& nPages,
const std::vector& aMetaFiles,
-   const std::vector<::Size>& aPageSizes, bool 
bIsCalc);
+   const std::vector<::Size>& aPageSizes);
 /*
  * Makes the Redaction toolbar visible to the user.
  * Meant to be called after converting a document to a Draw doc
diff --git a/sfx2/source/doc/SfxRedactionHelper.cxx 
b/sfx2/source/doc/SfxRedactionHelper.cxx
index 67cdfa77c22f..b63340c4913f 100644
--- a/sfx2/source/doc/SfxRedactionHelper.cxx
+++ b/sfx2/source/doc/SfxRedactionHelper.cxx
@@ -28,6 +28,9 @@
 #include 
 #include 
 
+#include 
+#include 
+
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::lang;
 using namespace ::com::sun::star::uno;
@@ -61,11 +64,24 @@ OUString SfxRedactionHelper::getStringParam(const 
SfxRequest& rReq, const sal_uI
 return sStringParam;
 }
 
+namespace
+{
+void fixMetaFile(GDIMetaFile& tmpMtf)
+{
+SvMemoryStream aDestStrm(65535, 65535);
+ConvertGDIMetaFileToWMF(tmpMtf, aDestStrm, nullptr, false);
+aDestStrm.Seek(0);
+
+tmpMtf.Clear();
+
+ReadWindowMetafile(aDestStrm, tmpMtf);
+}
+}
+
 void SfxRedactionHelper::getPageMetaFilesFromDoc(std::vector& 
aMetaFiles,
  std::vector<::Size>& 
aPageSizes,
  const sal_Int32& nPages,
- DocumentToGraphicRenderer& 
aRenderer,
- bool bIsWriter, bool bIsCalc)
+ DocumentToGraphicRenderer& 
aRenderer)
 {
 for (sal_Int32 nPage = 1; nPage <= nPages; ++nPage)
 {
@@ -75,12 +91,10 @@ void 
SfxRedactionHelper::getPageMetaFilesFromDoc(std::vector& aMeta
 ::Size aCalcPageContentSize;
 ::Size aLogic = aRenderer.getDocumentSizeIn100mm(nPage, , 
,
  
);
-// FIXME: This is a temporary hack. Need to figure out a proper way to 
derive this scale factor.
-::Size aTargetSize(aDocumentSizePixel.Width() * 1.23, 
aDocumentSizePixel.Height() * 1.23);
 
 aPageSizes.push_back(aLogic);
 
-Graphic aGraphic = aRenderer.renderToGraphic(nPage, 
aDocumentSizePixel, aTargetSize,
+Graphic aGraphic = aRenderer.renderToGraphic(nPage, 
aDocumentSizePixel, aDocumentSizePixel,
  COL_TRANSPARENT, true);
 auto& rGDIMetaFile = 
const_cast(aGraphic.GetGDIMetaFile());
 
@@ -88,24 +102,11 @@ void 
SfxRedactionHelper::getPageMetaFilesFromDoc(std::vector& aMeta
 // will be correct in MM.
 MapMode aMapMode;
 aMapMode.SetMapUnit(MapUnit::Map100thMM);
-// FIXME: This is a temporary hack. Need to figure out a proper way to 
derive these magic numbers.
-if (bIsWriter)
-aMapMode.SetOrigin(::Point(-(aLogicPos.getX() - 512) * 1.53,
-   -((aLogicPos.getY() - 501) * 1.53 + 
(nPage - 1) * 740)));
-else if (bIsCalc)
-rGDIMetaFile.Scale(0.566, 0.566);
 
 rGDIMetaFile.SetPrefMapMode(aMapMode);
+rGDIMetaFile.SetPrefSize(aLogic);
 
-if (bIsCalc)
-{
-double aWidthRatio = 

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

2019-05-02 Thread Muhammet Kara (via logerrit)
 sfx2/inc/SfxRedactionHelper.hxx|6 --
 sfx2/source/doc/SfxRedactionHelper.cxx |   10 +++---
 sfx2/source/doc/objserv.cxx|5 +++--
 3 files changed, 14 insertions(+), 7 deletions(-)

New commits:
commit b743d446d8cccabcf3d002da652da0a8854ad883
Author: Muhammet Kara 
AuthorDate: Wed May 1 18:46:47 2019 +0300
Commit: Muhammet Kara 
CommitDate: Thu May 2 19:28:27 2019 +0200

tdf#125063: Don't depend on content size for Page sizing

During redaction of Calc sheets

Change-Id: If2a4f71c77a687a74b8f823152b76d2a7e2e21da
Reviewed-on: https://gerrit.libreoffice.org/71627
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 

diff --git a/sfx2/inc/SfxRedactionHelper.hxx b/sfx2/inc/SfxRedactionHelper.hxx
index d338143c608e..1cd653650557 100644
--- a/sfx2/inc/SfxRedactionHelper.hxx
+++ b/sfx2/inc/SfxRedactionHelper.hxx
@@ -15,6 +15,7 @@
 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -47,7 +48,7 @@ public:
  * and pushes into the given vector.
  * */
 static void getPageMetaFilesFromDoc(std::vector& aMetaFiles,
-const sal_Int32& nPages,
+std::vector<::Size>& aPageSizes, const 
sal_Int32& nPages,
 DocumentToGraphicRenderer& aRenderer, 
bool bIsWriter,
 bool bIsCalc);
 /*
@@ -55,7 +56,8 @@ public:
  * and inserts the shapes into the newly created draw pages.
  * */
 static void addPagesToDraw(uno::Reference& xComponent, const 
sal_Int32& nPages,
-   const std::vector& aMetaFiles, 
bool bIsCalc);
+   const std::vector& aMetaFiles,
+   const std::vector<::Size>& aPageSizes, bool 
bIsCalc);
 /*
  * Makes the Redaction toolbar visible to the user.
  * Meant to be called after converting a document to a Draw doc
diff --git a/sfx2/source/doc/SfxRedactionHelper.cxx 
b/sfx2/source/doc/SfxRedactionHelper.cxx
index bc7f421444d7..67cdfa77c22f 100644
--- a/sfx2/source/doc/SfxRedactionHelper.cxx
+++ b/sfx2/source/doc/SfxRedactionHelper.cxx
@@ -62,6 +62,7 @@ OUString SfxRedactionHelper::getStringParam(const SfxRequest& 
rReq, const sal_uI
 }
 
 void SfxRedactionHelper::getPageMetaFilesFromDoc(std::vector& 
aMetaFiles,
+ std::vector<::Size>& 
aPageSizes,
  const sal_Int32& nPages,
  DocumentToGraphicRenderer& 
aRenderer,
  bool bIsWriter, bool bIsCalc)
@@ -77,6 +78,8 @@ void 
SfxRedactionHelper::getPageMetaFilesFromDoc(std::vector& aMeta
 // FIXME: This is a temporary hack. Need to figure out a proper way to 
derive this scale factor.
 ::Size aTargetSize(aDocumentSizePixel.Width() * 1.23, 
aDocumentSizePixel.Height() * 1.23);
 
+aPageSizes.push_back(aLogic);
+
 Graphic aGraphic = aRenderer.renderToGraphic(nPage, 
aDocumentSizePixel, aTargetSize,
  COL_TRANSPARENT, true);
 auto& rGDIMetaFile = 
const_cast(aGraphic.GetGDIMetaFile());
@@ -110,7 +113,8 @@ void 
SfxRedactionHelper::getPageMetaFilesFromDoc(std::vector& aMeta
 
 void SfxRedactionHelper::addPagesToDraw(uno::Reference& xComponent,
 const sal_Int32& nPages,
-const std::vector& 
aMetaFiles, bool bIsCalc)
+const std::vector& 
aMetaFiles,
+const std::vector<::Size>& aPageSizes, 
bool bIsCalc)
 {
 // Access the draw pages
 uno::Reference xDrawPagesSupplier(xComponent, 
uno::UNO_QUERY);
@@ -123,8 +127,8 @@ void 
SfxRedactionHelper::addPagesToDraw(uno::Reference& xComponent,
 GDIMetaFile rGDIMetaFile = aMetaFiles[nPage];
 Graphic aGraphic(rGDIMetaFile);
 
-sal_Int32 nPageHeight(rGDIMetaFile.GetPrefSize().Height());
-sal_Int32 nPageWidth(rGDIMetaFile.GetPrefSize().Width());
+sal_Int32 nPageHeight(aPageSizes[nPage].Height());
+sal_Int32 nPageWidth(aPageSizes[nPage].Width());
 
 uno::Reference xGraph = aGraphic.GetXGraphic();
 uno::Reference xPage = 
xDrawPages->insertNewByIndex(nPage);
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index cd8bdd0ced85..7d5fa32738e6 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -561,9 +561,10 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest )
 
 sal_Int32 nPages = aRenderer.getPageCount();
 std::vector< GDIMetaFile > aMetaFiles;
+std::vector< ::Size > aPageSizes;
 
 // Convert the pages of the document to gdimetafiles
-SfxRedactionHelper::getPageMetaFilesFromDoc(aMetaFiles, nPages, 

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

2018-11-26 Thread Libreoffice Gerrit user
 sfx2/inc/srchdlg.hxx  |5 -
 sfx2/source/appl/newhelp.hxx  |1 -
 sfx2/source/dialog/basedlgs.cxx   |1 -
 sfx2/source/dialog/securitypage.cxx   |3 ---
 sfx2/source/doc/saveastemplatedlg.cxx |2 --
 5 files changed, 12 deletions(-)

New commits:
commit 7fcdc7efe836f9ca71f80d3178a2578b63fb3fd8
Author: Caolán McNamara 
AuthorDate: Sun Nov 25 20:36:18 2018 +
Commit: Caolán McNamara 
CommitDate: Mon Nov 26 09:51:39 2018 +0100

drop unnecessary includes

Change-Id: I5305722d88ed947cbaf8015fc85d6b52900b7b75
Reviewed-on: https://gerrit.libreoffice.org/64003
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sfx2/inc/srchdlg.hxx b/sfx2/inc/srchdlg.hxx
index 99903a6f9207..1e72f5e30edb 100644
--- a/sfx2/inc/srchdlg.hxx
+++ b/sfx2/inc/srchdlg.hxx
@@ -19,13 +19,8 @@
 #ifndef INCLUDED_SFX2_INC_SRCHDLG_HXX
 #define INCLUDED_SFX2_INC_SRCHDLG_HXX
 
-#include 
-#include 
-#include 
-#include 
 #include 
 
-
 namespace sfx2 {
 
 
diff --git a/sfx2/source/appl/newhelp.hxx b/sfx2/source/appl/newhelp.hxx
index a70166bbd8e2..ddea348f807f 100644
--- a/sfx2/source/appl/newhelp.hxx
+++ b/sfx2/source/appl/newhelp.hxx
@@ -29,7 +29,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx
index 7ad50b9b86ad..288f9b71a5e1 100644
--- a/sfx2/source/dialog/basedlgs.cxx
+++ b/sfx2/source/dialog/basedlgs.cxx
@@ -22,7 +22,6 @@
 #include 
 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/sfx2/source/dialog/securitypage.cxx 
b/sfx2/source/dialog/securitypage.cxx
index 7caf842e5fe8..249973507d53 100644
--- a/sfx2/source/dialog/securitypage.cxx
+++ b/sfx2/source/dialog/securitypage.cxx
@@ -28,9 +28,6 @@
 #include 
 #include 
 
-#include 
-#include 
-#include 
 #include 
 #include 
 #include 
diff --git a/sfx2/source/doc/saveastemplatedlg.cxx 
b/sfx2/source/doc/saveastemplatedlg.cxx
index 2b7dad5dd377..5a6a12277f8d 100644
--- a/sfx2/source/doc/saveastemplatedlg.cxx
+++ b/sfx2/source/doc/saveastemplatedlg.cxx
@@ -16,8 +16,6 @@
 #include 
 #include 
 #include 
-#include 
-#include 
 #include 
 #include 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-10-07 Thread Libreoffice Gerrit user
 sfx2/inc/pch/precompiled_sfx.hxx |1 -
 sfx2/inc/preventduplicateinteraction.hxx |2 --
 sfx2/source/appl/newhelp.hxx |1 -
 3 files changed, 4 deletions(-)

New commits:
commit 45385a532b2d4bd227d6771e54b2b8a9faca939c
Author: Caolán McNamara 
AuthorDate: Sat Oct 6 21:32:08 2018 +0100
Commit: Caolán McNamara 
CommitDate: Sun Oct 7 19:44:55 2018 +0200

drop unnecessary includes

Change-Id: I0a873ecc812f229d972f18370ff06c02f521fedb
Reviewed-on: https://gerrit.libreoffice.org/61484
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sfx2/inc/pch/precompiled_sfx.hxx b/sfx2/inc/pch/precompiled_sfx.hxx
index 51b5c8e10195..079cca3ddb51 100644
--- a/sfx2/inc/pch/precompiled_sfx.hxx
+++ b/sfx2/inc/pch/precompiled_sfx.hxx
@@ -97,7 +97,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/sfx2/inc/preventduplicateinteraction.hxx 
b/sfx2/inc/preventduplicateinteraction.hxx
index 8fdf8f79ea22..8a8cd91b565c 100644
--- a/sfx2/inc/preventduplicateinteraction.hxx
+++ b/sfx2/inc/preventduplicateinteraction.hxx
@@ -34,8 +34,6 @@
 
 #include 
 #include 
-#include 
-#include 
 #include 
 
 namespace com { namespace sun { namespace star { namespace uno {
diff --git a/sfx2/source/appl/newhelp.hxx b/sfx2/source/appl/newhelp.hxx
index fa660cd5f01c..a887f5d00127 100644
--- a/sfx2/source/appl/newhelp.hxx
+++ b/sfx2/source/appl/newhelp.hxx
@@ -32,7 +32,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-10-05 Thread Libreoffice Gerrit user
 sfx2/inc/srchdlg.hxx |   42 ++
 sfx2/source/appl/newhelp.cxx |   27 -
 sfx2/source/appl/newhelp.hxx |2 
 sfx2/source/dialog/srchdlg.cxx   |  110 ---
 sfx2/uiconfig/ui/searchdialog.ui |   18 --
 5 files changed, 78 insertions(+), 121 deletions(-)

New commits:
commit faf6b466ab510ccee540953eebb790b6a57386e6
Author: Caolán McNamara 
AuthorDate: Thu Oct 4 17:06:50 2018 +0100
Commit: Caolán McNamara 
CommitDate: Fri Oct 5 12:20:28 2018 +0200

weld modeless sfx SearchDialog

Change-Id: I90a9b5dcf8878356bf8fe911d5dce9391904
Reviewed-on: https://gerrit.libreoffice.org/61396
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sfx2/inc/srchdlg.hxx b/sfx2/inc/srchdlg.hxx
index 2dfab6612abc..42941356012b 100644
--- a/sfx2/inc/srchdlg.hxx
+++ b/sfx2/inc/srchdlg.hxx
@@ -32,52 +32,44 @@ namespace sfx2 {
 // SearchDialog
 
 
-class SearchDialog : public ModelessDialog
+class SearchDialog : public weld::GenericDialogController
 {
 private:
-VclPtr   m_pSearchEdit;
-VclPtr   m_pWholeWordsBox;
-VclPtr   m_pMatchCaseBox;
-VclPtr   m_pWrapAroundBox;
-VclPtr   m_pBackwardsBox;
-VclPtr m_pFindBtn;
-
 Link   m_aFindHdl;
 Link  m_aCloseHdl;
 
 OUStringm_sConfigName;
-OString m_sWinState;
 
-boolm_bIsConstructed;
+std::unique_ptr m_xSearchEdit;
+std::unique_ptr m_xWholeWordsBox;
+std::unique_ptr m_xMatchCaseBox;
+std::unique_ptr m_xWrapAroundBox;
+std::unique_ptr m_xBackwardsBox;
+std::unique_ptr m_xFindBtn;
 
 voidLoadConfig();
 voidSaveConfig();
 
-DECL_LINK(FindHdl, Button *, void);
+DECL_LINK(FindHdl, weld::Button&, void);
 
 public:
-SearchDialog( vcl::Window* pWindow, const OUString& rConfigName );
+SearchDialog(weld::Window* pWindow, const OUString& rConfigName);
+static void runAsync(std::shared_ptr& rController);
 virtual ~SearchDialog() override;
-virtual void dispose() override;
 
 void SetFindHdl( const Link& rLink ) { 
m_aFindHdl = rLink; }
 void SetCloseHdl( const Link& rLink ) { 
m_aCloseHdl = rLink; }
 
-OUString GetSearchText() const { return m_pSearchEdit->GetText(); }
-void SetSearchText( const OUString& _rText ) { 
m_pSearchEdit->SetText( _rText ); }
-bool IsOnlyWholeWords() const { return 
m_pWholeWordsBox->IsChecked(); }
-bool IsMarchCase() const { return m_pMatchCaseBox->IsChecked(); }
-bool IsWrapAround() const { return m_pWrapAroundBox->IsChecked(); }
-bool IsSearchBackwards() const { return 
m_pBackwardsBox->IsChecked(); }
-
-voidSetFocusOnEdit();
+OUString GetSearchText() const { return 
m_xSearchEdit->get_active_text(); }
+void SetSearchText( const OUString& _rText ) { 
m_xSearchEdit->set_entry_text( _rText ); }
+bool IsOnlyWholeWords() const { return 
m_xWholeWordsBox->get_active(); }
+bool IsMarchCase() const { return m_xMatchCaseBox->get_active(); }
+bool IsWrapAround() const { return m_xWrapAroundBox->get_active(); 
}
+bool IsSearchBackwards() const { return 
m_xBackwardsBox->get_active(); }
 
-virtual boolClose() override;
-virtual voidMove() override;
-virtual voidStateChanged( StateChangedType nStateChange ) override;
+void SetFocusOnEdit();
 };
 
-
 } // namespace sfx2
 
 
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index f2a28bb418ed..a7c7404cab32 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -1863,7 +1863,6 @@ SfxHelpTextWindow_Impl::SfxHelpTextWindow_Impl( 
SfxHelpWindow_Impl* pParent ) :
 aOnStartupText  ( SfxResId( RID_HELP_ONSTARTUP_TEXT ) ),
 pHelpWin( pParent ),
 pTextWin( VclPtr::Create( this ) ),
-pSrchDlg( nullptr ),
 nMinPos ( 0 ),
 bIsDebug( false ),
 bIsIndexOn  ( false ),
@@ -1924,7 +1923,7 @@ void SfxHelpTextWindow_Impl::dispose()
 
 bIsInClose = true;
 SvtMiscOptions().RemoveListenerLink( LINK( this, SfxHelpTextWindow_Impl, 
NotifyHdl ) );
-pSrchDlg.disposeAndClear();
+m_xSrchDlg.reset();
 aToolBox.disposeAndClear();
 aOnStartupCB.disposeAndClear();
 pHelpWin.clear();
@@ -2205,7 +2204,7 @@ void SfxHelpTextWindow_Impl::FindHdl(sfx2::SearchDialog* 
pDlg)
 {
 bool bWrapAround = ( nullptr == pDlg );
 if ( bWrapAround )
-pDlg = pSrchDlg;
+pDlg = m_xSrchDlg.get();
 DBG_ASSERT( pDlg, "invalid search dialog" );
 OUString sSearchText = pDlg->GetSearchText();
 try
@@ -2265,11 +2264,11 @@ void 
SfxHelpTextWindow_Impl::FindHdl(sfx2::SearchDialog* pDlg)
 }

[Libreoffice-commits] core.git: sfx2/inc sfx2/source svx/inc sw/inc sw/source unotools/source vcl/inc vcl/opengl

2018-08-29 Thread Libreoffice Gerrit user
 sfx2/inc/guisaveas.hxx   |3 +--
 sfx2/inc/preventduplicateinteraction.hxx |5 ++---
 sfx2/source/appl/appopen.cxx |2 +-
 sfx2/source/doc/guisaveas.cxx|   11 +--
 svx/inc/sxmovitm.hxx |4 ++--
 svx/inc/sxroaitm.hxx |2 +-
 svx/inc/sxrooitm.hxx |2 +-
 svx/inc/sxsalitm.hxx |4 ++--
 svx/inc/sxsoitm.hxx  |4 ++--
 sw/inc/crsrsh.hxx|4 ++--
 sw/source/core/crsr/crsrsh.cxx   |6 +++---
 sw/source/filter/ww8/docxattributeoutput.cxx |2 +-
 sw/source/filter/ww8/wrtw8nds.cxx|   18 +-
 sw/source/filter/ww8/wrtww8.hxx  |2 +-
 sw/source/ui/dbui/mmresultdialogs.cxx|4 ++--
 unotools/source/i18n/localedatawrapper.cxx   |   13 +
 vcl/inc/opengl/texture.hxx   |2 +-
 vcl/opengl/texture.cxx   |   18 +-
 18 files changed, 42 insertions(+), 64 deletions(-)

New commits:
commit 3dfc17ed6334c619228668ffeff591bc75d32025
Author: Noel Grandin 
AuthorDate: Tue Aug 28 14:43:10 2018 +0200
Commit: Noel Grandin 
CommitDate: Wed Aug 29 11:12:47 2018 +0200

loplugin:constantparam (3)

Change-Id: Ifc47bb8e096c9a8563021b2fcb44199577740746
Reviewed-on: https://gerrit.libreoffice.org/59747
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sfx2/inc/guisaveas.hxx b/sfx2/inc/guisaveas.hxx
index fb93a33c5328..ac9df75aea61 100644
--- a/sfx2/inc/guisaveas.hxx
+++ b/sfx2/inc/guisaveas.hxx
@@ -70,8 +70,7 @@ public:
 
 static void SetDocInfoState(
 const css::uno::Reference< css::frame::XModel >& xModel,
-const css::uno::Reference< css::document::XDocumentProperties>& 
i_xOldDocInfo,
-bool bNoModify );
+const css::uno::Reference< css::document::XDocumentProperties>& 
i_xOldDocInfo );
 
 static bool WarnUnacceptableFormat(
 const css::uno::Reference< 
css::frame::XModel >& xModel,
diff --git a/sfx2/inc/preventduplicateinteraction.hxx 
b/sfx2/inc/preventduplicateinteraction.hxx
index 46e998a213e7..8fdf8f79ea22 100644
--- a/sfx2/inc/preventduplicateinteraction.hxx
+++ b/sfx2/inc/preventduplicateinteraction.hxx
@@ -182,10 +182,9 @@ class PreventDuplicateInteraction : private ThreadHelpBase2
 
 public:
 
-InteractionInfo(const css::uno::Type& aInteraction,
-  sal_Int32   nMaxCount   )
+InteractionInfo(const css::uno::Type& aInteraction)
 : m_aInteraction(aInteraction)
-, m_nMaxCount   (nMaxCount   )
+, m_nMaxCount   (1   )
 , m_nCallCount  (0   )
 {}
 };
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index ad839b0ccb24..632a2f985268 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -686,7 +686,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
 
 // define rules for this handler
 css::uno::Type
aInteraction = ::cppu::UnoType::get();
-::sfx2::PreventDuplicateInteraction::InteractionInfo aRule
(aInteraction, 1);
+::sfx2::PreventDuplicateInteraction::InteractionInfo 
aRule(aInteraction);
 pHandler->addInteractionRule(aRule);
 
 if (!aDocService.isEmpty())
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index f4427d0f2035..acab90b6cd4a 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -1654,7 +1654,7 @@ bool SfxStoringHelper::GUIStoreModel( const 
uno::Reference< frame::XModel >& xMo
 
 if ( nStoreMode & EXPORT_REQUESTED )
 {
-SfxStoringHelper::SetDocInfoState(aModel.GetModel(), 
xOldDocProps, true);
+SfxStoringHelper::SetDocInfoState(aModel.GetModel(), 
xOldDocProps);
 }
 };
 
@@ -1728,8 +1728,7 @@ bool SfxStoringHelper::CheckFilterOptionsAppearance(
 // static
 void SfxStoringHelper::SetDocInfoState(
 const uno::Reference< frame::XModel >& xModel,
-const uno::Reference< document::XDocumentProperties>& i_xOldDocProps,
-bool bNoModify )
+const uno::Reference< document::XDocumentProperties>& i_xOldDocProps )
 {
 uno::Reference const
 xModelDocPropsSupplier(xModel, uno::UNO_QUERY_THROW);
@@ -1739,10 +1738,10 @@ void SfxStoringHelper::SetDocInfoState(
 i_xOldDocProps->getUserDefinedProperties(), uno::UNO_QUERY_THROW);
 
 uno::Reference< util::XModifiable > xModifiable( xModel, uno::UNO_QUERY );
-if ( bNoModify && !xModifiable.is() )
+if ( !xModifiable.is() )
 throw 

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

2017-05-19 Thread Caolán McNamara
 sfx2/inc/doc.hrc   |8 
 sfx2/source/doc/doc.src|   35 ---
 sfx2/source/doc/docfac.cxx |   22 --
 3 files changed, 65 deletions(-)

New commits:
commit c2667d7ff558a1b7bf83e694909465f00d1a16f6
Author: Caolán McNamara 
Date:   Fri May 19 09:52:56 2017 +0100

pNameResId is unused

Change-Id: Ic1fe6abc7066517187695266c4d1a0888b41ffe7

diff --git a/sfx2/inc/doc.hrc b/sfx2/inc/doc.hrc
index f6ae529b83df..959e5b23e71f 100644
--- a/sfx2/inc/doc.hrc
+++ b/sfx2/inc/doc.hrc
@@ -39,14 +39,6 @@
 
 #define STR_AUTOMATICVERSION(RID_SFX_DOC_START+ 68)
 
-#define STR_DOCTYPENAME_SW  (RID_SFX_DOC_START+ 69)
-#define STR_DOCTYPENAME_SWWEB   (RID_SFX_DOC_START+ 70)
-#define STR_DOCTYPENAME_SWGLOB  (RID_SFX_DOC_START+ 71)
-#define STR_DOCTYPENAME_SC  (RID_SFX_DOC_START+ 72)
-#define STR_DOCTYPENAME_SI  (RID_SFX_DOC_START+ 73)
-#define STR_DOCTYPENAME_SD  (RID_SFX_DOC_START+ 74)
-#define STR_DOCTYPENAME_MESSAGE (RID_SFX_DOC_START+ 75)
-
 #define TEMPLATE_LONG_NAMES_ARY (RID_SFX_DOC_START+ 81)
 #define TEMPLATE_SHORT_NAMES_ARY(RID_SFX_DOC_START+ 82)
 #define RID_CNT_STR_WAITING (RID_SFX_DOC_START+ 83)
diff --git a/sfx2/source/doc/doc.src b/sfx2/source/doc/doc.src
index f884e0d6651d..8d26bba9de82 100644
--- a/sfx2/source/doc/doc.src
+++ b/sfx2/source/doc/doc.src
@@ -84,41 +84,6 @@ String STR_AUTOMATICVERSION
 Text [ en-US ] = "Automatically saved version" ;
 };
 
-String STR_DOCTYPENAME_SW
-{
-Text [ en-US ] = "Text Document";
-};
-
-String STR_DOCTYPENAME_SWWEB
-{
-Text [ en-US ] = "HTML Document";
-};
-
-String STR_DOCTYPENAME_SWGLOB
-{
-Text [ en-US ] = "Master Document";
-};
-
-String STR_DOCTYPENAME_SC
-{
-Text [ en-US ] = "Spreadsheet";
-};
-
-String STR_DOCTYPENAME_SI
-{
-Text [ en-US ] = "Presentation";
-};
-
-String STR_DOCTYPENAME_SD
-{
-Text [ en-US ] = "Drawing";
-};
-
-String STR_DOCTYPENAME_MESSAGE
-{
-Text [ en-US ] = "Message";
-};
-
 String STR_EXPORTBUTTON
 {
 Text [ en-US ] = "Export" ;
diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx
index 339c2bb8fed6..6a26e7b8420f 100644
--- a/sfx2/source/doc/docfac.cxx
+++ b/sfx2/source/doc/docfac.cxx
@@ -61,26 +61,22 @@ typedef std::vector SfxViewFactoryArr_Impl;
 struct SfxObjectFactory_Impl
 {
 SfxViewFactoryArr_Impl  aViewFactoryArr;// List of s
-ResId*  pNameResId;
 OUString aServiceName;
 SfxFilterContainer* pFilterContainer;
 SfxModule*  pModule;
 SvGlobalNameaClassName;
 
 SfxObjectFactory_Impl() :
-pNameResId  ( nullptr ),
 pFilterContainer( nullptr ),
 pModule ( nullptr )
 {}
 };
 
-
 SfxFilterContainer* SfxObjectFactory::GetFilterContainer() const
 {
 return pImpl->pFilterContainer;
 }
 
-
 SfxObjectFactory::SfxObjectFactory
 (
 const SvGlobalName& rName,
@@ -91,29 +87,11 @@ SfxObjectFactory::SfxObjectFactory
nFlags( nFlagsP )
 {
 pImpl->pFilterContainer = new SfxFilterContainer( m_sFactoryName );
-
-const OUString aShortName( m_sFactoryName.toAsciiLowerCase() );
 pImpl->aClassName = rName;
-if ( aShortName == "swriter" )
-pImpl->pNameResId = new SfxResId( STR_DOCTYPENAME_SW );
-else if ( aShortName == "swriter/web" )
-pImpl->pNameResId = new SfxResId( STR_DOCTYPENAME_SWWEB );
-else if ( aShortName == "swriter/globaldocument" )
-pImpl->pNameResId = new SfxResId( STR_DOCTYPENAME_SWGLOB );
-else if ( aShortName == "scalc" )
-pImpl->pNameResId = new SfxResId( STR_DOCTYPENAME_SC );
-else if ( aShortName == "simpress" )
-pImpl->pNameResId = new SfxResId( STR_DOCTYPENAME_SI );
-else if ( aShortName == "sdraw" )
-pImpl->pNameResId = new SfxResId( STR_DOCTYPENAME_SD );
-else if ( aShortName == "message" )
-pImpl->pNameResId = new SfxResId( STR_DOCTYPENAME_MESSAGE );
 }
 
-
 SfxObjectFactory::~SfxObjectFactory()
 {
-delete pImpl->pNameResId;
 delete pImpl->pFilterContainer;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-05-09 Thread Stephan Bergmann
 sfx2/inc/srchdlg.hxx   |4 ++--
 sfx2/source/appl/newhelp.cxx   |2 +-
 sfx2/source/appl/newhelp.hxx   |2 +-
 sfx2/source/dialog/srchdlg.cxx |3 +--
 4 files changed, 5 insertions(+), 6 deletions(-)

New commits:
commit 497751f9024bacad7681c4851f442a5536c1f23f
Author: Stephan Bergmann 
Date:   Tue May 9 15:29:05 2017 +0200

In LazyDelete'd SearchDialog::dispose, SfxHelpTextWindow_Impl is already 
gone

Came across this in a UBSan build via menu "Help - LibreOffice Help" ->
"LibreOffice Help" window: "Find on this Page..." icon -> "Find on this 
Page"
dialog: "Close" button, then close help window:

> sfx2/source/appl/newhelp.cxx:2291:1: runtime error: member call on 
address 0x61800110 which does not point to an object of type 
'SfxHelpTextWindow_Impl'
> 0x61800110: note: object has a possibly invalid vptr: abs(offset to 
top) too big
>  81 04 00 13  0e 07 00 08 5e 7f 00 00  00 00 00 00 00 00 00 00  60 62 9a 
51 5e 7f 00 00  00 00 00 00
>   ^~~
>   possibly invalid vptr
> #0 0x7f5e4700f276 in SfxHelpTextWindow_Impl::LinkStubCloseHdl(void*, 
sfx2::SearchDialog*) sfx2/source/appl/newhelp.cxx:2291:1
> #1 0x7f5e47f6d13a in Link::Call(sfx2::SearchDialog*) const include/tools/link.hxx:84:45
> #2 0x7f5e47f66c5f in sfx2::SearchDialog::dispose() 
sfx2/source/dialog/srchdlg.cxx:70:17
> #3 0x7f5e209af22c in VclReferenceBase::disposeOnce() 
vcl/source/outdev/vclreferencebase.cxx:42:5
> #4 0x7f5e1edb81b9 in VclPtr::disposeAndClear() 
include/vcl/vclptr.hxx:239:19
> #5 0x7f5e1fc47199 in vcl::LazyDeletor::~LazyDeletor() 
include/vcl/lazydelete.hxx:148:36
> #6 0x7f5e1fc473af in vcl::LazyDeletor::~LazyDeletor() 
include/vcl/lazydelete.hxx:122:9
> #7 0x7f5e21dfdb50 in vcl::LazyDelete::flush() 
vcl/source/helper/lazydelete.cxx:52:9
> #8 0x7f5e21fa552f in ImplYield(bool, bool, unsigned long) 
vcl/source/app/svapp.cxx:513:9
> #9 0x7f5e21f7fdc3 in Application::Yield() 
vcl/source/app/svapp.cxx:558:5
> #10 0x7f5e21f7fb06 in Application::Execute() 
vcl/source/app/svapp.cxx:458:9
> #11 0x7f5e5cbd18d4 in desktop::Desktop::DoExecute() 
desktop/source/app/app.cxx:1359:5
> #12 0x7f5e5cbd9e06 in desktop::Desktop::Main() 
desktop/source/app/app.cxx:1679:17
> #13 0x7f5e21ffb0cb in ImplSVMain() vcl/source/app/svmain.cxx:191:35
> #14 0x7f5e220085f1 in SVMain() vcl/source/app/svmain.cxx:229:16
> #15 0x7f5e5cdfec4b in soffice_main 
desktop/source/app/sofficemain.cxx:166:12
> #16 0x511c69 in sal_main desktop/source/app/main.c:48:15
> #17 0x511c13 in main desktop/source/app/main.c:47:1
> #18 0x7f5e5b37d400 in __libc_start_main 
/usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:289
> #19 0x419e59 in _start (instdir/program/soffice.bin+0x419e59)

indicating that the SfxHelpTextWindow_Impl target of the m_aCloseHdl.Call is
already dead.  Looks like there is no good reason for that call from 
dipose()
anyway, which also means the Call's argument is unused.

Change-Id: Ifc33e74e346902dc0208350f5bac79bec182ef12

diff --git a/sfx2/inc/srchdlg.hxx b/sfx2/inc/srchdlg.hxx
index 0210ed23436b..b6e8d2ae7588 100644
--- a/sfx2/inc/srchdlg.hxx
+++ b/sfx2/inc/srchdlg.hxx
@@ -43,7 +43,7 @@ private:
 VclPtr m_pFindBtn;
 
 Link   m_aFindHdl;
-Link   m_aCloseHdl;
+Link  m_aCloseHdl;
 
 OUStringm_sConfigName;
 OString m_sWinState;
@@ -61,7 +61,7 @@ public:
 virtual void dispose() override;
 
 void SetFindHdl( const Link& rLink ) { 
m_aFindHdl = rLink; }
-void SetCloseHdl( const Link& rLink ) { 
m_aCloseHdl = rLink; }
+void SetCloseHdl( const Link& rLink ) { 
m_aCloseHdl = rLink; }
 
 OUString GetSearchText() const { return m_pSearchEdit->GetText(); }
 void SetSearchText( const OUString& _rText ) { 
m_pSearchEdit->SetText( _rText ); }
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index 7af2a0c7f604..4a67b06ef6ff 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -2288,7 +2288,7 @@ void SfxHelpTextWindow_Impl::FindHdl(sfx2::SearchDialog* 
pDlg)
 }
 
 
-IMPL_LINK_NOARG( SfxHelpTextWindow_Impl, CloseHdl, sfx2::SearchDialog*, void )
+IMPL_LINK_NOARG( SfxHelpTextWindow_Impl, CloseHdl, LinkParamNone*, void )
 {
 pSrchDlg.clear();
 }
diff --git a/sfx2/source/appl/newhelp.hxx b/sfx2/source/appl/newhelp.hxx
index 499d8072e7fc..74de410b71e3 100644
--- a/sfx2/source/appl/newhelp.hxx
+++ b/sfx2/source/appl/newhelp.hxx
@@ -457,7 +457,7 @@ private:
 DECL_LINK(SelectHdl, Timer *, void);
 DECL_LINK(NotifyHdl, 

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

2017-04-26 Thread Caolán McNamara
 sfx2/inc/app.hrc |   23 -
 sfx2/inc/bitmaps.hlst|   21 +
 sfx2/source/appl/newhelp.cxx |   45 +--
 sfx2/source/appl/newhelp.src |  100 ---
 4 files changed, 44 insertions(+), 145 deletions(-)

New commits:
commit d23af0cd71c655325f1b7821ebe1ca34cc34afff
Author: Caolán McNamara 
Date:   Wed Apr 26 10:49:43 2017 +0100

remove sfx2 bitmaps from .src files

Change-Id: I54448567db051f4446c36b16acdda2288b391537

diff --git a/sfx2/inc/app.hrc b/sfx2/inc/app.hrc
index 1a95425fecf8..24eba24c2dbc 100644
--- a/sfx2/inc/app.hrc
+++ b/sfx2/inc/app.hrc
@@ -38,20 +38,6 @@
 #define STR_INFO_NOSEARCHRESULTS(RID_SFX_APP_START+106)
 #define STR_INFO_NOSEARCHTEXTFOUND  (RID_SFX_APP_START+107)
 
-#define BMP_HELP_TOOLBOX_INDEX_ON   (RID_SFX_APP_START+110)
-#define BMP_HELP_TOOLBOX_INDEX_OFF  (RID_SFX_APP_START+111)
-#define BMP_HELP_TOOLBOX_START  (RID_SFX_APP_START+112)
-#define BMP_HELP_TOOLBOX_PREV   (RID_SFX_APP_START+113)
-#define BMP_HELP_TOOLBOX_NEXT   (RID_SFX_APP_START+114)
-#define BMP_HELP_TOOLBOX_PRINT  (RID_SFX_APP_START+115)
-#define BMP_HELP_TOOLBOX_BOOKMARKS  (RID_SFX_APP_START+116)
-#define BMP_HELP_TOOLBOX_SEARCHDIALOG   (RID_SFX_APP_START+117)
-#define BMP_HELP_TOOLBOX_COPY   (RID_SFX_APP_START+118)
-
-#define BMP_HELP_CONTENT_BOOK_OPEN  (RID_SFX_APP_START+120)
-#define BMP_HELP_CONTENT_BOOK_CLOSED(RID_SFX_APP_START+122)
-#define BMP_HELP_CONTENT_DOC(RID_SFX_APP_START+124)
-
 #define STR_HELP_WINDOW_TITLE   (RID_SFX_APP_START+125) // 
string
 
 #define STR_HELP_BUTTON_INDEX_ON(RID_SFX_APP_START+126)
@@ -79,15 +65,6 @@
 
 #define RID_HELP_ONSTARTUP_TEXT (RID_SFX_APP_START+145)
 
-#define BMP_HELP_TOOLBOX_L_INDEX_ON (RID_SFX_APP_START+160)
-#define BMP_HELP_TOOLBOX_L_INDEX_OFF(RID_SFX_APP_START+161)
-#define BMP_HELP_TOOLBOX_L_START(RID_SFX_APP_START+162)
-#define BMP_HELP_TOOLBOX_L_PREV (RID_SFX_APP_START+163)
-#define BMP_HELP_TOOLBOX_L_NEXT (RID_SFX_APP_START+164)
-#define BMP_HELP_TOOLBOX_L_PRINT(RID_SFX_APP_START+165)
-#define BMP_HELP_TOOLBOX_L_BOOKMARKS(RID_SFX_APP_START+166)
-#define BMP_HELP_TOOLBOX_L_SEARCHDIALOG (RID_SFX_APP_START+167)
-
 #define RID_SECURITY_WARNING_TITLE  (RID_SFX_APP_START + 181)
 
 #define RID_SVXSTR_XMLSEC_QUERY_LOSINGSIGNATURE (RID_SFX_APP_START + 186)
diff --git a/sfx2/inc/bitmaps.hlst b/sfx2/inc/bitmaps.hlst
index ff88d467071d..d6fb2f3416cc 100644
--- a/sfx2/inc/bitmaps.hlst
+++ b/sfx2/inc/bitmaps.hlst
@@ -10,6 +10,27 @@
 #ifndef INCLUDED_SFX2_INC_BITMAPS_HRC
 #define INCLUDED_SFX2_INC_BITMAPS_HRC
 
+#define BMP_HELP_TOOLBOX_INDEX_ON   "sfx2/res/indexon_small.png"
+#define BMP_HELP_TOOLBOX_INDEX_OFF  "sfx2/res/indexoff_small.png"
+#define BMP_HELP_TOOLBOX_START  "res/sc06303.png"
+#define BMP_HELP_TOOLBOX_PREV   "res/sc06301.png"
+#define BMP_HELP_TOOLBOX_NEXT   "res/sc06300.png"
+#define BMP_HELP_TOOLBOX_PRINT  "res/sc05504.png"
+#define BMP_HELP_TOOLBOX_BOOKMARKS  "sfx2/res/favourite.png"
+#define BMP_HELP_TOOLBOX_SEARCHDIALOG   "sfx2/res/sc05961.png"
+#define BMP_HELP_TOOLBOX_COPY   "sfx2/res/sc05711.png"
+#define BMP_HELP_CONTENT_BOOK_OPEN  "sfx2/res/hlpbookopen.png"
+#define BMP_HELP_CONTENT_BOOK_CLOSED"sfx2/res/hlpbookclosed.png"
+#define BMP_HELP_CONTENT_DOC"sfx2/res/hlpdoc.png"
+#define BMP_HELP_TOOLBOX_L_INDEX_ON "sfx2/res/indexon_big.png"
+#define BMP_HELP_TOOLBOX_L_INDEX_OFF"sfx2/res/indexoff_big.png"
+#define BMP_HELP_TOOLBOX_L_START"res/lc06303.png"
+#define BMP_HELP_TOOLBOX_L_PREV "res/lc06301.png"
+#define BMP_HELP_TOOLBOX_L_NEXT "res/lc06300.png"
+#define BMP_HELP_TOOLBOX_L_PRINT"res/lc05504.png"
+#define BMP_HELP_TOOLBOX_L_BOOKMARKS"sfx2/res/favourite_big.png"
+#define BMP_HELP_TOOLBOX_L_SEARCHDIALOG "res/lc05961.png"
+
 //start, sfx2/source/sidebar/Theme.cxx
 #define CLOSEDOC   "sfx2/res/closedoc.png"
 #define GRIP   "sfx2/res/grip.png"
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index 4cb7668d9135..363efea0bc38 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -34,6 +34,7 @@
 #include "app.hrc"
 #include "newhelp.hrc"
 #include "helpid.hrc"
+#include "bitmaps.hlst"
 
 #include 
 #include 
@@ -267,9 +268,9 @@ struct ContentEntry_Impl
 
 ContentListBox_Impl::ContentListBox_Impl(vcl::Window* pParent, WinBits nStyle)
 : SvTreeListBox(pParent, nStyle)
-, aOpenBookImage(BitmapEx(SfxResId(BMP_HELP_CONTENT_BOOK_OPEN)))
-, 

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

2017-03-29 Thread Andrea Gelmini
 sfx2/inc/guisaveas.hxx|2 +-
 sfx2/source/doc/guisaveas.cxx |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 9c95a2062ed5088c72189e0bb3e70b1b853de934
Author: Andrea Gelmini 
Date:   Wed Mar 29 17:50:59 2017 +0200

Fix typo in method

Change-Id: Ib2b05abaeacd3b8787f938a49a0d9673096b5f42
Reviewed-on: https://gerrit.libreoffice.org/35857
Tested-by: Jenkins 
Reviewed-by: Julien Nabet 

diff --git a/sfx2/inc/guisaveas.hxx b/sfx2/inc/guisaveas.hxx
index eb742e045300..ee044218caad 100644
--- a/sfx2/inc/guisaveas.hxx
+++ b/sfx2/inc/guisaveas.hxx
@@ -65,7 +65,7 @@ public:
 const OUString& aUserSelectedName,
 SignatureState nDocumentSignatureState );
 
-static bool CheckFilterOptionsAppearence(
+static bool CheckFilterOptionsAppearance(
 const css::uno::Reference< css::container::XNameAccess >& 
xFilterCFG,
 const OUString& aFilterName );
 
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 237821beaee7..8744d1e22f53 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -1078,7 +1078,7 @@ bool ModelData_Impl::OutputFileDialog( sal_Int8 
nStoreMode,
 uno::Reference< ui::dialogs::XFilePickerControlAccess > xExtFileDlg( 
pFileDlg->GetFilePicker(), uno::UNO_QUERY );
 if ( xExtFileDlg.is() )
 {
-if ( SfxStoringHelper::CheckFilterOptionsAppearence( 
m_pOwner->GetFilterConfiguration(), aFilterName ) )
+if ( SfxStoringHelper::CheckFilterOptionsAppearance( 
m_pOwner->GetFilterConfiguration(), aFilterName ) )
 bUseFilterOptions = true;
 
 if ( ( !( nStoreMode & EXPORT_REQUESTED ) || ( nStoreMode & 
WIDEEXPORT_REQUESTED ) ) && bUseFilterOptions )
@@ -1698,7 +1698,7 @@ bool SfxStoringHelper::GUIStoreModel( const 
uno::Reference< frame::XModel >& xMo
 
 
 // static
-bool SfxStoringHelper::CheckFilterOptionsAppearence(
+bool SfxStoringHelper::CheckFilterOptionsAppearance(
 const uno::Reference< 
container::XNameAccess >& xFilterCFG,
 const OUString& 
aFilterName )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-03-13 Thread Jeevan
 sfx2/inc/app.hrc|  130 
 sfx2/source/appl/app.hrc|  130 
 sfx2/source/dialog/dinfdlg.cxx  |2 
 sfx2/source/dialog/securitypage.cxx |2 
 sfx2/source/doc/guisaveas.cxx   |2 
 sfx2/source/doc/objmisc.cxx |2 
 sfx2/source/doc/objserv.cxx |2 
 sfx2/source/doc/objstor.cxx |2 
 sfx2/source/view/viewfrm.cxx|2 
 ucb/source/ucp/webdav/SerfUri.cxx   |2 
 10 files changed, 138 insertions(+), 138 deletions(-)

New commits:
commit befafd4f8d58f81ac9cb0e4ef8dfbda9373787f7
Author: Jeevan 
Date:   Fri Mar 10 02:46:30 2017 +0530

tdf#95416 remove ../ in #include headers of sfx2 files

Change-Id: I5f3e1a8fe559500aec7ea9e38edaba42dff3f98b
Reviewed-on: https://gerrit.libreoffice.org/35028
Reviewed-by: Tor Lillqvist 
Tested-by: Tor Lillqvist 

diff --git a/sfx2/source/appl/app.hrc b/sfx2/inc/app.hrc
similarity index 98%
rename from sfx2/source/appl/app.hrc
rename to sfx2/inc/app.hrc
index 2510c46..760706f 100644
--- a/sfx2/source/appl/app.hrc
+++ b/sfx2/inc/app.hrc
@@ -16,8 +16,8 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
-#ifndef INCLUDED_SFX2_SOURCE_APPL_APP_HRC
-#define INCLUDED_SFX2_SOURCE_APPL_APP_HRC
+#ifndef INCLUDED_SFX2_INC_APP_HRC
+#define INCLUDED_SFX2_INC_APP_HRC
 
 #include 
 
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 07d0af8..0ae7a11 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -67,7 +67,7 @@
 #include "documentfontsdialog.hxx"
 #include 
 #include "dinfdlg.hrc"
-#include "../appl/app.hrc"
+#include "app.hrc"
 #include "sfxlocal.hrc"
 #include 
 #include 
diff --git a/sfx2/source/dialog/securitypage.cxx 
b/sfx2/source/dialog/securitypage.cxx
index 04a138a..181e548 100644
--- a/sfx2/source/dialog/securitypage.cxx
+++ b/sfx2/source/dialog/securitypage.cxx
@@ -38,7 +38,7 @@
 #include 
 #include 
 
-#include "../appl/app.hrc"
+#include "app.hrc"
 
 
 using namespace ::com::sun::star;
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 8f08c35..237821b 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -86,7 +86,7 @@
 #include 
 #include 
 #include 
-#include "../appl/app.hrc"
+#include "app.hrc"
 
 #include 
 
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index da263b3..16d58bc 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -118,7 +118,7 @@
 #include "doc.hrc"
 #include "workwin.hxx"
 #include "helpid.hrc"
-#include "../appl/app.hrc"
+#include "app.hrc"
 #include 
 #include "appbaslib.hxx"
 #include 
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 2ac1ccd..95048d1 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -91,7 +91,7 @@
 #include 
 #include 
 
-#include "../appl/app.hrc"
+#include "app.hrc"
 #include 
 #include 
 #include 
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 0e8f04e..4f70a1d 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -129,7 +129,7 @@
 #include "appdata.hxx"
 #include 
 
-#include "../appl/app.hrc"
+#include "app.hrc"
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::container;
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 818a519..008cd10 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -135,7 +135,7 @@ using ::com::sun::star::container::XIndexContainer;
 #include "workwin.hxx"
 #include "helper.hxx"
 #include 
-#include "../appl/app.hrc"
+#include "app.hrc"
 #include "impviewframe.hxx"
 
 #define SfxViewFrame
diff --git a/ucb/source/ucp/webdav/SerfUri.cxx 
b/ucb/source/ucp/webdav/SerfUri.cxx
index 7aec24f..78cb6da 100644
--- a/ucb/source/ucp/webdav/SerfUri.cxx
+++ b/ucb/source/ucp/webdav/SerfUri.cxx
@@ -25,7 +25,7 @@
 #include "DAVException.hxx"
 #include "AprEnv.hxx"
 
-#include "../inc/urihelper.hxx"
+#include "urihelper.hxx"
 
 using namespace http_dav_ucp;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-12-13 Thread Adam Kasztenny
 sfx2/inc/doc.hrc|  138 
 sfx2/source/control/emojiview.cxx   |2 
 sfx2/source/control/templatedefaultview.cxx |2 
 sfx2/source/control/templatelocalview.cxx   |2 
 sfx2/source/control/templatesearchview.cxx  |2 
 sfx2/source/doc/doc.hrc |  138 
 6 files changed, 142 insertions(+), 142 deletions(-)

New commits:
commit 69d11029d6c72078381f33918574c5a0e043e217
Author: Adam Kasztenny 
Date:   Mon Dec 12 19:54:50 2016 -0500

tdf#95416 Fix an include for sfx2

This .hrc file was used in multiple places.

Change-Id: I603c6d35da2e870d8586f081ccd2672065ade5db
Reviewed-on: https://gerrit.libreoffice.org/31928
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/sfx2/source/doc/doc.hrc b/sfx2/inc/doc.hrc
similarity index 100%
rename from sfx2/source/doc/doc.hrc
rename to sfx2/inc/doc.hrc
diff --git a/sfx2/source/control/emojiview.cxx 
b/sfx2/source/control/emojiview.cxx
index 6494002..36b185c 100644
--- a/sfx2/source/control/emojiview.cxx
+++ b/sfx2/source/control/emojiview.cxx
@@ -25,7 +25,7 @@
 #include 
 #include 
 
-#include "../doc/doc.hrc"
+#include 
 
 #include 
 using namespace ::com::sun::star;
diff --git a/sfx2/source/control/templatedefaultview.cxx 
b/sfx2/source/control/templatedefaultview.cxx
index 219c533..26d3f80 100644
--- a/sfx2/source/control/templatedefaultview.cxx
+++ b/sfx2/source/control/templatedefaultview.cxx
@@ -14,7 +14,7 @@
 #include 
 #include 
 
-#include "../doc/doc.hrc"
+#include 
 
 #define MNI_OPEN   1
 #define MNI_EDIT   2
diff --git a/sfx2/source/control/templatelocalview.cxx 
b/sfx2/source/control/templatelocalview.cxx
index 6603a3c..9bb05809 100644
--- a/sfx2/source/control/templatelocalview.cxx
+++ b/sfx2/source/control/templatelocalview.cxx
@@ -34,7 +34,7 @@
 #include 
 #include 
 
-#include "../doc/doc.hrc"
+#include 
 #include "templateview.hrc"
 
 #define MNI_OPEN   1
diff --git a/sfx2/source/control/templatesearchview.cxx 
b/sfx2/source/control/templatesearchview.cxx
index 8403143..3b1a6fb 100644
--- a/sfx2/source/control/templatesearchview.cxx
+++ b/sfx2/source/control/templatesearchview.cxx
@@ -14,7 +14,7 @@
 #include 
 #include 
 
-#include "../doc/doc.hrc"
+#include 
 
 #include 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-08-02 Thread Noel Grandin
 sfx2/inc/guisaveas.hxx |2 +-
 sfx2/source/appl/fileobj.hxx   |2 +-
 sfx2/source/appl/shutdownicon.cxx  |4 ++--
 sfx2/source/appl/workwin.cxx   |2 +-
 sfx2/source/dialog/filedlghelper.cxx   |2 +-
 sfx2/source/dialog/filedlgimpl.hxx |2 +-
 sfx2/source/dialog/templdlg.cxx|8 
 sfx2/source/doc/DocumentMetadataAccess.cxx |4 ++--
 sfx2/source/doc/SfxDocumentMetaData.cxx|8 
 sfx2/source/doc/doctempl.cxx   |8 
 sfx2/source/doc/doctemplates.cxx   |4 ++--
 sfx2/source/inc/splitwin.hxx   |4 ++--
 sfx2/source/inc/statcach.hxx   |2 +-
 sfx2/source/inc/templdgi.hxx   |2 +-
 sfx2/source/sidebar/SidebarController.cxx  |3 ++-
 sfx2/source/toolbox/imgmgr.cxx |2 +-
 sfx2/source/view/ipclient.cxx  |3 ++-
 17 files changed, 32 insertions(+), 30 deletions(-)

New commits:
commit d961af95cdc62565b2e804fedf7221aa8bb4d840
Author: Noel Grandin 
Date:   Mon Aug 1 08:27:30 2016 +0200

loplugin:countusersofdefaultparams in sfx2

Change-Id: I0a21e2f8069bc698700e97e7c5e4ae508240ff98
Reviewed-on: https://gerrit.libreoffice.org/27761
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/sfx2/inc/guisaveas.hxx b/sfx2/inc/guisaveas.hxx
index 5ca7743..eb742e0 100644
--- a/sfx2/inc/guisaveas.hxx
+++ b/sfx2/inc/guisaveas.hxx
@@ -63,7 +63,7 @@ public:
 css::uno::Sequence< css::beans::PropertyValue >& 
aArgsSequence,
 bool bPreselectPassword,
 const OUString& aUserSelectedName,
-SignatureState nDocumentSignatureState = 
SignatureState::NOSIGNATURES );
+SignatureState nDocumentSignatureState );
 
 static bool CheckFilterOptionsAppearence(
 const css::uno::Reference< css::container::XNameAccess >& 
xFilterCFG,
diff --git a/sfx2/source/appl/fileobj.hxx b/sfx2/source/appl/fileobj.hxx
index e7907f7..7f91bc6 100644
--- a/sfx2/source/appl/fileobj.hxx
+++ b/sfx2/source/appl/fileobj.hxx
@@ -49,7 +49,7 @@ class SvFileObject : public sfx2::SvLinkSource
 bool bStateChangeCalled : 1;
 bool bInCallDownload : 1;
 
-bool GetGraphic_Impl( Graphic&, SvStream* pStream = nullptr );
+bool GetGraphic_Impl( Graphic&, SvStream* pStream );
 bool LoadFile_Impl();
 void SendStateChg_Impl( sfx2::LinkManager::LinkState nState );
 
diff --git a/sfx2/source/appl/shutdownicon.cxx 
b/sfx2/source/appl/shutdownicon.cxx
index 3c6a1d2..a0acb49 100644
--- a/sfx2/source/appl/shutdownicon.cxx
+++ b/sfx2/source/appl/shutdownicon.cxx
@@ -694,7 +694,7 @@ bool ShutdownIcon::IsQuickstarterInstalled()
 * @param bCreate Create the directory if it does not exist yet.
 * @return OUString containing the autostart directory path.
 */
-static OUString getAutostartDir( bool bCreate = false )
+static OUString getAutostartDir( bool bCreate )
 {
 OUString aShortcut;
 const char *pConfigHome;
@@ -739,7 +739,7 @@ OUString ShutdownIcon::getShortcutName()
 aShortcut += "\\";
 aShortcut += aShortcutName;
 #else // UNX
-OUString aShortcut = getAutostartDir();
+OUString aShortcut = getAutostartDir(false);
 aShortcut += "/qstart.desktop";
 #endif // UNX
 return aShortcut;
diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx
index 51a4379..0e1e268 100644
--- a/sfx2/source/appl/workwin.cxx
+++ b/sfx2/source/appl/workwin.cxx
@@ -2401,7 +2401,7 @@ void SfxWorkWindow::EndAutoShow_Impl( Point aPos )
 
 for (VclPtr & p : pSplit)
 {
-if ( p && p->IsAutoHide() )
+if ( p && p->IsAutoHide(false) )
 {
 Point aLocalPos = p->ScreenToOutputPixel( aPos );
 Point aEmptyPoint;
diff --git a/sfx2/source/dialog/filedlghelper.cxx 
b/sfx2/source/dialog/filedlghelper.cxx
index acdd72e..79d48f1 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -289,7 +289,7 @@ void FileDialogHelper_Impl::handleControlStateChanged( 
const FilePickerEvent& aE
 break;
 
 case ExtendedFilePickerElementIds::CHECKBOX_PREVIEW:
-updatePreviewState();
+updatePreviewState(true);
 break;
 }
 }
diff --git a/sfx2/source/dialog/filedlgimpl.hxx 
b/sfx2/source/dialog/filedlgimpl.hxx
index 4e63998..7d4697d 100644
--- a/sfx2/source/dialog/filedlgimpl.hxx
+++ b/sfx2/source/dialog/filedlgimpl.hxx
@@ -109,7 +109,7 @@ namespace sfx2
 voidupdateExportButton();
 voidupdateSelectionBox();
 voidupdateVersions();
-voidupdatePreviewState( bool _bUpdatePreviewWindow 
= true );
+voidupdatePreviewState( bool _bUpdatePreviewWindow 
);
 void 

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

2016-01-11 Thread Stephan Bergmann
 sfx2/inc/bitset.hxx   |  126 ++--
 sfx2/source/bastyp/bitset.cxx |  215 +-
 2 files changed, 20 insertions(+), 321 deletions(-)

New commits:
commit 753b516cae68a5ac09c6389b9e8cd8a52e40ae11
Author: Stephan Bergmann 
Date:   Mon Jan 11 14:33:00 2016 +0100

Merge BitSet into IndexBitSet (and remove unused parts)

Change-Id: I8cab0aac2f67b88936e4bed459dd43b08429b136

diff --git a/sfx2/inc/bitset.hxx b/sfx2/inc/bitset.hxx
index 67651e1..d3f3b28 100644
--- a/sfx2/inc/bitset.hxx
+++ b/sfx2/inc/bitset.hxx
@@ -19,131 +19,27 @@
 #ifndef INCLUDED_SFX2_INC_BITSET_HXX
 #define INCLUDED_SFX2_INC_BITSET_HXX
 
-class BitSet
+class IndexBitSet
 {
 private:
-void CopyFrom( const BitSet& rSet );
 sal_uInt16 nBlocks;
 sal_uInt16 nCount;
 sal_uInt32* pBitmap;
-public:
-BitSet operator<<( sal_uInt16 nOffset ) const;
-BitSet operator>>( sal_uInt16 nOffset ) const;
-static sal_uInt16 CountBits(sal_uInt32 nBits);
-bool operator!() const;
-BitSet();
-BitSet( const BitSet& rOrig );
-~BitSet();
-BitSet& operator=( const BitSet& rOrig );
-BitSet& operator=( sal_uInt16 nBit );
-BitSet operator|( const BitSet& rSet ) const;
-BitSet operator|( sal_uInt16 nBit ) const;
-BitSet& operator|=( const BitSet& rSet );
-BitSet& operator|=( sal_uInt16 nBit );
-BitSet operator-( const BitSet& rSet ) const;
-BitSet operator-( sal_uInt16 nId ) const;
-BitSet& operator-=( const BitSet& rSet );
-BitSet& operator-=( sal_uInt16 nBit );
-BitSet operator&( const BitSet& rSet ) const;
-BitSet& operator&=( const BitSet& rSet );
-BitSet operator^( const BitSet& rSet ) const;
-BitSet operator^( sal_uInt16 nBit ) const;
-BitSet& operator^=( const BitSet& rSet );
-BitSet& operator^=( sal_uInt16 nBit );
-bool Contains( sal_uInt16 nBit ) const;
-bool operator==( const BitSet& rSet ) const;
-bool operator!=( const BitSet& rSet ) const;
 
-};
-
-// returns sal_True if the set is empty
-inline bool BitSet::operator!() const
-{
-return nCount == 0;
-}
-
-// creates the union of two bitset
-inline BitSet BitSet::operator|( const BitSet& rSet ) const
-{
-return BitSet(*this) |= rSet;
-}
-
-// creates the union of a bitset with a single bit
-inline BitSet BitSet::operator|( sal_uInt16 nBit ) const
-{
-return BitSet(*this) |= nBit;
-}
-
-// creates the asymetric difference
-inline BitSet BitSet::operator-( const BitSet& ) const
-{
-return BitSet();
-}
-
-// creates the asymetric difference with a single bit
-inline BitSet BitSet::operator-( sal_uInt16 ) const
-{
-return BitSet();
-}
-
-// removes the bits contained in rSet
-inline BitSet& BitSet::operator-=( const BitSet& )
-{
-return *this;
-}
-
-// creates the intersection with another bitset
-inline BitSet BitSet::operator&( const BitSet& ) const
-{
-return BitSet();
-}
-
-// intersects with another bitset
-inline BitSet& BitSet::operator&=( const BitSet& )
-{
-return *this;
-}
-
-// creates the symetric difference with another bitset
-inline BitSet BitSet::operator^( const BitSet& ) const
-{
-return BitSet();
-}
-
-// creates the symetric difference with a single bit
-inline BitSet BitSet::operator^( sal_uInt16 ) const
-{
-return BitSet();
-}
-
-// builds the symetric difference with another bitset
-inline BitSet& BitSet::operator^=( const BitSet& )
-{
-return *this;
-}
-
-#ifdef BITSET_READY
-// builds the symetric difference with a single bit
-inline BitSet& BitSet::operator^=( sal_uInt16 )
-{
-// crash!!!
-return BitSet();
-}
-#endif
+IndexBitSet& operator|=( sal_uInt16 nBit );
+IndexBitSet& operator-=( sal_uInt16 nBit );
+bool Contains( sal_uInt16 nBit ) const;
 
-// determines if the bitsets aren't equal
-inline bool BitSet::operator!=( const BitSet& rSet ) const
-{
-return !( *this == rSet );
-}
+IndexBitSet(IndexBitSet &) = delete;
+void operator =(IndexBitSet) = delete;
 
-class IndexBitSet : private BitSet
-{
 public:
-  sal_uInt16 GetFreeIndex();
-  void ReleaseIndex(sal_uInt16 i){*this-=i;}
-};
+IndexBitSet();
+~IndexBitSet();
 
+sal_uInt16 GetFreeIndex();
+void ReleaseIndex(sal_uInt16 i){*this-=i;}
+};
 
 #endif
 
diff --git a/sfx2/source/bastyp/bitset.cxx b/sfx2/source/bastyp/bitset.cxx
index c36de49..39cba96 100644
--- a/sfx2/source/bastyp/bitset.cxx
+++ b/sfx2/source/bastyp/bitset.cxx
@@ -23,151 +23,10 @@
 
 #include 
 #include 
-#include 
-
-
-// add nOffset to each bit-value in the set
-
-BitSet BitSet::operator<<( sal_uInt16 nOffset ) const
-{
-// create a work-copy, return it if nothing to shift
-BitSet aSet(*this);
-if ( nOffset == 0 )
-return aSet;
-
-// compute the shiftment in long-words and bits
-sal_uInt16 nBlockDiff = nOffset / 32;
-sal_uInt32 nBitValDiff = nOffset % 32;
-
-// compute the new number of bits
-for ( sal_uInt16 nBlock = 0; nBlock 

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

2015-10-29 Thread Mario J . Rugiero
 sfx2/inc/pch/precompiled_sfx.hxx   |1 -
 sfx2/source/bastyp/fltfnc.cxx  |4 ++--
 sfx2/source/doc/DocumentMetadataAccess.cxx |   20 +++-
 sfx2/source/doc/Metadatable.cxx|   12 +---
 sfx2/source/doc/sfxbasemodel.cxx   |2 +-
 sfx2/source/sidebar/Panel.cxx  |2 --
 6 files changed, 15 insertions(+), 26 deletions(-)

New commits:
commit efbde08e2a9930edb4637824d9d3a768873314a8
Author: Mario J. Rugiero 
Date:   Thu Oct 29 01:06:38 2015 -0300

Cleanup in sfx2 tree

Replaced a few std::for_each occurences by range based for loops,
and the only boost::bind in such tree by a lambda, alongside with
a bind2nd call and boost/bind.hxx headers cleanup.

Change-Id: Ie5e58f5b7d23ec846fd7457a6bad0132e0278dbf
Reviewed-on: https://gerrit.libreoffice.org/19662
Reviewed-by: Michael Stahl 
Tested-by: Michael Stahl 

diff --git a/sfx2/inc/pch/precompiled_sfx.hxx b/sfx2/inc/pch/precompiled_sfx.hxx
index 8d93542..a1876f8 100644
--- a/sfx2/inc/pch/precompiled_sfx.hxx
+++ b/sfx2/inc/pch/precompiled_sfx.hxx
@@ -40,7 +40,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx
index 580de68..5679c35 100644
--- a/sfx2/source/bastyp/fltfnc.cxx
+++ b/sfx2/source/bastyp/fltfnc.cxx
@@ -1197,8 +1197,8 @@ void SfxFilterContainer::ReadFilters_Impl( bool bUpdate )
 {
 // global filter arry was modified, factory specific ones might need an
 // update too
-std::for_each(aImplArr.begin(), aImplArr.end(),
-std::mem_fun_ref(_Impl::Update));
+for (auto& aImpl : aImplArr)
+aImpl.Update();
 }
 }
 
diff --git a/sfx2/source/doc/DocumentMetadataAccess.cxx 
b/sfx2/source/doc/DocumentMetadataAccess.cxx
index 1122f80..385cf2a 100644
--- a/sfx2/source/doc/DocumentMetadataAccess.cxx
+++ b/sfx2/source/doc/DocumentMetadataAccess.cxx
@@ -48,14 +48,9 @@
 
 #include 
 
-#include 
-#include 
-
 #include 
 #include 
 #include 
-#include 
-#include 
 
 #include 
 #include 
@@ -890,9 +885,9 @@ throw (uno::RuntimeException, 
lang::IllegalArgumentException, std::exception)
 getAllParts(*m_pImpl) );
 ::std::remove_copy_if(parts.begin(), parts.end(),
 ::std::back_inserter(ret),
-::boost::bind(
-::std::logical_not(),
-::boost::bind(, ::boost::ref(*m_pImpl), _1, i_xType) 
));
+[this, _xType](uno::Reference< rdf::XURI > aPart) {
+return !isPartOfType(*m_pImpl, aPart, i_xType);
+} );
 return ::comphelper::containerToSequence(ret);
 }
 
@@ -1162,12 +1157,11 @@ throw (uno::RuntimeException, 
lang::IllegalArgumentException,
 "exception", *this, uno::makeAny(e));
 }
 
-std::for_each(StgFiles.begin(), StgFiles.end(),
-boost::bind(addContentOrStylesFileImpl, boost::ref(*m_pImpl), _1));
+for (const auto& aStgFile : StgFiles)
+addContentOrStylesFileImpl(*m_pImpl, aStgFile);
 
-std::for_each(MfstMetadataFiles.begin(), MfstMetadataFiles.end(),
-boost::bind(importFile, boost::ref(*m_pImpl),
-i_xStorage, baseURI, i_xHandler, _1));
+for (const auto& aMfstMetadataFile : MfstMetadataFiles)
+importFile(*m_pImpl, i_xStorage, baseURI, i_xHandler, 
aMfstMetadataFile);
 }
 
 void SAL_CALL DocumentMetadataAccess::storeMetadataToStorage(
diff --git a/sfx2/source/doc/Metadatable.cxx b/sfx2/source/doc/Metadatable.cxx
index b5929b4..77cf953 100644
--- a/sfx2/source/doc/Metadatable.cxx
+++ b/sfx2/source/doc/Metadatable.cxx
@@ -640,13 +640,11 @@ removeLink(Metadatable* i_pObject)
 XmlIdRegistryDocument::~XmlIdRegistryDocument()
 {
 // notify all list elements that are actually in the clipboard
-for (XmlIdMap_t::iterator iter(m_pImpl->m_XmlIdMap.begin());
-iter != m_pImpl->m_XmlIdMap.end(); ++iter)
-{
-::std::for_each(iter->second.first.begin(), iter->second.first.end(),
-removeLink);
-::std::for_each(iter->second.second.begin(), iter->second.second.end(),
-removeLink);
+for (auto& aXmlId : m_pImpl->m_XmlIdMap) {
+for (auto aLink : aXmlId.second.first)
+removeLink(aLink);
+for (auto aLink : aXmlId.second.second)
+removeLink(aLink);
 }
 }
 
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 1d0717a..82e919e 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -577,7 +577,7 @@ namespace
 io_rTypes.getConstArray(),
 io_rTypes.getConstArray() + io_rTypes.getLength(),
 aStrippedTypes.getArray(),
-::std::bind2nd( ::std::equal_to< uno::Type >(), i_rTypeToStrip )
+[_rTypeToStrip](const uno::Type& aType) { return aType == 
i_rTypeToStrip; }
 );
 

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

2015-09-03 Thread Takeshi Abe
 sfx2/inc/pch/precompiled_sfx.hxx|9 ++---
 sfx2/source/appl/appdispatchprovider.cxx|4 ++--
 sfx2/source/appl/appinit.cxx|4 ++--
 sfx2/source/appl/appopen.cxx|1 -
 sfx2/source/appl/childwin.cxx   |4 ++--
 sfx2/source/appl/helpdispatch.hxx   |4 ++--
 sfx2/source/appl/helpinterceptor.hxx|9 -
 sfx2/source/appl/imestatuswindow.cxx|3 ++-
 sfx2/source/appl/imestatuswindow.hxx|4 ++--
 sfx2/source/appl/macroloader.cxx|1 -
 sfx2/source/appl/newhelp.hxx|1 -
 sfx2/source/appl/opengrf.cxx|1 -
 sfx2/source/appl/sfxpicklist.cxx|4 ++--
 sfx2/source/appl/shutdownicon.cxx   |4 ++--
 sfx2/source/appl/shutdownicon.hxx   |4 ++--
 sfx2/source/appl/shutdowniconaqua.mm|4 ++--
 sfx2/source/appl/xpackcreator.cxx   |4 ++--
 sfx2/source/bastyp/fltlst.cxx   |3 ++-
 sfx2/source/bastyp/fltlst.hxx   |1 -
 sfx2/source/control/querystatus.cxx |4 ++--
 sfx2/source/control/thumbnailviewacc.hxx|8 
 sfx2/source/dialog/filedlgimpl.hxx  |4 ++--
 sfx2/source/dialog/mailmodel.cxx|4 ++--
 sfx2/source/doc/SfxDocumentMetaData.cxx |8 
 sfx2/source/doc/docfile.cxx |1 -
 sfx2/source/doc/doctemplates.cxx|6 +++---
 sfx2/source/doc/doctemplateslocal.hxx   |4 ++--
 sfx2/source/doc/iframe.cxx  |4 ++--
 sfx2/source/doc/objserv.cxx |3 ++-
 sfx2/source/doc/objxtor.cxx |4 ++--
 sfx2/source/doc/ownsubfilterservice.cxx |4 ++--
 sfx2/source/doc/plugin.cxx  |4 ++--
 sfx2/source/doc/printhelper.cxx |4 ++--
 sfx2/source/doc/printhelper.hxx |4 ++--
 sfx2/source/doc/sfxbasemodel.cxx|7 ---
 sfx2/source/doc/sfxmodelfactory.cxx |4 ++--
 sfx2/source/inc/docundomanager.hxx  |4 ++--
 sfx2/source/inc/eventsupplier.hxx   |4 ++--
 sfx2/source/inc/macroloader.hxx |4 ++--
 sfx2/source/inc/statcach.hxx|4 ++--
 sfx2/source/inc/workwin.hxx |4 ++--
 sfx2/source/notify/globalevents.cxx |7 +++
 sfx2/source/sidebar/CommandInfoProvider.cxx |4 ++--
 sfx2/source/sidebar/ControllerItem.cxx  |3 ++-
 sfx2/source/view/frmload.cxx|4 ++--
 sfx2/source/view/ipclient.cxx   |4 ++--
 sfx2/source/view/sfxbasecontroller.cxx  |9 -
 sfx2/source/view/viewsh.cxx |4 ++--
 48 files changed, 96 insertions(+), 105 deletions(-)

New commits:
commit d465e8273f1ee54450f0bf59c41bda93c54b3db4
Author: Takeshi Abe 
Date:   Tue Sep 1 18:13:22 2015 +0900

sfx2: tdf#88206 replace cppu::WeakImplHelper* etc.

with the variadic variants.

Change-Id: Id9b4ad4d1fa700c5ea3dd7417292cf2ddb7ade50
Reviewed-on: https://gerrit.libreoffice.org/18229
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sfx2/inc/pch/precompiled_sfx.hxx b/sfx2/inc/pch/precompiled_sfx.hxx
index 6c7b649..b4e6f5d 100644
--- a/sfx2/inc/pch/precompiled_sfx.hxx
+++ b/sfx2/inc/pch/precompiled_sfx.hxx
@@ -496,14 +496,9 @@
 #include 
 #include 
 #include 
-#include 
-#include 
+#include 
 #include 
-#include 
-#include 
-#include 
-#include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/sfx2/source/appl/appdispatchprovider.cxx 
b/sfx2/source/appl/appdispatchprovider.cxx
index 51a08a8..0b00f72 100644
--- a/sfx2/source/appl/appdispatchprovider.cxx
+++ b/sfx2/source/appl/appdispatchprovider.cxx
@@ -32,7 +32,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -59,7 +59,7 @@ using namespace ::com::sun::star::uno;
 
 namespace {
 
-class SfxAppDispatchProvider : public ::cppu::WeakImplHelper3< 
css::frame::XAppDispatchProvider,
+class SfxAppDispatchProvider : public ::cppu::WeakImplHelper< 
css::frame::XAppDispatchProvider,

css::lang::XServiceInfo,

css::lang::XInitialization >
 {
diff --git a/sfx2/source/appl/appinit.cxx b/sfx2/source/appl/appinit.cxx
index 0c1b6d7..de9c673 100644
--- a/sfx2/source/appl/appinit.cxx
+++ b/sfx2/source/appl/appinit.cxx
@@ -43,7 +43,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 
 #include 
@@ -76,7 +76,7 @@ using namespace ::com::sun::star::frame;
 using namespace ::com::sun::star::lang;
 using namespace ::com::sun::star;
 
-class SfxTerminateListener_Impl : public ::cppu::WeakImplHelper2< 
XTerminateListener, XServiceInfo >
+class 

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

2015-04-13 Thread Juan A . Suarez Romero
 sfx2/inc/guisaveas.hxx  |1 
 sfx2/source/dialog/alienwarn.cxx|   10 ++-
 sfx2/source/doc/guisaveas.cxx   |   49 +++-
 sfx2/source/inc/alienwarn.hxx   |3 +-
 sfx2/uiconfig/ui/alienwarndialog.ui |4 +-
 5 files changed, 51 insertions(+), 16 deletions(-)

New commits:
commit e904e6ad4876c095ab5ee7bd40540635c520c9de
Author: Juan A. Suarez Romero jasua...@igalia.com
Date:   Mon Dec 15 19:13:24 2014 +0100

tdf#90478: Show the right default format when saving

When saving a file that is not in ODF format (the default format), there
is a dialog asking if should keep the original format or rather use ODF.

But the default format can be changed to a different one than ODF. And
the dialog will still assume the ODF is the default one.

This commit fixes the wording in the dialog to use the the default
format instead of hard-coded ODF.

In order to keep the text simple, instead of using the long name for the
default format, it uses the proper file extension.

So if for example changes from ODF to Microsoft Word 97 default format,
and saving a non-Word document, the dialog will ask user if document
should be saved in default DOC format.

Change-Id: I0b259af9eca61161ec8a3d7e72d4722b5afdf4b4
Reviewed-on: https://gerrit.libreoffice.org/15170
Tested-by: Jenkins c...@libreoffice.org
Reviewed-by: Jacobo Aragunde Pérez jaragu...@igalia.com

diff --git a/sfx2/inc/guisaveas.hxx b/sfx2/inc/guisaveas.hxx
index 0c2aa90..19bfb51 100644
--- a/sfx2/inc/guisaveas.hxx
+++ b/sfx2/inc/guisaveas.hxx
@@ -80,6 +80,7 @@ public:
 const ::com::sun::star::uno::Reference 
::com::sun::star::frame::XModel  xModel,
 const OUString aOldUIName,
 const OUString aDefUIName,
+const OUString aDefExtension,
 bool bCanProceedFurther );
 
 static vcl::Window* GetModelWindow( const 
::com::sun::star::uno::Reference ::com::sun::star::frame::XModel  xModel );
diff --git a/sfx2/source/dialog/alienwarn.cxx b/sfx2/source/dialog/alienwarn.cxx
index d1dc6ea..e6c8234 100644
--- a/sfx2/source/dialog/alienwarn.cxx
+++ b/sfx2/source/dialog/alienwarn.cxx
@@ -25,7 +25,7 @@
 #include vcl/msgbox.hxx
 #include alienwarn.hxx
 
-SfxAlienWarningDialog::SfxAlienWarningDialog(vcl::Window* pParent, const 
OUString _rFormatName)
+SfxAlienWarningDialog::SfxAlienWarningDialog(vcl::Window* pParent, const 
OUString _rFormatName, const OUString _rDefaultExtension)
 : MessageDialog(pParent, AlienWarnDialog, sfx/ui/alienwarndialog.ui)
 {
 get(m_pWarningOnBox, ask);
@@ -34,6 +34,9 @@ SfxAlienWarningDialog::SfxAlienWarningDialog(vcl::Window* 
pParent, const OUStrin
 
m_pWarningOnBox-set_margin_left(QueryBox::GetStandardImage().GetSizePixel().Width()
 + 12);
 
 get(m_pKeepCurrentBtn, save);
+get(m_pUseDefaultFormatBtn, cancel);
+
+OUString aExtension = _rDefaultExtension.toAsciiUpperCase();
 
 // replace formatname (text)
 OUString sInfoText = get_primary_text();
@@ -45,6 +48,11 @@ SfxAlienWarningDialog::SfxAlienWarningDialog(vcl::Window* 
pParent, const OUStrin
 sInfoText = sInfoText.replaceAll( %FORMATNAME, _rFormatName );
 m_pKeepCurrentBtn-SetText( sInfoText );
 
+// replace defaultextension (button)
+sInfoText = m_pUseDefaultFormatBtn-GetText();
+sInfoText = sInfoText.replaceAll( %DEFAULTEXTENSION, aExtension );
+m_pUseDefaultFormatBtn-SetText( sInfoText );
+
 // load value of warning on checkbox from save options
 m_pWarningOnBox-Check( SvtSaveOptions().IsWarnAlienFormat() );
 }
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index c757869..1251942 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -317,6 +317,7 @@ public:
 
 bool ShowDocumentInfoDialog();
 
+OUString GetRecommendedExtension( const OUString aTypeName );
 OUString GetRecommendedDir( const OUString aSuggestedDir );
 OUString GetRecommendedName( const OUString aSuggestedName,
 const OUString aTypeName );
@@ -791,6 +792,10 @@ sal_Int8 ModelData_Impl::CheckFilter( const OUString 
aFilterName )
 OUString aPreusedFilterName = GetDocProps().getUnpackedValueOrDefault(
 
OUString(PreusedFilterName),
 OUString() );
+
+OUString aDefType = aDefFiltPropsHM.getUnpackedValueOrDefault( Type, 
OUString() );
+OUString aDefExtension = GetRecommendedExtension( aDefType );
+
 if ( !aPreusedFilterName.equals( aFilterName )  !aUIName.equals( 
aDefUIName ) )
 {
 // is it possible to get these names from somewhere and not just
@@ -828,7 +833,7 @@ sal_Int8 

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

2015-04-13 Thread Jacobo Aragunde Pérez
 sfx2/inc/guisaveas.hxx   |3 ++-
 sfx2/source/dialog/alienwarn.cxx |   13 +++--
 sfx2/source/doc/guisaveas.cxx|8 +---
 sfx2/source/inc/alienwarn.hxx|3 ++-
 4 files changed, 20 insertions(+), 7 deletions(-)

New commits:
commit 5c308ad7696f3873c0747afef1ea143047e4eafb
Author: Jacobo Aragunde Pérez jaragu...@igalia.com
Date:   Fri Apr 10 18:52:33 2015 +0200

tdf#90478: Hide explanation on ODF when default format is alien

When saving a file that is not in ODF format (the default format), there
is a dialog asking if should keep the original format or rather use ODF.

But the default format can be changed to a different one than ODF, and
the dialog will let users choose between saving in the default format
or the one they chose in the save as dialog.

In this case, the explanation about ODF shown in the dialog is
pointless, so this commit hides it.

Change-Id: I91cf95d35b70cb46e7667025a4a649b390205f0b
Reviewed-on: https://gerrit.libreoffice.org/15234
Tested-by: Jenkins c...@libreoffice.org
Reviewed-by: Jacobo Aragunde Pérez jaragu...@igalia.com

diff --git a/sfx2/inc/guisaveas.hxx b/sfx2/inc/guisaveas.hxx
index 19bfb51..914094b 100644
--- a/sfx2/inc/guisaveas.hxx
+++ b/sfx2/inc/guisaveas.hxx
@@ -81,7 +81,8 @@ public:
 const OUString aOldUIName,
 const OUString aDefUIName,
 const OUString aDefExtension,
-bool bCanProceedFurther );
+bool bCanProceedFurther,
+bool rDefaultIsAlien );
 
 static vcl::Window* GetModelWindow( const 
::com::sun::star::uno::Reference ::com::sun::star::frame::XModel  xModel );
 
diff --git a/sfx2/source/dialog/alienwarn.cxx b/sfx2/source/dialog/alienwarn.cxx
index e6c8234..09f59c1 100644
--- a/sfx2/source/dialog/alienwarn.cxx
+++ b/sfx2/source/dialog/alienwarn.cxx
@@ -25,7 +25,8 @@
 #include vcl/msgbox.hxx
 #include alienwarn.hxx
 
-SfxAlienWarningDialog::SfxAlienWarningDialog(vcl::Window* pParent, const 
OUString _rFormatName, const OUString _rDefaultExtension)
+SfxAlienWarningDialog::SfxAlienWarningDialog(vcl::Window* pParent, const 
OUString _rFormatName,
+ const OUString 
_rDefaultExtension, bool rDefaultIsAlien)
 : MessageDialog(pParent, AlienWarnDialog, sfx/ui/alienwarndialog.ui)
 {
 get(m_pWarningOnBox, ask);
@@ -36,7 +37,7 @@ SfxAlienWarningDialog::SfxAlienWarningDialog(vcl::Window* 
pParent, const OUStrin
 get(m_pKeepCurrentBtn, save);
 get(m_pUseDefaultFormatBtn, cancel);
 
-OUString aExtension = _rDefaultExtension.toAsciiUpperCase();
+OUString aExtension = ODF;
 
 // replace formatname (text)
 OUString sInfoText = get_primary_text();
@@ -48,6 +49,14 @@ SfxAlienWarningDialog::SfxAlienWarningDialog(vcl::Window* 
pParent, const OUStrin
 sInfoText = sInfoText.replaceAll( %FORMATNAME, _rFormatName );
 m_pKeepCurrentBtn-SetText( sInfoText );
 
+// hide ODF explanation if default format is alien
+// and set the proper extension in the button
+if( rDefaultIsAlien )
+{
+set_secondary_text(OUString());
+aExtension = _rDefaultExtension.toAsciiUpperCase();
+}
+
 // replace defaultextension (button)
 sInfoText = m_pUseDefaultFormatBtn-GetText();
 sInfoText = sInfoText.replaceAll( %DEFAULTEXTENSION, aExtension );
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 1251942..3dc833c 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -833,7 +833,8 @@ sal_Int8 ModelData_Impl::CheckFilter( const OUString 
aFilterName )
 return STATUS_SAVEAS;
 }
 }
-if ( !SfxStoringHelper::WarnUnacceptableFormat( GetModel(), 
aUIName, aDefUIName, aDefExtension, true ) )
+if ( !SfxStoringHelper::WarnUnacceptableFormat( GetModel(), 
aUIName, aDefUIName, aDefExtension,
+true, (bool)( 
nDefFiltFlags  SfxFilterFlags::ALIEN ) ) )
 return STATUS_SAVEAS_STANDARDNAME;
 }
 }
@@ -1875,13 +1876,14 @@ bool SfxStoringHelper::WarnUnacceptableFormat( const 
uno::Reference frame::XMod
 const OUString aOldUIName,
 const OUString 
/*aDefUIName*/,
 const OUString 
aDefExtension,
-bool 
/*bCanProceedFurther*/ )
+bool 
/*bCanProceedFurther*/,
+bool bDefIsAlien )
 {
 if ( !SvtSaveOptions().IsWarnAlienFormat() )
 return true;
 
 vcl::Window* 

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

2013-09-06 Thread Caolán McNamara
 sfx2/inc/backingcomp.hxx |3 --
 sfx2/source/dialog/backingcomp.cxx   |   28 
 sfx2/source/dialog/backingwindow.cxx |   48 +++
 sfx2/source/dialog/backingwindow.hxx |5 +++
 4 files changed, 53 insertions(+), 31 deletions(-)

New commits:
commit e7dd69d97af1e12b15fd82eaea2e2b51f9dca40b
Author: Caolán McNamara caol...@redhat.com
Date:   Fri Sep 6 13:55:59 2013 +0100

move backing component dnd support into the large thumbnail areas

of the backing window

Change-Id: Icf399a8834a25de43909769be08854134991885a

diff --git a/sfx2/inc/backingcomp.hxx b/sfx2/inc/backingcomp.hxx
index 16a2ae7..794e80d 100644
--- a/sfx2/inc/backingcomp.hxx
+++ b/sfx2/inc/backingcomp.hxx
@@ -73,9 +73,6 @@ class BackingComp : public  css::lang::XTypeProvider
 /** the owner frame of this component. */
 css::uno::Reference css::frame::XFrame  m_xFrame;
 
-/** helper for dragdrop. */
-css::uno::Reference css::datatransfer::dnd::XDropTargetListener  
m_xDropTargetListener;
-
 //__
 // interface
 
diff --git a/sfx2/source/dialog/backingcomp.cxx 
b/sfx2/source/dialog/backingcomp.cxx
index 906922c..0271164 100644
--- a/sfx2/source/dialog/backingcomp.cxx
+++ b/sfx2/source/dialog/backingcomp.cxx
@@ -21,8 +21,6 @@
 
 #include backingwindow.hxx
 
-#include svtools/openfiledroptargetlistener.hxx
-
 #include helpid.hrc
 
 #include com/sun/star/beans/NamedValue.hpp
@@ -31,7 +29,6 @@
 #include com/sun/star/beans/XPropertySet.hpp
 #include com/sun/star/awt/Toolkit.hpp
 #include com/sun/star/awt/XDataTransferProviderAccess.hpp
-#include com/sun/star/datatransfer/dnd/XDropTarget.hpp
 #include com/sun/star/awt/KeyEvent.hpp
 #include com/sun/star/awt/KeyModifier.hpp
 #include com/sun/star/frame/XLayoutManager.hpp
@@ -453,18 +450,6 @@ void SAL_CALL BackingComp::attachFrame( /*IN*/ const 
css::uno::Reference css::f
 // safe the frame reference
 m_xFrame = xFrame;
 
-// establish dragdrop mode
-OpenFileDropTargetListener* pDropListener = new 
OpenFileDropTargetListener( m_xContext, m_xFrame);
-m_xDropTargetListener = css::uno::Reference 
css::datatransfer::dnd::XDropTargetListener (static_cast ::cppu::OWeakObject* 
(pDropListener), css::uno::UNO_QUERY);
-
-css::uno::Reference css::awt::XToolkit2  xToolkit = 
css::awt::Toolkit::create( m_xContext );
-css::uno::Reference css::datatransfer::dnd::XDropTarget  xDropTarget = 
xToolkit-getDropTarget(m_xWindow);
-if (xDropTarget.is())
-{
-xDropTarget-addDropTargetListener(m_xDropTargetListener);
-xDropTarget-setActive(sal_True);
-}
-
 // initialize the component and it's parent window
 css::uno::Reference css::awt::XWindow  xParentWindow = 
xFrame-getContainerWindow();
 WorkWindow* pParent = (WorkWindow*)VCLUnoHelper::GetWindow(xParentWindow);
@@ -668,19 +653,6 @@ void SAL_CALL BackingComp::dispose()
 xDispatch-dispatch(aURL, css::uno::Sequence 
css::beans::PropertyValue());
 }
 
-// deregister dragdrop helper
-if (m_xDropTargetListener.is())
-{
-css::uno::Reference css::awt::XToolkit2  xToolkit = 
css::awt::Toolkit::create( m_xContext );
-css::uno::Reference css::datatransfer::dnd::XDropTarget  xDropTarget 
= xToolkit-getDropTarget(m_xWindow);
-if (xDropTarget.is())
-{
-xDropTarget-removeDropTargetListener(m_xDropTargetListener);
-xDropTarget-setActive(sal_False);
-}
-m_xDropTargetListener = css::uno::Reference 
css::datatransfer::dnd::XDropTargetListener ();
-}
-
 // stop listening at the window
 if (m_xWindow.is())
 {
diff --git a/sfx2/source/dialog/backingwindow.cxx 
b/sfx2/source/dialog/backingwindow.cxx
index 3b66cc9..e92bdc7 100644
--- a/sfx2/source/dialog/backingwindow.cxx
+++ b/sfx2/source/dialog/backingwindow.cxx
@@ -24,6 +24,7 @@
 
 #include unotools/dynamicmenuoptions.hxx
 #include svtools/langhelp.hxx
+#include svtools/openfiledroptargetlistener.hxx
 #include svtools/colorcfg.hxx
 
 #include comphelper/processfactory.hxx
@@ -127,6 +128,18 @@ BackingWindow::BackingWindow( Window* i_pParent ) :
 get( mpImpressTemplateThumbnails,   impress_templates);
 get( mpDrawTemplateThumbnails,  draw_templates);
 
+maDndWindows.push_back(mpAllRecentThumbnails);
+maDndWindows.push_back(mpWriterRecentThumbnails);
+maDndWindows.push_back(mpCalcRecentThumbnails);
+maDndWindows.push_back(mpImpressRecentThumbnails);
+maDndWindows.push_back(mpDrawRecentThumbnails);
+maDndWindows.push_back(mpDatabaseRecentThumbnails);
+maDndWindows.push_back(mpMathRecentThumbnails);
+maDndWindows.push_back(mpWriterTemplateThumbnails);
+maDndWindows.push_back(mpCalcTemplateThumbnails);
+maDndWindows.push_back(mpImpressTemplateThumbnails);
+maDndWindows.push_back(mpDrawTemplateThumbnails);
+
 try
 {
 mxContext.set( 

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

2013-04-18 Thread Miklos Vajna
On Wed, Apr 17, 2013 at 10:20:21AM +0200, Noel Grandin n...@peralex.com wrote:
 Aaah, sorry about that, I got the DBG_ASSERT the wrong way around.
 Pushed a fix - c3b1ce2097ea3b43234be3dfb1d529335b980ff8

Thanks, that indeed solved the bogus assert.


signature.asc
Description: Digital signature
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


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

2013-04-17 Thread Miklos Vajna
Hi Noel,

On Tue, Apr 16, 2013 at 01:04:46PM -0700, Noel Grandin n...@peralex.com wrote:
  sfx2/inc/sfx2/dispatch.hxx   |4 +
  sfx2/source/control/dispatch.cxx |   99 
 ++-
  2 files changed, 49 insertions(+), 54 deletions(-)
 
 New commits:
 commit 7e4db91a3900fd0bbce0f0592a045458a37862b3
 Author: Noel Grandin n...@peralex.com
 Date:   Mon Apr 15 11:21:16 2013 +0200
 
 Convert SfxShellStack_Impl from SfxPtrArr to std::vector
 
 Change-Id: I1ffd615a505029242a87337c9ef42c8156c42d70
 Reviewed-on: https://gerrit.libreoffice.org/3394

After this commit, I see some new warnings on startup:

warn:legacy.tools:27529:1:sfx2/source/control/dispatch.cxx:1592: pushed 
SfxShell already on stack

Reverting this commit (to test, you need to also revert
187a592df9bc9c1ef4b53fe6dce40a3c74f6bb67 and
e2ce3538943c510efa8041fca3c83728acf3a155, but they are unlikely to be
reason for this) makes the warning go away. I did not look into this
deeply, is it possible that the old container checked if the given
SfxShell is already on the stack, and if so, it didn't add it?

Miklos


signature.asc
Description: Digital signature
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


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

2013-04-17 Thread Noel Grandin

On 2013-04-17 10:06, Miklos Vajna wrote:

On Tue, Apr 16, 2013 at 01:04:46PM -0700, Noel Grandin n...@peralex.com wrote:

  sfx2/inc/sfx2/dispatch.hxx   |4 +
  sfx2/source/control/dispatch.cxx |   99 
++-
  2 files changed, 49 insertions(+), 54 deletions(-)

New commits:
commit 7e4db91a3900fd0bbce0f0592a045458a37862b3
Author: Noel Grandin n...@peralex.com
Date:   Mon Apr 15 11:21:16 2013 +0200

 Convert SfxShellStack_Impl from SfxPtrArr to std::vector
 
 Change-Id: I1ffd615a505029242a87337c9ef42c8156c42d70

 Reviewed-on: https://gerrit.libreoffice.org/3394

After this commit, I see some new warnings on startup:

warn:legacy.tools:27529:1:sfx2/source/control/dispatch.cxx:1592: pushed 
SfxShell already on stack

Reverting this commit (to test, you need to also revert
187a592df9bc9c1ef4b53fe6dce40a3c74f6bb67 and
e2ce3538943c510efa8041fca3c83728acf3a155, but they are unlikely to be
reason for this) makes the warning go away. I did not look into this
deeply, is it possible that the old container checked if the given
SfxShell is already on the stack, and if so, it didn't add it?




Aaah, sorry about that, I got the DBG_ASSERT the wrong way around.
Pushed a fix - c3b1ce2097ea3b43234be3dfb1d529335b980ff8



Disclaimer: http://www.peralex.com/disclaimer.html


___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


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

2013-04-16 Thread Noel Grandin
 sfx2/inc/sfx2/bindings.hxx   |3 -
 sfx2/source/control/bindings.cxx |   95 ---
 2 files changed, 52 insertions(+), 46 deletions(-)

New commits:
commit d3a279cbd308486250e2b652aac01d41e2a52f14
Author: Noel Grandin n...@peralex.com
Date:   Fri Apr 12 09:38:45 2013 +0200

Convert usage of SfxPtrArray to std::vector

Change-Id: I38664f59e4cfa7354196437901175c9ef9aa9006
Reviewed-on: https://gerrit.libreoffice.org/3356
Reviewed-by: Michael Stahl mst...@redhat.com
Tested-by: Michael Stahl mst...@redhat.com

diff --git a/sfx2/inc/sfx2/bindings.hxx b/sfx2/inc/sfx2/bindings.hxx
index 73ac3dc..9479e8f 100644
--- a/sfx2/inc/sfx2/bindings.hxx
+++ b/sfx2/inc/sfx2/bindings.hxx
@@ -121,6 +121,7 @@ private:
 const SfxFoundCache_Impl* pFound,
 const SfxPoolItem *pItem,
 SfxItemState eItemState );
+SAL_DLLPRIVATE SfxStateCache* GetStateCache( sal_uInt16 nId, sal_uInt16 
*pPos);
 DECL_DLLPRIVATE_LINK( NextJob_Impl, Timer * );
 
 public:
@@ -149,7 +150,7 @@ public:
 sal_Bool IsBound( sal_uInt16 nMsgId, sal_uInt16 nStartSearchAt = 0 
);
 
 const SfxSlot*   GetSlot( sal_uInt16 nMsgId );
-SfxStateCache*   GetStateCache( sal_uInt16 nId, sal_uInt16 *pPos = 0 );
+SfxStateCache*   GetStateCache( sal_uInt16 nId);
 SAL_DLLPRIVATE SfxStateCache* GetAnyStateCache_Impl( sal_uInt16 nId );
 /**
  * @param rpState the caller has to delete the pointer
diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx
index d2981d4..5df40c1 100644
--- a/sfx2/source/control/bindings.cxx
+++ b/sfx2/source/control/bindings.cxx
@@ -93,7 +93,7 @@ typedef boost::unordered_map sal_uInt16, bool  
InvalidateSlotMap;
 
 //
 
-DECL_PTRARRAY(SfxStateCacheArr_Impl, SfxStateCache*, 32, 16)
+typedef std::vectorSfxStateCache* SfxStateCacheArr_Impl;
 
 //
 
@@ -264,9 +264,8 @@ SfxBindings::~SfxBindings()
 DeleteControllers_Impl();
 
 // Delete Caches
-sal_uInt16 nCount = pImp-pCaches-Count();
-for ( sal_uInt16 nCache = 0; nCache  nCount; ++nCache )
-delete pImp-pCaches-GetObject(nCache);
+for(SfxStateCacheArr_Impl::const_iterator it = pImp-pCaches-begin(); it 
!= pImp-pCaches-end(); ++it)
+delete *it;
 
 DELETEZ( pImp-pWorkWin );
 
@@ -279,34 +278,34 @@ SfxBindings::~SfxBindings()
 void SfxBindings::DeleteControllers_Impl()
 {
 // in the first round delete SfxPopupWindows
-sal_uInt16 nCount = pImp-pCaches-Count();
+sal_uInt16 nCount = pImp-pCaches-size();
 sal_uInt16 nCache;
 for ( nCache = 0; nCache  nCount; ++nCache )
 {
 // Remember were you are
-SfxStateCache *pCache = pImp-pCaches-GetObject(nCache);
+SfxStateCache *pCache = (*pImp-pCaches)[nCache];
 sal_uInt16 nSlotId = pCache-GetId();
 
 // Delete SfxPopupWindow
 pCache-DeleteFloatingWindows();
 
 // Re-align, because the cache may have been reduced
-sal_uInt16 nNewCount = pImp-pCaches-Count();
+sal_uInt16 nNewCount = pImp-pCaches-size();
 if ( nNewCount  nCount )
 {
 nCache = GetSlotPos(nSlotId);
 if ( nCache = nNewCount ||
- nSlotId != pImp-pCaches-GetObject(nCache)-GetId() )
+ nSlotId != (*pImp-pCaches)[nCache]-GetId() )
 --nCache;
 nCount = nNewCount;
 }
 }
 
 // Delete all Caches
-for ( nCache = pImp-pCaches-Count(); nCache  0; --nCache )
+for ( nCache = pImp-pCaches-size(); nCache  0; --nCache )
 {
 // Get Cache via ::com::sun::star::sdbcx::Index
-SfxStateCache *pCache = pImp-pCaches-GetObject(nCache-1);
+SfxStateCache *pCache = (*pImp-pCaches)[ nCache-1 ];
 
 // unbind all controllers in the cache
 SfxControllerItem *pNext;
@@ -321,9 +320,9 @@ void SfxBindings::DeleteControllers_Impl()
 pCache-GetInternalController()-UnBind();
 
 // Delete Cache
-if( nCache-1  pImp-pCaches-Count() )
+if( nCache-1  (sal_uInt16) pImp-pCaches-size() )
 delete (*pImp-pCaches)[nCache-1];
-pImp-pCaches-Remove(nCache-1, 1);
+pImp-pCaches-erase(pImp-pCaches-begin()+ nCache - 1);
 }
 
 if( pImp-pUnoCtrlArr )
@@ -372,8 +371,8 @@ void SfxBindings::HidePopupCtrls_Impl( bool bHide )
 pImp-ePopupAction = SFX_POPUP_SHOW;
 }
 
-for ( sal_uInt16 nCache = 0; nCache  pImp-pCaches-Count(); ++nCache )
-pImp-pCaches-GetObject(nCache)-DeleteFloatingWindows();
+for(SfxStateCacheArr_Impl::const_iterator it = pImp-pCaches-begin(); it 
!= pImp-pCaches-end(); ++it)
+(*it)-DeleteFloatingWindows();
 pImp-ePopupAction = SFX_POPUP_DELETE;
 }
 
@@ -639,6 +638,14 @@ SfxStateCache* 

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

2013-04-16 Thread Noel Grandin
 sfx2/inc/sfx2/objface.hxx   |   17 --
 sfx2/source/control/objface.cxx |   65 ++--
 2 files changed, 30 insertions(+), 52 deletions(-)

New commits:
commit 3f153805b84e91dec3819a15ae04d2ba1a9721dc
Author: Noel Grandin n...@peralex.com
Date:   Fri Apr 12 16:24:02 2013 +0200

Convert SfxObjectUIArr_Impl from SfxPtrArr to std::vector

Also
- remove dead class definition SfxIFConfig_Impl, which was
  using SfxObjectUIArr_Impl
- simplify declaration sites, we don't need to dynamically allocate
  these arrays

Change-Id: I0f7110a324cc37f2eb2567cc066099ea4d86276c
Reviewed-on: https://gerrit.libreoffice.org/3359
Reviewed-by: Michael Stahl mst...@redhat.com
Tested-by: Michael Stahl mst...@redhat.com

diff --git a/sfx2/inc/sfx2/objface.hxx b/sfx2/inc/sfx2/objface.hxx
index 90315d0..8e1f772 100644
--- a/sfx2/inc/sfx2/objface.hxx
+++ b/sfx2/inc/sfx2/objface.hxx
@@ -32,14 +32,11 @@
 struct SfxFormalArgument;
 struct SfxInterface_Impl;
 class  SfxConfigItem;
-class  SfxIFConfig_Impl;
-class  SfxObjectUIArr_Impl ;
 class  SfxModule;
 class  SvStream;
 
 class SFX2_DLLPUBLIC SfxInterface
 {
-friend class SfxIFConfig_Impl;
 friend class SfxSlotPool;
 
 const char* pName;  // Sfx-internal name of interface
@@ -123,20 +120,6 @@ inline SfxSlot* SfxInterface::operator[]( sal_uInt16 nPos 
) const
 return nPos  nCount? pSlots+nPos: 0;
 }
 
-class SfxIFConfig_Impl
-{
-friend class SfxInterface;
-sal_uInt16  nCount;
-SfxObjectUIArr_Impl*pObjectBars;
-
-public:
-SfxIFConfig_Impl();
-~SfxIFConfig_Impl();
-sal_BoolStore(SvStream);
-voidRegisterObjectBar( sal_uInt16, const ResId, sal_uInt32 
nFeature, const String* pST=0 );
-sal_uInt16  GetType();
-};
-
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/control/objface.cxx b/sfx2/source/control/objface.cxx
index 90be4b5..8b9e0f9 100644
--- a/sfx2/source/control/objface.cxx
+++ b/sfx2/source/control/objface.cxx
@@ -77,16 +77,16 @@ struct SfxObjectUI_Impl
 }
 };
 
-DECL_PTRARRAY(SfxObjectUIArr_Impl, SfxObjectUI_Impl*, 2, 2)
+typedef std::vectorSfxObjectUI_Impl* SfxObjectUIArr_Impl;
 
 struct SfxInterface_Impl
 {
-SfxObjectUIArr_Impl*pObjectBars;// registered ObjectBars
-SfxObjectUIArr_Impl*pChildWindows;  // registered ChildWindows
+SfxObjectUIArr_Impl aObjectBars;// registered ObjectBars
+SfxObjectUIArr_Impl aChildWindows;  // registered ChildWindows
 ResId   aPopupRes;  // registered PopupMenu
 ResId   aStatBarRes;// registered StatusBar
 SfxModule*  pModule;
-sal_BoolbRegistered;
+sal_BoolbRegistered;
 
 SfxInterface_Impl() :
 aPopupRes(0,*SfxApplication::GetOrCreate()-GetSfxResManager()),
@@ -94,20 +94,15 @@ struct SfxInterface_Impl
 , pModule(NULL)
 , bRegistered(sal_False)
 {
-pObjectBars   = new SfxObjectUIArr_Impl;
-pChildWindows = new SfxObjectUIArr_Impl;
 }
 
 ~SfxInterface_Impl()
 {
-sal_uInt16 n;
-for (n=0; npObjectBars-Count(); n++)
-delete (*pObjectBars)[n];
-delete pObjectBars;
-
-for (n=0; npChildWindows-Count(); n++)
-delete (*pChildWindows)[n];
-delete pChildWindows;
+for (SfxObjectUIArr_Impl::const_iterator it = aObjectBars.begin(); it 
!= aObjectBars.end(); ++it)
+delete *it;
+
+for (SfxObjectUIArr_Impl::const_iterator it = aChildWindows.begin(); 
it != aChildWindows.end(); ++it)
+delete *it;
 }
 };
 
@@ -404,7 +399,7 @@ void SfxInterface::RegisterObjectBar( sal_uInt16 nPos, 
const ResId rResId, sal_
 {
 SfxObjectUI_Impl* pUI = CreateObjectBarUI_Impl( nPos, rResId, nFeature, 
pStr );
 if ( pUI )
-pImpData-pObjectBars-Append(pUI);
+pImpData-aObjectBars.push_back(pUI);
 }
 
 SfxObjectUI_Impl* CreateObjectBarUI_Impl( sal_uInt16 nPos, const ResId 
rResId, sal_uInt32 nFeature, const String *pStr )
@@ -447,10 +442,10 @@ const ResId SfxInterface::GetObjectBarResId( sal_uInt16 
nNo ) const
 }
 
 #ifdef DBG_UTIL
-sal_uInt16 nObjBarCount = pImpData-pObjectBars-Count();
+sal_uInt16 nObjBarCount = pImpData-aObjectBars.size();
 DBG_ASSERT( nNonObjBarCount,Objectbar is unknown! );
 #endif
-return (*pImpData-pObjectBars)[nNo]-aResId;
+return pImpData-aObjectBars[nNo]-aResId;
 }
 
 //
@@ -471,10 +466,10 @@ sal_uInt16 SfxInterface::GetObjectBarPos( sal_uInt16 nNo 
) const
 }
 
 #ifdef DBG_UTIL
-sal_uInt16 nObjBarCount = pImpData-pObjectBars-Count();
+sal_uInt16 nObjBarCount = pImpData-aObjectBars.size();
 DBG_ASSERT( nNonObjBarCount,Objectbar is unknown! );
 #endif
-return 

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

2013-04-16 Thread Noel Grandin
 sfx2/inc/sfx2/dispatch.hxx   |4 +
 sfx2/source/control/dispatch.cxx |   99 ++-
 2 files changed, 49 insertions(+), 54 deletions(-)

New commits:
commit 7e4db91a3900fd0bbce0f0592a045458a37862b3
Author: Noel Grandin n...@peralex.com
Date:   Mon Apr 15 11:21:16 2013 +0200

Convert SfxShellStack_Impl from SfxPtrArr to std::vector

Change-Id: I1ffd615a505029242a87337c9ef42c8156c42d70
Reviewed-on: https://gerrit.libreoffice.org/3394
Reviewed-by: Michael Stahl mst...@redhat.com
Tested-by: Michael Stahl mst...@redhat.com

diff --git a/sfx2/inc/sfx2/dispatch.hxx b/sfx2/inc/sfx2/dispatch.hxx
index c7aaae3..2b02a5e 100644
--- a/sfx2/inc/sfx2/dispatch.hxx
+++ b/sfx2/inc/sfx2/dispatch.hxx
@@ -28,11 +28,11 @@
 #include sfx2/bindings.hxx
 #include sfx2/viewfrm.hxx
 #include map
+#include vector
 
 class SfxSlotServer;
 class SfxShell;
 class SfxRequest;
-class SfxShellStack_Impl;
 class SfxHintPoster;
 class SfxViewFrame;
 class SfxBindings;
@@ -41,6 +41,8 @@ class SfxPopupMenuManager;
 class SfxModule;
 struct SfxDispatcher_Impl;
 
+typedef std::vectorSfxShell* SfxShellStack_Impl;
+
 namespace com
 {
 namespace sun
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index 16a83a1..26fd6f0 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -30,6 +30,7 @@
 #include stdio.h
 #include stdarg.h
 #include stdlib.h  // due to bsearch
+#include algorithm
 
 #include svtools/helpopt.hxx
 
@@ -37,7 +38,6 @@
 #include appdata.hxx
 #include sfx2/sfxhelp.hxx
 #include sfx2/dispatch.hxx
-#include sfx2/minstack.hxx
 #include sfx2/msg.hxx
 #include sfx2/objface.hxx
 #include sfx2/bindings.hxx
@@ -67,8 +67,6 @@ DBG_NAME(SfxDispatcherFillState)
 
 typedef std::vectorSfxRequest* SfxRequestPtrArray;
 
-DECL_PTRSTACK(SfxShellStack_Impl, SfxShell*, 8, 4 );
-
 struct SfxToDo_Impl
 {
 SfxShell*  pCluster;
@@ -552,14 +550,15 @@ sal_Bool SfxDispatcher::CheckVirtualStack( const 
SfxShell rShell, sal_Bool bDee
 for(std::dequeSfxToDo_Impl::reverse_iterator i = 
pImp-aToDoStack.rbegin(); i != pImp-aToDoStack.rend(); ++i)
 {
 if(i-bPush)
-aStack.Push(i-pCluster);
+aStack.push_back(i-pCluster);
 else
 {
 SfxShell* pPopped(NULL);
 do
 {
-DBG_ASSERT( aStack.Count(), popping from empty stack );
-pPopped = aStack.Pop();
+DBG_ASSERT( !aStack.empty(), popping from empty stack );
+pPopped = aStack.back();
+aStack.pop_back();
 }
 while(i-bUntil  pPopped != i-pCluster);
 DBG_ASSERT(pPopped == i-pCluster, popping unpushed 
SfxInterface);
@@ -568,9 +567,9 @@ sal_Bool SfxDispatcher::CheckVirtualStack( const SfxShell 
rShell, sal_Bool bDee
 
 sal_Bool bReturn;
 if ( bDeep )
-bReturn = aStack.Contains(rShell);
+bReturn = std::find(aStack.begin(), aStack.end(), rShell) != 
aStack.end();
 else
-bReturn = aStack.Top() == rShell;
+bReturn = aStack.back() == rShell;
 return bReturn;
 }
 
@@ -596,15 +595,15 @@ sal_uInt16 SfxDispatcher::GetShellLevel( const SfxShell 
rShell )
 SFX_STACK(SfxDispatcher::GetShellLevel);
 Flush();
 
-for ( sal_uInt16 n = 0; n  pImp-aStack.Count(); ++n )
-if ( pImp-aStack.Top( n ) == rShell )
+for ( sal_uInt16 n = 0; n  pImp-aStack.size(); ++n )
+if ( *( pImp-aStack.rbegin() + n ) == rShell )
 return n;
 if ( pImp-pParent )
 {
 sal_uInt16 nRet = pImp-pParent-GetShellLevel(rShell);
 if ( nRet == USHRT_MAX )
 return nRet;
-return  nRet + pImp-aStack.Count();
+return  nRet + pImp-aStack.size();
 }
 
 return USHRT_MAX;
@@ -624,9 +623,9 @@ SfxShell *SfxDispatcher::GetShell(sal_uInt16 nIdx) const
 */
 
 {
-sal_uInt16 nShellCount = pImp-aStack.Count();
+sal_uInt16 nShellCount = pImp-aStack.size();
 if ( nIdx  nShellCount )
-return pImp-aStack.Top(nIdx);
+return *(pImp-aStack.rbegin() + nIdx);
 else if ( pImp-pParent )
 return pImp-pParent-GetShell( nIdx - nShellCount );
 return 0;
@@ -717,8 +716,8 @@ void SfxDispatcher::DoActivate_Impl( sal_Bool bMDI, 
SfxViewFrame* /* pOld */ )
 if ( IsAppDispatcher() )
 return;
 
-for ( int i = int(pImp-aStack.Count()) - 1; i = 0; --i )
-pImp-aStack.Top( (sal_uInt16) i )-DoActivate_Impl(pImp-pFrame, 
bMDI);
+for ( int i = int(pImp-aStack.size()) - 1; i = 0; --i )
+(*(pImp-aStack.rbegin() + i ))-DoActivate_Impl(pImp-pFrame, bMDI);
 
 if ( bMDI  pImp-pFrame )
 {
@@ -743,8 +742,8 @@ void SfxDispatcher::DoActivate_Impl( sal_Bool bMDI, 
SfxViewFrame* /* pOld */ )
 
 void SfxDispatcher::DoParentActivate_Impl()
 {
-for ( int i = int(pImp-aStack.Count()) - 1; i = 0; --i )
-pImp-aStack.Top( (sal_uInt16) i )-ParentActivate();
+

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

2013-04-15 Thread Noel Grandin
 sfx2/inc/resmgr.hxx  |   65 ---
 sfx2/inc/sfx2/app.hxx|1 
 sfx2/source/appl/appdata.cxx |1 
 sfx2/source/inc/appdata.hxx  |2 -
 4 files changed, 69 deletions(-)

New commits:
commit f47c3906ee0fc35f4b219fb24a0e270956821369
Author: Noel Grandin n...@peralex.com
Date:   Mon Apr 15 10:36:16 2013 +0200

remove dead class SfxResourceManager

Change-Id: I33590e7907c593d821e2eafda0e04c76c8b99879
Reviewed-on: https://gerrit.libreoffice.org/3393
Reviewed-by: Thomas Arnhold tho...@arnhold.org
Tested-by: Thomas Arnhold tho...@arnhold.org

diff --git a/sfx2/inc/resmgr.hxx b/sfx2/inc/resmgr.hxx
deleted file mode 100644
index 7e6f837..000
--- a/sfx2/inc/resmgr.hxx
+++ /dev/null
@@ -1,65 +0,0 @@
-/* -*- 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/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the License); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#ifndef _SFX_RESMGR_HXX
-#define _SFX_RESMGR_HXX
-
-#include sfx2/minarray.hxx
-
-class SfxMessageDescription;
-class SfxMessageTable;
-class Bitmap;
-class ResMgr;
-
-DECL_PTRARRAY(SfxResMgrArr, ResMgr *, 1, 1);
-
-// INCLUDE ---
-
-class SfxResourceManager
-{
-SfxResMgrArraResMgrArr;
-SfxResMgrArraResMgrBmpArr;
-sal_uInt16  nEnterCount;
-SfxMessageTable*pMessageTable;
-
-private:
-voidClearMsgTable_Impl();
-SfxMessageDescription*  MakeDesc_Impl(sal_uInt16);
-
-public:
-SfxResourceManager();
-~SfxResourceManager();
-
-sal_uInt16  RegisterResource( const char *pFileName);
-voidReleaseResource( sal_uInt16 nRegisterId );
-
-sal_uInt16  RegisterBitmap(const char *pMono, const 
char *pColor);
-
-sal_uInt16  RegisterBitmap( const char *pSingleFile );
-voidReleaseBitmap( sal_uInt16 nRegisterId );
-
-Bitmap  GetAllBitmap( sal_uInt16 nBmpsPerRow );
-
-voidEnter();
-voidLeave();
-SfxMessageDescription*  CreateDescription( sal_uInt16 nId );
-};
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/sfx2/app.hxx b/sfx2/inc/sfx2/app.hxx
index 2f81d6d..858140d 100644
--- a/sfx2/inc/sfx2/app.hxx
+++ b/sfx2/inc/sfx2/app.hxx
@@ -65,7 +65,6 @@ class SfxNewFileDialog;
 class SfxObjectShell;
 class SfxObjectShellArr_Impl;
 class SfxProgress;
-class SfxResourceManager;
 class SfxSlotPool;
 class SfxStbCtrlFactArr_Impl;
 class SfxTbxCtrlFactArr_Impl;
diff --git a/sfx2/source/appl/appdata.cxx b/sfx2/source/appl/appdata.cxx
index 2988d8b..a2c79ca 100644
--- a/sfx2/source/appl/appdata.cxx
+++ b/sfx2/source/appl/appdata.cxx
@@ -112,7 +112,6 @@ SfxAppData_Impl::SfxAppData_Impl( SfxApplication* )
 , pBasMgrListener( new SfxBasicManagerCreationListener( *this ) )
 , pViewFrame( 0 )
 , pSlotPool( 0 )
-, pResMgr( 0 )
 , pAppDispat( 0 )
 , pInterfaces( 0 )
 , nDocNo(0)
diff --git a/sfx2/source/inc/appdata.hxx b/sfx2/source/inc/appdata.hxx
index 786528a..3e92ccd8 100644
--- a/sfx2/source/inc/appdata.hxx
+++ b/sfx2/source/inc/appdata.hxx
@@ -56,7 +56,6 @@ class SfxObjectShellArr_Impl;
 class ResMgr;
 class SfxViewFrame;
 class SfxSlotPool;
-class SfxResourceManager;
 class SfxDispatcher;
 class SfxInterface;
 class BasicManager;
@@ -129,7 +128,6 @@ public:
 pBasMgrListener;
 SfxViewFrame*   pViewFrame;
 SfxSlotPool*pSlotPool;
-SfxResourceManager* pResMgr;
 SfxDispatcher*  pAppDispat; // Dispatcher if no document
 SfxInterface**  pInterfaces;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-04-11 Thread Caolán McNamara
 sfx2/inc/sfx2/docfile.hxx|3 +++
 sfx2/source/appl/appopen.cxx |2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 60683b6de3f0ef0e9b22de5f5159086eb64e9f33
Author: Caolán McNamara caol...@redhat.com
Date:   Thu Apr 11 15:38:20 2013 +0100

Resolves: fdo#63426 presentation wizard crashes

This effectively reverts the code parts of
13e8f68e82713cae2d081a236b260bda12aafa23
fix memory leak and add some documentation

Change-Id: I66fa052f79185e1348c14e99954b04bf0a4622e5

diff --git a/sfx2/inc/sfx2/docfile.hxx b/sfx2/inc/sfx2/docfile.hxx
index 5aef2f2..fcf7351 100644
--- a/sfx2/inc/sfx2/docfile.hxx
+++ b/sfx2/inc/sfx2/docfile.hxx
@@ -71,6 +71,9 @@ class SFX2_DLLPUBLIC SfxMedium : public SvRefBase
 public:
 
 SfxMedium();
+/**
+ * @param pSet Takes ownership
+ */
 SfxMedium( const String rName,
StreamMode nOpenMode,
const SfxFilter *pFilter = 0,
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index d88ecb7..1e8a832 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -375,8 +375,8 @@ sal_uIntPtr SfxApplication::LoadTemplate( 
SfxObjectShellLock xDoc, const String
 if ( !xDoc.Is() )
 xDoc = SfxObjectShell::CreateObject( pFilter-GetServiceName() );
 
+//pMedium takes ownership of pSet
 SfxMedium *pMedium = new SfxMedium( rFileName, STREAM_STD_READ, 
pFilter, pSet );
-delete pSet;
 if(!xDoc-DoLoad(pMedium))
 {
 ErrCode nErrCode = xDoc-GetErrorCode();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-04-02 Thread Tor Lillqvist
 sfx2/inc/sfx2/app.hxx|5 +-
 sfx2/inc/sfx2/dispatch.hxx   |1 
 sfx2/source/appl/appmisc.cxx |   82 ---
 sfx2/source/control/dispatch.cxx |   65 --
 4 files changed, 3 insertions(+), 150 deletions(-)

New commits:
commit a2bf98857b675b2d10a4fd93a0413229abebf3f1
Author: Tor Lillqvist t...@iki.fi
Date:   Fri Mar 29 11:52:00 2013 +0200

Get rid of the slots.cfg mechanism

I very much doubt anybody is using it. It has never been documented as far 
as
I can see for OpenOffice.org and even less for LibreOffice. I only found it
mentioned in the StarOffice 6.0 Software Administration Guide.

Change-Id: I03f272427ef6717e3e3ff957f32ffe1f696d93c9
Reviewed-on: https://gerrit.libreoffice.org/3118
Reviewed-by: Michael Stahl mst...@redhat.com
Tested-by: Michael Stahl mst...@redhat.com

diff --git a/sfx2/inc/sfx2/app.hxx b/sfx2/inc/sfx2/app.hxx
index ab88440..bc8613f 100644
--- a/sfx2/inc/sfx2/app.hxx
+++ b/sfx2/inc/sfx2/app.hxx
@@ -251,8 +251,9 @@ public:
 SAL_DLLPRIVATE void Registrations_Impl();
 SAL_DLLPRIVATE SfxWorkWindow* GetWorkWindow_Impl(const SfxViewFrame 
*pFrame=0) const;
 
-// TODO/CLEANUP: still needed?
-SAL_DLLPRIVATE std::vectorsal_uInt16* GetDisabledSlotList_Impl();
+// TODO/CLEANUP: still needed? -- unclear whether this comment
+// refers to the GetDisabledSlotList_Impl() method which was
+// already removed, or the below methods?
 SAL_DLLPRIVATE SfxSlotPool GetAppSlotPool_Impl() const;
 SAL_DLLPRIVATE SfxModule*   GetModule_Impl();
 SAL_DLLPRIVATE ResMgr*  GetOffResManager_Impl();
diff --git a/sfx2/inc/sfx2/dispatch.hxx b/sfx2/inc/sfx2/dispatch.hxx
index f871838..c7aaae3 100644
--- a/sfx2/inc/sfx2/dispatch.hxx
+++ b/sfx2/inc/sfx2/dispatch.hxx
@@ -182,7 +182,6 @@ public:
 SfxItemStateQueryState( sal_uInt16 nSID, const SfxPoolItem* 
rpState );
 SfxItemStateQueryState( sal_uInt16 nSID, 
::com::sun::star::uno::Any rAny );
 
-sal_BoolIsAllowed( sal_uInt16 nSlot ) const;
 ::com::sun::star::frame::XDispatch*  GetDispatchInterface( const 
String );
 voidSetDisableFlags( sal_uInt32 nFlags );
 sal_uInt32  GetDisableFlags() const;
diff --git a/sfx2/source/appl/appmisc.cxx b/sfx2/source/appl/appmisc.cxx
index bd55b24..2cd1336 100644
--- a/sfx2/source/appl/appmisc.cxx
+++ b/sfx2/source/appl/appmisc.cxx
@@ -155,88 +155,6 @@ SfxProgress* SfxApplication::GetProgress() const
 return pAppData_Impl-pProgress;
 }
 
-//
-
-std::vectorsal_uInt16* SfxApplication::GetDisabledSlotList_Impl()
-{
-sal_Bool bError = sal_False;
-std::vectorsal_uInt16* pList = pAppData_Impl-pDisabledSlotList;
-if ( !pList )
-{
-// Is there a slot file?
-INetURLObject aUserObj( SvtPathOptions().GetUserConfigPath() );
-aUserObj.insertName( slots.cfg );
-SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( 
aUserObj.GetMainURL( INetURLObject::NO_DECODE ), STREAM_STD_READ );
-if ( !pStream || pStream-GetError() == ERRCODE_IO_NOTEXISTS )
-{
-delete pStream;
-INetURLObject aObj( SvtPathOptions().GetConfigPath() );
-aObj.insertName( slots.cfg );
-pStream = ::utl::UcbStreamHelper::CreateStream( aObj.GetMainURL( 
INetURLObject::NO_DECODE ), STREAM_STD_READ );
-}
-
-sal_Bool bSlotsEnabled = SvtInternalOptions().SlotCFGEnabled();
-sal_Bool bSlots = ( pStream  !pStream-GetError() );
-if( bSlots  bSlotsEnabled )
-{
-// Read Slot file
-String aTitle  = 
pStream-ReadUniOrByteString(pStream-GetStreamCharSet());
-if ( aTitle.CompareToAscii(SfxSlotFile ) == COMPARE_EQUAL )
-{
-sal_uInt16 nCount;
-(*pStream)  nCount;
-pList = pAppData_Impl-pDisabledSlotList =
-new std::vectorsal_uInt16;
-
-sal_uInt16 nSlot;
-for ( sal_uInt16 n=0; nnCount; n++ )
-{
-(*pStream)  nSlot;
-pList-push_back( nSlot );
-}
-
-aTitle = 
pStream-ReadUniOrByteString(pStream-GetStreamCharSet());
-if ( aTitle.CompareToAscii(END ) != COMPARE_EQUAL || 
pStream-GetError() )
-{
-// Read failed
-DELETEZ( pList );
-bError = sal_True;
-}
-}
-else
-{
-// Stream detection failure
-bError = sal_True;
-}
-}
-else if ( bSlots != bSlotsEnabled )
-{
-// If no slot list entry, then no slot file shall exist
-bError = sal_True;
-}
-
-

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

2013-04-02 Thread Tor Lillqvist
 sfx2/inc/sfx2/shell.hxx  |4 
 sfx2/source/appl/workwin.cxx |2 --
 2 files changed, 6 deletions(-)

New commits:
commit f019eea0f50a99788482cd564352bf67bab9
Author: Tor Lillqvist t...@iki.fi
Date:   Mon Apr 1 10:37:06 2013 +0300

SFX_VISIBILITY_PLUGCLIENT, SERVER and RECORDING are unused

Change-Id: I1fd581c8ca44cfb48184d8a17e6077707f038bd4
Reviewed-on: https://gerrit.libreoffice.org/3148
Reviewed-by: Luboš Luňák l.lu...@suse.cz
Tested-by: Luboš Luňák l.lu...@suse.cz

diff --git a/sfx2/inc/sfx2/shell.hxx b/sfx2/inc/sfx2/shell.hxx
index 344294a..cba6efa 100644
--- a/sfx2/inc/sfx2/shell.hxx
+++ b/sfx2/inc/sfx2/shell.hxx
@@ -336,11 +336,7 @@ inline void SfxShell::SetPool
 #define SFX_POSITION_MASK   0x000F
 #define SFX_VISIBILITY_MASK 0xFFF0
 #define SFX_VISIBILITY_UNVISIBLE0x  // Never visible
-#define SFX_VISIBILITY_PLUGSERVER   0x0010
-#define SFX_VISIBILITY_PLUGCLIENT   0x0020
 #define SFX_VISIBILITY_VIEWER   0x0040
-// One is still free!
-#define SFX_VISIBILITY_RECORDING0x0200
 #define SFX_VISIBILITY_READONLYDOC  0x0400
 #define SFX_VISIBILITY_DESKTOP  0x0800
 #define SFX_VISIBILITY_STANDARD 0x1000
diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx
index cce1d39..4108102 100644
--- a/sfx2/source/appl/workwin.cxx
+++ b/sfx2/source/appl/workwin.cxx
@@ -1225,8 +1225,6 @@ sal_Bool SfxWorkWindow::IsVisible_Impl( sal_uInt16 nMode 
) const
 return sal_True;
 case SFX_VISIBILITY_UNVISIBLE:
 return sal_False;
-case SFX_VISIBILITY_PLUGSERVER:
-case SFX_VISIBILITY_PLUGCLIENT:
 case SFX_VISIBILITY_CLIENT:
 case SFX_VISIBILITY_SERVER:
 return !!(nMode  nUpdateMode);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-03-27 Thread Rafael Dominguez
 sfx2/inc/sfx2/templatecontaineritem.hxx  |1 
 sfx2/inc/sfx2/templatelocalview.hxx  |2 
 sfx2/inc/sfx2/thumbnailview.hxx  |2 
 sfx2/source/control/templateabstractview.cxx |2 
 sfx2/source/control/templatelocalview.cxx|  111 +--
 sfx2/source/control/thumbnailview.cxx|5 +
 sfx2/source/doc/templatedlg.cxx  |   22 ++---
 7 files changed, 90 insertions(+), 55 deletions(-)

New commits:
commit 036c783b4c755c3054ab89a16853a145a13cbcfe
Author: Rafael Dominguez venccsra...@gmail.com
Date:   Tue Mar 26 19:00:11 2013 -0430

Separate template region ids from thumbnail ids.

- Update all actions to use the new system.

Change-Id: I22da25a4bbba4604f5df42f440e6532076d39457
Reviewed-on: https://gerrit.libreoffice.org/3075
Reviewed-by: Bosdonnat Cedric cedric.bosdon...@free.fr
Tested-by: Bosdonnat Cedric cedric.bosdon...@free.fr

diff --git a/sfx2/inc/sfx2/templatecontaineritem.hxx 
b/sfx2/inc/sfx2/templatecontaineritem.hxx
index 4768604..527571c 100644
--- a/sfx2/inc/sfx2/templatecontaineritem.hxx
+++ b/sfx2/inc/sfx2/templatecontaineritem.hxx
@@ -17,6 +17,7 @@ class TemplateContainerItem : public ThumbnailViewItem
 {
 public:
 
+sal_uInt16 mnRegionId;
 BitmapEx maPreview2;
 BitmapEx maPreview3;
 BitmapEx maPreview4;
diff --git a/sfx2/inc/sfx2/templatelocalview.hxx 
b/sfx2/inc/sfx2/templatelocalview.hxx
index 7ea226c..da51114 100644
--- a/sfx2/inc/sfx2/templatelocalview.hxx
+++ b/sfx2/inc/sfx2/templatelocalview.hxx
@@ -42,6 +42,8 @@ public:
 
 virtual void showRegion (ThumbnailViewItem *pItem);
 
+sal_uInt16 getCurRegionItemId () const;
+
 sal_uInt16 getRegionId (size_t pos) const;
 
 std::vectorOUString getFolderNames ();
diff --git a/sfx2/inc/sfx2/thumbnailview.hxx b/sfx2/inc/sfx2/thumbnailview.hxx
index 8d7f46a..467ac74 100644
--- a/sfx2/inc/sfx2/thumbnailview.hxx
+++ b/sfx2/inc/sfx2/thumbnailview.hxx
@@ -192,6 +192,8 @@ public:
 
 sal_uInt16 GetItemId( const Point rPos ) const;
 
+sal_uInt16 getNextItemId () const;
+
 long GetItemWidth() const { return mnItemWidth; }
 
 long GetItemHeight() const { return mnItemHeight; }
diff --git a/sfx2/source/control/templateabstractview.cxx 
b/sfx2/source/control/templateabstractview.cxx
index baa72ee..eb725ba 100644
--- a/sfx2/source/control/templateabstractview.cxx
+++ b/sfx2/source/control/templateabstractview.cxx
@@ -375,7 +375,7 @@ void TemplateAbstractView::OnItemDblClicked 
(ThumbnailViewItem *pItem)
 {
 // Fill templates
 
-mnCurRegionId = pContainerItem-mnId-1;
+mnCurRegionId = pContainerItem-mnRegionId+1;
 maCurRegionName = pContainerItem-maTitle;
 maFTName.SetText(maCurRegionName);
 showRegion(pItem);
diff --git a/sfx2/source/control/templatelocalview.cxx 
b/sfx2/source/control/templatelocalview.cxx
index 8c41502..9ab4ad6 100644
--- a/sfx2/source/control/templatelocalview.cxx
+++ b/sfx2/source/control/templatelocalview.cxx
@@ -61,6 +61,7 @@ void TemplateLocalView::Populate ()
 
 TemplateContainerItem* pItem = new TemplateContainerItem( *this );
 pItem-mnId = i+1;
+pItem-mnRegionId = i;
 pItem-maTitle = aRegionName;
 pItem-setSelectClickHdl(LINK(this,ThumbnailView,OnItemSelected));
 
@@ -100,11 +101,11 @@ void TemplateLocalView::reload ()
 // Check if we are currently browsing a region or root folder
 if (mnCurRegionId)
 {
-sal_uInt16 nItemId = mnCurRegionId + 1;
+sal_uInt16 nRegionId = mnCurRegionId - 1;   //Is offset by 1
 
 for (size_t i = 0; i  maRegions.size(); ++i)
 {
-if (maRegions[i]-mnId == nItemId)
+if (maRegions[i]-mnRegionId == nRegionId)
 {
 showRegion(maRegions[i]);
 break;
@@ -128,6 +129,7 @@ void TemplateLocalView::showRootRegion()
 TemplateContainerItem *pCur = maRegions[i];
 TemplateContainerItem *pItem = new TemplateContainerItem(*this);
 pItem-mnId = pCur-mnId;
+pItem-mnRegionId = pCur-mnRegionId;
 pItem-maTitle = pCur-maTitle;
 pItem-maTemplates = pCur-maTemplates;
 pItem-setSelectClickHdl(LINK(this,ThumbnailView,OnItemSelected));
@@ -147,7 +149,7 @@ void TemplateLocalView::showRegion(ThumbnailViewItem *pItem)
 {
 mnHeaderHeight = maAllButton.GetSizePixel().getHeight() + 
maAllButton.GetPosPixel().Y() * 2;
 
-mnCurRegionId = pItem-mnId-1;
+mnCurRegionId = static_castTemplateContainerItem*(pItem)-mnRegionId+1;
 maCurRegionName = pItem-maTitle;
 maAllButton.Show(true);
 maFTName.Show(true);
@@ -157,6 +159,17 @@ void TemplateLocalView::showRegion(ThumbnailViewItem 
*pItem)
 maOpenRegionHdl.Call(NULL);
 }
 
+sal_uInt16 TemplateLocalView::getCurRegionItemId() const
+{
+for (size_t i = 0; i  maRegions.size(); ++i)
+{
+if (maRegions[i]-mnRegionId == mnCurRegionId-1)
+return 

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

2013-03-27 Thread Rafael Dominguez
 sfx2/inc/sfx2/templatelocalview.hxx|2 
 sfx2/source/control/templatelocalview.cxx  |   22 ++-
 sfx2/source/control/templatesearchview.cxx |7 +-
 sfx2/source/doc/templatedlg.cxx|   90 ++---
 sfx2/source/inc/templatesearchview.hxx |2 
 sfx2/source/inc/templatesearchviewitem.hxx |3 
 6 files changed, 62 insertions(+), 64 deletions(-)

New commits:
commit 7ae8cf64aefedb79abf98aa4c1fe421f86c0db48
Author: Rafael Dominguez venccsra...@gmail.com
Date:   Tue Mar 26 23:07:57 2013 -0430

Delete the correct template from the selected search results.

Change-Id: I2fe82b20e9b4a78a3e8e587a5720054f845d
Reviewed-on: https://gerrit.libreoffice.org/3077
Reviewed-by: Bosdonnat Cedric cedric.bosdon...@free.fr
Tested-by: Bosdonnat Cedric cedric.bosdon...@free.fr

diff --git a/sfx2/inc/sfx2/templatelocalview.hxx 
b/sfx2/inc/sfx2/templatelocalview.hxx
index da51114..17eb140 100644
--- a/sfx2/inc/sfx2/templatelocalview.hxx
+++ b/sfx2/inc/sfx2/templatelocalview.hxx
@@ -46,6 +46,8 @@ public:
 
 sal_uInt16 getRegionId (size_t pos) const;
 
+OUString getRegionName(const sal_uInt16 nRegionId) const;
+
 std::vectorOUString getFolderNames ();
 
 std::vectorTemplateItemProperties
diff --git a/sfx2/source/control/templatelocalview.cxx 
b/sfx2/source/control/templatelocalview.cxx
index 9ab4ad6..69f0c91 100644
--- a/sfx2/source/control/templatelocalview.cxx
+++ b/sfx2/source/control/templatelocalview.cxx
@@ -177,6 +177,11 @@ sal_uInt16 TemplateLocalView::getRegionId(size_t pos) const
 return maRegions[pos]-mnId;
 }
 
+OUString TemplateLocalView::getRegionName(const sal_uInt16 nRegionId) const
+{
+return mpDocTemplates-GetRegionName(nRegionId);
+}
+
 std::vectorOUString TemplateLocalView::getFolderNames()
 {
 size_t n = maRegions.size();
@@ -193,9 +198,9 @@ TemplateLocalView::getFilteredItems(const 
boost::functionbool (const TemplateIt
 {
 std::vectorTemplateItemProperties aItems;
 
-for (size_t i = 0; i  maRegions.size(); ++i)
+if (mnCurRegionId)
 {
-TemplateContainerItem *pFolderItem = 
static_castTemplateContainerItem*(maRegions[i]);
+TemplateContainerItem *pFolderItem = maRegions[mnCurRegionId-1];
 
 for (size_t j = 0; j  pFolderItem-maTemplates.size(); ++j)
 {
@@ -203,6 +208,19 @@ TemplateLocalView::getFilteredItems(const 
boost::functionbool (const TemplateIt
 aItems.push_back(pFolderItem-maTemplates[j]);
 }
 }
+else
+{
+for (size_t i = 0; i  maRegions.size(); ++i)
+{
+TemplateContainerItem *pFolderItem = maRegions[i];
+
+for (size_t j = 0; j  pFolderItem-maTemplates.size(); ++j)
+{
+if (rFunc(pFolderItem-maTemplates[j]))
+aItems.push_back(pFolderItem-maTemplates[j]);
+}
+}
+}
 
 return aItems;
 }
diff --git a/sfx2/source/control/templatesearchview.cxx 
b/sfx2/source/control/templatesearchview.cxx
index 775abbc..eaec8dc 100644
--- a/sfx2/source/control/templatesearchview.cxx
+++ b/sfx2/source/control/templatesearchview.cxx
@@ -20,14 +20,15 @@ TemplateSearchView::~TemplateSearchView ()
 {
 }
 
-void TemplateSearchView::AppendItem(sal_uInt16 nItemId, sal_uInt16 nRegionId, 
sal_uInt16 nIdx,
+void TemplateSearchView::AppendItem(sal_uInt16 nAssocItemId, sal_uInt16 
nRegionId, sal_uInt16 nIdx,
 const OUString rTitle, const OUString 
rSubtitle,
 const OUString rPath,
 const BitmapEx rImage)
 {
 TemplateSearchViewItem *pItem = new TemplateSearchViewItem(*this);
-pItem-mnId = nItemId;
-pItem-mnIdx = nIdx;
+pItem-mnId = getNextItemId();
+pItem-mnAssocId = nAssocItemId;
+pItem-mnDocId = nIdx;
 pItem-mnRegionId = nRegionId;
 pItem-maPreview1 = rImage;
 pItem-maTitle = rTitle;
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 1cea676d..cd4b999 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -653,56 +653,47 @@ IMPL_LINK(SfxTemplateManagerDlg, OpenTemplateHdl, 
ThumbnailViewItem*, pItem)
 
 IMPL_LINK_NOARG(SfxTemplateManagerDlg, SearchUpdateHdl)
 {
-// if the search view is hidden, hide the folder view and display search 
one
-if (!mpCurView-isNonRootRegionVisible()  !mpSearchView-IsVisible())
-{
-mpSearchView-Clear();
-mpSearchView-Show();
-mpCurView-Hide();
-}
-
 OUString aKeyword = mpSearchEdit-GetText();
 
 if (!aKeyword.isEmpty())
 {
-if (mpCurView-isNonRootRegionVisible())
+mpSearchView-Clear();
+
+// if the search view is hidden, hide the folder view and display 
search one
+if (!mpSearchView-IsVisible())
 {
-mpCurView-filterItems(ViewFilter_Keyword(aKeyword));
+mpSearchView-Show();
+

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

2013-03-22 Thread Cédric Bosdonnat
 sfx2/inc/sfx2/templateview.hxx   |1 -
 sfx2/source/control/templateabstractview.cxx |   10 --
 sfx2/source/control/templateview.cxx |   16 +---
 sfx2/source/control/templateview.src |6 --
 4 files changed, 13 insertions(+), 20 deletions(-)

New commits:
commit 7a25aa2821ccf7318ce4a13efe171763989009d5
Author: Cédric Bosdonnat cedric.bosdon...@free.fr
Date:   Fri Mar 22 16:33:20 2013 +0100

fdo#61390: Fixed the tabstop in the TemplateView.

Change-Id: I887b11646efb9a839da11cd3e20cdf7e532caf3e

diff --git a/sfx2/inc/sfx2/templateview.hxx b/sfx2/inc/sfx2/templateview.hxx
index b7ff215..104cb11 100644
--- a/sfx2/inc/sfx2/templateview.hxx
+++ b/sfx2/inc/sfx2/templateview.hxx
@@ -54,7 +54,6 @@ private:
 Link maOpenHdl;
 TemplateAbstractView* mpMasterView;
 
-ControlmaButtons;
 PushButton maAllButton;
 FixedText  maFTName;
 sal_uInt16 mnId;
diff --git a/sfx2/source/control/templateabstractview.cxx 
b/sfx2/source/control/templateabstractview.cxx
index 737f087..b6cd646 100644
--- a/sfx2/source/control/templateabstractview.cxx
+++ b/sfx2/source/control/templateabstractview.cxx
@@ -115,7 +115,7 @@ bool ViewFilter_Keyword::operator ()(const 
ThumbnailViewItem *pItem)
 
 TemplateAbstractView::TemplateAbstractView (Window *pParent, WinBits 
nWinStyle, bool bDisableTransientChildren)
 : ThumbnailView(pParent,nWinStyle,bDisableTransientChildren),
-  mpItemView(new TemplateView(this)),
+  mpItemView(new TemplateView(pParent)),
   mbFilteredResults(false),
   meFilterOption(FILTER_APP_WRITER)
 {
@@ -124,7 +124,7 @@ TemplateAbstractView::TemplateAbstractView (Window 
*pParent, WinBits nWinStyle,
 
 TemplateAbstractView::TemplateAbstractView(Window *pParent, const ResId 
rResId, bool bDisableTransientChildren)
 : ThumbnailView(pParent,rResId,bDisableTransientChildren),
-  mpItemView(new TemplateView(this)),
+  mpItemView(new TemplateView(pParent)),
   mbFilteredResults(false),
   meFilterOption(FILTER_APP_WRITER)
 {
@@ -186,8 +186,14 @@ void TemplateAbstractView::filterTemplatesByApp (const 
FILTER_APPLICATION eApp)
 
 void TemplateAbstractView::showOverlay (bool bVisible)
 {
+Show(!bVisible);
 mpItemView-Show(bVisible);
 
+mpItemView-SetPosSizePixel(GetPosPixel(), GetSizePixel());
+mpItemView-SetStyle(GetStyle());
+
+mpItemView-GrabFocus();
+
 // Clear items is the overlay is closed.
 if (!bVisible)
 {
diff --git a/sfx2/source/control/templateview.cxx 
b/sfx2/source/control/templateview.cxx
index 21b2603..a19c8c5 100644
--- a/sfx2/source/control/templateview.cxx
+++ b/sfx2/source/control/templateview.cxx
@@ -34,14 +34,13 @@ using namespace drawinglayer::attribute;
 using namespace drawinglayer::primitive2d;
 
 TemplateView::TemplateView (Window *pParent)
-: ThumbnailView(pParent,WB_VSCROLL),
+: ThumbnailView(pParent,WB_VSCROLL | WB_TABSTOP),
   mpMasterView(NULL),
-  maButtons(this, SfxResId(CONTROL_BUTTONS)),
-  maAllButton(maButtons, SfxResId(BTN_ALL_TEMPLATES)),
-  maFTName(maButtons, SfxResId(FT_NAME)),
+  maAllButton(this, SfxResId(BTN_ALL_TEMPLATES)),
+  maFTName(this, SfxResId(FT_NAME)),
   mnId(0)
 {
-mnHeaderHeight = maButtons.GetSizePixel().getHeight();
+mnHeaderHeight = maAllButton.GetSizePixel().getHeight() + 
maAllButton.GetPosPixel().Y() * 2;
 maAllButton.SetStyle(maAllButton.GetStyle() | WB_FLATBUTTON);
 }
 
@@ -88,13 +87,8 @@ void TemplateView::Resize()
 Size aWinSize = GetOutputSize();
 
 // Set the buttons panel and buttons size
-Size aPanelSize = maButtons.GetSizePixel();
-int nDeltaW = aWinSize.getWidth() - aPanelSize.getWidth();
-aPanelSize.setWidth(aWinSize.getWidth());
-maButtons.SetSizePixel(aPanelSize);
-
 Size aNameSize = maFTName.GetSizePixel();
-aNameSize.setWidth(aNameSize.getWidth() + nDeltaW);
+aNameSize.setWidth( aWinSize.getWidth() - maFTName.GetPosPixel().X());
 maFTName.SetSizePixel(aNameSize);
 
 ThumbnailView::Resize();
diff --git a/sfx2/source/control/templateview.src 
b/sfx2/source/control/templateview.src
index 1f78a88..5836a95 100644
--- a/sfx2/source/control/templateview.src
+++ b/sfx2/source/control/templateview.src
@@ -9,12 +9,6 @@
 
 #include templateview.hrc
 
-Control CONTROL_BUTTONS
-{
-Size = MAP_APPFONT( 290, 17 );
-TabStop = False;
-};
-
 PushButton BTN_ALL_TEMPLATES
 {
 Pos = MAP_APPFONT( 1, 1 );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-03-15 Thread Cédric Bosdonnat
 sfx2/inc/templatedlg.hxx |2 
 sfx2/source/control/templateview.src |2 
 sfx2/source/doc/doc.hrc  |1 
 sfx2/source/doc/templatedlg.cxx  |   43 +++-
 sfx2/source/doc/templatedlg.src  |  124 ++-
 5 files changed, 98 insertions(+), 74 deletions(-)

New commits:
commit 5fbc90a6e277fc038b8c3a1c86360556dc9c0069
Author: Cédric Bosdonnat cedric.bosdon...@free.fr
Date:   Fri Mar 15 17:14:26 2013 +0100

Template manager: moved the controls into a proper TabPage to avoid problems

Change-Id: Ibff35bf24873a38c9a09d71fb3630a57e06f1a3c

diff --git a/sfx2/inc/templatedlg.hxx b/sfx2/inc/templatedlg.hxx
index 53a70ff..6b2d4bc 100644
--- a/sfx2/inc/templatedlg.hxx
+++ b/sfx2/inc/templatedlg.hxx
@@ -15,6 +15,7 @@
 #include vcl/dialog.hxx
 #include vcl/button.hxx
 #include vcl/tabctrl.hxx
+#include vcl/tabpage.hxx
 #include com/sun/star/frame/XDesktop2.hpp
 
 class Edit;
@@ -128,6 +129,7 @@ private:
 private:
 
 TabControl maTabControl;
+TabPage maTabPage;
 Control *mpToolbars;
 
 Edit *mpSearchEdit;
diff --git a/sfx2/source/control/templateview.src 
b/sfx2/source/control/templateview.src
index 0e77593..1f78a88 100644
--- a/sfx2/source/control/templateview.src
+++ b/sfx2/source/control/templateview.src
@@ -12,7 +12,6 @@
 Control CONTROL_BUTTONS
 {
 Size = MAP_APPFONT( 290, 17 );
-Border = True;
 TabStop = False;
 };
 
@@ -21,6 +20,7 @@ PushButton BTN_ALL_TEMPLATES
 Pos = MAP_APPFONT( 1, 1 );
 Size = MAP_APPFONT( 50, 14 );
 Text [ en-US ] = All Templates;
+TabStop = True;
 };
 
 FixedText FT_NAME
diff --git a/sfx2/source/doc/doc.hrc b/sfx2/source/doc/doc.hrc
index 1627e8b..9a38284 100644
--- a/sfx2/source/doc/doc.hrc
+++ b/sfx2/source/doc/doc.hrc
@@ -40,6 +40,7 @@
 #define DLG_DOC_TEMPLATE(RID_SFX_DOC_START+2)
 
 #define DLG_TEMPLATE_MANAGER(RID_SFX_DOC_START+4)
+#define TAB_TEMPLATE_MANAGER(RID_SFX_DOC_START+5)
 
 #define BMP_STYLES_CLOSED   (RID_SFX_DOC_START+ 0)
 #define BMP_STYLES_OPENED   (RID_SFX_DOC_START+ 1)
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index c2bbf7c..ce815bb 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -100,22 +100,38 @@ private:
 OUString maKeyword;
 };
 
+class TemplateManagerPage : public TabPage
+{
+private:
+FixedText maFixedText;
+
+public:
+TemplateManagerPage( Window* pParent );
+~TemplateManagerPage( ) { };
+};
+
 SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
 : ModelessDialog(parent, SfxResId(DLG_TEMPLATE_MANAGER)),
   maTabControl(this,SfxResId(TAB_CONTROL)),
-  mpToolbars( new Control(maTabControl,SfxResId(TOOLBARS))),
+  maTabPage(maTabControl, SfxResId(TAB_TEMPLATE_MANAGER)),
+  mpToolbars( new Control(maTabPage,SfxResId(TOOLBARS))),
   mpSearchEdit(new Edit(this,WB_HIDE | WB_BORDER)),
   mpViewBar( new ToolBox(mpToolbars, SfxResId(TBX_ACTION_VIEW))),
   mpActionBar( new ToolBox(mpToolbars, SfxResId(TBX_ACTION_ACTION))),
   mpTemplateBar( new ToolBox(mpToolbars, SfxResId(TBX_ACTION_TEMPLATES))),
-  mpSearchView(new TemplateSearchView(this)),
-  maView(new TemplateLocalView(this,SfxResId(TEMPLATE_VIEW))),
-  mpOnlineView(new TemplateRemoteView(this, WB_VSCROLL,false)),
+  mpSearchView(new TemplateSearchView(maTabPage)),
+  maView(new TemplateLocalView(maTabPage,SfxResId(TEMPLATE_VIEW))),
+  mpOnlineView(new TemplateRemoteView(maTabPage, WB_VSCROLL,false)),
   mbIsSaveMode(false),
   mxDesktop( Desktop::create(comphelper::getProcessComponentContext()) ),
   mbIsSynced(false),
   maRepositories()
 {
+maTabControl.SetTabPage( FILTER_DOCS, maTabPage );
+maTabControl.SetTabPage( FILTER_SHEETS, maTabPage );
+maTabControl.SetTabPage( FILTER_PRESENTATIONS, maTabPage );
+maTabControl.SetTabPage( FILTER_DRAWS, maTabPage );
+
 // Create popup menus
 mpActionMenu = new PopupMenu;
 
mpActionMenu-InsertItem(MNI_ACTION_SORT_NAME,SfxResId(STR_ACTION_SORT_NAME).toString(),SfxResId(IMG_ACTION_SORT));
@@ -294,21 +310,18 @@ void SfxTemplateManagerDlg::Resize()
 Size aTabSize = maTabControl.GetSizePixel();
 aTabSize.setWidth(aWinSize.getWidth());
 maTabControl.SetSizePixel(aTabSize);
-Size aTabPageSize = maTabControl.GetTabPageSizePixel();
-Point aToolbarsPos(0, aTabSize.getHeight() - aTabPageSize.getHeight());
-mpToolbars-SetPosPixel(aToolbarsPos);
-aTabPageSize.setHeight(mpToolbars-GetSizePixel().getHeight() + 3);
-maTabControl.SetTabPageSizePixel(aTabPageSize);
-
-Size aToolbarsSize = mpToolbars-GetSizePixel();
-aToolbarsSize.setWidth(aWinSize.getWidth());
-mpToolbars-SetSizePixel(aToolbarsSize);
+maTabControl.SetTabPageSizePixel(aWinSize);
 
 // Calculate toolboxes size and positions
 Size aViewSize = 

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

2013-03-13 Thread Caolán McNamara
 sfx2/inc/sfx2/mgetempl.hxx  |1 -
 sfx2/source/dialog/mgetempl.cxx |5 -
 sfx2/source/dialog/mgetempl.src |9 +
 3 files changed, 1 insertion(+), 14 deletions(-)

New commits:
commit 866a9a57fedf92767f64fc9348722ce42e17cde4
Author: Caolán McNamara caol...@redhat.com
Date:   Wed Mar 13 12:29:00 2013 +

remove aDescED which is always hidden and never used

looks like it got replaced by FT_DESC over 13 years
ago without getting removed, FT_DESC should have had
the helpid associated with ED_DESC.

Change-Id: I7aa0887d75b114ebc7c863920e0d58f71c3a7a31

diff --git a/sfx2/inc/sfx2/mgetempl.hxx b/sfx2/inc/sfx2/mgetempl.hxx
index f7816b3..6fce1f4 100644
--- a/sfx2/inc/sfx2/mgetempl.hxx
+++ b/sfx2/inc/sfx2/mgetempl.hxx
@@ -61,7 +61,6 @@ class SfxManageStyleSheetPage : public SfxTabPage
 
 FixedLine aDescGb;
 FixedInfo aDescFt;
-MultiLineEdit aDescED;
 
 SfxStyleSheetBase *pStyle;
 SfxStyleFamilies *pFamilies;
diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx
index 3d127ad..d252b6e 100644
--- a/sfx2/source/dialog/mgetempl.cxx
+++ b/sfx2/source/dialog/mgetempl.cxx
@@ -61,7 +61,6 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage( Window* 
pParent, const SfxItem
 
 aDescGb ( this, SfxResId( GB_DESC ) ),
 aDescFt ( this, SfxResId( FT_DESC ) ),
-aDescED ( this, SfxResId( ED_DESC ) ),
 
 pStyle( ( (SfxStyleDialog*)GetParentDialog() )-GetStyleSheet() ),
 
@@ -80,13 +79,9 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage( Window* 
pParent, const SfxItem
 {
 FreeResource();
 
-if ( IsBackground() )
-aDescED.SetBackground( GetBackground() );
 FixedInfo* pInfo = new FixedInfo( this );
-aDescED.SetFont( pInfo-GetFont() );
 delete pInfo;
 
-aDescED.Hide();
 aDescFt.Show();
 
 // this Page needs ExchangeSupport
diff --git a/sfx2/source/dialog/mgetempl.src b/sfx2/source/dialog/mgetempl.src
index 64f145c..80199dd 100644
--- a/sfx2/source/dialog/mgetempl.src
+++ b/sfx2/source/dialog/mgetempl.src
@@ -103,19 +103,12 @@ TabPage TP_MANAGE_STYLES
 };
 FixedText FT_DESC
 {
+HelpID = sfx2:MultiLineEdit:TP_MANAGE_STYLES:ED_DESC;
 Pos = MAP_APPFONT ( 12 , 88  ) ;
 Size = MAP_APPFONT ( 236 , 85 ) ;
 WordBreak = TRUE ;
 Hide = TRUE ;
 };
-MultiLineEdit ED_DESC
-{
-HelpID = sfx2:MultiLineEdit:TP_MANAGE_STYLES:ED_DESC;
-Pos = MAP_APPFONT ( 12 , 88  ) ;
-Size = MAP_APPFONT ( 236 , 85 ) ;
-ReadOnly = TRUE ;
-IgnoreTab = TRUE;
-};
 FixedLine GB_DESC
 {
 Pos = MAP_APPFONT ( 6 , 77  ) ;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: sfx2/inc sfx2/source sfx2/uiconfig sfx2/UI_sfx.mk

2013-03-13 Thread Caolán McNamara
 sfx2/UI_sfx.mk  |1 
 sfx2/inc/sfx2/mgetempl.hxx  |   36 +---
 sfx2/source/dialog/mgetempl.cxx |  206 +++
 sfx2/uiconfig/ui/managestylepage.ui |  268 
 4 files changed, 366 insertions(+), 145 deletions(-)

New commits:
commit c3d3b0220b322072c0fd731fe685587a46eef2d2
Author: Caolán McNamara caol...@redhat.com
Date:   Wed Mar 13 13:47:38 2013 +

convert manage style page to .ui

Change-Id: I42d08439c7aaf90ba2090012757c2ece88ba023c

diff --git a/sfx2/UI_sfx.mk b/sfx2/UI_sfx.mk
index 4b6466d..f037060 100644
--- a/sfx2/UI_sfx.mk
+++ b/sfx2/UI_sfx.mk
@@ -16,6 +16,7 @@ $(eval $(call gb_UI_add_uifiles,sfx,\
sfx2/uiconfig/ui/documentinfopage \
sfx2/uiconfig/ui/documentpropertiesdialog \
sfx2/uiconfig/ui/internetinfopage \
+   sfx2/uiconfig/ui/managestylepage \
sfx2/uiconfig/ui/optprintpage \
sfx2/uiconfig/ui/password \
sfx2/uiconfig/ui/printeroptionsdialog \
diff --git a/sfx2/inc/sfx2/mgetempl.hxx b/sfx2/inc/sfx2/mgetempl.hxx
index 6fce1f4..553c5bd 100644
--- a/sfx2/inc/sfx2/mgetempl.hxx
+++ b/sfx2/inc/sfx2/mgetempl.hxx
@@ -22,13 +22,9 @@
 #include vcl/edit.hxx
 #include vcl/fixed.hxx
 #include vcl/lstbox.hxx
-#include svtools/stdctrl.hxx
-#include svtools/svmedit.hxx
-
+#include vcl/vclmedit.hxx
 #include sfx2/tabdlg.hxx
 
-#include svtools/svmedit2.hxx
-
 /* expected:
 SID_TEMPLATE_NAME   :   In: StringItem, Name of Template
 SID_TEMPLATE_FAMILY :   In: Family of Template
@@ -38,29 +34,23 @@ class SfxStyleFamilies;
 class SfxStyleFamilyItem;
 class SfxStyleSheetBase;
 
-#ifdef _SFXDLG_HXX
-#define FixedInfo FixedText
-#endif
-
 class SfxManageStyleSheetPage : public SfxTabPage
 {
-FixedText aNameFt;
-Edit aNameEd;
-ExtMultiLineEdit aNameMLE;
+VclMultiLineEdit* m_pNameRo;
+Edit* m_pNameRw;
 
-CheckBoxaAutoCB;
+CheckBox* m_pAutoCB;
 
-FixedText aFollowFt;
-ListBox aFollowLb;
+FixedText* m_pFollowFt;
+ListBox* m_pFollowLb;
 
-FixedText aBaseFt;
-ListBox aBaseLb;
+FixedText* m_pBaseFt;
+ListBox* m_pBaseLb;
 
-FixedText aFilterFt;
-ListBox aFilterLb;
+FixedText* m_pFilterFt;
+ListBox* m_pFilterLb;
 
-FixedLine aDescGb;
-FixedInfo aDescFt;
+FixedText *m_pDescFt;
 
 SfxStyleSheetBase *pStyle;
 SfxStyleFamilies *pFamilies;
@@ -98,10 +88,6 @@ protected:
 virtual int DeactivatePage(SfxItemSet * = 0);
 };
 
-#ifdef FixedInfo
-#undef FixedInfo
-#endif
-
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx
index d252b6e..8477c0c 100644
--- a/sfx2/source/dialog/mgetempl.cxx
+++ b/sfx2/source/dialog/mgetempl.cxx
@@ -39,50 +39,30 @@
 
 #include svl/style.hrc
 
-// SfxManageStyleSheetPage ---
-
-SfxManageStyleSheetPage::SfxManageStyleSheetPage( Window* pParent, const 
SfxItemSet rAttrSet ) :
-
-SfxTabPage( pParent, SfxResId( TP_MANAGE_STYLES ), rAttrSet ),
-
-aNameFt ( this, SfxResId( FT_NAME ) ),
-aNameEd ( this, SfxResId( ED_NAME ) ),
-aNameMLE( this, SfxResId( MLE_NAME ) ),
-aAutoCB ( this, SfxResId( CB_AUTO ) ),
-
-aFollowFt   ( this, SfxResId( FT_NEXT ) ),
-aFollowLb   ( this, SfxResId( LB_NEXT ) ),
-
-aBaseFt ( this, SfxResId( FT_BASE ) ),
-aBaseLb ( this, SfxResId( LB_BASE ) ),
-
-aFilterFt   ( this, SfxResId( FT_REGION ) ),
-aFilterLb   ( this, SfxResId( LB_REGION ) ),
-
-aDescGb ( this, SfxResId( GB_DESC ) ),
-aDescFt ( this, SfxResId( FT_DESC ) ),
-
-pStyle( ( (SfxStyleDialog*)GetParentDialog() )-GetStyleSheet() ),
-
-pItem   ( 0 ),
-bModified   ( sal_False ),
-aName   ( pStyle-GetName() ),
-aFollow ( pStyle-GetFollow() ),
-aParent ( pStyle-GetParent() ),
-nFlags  ( pStyle-GetMask() )
-
-/*  [Description]
-
-Constructor, initializes the list box with the templates
-*/
-
+/*  SfxManageStyleSheetPage Constructor
+ *
+ *  initializes the list box with the templates
+ */
+SfxManageStyleSheetPage::SfxManageStyleSheetPage(Window* pParent, const 
SfxItemSet rAttrSet)
+: SfxTabPage(pParent, ManageStylePage, sfx/ui/managestylepage.ui, 
rAttrSet)
+, pStyle(((SfxStyleDialog*)GetParentDialog())-GetStyleSheet())
+, pItem(0)
+, bModified(false)
+, aName(pStyle-GetName())
+, aFollow(pStyle-GetFollow())
+, aParent(pStyle-GetParent())
+, nFlags(pStyle-GetMask())
 {
-FreeResource();
-
-FixedInfo* pInfo = new FixedInfo( this );
-delete pInfo;
-
-aDescFt.Show();
+get(m_pNameRo, namero);
+get(m_pNameRw, namerw);
+get(m_pAutoCB, autoupdate);
+get(m_pFollowFt, nextstyleft);
+get(m_pFollowLb, nextstyle);
+get(m_pBaseFt, linkedwithft);
+get(m_pBaseLb, linkedwith);
+get(m_pFilterFt, categoryft);
+get(m_pFilterLb, 

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

2013-03-01 Thread Noel Power
 sfx2/inc/sfx2/docmacromode.hxx   |1 
 sfx2/source/doc/docmacromode.cxx |   29 +++-
 sfx2/source/doc/guisaveas.cxx|   55 +++
 svtools/inc/svtools/sfxecode.hxx |2 -
 uui/source/iahndl.cxx|   17 +++-
 uui/source/ids.hrc   |2 -
 uui/source/ids.src   |5 ++-
 7 files changed, 100 insertions(+), 11 deletions(-)

New commits:
commit ec583253c3d761847c93a77fa10c065fc334fab9
Author: Noel Power noel.po...@suse.com
Date:   Fri Mar 1 17:07:06 2013 +

raise warning when saving macro laden doc as a macro-free format bnc#791777

Change-Id: Ic947ceef71c86e31fbf0bce74b064aaf91f47178

diff --git a/sfx2/inc/sfx2/docmacromode.hxx b/sfx2/inc/sfx2/docmacromode.hxx
index 86bad08..1b5857f 100644
--- a/sfx2/inc/sfx2/docmacromode.hxx
+++ b/sfx2/inc/sfx2/docmacromode.hxx
@@ -287,6 +287,7 @@ namespace sfx2
 static sal_Bool
 storageHasMacros( const ::com::sun::star::uno::Reference 
::com::sun::star::embed::XStorage  _rxStorage );
 
+static sal_Bool containerHasBasicMacros( const 
::com::sun::star::uno::Reference ::com::sun::star::script::XLibraryContainer 
 xContainter );
 /** checks the macro execution mode while loading the document.
 
 This must be called when the loading is effectively finished, but 
before any macro action
diff --git a/sfx2/source/doc/docmacromode.cxx b/sfx2/source/doc/docmacromode.cxx
index 999ab20..6f10507 100644
--- a/sfx2/source/doc/docmacromode.cxx
+++ b/sfx2/source/doc/docmacromode.cxx
@@ -318,17 +318,11 @@ namespace sfx2
 }
 
 //
-sal_Bool DocumentMacroMode::hasMacroLibrary() const
+sal_Bool DocumentMacroMode::containerHasBasicMacros( const Reference 
XLibraryContainer  xContainer )
 {
 sal_Bool bHasMacroLib = sal_False;
-#ifndef DISABLE_SCRIPTING
 try
 {
-Reference XEmbeddedScripts  xScripts( 
m_pData-m_rDocumentAccess.getEmbeddedDocumentScripts() );
-Reference XLibraryContainer  xContainer;
-if ( xScripts.is() )
-xContainer.set( xScripts-getBasicLibraries(), UNO_QUERY_THROW 
);
-
 if ( xContainer.is() )
 {
 // a library container exists; check if it's empty
@@ -368,6 +362,27 @@ namespace sfx2
 {
 DBG_UNHANDLED_EXCEPTION();
 }
+return bHasMacroLib;
+}
+
+//
+sal_Bool DocumentMacroMode::hasMacroLibrary() const
+{
+sal_Bool bHasMacroLib = sal_False;
+#ifndef DISABLE_SCRIPTING
+try
+{
+Reference XEmbeddedScripts  xScripts( 
m_pData-m_rDocumentAccess.getEmbeddedDocumentScripts() );
+Reference XLibraryContainer  xContainer;
+if ( xScripts.is() )
+xContainer.set( xScripts-getBasicLibraries(), UNO_QUERY_THROW 
);
+bHasMacroLib = containerHasBasicMacros( xContainer );
+
+}
+catch( const Exception )
+{
+DBG_UNHANDLED_EXCEPTION();
+}
 #endif
 return bHasMacroLib;
 }
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 1b40a74..f94b809 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -79,6 +79,13 @@
 #include sfxtypes.hxx
 #include alienwarn.hxx
 
+#include sfx2/docmacromode.hxx
+#include svx/svxerr.hxx
+#include comphelper/interaction.hxx
+#include com/sun/star/task/ErrorCodeRequest.hpp
+#include rtl/ref.hxx
+#include framework/interaction.hxx
+#include svtools/sfxecode.hxx
 #include ../appl/app.hrc
 
 // flags that specify requested operation
@@ -707,6 +714,19 @@ sal_Int8 ModelData_Impl::CheckStateForSave()
 return nResult;
 }
 
+sal_Bool hasMacros( const uno::Reference frame::XModel  xModel  )
+{
+sal_Bool bHasMacros = sal_False;
+uno::Reference script::XLibraryContainer  xContainer;
+uno::Reference beans::XPropertySet  xProps( xModel, uno::UNO_QUERY );
+if ( xProps.is() )
+{
+xProps-getPropertyValue( BasicLibraries ) = xContainer;
+bHasMacros = sfx2::DocumentMacroMode::containerHasBasicMacros( 
xContainer );
+}
+return bHasMacros;
+}
+
 sal_Int8 ModelData_Impl::CheckFilter( const ::rtl::OUString aFilterName )
 {
 ::comphelper::SequenceAsHashMap aFiltPropsHM;
@@ -754,6 +774,41 @@ sal_Int8 ModelData_Impl::CheckFilter( const 
::rtl::OUString aFilterName )
 ::rtl::OUString() );
 if ( !aPreusedFilterName.equals( aFilterName )  !aUIName.equals( 
aDefUIName ) )
 {
+// is it possible to get these names from somewhere and not just
+// hardcode them?
+OUString sXLSXFilter(Calc MS Excel 2007 XML);
+OUString sOtherXLSXFilter(Calc Office Open XML);
+   

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

2013-02-11 Thread Cédric Bosdonnat
 sfx2/inc/sfx2/templatelocalview.hxx   |4 ++--
 sfx2/inc/sfx2/templateview.hxx|2 +-
 sfx2/inc/sfx2/thumbnailview.hxx   |2 +-
 sfx2/source/control/templatelocalview.cxx |4 ++--
 sfx2/source/control/templateview.cxx  |5 +++--
 sfx2/source/control/thumbnailview.cxx |3 ++-
 sfx2/source/control/thumbnailviewitem.cxx |4 ++--
 7 files changed, 13 insertions(+), 11 deletions(-)

New commits:
commit 98fa4be44290ceefd7f08ef167f0278743ade1c5
Author: Cédric Bosdonnat cedric.bosdon...@free.fr
Date:   Mon Feb 11 18:09:45 2013 +0100

Templates Manager: if the title can't be edited, don't update it in UI

Conflicts:
sfx2/inc/sfx2/templatelocalview.hxx
sfx2/source/control/templatelocalview.cxx
sfx2/source/control/templateview.cxx

Change-Id: Id16431fb3517c831a5e81ff72fafaa8569f99ef1

diff --git a/sfx2/inc/sfx2/templatelocalview.hxx 
b/sfx2/inc/sfx2/templatelocalview.hxx
index c27659f..432b008 100644
--- a/sfx2/inc/sfx2/templatelocalview.hxx
+++ b/sfx2/inc/sfx2/templatelocalview.hxx
@@ -68,8 +68,8 @@ public:
  const OUString rName);
 
 bool isTemplateNameUnique (const sal_uInt16 nRegionItemId, const OUString 
rName) const;
-
-virtual void renameItem(ThumbnailViewItem* pItem, rtl::OUString sNewTitle);
+
+virtual bool renameItem(ThumbnailViewItem* pItem, rtl::OUString sNewTitle);
 
 private:
 
diff --git a/sfx2/inc/sfx2/templateview.hxx b/sfx2/inc/sfx2/templateview.hxx
index 81582ef..b7ff215 100644
--- a/sfx2/inc/sfx2/templateview.hxx
+++ b/sfx2/inc/sfx2/templateview.hxx
@@ -43,7 +43,7 @@ public:
 void setOpenHdl (const Link rLink) { maOpenHdl = rLink; }
 virtual void OnItemDblClicked(ThumbnailViewItem *pItem) { 
maOpenHdl.Call(pItem); }
 void setMasterView(TemplateAbstractView* pMasterView) { mpMasterView = 
pMasterView; }
-virtual void renameItem(ThumbnailViewItem* pItem, rtl::OUString sNewTitle);
+virtual bool renameItem(ThumbnailViewItem* pItem, rtl::OUString sNewTitle);
 
 protected:
 
diff --git a/sfx2/inc/sfx2/thumbnailview.hxx b/sfx2/inc/sfx2/thumbnailview.hxx
index 78e1df6..1e8f1ac 100644
--- a/sfx2/inc/sfx2/thumbnailview.hxx
+++ b/sfx2/inc/sfx2/thumbnailview.hxx
@@ -236,7 +236,7 @@ public:
 
 virtual void Resize();
 
-virtual void renameItem(ThumbnailViewItem* pItem, rtl::OUString sNewTitle);
+virtual bool renameItem(ThumbnailViewItem* pItem, rtl::OUString sNewTitle);
 
 protected:
 
diff --git a/sfx2/source/control/templatelocalview.cxx 
b/sfx2/source/control/templatelocalview.cxx
index e42f9c8..0bb12dc 100644
--- a/sfx2/source/control/templatelocalview.cxx
+++ b/sfx2/source/control/templatelocalview.cxx
@@ -571,7 +571,7 @@ bool TemplateLocalView::isTemplateNameUnique(const 
sal_uInt16 nRegionItemId, con
 return true;
 }
 
-void TemplateLocalView::renameItem(ThumbnailViewItem* pItem, rtl::OUString 
sNewTitle)
+bool TemplateLocalView::renameItem(ThumbnailViewItem* pItem, rtl::OUString 
sNewTitle)
 {
 sal_uInt16 nRegionId = 0;
 sal_uInt16 nDocId = USHRT_MAX;
@@ -586,7 +586,7 @@ void TemplateLocalView::renameItem(ThumbnailViewItem* 
pItem, rtl::OUString sNewT
 {
 nRegionId = pContainerItem-mnId - 1;
 }
-mpDocTemplates-SetName( sNewTitle, nRegionId, nDocId );
+return mpDocTemplates-SetName( sNewTitle, nRegionId, nDocId );
 }
 
 static void lcl_updateThumbnails (TemplateContainerItem *pItem)
diff --git a/sfx2/source/control/templateview.cxx 
b/sfx2/source/control/templateview.cxx
index 7073a6f..21b2603 100644
--- a/sfx2/source/control/templateview.cxx
+++ b/sfx2/source/control/templateview.cxx
@@ -100,10 +100,11 @@ void TemplateView::Resize()
 ThumbnailView::Resize();
 }
 
-void TemplateView::renameItem(ThumbnailViewItem* pItem, rtl::OUString 
sNewTitle)
+bool TemplateView::renameItem(ThumbnailViewItem* pItem, rtl::OUString 
sNewTitle)
 {
 if (mpMasterView)
-mpMasterView-renameItem(pItem, sNewTitle);
+return mpMasterView-renameItem(pItem, sNewTitle);
+return false;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/control/thumbnailview.cxx 
b/sfx2/source/control/thumbnailview.cxx
index a1c08980..4cff537 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -969,9 +969,10 @@ void ThumbnailView::sortItems (const boost::functionbool 
(const ThumbnailViewIt
 Invalidate();
 }
 
-void ThumbnailView::renameItem(ThumbnailViewItem*, rtl::OUString)
+bool ThumbnailView::renameItem(ThumbnailViewItem*, rtl::OUString)
 {
 // Do nothing by default
+return false;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/control/thumbnailviewitem.cxx 
b/sfx2/source/control/thumbnailviewitem.cxx
index c228bab..2a83bc1 100644
--- a/sfx2/source/control/thumbnailviewitem.cxx
+++ b/sfx2/source/control/thumbnailviewitem.cxx
@@ -187,8 +187,8 @@ void ThumbnailViewItem::updateTitleEditSize()