[Libreoffice-commits] core.git: 4 commits - include/sfx2 sc/source sfx2/source
Caolán McNamara
caolanm at redhat.com
Fri Jan 8 10:20:48 PST 2016
include/sfx2/templdlg.hxx | 5 --
sc/source/ui/drawfunc/fusel.cxx | 3 -
sfx2/source/dialog/templdlg.cxx | 100 +++++++++++++++++++++++-----------------
sfx2/source/dialog/templdlg.hrc | 21 --------
sfx2/source/dialog/templdlg.src | 50 --------------------
sfx2/source/inc/templdgi.hxx | 1
6 files changed, 63 insertions(+), 117 deletions(-)
New commits:
commit 79bbc5b910259c2c0efc71329501767e97513584
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jan 8 14:10:03 2016 +0000
silence mouse release warning
Change-Id: Idce7f28d642f6dc23f16e3c963d0ed42782ed14a
diff --git a/sc/source/ui/drawfunc/fusel.cxx b/sc/source/ui/drawfunc/fusel.cxx
index 8a1dbd7..c4c1aac 100644
--- a/sc/source/ui/drawfunc/fusel.cxx
+++ b/sc/source/ui/drawfunc/fusel.cxx
@@ -570,7 +570,8 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
ForcePointer(&rMEvt);
- pWindow->ReleaseMouse();
+ if (pWindow->IsMouseCaptured())
+ pWindow->ReleaseMouse();
// Command-Handler fuer Kontext-Menue kommt erst nach MouseButtonUp,
// darum hier die harte IsLeft-Abfrage
commit ca66b8c025fafe5fa79b749d17a28710322621c4
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jan 8 11:01:38 2016 +0000
SfxTemplatePanelControl doesn't have to be a DockingWindow anymore
so we can drop one more DockingWindow from .src files leaving
just one left
Change-Id: I2e12398ce7682193aace966ebb8d153ec9acea2e
diff --git a/include/sfx2/templdlg.hxx b/include/sfx2/templdlg.hxx
index 75fdfb1..94d2134 100644
--- a/include/sfx2/templdlg.hxx
+++ b/include/sfx2/templdlg.hxx
@@ -38,17 +38,16 @@ namespace SfxTemplate
class SfxTemplateDialog_Impl;
-class SFX2_DLLPUBLIC SfxTemplatePanelControl : public DockingWindow
+class SFX2_DLLPUBLIC SfxTemplatePanelControl : public vcl::Window
{
public:
- SfxTemplatePanelControl (SfxBindings* pBindings, vcl::Window* pParentWindow);
+ SfxTemplatePanelControl(SfxBindings* pBindings, vcl::Window* pParentWindow);
virtual ~SfxTemplatePanelControl();
virtual void dispose() override;
virtual void DataChanged( const DataChangedEvent& _rDCEvt ) override;
virtual void Resize() override;
virtual void StateChanged( StateChangedType nStateChange ) override;
- void FreeResource();
private:
std::unique_ptr<SfxTemplateDialog_Impl> pImpl;
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index 7580759..2aa03aa 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -341,7 +341,7 @@ std::unique_ptr<PopupMenu> SfxActionListBox::CreateContextMenu()
}
SfxTemplatePanelControl::SfxTemplatePanelControl(SfxBindings* pBindings, vcl::Window* pParentWindow)
- : DockingWindow(pParentWindow, SfxResId(DLG_STYLE_DESIGNER))
+ : Window(pParentWindow)
, pImpl(new SfxTemplateDialog_Impl(pBindings, this))
, mpBindings(pBindings)
{
@@ -360,7 +360,7 @@ SfxTemplatePanelControl::~SfxTemplatePanelControl()
void SfxTemplatePanelControl::dispose()
{
pImpl.reset();
- DockingWindow::dispose();
+ Window::dispose();
}
void SfxTemplatePanelControl::DataChanged( const DataChangedEvent& _rDCEvt )
@@ -372,19 +372,14 @@ void SfxTemplatePanelControl::DataChanged( const DataChangedEvent& _rDCEvt )
pImpl->updateNonFamilyImages();
}
- DockingWindow::DataChanged( _rDCEvt );
+ Window::DataChanged( _rDCEvt );
}
void SfxTemplatePanelControl::Resize()
{
if(pImpl)
pImpl->Resize();
- DockingWindow::Resize();
-}
-
-void SfxTemplatePanelControl::FreeResource()
-{
- DockingWindow::FreeResource();
+ Window::Resize();
}
void SfxTemplatePanelControl::StateChanged( StateChangedType nStateChange )
@@ -403,7 +398,7 @@ void SfxTemplatePanelControl::StateChanged( StateChangedType nStateChange )
// SetFloatingPos( aPoint );
}
- DockingWindow::StateChanged( nStateChange );
+ Window::StateChanged( nStateChange );
}
void StyleTreeListBox_Impl::MakeExpanded_Impl(ExpandedEntries_t& rEntries) const
@@ -2258,7 +2253,6 @@ SfxTemplateDialog_Impl::SfxTemplateDialog_Impl(SfxBindings* pB, SfxTemplatePanel
{
}
- pDlgWindow->FreeResource();
Initialize();
}
diff --git a/sfx2/source/dialog/templdlg.src b/sfx2/source/dialog/templdlg.src
index 2fddb59..16f2e57 100644
--- a/sfx2/source/dialog/templdlg.src
+++ b/sfx2/source/dialog/templdlg.src
@@ -45,22 +45,4 @@ String STR_STYLE_FILTER_HIERARCHICAL
Text [ en-US ] = "Hierarchical" ;
};
- // DLG_STYLE_DESIGNER ----------------------------------------------------
-DockingWindow DLG_STYLE_DESIGNER
-{
- HelpId = CMD_SID_STYLE_DESIGNER ;
- OutputSize = TRUE ;
- Hide = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 116 , 215 ) ;
- Pos = MAP_APPFONT ( 0 , 0 ) ;
- Closeable = TRUE ;
- Zoomable = TRUE ;
- Sizeable = TRUE ;
- Dockable = TRUE ;
- EnableResizing = TRUE ;
- Border = TRUE ;
- Moveable = TRUE ;
-};
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit b7dc6101dafcfe01023608b7e1be31c1c17a82bf
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jan 8 10:56:32 2016 +0000
Float is never a SfxDockingWindow anymore
Change-Id: I22ddb6416c48ab72bf3ee4a7e7d664bfd0dd51f1
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index bbfed85..7580759 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -2366,15 +2366,6 @@ void SfxTemplateDialog_Impl::LoadedFamilies()
// The size of the Listboxen is adjusted
void SfxTemplateDialog_Impl::Resize()
{
- SfxDockingWindow* pDockingWindow = dynamic_cast<SfxDockingWindow*>(m_pFloat.get());
- FloatingWindow *pF = pDockingWindow!=nullptr ? pDockingWindow->GetFloatingWindow() : nullptr;
- if (pF)
- {
- m_bZoomIn = pF->IsRollUp();
- if (m_bZoomIn)
- return;
- }
-
if (m_pFloat == nullptr)
return;
Size aDlgSize=m_pFloat->PixelToLogic(m_pFloat->GetOutputSizePixel());
diff --git a/sfx2/source/inc/templdgi.hxx b/sfx2/source/inc/templdgi.hxx
index 98fe582..e153356 100644
--- a/sfx2/source/inc/templdgi.hxx
+++ b/sfx2/source/inc/templdgi.hxx
@@ -47,7 +47,6 @@ class SvTreeListBox ;
class StyleTreeListBox_Impl;
class SfxTemplateDialog_Impl;
class SfxCommonTemplateDialog_Impl;
-class SfxDockingWindow;
namespace com { namespace sun { namespace star { namespace frame {
class XModuleManager2;
commit 0b14725c7b188b78eddafae7ea6761865dfc81ab
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jan 8 10:53:34 2016 +0000
implement the style pane right toolbar the same as the left toolbar
Change-Id: I1a031facad52afbc84b06610f9bdd0a9f118ebeb
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index 473ef30..bbfed85 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -50,7 +50,6 @@
#include <sfx2/tplpitem.hxx>
#include <sfx2/sfxresid.hxx>
-#include "templdlg.hrc"
#include <sfx2/sfx.hrc>
#include "dialog.hrc"
#include "arrdecl.hxx"
@@ -2200,13 +2199,65 @@ std::unique_ptr<PopupMenu> SfxCommonTemplateDialog_Impl::CreateContextMenu()
return pMenu;
}
+static OUString lcl_GetLabel(uno::Any& rAny)
+{
+ OUString sRet;
+ uno::Sequence< beans::PropertyValue >aPropSeq;
+ if ( rAny >>= aPropSeq )
+ {
+ for( sal_Int32 i = 0; i < aPropSeq.getLength(); i++ )
+ {
+ if ( aPropSeq[i].Name == "Label" )
+ {
+ aPropSeq[i].Value >>= sRet;
+ break;
+ }
+ }
+ }
+ return sRet;
+}
+
SfxTemplateDialog_Impl::SfxTemplateDialog_Impl(SfxBindings* pB, SfxTemplatePanelControl* pDlgWindow)
: SfxCommonTemplateDialog_Impl(pB, pDlgWindow, true)
, m_pFloat(pDlgWindow)
, m_bZoomIn(false)
, m_aActionTbL(VclPtrInstance<DropToolBox_Impl>(pDlgWindow, this))
- , m_aActionTbR(VclPtrInstance<ToolBox> (pDlgWindow, SfxResId(TB_ACTION)))
+ , m_aActionTbR(VclPtrInstance<ToolBox>(pDlgWindow))
{
+ try
+ {
+ uno::Reference< container::XNameAccess > xNameAccess(
+ frame::theUICommandDescription::get(
+ ::comphelper::getProcessComponentContext()) );
+ uno::Reference< container::XNameAccess > xUICommands;
+ OUString sTextDoc("com.sun.star.text.TextDocument");
+ if(xNameAccess->hasByName(sTextDoc))
+ {
+ uno::Any a = xNameAccess->getByName( sTextDoc );
+ a >>= xUICommands;
+ }
+ if (xUICommands.is())
+ {
+ uno::Any aCommand = xUICommands->getByName(".uno:StyleApply");
+ OUString sLabel = lcl_GetLabel( aCommand );
+ m_aActionTbR->InsertItem( SID_STYLE_WATERCAN, sLabel );
+ m_aActionTbR->SetHelpId(SID_STYLE_WATERCAN, HID_TEMPLDLG_WATERCAN);
+
+ aCommand = xUICommands->getByName(".uno:StyleNewByExample");
+ sLabel = lcl_GetLabel( aCommand );
+ m_aActionTbR->InsertItem( SID_STYLE_NEW_BY_EXAMPLE, sLabel );
+ m_aActionTbR->SetHelpId(SID_STYLE_NEW_BY_EXAMPLE, HID_TEMPLDLG_NEWBYEXAMPLE);
+
+ aCommand = xUICommands->getByName(".uno:StyleUpdateByExample");
+ sLabel = lcl_GetLabel( aCommand );
+ m_aActionTbR->InsertItem( SID_STYLE_UPDATE_BY_EXAMPLE, sLabel );
+ m_aActionTbR->SetHelpId(SID_STYLE_UPDATE_BY_EXAMPLE, HID_TEMPLDLG_UPDATEBYEXAMPLE);
+ }
+ }
+ catch (const uno::Exception&)
+ {
+ }
+
pDlgWindow->FreeResource();
Initialize();
}
@@ -2443,24 +2494,6 @@ IMPL_LINK_TYPED( SfxTemplateDialog_Impl, ToolBoxLSelect, ToolBox *, pBox, void )
FamilySelect(nEntry);
}
-static OUString lcl_GetLabel(uno::Any& rAny)
-{
- OUString sRet;
- uno::Sequence< beans::PropertyValue >aPropSeq;
- if ( rAny >>= aPropSeq )
- {
- for( sal_Int32 i = 0; i < aPropSeq.getLength(); i++ )
- {
- if ( aPropSeq[i].Name == "Label" )
- {
- aPropSeq[i].Value >>= sRet;
- break;
- }
- }
- }
- return sRet;
-}
-
IMPL_LINK_TYPED( SfxTemplateDialog_Impl, ToolBoxRSelect, ToolBox *, pBox, void )
{
const sal_uInt16 nEntry = pBox->GetCurItemId();
@@ -2513,7 +2546,7 @@ IMPL_LINK_TYPED( SfxTemplateDialog_Impl, ToolBoxRClick, ToolBox *, pBox, void )
PopupMenuFlags::ExecuteDown );
pBox->EndSelection();
}
- catch(uno::Exception&)
+ catch (const uno::Exception&)
{
}
pBox->Invalidate();
diff --git a/sfx2/source/dialog/templdlg.hrc b/sfx2/source/dialog/templdlg.hrc
deleted file mode 100644
index 3c128df..0000000
--- a/sfx2/source/dialog/templdlg.hrc
+++ /dev/null
@@ -1,21 +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 .
- */
-#define TB_ACTION 15
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/dialog/templdlg.src b/sfx2/source/dialog/templdlg.src
index fd9c11d..2fddb59 100644
--- a/sfx2/source/dialog/templdlg.src
+++ b/sfx2/source/dialog/templdlg.src
@@ -19,7 +19,6 @@
#include <sfx2/sfx.hrc>
#include "dialog.hrc"
-#include "templdlg.hrc"
#include "helpid.hrc"
ImageList DLG_STYLE_DESIGNER
@@ -49,8 +48,6 @@ String STR_STYLE_FILTER_HIERARCHICAL
// DLG_STYLE_DESIGNER ----------------------------------------------------
DockingWindow DLG_STYLE_DESIGNER
{
- Text [ en-US ] = "Styles and Formatting" ;
-
HelpId = CMD_SID_STYLE_DESIGNER ;
OutputSize = TRUE ;
Hide = TRUE ;
@@ -64,35 +61,6 @@ DockingWindow DLG_STYLE_DESIGNER
EnableResizing = TRUE ;
Border = TRUE ;
Moveable = TRUE ;
- ToolBox TB_ACTION
- {
- Pos = MAP_APPFONT ( 3 , 3 ) ;
- Size = MAP_APPFONT ( 57 , 42 ) ;
- LineCount = 1 ;
- ItemImageList = DLG_STYLE_DESIGNER ;
- HelpId = HID_TEMPLDLG_TOOLBOX_RIGHT ;
- ItemList =
- {
- ToolBoxItem
- {
- HelpId = HID_TEMPLDLG_WATERCAN ;
- Identifier = SID_STYLE_WATERCAN ;
- Text [ en-US ] = "Fill Format Mode" ;
- };
- ToolBoxItem
- {
- HelpId = HID_TEMPLDLG_NEWBYEXAMPLE ;
- Identifier = SID_STYLE_NEW_BY_EXAMPLE ;
- Text [ en-US ] = "New Style from Selection" ;
- };
- ToolBoxItem
- {
- HelpId = HID_TEMPLDLG_UPDATEBYEXAMPLE ;
- Identifier = SID_STYLE_UPDATE_BY_EXAMPLE ;
- Text [ en-US ] = "Update Style" ;
- };
- };
- };
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list