diff options
author | roopak12345 <mailstorpk@gmail.com> | 2014-03-09 21:40:44 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-03-09 21:53:34 +0100 |
commit | a652ea0fc4cc789f715b461819127ee80afa9e6f (patch) | |
tree | 0858def8201a45024721f4a98b537cd3274ac4c5 /sw/source/ui/sidebar | |
parent | f4dfd811344604e119670eb7cdda0ab2e85bcea5 (diff) |
fdo#70422 Moved the linked files from sw/source/ui to a new core/uibase dir
Moved the files linked in sw/Library_sw.mk from sw/source/ui to
sw/source/core/uibase and modified the make files as per the new
directory location.
Reviewed on:
https://gerrit.libreoffice.org/8447
Change-Id: I05f6ccdeee5e76fb0ae477d16721d9ddc6eaff32
Diffstat (limited to 'sw/source/ui/sidebar')
-rw-r--r-- | sw/source/ui/sidebar/PageColumnControl.cxx | 110 | ||||
-rw-r--r-- | sw/source/ui/sidebar/PageColumnControl.hxx | 65 | ||||
-rw-r--r-- | sw/source/ui/sidebar/PageMarginControl.cxx | 518 | ||||
-rw-r--r-- | sw/source/ui/sidebar/PageMarginControl.hxx | 121 | ||||
-rw-r--r-- | sw/source/ui/sidebar/PageOrientationControl.cxx | 90 | ||||
-rw-r--r-- | sw/source/ui/sidebar/PageOrientationControl.hxx | 56 | ||||
-rw-r--r-- | sw/source/ui/sidebar/PagePropertyPanel.cxx | 742 | ||||
-rw-r--r-- | sw/source/ui/sidebar/PagePropertyPanel.hrc | 188 | ||||
-rw-r--r-- | sw/source/ui/sidebar/PagePropertyPanel.hxx | 223 | ||||
-rw-r--r-- | sw/source/ui/sidebar/PageSizeControl.cxx | 177 | ||||
-rw-r--r-- | sw/source/ui/sidebar/PageSizeControl.hxx | 71 | ||||
-rw-r--r-- | sw/source/ui/sidebar/PropertyPanel.hrc | 35 | ||||
-rw-r--r-- | sw/source/ui/sidebar/SwPanelFactory.cxx | 148 | ||||
-rw-r--r-- | sw/source/ui/sidebar/WrapPropertyPanel.cxx | 243 | ||||
-rw-r--r-- | sw/source/ui/sidebar/WrapPropertyPanel.hxx | 88 |
15 files changed, 0 insertions, 2875 deletions
diff --git a/sw/source/ui/sidebar/PageColumnControl.cxx b/sw/source/ui/sidebar/PageColumnControl.cxx deleted file mode 100644 index f2a5f3857bee..000000000000 --- a/sw/source/ui/sidebar/PageColumnControl.cxx +++ /dev/null @@ -1,110 +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 . - */ - -#include "PageColumnControl.hxx" -#include "PagePropertyPanel.hxx" -#include "PagePropertyPanel.hrc" - -#include <cmdid.h> -#include <swtypes.hxx> - -#include <svx/sidebar/ValueSetWithTextControl.hxx> -#include <sfx2/bindings.hxx> -#include <sfx2/dispatch.hxx> -#include <vcl/settings.hxx> - -namespace sw { namespace sidebar { - -PageColumnControl::PageColumnControl( - Window* pParent, - PagePropertyPanel& rPanel, - const sal_uInt16 nColumnType, - const bool bLandscape ) - : ::svx::sidebar::PopupControl( pParent, SW_RES(RID_POPUP_SWPAGE_COLUMN) ) - , mpColumnValueSet( new ::svx::sidebar::ValueSetWithTextControl( ::svx::sidebar::ValueSetWithTextControl::IMAGE_TEXT, this, SW_RES(VS_COLUMN) ) ) - , maMoreButton( this, SW_RES(CB_COLUMN_MORE) ) - , mnColumnType( nColumnType ) - , mrPagePropPanel(rPanel) -{ - mpColumnValueSet->SetStyle( mpColumnValueSet->GetStyle() | WB_3DLOOK | WB_NO_DIRECTSELECT ); - mpColumnValueSet->SetColor(GetSettings().GetStyleSettings().GetMenuColor()); - - if ( bLandscape ) - { - mpColumnValueSet->AddItem(Image(SW_RES(IMG_ONE_L)), 0, SW_RES(STR_ONE), 0 ); - mpColumnValueSet->AddItem(Image(SW_RES(IMG_TWO_L)), 0, SW_RES(STR_TWO), 0 ); - mpColumnValueSet->AddItem(Image(SW_RES(IMG_THREE_L)), 0, SW_RES(STR_THREE), 0 ); - mpColumnValueSet->AddItem(Image(SW_RES(IMG_LEFT_L)), 0, SW_RES(STR_LEFT), 0 ); - mpColumnValueSet->AddItem(Image(SW_RES(IMG_RIGHT_L)), 0, SW_RES(STR_RIGHT), 0 ); - } - else - { - mpColumnValueSet->AddItem(Image(SW_RES(IMG_ONE)), 0, SW_RES(STR_ONE), 0 ); - mpColumnValueSet->AddItem(Image(SW_RES(IMG_TWO)), 0, SW_RES(STR_TWO), 0 ); - mpColumnValueSet->AddItem(Image(SW_RES(IMG_THREE)), 0, SW_RES(STR_THREE), 0 ); - mpColumnValueSet->AddItem(Image(SW_RES(IMG_LEFT)), 0, SW_RES(STR_LEFT), 0 ); - mpColumnValueSet->AddItem(Image(SW_RES(IMG_RIGHT)), 0, SW_RES(STR_RIGHT), 0 ); - } - - mpColumnValueSet->SetNoSelection(); - mpColumnValueSet->SetSelectHdl( LINK(this, PageColumnControl,ImplColumnHdl ) ); - mpColumnValueSet->Show(); - mpColumnValueSet->SelectItem( mnColumnType ); - mpColumnValueSet->Format(); - mpColumnValueSet->StartSelection(); - - maMoreButton.SetClickHdl( LINK( this, PageColumnControl, MoreButtonClickHdl_Impl ) ); - maMoreButton.GrabFocus(); - - FreeResource(); -} - -PageColumnControl::~PageColumnControl(void) -{ - delete mpColumnValueSet; -} - -IMPL_LINK(PageColumnControl, ImplColumnHdl, void *, pControl) -{ - mpColumnValueSet->SetNoSelection(); - if ( pControl == mpColumnValueSet ) - { - const sal_uInt32 nColumnType = mpColumnValueSet->GetSelectItemId(); - if ( nColumnType != mnColumnType ) - { - mnColumnType = nColumnType; - mrPagePropPanel.ExecuteColumnChange( mnColumnType ); - } - } - - mrPagePropPanel.ClosePageColumnPopup(); - return 0; -} - -IMPL_LINK(PageColumnControl, MoreButtonClickHdl_Impl, void *, EMPTYARG) -{ - mrPagePropPanel.GetBindings()->GetDispatcher()->Execute( FN_FORMAT_PAGE_COLUMN_DLG, SFX_CALLMODE_ASYNCHRON ); - - mrPagePropPanel.ClosePageColumnPopup(); - return 0; -} - -} } // end of namespace sw::sidebar - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/sidebar/PageColumnControl.hxx b/sw/source/ui/sidebar/PageColumnControl.hxx deleted file mode 100644 index 875bea370fd7..000000000000 --- a/sw/source/ui/sidebar/PageColumnControl.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 INCLUDED_SW_SOURCE_UI_SIDEBAR_PAGECOLUMNCONTROL_HXX -#define INCLUDED_SW_SOURCE_UI_SIDEBAR_PAGECOLUMNCONTROL_HXX - -#include <svx/sidebar/PopupControl.hxx> - -#include <vcl/image.hxx> -#include <vcl/button.hxx> - -#include <vector> - -namespace svx { namespace sidebar { - class ValueSetWithTextControl; -} } - -namespace sw { namespace sidebar { - -class PagePropertyPanel; - -class PageColumnControl - : public ::svx::sidebar::PopupControl -{ -public: - PageColumnControl( - Window* pParent, - PagePropertyPanel& rPanel, - const sal_uInt16 nColumnType, - const bool bLandscape ); - - ~PageColumnControl(void); - -private: - ::svx::sidebar::ValueSetWithTextControl* mpColumnValueSet; - PushButton maMoreButton; - - sal_uInt16 mnColumnType; - - PagePropertyPanel& mrPagePropPanel; - - DECL_LINK(ImplColumnHdl, void*); - DECL_LINK(MoreButtonClickHdl_Impl, void*); -}; - -} } // end of namespace sw::sidebar - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/sidebar/PageMarginControl.cxx b/sw/source/ui/sidebar/PageMarginControl.cxx deleted file mode 100644 index dd3d031c8dff..000000000000 --- a/sw/source/ui/sidebar/PageMarginControl.cxx +++ /dev/null @@ -1,518 +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 . - */ - -#include <sal/config.h> - -#include <cstdlib> - -#include "PageMarginControl.hxx" -#include "PagePropertyPanel.hxx" -#include "PagePropertyPanel.hrc" - -#include <swtypes.hxx> - -#include <svx/sidebar/ValueSetWithTextControl.hxx> -#include <vcl/settings.hxx> - -#define SWPAGE_LEFT_GVALUE "Sw_Page_Left" -#define SWPAGE_RIGHT_GVALUE "Sw_Page_Right" -#define SWPAGE_TOP_GVALUE "Sw_Page_Top" -#define SWPAGE_DOWN_GVALUE "Sw_Page_Down" -#define SWPAGE_MIRROR_GVALUE "Sw_Page_Mirrored" - -namespace sw { namespace sidebar { - -PageMarginControl::PageMarginControl( - Window* pParent, - PagePropertyPanel& rPanel, - const SvxLongLRSpaceItem& aPageLRMargin, - const SvxLongULSpaceItem& aPageULMargin, - const bool bMirrored, - const Size aPageSize, - const sal_Bool bLandscape, - const FieldUnit eFUnit, - const SfxMapUnit eUnit ) - : ::svx::sidebar::PopupControl( pParent, SW_RES(RID_POPUP_SWPAGE_MARGIN) ) - , mpMarginValueSet( new ::svx::sidebar::ValueSetWithTextControl( ::svx::sidebar::ValueSetWithTextControl::IMAGE_TEXT, this, SW_RES(VS_MARGIN) ) ) - , maCustom(this, SW_RES(FT_CUSTOM)) - , maLeft(this, SW_RES(FT_LEFT)) - , maInner(this, SW_RES(FT_INNER)) - , maLeftMarginEdit(this, SW_RES(MF_SWLEFT_MARGIN)) - , maRight(this, SW_RES(FT_RIGHT)) - , maOuter(this, SW_RES(FT_OUTER)) - , maRightMarginEdit(this, SW_RES(MF_SWRIGHT_MARGIN)) - , maTop(this, SW_RES(FT_TOP)) - , maTopMarginEdit(this, SW_RES(MF_SWTOP_MARGIN)) - , maBottom(this, SW_RES(FT_BOTTOM)) - , maBottomMarginEdit(this, SW_RES(MF_SWBOTTOM_MARGIN)) - , maWidthHeightField( this, SW_RES(FLD_WIDTH_HEIGHT) ) - , mnPageLeftMargin( aPageLRMargin.GetLeft() ) - , mnPageRightMargin( aPageLRMargin.GetRight() ) - , mnPageTopMargin( aPageULMargin.GetUpper() ) - , mnPageBottomMargin( aPageULMargin.GetLower() ) - , mbMirrored( bMirrored ) - , meUnit( eUnit ) - , mbUserCustomValuesAvailable(false) - , mnUserCustomPageLeftMargin(0) - , mnUserCustomPageRightMargin(0) - , mnUserCustomPageTopMargin(0) - , mnUserCustomPageBottomMargin(0) - , mbUserCustomMirrored(false) - , mbCustomValuesUsed( false ) - , mrPagePropPanel(rPanel) -{ - maWidthHeightField.Hide(); - SetFieldUnit( maWidthHeightField, eFUnit ); - - mbUserCustomValuesAvailable = GetUserCustomValues(); - - mpMarginValueSet->SetStyle( mpMarginValueSet->GetStyle() | WB_3DLOOK | WB_NO_DIRECTSELECT ); - mpMarginValueSet->SetColor( GetSettings().GetStyleSettings().GetMenuColor() ); - - FillValueSet( bLandscape, mbUserCustomValuesAvailable ); - - mpMarginValueSet->SetNoSelection(); - mpMarginValueSet->SetSelectHdl( LINK(this, PageMarginControl,ImplMarginHdl ) ); - mpMarginValueSet->Show(); - - SelectValueSetItem(); - - SetFieldUnit( maLeftMarginEdit, eFUnit ); - Link aLinkLR = LINK( this, PageMarginControl, ModifyLRMarginHdl ); - maLeftMarginEdit.SetModifyHdl( aLinkLR ); - SetMetricValue( maLeftMarginEdit, mnPageLeftMargin, meUnit ); - - SetFieldUnit( maRightMarginEdit, eFUnit ); - maRightMarginEdit.SetModifyHdl( aLinkLR ); - SetMetricValue( maRightMarginEdit, mnPageRightMargin, meUnit ); - - Link aLinkUL = LINK( this, PageMarginControl, ModifyULMarginHdl ); - SetFieldUnit( maTopMarginEdit, eFUnit ); - maTopMarginEdit.SetModifyHdl( aLinkUL ); - SetMetricValue( maTopMarginEdit, mnPageTopMargin, meUnit ); - - SetFieldUnit( maBottomMarginEdit, eFUnit ); - maBottomMarginEdit.SetModifyHdl( aLinkUL ); - SetMetricValue( maBottomMarginEdit, mnPageBottomMargin, meUnit ); - - SetMetricFieldMaxValues( aPageSize ); - - if ( mbMirrored ) - { - maLeft.Hide(); - maRight.Hide(); - maInner.Show(); - maOuter.Show(); - } - else - { - maLeft.Show(); - maRight.Show(); - maInner.Hide(); - maOuter.Hide(); - } - - FreeResource(); -} - -PageMarginControl::~PageMarginControl(void) -{ - delete mpMarginValueSet; - - StoreUserCustomValues(); -} - -void PageMarginControl::SetMetricFieldMaxValues( const Size aPageSize ) -{ - const long nML = maLeftMarginEdit.Denormalize( maLeftMarginEdit.GetValue(FUNIT_TWIP) ); - const long nMR = maRightMarginEdit.Denormalize( maRightMarginEdit.GetValue(FUNIT_TWIP) ); - const long nMT = maTopMarginEdit.Denormalize(maTopMarginEdit.GetValue(FUNIT_TWIP) ); - const long nMB = maBottomMarginEdit.Denormalize( maBottomMarginEdit.GetValue(FUNIT_TWIP) ); - - const long nPH = LogicToLogic( aPageSize.Height(), (MapUnit)meUnit, MAP_TWIP ); - const long nPW = LogicToLogic( aPageSize.Width(), (MapUnit)meUnit, MAP_TWIP ); - - // Left - long nMax = nPW - nMR - MINBODY; - maLeftMarginEdit.SetMax(maLeftMarginEdit.Normalize(nMax), FUNIT_TWIP); - - // Right - nMax = nPW - nML - MINBODY; - maRightMarginEdit.SetMax(maRightMarginEdit.Normalize(nMax), FUNIT_TWIP); - - //Top - nMax = nPH - nMB - MINBODY; - maTopMarginEdit.SetMax(maTopMarginEdit.Normalize(nMax), FUNIT_TWIP); - - //Bottom - nMax = nPH - nMT - MINBODY; - maBottomMarginEdit.SetMax(maTopMarginEdit.Normalize(nMax), FUNIT_TWIP); -} - -void PageMarginControl::FillValueSet( - const bool bLandscape, - const bool bUserCustomValuesAvailable ) -{ - const OUString aLeft = SW_RESSTR(STR_MARGIN_TOOLTIP_LEFT); - const OUString aRight = SW_RESSTR(STR_MARGIN_TOOLTIP_RIGHT); - const OUString aTop = SW_RESSTR(STR_MARGIN_TOOLTIP_TOP); - const OUString aBottom = SW_RESSTR(STR_MARGIN_TOOLTIP_BOT); - - SetMetricValue( maWidthHeightField, SWPAGE_NARROW_VALUE, meUnit ); - const OUString aNarrowValText = maWidthHeightField.GetText(); - OUString aHelpText = aLeft; - aHelpText += aNarrowValText; - aHelpText += aRight; - aHelpText += aNarrowValText; - aHelpText += aTop; - aHelpText += aNarrowValText; - aHelpText += aBottom; - aHelpText += aNarrowValText; - mpMarginValueSet->AddItem( - Image((bLandscape) ? SW_RES(IMG_NARROW_L) : SW_RES(IMG_NARROW)), 0, - SW_RESSTR(STR_NARROW), &aHelpText ); - - SetMetricValue( maWidthHeightField, SWPAGE_NORMAL_VALUE, meUnit ); - const OUString aNormalValText = maWidthHeightField.GetText(); - aHelpText = aLeft; - aHelpText += aNormalValText; - aHelpText += aRight; - aHelpText += aNormalValText; - aHelpText += aTop; - aHelpText += aNormalValText; - aHelpText += aBottom; - aHelpText += aNormalValText; - mpMarginValueSet->AddItem( - Image((bLandscape) ? SW_RES(IMG_NORMAL_L) : SW_RES(IMG_NORMAL)), 0, - SW_RESSTR(STR_NORMAL), &aHelpText ); - - SetMetricValue( maWidthHeightField, SWPAGE_WIDE_VALUE1, meUnit ); - const OUString aWide1ValText = maWidthHeightField.GetText(); - SetMetricValue( maWidthHeightField, SWPAGE_WIDE_VALUE2, meUnit ); - const OUString aWide2ValText = maWidthHeightField.GetText(); - aHelpText = aLeft; - aHelpText += aWide2ValText; - aHelpText += aRight; - aHelpText += aWide2ValText; - aHelpText += aTop; - aHelpText += aWide1ValText; - aHelpText += aBottom; - aHelpText += aWide1ValText; - mpMarginValueSet->AddItem( - Image((bLandscape) ? SW_RES(IMG_WIDE_L) : SW_RES(IMG_WIDE)), 0, - SW_RESSTR(STR_WIDE), &aHelpText ); - - const OUString aInner = SW_RESSTR(STR_MARGIN_TOOLTIP_INNER); - const OUString aOuter = SW_RESSTR(STR_MARGIN_TOOLTIP_OUTER); - - SetMetricValue( maWidthHeightField, SWPAGE_WIDE_VALUE3, meUnit ); - const OUString aWide3ValText = maWidthHeightField.GetText(); - aHelpText = aInner; - aHelpText += aWide3ValText; - aHelpText += aOuter; - aHelpText += aWide3ValText; - aHelpText += aTop; - aHelpText += aWide1ValText; - aHelpText += aBottom; - aHelpText += aWide1ValText; - mpMarginValueSet->AddItem( - Image((bLandscape) ? SW_RES(IMG_MIRRORED_L) : SW_RES(IMG_MIRRORED)), 0, - SW_RESSTR(STR_MIRRORED), &aHelpText ); - - if ( bUserCustomValuesAvailable ) - { - aHelpText = mbUserCustomMirrored ? aInner : aLeft; - SetMetricValue( maWidthHeightField, mnUserCustomPageLeftMargin, meUnit ); - aHelpText += maWidthHeightField.GetText(); - aHelpText += mbUserCustomMirrored ? aOuter : aRight; - SetMetricValue( maWidthHeightField, mnUserCustomPageRightMargin, meUnit ); - aHelpText += maWidthHeightField.GetText(); - aHelpText += aTop; - SetMetricValue( maWidthHeightField, mnUserCustomPageTopMargin, meUnit ); - aHelpText += maWidthHeightField.GetText(); - aHelpText += aBottom; - SetMetricValue( maWidthHeightField, mnUserCustomPageBottomMargin, meUnit ); - aHelpText += maWidthHeightField.GetText(); - } - else - { - aHelpText = OUString(); - } - mpMarginValueSet->AddItem( - Image((bUserCustomValuesAvailable) ? SW_RES(IMG_CUSTOM) : SW_RES(IMG_CUSTOM_DIS)), 0, - SW_RESSTR(STR_LCVALUE), &aHelpText ); -} - -void PageMarginControl::SelectValueSetItem() -{ - const long cTolerance = 5; - - if( std::abs(mnPageLeftMargin - SWPAGE_NARROW_VALUE) <= cTolerance && - std::abs(mnPageRightMargin - SWPAGE_NARROW_VALUE) <= cTolerance && - std::abs(mnPageTopMargin - SWPAGE_NARROW_VALUE) <= cTolerance && - std::abs(mnPageBottomMargin - SWPAGE_NARROW_VALUE) <= cTolerance && - !mbMirrored ) - { - mpMarginValueSet->SelectItem(1); - } - else if( std::abs(mnPageLeftMargin - SWPAGE_NORMAL_VALUE) <= cTolerance && - std::abs(mnPageRightMargin - SWPAGE_NORMAL_VALUE) <= cTolerance && - std::abs(mnPageTopMargin - SWPAGE_NORMAL_VALUE) <= cTolerance && - std::abs(mnPageBottomMargin - SWPAGE_NORMAL_VALUE) <= cTolerance && - !mbMirrored ) - { - mpMarginValueSet->SelectItem(2); - } - else if( std::abs(mnPageLeftMargin - SWPAGE_WIDE_VALUE2) <= cTolerance && - std::abs(mnPageRightMargin - SWPAGE_WIDE_VALUE2) <= cTolerance && - std::abs(mnPageTopMargin - SWPAGE_WIDE_VALUE1) <= cTolerance && - std::abs(mnPageBottomMargin - SWPAGE_WIDE_VALUE1) <= cTolerance && - !mbMirrored ) - { - mpMarginValueSet->SelectItem(3); - } - else if( std::abs(mnPageLeftMargin - SWPAGE_WIDE_VALUE3) <= cTolerance && - std::abs(mnPageRightMargin - SWPAGE_WIDE_VALUE1) <= cTolerance && - std::abs(mnPageTopMargin - SWPAGE_WIDE_VALUE1) <= cTolerance && - std::abs(mnPageBottomMargin - SWPAGE_WIDE_VALUE1) <= cTolerance && - mbMirrored ) - { - mpMarginValueSet->SelectItem(4); - } - else - { - mpMarginValueSet->SelectItem(0); - } - - mpMarginValueSet->Format(); - mpMarginValueSet->StartSelection(); -}; - -IMPL_LINK(PageMarginControl, ImplMarginHdl, void *, pControl) -{ - if ( pControl == mpMarginValueSet ) - { - const sal_uInt16 iPos = mpMarginValueSet->GetSelectItemId(); - bool bMirrored = false; - bool bApplyNewPageMargins = true; - switch ( iPos ) - { - case 1: - mnPageLeftMargin = SWPAGE_NARROW_VALUE; - mnPageRightMargin = SWPAGE_NARROW_VALUE; - mnPageTopMargin = SWPAGE_NARROW_VALUE; - mnPageBottomMargin = SWPAGE_NARROW_VALUE; - bMirrored = false; - break; - case 2: - mnPageLeftMargin = SWPAGE_NORMAL_VALUE; - mnPageRightMargin = SWPAGE_NORMAL_VALUE; - mnPageTopMargin = SWPAGE_NORMAL_VALUE; - mnPageBottomMargin = SWPAGE_NORMAL_VALUE; - bMirrored = false; - break; - case 3: - mnPageLeftMargin = SWPAGE_WIDE_VALUE2; - mnPageRightMargin = SWPAGE_WIDE_VALUE2; - mnPageTopMargin = SWPAGE_WIDE_VALUE1; - mnPageBottomMargin = SWPAGE_WIDE_VALUE1; - bMirrored = false; - break; - case 4: - mnPageLeftMargin = SWPAGE_WIDE_VALUE3; - mnPageRightMargin = SWPAGE_WIDE_VALUE1; - mnPageTopMargin = SWPAGE_WIDE_VALUE1; - mnPageBottomMargin = SWPAGE_WIDE_VALUE1; - bMirrored = true; - break; - case 5: - if ( mbUserCustomValuesAvailable ) - { - mnPageLeftMargin = mnUserCustomPageLeftMargin; - mnPageRightMargin = mnUserCustomPageRightMargin; - mnPageTopMargin = mnUserCustomPageTopMargin; - mnPageBottomMargin = mnUserCustomPageBottomMargin; - bMirrored = mbUserCustomMirrored; - } - else - { - bApplyNewPageMargins = false; - } - break; - } - - if ( bApplyNewPageMargins ) - { - mrPagePropPanel.StartUndo(); - mpMarginValueSet->SetNoSelection(); - mrPagePropPanel.ExecuteMarginLRChange( mnPageLeftMargin, mnPageRightMargin ); - mrPagePropPanel.ExecuteMarginULChange( mnPageTopMargin, mnPageBottomMargin ); - if ( mbMirrored != bMirrored ) - { - mbMirrored = bMirrored; - mrPagePropPanel.ExecutePageLayoutChange( mbMirrored ); - } - mrPagePropPanel.EndUndo(); - - mbCustomValuesUsed = false; - mrPagePropPanel.ClosePageMarginPopup(); - } - else - { - // back to initial selection - SelectValueSetItem(); - } - } - - return 0; -} - -IMPL_LINK( PageMarginControl, ModifyLRMarginHdl, MetricField *, EMPTYARG ) -{ - mpMarginValueSet->SetNoSelection(); - mpMarginValueSet->SelectItem(0); - mpMarginValueSet->Format(); - mpMarginValueSet->StartSelection(); - - mnPageLeftMargin = GetCoreValue( maLeftMarginEdit, meUnit ); - mnPageRightMargin = GetCoreValue( maRightMarginEdit, meUnit ); - mrPagePropPanel.ExecuteMarginLRChange( mnPageLeftMargin, mnPageRightMargin ); - mbCustomValuesUsed = true; - return 0; -} - -IMPL_LINK( PageMarginControl, ModifyULMarginHdl, MetricField *, EMPTYARG ) -{ - mpMarginValueSet->SetNoSelection(); - mpMarginValueSet->SelectItem(0); - mpMarginValueSet->Format(); - mpMarginValueSet->StartSelection(); - - mnPageTopMargin = GetCoreValue( maTopMarginEdit, meUnit ); - mnPageBottomMargin = GetCoreValue( maBottomMarginEdit, meUnit ); - mrPagePropPanel.ExecuteMarginULChange( mnPageTopMargin, mnPageBottomMargin ); - mbCustomValuesUsed = true; - return 0; -} - -bool PageMarginControl::GetUserCustomValues() -{ - bool bUserCustomValuesAvailable = false; - - SvtViewOptions aWinOpt( E_WINDOW, SWPAGE_LEFT_GVALUE ); - if ( aWinOpt.Exists() ) - { - ::com::sun::star::uno::Sequence < ::com::sun::star::beans::NamedValue > aSeq = aWinOpt.GetUserData(); - ::rtl::OUString aTmp; - if ( aSeq.getLength()) - aSeq[0].Value >>= aTmp; - OUString aWinData( aTmp ); - mnUserCustomPageLeftMargin = aWinData.toInt32(); - bUserCustomValuesAvailable = true; - } - - SvtViewOptions aWinOpt2( E_WINDOW, SWPAGE_RIGHT_GVALUE ); - if ( aWinOpt2.Exists() ) - { - ::com::sun::star::uno::Sequence < ::com::sun::star::beans::NamedValue > aSeq = aWinOpt2.GetUserData(); - ::rtl::OUString aTmp; - if ( aSeq.getLength()) - aSeq[0].Value >>= aTmp; - OUString aWinData( aTmp ); - mnUserCustomPageRightMargin = aWinData.toInt32(); - bUserCustomValuesAvailable = true; - } - - SvtViewOptions aWinOpt3( E_WINDOW, SWPAGE_TOP_GVALUE ); - if ( aWinOpt3.Exists() ) - { - ::com::sun::star::uno::Sequence < ::com::sun::star::beans::NamedValue > aSeq = aWinOpt3.GetUserData(); - ::rtl::OUString aTmp; - if ( aSeq.getLength()) - aSeq[0].Value >>= aTmp; - OUString aWinData( aTmp ); - mnUserCustomPageTopMargin = aWinData.toInt32(); - bUserCustomValuesAvailable = true; - } - - SvtViewOptions aWinOpt4( E_WINDOW, SWPAGE_DOWN_GVALUE ); - if ( aWinOpt4.Exists() ) - { - ::com::sun::star::uno::Sequence < ::com::sun::star::beans::NamedValue > aSeq = aWinOpt4.GetUserData(); - ::rtl::OUString aTmp; - if ( aSeq.getLength()) - aSeq[0].Value >>= aTmp; - OUString aWinData( aTmp ); - mnUserCustomPageBottomMargin = aWinData.toInt32(); - bUserCustomValuesAvailable = true; - } - - SvtViewOptions aWinOpt5( E_WINDOW, SWPAGE_MIRROR_GVALUE ); - if ( aWinOpt5.Exists() ) - { - ::com::sun::star::uno::Sequence < ::com::sun::star::beans::NamedValue > aSeq = aWinOpt5.GetUserData(); - ::rtl::OUString aTmp; - if ( aSeq.getLength()) - aSeq[0].Value >>= aTmp; - OUString aWinData( aTmp ); - mbUserCustomMirrored = aWinData.toInt32() == 0 ? false : true; - bUserCustomValuesAvailable = true; - } - - return bUserCustomValuesAvailable; -} - -void PageMarginControl::StoreUserCustomValues() -{ - if ( !mbCustomValuesUsed ) - { - return; - } - - ::com::sun::star::uno::Sequence < ::com::sun::star::beans::NamedValue > aSeq(1); - SvtViewOptions aWinOpt( E_WINDOW, SWPAGE_LEFT_GVALUE ); - - aSeq[0].Name = "mnPageLeftMargin"; - aSeq[0].Value <<= ::rtl::OUString::number( mnPageLeftMargin ); - aWinOpt.SetUserData( aSeq ); - - SvtViewOptions aWinOpt2( E_WINDOW, SWPAGE_RIGHT_GVALUE ); - aSeq[0].Name = "mnPageRightMargin"; - aSeq[0].Value <<= ::rtl::OUString::number( mnPageRightMargin ); - aWinOpt2.SetUserData( aSeq ); - - SvtViewOptions aWinOpt3( E_WINDOW, SWPAGE_TOP_GVALUE ); - aSeq[0].Name = "mnPageTopMargin"; - aSeq[0].Value <<= ::rtl::OUString::number( mnPageTopMargin ); - aWinOpt3.SetUserData( aSeq ); - - SvtViewOptions aWinOpt4( E_WINDOW, SWPAGE_DOWN_GVALUE ); - aSeq[0].Name = "mnPageBottomMargin"; - aSeq[0].Value <<= ::rtl::OUString::number( mnPageBottomMargin ); - aWinOpt4.SetUserData( aSeq ); - - SvtViewOptions aWinOpt5( E_WINDOW, SWPAGE_MIRROR_GVALUE ); - aSeq[0].Name = "mbMirrored"; - aSeq[0].Value <<= ::rtl::OUString::number( (mbMirrored ? 1 : 0) ); - aWinOpt5.SetUserData( aSeq ); -} - -} } // end of namespace sw::sidebar - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/sidebar/PageMarginControl.hxx b/sw/source/ui/sidebar/PageMarginControl.hxx deleted file mode 100644 index f32e8846329c..000000000000 --- a/sw/source/ui/sidebar/PageMarginControl.hxx +++ /dev/null @@ -1,121 +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 INCLUDED_SW_SOURCE_UI_SIDEBAR_PAGEMARGINCONTROL_HXX -#define INCLUDED_SW_SOURCE_UI_SIDEBAR_PAGEMARGINCONTROL_HXX - -#include <svx/sidebar/PopupControl.hxx> - -#include <tools/fldunit.hxx> -#include <svl/poolitem.hxx> -#include <svx/rulritem.hxx> -#include <unotools/viewoptions.hxx> -#include <vcl/fixed.hxx> -#include <vcl/field.hxx> -#include <svtools/unitconv.hxx> -#include <vector> - -#define SWPAGE_NARROW_VALUE 720 -#define SWPAGE_NORMAL_VALUE 1136 -#define SWPAGE_WIDE_VALUE1 1440 -#define SWPAGE_WIDE_VALUE2 2880 -#define SWPAGE_WIDE_VALUE3 1800 - -namespace svx { namespace sidebar { - class ValueSetWithTextControl; -} } - -static const long MINBODY = 284; //0.5 cm in twips - -namespace sw { namespace sidebar { - -class PagePropertyPanel; - -class PageMarginControl - : public ::svx::sidebar::PopupControl -{ -public: - PageMarginControl( - Window* pParent, - PagePropertyPanel& rPanel, - const SvxLongLRSpaceItem& aPageLRMargin, - const SvxLongULSpaceItem& aPageULMargin, - const bool bMirrored, - const Size aPageSize, - const sal_Bool bLandscape, - const FieldUnit eFUnit, - const SfxMapUnit eUnit ); - ~PageMarginControl(void); - -private: - ::svx::sidebar::ValueSetWithTextControl* mpMarginValueSet; - - FixedText maCustom; - FixedText maLeft; - FixedText maInner; - MetricField maLeftMarginEdit; - FixedText maRight; - FixedText maOuter; - MetricField maRightMarginEdit; - FixedText maTop; - MetricField maTopMarginEdit; - FixedText maBottom; - MetricField maBottomMarginEdit; - - // hidden metric field - MetricField maWidthHeightField; - - long mnPageLeftMargin; - long mnPageRightMargin; - long mnPageTopMargin; - long mnPageBottomMargin; - bool mbMirrored; - - const SfxMapUnit meUnit; - - bool mbUserCustomValuesAvailable; - long mnUserCustomPageLeftMargin; - long mnUserCustomPageRightMargin; - long mnUserCustomPageTopMargin; - long mnUserCustomPageBottomMargin; - bool mbUserCustomMirrored; - - bool mbCustomValuesUsed; - - PagePropertyPanel& mrPagePropPanel; - - DECL_LINK( ImplMarginHdl, void* ); - DECL_LINK( ModifyLRMarginHdl, MetricField* ); - DECL_LINK( ModifyULMarginHdl, MetricField* ); - - void SetMetricFieldMaxValues( const Size aPageSize ); - - bool GetUserCustomValues(); - void StoreUserCustomValues(); - - void FillValueSet( - const bool bLandscape, - const bool bUserCustomValuesAvailable ); - void SelectValueSetItem(); -}; - -} } // end of namespace sw::sidebar - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/sidebar/PageOrientationControl.cxx b/sw/source/ui/sidebar/PageOrientationControl.cxx deleted file mode 100644 index 2dbf8bf8762a..000000000000 --- a/sw/source/ui/sidebar/PageOrientationControl.cxx +++ /dev/null @@ -1,90 +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 . - */ - -#include "PageOrientationControl.hxx" -#include "PagePropertyPanel.hxx" -#include "PagePropertyPanel.hrc" - -#include <swtypes.hxx> - -#include <svx/sidebar/ValueSetWithTextControl.hxx> -#include <vcl/settings.hxx> - -namespace sw { namespace sidebar { - -PageOrientationControl::PageOrientationControl( - Window* pParent, - PagePropertyPanel& rPanel, - const sal_Bool bLandscape ) - : ::svx::sidebar::PopupControl( pParent, SW_RES(RID_POPUP_SWPAGE_ORIENTATION) ) - , mpOrientationValueSet( new ::svx::sidebar::ValueSetWithTextControl( ::svx::sidebar::ValueSetWithTextControl::IMAGE_TEXT, this, SW_RES(VS_ORIENTATION) ) ) - , mbLandscape( bLandscape ) - , mrPagePropPanel(rPanel) -{ - mpOrientationValueSet->SetStyle( mpOrientationValueSet->GetStyle() | WB_3DLOOK | WB_NO_DIRECTSELECT ); - mpOrientationValueSet->SetColor(GetSettings().GetStyleSettings().GetMenuColor()); - - // initialize <ValueSetWithText> control - { - mpOrientationValueSet->AddItem(Image(SW_RES(IMG_PORTRAIT)), 0, - SW_RES(STR_PORTRAIT), 0); - mpOrientationValueSet->AddItem(Image(SW_RES(IMG_LANDSCAPE)), 0, - SW_RES(STR_LANDSCAPE), 0 ); - } - - Link aLink = LINK(this, PageOrientationControl,ImplOrientationHdl ); - mpOrientationValueSet->SetSelectHdl(aLink); - mpOrientationValueSet->SetNoSelection(); - mpOrientationValueSet->StartSelection(); - mpOrientationValueSet->Show(); - mpOrientationValueSet->SelectItem( (mbLandscape == sal_True) ? 2 : 1 ); - mpOrientationValueSet->GrabFocus(); - mpOrientationValueSet->Format(); - mpOrientationValueSet->StartSelection(); - - FreeResource(); -} - -PageOrientationControl::~PageOrientationControl(void) -{ - delete mpOrientationValueSet; -} - -IMPL_LINK(PageOrientationControl, ImplOrientationHdl, void *, pControl) -{ - mpOrientationValueSet->SetNoSelection(); - if ( pControl == mpOrientationValueSet ) - { - const sal_uInt32 iPos = mpOrientationValueSet->GetSelectItemId(); - const bool bChanged = ( ( iPos == 1 ) && mbLandscape ) || - ( ( iPos == 2 ) && !mbLandscape ); - if ( bChanged ) - { - mbLandscape = !mbLandscape; - mrPagePropPanel.ExecuteOrientationChange( mbLandscape ); - } - } - - mrPagePropPanel.ClosePageOrientationPopup(); - return 0; -} - -} } // end of namespace sw::sidebar - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/sidebar/PageOrientationControl.hxx b/sw/source/ui/sidebar/PageOrientationControl.hxx deleted file mode 100644 index a4cfe4249376..000000000000 --- a/sw/source/ui/sidebar/PageOrientationControl.hxx +++ /dev/null @@ -1,56 +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 INCLUDED_SW_SOURCE_UI_SIDEBAR_PAGEORIENTATIONCONTROL_HXX -#define INCLUDED_SW_SOURCE_UI_SIDEBAR_PAGEORIENTATIONCONTROL_HXX - -#include <svx/sidebar/PopupControl.hxx> - -namespace svx { namespace sidebar { - class ValueSetWithTextControl; -} } - -namespace sw { namespace sidebar { - -class PagePropertyPanel; - -class PageOrientationControl - : public ::svx::sidebar::PopupControl -{ -public: - PageOrientationControl( - Window* pParent, - PagePropertyPanel& rPanel, - const sal_Bool bLandscape ); - ~PageOrientationControl(void); - -private: - ::svx::sidebar::ValueSetWithTextControl* mpOrientationValueSet; - - sal_Bool mbLandscape; - - PagePropertyPanel& mrPagePropPanel; - - DECL_LINK(ImplOrientationHdl, void*); -}; - -} } // end of namespace sw::sidebar - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/sidebar/PagePropertyPanel.cxx b/sw/source/ui/sidebar/PagePropertyPanel.cxx deleted file mode 100644 index a5d02386cb52..000000000000 --- a/sw/source/ui/sidebar/PagePropertyPanel.cxx +++ /dev/null @@ -1,742 +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 . - */ - -#include <sal/config.h> - -#include <cstdlib> - -#include "PagePropertyPanel.hxx" -#include "PagePropertyPanel.hrc" - -#include "PropertyPanel.hrc" - -#include <svx/sidebar/PopupContainer.hxx> -#include "PageOrientationControl.hxx" -#include "PageMarginControl.hxx" -#include "PageSizeControl.hxx" -#include "PageColumnControl.hxx" - -#include <swtypes.hxx> -#include <cmdid.h> - -#include <svl/intitem.hxx> -#include <editeng/sizeitem.hxx> -#include <editeng/paperinf.hxx> -#include <svx/svxids.hrc> -#include <svx/dlgutil.hxx> -#include <svx/rulritem.hxx> - -#include <sfx2/sidebar/ControlFactory.hxx> -#include <sfx2/dispatch.hxx> -#include <sfx2/bindings.hxx> -#include <sfx2/viewsh.hxx> -#include <sfx2/objsh.hxx> - -#include <boost/bind.hpp> - -#include <com/sun/star/frame/XController.hpp> -#include <com/sun/star/frame/XModel.hpp> -#include <com/sun/star/document/XUndoManagerSupplier.hpp> - -const char UNO_ORIENTATION[] = ".uno:Orientation"; -const char UNO_MARGIN[] = ".uno:Margin"; -const char UNO_SIZE[] = ".uno:Size"; -const char UNO_COLUMN[] = ".uno:Column"; - -namespace { - const cssu::Reference< css::document::XUndoManager > getUndoManager( const cssu::Reference< css::frame::XFrame >& rxFrame ) - { - const cssu::Reference< css::frame::XController >& xController = rxFrame->getController(); - if ( xController.is() ) - { - const cssu::Reference< css::frame::XModel >& xModel = xController->getModel(); - if ( xModel.is() ) - { - const cssu::Reference< css::document::XUndoManagerSupplier > xSuppUndo( xModel, cssu::UNO_QUERY_THROW ); - if ( xSuppUndo.is() ) - { - const cssu::Reference< css::document::XUndoManager > xUndoManager( xSuppUndo->getUndoManager(), cssu::UNO_QUERY_THROW ); - return xUndoManager; - } - } - } - - return cssu::Reference< css::document::XUndoManager > (); - } -} - -namespace sw { namespace sidebar { - -PagePropertyPanel* PagePropertyPanel::Create ( - Window* pParent, - const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame>& rxFrame, - SfxBindings* pBindings) -{ - if (pParent == NULL) - throw ::com::sun::star::lang::IllegalArgumentException("no parent Window given to PagePropertyPanel::Create", NULL, 0); - if ( ! rxFrame.is()) - throw ::com::sun::star::lang::IllegalArgumentException("no XFrame given to PagePropertyPanel::Create", NULL, 1); - if (pBindings == NULL) - throw ::com::sun::star::lang::IllegalArgumentException("no SfxBindings given to PagePropertyPanel::Create", NULL, 2); - - return new PagePropertyPanel( - pParent, - rxFrame, - pBindings); -} - -PagePropertyPanel::PagePropertyPanel( - Window* pParent, - const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame>& rxFrame, - SfxBindings* pBindings) - : PanelLayout(pParent, "PagePropertyPanel", "modules/swriter/ui/sidebarpage.ui", rxFrame) - , mpBindings(pBindings) - - // image resources - , maImgSize (NULL) - , maImgSize_L (NULL) - , mImgPortrait (SW_RES(IMG_PAGE_PORTRAIT)) - , mImgLandscape (SW_RES(IMG_PAGE_LANDSCAPE)) - , mImgNarrow (SW_RES(IMG_PAGE_NARROW)) - , mImgNormal (SW_RES(IMG_PAGE_NORMAL)) - , mImgWide (SW_RES(IMG_PAGE_WIDE)) - , mImgMirrored (SW_RES(IMG_PAGE_MIRRORED)) - , mImgMarginCustom (SW_RES(IMG_PAGE_MARGIN_CUSTOM)) - , mImgNarrow_L (SW_RES(IMG_PAGE_NARROW_L)) - , mImgNormal_L (SW_RES(IMG_PAGE_NORMAL_L)) - , mImgWide_L (SW_RES(IMG_PAGE_WIDE_L)) - , mImgMirrored_L (SW_RES(IMG_PAGE_MIRRORED_L)) - , mImgMarginCustom_L (SW_RES(IMG_PAGE_MARGIN_CUSTOM_L)) - , mImgA3 (SW_RES(IMG_PAGE_A3)) - , mImgA4 (SW_RES(IMG_PAGE_A4)) - , mImgA5 (SW_RES(IMG_PAGE_A5)) - , mImgB4 (SW_RES(IMG_PAGE_B4)) - , mImgB5 (SW_RES(IMG_PAGE_B5)) - , mImgC5 (SW_RES(IMG_PAGE_C5)) - , mImgLetter (SW_RES(IMG_PAGE_LETTER)) - , mImgLegal (SW_RES(IMG_PAGE_LEGAL)) - , mImgSizeNone (SW_RES(IMG_PAGE_SIZE_NONE)) - , mImgA3_L (SW_RES(IMG_PAGE_A3_L)) - , mImgA4_L (SW_RES(IMG_PAGE_A4_L)) - , mImgA5_L (SW_RES(IMG_PAGE_A5_L)) - , mImgB4_L (SW_RES(IMG_PAGE_B4_L)) - , mImgB5_L (SW_RES(IMG_PAGE_B5_L)) - , mImgC5_L (SW_RES(IMG_PAGE_C5_L)) - , 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() - - , m_aSwPagePgULControl(SID_ATTR_PAGE_ULSPACE, *pBindings, *this) - , 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) - - , maOrientationPopup( this, - ::boost::bind( &PagePropertyPanel::CreatePageOrientationControl, this, _1 ), - OUString("Page orientation") ) - , maMarginPopup( this, - ::boost::bind( &PagePropertyPanel::CreatePageMarginControl, this, _1 ), - OUString("Page margins") ) - , maSizePopup( this, - ::boost::bind( &PagePropertyPanel::CreatePageSizeControl, this, _1 ), - OUString("Page size") ) - , maColumnPopup( this, - ::boost::bind( &PagePropertyPanel::CreatePageColumnControl, this, _1 ), - OUString("Page columns") ) - - , mxUndoManager( getUndoManager( rxFrame ) ) - - , mbInvalidateSIDAttrPageOnSIDAttrPageSizeNotify( false ) -{ - // visible controls - get(mpToolBoxOrientation, "selectorientation"); - get(mpToolBoxMargin, "selectmargin"); - get(mpToolBoxSize, "selectsize"); - get(mpToolBoxColumn, "selectcolumn"); - - Initialize(); - mbInvalidateSIDAttrPageOnSIDAttrPageSizeNotify = true; -} - -PagePropertyPanel::~PagePropertyPanel() -{ - delete[] maImgSize; - delete[] maImgSize_L; -} - -void PagePropertyPanel::Initialize() -{ - // popup for page orientation - const sal_uInt16 nIdOrientation = mpToolBoxOrientation->GetItemId(UNO_ORIENTATION); - Link aLink = LINK( this, PagePropertyPanel, ClickOrientationHdl ); - mpToolBoxOrientation->SetDropdownClickHdl( aLink ); - mpToolBoxOrientation->SetSelectHdl( aLink ); - mpToolBoxOrientation->SetItemImage( nIdOrientation, mImgPortrait); - mpToolBoxOrientation->SetItemBits( nIdOrientation, mpToolBoxOrientation->GetItemBits( nIdOrientation ) | TIB_DROPDOWNONLY ); - - // popup for page margins - const sal_uInt16 nIdMargin = mpToolBoxMargin->GetItemId(UNO_MARGIN); - aLink = LINK( this, PagePropertyPanel, ClickMarginHdl ); - mpToolBoxMargin->SetDropdownClickHdl( aLink ); - mpToolBoxMargin->SetSelectHdl( aLink ); - mpToolBoxMargin->SetItemImage(nIdMargin, mImgNormal); - mpToolBoxMargin->SetItemBits( nIdMargin, mpToolBoxMargin->GetItemBits( nIdMargin ) | TIB_DROPDOWNONLY ); - - // popup for page size - const sal_uInt16 nIdSize = mpToolBoxSize->GetItemId(UNO_SIZE); - aLink = LINK( this, PagePropertyPanel, ClickSizeHdl ); - mpToolBoxSize->SetDropdownClickHdl( aLink ); - mpToolBoxSize->SetSelectHdl( aLink ); - mpToolBoxSize->SetItemImage(nIdSize, mImgLetter); - mpToolBoxSize->SetItemBits( nIdSize, mpToolBoxSize->GetItemBits( nIdSize ) | TIB_DROPDOWNONLY ); - maImgSize = new Image[8]; - maImgSize[0] = mImgA3; - maImgSize[1] = mImgA4; - maImgSize[2] = mImgA5; - maImgSize[3] = mImgB4; - maImgSize[4] = mImgB5; - maImgSize[5] = mImgC5; - maImgSize[6] = mImgLetter; - maImgSize[7] = mImgLegal; - maImgSize_L = new Image[8]; - maImgSize_L[0] = mImgA3_L; - maImgSize_L[1] = mImgA4_L; - maImgSize_L[2] = mImgA5_L; - maImgSize_L[3] = mImgB4_L; - maImgSize_L[4] = mImgB5_L; - maImgSize_L[5] = mImgC5_L; - 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 ) | TIB_DROPDOWNONLY ); - - meFUnit = GetModuleFieldUnit(); - meUnit = m_aSwPagePgSizeControl.GetCoreMetric(); - - // 'pull' for page style's attribute values - mpBindings->Update( SID_ATTR_PAGE_LRSPACE ); - mpBindings->Update( SID_ATTR_PAGE_ULSPACE ); - mpBindings->Update( SID_ATTR_PAGE ); - mpBindings->Update( SID_ATTR_PAGE_SIZE ); -} - -::svx::sidebar::PopupControl* PagePropertyPanel::CreatePageOrientationControl( ::svx::sidebar::PopupContainer* pParent ) -{ - return new PageOrientationControl( pParent, *this , mpPageItem->IsLandscape() ); -} - -IMPL_LINK( PagePropertyPanel, ClickOrientationHdl, ToolBox*, pToolBox ) -{ - maOrientationPopup.Show( *pToolBox ); - - return 0L; -} - -void PagePropertyPanel::ExecuteOrientationChange( const sal_Bool bLandscape ) -{ - StartUndo(); - - { - // set new page orientation - mpPageItem->SetLandscape( bLandscape ); - - // swap the width and height of the page size - mpPageSizeItem->SetSize( Size( mpPageSizeItem->GetSize().Height(), mpPageSizeItem->GetSize().Width() ) ); - - // apply changed attributes - GetBindings()->GetDispatcher()->Execute( SID_ATTR_PAGE_SIZE, SFX_CALLMODE_RECORD, mpPageSizeItem.get(), mpPageItem.get(), 0L ); - } - - // check, if margin values still fit to the changed page size. - // if not, adjust margin values - { - const long nML = mpPageLRMarginItem->GetLeft(); - const long nMR = mpPageLRMarginItem->GetRight(); - const long nTmpPW = nML + nMR + MINBODY; - - const long nPW = mpPageSizeItem->GetSize().Width(); - - if ( nTmpPW > nPW ) - { - if ( nML <= nMR ) - { - ExecuteMarginLRChange( mpPageLRMarginItem->GetLeft(), nMR - (nTmpPW - nPW ) ); - } - else - { - ExecuteMarginLRChange( nML - (nTmpPW - nPW ), mpPageLRMarginItem->GetRight() ); - } - } - - const long nMT = mpPageULMarginItem->GetUpper(); - const long nMB = mpPageULMarginItem->GetLower(); - const long nTmpPH = nMT + nMB + MINBODY; - - const long nPH = mpPageSizeItem->GetSize().Height(); - - if ( nTmpPH > nPH ) - { - if ( nMT <= nMB ) - { - ExecuteMarginULChange( mpPageULMarginItem->GetUpper(), nMB - ( nTmpPH - nPH ) ); - } - else - { - ExecuteMarginULChange( nMT - ( nTmpPH - nPH ), mpPageULMarginItem->GetLower() ); - } - } - } - - EndUndo(); -} - -void PagePropertyPanel::ClosePageOrientationPopup() -{ - maOrientationPopup.Hide(); -} - -::svx::sidebar::PopupControl* PagePropertyPanel::CreatePageMarginControl( ::svx::sidebar::PopupContainer* pParent ) -{ - return new PageMarginControl( - pParent, - *this, - *mpPageLRMarginItem.get(), - *mpPageULMarginItem.get(), - mpPageItem->GetPageUsage() == SVX_PAGE_MIRROR, - mpPageSizeItem->GetSize(), - mpPageItem->IsLandscape(), - meFUnit, - meUnit ); -} - -void PagePropertyPanel::ExecuteMarginLRChange( - const long nPageLeftMargin, - const long nPageRightMargin ) -{ - mpPageLRMarginItem->SetLeft( nPageLeftMargin ); - mpPageLRMarginItem->SetRight( nPageRightMargin ); - GetBindings()->GetDispatcher()->Execute( SID_ATTR_PAGE_LRSPACE, SFX_CALLMODE_RECORD, mpPageLRMarginItem.get(), 0L ); -} - -void PagePropertyPanel::ExecuteMarginULChange( - const long nPageTopMargin, - const long nPageBottomMargin ) -{ - mpPageULMarginItem->SetUpper( nPageTopMargin ); - mpPageULMarginItem->SetLower( nPageBottomMargin ); - GetBindings()->GetDispatcher()->Execute( SID_ATTR_PAGE_ULSPACE, SFX_CALLMODE_RECORD, mpPageULMarginItem.get(), 0L ); -} - -void PagePropertyPanel::ExecutePageLayoutChange( const bool bMirrored ) -{ - mpPageItem->SetPageUsage( bMirrored ? SVX_PAGE_MIRROR : SVX_PAGE_ALL ); - GetBindings()->GetDispatcher()->Execute( SID_ATTR_PAGE, SFX_CALLMODE_RECORD, mpPageItem.get(), 0L ); -} - -IMPL_LINK( PagePropertyPanel, ClickMarginHdl, ToolBox*, pToolBox ) -{ - maMarginPopup.Show( *pToolBox ); - - return 0L; -} - -void PagePropertyPanel::ClosePageMarginPopup() -{ - maMarginPopup.Hide(); -} - -::svx::sidebar::PopupControl* PagePropertyPanel::CreatePageSizeControl( ::svx::sidebar::PopupContainer* pParent ) -{ - return new PageSizeControl( - pParent, - *this, - mePaper, - mpPageItem->IsLandscape(), - meFUnit ); -} - -void PagePropertyPanel::ExecuteSizeChange( const Paper ePaper ) -{ - Size aPageSize = SvxPaperInfo::GetPaperSize( ePaper, (MapUnit)(meUnit) ); - if ( mpPageItem->IsLandscape() ) - { - Swap( aPageSize ); - } - mpPageSizeItem->SetSize( aPageSize ); - - mpBindings->GetDispatcher()->Execute(SID_ATTR_PAGE_SIZE, SFX_CALLMODE_RECORD, mpPageSizeItem.get(), 0L ); -} - -IMPL_LINK( PagePropertyPanel, ClickSizeHdl, ToolBox*, pToolBox ) -{ - maSizePopup.Show( *pToolBox ); - - return 0L; -} - -void PagePropertyPanel::ClosePageSizePopup() -{ - maSizePopup.Hide(); -} - -::svx::sidebar::PopupControl* PagePropertyPanel::CreatePageColumnControl( ::svx::sidebar::PopupContainer* pParent ) -{ - return new PageColumnControl( - pParent, - *this, - mpPageColumnTypeItem->GetValue(), - mpPageItem->IsLandscape() ); -} - -void PagePropertyPanel::ExecuteColumnChange( const sal_uInt16 nColumnType ) -{ - mpPageColumnTypeItem->SetValue( nColumnType ); - mpBindings->GetDispatcher()->Execute(SID_ATTR_PAGE_COLUMN, SFX_CALLMODE_RECORD, mpPageColumnTypeItem.get(), 0L ); -} - -IMPL_LINK( PagePropertyPanel, ClickColumnHdl, ToolBox*, pToolBox ) -{ - maColumnPopup.Show( *pToolBox ); - - return 0L; -} - -void PagePropertyPanel::ClosePageColumnPopup() -{ - maColumnPopup.Hide(); -} - -void PagePropertyPanel::NotifyItemUpdate( - const sal_uInt16 nSId, - const SfxItemState eState, - const SfxPoolItem* pState, - const bool bIsEnabled) -{ - (void)bIsEnabled; - - switch( nSId ) - { - case SID_ATTR_PAGE_COLUMN: - { - if ( eState >= SFX_ITEM_AVAILABLE && - pState && pState->ISA(SfxInt16Item) ) - { - mpPageColumnTypeItem.reset( static_cast<SfxInt16Item*>(pState->Clone()) ); - ChangeColumnImage( mpPageColumnTypeItem->GetValue() ); - } - } - break; - case SID_ATTR_PAGE_LRSPACE: - if ( eState >= SFX_ITEM_AVAILABLE && - pState && pState->ISA(SvxLongLRSpaceItem) ) - { - mpPageLRMarginItem.reset( static_cast<SvxLongLRSpaceItem*>(pState->Clone()) ); - ChangeMarginImage(); - } - break; - - case SID_ATTR_PAGE_ULSPACE: - if ( eState >= SFX_ITEM_AVAILABLE && - pState && pState->ISA(SvxLongULSpaceItem) ) - { - mpPageULMarginItem.reset( static_cast<SvxLongULSpaceItem*>(pState->Clone()) ); - ChangeMarginImage(); - } - break; - - case SID_ATTR_PAGE: - if ( eState >= SFX_ITEM_AVAILABLE && - pState && pState->ISA(SvxPageItem) ) - { - const sal_uInt16 nIdOrientation = mpToolBoxOrientation->GetItemId(UNO_ORIENTATION); - mpPageItem.reset( static_cast<SvxPageItem*>(pState->Clone()) ); - if ( mpPageItem->IsLandscape() ) - { - mpToolBoxOrientation->SetItemImage(nIdOrientation, mImgLandscape); - } - else - { - mpToolBoxOrientation->SetItemImage(nIdOrientation, mImgPortrait); - } - ChangeMarginImage(); - ChangeSizeImage(); - ChangeColumnImage( mpPageColumnTypeItem->GetValue() ); - } - break; - - case SID_ATTR_PAGE_SIZE: - if ( mbInvalidateSIDAttrPageOnSIDAttrPageSizeNotify ) - { - mpBindings->Invalidate( SID_ATTR_PAGE, sal_True, sal_False ); - } - if ( eState >= SFX_ITEM_AVAILABLE && - pState && pState->ISA(SvxSizeItem) ) - { - mpPageSizeItem.reset( static_cast<SvxSizeItem*>(pState->Clone()) ); - ChangeSizeImage(); - } - break; - case SID_ATTR_METRIC: - MetricState( eState, pState ); - break; - } -} - -void PagePropertyPanel::MetricState( SfxItemState eState, const SfxPoolItem* pState ) -{ - meFUnit = FUNIT_NONE; - if ( pState && eState >= SFX_ITEM_DEFAULT ) - { - meFUnit = (FieldUnit)( (const SfxUInt16Item*)pState )->GetValue(); - } - else - { - SfxViewFrame* pFrame = SfxViewFrame::Current(); - SfxObjectShell* pSh = NULL; - if ( pFrame ) - pSh = pFrame->GetObjectShell(); - if ( pSh ) - { - SfxModule* pModule = pSh->GetModule(); - if ( pModule ) - { - const SfxPoolItem* pItem = pModule->GetItem( SID_ATTR_METRIC ); - if ( pItem ) - meFUnit = (FieldUnit)( (SfxUInt16Item*)pItem )->GetValue(); - } - else - { - DBG_ERRORFILE( "<PagePropertyPanel::MetricState(..)>: no module found" ); - } - } - } -} - -void PagePropertyPanel::ChangeMarginImage() -{ - if ( mpPageLRMarginItem.get() == 0 || - mpPageULMarginItem.get() == 0 || - mpPageItem.get() == 0 ) - { - return; - } - - const long cTolerance = 5; - const sal_uInt16 nIdMargin = mpToolBoxMargin->GetItemId(UNO_MARGIN); - - if( std::abs(mpPageLRMarginItem->GetLeft() - SWPAGE_NARROW_VALUE) <= cTolerance && - std::abs(mpPageLRMarginItem->GetRight() - SWPAGE_NARROW_VALUE) <= cTolerance && - std::abs(mpPageULMarginItem->GetUpper() - SWPAGE_NARROW_VALUE) <= cTolerance && - std::abs(mpPageULMarginItem->GetLower() - SWPAGE_NARROW_VALUE) <= cTolerance && - mpPageItem->GetPageUsage() != SVX_PAGE_MIRROR ) - mpToolBoxMargin->SetItemImage( nIdMargin, mpPageItem->IsLandscape() ? mImgNarrow_L : mImgNarrow ); - - else if( std::abs(mpPageLRMarginItem->GetLeft() - SWPAGE_NORMAL_VALUE) <= cTolerance && - std::abs(mpPageLRMarginItem->GetRight() - SWPAGE_NORMAL_VALUE) <= cTolerance && - std::abs(mpPageULMarginItem->GetUpper() - SWPAGE_NORMAL_VALUE) <= cTolerance && - std::abs(mpPageULMarginItem->GetLower() - SWPAGE_NORMAL_VALUE) <= cTolerance && - mpPageItem->GetPageUsage() != SVX_PAGE_MIRROR ) - mpToolBoxMargin->SetItemImage( nIdMargin, mpPageItem->IsLandscape() ? mImgNormal_L : mImgNormal ); - - else if( std::abs(mpPageLRMarginItem->GetLeft() - SWPAGE_WIDE_VALUE2) <= cTolerance && - std::abs(mpPageLRMarginItem->GetRight() - SWPAGE_WIDE_VALUE2) <= cTolerance && - std::abs(mpPageULMarginItem->GetUpper() - SWPAGE_WIDE_VALUE1) <= cTolerance && - std::abs(mpPageULMarginItem->GetLower() - SWPAGE_WIDE_VALUE1) <= cTolerance && - mpPageItem->GetPageUsage() != SVX_PAGE_MIRROR ) - mpToolBoxMargin->SetItemImage( nIdMargin, mpPageItem->IsLandscape() ? mImgWide_L : mImgWide ); - - else if( std::abs(mpPageLRMarginItem->GetLeft() - SWPAGE_WIDE_VALUE3) <= cTolerance && - std::abs(mpPageLRMarginItem->GetRight() - SWPAGE_WIDE_VALUE1) <= cTolerance && - std::abs(mpPageULMarginItem->GetUpper() - SWPAGE_WIDE_VALUE1) <= cTolerance && - std::abs(mpPageULMarginItem->GetLower() - SWPAGE_WIDE_VALUE1) <= cTolerance && - mpPageItem->GetPageUsage() == SVX_PAGE_MIRROR ) - mpToolBoxMargin->SetItemImage( nIdMargin, mpPageItem->IsLandscape() ? mImgMirrored_L : mImgMirrored ); - - else - mpToolBoxMargin->SetItemImage( nIdMargin, mpPageItem->IsLandscape() ? mImgMarginCustom_L : mImgMarginCustom ); -} - -void PagePropertyPanel::ChangeSizeImage() -{ - if ( mpPageSizeItem.get() == 0 || - mpPageItem.get() == 0 ) - { - return; - } - - Size aTmpPaperSize = mpPageSizeItem->GetSize(); - if ( mpPageItem->IsLandscape() ) - { - Swap( aTmpPaperSize ); // Swap(..) defined in editeng/paperinf.hxx - } - - mePaper = SvxPaperInfo::GetSvxPaper( aTmpPaperSize, static_cast<MapUnit>(meUnit), true ); - - sal_uInt16 nImageIdx = 0; - switch ( mePaper ) - { - case PAPER_A3: - nImageIdx = 1; - break; - case PAPER_A4: - nImageIdx = 2; - break; - case PAPER_A5: - nImageIdx = 3; - break; - case PAPER_B4_ISO: - nImageIdx = 4; - break; - case PAPER_B5_ISO: - nImageIdx = 5; - break; - case PAPER_ENV_C5: - nImageIdx = 6; - break; - case PAPER_LETTER: - nImageIdx = 7; - break; - case PAPER_LEGAL: - nImageIdx = 8; - break; - default: - nImageIdx = 0; - mePaper = PAPER_USER; - break; - } - - const sal_uInt16 nIdSize = mpToolBoxSize->GetItemId(UNO_SIZE); - - if ( nImageIdx == 0 ) - { - mpToolBoxSize->SetItemImage( nIdSize, - ( mpPageItem->IsLandscape() ? mImgSizeNone_L : mImgSizeNone ) ); - } - else - { - mpToolBoxSize->SetItemImage( nIdSize, - ( mpPageItem->IsLandscape() ? maImgSize_L[nImageIdx-1] : maImgSize[nImageIdx-1] ) ); - } -} - -void PagePropertyPanel::ChangeColumnImage( const sal_uInt16 nColumnType ) -{ - if ( mpPageItem.get() == 0 ) - { - 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() ) - { - mxUndoManager->enterUndoContext( OUString("") ); - } -} - -void PagePropertyPanel::EndUndo() -{ - if ( mxUndoManager.is() ) - { - mxUndoManager->leaveUndoContext(); - } -} - -} } // end of namespace ::sw::sidebar - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/sidebar/PagePropertyPanel.hrc b/sw/source/ui/sidebar/PagePropertyPanel.hrc deleted file mode 100644 index 0f827f0d84fe..000000000000 --- a/sw/source/ui/sidebar/PagePropertyPanel.hrc +++ /dev/null @@ -1,188 +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 . - */ - -#include <rcid.hrc> -#include "PropertyPanel.hrc" - -// global definitions -#define IMG_PAGE_PORTRAIT (RC_SIDEBAR_BEGIN + 0) -#define IMG_PAGE_LANDSCAPE (RC_SIDEBAR_BEGIN + 1) -#define IMG_PAGE_NARROW (RC_SIDEBAR_BEGIN + 2) -#define IMG_PAGE_NORMAL (RC_SIDEBAR_BEGIN + 3) -#define IMG_PAGE_WIDE (RC_SIDEBAR_BEGIN + 4) -#define IMG_PAGE_MIRRORED (RC_SIDEBAR_BEGIN + 5) -#define IMG_PAGE_MARGIN_CUSTOM (RC_SIDEBAR_BEGIN + 6) -#define IMG_PAGE_NARROW_L (RC_SIDEBAR_BEGIN + 7) -#define IMG_PAGE_NORMAL_L (RC_SIDEBAR_BEGIN + 8) -#define IMG_PAGE_WIDE_L (RC_SIDEBAR_BEGIN + 9) -#define IMG_PAGE_MIRRORED_L (RC_SIDEBAR_BEGIN + 10) -#define IMG_PAGE_MARGIN_CUSTOM_L (RC_SIDEBAR_BEGIN+ 11) -#define IMG_PAGE_A3 (RC_SIDEBAR_BEGIN + 12) -#define IMG_PAGE_A4 (RC_SIDEBAR_BEGIN + 13) -#define IMG_PAGE_A5 (RC_SIDEBAR_BEGIN + 14) -#define IMG_PAGE_B4 (RC_SIDEBAR_BEGIN + 15) -#define IMG_PAGE_B5 (RC_SIDEBAR_BEGIN + 16) -#define IMG_PAGE_C5 (RC_SIDEBAR_BEGIN + 17) -#define IMG_PAGE_LETTER (RC_SIDEBAR_BEGIN + 18) -#define IMG_PAGE_LEGAL (RC_SIDEBAR_BEGIN + 19) -#define IMG_PAGE_SIZE_NONE (RC_SIDEBAR_BEGIN + 20) -#define IMG_PAGE_A3_L (RC_SIDEBAR_BEGIN + 21) -#define IMG_PAGE_A4_L (RC_SIDEBAR_BEGIN + 22) -#define IMG_PAGE_A5_L (RC_SIDEBAR_BEGIN + 23) -#define IMG_PAGE_B4_L (RC_SIDEBAR_BEGIN + 24) -#define IMG_PAGE_B5_L (RC_SIDEBAR_BEGIN + 25) -#define IMG_PAGE_C5_L (RC_SIDEBAR_BEGIN + 26) -#define IMG_PAGE_LETTER_L (RC_SIDEBAR_BEGIN + 27) -#define IMG_PAGE_LEGAL_L (RC_SIDEBAR_BEGIN + 28) -#define IMG_PAGE_SIZE_NONE_L (RC_SIDEBAR_BEGIN + 29) -#define IMG_PAGE_COLUMN_1 (RC_SIDEBAR_BEGIN + 30) -#define IMG_PAGE_COLUMN_2 (RC_SIDEBAR_BEGIN + 31) -#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) -#define IMG_PAGE_COLUMN_LEFT_L (RC_SIDEBAR_BEGIN + 39) -#define IMG_PAGE_COLUMN_RIGHT_L (RC_SIDEBAR_BEGIN + 40) -#define IMG_PAGE_COLUMN_NONE_L (RC_SIDEBAR_BEGIN + 41) - -// local -#define IMG_PORTRAIT 10 -#define IMG_LANDSCAPE 11 -#define STR_PORTRAIT 12 -#define STR_LANDSCAPE 13 -#define ED_SWPAPER_WIDTH 14 -#define ED_SWPAPER_HEIGHT 15 -#define LB_SWPAPER_TRAY 16 -#define LB_SWPAPER_SIZE 17 -#define MF_SWLEFT_MARGIN 18 -#define MF_SWRIGHT_MARGIN 19 -#define MF_SWTOP_MARGIN 20 -#define MF_SWBOTTOM_MARGIN 21 -#define VS_SIZE 23 -#define STR_LCVALUE 24 -#define FT_CUSTOM 25 -#define FLD_WIDTH_HEIGHT 26 - -#define VS_ORIENTATION 29 -#define IMG_NARROW 32 -#define IMG_NORMAL 33 -#define IMG_WIDE 34 -#define IMG_MIRRORED 35 -#define STR_NARROW 36 -#define STR_NORMAL 37 -#define STR_WIDE 38 -#define STR_MIRRORED 39 -#define VS_MARGIN 40 -#define IMG_CUSTOM 41 -#define FT_LEFT 42 -#define FT_RIGHT 43 -#define FT_TOP 44 -#define FT_BOTTOM 45 -#define FT_INNER 46 -#define FT_OUTER 47 -#define VS_COLUMN 49 -#define MBOX_WIDTH 50 -#define IMG_ONE 51 -#define IMG_TWO 52 -#define IMG_THREE 53 -#define IMG_LEFT 54 -#define IMG_RIGHT 55 -#define STR_ONE 56 -#define STR_TWO 57 -#define STR_THREE 58 -#define STR_LEFT 59 -#define STR_RIGHT 60 -#define CB_COLUMN_MORE 61 - -#define CB_SIZE_MORE 61 - -#define IMG_ONE_L 90 -#define IMG_TWO_L 91 -#define IMG_THREE_L 92 -#define IMG_LEFT_L 93 -#define IMG_RIGHT_L 94 -#define IMG_NARROW_L 109 -#define IMG_NORMAL_L 110 -#define IMG_WIDE_L 111 -#define IMG_MIRRORED_L 112 -#define FLD_LEFT_MARGIN 113 -#define FLD_RIGHT_MARGIN 114 -#define FLD_TOP_MARGIN 115 -#define FLD_BOTTOM_MARGIN 116 - -#define IMG_CUSTOM_DIS 121 - -#define STR_MARGIN_TOOLTIP_LEFT 122 -#define STR_MARGIN_TOOLTIP_RIGHT 123 -#define STR_MARGIN_TOOLTIP_INNER 124 -#define STR_MARGIN_TOOLTIP_OUTER 125 -#define STR_MARGIN_TOOLTIP_TOP 126 -#define STR_MARGIN_TOOLTIP_BOT 127 - -#define POPUP_MARGIN 4 -#define VS_WIDTH 78 -#define ITEM_HEIGHT 17 -#define ITEM_HEIGHT2 15 - -//========================================Position============================================== - -#define FT_ORIENTATION_X SECTIONPAGE_MARGIN_HORIZONTAL -#define FT_ORIENTATION_Y SECTIONPAGE_MARGIN_VERTICAL_TOP -#define TBX_ORIENTATION_X FT_ORIENTATION_X -#define TBX_ORIENTATION_Y FT_ORIENTATION_Y + TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL -#define FT_MARGIN_X FT_ORIENTATION_X + MBOX_WIDTH + CONTROL_SPACING_HORIZONTAL -#define FT_MARGIN_Y FT_ORIENTATION_Y -#define TBX_MARGIN_X FT_MARGIN_X -#define TBX_MARGIN_Y TBX_ORIENTATION_Y -#define FT_SIZE_X FT_ORIENTATION_X -#define FT_SIZE_Y TBX_ORIENTATION_Y + 20 + CONTROL_SPACING_VERTICAL -#define TBX_SIZE_X FT_SIZE_X -#define TBX_SIZE_Y FT_SIZE_Y + TEXT_HEIGHT + TEXT_CONTROL_SPACING_VERTICAL -#define FT_COLUMN_X FT_MARGIN_X -#define FT_COLUMN_Y FT_SIZE_Y -#define TBX_COLUMN_X FT_COLUMN_X -#define TBX_COLUMN_Y TBX_SIZE_Y - -#define FT_CUSTOM_X POPUP_MARGIN + OFFSET_X -#define FT_CUSTOM_Y POPUPPANEL_MARGIN_SMALL * 2 + ITEM_HEIGHT * 5 - -#define POP_BORDER_X POPUP_MARGIN + OFFSET_X + 1 -#define POP_BORDER_Y POPUPPANEL_MARGIN_SMALL * 3 + ITEM_HEIGHT * 5 + TEXT_HEIGHT -#define BD_WIDTH VS_WIDTH - 6 -#define BD_HEIGHT MBOX_HEIGHT*4 + CONTROL_SPACING_VERTICAL*5 - -#define FT_X POP_BORDER_X + CONTROL_SPACING_HORIZONTAL -#define MF_X FT_X + 25 + CONTROL_SPACING_HORIZONTAL -#define LEFT_MF_Y POP_BORDER_Y + CONTROL_SPACING_VERTICAL -#define RIGHT_MF_Y LEFT_MF_Y + MBOX_HEIGHT + CONTROL_SPACING_VERTICAL -#define TOP_MF_Y RIGHT_MF_Y + MBOX_HEIGHT + CONTROL_SPACING_VERTICAL -#define BOTTOM_MF_Y TOP_MF_Y + MBOX_HEIGHT + CONTROL_SPACING_VERTICAL -#define FT_LEFT_Y LEFT_MF_Y + 1 -#define FT_RIGHT_Y RIGHT_MF_Y + 1 -#define FT_TOP_Y TOP_MF_Y + 1 -#define FT_BOTTOM_Y BOTTOM_MF_Y + 1 - -#define MARGIN_PANEL_HEIGHT POP_BORDER_Y + BD_HEIGHT + POPUP_MARGIN + OFFSET_Y -#define CUST_MORE_BUTTON_IMG_OFF_X POPUPPANEL_MARGIN_HORIZONTAL + OFFSET_X -#define PAGE_HEIGHT TBX_COLUMN_Y + 20 + SECTIONPAGE_MARGIN_VERTICAL_BOT - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/sidebar/PagePropertyPanel.hxx b/sw/source/ui/sidebar/PagePropertyPanel.hxx deleted file mode 100644 index d7b6e57153e0..000000000000 --- a/sw/source/ui/sidebar/PagePropertyPanel.hxx +++ /dev/null @@ -1,223 +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 INCLUDED_SW_SOURCE_UI_SIDEBAR_PAGEPROPERTYPANEL_HXX -#define INCLUDED_SW_SOURCE_UI_SIDEBAR_PAGEPROPERTYPANEL_HXX - -#include <com/sun/star/frame/XFrame.hpp> -#include <com/sun/star/document/XUndoManager.hpp> - -#include <svx/sidebar/Popup.hxx> -#include <svx/sidebar/PanelLayout.hxx> - -#include <sfx2/sidebar/ControllerItem.hxx> - -namespace svx { namespace sidebar { - class PopupControl; -} } - -#include <i18nutil/paper.hxx> - -#include <svx/pageitem.hxx> -#include <svx/rulritem.hxx> -#include <editeng/sizeitem.hxx> - -#include <vcl/ctrl.hxx> -#include <vcl/fixed.hxx> -#include <vcl/button.hxx> -#include <vcl/toolbox.hxx> -#include <vcl/lstbox.hxx> -#include <vcl/field.hxx> -#include <svl/intitem.hxx> - -#include <boost/scoped_ptr.hpp> - -namespace cssu = ::com::sun::star::uno; - -namespace sw { namespace sidebar { - - class PagePropertyPanel - : public PanelLayout, - public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface - { - public: - static PagePropertyPanel* Create( - Window* pParent, - const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame>& rxFrame, - SfxBindings* pBindings ); - - // interface of ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface - virtual void NotifyItemUpdate( - const sal_uInt16 nSId, - const SfxItemState eState, - const SfxPoolItem* pState, - const bool bIsEnabled); - - SfxBindings* GetBindings() const - { - return mpBindings; - } - - ::svx::sidebar::PopupControl* CreatePageOrientationControl( ::svx::sidebar::PopupContainer* pParent ); - void ExecuteOrientationChange( const sal_Bool bLandscape ); - void ClosePageOrientationPopup(); - - ::svx::sidebar::PopupControl* CreatePageMarginControl( ::svx::sidebar::PopupContainer* pParent ); - void ExecuteMarginLRChange( - const long nPageLeftMargin, - const long nPageRightMargin ); - void ExecuteMarginULChange( - const long nPageTopMargin, - const long nPageBottomMargin ); - void ExecutePageLayoutChange( const bool bMirrored ); - void ClosePageMarginPopup(); - - ::svx::sidebar::PopupControl* CreatePageSizeControl( ::svx::sidebar::PopupContainer* pParent ); - void ExecuteSizeChange( const Paper ePaper ); - void ClosePageSizePopup(); - - ::svx::sidebar::PopupControl* CreatePageColumnControl( ::svx::sidebar::PopupContainer* pParent ); - void ExecuteColumnChange( const sal_uInt16 nColumnType ); - void ClosePageColumnPopup(); - - void StartUndo(); - void EndUndo(); - - private: - PagePropertyPanel( - Window* pParent, - const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame>& rxFrame, - SfxBindings* pBindings ); - virtual ~PagePropertyPanel(void); - - SfxBindings* mpBindings; - - // toolboxes - on click open corresponding popup - ToolBox* mpToolBoxOrientation; - ToolBox* mpToolBoxMargin; - ToolBox* mpToolBoxSize; - ToolBox* mpToolBoxColumn; - - Image* maImgSize; - Image* maImgSize_L; - Image mImgPortrait; - Image mImgLandscape; - Image mImgNarrow; - Image mImgNormal; - Image mImgWide; - Image mImgMirrored; - Image mImgMarginCustom; - Image mImgNarrow_L; - Image mImgNormal_L; - Image mImgWide_L; - Image mImgMirrored_L; - Image mImgMarginCustom_L; - Image mImgA3; - Image mImgA4; - Image mImgA5; - Image mImgB4; - Image mImgB5; - Image mImgC5; - Image mImgLetter; - Image mImgLegal; - Image mImgSizeNone; - Image mImgA3_L; - Image mImgA4_L; - Image mImgA5_L; - Image mImgB4_L; - Image mImgB5_L; - Image mImgC5_L; - 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 - // - page usage - only left, only right, both, mirrored - // item also hold the numbering type for the page style which should - // be kept stable. - ::boost::scoped_ptr<SvxPageItem> mpPageItem; - - // item keeping the page style's left and right margins - ::boost::scoped_ptr<SvxLongLRSpaceItem> mpPageLRMarginItem; - // item keeping the page style's top and bottom margins - ::boost::scoped_ptr<SvxLongULSpaceItem> mpPageULMarginItem; - - // item keeping the page style's page size - ::boost::scoped_ptr<SvxSizeItem> mpPageSizeItem; - // Paper corresponding to the page style's page size - Paper mePaper; - - // item keeping the page column type - ::boost::scoped_ptr<SfxInt16Item> mpPageColumnTypeItem; - - FieldUnit meFUnit; - SfxMapUnit meUnit; - - // controller items - ::sfx2::sidebar::ControllerItem m_aSwPagePgULControl; - ::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 maOrientationPopup; - ::svx::sidebar::Popup maMarginPopup; - ::svx::sidebar::Popup maSizePopup; - ::svx::sidebar::Popup maColumnPopup; - - const cssu::Reference< css::document::XUndoManager > mxUndoManager; - - bool mbInvalidateSIDAttrPageOnSIDAttrPageSizeNotify; - - // handler for popup toolboxes to show the popups - DECL_LINK(ClickOrientationHdl, ToolBox* ); - DECL_LINK(ClickMarginHdl, ToolBox* ); - DECL_LINK(ClickSizeHdl, ToolBox* ); - DECL_LINK(ClickColumnHdl, ToolBox* ); - - void Initialize(); - - void MetricState( SfxItemState eState, const SfxPoolItem* pState ); - - // helper to adjust popup toolbox' images - void ChangeMarginImage(); - void ChangeSizeImage(); - void ChangeColumnImage( const sal_uInt16 nColumnType ); - - }; - -} } // end of namespace ::sw::sidebar - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/sidebar/PageSizeControl.cxx b/sw/source/ui/sidebar/PageSizeControl.cxx deleted file mode 100644 index 038e033235f2..000000000000 --- a/sw/source/ui/sidebar/PageSizeControl.cxx +++ /dev/null @@ -1,177 +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 . - */ - -#include "PageSizeControl.hxx" -#include "PagePropertyPanel.hxx" -#include "PagePropertyPanel.hrc" - -#include <cmdid.h> -#include <swtypes.hxx> - -#include <svx/sidebar/ValueSetWithTextControl.hxx> - -#include <rtl/character.hxx> -#include <editeng/paperinf.hxx> -#include <sfx2/bindings.hxx> -#include <sfx2/dispatch.hxx> - -#include <vcl/settings.hxx> - -namespace sw { namespace sidebar { - -PageSizeControl::PageSizeControl( - Window* pParent, - PagePropertyPanel& rPanel, - const Paper ePaper, - const sal_Bool bLandscape, - const FieldUnit eFUnit ) - : ::svx::sidebar::PopupControl( pParent, SW_RES(RID_POPUP_SWPAGE_SIZE) ) - , mpSizeValueSet( new ::svx::sidebar::ValueSetWithTextControl( ::svx::sidebar::ValueSetWithTextControl::TEXT_TEXT, this, SW_RES(VS_SIZE) ) ) - , maMoreButton( this, SW_RES(CB_SIZE_MORE) ) - , maWidthHeightField( this, SW_RES(FLD_WIDTH_HEIGHT) ) - , mePaper( ePaper ) - , maPaperList() - , mrPagePropPanel(rPanel) -{ - maWidthHeightField.Hide(); - SetFieldUnit( maWidthHeightField, eFUnit ); - - maPaperList.push_back( PAPER_A3 ); - maPaperList.push_back( PAPER_A4 ); - maPaperList.push_back( PAPER_A5 ); - maPaperList.push_back( PAPER_B4_ISO ); - maPaperList.push_back( PAPER_B5_ISO ); - maPaperList.push_back( PAPER_ENV_C5 ); - maPaperList.push_back( PAPER_LETTER ); - maPaperList.push_back( PAPER_LEGAL ); - - mpSizeValueSet->SetStyle( mpSizeValueSet->GetStyle() | WB_3DLOOK | WB_NO_DIRECTSELECT ); - mpSizeValueSet->SetColor( GetSettings().GetStyleSettings().GetMenuColor() ); - - sal_uInt16 nSelectedItem = 0; - { - OUString aMetricStr; - { - const OUString aText = maWidthHeightField.GetText(); - for (short i = aText.getLength() - 1; i >= 0; i--) - { - sal_Unicode c = aText[i]; - if ( rtl::isAsciiAlpha(c) || (c == '\'') || (c == '\"') || (c == '%') ) - { - aMetricStr = OUString(c) + aMetricStr; - } - else - { - if (!aMetricStr.isEmpty()) - { - break; - } - } - } - } - - const LocaleDataWrapper& localeDataWrapper = maWidthHeightField.GetLocaleDataWrapper(); - OUString aWidthStr; - OUString aHeightStr; - OUString aItemText2; - for ( ::std::vector< Paper >::size_type nPaperIdx = 0; - nPaperIdx < maPaperList.size(); - ++nPaperIdx ) - { - Size aPaperSize = SvxPaperInfo::GetPaperSize( maPaperList[ nPaperIdx ] ); - if ( bLandscape ) - { - Swap( aPaperSize ); - } - maWidthHeightField.SetValue( maWidthHeightField.Normalize( aPaperSize.Width() ), FUNIT_TWIP ); - aWidthStr = localeDataWrapper.getNum( - maWidthHeightField.GetValue(), - maWidthHeightField.GetDecimalDigits(), - maWidthHeightField.IsUseThousandSep(), - maWidthHeightField.IsShowTrailingZeros() ); - - maWidthHeightField.SetValue( maWidthHeightField.Normalize( aPaperSize.Height() ), FUNIT_TWIP); - aHeightStr = localeDataWrapper.getNum( - maWidthHeightField.GetValue(), - maWidthHeightField.GetDecimalDigits(), - maWidthHeightField.IsUseThousandSep(), - maWidthHeightField.IsShowTrailingZeros() ); - - aItemText2 = aWidthStr + " x " + aHeightStr + " " + aMetricStr; - - mpSizeValueSet->AddItem( - SvxPaperInfo::GetName( maPaperList[ nPaperIdx ] ), - aItemText2, - 0 ); - - if ( maPaperList[ nPaperIdx ] == mePaper ) - { - nSelectedItem = nPaperIdx + 1; - } - } - } - - mpSizeValueSet->SetNoSelection(); - mpSizeValueSet->SetSelectHdl( LINK(this, PageSizeControl,ImplSizeHdl ) ); - mpSizeValueSet->Show(); - - mpSizeValueSet->SelectItem( nSelectedItem ); - mpSizeValueSet->Format(); - mpSizeValueSet->StartSelection(); - - maMoreButton.SetClickHdl( LINK( this, PageSizeControl, MoreButtonClickHdl_Impl ) ); - maMoreButton.GrabFocus(); - - FreeResource(); -} - -PageSizeControl::~PageSizeControl(void) -{ - delete mpSizeValueSet; -} - -IMPL_LINK(PageSizeControl, ImplSizeHdl, void *, pControl) -{ - mpSizeValueSet->SetNoSelection(); - if ( pControl == mpSizeValueSet ) - { - const sal_uInt16 nSelectedPaper = mpSizeValueSet->GetSelectItemId(); - const Paper ePaper = maPaperList[nSelectedPaper - 1]; - if ( ePaper != mePaper ) - { - mePaper = ePaper; - mrPagePropPanel.ExecuteSizeChange( mePaper ); - } - } - - mrPagePropPanel.ClosePageSizePopup(); - return 0; -} - -IMPL_LINK(PageSizeControl, MoreButtonClickHdl_Impl, void *, EMPTYARG) -{ - mrPagePropPanel.GetBindings()->GetDispatcher()->Execute( FN_FORMAT_PAGE_SETTING_DLG, SFX_CALLMODE_ASYNCHRON ); - - mrPagePropPanel.ClosePageSizePopup(); - return 0; -} - -} } // end of namespace sw::sidebar - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/sidebar/PageSizeControl.hxx b/sw/source/ui/sidebar/PageSizeControl.hxx deleted file mode 100644 index e1f0313a3649..000000000000 --- a/sw/source/ui/sidebar/PageSizeControl.hxx +++ /dev/null @@ -1,71 +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 INCLUDED_SW_SOURCE_UI_SIDEBAR_PAGESIZECONTROL_HXX -#define INCLUDED_SW_SOURCE_UI_SIDEBAR_PAGESIZECONTROL_HXX - -#include <svx/sidebar/PopupControl.hxx> - -#include <i18nutil/paper.hxx> - -#include <vcl/button.hxx> -#include <vcl/field.hxx> -#include <svtools/unitconv.hxx> - -#include <vector> - -namespace svx { namespace sidebar { - class ValueSetWithTextControl; -} } - -namespace sw { namespace sidebar { - -class PagePropertyPanel; - -class PageSizeControl - : public ::svx::sidebar::PopupControl -{ -public: - PageSizeControl( - Window* pParent, - PagePropertyPanel& rPanel, - const Paper ePaper, - const sal_Bool bLandscape, - const FieldUnit eFUnit ); - ~PageSizeControl(void); - -private: - ::svx::sidebar::ValueSetWithTextControl* mpSizeValueSet; - PushButton maMoreButton; - // hidden metric field - MetricField maWidthHeightField; - - Paper mePaper; - ::std::vector< Paper > maPaperList; - - PagePropertyPanel& mrPagePropPanel; - - DECL_LINK(ImplSizeHdl, void*); - DECL_LINK(MoreButtonClickHdl_Impl, void*); -}; - -} } // end of namespace sw::sidebar - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/sidebar/PropertyPanel.hrc b/sw/source/ui/sidebar/PropertyPanel.hrc deleted file mode 100644 index b374ab3dc96b..000000000000 --- a/sw/source/ui/sidebar/PropertyPanel.hrc +++ /dev/null @@ -1,35 +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 _SW_PROPERTY_PANEL_HRC -#define _SW_PROPERTY_PANEL_HRC - -#include "rcid.hrc" - -#define RID_PROPERTYPANEL_SWOBJWRAP_PAGE (RC_PROPERTYPANEL_BEGIN + 1) -#define RID_PROPERTYPANEL_SWPAGE (RC_PROPERTYPANEL_BEGIN + 2) -#define RID_POPUP_SWPAGE_MARGIN (RC_PROPERTYPANEL_BEGIN + 3) -#define RID_POPUP_SWPAGE_ORIENTATION (RC_PROPERTYPANEL_BEGIN + 4) -#define RID_POPUP_SWPAGE_COLUMN (RC_PROPERTYPANEL_BEGIN + 5) -#define RID_POPUP_SWPAGE_SIZE (RC_PROPERTYPANEL_BEGIN + 6) - -#define PROPERTY_PANEL_END RID_POPUP_SWPAGE_SIZE - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/sidebar/SwPanelFactory.cxx b/sw/source/ui/sidebar/SwPanelFactory.cxx deleted file mode 100644 index 18220cdbdf80..000000000000 --- a/sw/source/ui/sidebar/SwPanelFactory.cxx +++ /dev/null @@ -1,148 +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 . - */ - -#include <com/sun/star/ui/XUIElementFactory.hpp> - -#include <PagePropertyPanel.hxx> -#include <WrapPropertyPanel.hxx> -#include <navipi.hxx> - -#include <sfx2/sidebar/SidebarPanelBase.hxx> -#include <sfx2/sfxbasecontroller.hxx> -#include <toolkit/helper/vclunohelper.hxx> -#include <vcl/window.hxx> -#include <rtl/ref.hxx> -#include <comphelper/namedvaluecollection.hxx> -#include <cppuhelper/compbase1.hxx> -#include <cppuhelper/basemutex.hxx> - -#include <boost/bind.hpp> -#include <boost/noncopyable.hpp> - -using namespace css; -using namespace css::uno; - -namespace { - -typedef ::cppu::WeakComponentImplHelper1 < - css::ui::XUIElementFactory - > PanelFactoryInterfaceBase; - -class SwPanelFactory - : private ::boost::noncopyable, - private ::cppu::BaseMutex, - public PanelFactoryInterfaceBase -{ -public: - SwPanelFactory(void); - virtual ~SwPanelFactory(void); - - // XUIElementFactory - cssu::Reference<css::ui::XUIElement> SAL_CALL createUIElement( - const ::rtl::OUString& rsResourceURL, - const ::cssu::Sequence<css::beans::PropertyValue>& rArguments) - throw( - css::container::NoSuchElementException, - css::lang::IllegalArgumentException, - cssu::RuntimeException, std::exception ); -}; - -SwPanelFactory::SwPanelFactory (void) - : PanelFactoryInterfaceBase(m_aMutex) -{ -} - -SwPanelFactory::~SwPanelFactory (void) -{ -} - -Reference<ui::XUIElement> SAL_CALL SwPanelFactory::createUIElement ( - const ::rtl::OUString& rsResourceURL, - const ::cssu::Sequence<css::beans::PropertyValue>& rArguments) - throw( - container::NoSuchElementException, - lang::IllegalArgumentException, - RuntimeException, std::exception) -{ - Reference<ui::XUIElement> xElement; - - const ::comphelper::NamedValueCollection aArguments (rArguments); - Reference<frame::XFrame> xFrame (aArguments.getOrDefault("Frame", Reference<frame::XFrame>())); - Reference<awt::XWindow> xParentWindow (aArguments.getOrDefault("ParentWindow", Reference<awt::XWindow>())); - const sal_uInt64 nBindingsValue (aArguments.getOrDefault("SfxBindings", sal_uInt64(0))); - SfxBindings* pBindings = reinterpret_cast<SfxBindings*>(nBindingsValue); - - ::Window* pParentWindow = VCLUnoHelper::GetWindow(xParentWindow); - if ( ! xParentWindow.is() || pParentWindow==NULL) - throw RuntimeException( - "PanelFactory::createUIElement called without ParentWindow", - NULL); - if ( ! xFrame.is()) - throw RuntimeException( - "PanelFactory::createUIElement called without Frame", - NULL); - if (pBindings == NULL) - throw RuntimeException( - "PanelFactory::createUIElement called without SfxBindings", - NULL); - -#define DoesResourceEndWith(s) rsResourceURL.endsWithAsciiL(s,strlen(s)) - if (DoesResourceEndWith("/PagePropertyPanel")) - { - sw::sidebar::PagePropertyPanel* pPanel = sw::sidebar::PagePropertyPanel::Create( pParentWindow, xFrame, pBindings ); - xElement = sfx2::sidebar::SidebarPanelBase::Create( - rsResourceURL, - xFrame, - pPanel, - ui::LayoutSize(-1,-1,-1)); - } - else if (DoesResourceEndWith("/WrapPropertyPanel")) - { - sw::sidebar::WrapPropertyPanel* pPanel = sw::sidebar::WrapPropertyPanel::Create( pParentWindow, xFrame, pBindings ); - xElement = sfx2::sidebar::SidebarPanelBase::Create( - rsResourceURL, - xFrame, - pPanel, - ui::LayoutSize(-1,-1,-1)); - } - else if (DoesResourceEndWith("/NavigatorPanel")) - { - Window* pPanel = new SwNavigationPI(pBindings, NULL, pParentWindow); - xElement = sfx2::sidebar::SidebarPanelBase::Create( - rsResourceURL, - xFrame, - pPanel, - ui::LayoutSize(0,-1,-1)); - } -#undef DoesResourceEndWith - - return xElement; -} - -} - -extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL -org_apache_openoffice_comp_sw_sidebar_SwPanelFactory_get_implementation( - css::uno::XComponentContext *, - css::uno::Sequence<css::uno::Any> const &) -{ - return cppu::acquire(new SwPanelFactory()); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/sidebar/WrapPropertyPanel.cxx b/sw/source/ui/sidebar/WrapPropertyPanel.cxx deleted file mode 100644 index 6d4e8526f6fc..000000000000 --- a/sw/source/ui/sidebar/WrapPropertyPanel.cxx +++ /dev/null @@ -1,243 +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 . - */ - -#include "WrapPropertyPanel.hxx" -#include "PropertyPanel.hrc" - -#include <cmdid.h> -#include <swtypes.hxx> - -#include <sfx2/bindings.hxx> -#include <sfx2/dispatch.hxx> -#include <sfx2/sidebar/ControlFactory.hxx> -#include <sfx2/imagemgr.hxx> -#include <svl/eitem.hxx> -#include <vcl/svapp.hxx> -#include <vcl/settings.hxx> - -#include "com/sun/star/lang/IllegalArgumentException.hpp" - -const char UNO_WRAPOFF[] = ".uno:WrapOff"; -const char UNO_WRAPLEFT[] = ".uno:WrapLeft"; -const char UNO_WRAPRIGHT[] = ".uno:WrapRight"; -const char UNO_WRAPON[] = ".uno:WrapOn"; -const char UNO_WRAPTHROUGH[] = ".uno:WrapThrough"; -const char UNO_WRAPIDEAL[] = ".uno:WrapIdeal"; - -namespace sw { namespace sidebar { - -WrapPropertyPanel* WrapPropertyPanel::Create ( - Window* pParent, - const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxFrame, - SfxBindings* pBindings) -{ - if (pParent == NULL) - throw ::com::sun::star::lang::IllegalArgumentException("no parent Window given to WrapPropertyPanel::Create", NULL, 0); - if ( ! rxFrame.is()) - throw ::com::sun::star::lang::IllegalArgumentException("no XFrame given to WrapPropertyPanel::Create", NULL, 1); - if (pBindings == NULL) - throw ::com::sun::star::lang::IllegalArgumentException("no SfxBindings given to WrapPropertyPanel::Create", NULL, 2); - - return new WrapPropertyPanel( - pParent, - rxFrame, - pBindings); -} - -WrapPropertyPanel::WrapPropertyPanel( - Window* pParent, - const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxFrame, - SfxBindings* pBindings ) - : PanelLayout(pParent, "WrapPropertyPanel", "modules/swriter/ui/sidebarwrap.ui", rxFrame) - , mxFrame( rxFrame ) - , mpBindings(pBindings) - // resources - , aWrapIL(6,2) - // controller items - , maSwNoWrapControl(FN_FRAME_NOWRAP, *pBindings, *this) - , maSwWrapLeftControl(FN_FRAME_WRAP, *pBindings, *this) - , maSwWrapRightControl(FN_FRAME_WRAP_RIGHT, *pBindings, *this) - , maSwWrapParallelControl(FN_FRAME_WRAP_LEFT, *pBindings, *this) - , maSwWrapThroughControl(FN_FRAME_WRAPTHRU, *pBindings, *this) - , maSwWrapIdealControl(FN_FRAME_WRAP_IDEAL, *pBindings, *this) -{ - get(mpRBNoWrap, "buttonnone"); - get(mpRBWrapLeft, "buttonbefore"); - get(mpRBWrapRight, "buttonafter"); - get(mpRBWrapParallel, "buttonparallel"); - get(mpRBWrapThrough, "buttonthrough"); - get(mpRBIdealWrap, "buttonoptimal"); - - Initialize(); -} - -WrapPropertyPanel::~WrapPropertyPanel() -{ -} - -void WrapPropertyPanel::Initialize() -{ - Link aLink = LINK(this, WrapPropertyPanel, WrapTypeHdl); - mpRBNoWrap->SetClickHdl(aLink); - mpRBWrapLeft->SetClickHdl(aLink); - mpRBWrapRight->SetClickHdl(aLink); - mpRBWrapParallel->SetClickHdl(aLink); - mpRBWrapThrough->SetClickHdl(aLink); - mpRBIdealWrap->SetClickHdl(aLink); - - aWrapIL.AddImage( UNO_WRAPOFF, - ::GetImage( mxFrame, UNO_WRAPOFF, false ) ); - aWrapIL.AddImage( UNO_WRAPLEFT, - ::GetImage( mxFrame, UNO_WRAPLEFT, false ) ); - aWrapIL.AddImage( UNO_WRAPRIGHT, - ::GetImage( mxFrame, UNO_WRAPRIGHT, false ) ); - aWrapIL.AddImage( UNO_WRAPON, - ::GetImage( mxFrame, UNO_WRAPON, false ) ); - aWrapIL.AddImage( UNO_WRAPTHROUGH, - ::GetImage( mxFrame, UNO_WRAPTHROUGH, false ) ); - aWrapIL.AddImage( UNO_WRAPIDEAL, - ::GetImage( mxFrame, UNO_WRAPIDEAL, false ) ); - - mpRBNoWrap->SetModeRadioImage( aWrapIL.GetImage(UNO_WRAPOFF) ); - if ( Application::GetSettings().GetLayoutRTL() ) - { - mpRBWrapLeft->SetModeRadioImage( aWrapIL.GetImage(UNO_WRAPRIGHT) ); - mpRBWrapRight->SetModeRadioImage( aWrapIL.GetImage(UNO_WRAPLEFT) ); - } - else - { - mpRBWrapLeft->SetModeRadioImage( aWrapIL.GetImage(UNO_WRAPLEFT) ); - mpRBWrapRight->SetModeRadioImage( aWrapIL.GetImage(UNO_WRAPRIGHT) ); - } - mpRBWrapParallel->SetModeRadioImage( aWrapIL.GetImage(UNO_WRAPON) ); - mpRBWrapThrough->SetModeRadioImage( aWrapIL.GetImage(UNO_WRAPTHROUGH) ); - mpRBIdealWrap->SetModeRadioImage( aWrapIL.GetImage(UNO_WRAPIDEAL) ); - - mpRBNoWrap->SetAccessibleName(mpRBNoWrap->GetQuickHelpText()); - mpRBWrapLeft->SetAccessibleName(mpRBWrapLeft->GetQuickHelpText()); - mpRBWrapRight->SetAccessibleName(mpRBWrapRight->GetQuickHelpText()); - mpRBWrapParallel->SetAccessibleName(mpRBWrapParallel->GetQuickHelpText()); - mpRBWrapThrough->SetAccessibleName(mpRBWrapThrough->GetQuickHelpText()); - mpRBIdealWrap->SetAccessibleName(mpRBIdealWrap->GetQuickHelpText()); - - mpBindings->Update( FN_FRAME_NOWRAP ); - mpBindings->Update( FN_FRAME_WRAP ); - mpBindings->Update( FN_FRAME_WRAP_RIGHT ); - mpBindings->Update( FN_FRAME_WRAP_LEFT ); - mpBindings->Update( FN_FRAME_WRAPTHRU ); - mpBindings->Update( FN_FRAME_WRAP_IDEAL ); -} - -IMPL_LINK(WrapPropertyPanel, WrapTypeHdl, void *, EMPTYARG) -{ - sal_uInt16 nSlot = 0; - if ( mpRBWrapLeft->IsChecked() ) - { - nSlot = FN_FRAME_WRAP_LEFT; - } - else if( mpRBWrapRight->IsChecked() ) - { - nSlot = FN_FRAME_WRAP_RIGHT; - } - else if ( mpRBWrapParallel->IsChecked() ) - { - nSlot = FN_FRAME_WRAP; - } - else if( mpRBWrapThrough->IsChecked() ) - { - nSlot = FN_FRAME_WRAPTHRU; - } - else if( mpRBIdealWrap->IsChecked() ) - { - nSlot = FN_FRAME_WRAP_IDEAL; - } - else - { - nSlot = FN_FRAME_NOWRAP; - } - SfxBoolItem bStateItem( nSlot, true ); - mpBindings->GetDispatcher()->Execute( nSlot, SFX_CALLMODE_RECORD, &bStateItem, 0L ); - - return 0; -} - -void WrapPropertyPanel::NotifyItemUpdate( - const sal_uInt16 nSId, - const SfxItemState eState, - const SfxPoolItem* pState, - const bool bIsEnabled) -{ - (void)bIsEnabled; - - if ( eState == SFX_ITEM_AVAILABLE && - pState->ISA(SfxBoolItem) ) - { - //Set Radio Button enable - mpRBNoWrap->Enable(true); - mpRBWrapLeft->Enable(true); - mpRBWrapRight->Enable(true); - mpRBWrapParallel->Enable(true); - mpRBWrapThrough->Enable(true); - mpRBIdealWrap->Enable(true); - - const SfxBoolItem* pBoolItem = static_cast< const SfxBoolItem* >( pState ); - switch( nSId ) - { - case FN_FRAME_WRAP_RIGHT: - mpRBWrapRight->Check( pBoolItem->GetValue() ); - break; - case FN_FRAME_WRAP_LEFT: - mpRBWrapLeft->Check( pBoolItem->GetValue() ); - break; - case FN_FRAME_WRAPTHRU: - mpRBWrapThrough->Check( pBoolItem->GetValue() ); - break; - case FN_FRAME_WRAP_IDEAL: - mpRBIdealWrap->Check( pBoolItem->GetValue() ); - break; - case FN_FRAME_WRAP: - mpRBWrapParallel->Check( pBoolItem->GetValue() ); - break; - case FN_FRAME_NOWRAP: - default: - mpRBNoWrap->Check( pBoolItem->GetValue() ); - break; - } - } - else - { - mpRBNoWrap->Enable(false); - mpRBWrapLeft->Enable(false); - mpRBWrapRight->Enable(false); - mpRBWrapParallel->Enable(false); - mpRBWrapThrough->Enable(false); - mpRBIdealWrap->Enable(false); - - mpRBNoWrap->Check( false ); - mpRBWrapLeft->Check( false ); - mpRBWrapRight->Check( false ); - mpRBWrapParallel->Check( false ); - mpRBWrapThrough->Check( false ); - mpRBIdealWrap->Check( false ); - } -} - -} } // end of namespace ::sw::sidebar - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/sidebar/WrapPropertyPanel.hxx b/sw/source/ui/sidebar/WrapPropertyPanel.hxx deleted file mode 100644 index c5e524c25a0f..000000000000 --- a/sw/source/ui/sidebar/WrapPropertyPanel.hxx +++ /dev/null @@ -1,88 +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 INCLUDED_SW_SOURCE_UI_SIDEBAR_WRAPPROPERTYPANEL_HXX -#define INCLUDED_SW_SOURCE_UI_SIDEBAR_WRAPPROPERTYPANEL_HXX - -#include <svx/sidebar/PanelLayout.hxx> -#include <vcl/button.hxx> -#include <vcl/image.hxx> - -#include <sfx2/sidebar/ControllerItem.hxx> -#include <com/sun/star/frame/XFrame.hpp> - -#include <boost/scoped_ptr.hpp> - -namespace sw { namespace sidebar { - - class WrapPropertyPanel - : public PanelLayout - , public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface - { - public: - static WrapPropertyPanel* Create( - Window* pParent, - const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame>& rxFrame, - SfxBindings* pBindings ); - - // interface of ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface - virtual void NotifyItemUpdate( - const sal_uInt16 nSId, - const SfxItemState eState, - const SfxPoolItem* pState, - const bool bIsEnabled); - - private: - WrapPropertyPanel( - Window* pParent, - const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxFrame, - SfxBindings* pBindings ); - - virtual ~WrapPropertyPanel(); - - ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame; - SfxBindings* mpBindings; - - RadioButton* mpRBNoWrap; - RadioButton* mpRBWrapLeft; - RadioButton* mpRBWrapRight; - RadioButton* mpRBWrapParallel; - RadioButton* mpRBWrapThrough; - RadioButton* mpRBIdealWrap; - - //Image resource. - ImageList aWrapIL; - - //Controler Items================================== - ::sfx2::sidebar::ControllerItem maSwNoWrapControl; - ::sfx2::sidebar::ControllerItem maSwWrapLeftControl; - ::sfx2::sidebar::ControllerItem maSwWrapRightControl; - ::sfx2::sidebar::ControllerItem maSwWrapParallelControl; - ::sfx2::sidebar::ControllerItem maSwWrapThroughControl; - ::sfx2::sidebar::ControllerItem maSwWrapIdealControl; - - void Initialize(); - - DECL_LINK(WrapTypeHdl, void*); - }; - -} } // end of namespace ::sw::sidebar - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |