summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/sfx2/tbxctrl.hxx7
-rw-r--r--include/svx/dialogs.hrc7
-rw-r--r--include/vcl/dialog.hxx2
-rw-r--r--include/vcl/floatwin.hxx2
-rw-r--r--include/vcl/syswin.hxx2
-rw-r--r--sfx2/source/toolbox/tbxitem.cxx16
-rw-r--r--svx/UIConfig_svx.mk1
-rw-r--r--svx/inc/helpid.hrc1
-rw-r--r--svx/source/tbxctrls/lboxctrl.cxx52
-rw-r--r--svx/source/tbxctrls/lboxctrl.hrc22
-rw-r--r--svx/source/tbxctrls/lboxctrl.src21
-rw-r--r--svx/uiconfig/ui/floatingundoredo.ui42
-rw-r--r--vcl/source/window/builder.cxx36
-rw-r--r--vcl/source/window/dialog.cxx7
-rw-r--r--vcl/source/window/floatwin.cxx7
-rw-r--r--vcl/source/window/syswin.cxx2
16 files changed, 100 insertions, 127 deletions
diff --git a/include/sfx2/tbxctrl.hxx b/include/sfx2/tbxctrl.hxx
index 2c7d81a2ec79..99202ff0525c 100644
--- a/include/sfx2/tbxctrl.hxx
+++ b/include/sfx2/tbxctrl.hxx
@@ -138,9 +138,10 @@ public:
SfxPopupWindow( sal_uInt16 nId,
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
WinBits nBits );
- SfxPopupWindow( sal_uInt16 nId,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
- const ResId &rId );
+ SfxPopupWindow(sal_uInt16 nId,
+ const OString& rID, const OUString& rUIXMLDescription,
+ const css::uno::Reference<css::frame::XFrame> &rFrame =
+ css::uno::Reference<css::frame::XFrame>());
SfxPopupWindow( sal_uInt16 nId,
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
Window* pParentWindow,
diff --git a/include/svx/dialogs.hrc b/include/svx/dialogs.hrc
index 430339747598..2a033e96fcf1 100644
--- a/include/svx/dialogs.hrc
+++ b/include/svx/dialogs.hrc
@@ -803,12 +803,11 @@
#define RID_SVXSTR_UNDO_GRAFTRANSPARENCY (RID_SVX_START + 828)
#define RID_SVXSTR_UNDO_GRAFCROP (RID_SVXSTR_GRAFCROP)
-// listbox control for UNDO and REDO
-#define RID_SVXTBX_UNDO_REDO_CTRL (RID_SVX_START + 845)
+// strings for UNDO and REDO
#define RID_SVXSTR_NUM_UNDO_ACTIONS (RID_SVX_START + 846)
#define RID_SVXSTR_NUM_REDO_ACTIONS (RID_SVX_START + 847)
-#define RID_SVXSTR_NUM_UNDO_ACTION (RID_SVX_START + 848)
-#define RID_SVXSTR_NUM_REDO_ACTION (RID_SVX_START + 849)
+#define RID_SVXSTR_NUM_UNDO_ACTION (RID_SVX_START + 848)
+#define RID_SVXSTR_NUM_REDO_ACTION (RID_SVX_START + 849)
// Default-transparence-gradient-names
#define RID_SVXSTR_TRASNGR0_DEF (RID_SVX_START + 850)
diff --git a/include/vcl/dialog.hxx b/include/vcl/dialog.hxx
index 14d303cef14c..ff9f249f3367 100644
--- a/include/vcl/dialog.hxx
+++ b/include/vcl/dialog.hxx
@@ -65,7 +65,7 @@ protected:
public:
SAL_DLLPRIVATE bool IsInClose() const { return mbInClose; }
- virtual void doDeferredInit(bool bResizable, bool bCloseable) SAL_OVERRIDE;
+ virtual void doDeferredInit(WinBits nBits) SAL_OVERRIDE;
protected:
explicit Dialog( WindowType nType );
diff --git a/include/vcl/floatwin.hxx b/include/vcl/floatwin.hxx
index c76876003ff1..2d4981ef1fad 100644
--- a/include/vcl/floatwin.hxx
+++ b/include/vcl/floatwin.hxx
@@ -117,7 +117,7 @@ public:
SAL_DLLPRIVATE void ImplEndPopupMode( sal_uInt16 nFlags = 0, sal_uLong nFocusId = 0 );
SAL_DLLPRIVATE Rectangle& ImplGetItemEdgeClipRect();
SAL_DLLPRIVATE bool ImplIsInPrivatePopupMode() const { return mbInPopupMode; }
- virtual void doDeferredInit(bool bResizable, bool bCloseable) SAL_OVERRIDE;
+ virtual void doDeferredInit(WinBits nBits) SAL_OVERRIDE;
public:
explicit FloatingWindow(Window* pParent, WinBits nStyle = WB_STDFLOATWIN);
diff --git a/include/vcl/syswin.hxx b/include/vcl/syswin.hxx
index 93c5926551ff..ce79e114a8a1 100644
--- a/include/vcl/syswin.hxx
+++ b/include/vcl/syswin.hxx
@@ -276,7 +276,7 @@ public:
SAL_DLLPRIVATE bool hasPendingLayout() const { return maLayoutTimer.IsActive(); }
- virtual void doDeferredInit(bool bResizable, bool bCloseable);
+ virtual void doDeferredInit(WinBits nBits);
};
#endif // INCLUDED_VCL_SYSWIN_HXX
diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx
index 25781db35c10..090feb2ebab9 100644
--- a/sfx2/source/toolbox/tbxitem.cxx
+++ b/sfx2/source/toolbox/tbxitem.cxx
@@ -1125,8 +1125,6 @@ throw ( ::com::sun::star::uno::RuntimeException, std::exception )
}
}
-
-
SfxPopupWindow::SfxPopupWindow(
sal_uInt16 nId,
const Reference< XFrame >& rFrame,
@@ -1143,13 +1141,9 @@ SfxPopupWindow::SfxPopupWindow(
((SystemWindow *)pWindow)->GetTaskPaneList()->AddWindow( this );
}
-
-
-SfxPopupWindow::SfxPopupWindow(
- sal_uInt16 nId,
- const Reference< XFrame >& rFrame,
- const ResId &rId ) :
- FloatingWindow( SfxGetpApp()->GetTopWindow(), rId )
+SfxPopupWindow::SfxPopupWindow(sal_uInt16 nId, const OString& rID, const OUString& rUIXMLDescription,
+ const css::uno::Reference<css::frame::XFrame> &rFrame)
+ : FloatingWindow(SfxGetpApp()->GetTopWindow(), rID, rUIXMLDescription, rFrame)
, m_bFloating( false )
, m_bCascading( false )
, m_nId( nId )
@@ -1161,8 +1155,6 @@ SfxPopupWindow::SfxPopupWindow(
((SystemWindow *)pWindow)->GetTaskPaneList()->AddWindow( this );
}
-
-
SfxPopupWindow::SfxPopupWindow(
sal_uInt16 nId,
const Reference< XFrame >& rFrame,
@@ -1197,8 +1189,6 @@ SfxPopupWindow::SfxPopupWindow(
((SystemWindow *)pWindow)->GetTaskPaneList()->AddWindow( this );
}
-
-
SfxPopupWindow::~SfxPopupWindow()
{
if ( m_xStatusListener.is() )
diff --git a/svx/UIConfig_svx.mk b/svx/UIConfig_svx.mk
index 21ac190369f8..b5db9b0df7e8 100644
--- a/svx/UIConfig_svx.mk
+++ b/svx/UIConfig_svx.mk
@@ -30,6 +30,7 @@ $(eval $(call gb_UIConfig_add_uifiles,svx,\
svx/uiconfig/ui/docrecoverysavedialog \
svx/uiconfig/ui/extrustiondepthdialog \
svx/uiconfig/ui/findreplacedialog \
+ svx/uiconfig/ui/floatingundoredo \
svx/uiconfig/ui/fontworkgallerydialog \
svx/uiconfig/ui/fontworkspacingdialog \
svx/uiconfig/ui/formlinkwarndialog \
diff --git a/svx/inc/helpid.hrc b/svx/inc/helpid.hrc
index c69725247b1c..33fd0a6e68d7 100644
--- a/svx/inc/helpid.hrc
+++ b/svx/inc/helpid.hrc
@@ -112,7 +112,6 @@
#define HID_POPUP_LINEEND "SVX_HID_POPUP_LINEEND"
#define HID_POPUP_LINEEND_CTRL "SVX_HID_POPUP_LINEEND_CTRL"
#define HID_STYLE_LISTBOX "SVX_HID_STYLE_LISTBOX"
-#define HID_SVXTBX_UNDO_REDO_CTRL "SVX_HID_SVXTBX_UNDO_REDO_CTRL"
#define HID_SVX_MDLG_DOCRECOVERY_BROKEN "SVX_HID_SVX_MDLG_DOCRECOVERY_BROKEN"
#define HID_SVX_TP_DOCRECOVERY_RECOVER "SVX_HID_SVX_TP_DOCRECOVERY_RECOVER"
#define HID_VALUESET_EXTRUSION_DIRECTION "SVX_HID_VALUESET_EXTRUSION_DIRECTION"
diff --git a/svx/source/tbxctrls/lboxctrl.cxx b/svx/source/tbxctrls/lboxctrl.cxx
index a6b2600bebf0..33340d59cddf 100644
--- a/svx/source/tbxctrls/lboxctrl.cxx
+++ b/svx/source/tbxctrls/lboxctrl.cxx
@@ -44,33 +44,24 @@
#include <svx/svxids.hrc>
#include <svx/dialogs.hrc>
-#include "lboxctrl.hrc"
-
-
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::frame;
class SvxPopupWindowListBox;
-
-
class SvxPopupWindowListBox: public SfxPopupWindow
{
using FloatingWindow::StateChanged;
- ListBox * pListBox;
+ ListBox * m_pListBox;
ToolBox & rToolBox;
bool bUserSel;
sal_uInt16 nTbxId;
OUString maCommandURL;
- // disallow copy-constructor and assignment-operator
-
-// SvxPopupWindowListBox( sal_uInt16 nSlotId, ToolBox& rTbx, sal_uInt16 nTbxItemId );
public:
SvxPopupWindowListBox( sal_uInt16 nSlotId, const OUString& rCommandURL, sal_uInt16 nTbxId, ToolBox& rTbx );
- virtual ~SvxPopupWindowListBox();
// SfxPopupWindow
virtual SfxPopupWindow * Clone() const SAL_OVERRIDE;
@@ -78,43 +69,38 @@ public:
virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
const SfxPoolItem* pState ) SAL_OVERRIDE;
- inline ListBox & GetListBox() { return *pListBox; }
+ inline ListBox & GetListBox() { return *m_pListBox; }
bool IsUserSelected() const { return bUserSel; }
void SetUserSelected( bool bVal ) { bUserSel = bVal; }
- /*virtual*/Window* GetPreferredKeyInputWindow() SAL_OVERRIDE;
+ virtual Window* GetPreferredKeyInputWindow() SAL_OVERRIDE;
};
-
-
-SvxPopupWindowListBox::SvxPopupWindowListBox( sal_uInt16 nSlotId, const OUString& rCommandURL, sal_uInt16 nId, ToolBox& rTbx ) :
- SfxPopupWindow( nSlotId, Reference< XFrame >(), SVX_RES( RID_SVXTBX_UNDO_REDO_CTRL ) ),
- rToolBox ( rTbx ),
- bUserSel ( false ),
- nTbxId ( nId ),
- maCommandURL( rCommandURL )
+SvxPopupWindowListBox::SvxPopupWindowListBox(sal_uInt16 nSlotId, const OUString& rCommandURL, sal_uInt16 nId, ToolBox& rTbx)
+ : SfxPopupWindow(nSlotId, "FloatingUndoRedo", "svx/ui/floatingundoredo.ui")
+ , rToolBox(rTbx)
+ , bUserSel(false)
+ , nTbxId(nId)
+ , maCommandURL(rCommandURL)
{
DBG_ASSERT( nSlotId == GetId(), "id mismatch" );
- pListBox = new ListBox( this, SVX_RES( LB_SVXTBX_UNDO_REDO_CTRL ) );
- FreeResource();
- pListBox->EnableMultiSelection( true, true );
+ get(m_pListBox, "treeview");
+ WinBits nBits(m_pListBox->GetStyle());
+ nBits &= ~(WB_SIMPLEMODE);
+ m_pListBox->SetStyle(nBits);
+ Size aSize(LogicToPixel(Size(100, 85), MAP_APPFONT));
+ m_pListBox->set_width_request(aSize.Width());
+ m_pListBox->set_height_request(aSize.Height());
+ m_pListBox->EnableMultiSelection( true, true );
SetBackground( GetSettings().GetStyleSettings().GetDialogColor() );
AddStatusListener( rCommandURL );
}
-
-SvxPopupWindowListBox::~SvxPopupWindowListBox()
-{
- delete pListBox;
-}
-
-
SfxPopupWindow* SvxPopupWindowListBox::Clone() const
{
return new SvxPopupWindowListBox( GetId(), maCommandURL, nTbxId, rToolBox );
}
-
void SvxPopupWindowListBox::PopupModeEnd()
{
rToolBox.EndSelection();
@@ -141,11 +127,9 @@ Window* SvxPopupWindowListBox::GetPreferredKeyInputWindow()
{
// allows forwarding key events in the correct window
// without setting the focus
- return pListBox->GetPreferredKeyInputWindow();
+ return m_pListBox->GetPreferredKeyInputWindow();
}
-
-
SvxListBoxControl::SvxListBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx )
:SfxToolBoxControl( nSlotId, nId, rTbx ),
pPopupWin ( 0 )
diff --git a/svx/source/tbxctrls/lboxctrl.hrc b/svx/source/tbxctrls/lboxctrl.hrc
deleted file mode 100644
index 8320a91c8884..000000000000
--- a/svx/source/tbxctrls/lboxctrl.hrc
+++ /dev/null
@@ -1,22 +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 LB_SVXTBX_UNDO_REDO_CTRL 11
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/tbxctrls/lboxctrl.src b/svx/source/tbxctrls/lboxctrl.src
index 7961f3913410..f9b5ab12004d 100644
--- a/svx/source/tbxctrls/lboxctrl.src
+++ b/svx/source/tbxctrls/lboxctrl.src
@@ -19,27 +19,6 @@
#include <svx/dialogs.hrc>
#include <helpid.hrc>
-#include "lboxctrl.hrc"
-
-FloatingWindow RID_SVXTBX_UNDO_REDO_CTRL
-{
- Pos = MAP_APPFONT ( 0 , 0 ) ;
- Size = MAP_APPFONT ( 102 , 87 ) ;
- HelpID = HID_SVXTBX_UNDO_REDO_CTRL ;
- StdPopup = TRUE;
- Hide = TRUE ;
- OutputSize = TRUE ;
-
- ListBox LB_SVXTBX_UNDO_REDO_CTRL
- {
- HelpID = "svx:ListBox:RID_SVXTBX_UNDO_REDO_CTRL:LB_SVXTBX_UNDO_REDO_CTRL";
- Pos = MAP_APPFONT ( 0 , 0 ) ;
- Size = MAP_APPFONT ( 100 , 85 ) ;
- Border = TRUE ;
- DropDown = FALSE ;
- OutputSize = TRUE ;
- };
-};
String RID_SVXSTR_NUM_UNDO_ACTIONS
{
diff --git a/svx/uiconfig/ui/floatingundoredo.ui b/svx/uiconfig/ui/floatingundoredo.ui
new file mode 100644
index 000000000000..66f30a614dcb
--- /dev/null
+++ b/svx/uiconfig/ui/floatingundoredo.ui
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.16.1 -->
+<interface>
+ <requires lib="gtk+" version="3.0"/>
+ <object class="GtkWindow" id="FloatingUndoRedo:border">
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="border_width">6</property>
+ <property name="resizable">False</property>
+ <property name="destroy_with_parent">True</property>
+ <property name="type_hint">popup-menu</property>
+ <property name="skip_pager_hint">True</property>
+ <property name="decorated">False</property>
+ <property name="deletable">False</property>
+ <child>
+ <object class="GtkBox" id="box">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkTreeView" id="treeview">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <child internal-child="selection">
+ <object class="GtkTreeSelection" id="treeview-selection1"/>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index ed310f0b8337..8db06521a5c2 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -930,6 +930,26 @@ namespace
return eUnit;
}
+
+ WinBits extractDeferredBits(VclBuilder::stringmap &rMap)
+ {
+ WinBits nBits = WB_3DLOOK|WB_HIDE;
+ if (extractResizable(rMap))
+ nBits |= WB_SIZEABLE;
+ if (extractCloseable(rMap))
+ nBits |= WB_CLOSEABLE;
+ OString sBorder = VclBuilder::extractCustomProperty(rMap);
+ if (!sBorder.isEmpty())
+ nBits |= WB_BORDER;
+ OString sType(extractTypeHint(rMap));
+ if (sType == "utility")
+ nBits |= WB_SYSTEMWINDOW | WB_DIALOGCONTROL | WB_MOVEABLE;
+ else if (sType == "popup-menu")
+ nBits |= WB_SYSTEMWINDOW | WB_DIALOGCONTROL | WB_POPUP;
+ else
+ nBits |= WB_MOVEABLE;
+ return nBits;
+ }
}
FieldUnit VclBuilder::detectUnit(OString const& rString)
@@ -1597,18 +1617,8 @@ Window *VclBuilder::makeObject(Window *pParent, const OString &name, const OStri
}
else if (name == "GtkWindow")
{
- WinBits nBits = WB_SYSTEMWINDOW|WB_MOVEABLE|WB_3DLOOK|WB_CLOSEABLE|WB_HIDE;
- if (extractResizable(rMap))
- nBits |= WB_SIZEABLE;
- OString sType(extractTypeHint(rMap));
- if (sType == "utility")
- {
- pWindow = new FloatingWindow(pParent, nBits);
- }
- else
- {
- SAL_WARN("vcl.layout", "no mapping yet for GtkWindow of type " << sType.getStr() << " yet");
- }
+ WinBits nBits = extractDeferredBits(rMap);
+ pWindow = new FloatingWindow(pParent, nBits|WB_MOVEABLE);
}
else
{
@@ -1706,7 +1716,7 @@ Window *VclBuilder::insertObject(Window *pParent, const OString &rClass,
if (pParent->IsSystemWindow())
{
SystemWindow *pSysWin = static_cast<SystemWindow*>(pCurrentChild);
- pSysWin->doDeferredInit(extractResizable(rProps), extractCloseable(rProps));
+ pSysWin->doDeferredInit(extractDeferredBits(rProps));
m_bToplevelHasDeferredInit = false;
}
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 5f04074d1293..ff6ab0c1b8c3 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -477,13 +477,8 @@ OUString VclBuilderContainer::getUIRootDir()
//we can't change sizeable after the fact, so need to defer until we know and then
//do the init. Find the real parent stashed in mpDialogParent.
-void Dialog::doDeferredInit(bool bResizable, bool bCloseable)
+void Dialog::doDeferredInit(WinBits nBits)
{
- WinBits nBits = WB_3DLOOK|WB_CLOSEABLE|WB_MOVEABLE;
- if (bResizable)
- nBits |= WB_SIZEABLE;
- if (bCloseable)
- nBits |= WB_CLOSEABLE;
Window *pParent = mpDialogParent;
mpDialogParent = NULL;
ImplInit(pParent, nBits);
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index caedcbcaaef3..05b806f7d120 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -171,13 +171,8 @@ FloatingWindow::FloatingWindow(Window* pParent, const OString& rID, const OUStri
}
//Find the real parent stashed in mpDialogParent.
-void FloatingWindow::doDeferredInit(bool bResizable, bool bCloseable)
+void FloatingWindow::doDeferredInit(WinBits nBits)
{
- WinBits nBits = WB_MOVEABLE|WB_3DLOOK;
- if (bResizable)
- nBits |= WB_SIZEABLE;
- if (bCloseable)
- nBits |= WB_CLOSEABLE;
Window *pParent = mpDialogParent;
mpDialogParent = NULL;
ImplInit(pParent, nBits);
diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx
index c2746348f68b..6a21d22bc4bf 100644
--- a/vcl/source/window/syswin.cxx
+++ b/vcl/source/window/syswin.cxx
@@ -1101,7 +1101,7 @@ void SystemWindow::DoInitialLayout()
}
}
-void SystemWindow::doDeferredInit(bool /*bResizable*/, bool /*bCloseable*/)
+void SystemWindow::doDeferredInit(WinBits /*nBits*/)
{
SAL_WARN("vcl.layout", "SystemWindow in layout without doDeferredInit impl");
}