summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorSzymon Kłos <eszkadev@gmail.com>2016-09-06 14:14:19 +0200
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2016-09-07 19:26:56 +0000
commitd5137fe53e5f2e0b87dd27f6e7602a392b3931bd (patch)
tree725115d5d063ef24fbb3fda9d6cec65040f91184 /sw/source
parente928e2daa3a8a9ad5d8ee7bf5982b41ec9cc6344 (diff)
Page column popup converted to use outside the sidebar
Change-Id: Iedb239eba5d74d10cef68276c2a03028f8cf81bf Reviewed-on: https://gerrit.libreoffice.org/28703 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/ui/sidebar/PagePropertyPanel.src91
-rw-r--r--sw/source/uibase/app/swmodule.cxx2
-rw-r--r--sw/source/uibase/sidebar/PageColumnControl.cxx117
-rw-r--r--sw/source/uibase/sidebar/PageColumnControl.hxx36
-rw-r--r--sw/source/uibase/sidebar/PageColumnPopup.cxx46
-rw-r--r--sw/source/uibase/sidebar/PagePropertyPanel.cxx124
-rw-r--r--sw/source/uibase/sidebar/PagePropertyPanel.hrc1
-rw-r--r--sw/source/uibase/sidebar/PagePropertyPanel.hxx24
-rw-r--r--sw/source/uibase/sidebar/PropertyPanel.hrc1
9 files changed, 126 insertions, 316 deletions
diff --git a/sw/source/ui/sidebar/PagePropertyPanel.src b/sw/source/ui/sidebar/PagePropertyPanel.src
index 785861dd758d..901bc608c93b 100644
--- a/sw/source/ui/sidebar/PagePropertyPanel.src
+++ b/sw/source/ui/sidebar/PagePropertyPanel.src
@@ -154,10 +154,6 @@ Image IMG_PAGE_COLUMN_RIGHT
{
ImageBitmap = Bitmap{File = "sidebar/pageproppanel/column_L_right_24x24.png";};
};
-Image IMG_PAGE_COLUMN_NONE
-{
- ImageBitmap = Bitmap{File = "sidebar/pageproppanel/column_L_copy_24x24.png";};
-};
Image IMG_PAGE_COLUMN_1_L
{
ImageBitmap = Bitmap{File = "sidebar/pageproppanel/column1_24x24.png";};
@@ -439,91 +435,4 @@ Control RID_POPUP_SWPAGE_SIZE
};
};
-// popup for page style's column attribute
-Control RID_POPUP_SWPAGE_COLUMN
-{
- OutputSize = TRUE;
- DialogControl = TRUE;
- Border = FALSE;
- Size = MAP_APPFONT( POPUPPANEL_MARGIN_SMALL * 2 + POPUP_BORDER_WIDTH + VS_WIDTH - 15, ITEM_HEIGHT*5 + POPUPPANEL_MARGIN_SMALL*2 + CONTROL_SPACING_VERTICAL + 15 );
-
- Control VS_COLUMN
- {
- Pos = MAP_APPFONT( POPUPPANEL_MARGIN_SMALL + OFFSET_X, POPUPPANEL_MARGIN_SMALL + OFFSET_Y);
- Size = MAP_APPFONT ( VS_WIDTH -15 , ITEM_HEIGHT*5);
- HelpID = HID_SWPAGE_VS_COLUMN;
- TabStop = TRUE ;
- Text = "Column";
- };
- PushButton CB_COLUMN_MORE
- {
- Pos = MAP_APPFONT ( POPUPPANEL_MARGIN_SMALL + 2*OFFSET_X, POPUPPANEL_MARGIN_SMALL + 2*OFFSET_Y + ITEM_HEIGHT*5 ) ;
- Size = MAP_APPFONT ( VS_WIDTH - 2 - 15, 15 ) ;
- HelpID = HID_SWPAGE_COLUMN_MORE;
- TabStop = TRUE ;
- Text [ en-US ] = "~More Options";
- QuickHelpText [ en-US ] = "More Options" ;
- };
- Image IMG_ONE
- {
- ImageBitmap = Bitmap{File = "sidebar/pageproppanel/column_L_1_24x24.png";};
- };
- Image IMG_TWO
- {
- ImageBitmap = Bitmap{File = "sidebar/pageproppanel/column_L_2_24x24.png";};
- };
- Image IMG_THREE
- {
- ImageBitmap = Bitmap{File = "sidebar/pageproppanel/column_L_3_24x24.png";};
- };
- Image IMG_LEFT
- {
- ImageBitmap = Bitmap{File = "sidebar/pageproppanel/column_L_left_24x24.png";};
- };
- Image IMG_RIGHT
- {
- ImageBitmap = Bitmap{File = "sidebar/pageproppanel/column_L_right_24x24.png";};
- };
- Image IMG_ONE_L
- {
- ImageBitmap = Bitmap{File = "sidebar/pageproppanel/column1_24x24.png";};
- };
- Image IMG_TWO_L
- {
- ImageBitmap = Bitmap{File = "sidebar/pageproppanel/column2_24x24.png";};
- };
- Image IMG_THREE_L
- {
- ImageBitmap = Bitmap{File = "sidebar/pageproppanel/column3_24x24.png";};
- };
- Image IMG_LEFT_L
- {
- ImageBitmap = Bitmap{File = "sidebar/pageproppanel/columnleft_24x24.png";};
- };
- Image IMG_RIGHT_L
- {
- ImageBitmap = Bitmap{File = "sidebar/pageproppanel/columnright_24x24.png";};
- };
- String STR_ONE
- {
- Text [ en-US ] = "1 Column";
- };
- String STR_TWO
- {
- Text [ en-US ] = "2 Columns";
- };
- String STR_THREE
- {
- Text [ en-US ] = "3 Columns";
- };
- String STR_LEFT
- {
- Text [ en-US ] = "Left";
- };
- String STR_RIGHT
- {
- Text [ en-US ] = "Right";
- };
-};
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/app/swmodule.cxx b/sw/source/uibase/app/swmodule.cxx
index e41b621ddd79..45be91e3c40e 100644
--- a/sw/source/uibase/app/swmodule.cxx
+++ b/sw/source/uibase/app/swmodule.cxx
@@ -111,6 +111,7 @@
#include <svx/rubydialog.hxx>
#include <svtools/colorcfg.hxx>
#include <PageOrientationPopup.hxx>
+#include <PageColumnPopup.hxx>
#include <unotools/configmgr.hxx>
#include <unotools/moduleoptions.hxx>
@@ -293,6 +294,7 @@ void SwDLL::RegisterControls()
svx::ParaULSpacingControl::RegisterControl(SID_ATTR_PARA_ULSPACE, pMod);
svx::ParaLRSpacingControl::RegisterControl(SID_ATTR_PARA_LRSPACE, pMod);
PageOrientationPopup::RegisterControl(SID_ATTR_PAGE_ORIENTATION, pMod);
+ PageColumnPopup::RegisterControl(SID_ATTR_PAGE_COLUMN, pMod);
SvxColorToolBoxControl::RegisterControl( SID_EXTRUSION_3D_COLOR, pMod );
diff --git a/sw/source/uibase/sidebar/PageColumnControl.cxx b/sw/source/uibase/sidebar/PageColumnControl.cxx
index 8d2697993bc4..04d24c43160a 100644
--- a/sw/source/uibase/sidebar/PageColumnControl.cxx
+++ b/sw/source/uibase/sidebar/PageColumnControl.cxx
@@ -28,52 +28,54 @@
#include <sfx2/bindings.hxx>
#include <sfx2/dispatch.hxx>
#include <vcl/settings.hxx>
+#include <svx/svxids.hrc>
namespace sw { namespace sidebar {
-PageColumnControl::PageColumnControl(
- vcl::Window* pParent,
- PagePropertyPanel& rPanel,
- const sal_uInt16 nColumnType,
- const bool bLandscape )
- : svx::sidebar::PopupControl( pParent, SW_RES(RID_POPUP_SWPAGE_COLUMN) )
- , mpColumnValueSet( VclPtr<svx::sidebar::ValueSetWithTextControl>::Create( svx::sidebar::ValueSetWithTextControl::ControlType::ImageText, this, SW_RES(VS_COLUMN) ) )
- , maMoreButton( VclPtr<PushButton>::Create( this, SW_RES(CB_COLUMN_MORE) ) )
- , mnColumnType( nColumnType )
- , mrPagePropPanel(rPanel)
+PageColumnControl::PageColumnControl( sal_uInt16 nId )
+ : SfxPopupWindow( nId, "PageColumnControl", "modules/swriter/ui/pagecolumncontrol.ui" )
{
- mpColumnValueSet->SetStyle( mpColumnValueSet->GetStyle() | WB_3DLOOK | WB_NO_DIRECTSELECT );
- mpColumnValueSet->SetColor(GetSettings().GetStyleSettings().GetMenuColor());
+ get( m_pMoreButton, "moreoptions" );
+
+ bool bLandscape = false;
+ const SfxPoolItem *pItem;
+ if ( SfxViewFrame::Current() )
+ {
+ SfxViewFrame::Current()->GetBindings().GetDispatcher()->QueryState( SID_ATTR_PAGE, pItem );
+ bLandscape = static_cast<const SvxPageItem*>(pItem)->IsLandscape();
+ }
if ( bLandscape )
{
- mpColumnValueSet->AddItem(Image(SW_RES(IMG_ONE_L)), nullptr, SW_RES(STR_ONE), nullptr );
- mpColumnValueSet->AddItem(Image(SW_RES(IMG_TWO_L)), nullptr, SW_RES(STR_TWO), nullptr );
- mpColumnValueSet->AddItem(Image(SW_RES(IMG_THREE_L)), nullptr, SW_RES(STR_THREE), nullptr );
- mpColumnValueSet->AddItem(Image(SW_RES(IMG_LEFT_L)), nullptr, SW_RES(STR_LEFT), nullptr );
- mpColumnValueSet->AddItem(Image(SW_RES(IMG_RIGHT_L)), nullptr, SW_RES(STR_RIGHT), nullptr );
+ get(m_pOneColumn, "column1L");
+ get(m_pTwoColumns, "column2L");
+ get(m_pThreeColumns, "column3L");
+ get(m_pLeft, "columnleftL");
+ get(m_pRight, "columnrightL");
}
else
{
- mpColumnValueSet->AddItem(Image(SW_RES(IMG_ONE)), nullptr, SW_RES(STR_ONE), nullptr );
- mpColumnValueSet->AddItem(Image(SW_RES(IMG_TWO)), nullptr, SW_RES(STR_TWO), nullptr );
- mpColumnValueSet->AddItem(Image(SW_RES(IMG_THREE)), nullptr, SW_RES(STR_THREE), nullptr );
- mpColumnValueSet->AddItem(Image(SW_RES(IMG_LEFT)), nullptr, SW_RES(STR_LEFT), nullptr );
- mpColumnValueSet->AddItem(Image(SW_RES(IMG_RIGHT)), nullptr, SW_RES(STR_RIGHT), nullptr );
+ get(m_pOneColumn, "column1");
+ get(m_pTwoColumns, "column2");
+ get(m_pThreeColumns, "column3");
+ get(m_pLeft, "columnleft");
+ get(m_pRight, "columnright");
}
- mpColumnValueSet->SetNoSelection();
- mpColumnValueSet->SetSelectHdl( LINK(this, PageColumnControl,ImplColumnHdl ) );
- mpColumnValueSet->Show();
- mpColumnValueSet->SelectItem( mnColumnType );
- mpColumnValueSet->SetFormat();
- mpColumnValueSet->Invalidate();
- mpColumnValueSet->StartSelection();
+ m_pOneColumn->Show();
+ m_pTwoColumns->Show();
+ m_pThreeColumns->Show();
+ m_pLeft->Show();
+ m_pRight->Show();
- maMoreButton->SetClickHdl( LINK( this, PageColumnControl, MoreButtonClickHdl_Impl ) );
- maMoreButton->GrabFocus();
+ m_pOneColumn->SetClickHdl( LINK( this, PageColumnControl, ColumnButtonClickHdl_Impl ) );
+ m_pTwoColumns->SetClickHdl( LINK( this, PageColumnControl, ColumnButtonClickHdl_Impl ) );
+ m_pThreeColumns->SetClickHdl( LINK( this, PageColumnControl, ColumnButtonClickHdl_Impl ) );
+ m_pLeft->SetClickHdl( LINK( this, PageColumnControl, ColumnButtonClickHdl_Impl ) );
+ m_pRight->SetClickHdl( LINK( this, PageColumnControl, ColumnButtonClickHdl_Impl ) );
- FreeResource();
+ m_pMoreButton->SetClickHdl( LINK( this, PageColumnControl, MoreButtonClickHdl_Impl ) );
+ m_pMoreButton->GrabFocus();
}
PageColumnControl::~PageColumnControl()
@@ -83,32 +85,45 @@ PageColumnControl::~PageColumnControl()
void PageColumnControl::dispose()
{
- mpColumnValueSet.disposeAndClear();
- maMoreButton.disposeAndClear();
- svx::sidebar::PopupControl::dispose();
+ m_pOneColumn.disposeAndClear();
+ m_pTwoColumns.disposeAndClear();
+ m_pThreeColumns.disposeAndClear();
+ m_pLeft.disposeAndClear();
+ m_pRight.disposeAndClear();
+ m_pMoreButton.disposeAndClear();
+ SfxPopupWindow::dispose();
}
-IMPL_LINK_TYPED(PageColumnControl, ImplColumnHdl, ValueSet*, pControl, void)
+void PageColumnControl::ExecuteColumnChange( const sal_uInt16 nColumnType )
{
- mpColumnValueSet->SetNoSelection();
- if ( pControl == mpColumnValueSet )
- {
- const sal_uInt32 nColumnType = mpColumnValueSet->GetSelectItemId();
- if ( nColumnType != mnColumnType )
- {
- mnColumnType = nColumnType;
- mrPagePropPanel.ExecuteColumnChange( mnColumnType );
- }
- }
-
- mrPagePropPanel.ClosePageColumnPopup();
+ std::unique_ptr<SfxInt16Item> mpPageColumnTypeItem( new SfxInt16Item(SID_ATTR_PAGE_COLUMN) );
+ mpPageColumnTypeItem->SetValue( nColumnType );
+ if ( SfxViewFrame::Current() )
+ SfxViewFrame::Current()->GetBindings().GetDispatcher()->ExecuteList(SID_ATTR_PAGE_COLUMN,
+ SfxCallMode::RECORD, { mpPageColumnTypeItem.get() });
}
-IMPL_LINK_NOARG_TYPED(PageColumnControl, MoreButtonClickHdl_Impl, Button*, void)
+IMPL_LINK_TYPED( PageColumnControl, ColumnButtonClickHdl_Impl, Button*, pButton, void )
{
- mrPagePropPanel.GetBindings()->GetDispatcher()->Execute( FN_FORMAT_PAGE_COLUMN_DLG, SfxCallMode::ASYNCHRON );
+ if ( pButton == m_pOneColumn.get() )
+ ExecuteColumnChange( 1 );
+ else if ( pButton == m_pTwoColumns.get() )
+ ExecuteColumnChange( 2 );
+ else if ( pButton == m_pThreeColumns.get() )
+ ExecuteColumnChange( 3 );
+ else if ( pButton == m_pLeft.get() )
+ ExecuteColumnChange( 4 );
+ else if ( pButton == m_pRight.get() )
+ ExecuteColumnChange( 5 );
+
+ EndPopupMode();
+}
- mrPagePropPanel.ClosePageColumnPopup();
+IMPL_LINK_NOARG_TYPED( PageColumnControl, MoreButtonClickHdl_Impl, Button*, void )
+{
+ if ( SfxViewFrame::Current() )
+ SfxViewFrame::Current()->GetBindings().GetDispatcher()->Execute( FN_FORMAT_PAGE_COLUMN_DLG, SfxCallMode::ASYNCHRON );
+ EndPopupMode();
}
} } // end of namespace sw::sidebar
diff --git a/sw/source/uibase/sidebar/PageColumnControl.hxx b/sw/source/uibase/sidebar/PageColumnControl.hxx
index 796cb84ea4ce..b116d5c41403 100644
--- a/sw/source/uibase/sidebar/PageColumnControl.hxx
+++ b/sw/source/uibase/sidebar/PageColumnControl.hxx
@@ -19,45 +19,33 @@
#ifndef INCLUDED_SW_SOURCE_UIBASE_SIDEBAR_PAGECOLUMNCONTROL_HXX
#define INCLUDED_SW_SOURCE_UIBASE_SIDEBAR_PAGECOLUMNCONTROL_HXX
-#include <svx/sidebar/PopupControl.hxx>
-
-#include <vcl/image.hxx>
+#include <svx/tbxctl.hxx>
#include <vcl/button.hxx>
-#include <vector>
-
-namespace svx { namespace sidebar {
- class ValueSetWithTextControl;
-} }
-class ValueSet;
-
namespace sw { namespace sidebar {
class PagePropertyPanel;
-class PageColumnControl
- : public svx::sidebar::PopupControl
+class PageColumnControl : public SfxPopupWindow
{
public:
- PageColumnControl(
- vcl::Window* pParent,
- PagePropertyPanel& rPanel,
- const sal_uInt16 nColumnType,
- const bool bLandscape );
+ PageColumnControl( sal_uInt16 nId );
virtual ~PageColumnControl();
virtual void dispose() override;
private:
- VclPtr< svx::sidebar::ValueSetWithTextControl> mpColumnValueSet;
- VclPtr<PushButton> maMoreButton;
-
- sal_uInt16 mnColumnType;
+ VclPtr<PushButton> m_pOneColumn;
+ VclPtr<PushButton> m_pTwoColumns;
+ VclPtr<PushButton> m_pThreeColumns;
+ VclPtr<PushButton> m_pLeft;
+ VclPtr<PushButton> m_pRight;
+ VclPtr<PushButton> m_pMoreButton;
- PagePropertyPanel& mrPagePropPanel;
+ static void ExecuteColumnChange( const sal_uInt16 nColumnType );
- DECL_LINK_TYPED(ImplColumnHdl, ValueSet*, void);
- DECL_LINK_TYPED(MoreButtonClickHdl_Impl, Button*, void);
+ DECL_LINK_TYPED( ColumnButtonClickHdl_Impl, Button*, void );
+ DECL_LINK_TYPED( MoreButtonClickHdl_Impl, Button*, void );
};
} } // end of namespace sw::sidebar
diff --git a/sw/source/uibase/sidebar/PageColumnPopup.cxx b/sw/source/uibase/sidebar/PageColumnPopup.cxx
new file mode 100644
index 000000000000..e8830cb0bf16
--- /dev/null
+++ b/sw/source/uibase/sidebar/PageColumnPopup.cxx
@@ -0,0 +1,46 @@
+/* -*- 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 .
+ */
+#include <PageColumnPopup.hxx>
+#include "PageColumnControl.hxx"
+#include <svl/intitem.hxx>
+#include <vcl/toolbox.hxx>
+
+SFX_IMPL_TOOLBOX_CONTROL(PageColumnPopup, SfxInt16Item);
+
+PageColumnPopup::PageColumnPopup(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx)
+ : SfxToolBoxControl(nSlotId, nId, rTbx)
+{
+ rTbx.SetItemBits(nId, ToolBoxItemBits::DROPDOWN | rTbx.GetItemBits(nId));
+}
+
+PageColumnPopup::~PageColumnPopup()
+{
+}
+
+VclPtr<SfxPopupWindow> PageColumnPopup::CreatePopupWindow()
+{
+ VclPtr<sw::sidebar::PageColumnControl> pControl = VclPtr<sw::sidebar::PageColumnControl>::Create(GetSlotId());
+ pControl->StartPopupMode(&GetToolBox(), FloatWinPopupFlags::GrabFocus|FloatWinPopupFlags::NoAppFocusClose);
+ SetPopupWindow(pControl);
+
+ return pControl;
+}
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/sidebar/PagePropertyPanel.cxx b/sw/source/uibase/sidebar/PagePropertyPanel.cxx
index fa6d711e59d7..ea0f3741554b 100644
--- a/sw/source/uibase/sidebar/PagePropertyPanel.cxx
+++ b/sw/source/uibase/sidebar/PagePropertyPanel.cxx
@@ -29,7 +29,6 @@
#include <svx/sidebar/PopupContainer.hxx>
#include "PageMarginControl.hxx"
#include "PageSizeControl.hxx"
-#include "PageColumnControl.hxx"
#include <swtypes.hxx>
#include <cmdid.h>
@@ -53,7 +52,6 @@
const char UNO_MARGIN[] = ".uno:Margin";
const char UNO_SIZE[] = ".uno:Size";
-const char UNO_COLUMN[] = ".uno:Column";
namespace {
const css::uno::Reference< css::document::XUndoManager > getUndoManager( const css::uno::Reference< css::frame::XFrame >& rxFrame )
@@ -134,25 +132,12 @@ PagePropertyPanel::PagePropertyPanel(
, mImgLetter_L (SW_RES(IMG_PAGE_LETTER_L))
, mImgLegal_L (SW_RES(IMG_PAGE_LEGAL_L))
, mImgSizeNone_L (SW_RES(IMG_PAGE_SIZE_NONE_L))
- , mImgColumn1 (SW_RES(IMG_PAGE_COLUMN_1))
- , mImgColumn2 (SW_RES(IMG_PAGE_COLUMN_2))
- , mImgColumn3 (SW_RES(IMG_PAGE_COLUMN_3))
- , mImgLeft (SW_RES(IMG_PAGE_COLUMN_LEFT))
- , mImgRight (SW_RES(IMG_PAGE_COLUMN_RIGHT))
- , mImgColumnNone (SW_RES(IMG_PAGE_COLUMN_NONE))
- , mImgColumn1_L (SW_RES(IMG_PAGE_COLUMN_1_L))
- , mImgColumn2_L (SW_RES(IMG_PAGE_COLUMN_2_L))
- , mImgColumn3_L (SW_RES(IMG_PAGE_COLUMN_3_L))
- , mImgLeft_L (SW_RES(IMG_PAGE_COLUMN_LEFT_L))
- , mImgRight_L (SW_RES(IMG_PAGE_COLUMN_RIGHT_L))
- , mImgColumnNone_L (SW_RES(IMG_PAGE_COLUMN_NONE_L))
, mpPageItem( new SvxPageItem(SID_ATTR_PAGE) )
, mpPageLRMarginItem( new SvxLongLRSpaceItem( 0, 0, SID_ATTR_PAGE_LRSPACE ) )
, mpPageULMarginItem( new SvxLongULSpaceItem( 0, 0, SID_ATTR_PAGE_ULSPACE ) )
, mpPageSizeItem( new SvxSizeItem(SID_ATTR_PAGE_SIZE) )
, mePaper( PAPER_USER )
- , mpPageColumnTypeItem( new SfxInt16Item(SID_ATTR_PAGE_COLUMN) )
, meFUnit()
, meUnit()
@@ -161,7 +146,6 @@ PagePropertyPanel::PagePropertyPanel(
, m_aSwPagePgLRControl(SID_ATTR_PAGE_LRSPACE, *pBindings, *this)
, m_aSwPagePgSizeControl(SID_ATTR_PAGE_SIZE, *pBindings, *this)
, m_aSwPagePgControl(SID_ATTR_PAGE, *pBindings, *this)
- , m_aSwPageColControl(SID_ATTR_PAGE_COLUMN, *pBindings, *this)
, m_aSwPagePgMetricControl(SID_ATTR_METRIC, *pBindings, *this)
, maMarginPopup( this,
@@ -170,9 +154,6 @@ PagePropertyPanel::PagePropertyPanel(
, maSizePopup( this,
[this] (svx::sidebar::PopupContainer *parent) { return this->CreatePageSizeControl(parent); },
OUString("Page size") )
- , maColumnPopup( this,
- [this] (svx::sidebar::PopupContainer *parent) { return this->CreatePageColumnControl(parent); },
- OUString("Page columns") )
, mxUndoManager( getUndoManager( rxFrame ) )
@@ -181,7 +162,6 @@ PagePropertyPanel::PagePropertyPanel(
// visible controls
get(mpToolBoxMargin, "selectmargin");
get(mpToolBoxSize, "selectsize");
- get(mpToolBoxColumn, "selectcolumn");
Initialize();
mbInvalidateSIDAttrPageOnSIDAttrPageSizeNotify = true;
@@ -206,16 +186,13 @@ void PagePropertyPanel::dispose()
mpToolBoxMargin.clear();
mpToolBoxSize.clear();
- mpToolBoxColumn.clear();
m_aSwPagePgULControl.dispose();
m_aSwPagePgLRControl.dispose();
m_aSwPagePgSizeControl.dispose();
m_aSwPagePgControl.dispose();
- m_aSwPageColControl.dispose();
m_aSwPagePgMetricControl.dispose();
- maColumnPopup.dispose();
maSizePopup.dispose();
maMarginPopup.dispose();
@@ -258,14 +235,6 @@ void PagePropertyPanel::Initialize()
maImgSize_L[6] = mImgLetter_L;
maImgSize_L[7] = mImgLegal_L;
- // popup for page column property
- const sal_uInt16 nIdColumn = mpToolBoxColumn->GetItemId(UNO_COLUMN);
- aLink = LINK( this, PagePropertyPanel, ClickColumnHdl );
- mpToolBoxColumn->SetDropdownClickHdl( aLink );
- mpToolBoxColumn->SetSelectHdl( aLink );
- mpToolBoxColumn->SetItemImage(nIdColumn, mImgColumn1);
- mpToolBoxColumn->SetItemBits( nIdColumn, mpToolBoxColumn->GetItemBits( nIdColumn ) | ToolBoxItemBits::DROPDOWNONLY );
-
meFUnit = GetModuleFieldUnit();
meUnit = m_aSwPagePgSizeControl.GetCoreMetric();
@@ -362,33 +331,6 @@ void PagePropertyPanel::ClosePageSizePopup()
maSizePopup.Hide();
}
-VclPtr< svx::sidebar::PopupControl> PagePropertyPanel::CreatePageColumnControl( svx::sidebar::PopupContainer* pParent )
-{
- return VclPtr<PageColumnControl>::Create(
-
- pParent,
- *this,
- mpPageColumnTypeItem->GetValue(),
- mpPageItem->IsLandscape() );
-}
-
-void PagePropertyPanel::ExecuteColumnChange( const sal_uInt16 nColumnType )
-{
- mpPageColumnTypeItem->SetValue( nColumnType );
- mpBindings->GetDispatcher()->ExecuteList(SID_ATTR_PAGE_COLUMN,
- SfxCallMode::RECORD, { mpPageColumnTypeItem.get() });
-}
-
-IMPL_LINK_TYPED( PagePropertyPanel, ClickColumnHdl, ToolBox*, pToolBox, void )
-{
- maColumnPopup.Show( *pToolBox );
-}
-
-void PagePropertyPanel::ClosePageColumnPopup()
-{
- maColumnPopup.Hide();
-}
-
void PagePropertyPanel::NotifyItemUpdate(
const sal_uInt16 nSId,
const SfxItemState eState,
@@ -402,16 +344,6 @@ void PagePropertyPanel::NotifyItemUpdate(
switch( nSId )
{
- case SID_ATTR_PAGE_COLUMN:
- {
- if ( eState >= SfxItemState::DEFAULT &&
- pState && dynamic_cast< const SfxInt16Item *>( pState ) != nullptr )
- {
- mpPageColumnTypeItem.reset( static_cast<SfxInt16Item*>(pState->Clone()) );
- ChangeColumnImage( mpPageColumnTypeItem->GetValue() );
- }
- }
- break;
case SID_ATTR_PAGE_LRSPACE:
if ( eState >= SfxItemState::DEFAULT &&
pState && dynamic_cast< const SvxLongLRSpaceItem *>( pState ) != nullptr )
@@ -585,62 +517,6 @@ void PagePropertyPanel::ChangeSizeImage()
}
}
-void PagePropertyPanel::ChangeColumnImage( const sal_uInt16 nColumnType )
-{
- if ( mpPageItem.get() == nullptr )
- {
- return;
- }
-
- const sal_uInt16 nIdColumn = mpToolBoxColumn->GetItemId(UNO_COLUMN);
- if ( !mpPageItem->IsLandscape() )
- {
- switch( nColumnType )
- {
- case 1:
- mpToolBoxColumn->SetItemImage(nIdColumn, mImgColumn1);
- break;
- case 2:
- mpToolBoxColumn->SetItemImage(nIdColumn, mImgColumn2);
- break;
- case 3:
- mpToolBoxColumn->SetItemImage(nIdColumn, mImgColumn3);
- break;
- case 4:
- mpToolBoxColumn->SetItemImage(nIdColumn, mImgLeft);
- break;
- case 5:
- mpToolBoxColumn->SetItemImage(nIdColumn, mImgRight);
- break;
- default:
- mpToolBoxColumn->SetItemImage(nIdColumn, mImgColumnNone);
- }
- }
- else
- {
- switch( nColumnType )
- {
- case 1:
- mpToolBoxColumn->SetItemImage(nIdColumn, mImgColumn1_L);
- break;
- case 2:
- mpToolBoxColumn->SetItemImage(nIdColumn, mImgColumn2_L);
- break;
- case 3:
- mpToolBoxColumn->SetItemImage(nIdColumn, mImgColumn3_L);
- break;
- case 4:
- mpToolBoxColumn->SetItemImage(nIdColumn, mImgLeft_L);
- break;
- case 5:
- mpToolBoxColumn->SetItemImage(nIdColumn, mImgRight_L);
- break;
- default:
- mpToolBoxColumn->SetItemImage(nIdColumn, mImgColumnNone_L);
- }
- }
-}
-
void PagePropertyPanel::StartUndo()
{
if ( mxUndoManager.is() )
diff --git a/sw/source/uibase/sidebar/PagePropertyPanel.hrc b/sw/source/uibase/sidebar/PagePropertyPanel.hrc
index 01d4df9ce654..c8af7bccf769 100644
--- a/sw/source/uibase/sidebar/PagePropertyPanel.hrc
+++ b/sw/source/uibase/sidebar/PagePropertyPanel.hrc
@@ -54,7 +54,6 @@
#define IMG_PAGE_COLUMN_3 (RC_SIDEBAR_BEGIN + 32)
#define IMG_PAGE_COLUMN_LEFT (RC_SIDEBAR_BEGIN + 33)
#define IMG_PAGE_COLUMN_RIGHT (RC_SIDEBAR_BEGIN + 34)
-#define IMG_PAGE_COLUMN_NONE (RC_SIDEBAR_BEGIN + 35)
#define IMG_PAGE_COLUMN_1_L (RC_SIDEBAR_BEGIN + 36)
#define IMG_PAGE_COLUMN_2_L (RC_SIDEBAR_BEGIN + 37)
#define IMG_PAGE_COLUMN_3_L (RC_SIDEBAR_BEGIN + 38)
diff --git a/sw/source/uibase/sidebar/PagePropertyPanel.hxx b/sw/source/uibase/sidebar/PagePropertyPanel.hxx
index 4c71d44c4fa7..72a7d4b52065 100644
--- a/sw/source/uibase/sidebar/PagePropertyPanel.hxx
+++ b/sw/source/uibase/sidebar/PagePropertyPanel.hxx
@@ -85,10 +85,6 @@ namespace sw { namespace sidebar {
void ExecuteSizeChange( const Paper ePaper );
void ClosePageSizePopup();
- VclPtr< svx::sidebar::PopupControl> CreatePageColumnControl( svx::sidebar::PopupContainer* pParent );
- void ExecuteColumnChange( const sal_uInt16 nColumnType );
- void ClosePageColumnPopup();
-
void StartUndo();
void EndUndo();
@@ -105,7 +101,6 @@ namespace sw { namespace sidebar {
// toolboxes - on click open corresponding popup
VclPtr<ToolBox> mpToolBoxMargin;
VclPtr<ToolBox> mpToolBoxSize;
- VclPtr<ToolBox> mpToolBoxColumn;
Image* maImgSize;
Image* maImgSize_L;
@@ -137,18 +132,6 @@ namespace sw { namespace sidebar {
Image mImgLetter_L;
Image mImgLegal_L;
Image mImgSizeNone_L;
- Image mImgColumn1;
- Image mImgColumn2;
- Image mImgColumn3;
- Image mImgLeft;
- Image mImgRight;
- Image mImgColumnNone;
- Image mImgColumn1_L;
- Image mImgColumn2_L;
- Image mImgColumn3_L;
- Image mImgLeft_L;
- Image mImgRight_L;
- Image mImgColumnNone_L;
// item keeping the following page style attributes:
// - page orientation
@@ -167,9 +150,6 @@ namespace sw { namespace sidebar {
// Paper corresponding to the page style's page size
Paper mePaper;
- // item keeping the page column type
- std::unique_ptr<SfxInt16Item> mpPageColumnTypeItem;
-
FieldUnit meFUnit;
MapUnit meUnit;
@@ -178,13 +158,11 @@ namespace sw { namespace sidebar {
::sfx2::sidebar::ControllerItem m_aSwPagePgLRControl;
::sfx2::sidebar::ControllerItem m_aSwPagePgSizeControl;
::sfx2::sidebar::ControllerItem m_aSwPagePgControl;
- ::sfx2::sidebar::ControllerItem m_aSwPageColControl;
::sfx2::sidebar::ControllerItem m_aSwPagePgMetricControl;
// popups
svx::sidebar::Popup maMarginPopup;
svx::sidebar::Popup maSizePopup;
- svx::sidebar::Popup maColumnPopup;
const css::uno::Reference< css::document::XUndoManager > mxUndoManager;
@@ -193,7 +171,6 @@ namespace sw { namespace sidebar {
// handler for popup toolboxes to show the popups
DECL_LINK_TYPED(ClickMarginHdl, ToolBox*, void);
DECL_LINK_TYPED(ClickSizeHdl, ToolBox*, void);
- DECL_LINK_TYPED(ClickColumnHdl, ToolBox*, void);
void Initialize();
@@ -202,7 +179,6 @@ namespace sw { namespace sidebar {
// helper to adjust popup toolbox' images
void ChangeMarginImage();
void ChangeSizeImage();
- void ChangeColumnImage( const sal_uInt16 nColumnType );
};
diff --git a/sw/source/uibase/sidebar/PropertyPanel.hrc b/sw/source/uibase/sidebar/PropertyPanel.hrc
index 7b36710f75a6..c4ca5a65e972 100644
--- a/sw/source/uibase/sidebar/PropertyPanel.hrc
+++ b/sw/source/uibase/sidebar/PropertyPanel.hrc
@@ -22,7 +22,6 @@
#include "rcid.hrc"
#define RID_POPUP_SWPAGE_MARGIN (RC_PROPERTYPANEL_BEGIN + 3)
-#define RID_POPUP_SWPAGE_COLUMN (RC_PROPERTYPANEL_BEGIN + 5)
#define RID_POPUP_SWPAGE_SIZE (RC_PROPERTYPANEL_BEGIN + 6)