You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ms...@apache.org on 2023/07/29 09:23:31 UTC

[openoffice] branch trunk updated: Maintenance cleanup

This is an automated email from the ASF dual-hosted git repository.

mseidel pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 344957f760 Maintenance cleanup
344957f760 is described below

commit 344957f76007126c8053525f8d780d21c982c6d4
Author: mseidel <ms...@apache.org>
AuthorDate: Sat Jul 29 11:23:01 2023 +0200

    Maintenance cleanup
---
 main/sw/source/ui/sidebar/PageColumnControl.cxx    |  125 +-
 main/sw/source/ui/sidebar/PageColumnControl.hxx    |   40 +-
 main/sw/source/ui/sidebar/PageMarginControl.cxx    |  881 +++++++-------
 main/sw/source/ui/sidebar/PageMarginControl.hxx    |  146 +--
 .../source/ui/sidebar/PageOrientationControl.cxx   |   97 +-
 .../source/ui/sidebar/PageOrientationControl.hxx   |   34 +-
 main/sw/source/ui/sidebar/PagePropertyPanel.cxx    | 1256 ++++++++++----------
 main/sw/source/ui/sidebar/PagePropertyPanel.hxx    |  368 +++---
 main/sw/source/ui/sidebar/PageSizeControl.cxx      |  259 ++--
 main/sw/source/ui/sidebar/PageSizeControl.hxx      |   48 +-
 main/sw/source/ui/sidebar/SwPanelFactory.cxx       |  140 +--
 main/sw/source/ui/sidebar/WrapPropertyPanel.cxx    |  402 +++----
 main/sw/source/ui/sidebar/WrapPropertyPanel.hxx    |  114 +-
 13 files changed, 1978 insertions(+), 1932 deletions(-)

diff --git a/main/sw/source/ui/sidebar/PageColumnControl.cxx b/main/sw/source/ui/sidebar/PageColumnControl.cxx
index 06d34f45f0..bad9fee18b 100644
--- a/main/sw/source/ui/sidebar/PageColumnControl.cxx
+++ b/main/sw/source/ui/sidebar/PageColumnControl.cxx
@@ -1,5 +1,5 @@
 /**************************************************************
- * 
+ *
  * 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
@@ -7,18 +7,20 @@
  * 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
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- * 
+ *
  *************************************************************/
 
+
+
 #include "precompiled_sw.hxx"
 
 #include "PageColumnControl.hxx"
@@ -35,81 +37,82 @@
 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)
+	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( SW_RES(IMG_ONE_L), 0, SW_RES(STR_ONE), 0 );
-        mpColumnValueSet->AddItem( SW_RES(IMG_TWO_L), 0, SW_RES(STR_TWO), 0 );
-        mpColumnValueSet->AddItem( SW_RES(IMG_THREE_L), 0, SW_RES(STR_THREE), 0 );
-        mpColumnValueSet->AddItem( SW_RES(IMG_LEFT_L), 0, SW_RES(STR_LEFT), 0 );
-        mpColumnValueSet->AddItem( SW_RES(IMG_RIGHT_L), 0, SW_RES(STR_RIGHT), 0 );
-    }
-    else
-    {
-        mpColumnValueSet->AddItem( SW_RES(IMG_ONE), 0, SW_RES(STR_ONE), 0 );
-        mpColumnValueSet->AddItem( SW_RES(IMG_TWO), 0, SW_RES(STR_TWO), 0 );
-        mpColumnValueSet->AddItem( SW_RES(IMG_THREE), 0, SW_RES(STR_THREE), 0 );
-        mpColumnValueSet->AddItem( SW_RES(IMG_LEFT), 0, SW_RES(STR_LEFT), 0 );
-        mpColumnValueSet->AddItem( 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();
+	mpColumnValueSet->SetStyle( mpColumnValueSet->GetStyle() | WB_3DLOOK | WB_NO_DIRECTSELECT );
+	mpColumnValueSet->SetColor(GetSettings().GetStyleSettings().GetMenuColor());
+
+	if ( bLandscape )
+	{
+		mpColumnValueSet->AddItem( SW_RES(IMG_ONE_L), 0, SW_RES(STR_ONE), 0 );
+		mpColumnValueSet->AddItem( SW_RES(IMG_TWO_L), 0, SW_RES(STR_TWO), 0 );
+		mpColumnValueSet->AddItem( SW_RES(IMG_THREE_L), 0, SW_RES(STR_THREE), 0 );
+		mpColumnValueSet->AddItem( SW_RES(IMG_LEFT_L), 0, SW_RES(STR_LEFT), 0 );
+		mpColumnValueSet->AddItem( SW_RES(IMG_RIGHT_L), 0, SW_RES(STR_RIGHT), 0 );
+	}
+	else
+	{
+		mpColumnValueSet->AddItem( SW_RES(IMG_ONE), 0, SW_RES(STR_ONE), 0 );
+		mpColumnValueSet->AddItem( SW_RES(IMG_TWO), 0, SW_RES(STR_TWO), 0 );
+		mpColumnValueSet->AddItem( SW_RES(IMG_THREE), 0, SW_RES(STR_THREE), 0 );
+		mpColumnValueSet->AddItem( SW_RES(IMG_LEFT), 0, SW_RES(STR_LEFT), 0 );
+		mpColumnValueSet->AddItem( 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;
+	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;
+	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.GetBindings()->GetDispatcher()->Execute( FN_FORMAT_PAGE_COLUMN_DLG, SFX_CALLMODE_ASYNCHRON );
 
-    mrPagePropPanel.ClosePageColumnPopup();
-    return 0;
+	mrPagePropPanel.ClosePageColumnPopup();
+	return 0;
 }
 
 
 } } // end of namespace sw::sidebar
 
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/sw/source/ui/sidebar/PageColumnControl.hxx b/main/sw/source/ui/sidebar/PageColumnControl.hxx
index aa0df8b946..78763dd3a3 100644
--- a/main/sw/source/ui/sidebar/PageColumnControl.hxx
+++ b/main/sw/source/ui/sidebar/PageColumnControl.hxx
@@ -1,5 +1,5 @@
 /**************************************************************
- * 
+ *
  * 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
@@ -7,18 +7,20 @@
  * 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
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- * 
+ *
  *************************************************************/
 
+
+
 #ifndef _SW_SIDEBAR_PAGE_COLUMN_CONTROL_HXX_
 #define _SW_SIDEBAR_PAGE_COLUMN_CONTROL_HXX_
 
@@ -30,7 +32,7 @@
 #include <vector>
 
 namespace svx { namespace sidebar {
-    class ValueSetWithTextControl;
+	class ValueSetWithTextControl;
 } }
 
 namespace sw { namespace sidebar {
@@ -39,29 +41,31 @@ class PagePropertyPanel;
 
 
 class PageColumnControl
-    : public ::svx::sidebar::PopupControl
+	: public ::svx::sidebar::PopupControl
 {
 public:
-    PageColumnControl(
-        Window* pParent,
-        PagePropertyPanel& rPanel,
-        const sal_uInt16 nColumnType,
-        const bool bLandscape );
+	PageColumnControl(
+		Window* pParent,
+		PagePropertyPanel& rPanel,
+		const sal_uInt16 nColumnType,
+		const bool bLandscape );
 
-    ~PageColumnControl(void);
+	~PageColumnControl(void);
 
 private:
-    ::svx::sidebar::ValueSetWithTextControl* mpColumnValueSet;
-    PushButton maMoreButton;
+	::svx::sidebar::ValueSetWithTextControl* mpColumnValueSet;
+	PushButton maMoreButton;
 
-    sal_uInt16 mnColumnType;
+	sal_uInt16 mnColumnType;
 
-    PagePropertyPanel& mrPagePropPanel;
+	PagePropertyPanel& mrPagePropPanel;
 
-    DECL_LINK(ImplColumnHdl, void*);
-    DECL_LINK(MoreButtonClickHdl_Impl, void*);
+	DECL_LINK(ImplColumnHdl, void*);
+	DECL_LINK(MoreButtonClickHdl_Impl, void*);
 };
 
 } } // end of namespace sw::sidebar
 
 #endif
+
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/sw/source/ui/sidebar/PageMarginControl.cxx b/main/sw/source/ui/sidebar/PageMarginControl.cxx
index 223ccf083c..53debf4446 100644
--- a/main/sw/source/ui/sidebar/PageMarginControl.cxx
+++ b/main/sw/source/ui/sidebar/PageMarginControl.cxx
@@ -1,5 +1,5 @@
 /**************************************************************
- * 
+ *
  * 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
@@ -7,18 +7,20 @@
  * 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
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- * 
+ *
  *************************************************************/
 
+
+
 #include "precompiled_sw.hxx"
 
 #include "PageMarginControl.hxx"
@@ -29,497 +31,498 @@
 
 #include <svx/sidebar/ValueSetWithTextControl.hxx>
 
-#define SWPAGE_LEFT_GVALUE      String("Sw_Page_Left", 12, RTL_TEXTENCODING_ASCII_US)
-#define SWPAGE_RIGHT_GVALUE     String("Sw_Page_Right", 13, RTL_TEXTENCODING_ASCII_US)
-#define SWPAGE_TOP_GVALUE       String("Sw_Page_Top", 11, RTL_TEXTENCODING_ASCII_US)
-#define SWPAGE_DOWN_GVALUE      String("Sw_Page_Down", 12, RTL_TEXTENCODING_ASCII_US)
-#define SWPAGE_MIRROR_GVALUE    String("Sw_Page_Mirrored", 16, RTL_TEXTENCODING_ASCII_US)
+#define SWPAGE_LEFT_GVALUE		String("Sw_Page_Left", 12, RTL_TEXTENCODING_ASCII_US)
+#define SWPAGE_RIGHT_GVALUE		String("Sw_Page_Right", 13, RTL_TEXTENCODING_ASCII_US)
+#define SWPAGE_TOP_GVALUE		String("Sw_Page_Top", 11, RTL_TEXTENCODING_ASCII_US)
+#define SWPAGE_DOWN_GVALUE		String("Sw_Page_Down", 12, RTL_TEXTENCODING_ASCII_US)
+#define SWPAGE_MIRROR_GVALUE	String("Sw_Page_Mirrored", 16, RTL_TEXTENCODING_ASCII_US)
 
 
 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)
+	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();
+	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;
+	delete mpMarginValueSet;
 
-    StoreUserCustomValues();
+	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 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 );
+	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);
+	// 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);
+	// Right
+	nMax = nPW - nML - MINBODY;
+	maRightMarginEdit.SetMax(maRightMarginEdit.Normalize(nMax), FUNIT_TWIP);
 
-    //Top
-    nMax = nPH - nMB - MINBODY;
-    maTopMarginEdit.SetMax(maTopMarginEdit.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);
+	// Bottom
+	nMax = nPH - nMT - MINBODY;
+	maBottomMarginEdit.SetMax(maTopMarginEdit.Normalize(nMax), FUNIT_TWIP);
 }
 
 
-void PageMarginControl::FillValueSet( 
-    const bool bLandscape,
-    const bool bUserCustomValuesAvailable )
+void PageMarginControl::FillValueSet(
+	const bool bLandscape,
+	const bool bUserCustomValuesAvailable )
 {
-    const XubString aLeft = SW_RES(STR_MARGIN_TOOLTIP_LEFT);
-    const XubString aRight = SW_RES(STR_MARGIN_TOOLTIP_RIGHT);
-    const XubString aTop = SW_RES(STR_MARGIN_TOOLTIP_TOP);
-    const XubString aBottom = SW_RES(STR_MARGIN_TOOLTIP_BOT);
-
-    SetMetricValue( maWidthHeightField, SWPAGE_NARROW_VALUE, meUnit );
-    const XubString aNarrowValText = maWidthHeightField.GetText();
-    XubString aHelpText = aLeft;
-    aHelpText += aNarrowValText;
-    aHelpText += aRight;
-    aHelpText += aNarrowValText;
-    aHelpText += aTop;
-    aHelpText += aNarrowValText;
-    aHelpText += aBottom;
-    aHelpText += aNarrowValText;
-    mpMarginValueSet->AddItem(
-        (bLandscape ? SW_RES(IMG_NARROW_L) : SW_RES(IMG_NARROW) ), 0,
-        SW_RES(STR_NARROW), &aHelpText );
-
-    SetMetricValue( maWidthHeightField, SWPAGE_NORMAL_VALUE, meUnit );
-    const XubString aNormalValText = maWidthHeightField.GetText();
-    aHelpText = aLeft;
-    aHelpText += aNormalValText;
-    aHelpText += aRight;
-    aHelpText += aNormalValText;
-    aHelpText += aTop;
-    aHelpText += aNormalValText;
-    aHelpText += aBottom;
-    aHelpText += aNormalValText;
-    mpMarginValueSet->AddItem(
-        (bLandscape ? SW_RES(IMG_NORMAL_L) : SW_RES(IMG_NORMAL) ), 0,
-        SW_RES(STR_NORMAL), &aHelpText );
-
-    SetMetricValue( maWidthHeightField, SWPAGE_WIDE_VALUE1, meUnit );
-    const XubString aWide1ValText = maWidthHeightField.GetText();
-    SetMetricValue( maWidthHeightField, SWPAGE_WIDE_VALUE2, meUnit );
-    const XubString aWide2ValText = maWidthHeightField.GetText();
-    aHelpText = aLeft;
-    aHelpText += aWide2ValText;
-    aHelpText += aRight;
-    aHelpText += aWide2ValText;
-    aHelpText += aTop;
-    aHelpText += aWide1ValText;
-    aHelpText += aBottom;
-    aHelpText += aWide1ValText;
-    mpMarginValueSet->AddItem(
-        (bLandscape ? SW_RES(IMG_WIDE_L) : SW_RES(IMG_WIDE) ), 0,
-        SW_RES(STR_WIDE), &aHelpText );
-
-    const XubString aInner = SW_RES(STR_MARGIN_TOOLTIP_INNER);
-    const XubString aOuter = SW_RES(STR_MARGIN_TOOLTIP_OUTER);
-
-    SetMetricValue( maWidthHeightField, SWPAGE_WIDE_VALUE3, meUnit );
-    const XubString aWide3ValText = maWidthHeightField.GetText();
-    aHelpText = aInner;
-    aHelpText += aWide3ValText;
-    aHelpText += aOuter;
-    aHelpText += aWide3ValText;
-    aHelpText += aTop;
-    aHelpText += aWide1ValText;
-    aHelpText += aBottom;
-    aHelpText += aWide1ValText;
-    mpMarginValueSet->AddItem( 
-        (bLandscape ? SW_RES(IMG_MIRRORED_L) : SW_RES(IMG_MIRRORED) ), 0,
-        SW_RES(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 = XubString();
-    }
-    mpMarginValueSet->AddItem(
-        (bUserCustomValuesAvailable ? SW_RES(IMG_CUSTOM) : SW_RES(IMG_CUSTOM_DIS) ), 0,
-        SW_RES(STR_LCVALUE), &aHelpText );
+	const XubString aLeft = SW_RES(STR_MARGIN_TOOLTIP_LEFT);
+	const XubString aRight = SW_RES(STR_MARGIN_TOOLTIP_RIGHT);
+	const XubString aTop = SW_RES(STR_MARGIN_TOOLTIP_TOP);
+	const XubString aBottom = SW_RES(STR_MARGIN_TOOLTIP_BOT);
+
+	SetMetricValue( maWidthHeightField, SWPAGE_NARROW_VALUE, meUnit );
+	const XubString aNarrowValText = maWidthHeightField.GetText();
+	XubString aHelpText = aLeft;
+	aHelpText += aNarrowValText;
+	aHelpText += aRight;
+	aHelpText += aNarrowValText;
+	aHelpText += aTop;
+	aHelpText += aNarrowValText;
+	aHelpText += aBottom;
+	aHelpText += aNarrowValText;
+	mpMarginValueSet->AddItem(
+		(bLandscape ? SW_RES(IMG_NARROW_L) : SW_RES(IMG_NARROW) ), 0,
+		SW_RES(STR_NARROW), &aHelpText );
+
+	SetMetricValue( maWidthHeightField, SWPAGE_NORMAL_VALUE, meUnit );
+	const XubString aNormalValText = maWidthHeightField.GetText();
+	aHelpText = aLeft;
+	aHelpText += aNormalValText;
+	aHelpText += aRight;
+	aHelpText += aNormalValText;
+	aHelpText += aTop;
+	aHelpText += aNormalValText;
+	aHelpText += aBottom;
+	aHelpText += aNormalValText;
+	mpMarginValueSet->AddItem(
+		(bLandscape ? SW_RES(IMG_NORMAL_L) : SW_RES(IMG_NORMAL) ), 0,
+		SW_RES(STR_NORMAL), &aHelpText );
+
+	SetMetricValue( maWidthHeightField, SWPAGE_WIDE_VALUE1, meUnit );
+	const XubString aWide1ValText = maWidthHeightField.GetText();
+	SetMetricValue( maWidthHeightField, SWPAGE_WIDE_VALUE2, meUnit );
+	const XubString aWide2ValText = maWidthHeightField.GetText();
+	aHelpText = aLeft;
+	aHelpText += aWide2ValText;
+	aHelpText += aRight;
+	aHelpText += aWide2ValText;
+	aHelpText += aTop;
+	aHelpText += aWide1ValText;
+	aHelpText += aBottom;
+	aHelpText += aWide1ValText;
+	mpMarginValueSet->AddItem(
+		(bLandscape ? SW_RES(IMG_WIDE_L) : SW_RES(IMG_WIDE) ), 0,
+		SW_RES(STR_WIDE), &aHelpText );
+
+	const XubString aInner = SW_RES(STR_MARGIN_TOOLTIP_INNER);
+	const XubString aOuter = SW_RES(STR_MARGIN_TOOLTIP_OUTER);
+
+	SetMetricValue( maWidthHeightField, SWPAGE_WIDE_VALUE3, meUnit );
+	const XubString aWide3ValText = maWidthHeightField.GetText();
+	aHelpText = aInner;
+	aHelpText += aWide3ValText;
+	aHelpText += aOuter;
+	aHelpText += aWide3ValText;
+	aHelpText += aTop;
+	aHelpText += aWide1ValText;
+	aHelpText += aBottom;
+	aHelpText += aWide1ValText;
+	mpMarginValueSet->AddItem(
+		(bLandscape ? SW_RES(IMG_MIRRORED_L) : SW_RES(IMG_MIRRORED) ), 0,
+		SW_RES(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 = XubString();
+	}
+	mpMarginValueSet->AddItem(
+		(bUserCustomValuesAvailable ? SW_RES(IMG_CUSTOM) : SW_RES(IMG_CUSTOM_DIS) ), 0,
+		SW_RES(STR_LCVALUE), &aHelpText );
 }
 
 
 void PageMarginControl::SelectValueSetItem()
 {
-    const long cTolerance = 5;
-
-    if( abs(mnPageLeftMargin - SWPAGE_NARROW_VALUE) <= cTolerance &&
-        abs(mnPageRightMargin - SWPAGE_NARROW_VALUE) <= cTolerance &&
-        abs(mnPageTopMargin - SWPAGE_NARROW_VALUE) <= cTolerance &&
-        abs(mnPageBottomMargin - SWPAGE_NARROW_VALUE) <= cTolerance &&
-        !mbMirrored )
-    {
-        mpMarginValueSet->SelectItem(1);
-    }
-    else if( abs(mnPageLeftMargin - SWPAGE_NORMAL_VALUE) <= cTolerance &&
-        abs(mnPageRightMargin - SWPAGE_NORMAL_VALUE) <= cTolerance &&
-        abs(mnPageTopMargin - SWPAGE_NORMAL_VALUE) <= cTolerance &&		
-        abs(mnPageBottomMargin - SWPAGE_NORMAL_VALUE) <= cTolerance &&
-        !mbMirrored )
-    {
-        mpMarginValueSet->SelectItem(2);
-    }
-    else if( abs(mnPageLeftMargin - SWPAGE_WIDE_VALUE2) <= cTolerance &&
-        abs(mnPageRightMargin - SWPAGE_WIDE_VALUE2) <= cTolerance &&
-        abs(mnPageTopMargin - SWPAGE_WIDE_VALUE1) <= cTolerance &&		
-        abs(mnPageBottomMargin - SWPAGE_WIDE_VALUE1) <= cTolerance &&
-        !mbMirrored )
-    {
-        mpMarginValueSet->SelectItem(3);
-    }
-    else if( abs(mnPageLeftMargin - SWPAGE_WIDE_VALUE3) <= cTolerance &&
-        abs(mnPageRightMargin - SWPAGE_WIDE_VALUE1) <= cTolerance &&
-        abs(mnPageTopMargin - SWPAGE_WIDE_VALUE1) <= cTolerance &&
-        abs(mnPageBottomMargin - SWPAGE_WIDE_VALUE1) <= cTolerance &&
-        mbMirrored )
-    {
-        mpMarginValueSet->SelectItem(4);
-    }
-    else 
-    {
-        mpMarginValueSet->SelectItem(0);
-    }
-
-    mpMarginValueSet->Format();
-    mpMarginValueSet->StartSelection();
+	const long cTolerance = 5;
+
+	if( abs(mnPageLeftMargin - SWPAGE_NARROW_VALUE) <= cTolerance &&
+		abs(mnPageRightMargin - SWPAGE_NARROW_VALUE) <= cTolerance &&
+		abs(mnPageTopMargin - SWPAGE_NARROW_VALUE) <= cTolerance &&
+		abs(mnPageBottomMargin - SWPAGE_NARROW_VALUE) <= cTolerance &&
+		!mbMirrored )
+	{
+		mpMarginValueSet->SelectItem(1);
+	}
+	else if( abs(mnPageLeftMargin - SWPAGE_NORMAL_VALUE) <= cTolerance &&
+		abs(mnPageRightMargin - SWPAGE_NORMAL_VALUE) <= cTolerance &&
+		abs(mnPageTopMargin - SWPAGE_NORMAL_VALUE) <= cTolerance &&
+		abs(mnPageBottomMargin - SWPAGE_NORMAL_VALUE) <= cTolerance &&
+		!mbMirrored )
+	{
+		mpMarginValueSet->SelectItem(2);
+	}
+	else if( abs(mnPageLeftMargin - SWPAGE_WIDE_VALUE2) <= cTolerance &&
+		abs(mnPageRightMargin - SWPAGE_WIDE_VALUE2) <= cTolerance &&
+		abs(mnPageTopMargin - SWPAGE_WIDE_VALUE1) <= cTolerance &&
+		abs(mnPageBottomMargin - SWPAGE_WIDE_VALUE1) <= cTolerance &&
+		!mbMirrored )
+	{
+		mpMarginValueSet->SelectItem(3);
+	}
+	else if( abs(mnPageLeftMargin - SWPAGE_WIDE_VALUE3) <= cTolerance &&
+		abs(mnPageRightMargin - SWPAGE_WIDE_VALUE1) <= cTolerance &&
+		abs(mnPageTopMargin - SWPAGE_WIDE_VALUE1) <= cTolerance &&
+		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;
+	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;
+	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;
+	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;
-        String 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;
-        String 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;
-        String 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;
-        String 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;
-        String aWinData( aTmp );
-        mbUserCustomMirrored = aWinData.ToInt32() == 0 ? false : true;
-        bUserCustomValuesAvailable = true;
-    }
-
-    return bUserCustomValuesAvailable;
+	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;
+		String 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;
+		String 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;
+		String 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;
+		String 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;
+		String 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 = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("mnPageLeftMargin") );
-    aSeq[0].Value <<= ::rtl::OUString( String::CreateFromInt64( mnPageLeftMargin ));
-    aWinOpt.SetUserData( aSeq );
-
-    SvtViewOptions aWinOpt2( E_WINDOW, SWPAGE_RIGHT_GVALUE );
-    aSeq[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("mnPageRightMargin") );
-    aSeq[0].Value <<= ::rtl::OUString( String::CreateFromInt64( mnPageRightMargin ));
-    aWinOpt2.SetUserData( aSeq );
-
-    SvtViewOptions aWinOpt3( E_WINDOW, SWPAGE_TOP_GVALUE );
-    aSeq[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("mnPageTopMargin") );
-    aSeq[0].Value <<= ::rtl::OUString( String::CreateFromInt64( mnPageTopMargin ));
-    aWinOpt3.SetUserData( aSeq );
-
-    SvtViewOptions aWinOpt4( E_WINDOW, SWPAGE_DOWN_GVALUE );
-    aSeq[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("mnPageBottomMargin") );
-    aSeq[0].Value <<= ::rtl::OUString( String::CreateFromInt64( mnPageBottomMargin ));
-    aWinOpt4.SetUserData( aSeq );
-
-    SvtViewOptions aWinOpt5( E_WINDOW, SWPAGE_MIRROR_GVALUE );
-    aSeq[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("mbMirrored") );
-    aSeq[0].Value <<= ::rtl::OUString( String::CreateFromInt64( (mbMirrored ? 1 : 0) ));
-    aWinOpt5.SetUserData( aSeq );
+	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 = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("mnPageLeftMargin") );
+	aSeq[0].Value <<= ::rtl::OUString( String::CreateFromInt64( mnPageLeftMargin ));
+	aWinOpt.SetUserData( aSeq );
+
+	SvtViewOptions aWinOpt2( E_WINDOW, SWPAGE_RIGHT_GVALUE );
+	aSeq[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("mnPageRightMargin") );
+	aSeq[0].Value <<= ::rtl::OUString( String::CreateFromInt64( mnPageRightMargin ));
+	aWinOpt2.SetUserData( aSeq );
+
+	SvtViewOptions aWinOpt3( E_WINDOW, SWPAGE_TOP_GVALUE );
+	aSeq[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("mnPageTopMargin") );
+	aSeq[0].Value <<= ::rtl::OUString( String::CreateFromInt64( mnPageTopMargin ));
+	aWinOpt3.SetUserData( aSeq );
+
+	SvtViewOptions aWinOpt4( E_WINDOW, SWPAGE_DOWN_GVALUE );
+	aSeq[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("mnPageBottomMargin") );
+	aSeq[0].Value <<= ::rtl::OUString( String::CreateFromInt64( mnPageBottomMargin ));
+	aWinOpt4.SetUserData( aSeq );
+
+	SvtViewOptions aWinOpt5( E_WINDOW, SWPAGE_MIRROR_GVALUE );
+	aSeq[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("mbMirrored") );
+	aSeq[0].Value <<= ::rtl::OUString( String::CreateFromInt64( (mbMirrored ? 1 : 0) ));
+	aWinOpt5.SetUserData( aSeq );
 }
 
 
 } } // end of namespace sw::sidebar
 
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/sw/source/ui/sidebar/PageMarginControl.hxx b/main/sw/source/ui/sidebar/PageMarginControl.hxx
index 915e532ab5..8b6d7354f9 100644
--- a/main/sw/source/ui/sidebar/PageMarginControl.hxx
+++ b/main/sw/source/ui/sidebar/PageMarginControl.hxx
@@ -1,5 +1,5 @@
 /**************************************************************
- * 
+ *
  * 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
@@ -7,18 +7,20 @@
  * 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
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- * 
+ *
  *************************************************************/
 
+
+
 #ifndef _SW_SIDEBAR_PAGE_MARGIN_CONTROL_HXX_
 #define _SW_SIDEBAR_PAGE_MARGIN_CONTROL_HXX_
 
@@ -33,15 +35,15 @@
 #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
+#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;
+	class ValueSetWithTextControl;
 } }
 
 static const long MINBODY = 284; //0.5 cm in twips
@@ -52,73 +54,75 @@ class PagePropertyPanel;
 
 
 class PageMarginControl
-    : public ::svx::sidebar::PopupControl
+	: 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);
+	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();
+	::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 noet sw=4 ts=4: */
diff --git a/main/sw/source/ui/sidebar/PageOrientationControl.cxx b/main/sw/source/ui/sidebar/PageOrientationControl.cxx
index 192c30b363..3e6bfed9d5 100644
--- a/main/sw/source/ui/sidebar/PageOrientationControl.cxx
+++ b/main/sw/source/ui/sidebar/PageOrientationControl.cxx
@@ -1,5 +1,5 @@
 /**************************************************************
- * 
+ *
  * 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
@@ -7,18 +7,20 @@
  * 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
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- * 
+ *
  *************************************************************/
 
+
+
 #include "precompiled_sw.hxx"
 
 #include "PageOrientationControl.hxx"
@@ -32,62 +34,63 @@
 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)
+	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( SW_RES(IMG_PORTRAIT), 0, SW_RES(STR_PORTRAIT), 0 );
-        mpOrientationValueSet->AddItem( 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();
+	mpOrientationValueSet->SetStyle( mpOrientationValueSet->GetStyle() | WB_3DLOOK | WB_NO_DIRECTSELECT );
+	mpOrientationValueSet->SetColor(GetSettings().GetStyleSettings().GetMenuColor());
+
+	// initialize <ValueSetWithText> control
+	{
+		mpOrientationValueSet->AddItem( SW_RES(IMG_PORTRAIT), 0, SW_RES(STR_PORTRAIT), 0 );
+		mpOrientationValueSet->AddItem( 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;
+	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;
+	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 noet sw=4 ts=4: */
diff --git a/main/sw/source/ui/sidebar/PageOrientationControl.hxx b/main/sw/source/ui/sidebar/PageOrientationControl.hxx
index 3b01f1478f..cb371d64fc 100644
--- a/main/sw/source/ui/sidebar/PageOrientationControl.hxx
+++ b/main/sw/source/ui/sidebar/PageOrientationControl.hxx
@@ -1,5 +1,5 @@
 /**************************************************************
- * 
+ *
  * 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
@@ -7,25 +7,27 @@
  * 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
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- * 
+ *
  *************************************************************/
 
+
+
 #ifndef _SW_SIDEBAR_PAGE_ORIENTATION_CONTROL_HXX_
 #define _SW_SIDEBAR_PAGE_ORIENTATION_CONTROL_HXX_
 
 #include <svx/sidebar/PopupControl.hxx>
 
 namespace svx { namespace sidebar {
-    class ValueSetWithTextControl;
+	class ValueSetWithTextControl;
 } }
 
 namespace sw { namespace sidebar {
@@ -34,25 +36,27 @@ class PagePropertyPanel;
 
 
 class PageOrientationControl
-    : public ::svx::sidebar::PopupControl
+	: public ::svx::sidebar::PopupControl
 {
 public:
-    PageOrientationControl(
-        Window* pParent,
-        PagePropertyPanel& rPanel,
-        const sal_Bool bLandscape );
-    ~PageOrientationControl(void);
+	PageOrientationControl(
+		Window* pParent,
+		PagePropertyPanel& rPanel,
+		const sal_Bool bLandscape );
+	~PageOrientationControl(void);
 
 private:
-    ::svx::sidebar::ValueSetWithTextControl* mpOrientationValueSet;
+	::svx::sidebar::ValueSetWithTextControl* mpOrientationValueSet;
 
-    sal_Bool mbLandscape;
+	sal_Bool mbLandscape;
 
-    PagePropertyPanel& mrPagePropPanel;
+	PagePropertyPanel& mrPagePropPanel;
 
-    DECL_LINK(ImplOrientationHdl, void*);
+	DECL_LINK(ImplOrientationHdl, void*);
 };
 
 } } // end of namespace sw::sidebar
 
 #endif
+
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/sw/source/ui/sidebar/PagePropertyPanel.cxx b/main/sw/source/ui/sidebar/PagePropertyPanel.cxx
index 986da7fe90..f917a84cdb 100644
--- a/main/sw/source/ui/sidebar/PagePropertyPanel.cxx
+++ b/main/sw/source/ui/sidebar/PagePropertyPanel.cxx
@@ -1,5 +1,5 @@
 /**************************************************************
-* 
+*
 * 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
@@ -7,18 +7,20 @@
 * 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
-* 
+*
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
-* 
+*
 *************************************************************/
 
+
+
 #include "precompiled_sw.hxx"
 
 #include "PagePropertyPanel.hxx"
@@ -64,187 +66,187 @@ using namespace ::sfx2::sidebar;
 #define SetFldVal(rField, lValue) (rField).SetValue((rField).Normalize(lValue), FUNIT_TWIP)
 
 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 > ();
-    }
+	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)
+	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(A2S("no parent Window given to PagePropertyPanel::Create"), NULL, 0);
-    if ( ! rxFrame.is())
-        throw ::com::sun::star::lang::IllegalArgumentException(A2S("no XFrame given to PagePropertyPanel::Create"), NULL, 1);
-    if (pBindings == NULL)
-        throw ::com::sun::star::lang::IllegalArgumentException(A2S("no SfxBindings given to PagePropertyPanel::Create"), NULL, 2);
-    
-    return new PagePropertyPanel(
-        pParent,
-        rxFrame,
-        pBindings);
+	if (pParent == NULL)
+		throw ::com::sun::star::lang::IllegalArgumentException(A2S("no parent Window given to PagePropertyPanel::Create"), NULL, 0);
+	if ( ! rxFrame.is())
+		throw ::com::sun::star::lang::IllegalArgumentException(A2S("no XFrame given to PagePropertyPanel::Create"), NULL, 1);
+	if (pBindings == NULL)
+		throw ::com::sun::star::lang::IllegalArgumentException(A2S("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)
-    : Control(pParent, SW_RES(RID_PROPERTYPANEL_SWPAGE))
-    , mpBindings(pBindings)
-    // visible controls
-    , maFtOrientation( this, SW_RES(FT_ORIENTATION) )
-    , mpToolBoxOrientationBackground( ::sfx2::sidebar::ControlFactory::CreateToolBoxBackground(this) )
-    , mpToolBoxOrientation( ::sfx2::sidebar::ControlFactory::CreateToolBox( mpToolBoxOrientationBackground.get(), SW_RES(TB_ORIENTATION)) )
-    , maFtMargin( this, SW_RES(FT_MARGIN) )
-    , mpToolBoxMarginBackground( ::sfx2::sidebar::ControlFactory::CreateToolBoxBackground(this) )
-    , mpToolBoxMargin( ::sfx2::sidebar::ControlFactory::CreateToolBox( mpToolBoxMarginBackground.get(), SW_RES(TB_MARGIN)) )
-    , maFtSize( this, SW_RES(FT_SIZE) )
-    , mpToolBoxSizeBackground( ::sfx2::sidebar::ControlFactory::CreateToolBoxBackground(this) )
-    , mpToolBoxSize( ::sfx2::sidebar::ControlFactory::CreateToolBox( mpToolBoxSizeBackground.get(), SW_RES(TB_SIZE)) )
-    , maFtColumn( this, SW_RES(FT_COLUMN) )
-    , mpToolBoxColumnBackground( ::sfx2::sidebar::ControlFactory::CreateToolBoxBackground(this) )
-    , mpToolBoxColumn( ::sfx2::sidebar::ControlFactory::CreateToolBox( mpToolBoxColumnBackground.get(), SW_RES(TB_COLUMN)) )
-    // 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 ),
-                          A2S("Page orientation") )
-    , maMarginPopup( this,
-                     ::boost::bind( &PagePropertyPanel::CreatePageMarginControl, this, _1 ),
-                     A2S("Page margins") )
-    , maSizePopup( this,
-                   ::boost::bind( &PagePropertyPanel::CreatePageSizeControl, this, _1 ),
-                   A2S("Page size") )
-    , maColumnPopup( this,
-                     ::boost::bind( &PagePropertyPanel::CreatePageColumnControl, this, _1 ),
-                     A2S("Page columns") )
-
-    , mxUndoManager( getUndoManager( rxFrame ) )
-
-    , mbInvalidateSIDAttrPageOnSIDAttrPageSizeNotify( false ),
-      maLayouter(*this)
+			Window* pParent,
+			const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame>& rxFrame,
+			SfxBindings* pBindings)
+	: Control(pParent, SW_RES(RID_PROPERTYPANEL_SWPAGE))
+	, mpBindings(pBindings)
+	// visible controls
+	, maFtOrientation( this, SW_RES(FT_ORIENTATION) )
+	, mpToolBoxOrientationBackground( ::sfx2::sidebar::ControlFactory::CreateToolBoxBackground(this) )
+	, mpToolBoxOrientation( ::sfx2::sidebar::ControlFactory::CreateToolBox( mpToolBoxOrientationBackground.get(), SW_RES(TB_ORIENTATION)) )
+	, maFtMargin( this, SW_RES(FT_MARGIN) )
+	, mpToolBoxMarginBackground( ::sfx2::sidebar::ControlFactory::CreateToolBoxBackground(this) )
+	, mpToolBoxMargin( ::sfx2::sidebar::ControlFactory::CreateToolBox( mpToolBoxMarginBackground.get(), SW_RES(TB_MARGIN)) )
+	, maFtSize( this, SW_RES(FT_SIZE) )
+	, mpToolBoxSizeBackground( ::sfx2::sidebar::ControlFactory::CreateToolBoxBackground(this) )
+	, mpToolBoxSize( ::sfx2::sidebar::ControlFactory::CreateToolBox( mpToolBoxSizeBackground.get(), SW_RES(TB_SIZE)) )
+	, maFtColumn( this, SW_RES(FT_COLUMN) )
+	, mpToolBoxColumnBackground( ::sfx2::sidebar::ControlFactory::CreateToolBoxBackground(this) )
+	, mpToolBoxColumn( ::sfx2::sidebar::ControlFactory::CreateToolBox( mpToolBoxColumnBackground.get(), SW_RES(TB_COLUMN)) )
+	// 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 ),
+						  A2S("Page orientation") )
+	, maMarginPopup( this,
+					 ::boost::bind( &PagePropertyPanel::CreatePageMarginControl, this, _1 ),
+					 A2S("Page margins") )
+	, maSizePopup( this,
+				   ::boost::bind( &PagePropertyPanel::CreatePageSizeControl, this, _1 ),
+				   A2S("Page size") )
+	, maColumnPopup( this,
+					 ::boost::bind( &PagePropertyPanel::CreatePageColumnControl, this, _1 ),
+					 A2S("Page columns") )
+
+	, mxUndoManager( getUndoManager( rxFrame ) )
+
+	, mbInvalidateSIDAttrPageOnSIDAttrPageSizeNotify( false ),
+	  maLayouter(*this)
 {
-    Initialize();
-    mbInvalidateSIDAttrPageOnSIDAttrPageSizeNotify = true;
-    FreeResource();
-
-    // Setup the grid layouter.
-    maLayouter.GetCell(0,0).SetControl(maFtOrientation).SetGridWidth(2);
-    maLayouter.GetCell(1,0).SetControl(*mpToolBoxOrientationBackground).SetFixedWidth();
-    
-    maLayouter.GetCell(0,3).SetControl(maFtMargin).SetGridWidth(2);
-    maLayouter.GetCell(1,3).SetControl(*mpToolBoxMarginBackground).SetFixedWidth();
-
-    maLayouter.GetCell(2,0).SetControl(maFtSize).SetGridWidth(2);
-    maLayouter.GetCell(3,0).SetControl(*mpToolBoxSizeBackground).SetFixedWidth();
-    
-    maLayouter.GetCell(2,3).SetControl(maFtColumn).SetGridWidth(2);
-    maLayouter.GetCell(3,3).SetControl(*mpToolBoxColumnBackground).SetFixedWidth();
-    
-    maLayouter.GetColumn(0)
-        .SetWeight(0)
-        .SetLeftPadding(Layouter::MapWidth(*this,SECTIONPAGE_MARGIN_HORIZONTAL));
-    maLayouter.GetColumn(1)
-        .SetWeight(1)
-        .SetMinimumWidth(Layouter::MapWidth(*this,MBOX_WIDTH/2));
-    maLayouter.GetColumn(2)
-        .SetWeight(0)
-        .SetMinimumWidth(Layouter::MapWidth(*this, CONTROL_SPACING_HORIZONTAL));
-    maLayouter.GetColumn(3)
-        .SetWeight(0);
-    maLayouter.GetColumn(4)
-        .SetWeight(1)
-        .SetRightPadding(Layouter::MapWidth(*this,SECTIONPAGE_MARGIN_HORIZONTAL))
-        .SetMinimumWidth(Layouter::MapWidth(*this,MBOX_WIDTH/2));
-
-    // Make controls that display text handle short widths more
-    // graceful.
-    Layouter::PrepareForLayouting(maFtOrientation);
-    Layouter::PrepareForLayouting(maFtMargin);
-    Layouter::PrepareForLayouting(maFtSize);
-    Layouter::PrepareForLayouting(maFtColumn);
+	Initialize();
+	mbInvalidateSIDAttrPageOnSIDAttrPageSizeNotify = true;
+	FreeResource();
+
+	// Setup the grid layouter.
+	maLayouter.GetCell(0,0).SetControl(maFtOrientation).SetGridWidth(2);
+	maLayouter.GetCell(1,0).SetControl(*mpToolBoxOrientationBackground).SetFixedWidth();
+
+	maLayouter.GetCell(0,3).SetControl(maFtMargin).SetGridWidth(2);
+	maLayouter.GetCell(1,3).SetControl(*mpToolBoxMarginBackground).SetFixedWidth();
+
+	maLayouter.GetCell(2,0).SetControl(maFtSize).SetGridWidth(2);
+	maLayouter.GetCell(3,0).SetControl(*mpToolBoxSizeBackground).SetFixedWidth();
+
+	maLayouter.GetCell(2,3).SetControl(maFtColumn).SetGridWidth(2);
+	maLayouter.GetCell(3,3).SetControl(*mpToolBoxColumnBackground).SetFixedWidth();
+
+	maLayouter.GetColumn(0)
+		.SetWeight(0)
+		.SetLeftPadding(Layouter::MapWidth(*this,SECTIONPAGE_MARGIN_HORIZONTAL));
+	maLayouter.GetColumn(1)
+		.SetWeight(1)
+		.SetMinimumWidth(Layouter::MapWidth(*this,MBOX_WIDTH/2));
+	maLayouter.GetColumn(2)
+		.SetWeight(0)
+		.SetMinimumWidth(Layouter::MapWidth(*this, CONTROL_SPACING_HORIZONTAL));
+	maLayouter.GetColumn(3)
+		.SetWeight(0);
+	maLayouter.GetColumn(4)
+		.SetWeight(1)
+		.SetRightPadding(Layouter::MapWidth(*this,SECTIONPAGE_MARGIN_HORIZONTAL))
+		.SetMinimumWidth(Layouter::MapWidth(*this,MBOX_WIDTH/2));
+
+	// Make controls that display text handle short widths more
+	// graceful.
+	Layouter::PrepareForLayouting(maFtOrientation);
+	Layouter::PrepareForLayouting(maFtMargin);
+	Layouter::PrepareForLayouting(maFtSize);
+	Layouter::PrepareForLayouting(maFtColumn);
 }
 
 
@@ -252,178 +254,178 @@ PagePropertyPanel::PagePropertyPanel(
 
 PagePropertyPanel::~PagePropertyPanel()
 {
-    delete[] maImgSize;
-    delete[] maImgSize_L;
-
-    // destroy the toolbox windows.
-    mpToolBoxOrientation.reset();
-    mpToolBoxMargin.reset();
-    mpToolBoxSize.reset();
-    mpToolBoxColumn.reset();
-
-    // destroy the background windows of the toolboxes.
-    mpToolBoxOrientationBackground.reset();
-    mpToolBoxMarginBackground.reset();
-    mpToolBoxSizeBackground.reset();
-    mpToolBoxColumnBackground.reset();
+	delete[] maImgSize;
+	delete[] maImgSize_L;
+
+	// destroy the toolbox windows.
+	mpToolBoxOrientation.reset();
+	mpToolBoxMargin.reset();
+	mpToolBoxSize.reset();
+	mpToolBoxColumn.reset();
+
+	// destroy the background windows of the toolboxes.
+	mpToolBoxOrientationBackground.reset();
+	mpToolBoxMarginBackground.reset();
+	mpToolBoxSizeBackground.reset();
+	mpToolBoxColumnBackground.reset();
 }
 
 void PagePropertyPanel::Initialize()
 {
-    maFtOrientation.SetBackground(Wallpaper());
-    maFtMargin.SetBackground(Wallpaper());
-    maFtSize.SetBackground(Wallpaper());
-    maFtColumn.SetBackground(Wallpaper());
-
-    // popup for page orientation
-    Link aLink = LINK( this, PagePropertyPanel, ClickOrientationHdl );
-    mpToolBoxOrientation->SetDropdownClickHdl( aLink );
-    mpToolBoxOrientation->SetSelectHdl( aLink );
-    mpToolBoxOrientation->SetItemImage( TBI_ORIENTATION, mImgPortrait);
-    mpToolBoxOrientation->SetItemBits( TBI_ORIENTATION, mpToolBoxOrientation->GetItemBits( TBI_ORIENTATION ) | TIB_DROPDOWNONLY );
-    mpToolBoxOrientation->SetQuickHelpText(TBI_ORIENTATION,String(SW_RES(STR_QHELP_TB_ORIENTATION)));
-    mpToolBoxOrientation->SetOutputSizePixel( mpToolBoxOrientation->CalcWindowSizePixel() );
-    mpToolBoxOrientation->SetBackground( Wallpaper() );
-    mpToolBoxOrientation->SetPaintTransparent( sal_True );
-
-    // popup for page margins
-    aLink = LINK( this, PagePropertyPanel, ClickMarginHdl );
-    mpToolBoxMargin->SetDropdownClickHdl( aLink );
-    mpToolBoxMargin->SetSelectHdl( aLink );
-    mpToolBoxMargin->SetItemImage(TBI_MARGIN, mImgNormal);
-    mpToolBoxMargin->SetItemBits( TBI_MARGIN, mpToolBoxMargin->GetItemBits( TBI_MARGIN ) | TIB_DROPDOWNONLY );
-    mpToolBoxMargin->SetQuickHelpText(TBI_MARGIN,String(SW_RES(STR_QHELP_TB_MARGIN)));
-    mpToolBoxMargin->SetOutputSizePixel( mpToolBoxMargin->CalcWindowSizePixel() );
-    mpToolBoxMargin->SetBackground(Wallpaper());
-    mpToolBoxMargin->SetPaintTransparent( sal_True );
-
-    // popup for page size
-    aLink = LINK( this, PagePropertyPanel, ClickSizeHdl );
-    mpToolBoxSize->SetDropdownClickHdl( aLink );
-    mpToolBoxSize->SetSelectHdl( aLink );
-    mpToolBoxSize->SetItemImage(TBI_SIZE, mImgLetter);
-    mpToolBoxSize->SetItemBits( TBI_SIZE, mpToolBoxSize->GetItemBits( TBI_SIZE ) | TIB_DROPDOWNONLY );
-    mpToolBoxSize->SetQuickHelpText(TBI_SIZE,String(SW_RES(STR_QHELP_TB_SIZE)));
-    mpToolBoxSize->SetOutputSizePixel( mpToolBoxSize->CalcWindowSizePixel() );
-    mpToolBoxSize->SetBackground(Wallpaper());
-    mpToolBoxSize->SetPaintTransparent( sal_True );
-    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
-    aLink = LINK( this, PagePropertyPanel, ClickColumnHdl );
-    mpToolBoxColumn->SetDropdownClickHdl( aLink );
-    mpToolBoxColumn->SetSelectHdl( aLink );
-    mpToolBoxColumn->SetItemImage(TBI_COLUMN, mImgColumn1);
-    mpToolBoxColumn->SetItemBits( TBI_COLUMN, mpToolBoxColumn->GetItemBits( TBI_COLUMN ) | TIB_DROPDOWNONLY );
-    mpToolBoxColumn->SetQuickHelpText(TBI_COLUMN,String(SW_RES(STR_QHELP_TB_COLUMN)));
-    mpToolBoxColumn->SetOutputSizePixel( mpToolBoxColumn->CalcWindowSizePixel() );
-    mpToolBoxColumn->SetBackground(Wallpaper());
-    mpToolBoxColumn->SetPaintTransparent( sal_True );
-
-    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 );
+	maFtOrientation.SetBackground(Wallpaper());
+	maFtMargin.SetBackground(Wallpaper());
+	maFtSize.SetBackground(Wallpaper());
+	maFtColumn.SetBackground(Wallpaper());
+
+	// popup for page orientation
+	Link aLink = LINK( this, PagePropertyPanel, ClickOrientationHdl );
+	mpToolBoxOrientation->SetDropdownClickHdl( aLink );
+	mpToolBoxOrientation->SetSelectHdl( aLink );
+	mpToolBoxOrientation->SetItemImage( TBI_ORIENTATION, mImgPortrait);
+	mpToolBoxOrientation->SetItemBits( TBI_ORIENTATION, mpToolBoxOrientation->GetItemBits( TBI_ORIENTATION ) | TIB_DROPDOWNONLY );
+	mpToolBoxOrientation->SetQuickHelpText(TBI_ORIENTATION,String(SW_RES(STR_QHELP_TB_ORIENTATION)));
+	mpToolBoxOrientation->SetOutputSizePixel( mpToolBoxOrientation->CalcWindowSizePixel() );
+	mpToolBoxOrientation->SetBackground( Wallpaper() );
+	mpToolBoxOrientation->SetPaintTransparent( sal_True );
+
+	// popup for page margins
+	aLink = LINK( this, PagePropertyPanel, ClickMarginHdl );
+	mpToolBoxMargin->SetDropdownClickHdl( aLink );
+	mpToolBoxMargin->SetSelectHdl( aLink );
+	mpToolBoxMargin->SetItemImage(TBI_MARGIN, mImgNormal);
+	mpToolBoxMargin->SetItemBits( TBI_MARGIN, mpToolBoxMargin->GetItemBits( TBI_MARGIN ) | TIB_DROPDOWNONLY );
+	mpToolBoxMargin->SetQuickHelpText(TBI_MARGIN,String(SW_RES(STR_QHELP_TB_MARGIN)));
+	mpToolBoxMargin->SetOutputSizePixel( mpToolBoxMargin->CalcWindowSizePixel() );
+	mpToolBoxMargin->SetBackground(Wallpaper());
+	mpToolBoxMargin->SetPaintTransparent( sal_True );
+
+	// popup for page size
+	aLink = LINK( this, PagePropertyPanel, ClickSizeHdl );
+	mpToolBoxSize->SetDropdownClickHdl( aLink );
+	mpToolBoxSize->SetSelectHdl( aLink );
+	mpToolBoxSize->SetItemImage(TBI_SIZE, mImgLetter);
+	mpToolBoxSize->SetItemBits( TBI_SIZE, mpToolBoxSize->GetItemBits( TBI_SIZE ) | TIB_DROPDOWNONLY );
+	mpToolBoxSize->SetQuickHelpText(TBI_SIZE,String(SW_RES(STR_QHELP_TB_SIZE)));
+	mpToolBoxSize->SetOutputSizePixel( mpToolBoxSize->CalcWindowSizePixel() );
+	mpToolBoxSize->SetBackground(Wallpaper());
+	mpToolBoxSize->SetPaintTransparent( sal_True );
+	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
+	aLink = LINK( this, PagePropertyPanel, ClickColumnHdl );
+	mpToolBoxColumn->SetDropdownClickHdl( aLink );
+	mpToolBoxColumn->SetSelectHdl( aLink );
+	mpToolBoxColumn->SetItemImage(TBI_COLUMN, mImgColumn1);
+	mpToolBoxColumn->SetItemBits( TBI_COLUMN, mpToolBoxColumn->GetItemBits( TBI_COLUMN ) | TIB_DROPDOWNONLY );
+	mpToolBoxColumn->SetQuickHelpText(TBI_COLUMN,String(SW_RES(STR_QHELP_TB_COLUMN)));
+	mpToolBoxColumn->SetOutputSizePixel( mpToolBoxColumn->CalcWindowSizePixel() );
+	mpToolBoxColumn->SetBackground(Wallpaper());
+	mpToolBoxColumn->SetPaintTransparent( sal_True );
+
+	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() );
+	return new PageOrientationControl( pParent, *this , mpPageItem->IsLandscape() );
 }
 
 
 IMPL_LINK( PagePropertyPanel, ClickOrientationHdl, ToolBox*, pToolBox )
 {
-    maOrientationPopup.Show( *pToolBox );
+	maOrientationPopup.Show( *pToolBox );
 
-    return 0L;
+	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();
+	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();
+	maOrientationPopup.Hide();
 }
 
 
@@ -431,56 +433,56 @@ void PagePropertyPanel::ClosePageOrientationPopup()
 
 ::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 );
+	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 )
+	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 );	
+	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 )
+	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 );
+	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 );
+	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 );
+	maMarginPopup.Show( *pToolBox );
 
-    return 0L;
+	return 0L;
 }
 
 
 void PagePropertyPanel::ClosePageMarginPopup()
 {
-    maMarginPopup.Hide();
+	maMarginPopup.Hide();
 }
 
 
@@ -488,39 +490,39 @@ void PagePropertyPanel::ClosePageMarginPopup()
 
 ::svx::sidebar::PopupControl* PagePropertyPanel::CreatePageSizeControl( ::svx::sidebar::PopupContainer* pParent )
 {
-    return new PageSizeControl( 
-        pParent, 
-        *this,
-        mePaper,
-        mpPageItem->IsLandscape(),
-        meFUnit );
+	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 );	
+	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 );
+	maSizePopup.Show( *pToolBox );
 
-    return 0L;
+	return 0L;
 }
 
 
 void PagePropertyPanel::ClosePageSizePopup()
 {
-    maSizePopup.Hide();
+	maSizePopup.Hide();
 }
 
 
@@ -528,141 +530,141 @@ void PagePropertyPanel::ClosePageSizePopup()
 
 ::svx::sidebar::PopupControl* PagePropertyPanel::CreatePageColumnControl( ::svx::sidebar::PopupContainer* pParent )
 {
-    return new PageColumnControl(
-        pParent,
-        *this,
-        mpPageColumnTypeItem->GetValue(),
-        mpPageItem->IsLandscape() );
+	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 );
+	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 );
+	maColumnPopup.Show( *pToolBox );
 
-    return 0L;
+	return 0L;
 }
 
 
 void PagePropertyPanel::ClosePageColumnPopup()
 {
-    maColumnPopup.Hide();
+	maColumnPopup.Hide();
 }
 
 
 
 
 void PagePropertyPanel::NotifyItemUpdate(
-    const sal_uInt16 nSId,
-    const SfxItemState eState,
-    const SfxPoolItem* pState,
-    const bool bIsEnabled)
+	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) )
-        {
-            mpPageItem.reset( static_cast<SvxPageItem*>(pState->Clone()) );
-            if ( mpPageItem->IsLandscape() )
-            {
-                mpToolBoxOrientation->SetItemImage(TBI_ORIENTATION, mImgLandscape);
-            }
-            else
-            {
-                mpToolBoxOrientation->SetItemImage(TBI_ORIENTATION, 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)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) )
+		{
+			mpPageItem.reset( static_cast<SvxPageItem*>(pState->Clone()) );
+			if ( mpPageItem->IsLandscape() )
+			{
+				mpToolBoxOrientation->SetItemImage(TBI_ORIENTATION, mImgLandscape);
+			}
+			else
+			{
+				mpToolBoxOrientation->SetItemImage(TBI_ORIENTATION, 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" );
-            }
-        }
-    }
+	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" );
+			}
+		}
+	}
 }
 
 
@@ -670,181 +672,181 @@ void PagePropertyPanel::MetricState( SfxItemState eState, const SfxPoolItem* pSt
 
 void PagePropertyPanel::ChangeMarginImage()
 {
-    if ( mpPageLRMarginItem.get() == 0 ||
-         mpPageULMarginItem.get() == 0 ||
-         mpPageItem.get() == 0 )
-    {
-        return;
-    }
-
-    const long cTolerance = 5;
-
-    if( abs(mpPageLRMarginItem->GetLeft() - SWPAGE_NARROW_VALUE) <= cTolerance &&
-        abs(mpPageLRMarginItem->GetRight() - SWPAGE_NARROW_VALUE) <= cTolerance &&
-        abs(mpPageULMarginItem->GetUpper() - SWPAGE_NARROW_VALUE) <= cTolerance &&
-        abs(mpPageULMarginItem->GetLower() - SWPAGE_NARROW_VALUE) <= cTolerance &&
-        mpPageItem->GetPageUsage() != SVX_PAGE_MIRROR )
-        mpToolBoxMargin->SetItemImage( TBI_MARGIN, mpPageItem->IsLandscape() ? mImgNarrow_L : mImgNarrow );
-
-    else if( abs(mpPageLRMarginItem->GetLeft() - SWPAGE_NORMAL_VALUE) <= cTolerance &&
-        abs(mpPageLRMarginItem->GetRight() - SWPAGE_NORMAL_VALUE) <= cTolerance &&
-        abs(mpPageULMarginItem->GetUpper() - SWPAGE_NORMAL_VALUE) <= cTolerance &&
-        abs(mpPageULMarginItem->GetLower() - SWPAGE_NORMAL_VALUE) <= cTolerance &&
-        mpPageItem->GetPageUsage() != SVX_PAGE_MIRROR )
-        mpToolBoxMargin->SetItemImage(TBI_MARGIN, mpPageItem->IsLandscape() ? mImgNormal_L : mImgNormal );
-
-    else if( abs(mpPageLRMarginItem->GetLeft() - SWPAGE_WIDE_VALUE2) <= cTolerance &&
-        abs(mpPageLRMarginItem->GetRight() - SWPAGE_WIDE_VALUE2) <= cTolerance &&
-        abs(mpPageULMarginItem->GetUpper() - SWPAGE_WIDE_VALUE1) <= cTolerance &&
-        abs(mpPageULMarginItem->GetLower() - SWPAGE_WIDE_VALUE1) <= cTolerance &&
-        mpPageItem->GetPageUsage() != SVX_PAGE_MIRROR )
-        mpToolBoxMargin->SetItemImage(TBI_MARGIN, mpPageItem->IsLandscape() ? mImgWide_L : mImgWide );
-
-    else if( abs(mpPageLRMarginItem->GetLeft() - SWPAGE_WIDE_VALUE3) <= cTolerance &&
-        abs(mpPageLRMarginItem->GetRight() - SWPAGE_WIDE_VALUE1) <= cTolerance &&
-        abs(mpPageULMarginItem->GetUpper() - SWPAGE_WIDE_VALUE1) <= cTolerance &&
-        abs(mpPageULMarginItem->GetLower() - SWPAGE_WIDE_VALUE1) <= cTolerance &&
-        mpPageItem->GetPageUsage() == SVX_PAGE_MIRROR )
-        mpToolBoxMargin->SetItemImage(TBI_MARGIN, mpPageItem->IsLandscape() ? mImgMirrored_L : mImgMirrored );
-
-    else 
-        mpToolBoxMargin->SetItemImage(TBI_MARGIN, mpPageItem->IsLandscape() ? mImgMarginCustom_L : mImgMarginCustom );
+	if ( mpPageLRMarginItem.get() == 0 ||
+		 mpPageULMarginItem.get() == 0 ||
+		 mpPageItem.get() == 0 )
+	{
+		return;
+	}
+
+	const long cTolerance = 5;
+
+	if( abs(mpPageLRMarginItem->GetLeft() - SWPAGE_NARROW_VALUE) <= cTolerance &&
+		abs(mpPageLRMarginItem->GetRight() - SWPAGE_NARROW_VALUE) <= cTolerance &&
+		abs(mpPageULMarginItem->GetUpper() - SWPAGE_NARROW_VALUE) <= cTolerance &&
+		abs(mpPageULMarginItem->GetLower() - SWPAGE_NARROW_VALUE) <= cTolerance &&
+		mpPageItem->GetPageUsage() != SVX_PAGE_MIRROR )
+		mpToolBoxMargin->SetItemImage( TBI_MARGIN, mpPageItem->IsLandscape() ? mImgNarrow_L : mImgNarrow );
+
+	else if( abs(mpPageLRMarginItem->GetLeft() - SWPAGE_NORMAL_VALUE) <= cTolerance &&
+		abs(mpPageLRMarginItem->GetRight() - SWPAGE_NORMAL_VALUE) <= cTolerance &&
+		abs(mpPageULMarginItem->GetUpper() - SWPAGE_NORMAL_VALUE) <= cTolerance &&
+		abs(mpPageULMarginItem->GetLower() - SWPAGE_NORMAL_VALUE) <= cTolerance &&
+		mpPageItem->GetPageUsage() != SVX_PAGE_MIRROR )
+		mpToolBoxMargin->SetItemImage(TBI_MARGIN, mpPageItem->IsLandscape() ? mImgNormal_L : mImgNormal );
+
+	else if( abs(mpPageLRMarginItem->GetLeft() - SWPAGE_WIDE_VALUE2) <= cTolerance &&
+		abs(mpPageLRMarginItem->GetRight() - SWPAGE_WIDE_VALUE2) <= cTolerance &&
+		abs(mpPageULMarginItem->GetUpper() - SWPAGE_WIDE_VALUE1) <= cTolerance &&
+		abs(mpPageULMarginItem->GetLower() - SWPAGE_WIDE_VALUE1) <= cTolerance &&
+		mpPageItem->GetPageUsage() != SVX_PAGE_MIRROR )
+		mpToolBoxMargin->SetItemImage(TBI_MARGIN, mpPageItem->IsLandscape() ? mImgWide_L : mImgWide );
+
+	else if( abs(mpPageLRMarginItem->GetLeft() - SWPAGE_WIDE_VALUE3) <= cTolerance &&
+		abs(mpPageLRMarginItem->GetRight() - SWPAGE_WIDE_VALUE1) <= cTolerance &&
+		abs(mpPageULMarginItem->GetUpper() - SWPAGE_WIDE_VALUE1) <= cTolerance &&
+		abs(mpPageULMarginItem->GetLower() - SWPAGE_WIDE_VALUE1) <= cTolerance &&
+		mpPageItem->GetPageUsage() == SVX_PAGE_MIRROR )
+		mpToolBoxMargin->SetItemImage(TBI_MARGIN, mpPageItem->IsLandscape() ? mImgMirrored_L : mImgMirrored );
+
+	else
+		mpToolBoxMargin->SetItemImage(TBI_MARGIN, 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), sal_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;
-    }
-
-    if ( nImageIdx == 0 )
-    {
-        mpToolBoxSize->SetItemImage( TBI_SIZE, 
-                                     ( mpPageItem->IsLandscape() ? mImgSizeNone_L : mImgSizeNone  ) );
-    }
-    else
-    {
-        mpToolBoxSize->SetItemImage( TBI_SIZE, 
-                                     ( mpPageItem->IsLandscape() ? maImgSize_L[nImageIdx-1] : maImgSize[nImageIdx-1] ) );
-    }
+	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), sal_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;
+	}
+
+	if ( nImageIdx == 0 )
+	{
+		mpToolBoxSize->SetItemImage( TBI_SIZE,
+									 ( mpPageItem->IsLandscape() ? mImgSizeNone_L : mImgSizeNone ) );
+	}
+	else
+	{
+		mpToolBoxSize->SetItemImage( TBI_SIZE,
+									 ( mpPageItem->IsLandscape() ? maImgSize_L[nImageIdx-1] : maImgSize[nImageIdx-1] ) );
+	}
 }
 
 
 void PagePropertyPanel::ChangeColumnImage( const sal_uInt16 nColumnType )
 {
-    if ( mpPageItem.get() == 0 )
-    {
-        return;
-    }
-
-    if ( !mpPageItem->IsLandscape() )
-    {
-        switch( nColumnType )
-        {
-        case 1:
-            mpToolBoxColumn->SetItemImage(TBI_COLUMN, mImgColumn1);
-            break;
-        case 2:
-            mpToolBoxColumn->SetItemImage(TBI_COLUMN, mImgColumn2);
-            break;
-        case 3:
-            mpToolBoxColumn->SetItemImage(TBI_COLUMN, mImgColumn3);
-            break;
-        case 4:
-            mpToolBoxColumn->SetItemImage(TBI_COLUMN, mImgLeft);
-            break;
-        case 5:
-            mpToolBoxColumn->SetItemImage(TBI_COLUMN, mImgRight);
-            break;
-        default:
-            mpToolBoxColumn->SetItemImage(TBI_COLUMN, mImgColumnNone);
-        }
-    }
-    else
-    {
-        switch( nColumnType )
-        {
-        case 1:
-            mpToolBoxColumn->SetItemImage(TBI_COLUMN, mImgColumn1_L);
-            break;
-        case 2:
-            mpToolBoxColumn->SetItemImage(TBI_COLUMN, mImgColumn2_L);
-            break;
-        case 3:
-            mpToolBoxColumn->SetItemImage(TBI_COLUMN, mImgColumn3_L);
-            break;
-        case 4:
-            mpToolBoxColumn->SetItemImage(TBI_COLUMN, mImgLeft_L);
-            break;
-        case 5:
-            mpToolBoxColumn->SetItemImage(TBI_COLUMN, mImgRight_L);
-            break;
-        default:
-            mpToolBoxColumn->SetItemImage(TBI_COLUMN, mImgColumnNone_L);
-        }
-    }
+	if ( mpPageItem.get() == 0 )
+	{
+		return;
+	}
+
+	if ( !mpPageItem->IsLandscape() )
+	{
+		switch( nColumnType )
+		{
+		case 1:
+			mpToolBoxColumn->SetItemImage(TBI_COLUMN, mImgColumn1);
+			break;
+		case 2:
+			mpToolBoxColumn->SetItemImage(TBI_COLUMN, mImgColumn2);
+			break;
+		case 3:
+			mpToolBoxColumn->SetItemImage(TBI_COLUMN, mImgColumn3);
+			break;
+		case 4:
+			mpToolBoxColumn->SetItemImage(TBI_COLUMN, mImgLeft);
+			break;
+		case 5:
+			mpToolBoxColumn->SetItemImage(TBI_COLUMN, mImgRight);
+			break;
+		default:
+			mpToolBoxColumn->SetItemImage(TBI_COLUMN, mImgColumnNone);
+		}
+	}
+	else
+	{
+		switch( nColumnType )
+		{
+		case 1:
+			mpToolBoxColumn->SetItemImage(TBI_COLUMN, mImgColumn1_L);
+			break;
+		case 2:
+			mpToolBoxColumn->SetItemImage(TBI_COLUMN, mImgColumn2_L);
+			break;
+		case 3:
+			mpToolBoxColumn->SetItemImage(TBI_COLUMN, mImgColumn3_L);
+			break;
+		case 4:
+			mpToolBoxColumn->SetItemImage(TBI_COLUMN, mImgLeft_L);
+			break;
+		case 5:
+			mpToolBoxColumn->SetItemImage(TBI_COLUMN, mImgRight_L);
+			break;
+		default:
+			mpToolBoxColumn->SetItemImage(TBI_COLUMN, mImgColumnNone_L);
+		}
+	}
 }
 
 
 void PagePropertyPanel::StartUndo()
 {
-    if ( mxUndoManager.is() )
-    {
-        mxUndoManager->enterUndoContext( A2S("") );
-    }
+	if ( mxUndoManager.is() )
+	{
+		mxUndoManager->enterUndoContext( A2S("") );
+	}
 }
 
 
 void PagePropertyPanel::EndUndo()
 {
-    if ( mxUndoManager.is() )
-    {
-        mxUndoManager->leaveUndoContext();
-    }
+	if ( mxUndoManager.is() )
+	{
+		mxUndoManager->leaveUndoContext();
+	}
 }
 
 
@@ -852,7 +854,7 @@ void PagePropertyPanel::EndUndo()
 
 void PagePropertyPanel::Resize (void)
 {
-    maLayouter.Layout();
+	maLayouter.Layout();
 }
 
 
@@ -860,3 +862,5 @@ void PagePropertyPanel::Resize (void)
 
 
 } } // end of namespace ::sw::sidebar
+
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/sw/source/ui/sidebar/PagePropertyPanel.hxx b/main/sw/source/ui/sidebar/PagePropertyPanel.hxx
index 22d9181c49..05aae1d4c1 100644
--- a/main/sw/source/ui/sidebar/PagePropertyPanel.hxx
+++ b/main/sw/source/ui/sidebar/PagePropertyPanel.hxx
@@ -1,5 +1,5 @@
 /**************************************************************
-* 
+*
 * 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
@@ -7,18 +7,20 @@
 * 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
-* 
+*
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
-* 
+*
 *************************************************************/
 
+
+
 #ifndef SW_SIDEBAR_PAGE_PROPERTY_PANEL_HXX
 #define SW_SIDEBAR_PAGE_PROPERTY_PANEL_HXX
 
@@ -31,7 +33,7 @@
 #include <sfx2/sidebar/GridLayouter.hxx>
 
 namespace svx { namespace sidebar {
-    class PopupControl;
+	class PopupControl;
 } }
 
 #include <i18npool/paper.hxx>
@@ -56,184 +58,186 @@ namespace cssu = ::com::sun::star::uno;
 
 namespace sw { namespace sidebar {
 
-    class PagePropertyPanel 
-        : public Control,
-          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();
-
-        // Inherited from vcl Window.
-        virtual void Resize (void);
-                
-    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
-        FixedText   maFtOrientation;
-        ::boost::scoped_ptr<Window> mpToolBoxOrientationBackground;
-        ::boost::scoped_ptr<ToolBox> mpToolBoxOrientation;
-        FixedText				maFtMargin;
-        ::boost::scoped_ptr<Window> mpToolBoxMarginBackground;
-        ::boost::scoped_ptr<ToolBox> mpToolBoxMargin;
-        FixedText				maFtSize;
-        ::boost::scoped_ptr<Window> mpToolBoxSizeBackground;
-        ::boost::scoped_ptr<ToolBox> mpToolBoxSize;
-        FixedText				maFtColumn;
-        ::boost::scoped_ptr<Window> mpToolBoxColumnBackground;
-        ::boost::scoped_ptr<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;
-        ::sfx2::sidebar::GridLayouter maLayouter;
-
-        // 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 );
-
-    };
+	class PagePropertyPanel
+		: public Control,
+		  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();
+
+		// Inherited from vcl Window.
+		virtual void Resize (void);
+
+	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
+		FixedText maFtOrientation;
+		::boost::scoped_ptr<Window> mpToolBoxOrientationBackground;
+		::boost::scoped_ptr<ToolBox> mpToolBoxOrientation;
+		FixedText				maFtMargin;
+		::boost::scoped_ptr<Window> mpToolBoxMarginBackground;
+		::boost::scoped_ptr<ToolBox> mpToolBoxMargin;
+		FixedText				maFtSize;
+		::boost::scoped_ptr<Window> mpToolBoxSizeBackground;
+		::boost::scoped_ptr<ToolBox> mpToolBoxSize;
+		FixedText				maFtColumn;
+		::boost::scoped_ptr<Window> mpToolBoxColumnBackground;
+		::boost::scoped_ptr<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;
+		::sfx2::sidebar::GridLayouter maLayouter;
+
+		// 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 noet sw=4 ts=4: */
diff --git a/main/sw/source/ui/sidebar/PageSizeControl.cxx b/main/sw/source/ui/sidebar/PageSizeControl.cxx
index d9532a19ef..21fb18aa5b 100644
--- a/main/sw/source/ui/sidebar/PageSizeControl.cxx
+++ b/main/sw/source/ui/sidebar/PageSizeControl.cxx
@@ -1,5 +1,5 @@
 /**************************************************************
- * 
+ *
  * 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
@@ -7,18 +7,20 @@
  * 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
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- * 
+ *
  *************************************************************/
 
+
+
 #include "precompiled_sw.hxx"
 
 #include "PageSizeControl.hxx"
@@ -39,148 +41,149 @@
 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)
+	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;
-    {
-        XubString aMetricStr;
-        {
-            const XubString aText = maWidthHeightField.GetText();
-            for (short i = aText.Len() - 1; i >= 0; i--)
-            {
-                xub_Unicode c = aText.GetChar(i);
-                if ( INetMIME::isAlpha(c) || (c == '\'') || (c == '\"') || (c == '%') )
-                {
-                    aMetricStr.Insert(c, 0);
-                }
-                else
-                {
-                    if (aMetricStr.Len())
-                    {
-                        break;
-                    }
-                }
-            }
-        }
-
-        const LocaleDataWrapper& localeDataWrapper = maWidthHeightField.GetLocaleDataWrapper();
-        String WidthStr;
-        String HeightStr;
-        String ItemText2;
-        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 );
-            WidthStr = localeDataWrapper.getNum(
-                maWidthHeightField.GetValue(),
-                maWidthHeightField.GetDecimalDigits(),
-                maWidthHeightField.IsUseThousandSep(),
-                maWidthHeightField.IsShowTrailingZeros() );
-
-            maWidthHeightField.SetValue( maWidthHeightField.Normalize( aPaperSize.Height() ), FUNIT_TWIP);
-            HeightStr = localeDataWrapper.getNum(
-                maWidthHeightField.GetValue(),
-                maWidthHeightField.GetDecimalDigits(),
-                maWidthHeightField.IsUseThousandSep(),
-                maWidthHeightField.IsShowTrailingZeros() );
-
-            ItemText2 = WidthStr;
-            ItemText2 += String::CreateFromAscii(" x ");
-            ItemText2 += HeightStr;
-            ItemText2 += String::CreateFromAscii(" ");
-            ItemText2 += aMetricStr;
-
-            mpSizeValueSet->AddItem( 
-                SvxPaperInfo::GetName( maPaperList[ nPaperIdx ] ),
-                ItemText2,
-                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();
+	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;
+	{
+		XubString aMetricStr;
+		{
+			const XubString aText = maWidthHeightField.GetText();
+			for (short i = aText.Len() - 1; i >= 0; i--)
+			{
+				xub_Unicode c = aText.GetChar(i);
+				if ( INetMIME::isAlpha(c) || (c == '\'') || (c == '\"') || (c == '%') )
+				{
+					aMetricStr.Insert(c, 0);
+				}
+				else
+				{
+					if (aMetricStr.Len())
+					{
+						break;
+					}
+				}
+			}
+		}
+
+		const LocaleDataWrapper& localeDataWrapper = maWidthHeightField.GetLocaleDataWrapper();
+		String WidthStr;
+		String HeightStr;
+		String ItemText2;
+		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 );
+			WidthStr = localeDataWrapper.getNum(
+				maWidthHeightField.GetValue(),
+				maWidthHeightField.GetDecimalDigits(),
+				maWidthHeightField.IsUseThousandSep(),
+				maWidthHeightField.IsShowTrailingZeros() );
+
+			maWidthHeightField.SetValue( maWidthHeightField.Normalize( aPaperSize.Height() ), FUNIT_TWIP);
+			HeightStr = localeDataWrapper.getNum(
+				maWidthHeightField.GetValue(),
+				maWidthHeightField.GetDecimalDigits(),
+				maWidthHeightField.IsUseThousandSep(),
+				maWidthHeightField.IsShowTrailingZeros() );
+
+			ItemText2 = WidthStr;
+			ItemText2 += String::CreateFromAscii(" x ");
+			ItemText2 += HeightStr;
+			ItemText2 += String::CreateFromAscii(" ");
+			ItemText2 += aMetricStr;
+
+			mpSizeValueSet->AddItem(
+				SvxPaperInfo::GetName( maPaperList[ nPaperIdx ] ),
+				ItemText2,
+				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;
+	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;
+	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.GetBindings()->GetDispatcher()->Execute( FN_FORMAT_PAGE_SETTING_DLG, SFX_CALLMODE_ASYNCHRON );
 
-    mrPagePropPanel.ClosePageSizePopup();
-    return 0;
+	mrPagePropPanel.ClosePageSizePopup();
+	return 0;
 }
 
 
 } } // end of namespace sw::sidebar
 
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/sw/source/ui/sidebar/PageSizeControl.hxx b/main/sw/source/ui/sidebar/PageSizeControl.hxx
index 2d0dc82f8d..c38d85f357 100644
--- a/main/sw/source/ui/sidebar/PageSizeControl.hxx
+++ b/main/sw/source/ui/sidebar/PageSizeControl.hxx
@@ -1,5 +1,5 @@
 /**************************************************************
- * 
+ *
  * 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
@@ -7,18 +7,20 @@
  * 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
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- * 
+ *
  *************************************************************/
 
+
+
 #ifndef _SW_SIDEBAR_PAGE_SIZE_CONTROL_HXX_
 #define _SW_SIDEBAR_PAGE_SIZE_CONTROL_HXX_
 
@@ -33,7 +35,7 @@
 #include <vector>
 
 namespace svx { namespace sidebar {
-    class ValueSetWithTextControl;
+	class ValueSetWithTextControl;
 } }
 
 namespace sw { namespace sidebar {
@@ -42,32 +44,34 @@ class PagePropertyPanel;
 
 
 class PageSizeControl
-    : public ::svx::sidebar::PopupControl
+	: public ::svx::sidebar::PopupControl
 {
 public:
-    PageSizeControl(
-        Window* pParent,
-        PagePropertyPanel& rPanel,
-        const Paper ePaper,
-        const sal_Bool bLandscape,
-        const FieldUnit eFUnit );
-    ~PageSizeControl(void);
+	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;
+	::svx::sidebar::ValueSetWithTextControl* mpSizeValueSet;
+	PushButton maMoreButton;
+	// hidden metric field
+	MetricField maWidthHeightField;
 
-    Paper mePaper;
-    ::std::vector< Paper > maPaperList;
+	Paper mePaper;
+	::std::vector< Paper > maPaperList;
 
-    PagePropertyPanel& mrPagePropPanel;
+	PagePropertyPanel& mrPagePropPanel;
 
-    DECL_LINK(ImplSizeHdl, void*);
-    DECL_LINK(MoreButtonClickHdl_Impl, void*);
+	DECL_LINK(ImplSizeHdl, void*);
+	DECL_LINK(MoreButtonClickHdl_Impl, void*);
 };
 
 } } // end of namespace sw::sidebar
 
 #endif
+
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/sw/source/ui/sidebar/SwPanelFactory.cxx b/main/sw/source/ui/sidebar/SwPanelFactory.cxx
index f81a2145fd..eb40ce300d 100644
--- a/main/sw/source/ui/sidebar/SwPanelFactory.cxx
+++ b/main/sw/source/ui/sidebar/SwPanelFactory.cxx
@@ -1,5 +1,5 @@
 /**************************************************************
- * 
+ *
  * 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
@@ -7,18 +7,20 @@
  * 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
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- * 
+ *
  *************************************************************/
 
+
+
 #include "precompiled_sw.hxx"
 
 #include "SwPanelFactory.hxx"
@@ -51,30 +53,30 @@ namespace sw { namespace sidebar {
 
 ::rtl::OUString SAL_CALL SwPanelFactory::getImplementationName (void)
 {
-    return A2S(IMPLEMENTATION_NAME);
+	return A2S(IMPLEMENTATION_NAME);
 }
 
 
 cssu::Reference<cssu::XInterface> SAL_CALL SwPanelFactory::createInstance(
-    const uno::Reference<lang::XMultiServiceFactory>& )
+	const uno::Reference<lang::XMultiServiceFactory>& )
 {
-    ::rtl::Reference<SwPanelFactory> pPanelFactory (new SwPanelFactory());
-    cssu::Reference<cssu::XInterface> xService (static_cast<XWeak*>(pPanelFactory.get()), cssu::UNO_QUERY);
-    return xService;
+	::rtl::Reference<SwPanelFactory> pPanelFactory (new SwPanelFactory());
+	cssu::Reference<cssu::XInterface> xService (static_cast<XWeak*>(pPanelFactory.get()), cssu::UNO_QUERY);
+	return xService;
 }
 
 
 cssu::Sequence<OUString> SAL_CALL SwPanelFactory::getSupportedServiceNames (void)
 {
-    cssu::Sequence<OUString> aServiceNames (1);
-    aServiceNames[0] = A2S(SERVICE_NAME);
-    return aServiceNames;
+	cssu::Sequence<OUString> aServiceNames (1);
+	aServiceNames[0] = A2S(SERVICE_NAME);
+	return aServiceNames;
 
 }
 
 
 SwPanelFactory::SwPanelFactory (void)
-    : PanelFactoryInterfaceBase(m_aMutex)
+	: PanelFactoryInterfaceBase(m_aMutex)
 {
 }
 
@@ -85,68 +87,68 @@ 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)
+	const ::rtl::OUString& rsResourceURL,
+	const ::cssu::Sequence<css::beans::PropertyValue>& rArguments)
+	throw(
+		container::NoSuchElementException,
+		lang::IllegalArgumentException,
+		RuntimeException)
 {
-    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(
-            A2S("PanelFactory::createUIElement called without ParentWindow"),
-            NULL);
-    if ( ! xFrame.is())
-        throw RuntimeException(
-            A2S("PanelFactory::createUIElement called without Frame"),
-            NULL);
-    if (pBindings == NULL)
-        throw RuntimeException(
-            A2S("PanelFactory::createUIElement called without SfxBindings"),
-            NULL);
+	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(
+			A2S("PanelFactory::createUIElement called without ParentWindow"),
+			NULL);
+	if ( ! xFrame.is())
+		throw RuntimeException(
+			A2S("PanelFactory::createUIElement called without Frame"),
+			NULL);
+	if (pBindings == NULL)
+		throw RuntimeException(
+			A2S("PanelFactory::createUIElement called without SfxBindings"),
+			NULL);
 
 #define DoesResourceEndWith(s) rsResourceURL.endsWithAsciiL(s,strlen(s))
-    if (DoesResourceEndWith("/PagePropertyPanel"))
-    {
-        PagePropertyPanel* pPanel = PagePropertyPanel::Create( pParentWindow, xFrame, pBindings );
-        xElement = sfx2::sidebar::SidebarPanelBase::Create(
-            rsResourceURL,
-            xFrame,
-            pPanel,
-            ui::LayoutSize(-1,-1,-1));
-    }
-    else if (DoesResourceEndWith("/WrapPropertyPanel"))
-    {
-        WrapPropertyPanel* pPanel = 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));
-    }
+	if (DoesResourceEndWith("/PagePropertyPanel"))
+	{
+		PagePropertyPanel* pPanel = PagePropertyPanel::Create( pParentWindow, xFrame, pBindings );
+		xElement = sfx2::sidebar::SidebarPanelBase::Create(
+			rsResourceURL,
+			xFrame,
+			pPanel,
+			ui::LayoutSize(-1,-1,-1));
+	}
+	else if (DoesResourceEndWith("/WrapPropertyPanel"))
+	{
+		WrapPropertyPanel* pPanel = 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;
+	return xElement;
 }
 
 } } // end of namespace sw::sidebar
 
-// eof
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/sw/source/ui/sidebar/WrapPropertyPanel.cxx b/main/sw/source/ui/sidebar/WrapPropertyPanel.cxx
index 5420375343..030148697f 100644
--- a/main/sw/source/ui/sidebar/WrapPropertyPanel.cxx
+++ b/main/sw/source/ui/sidebar/WrapPropertyPanel.cxx
@@ -1,5 +1,5 @@
 /**************************************************************
-* 
+*
 * 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
@@ -7,18 +7,20 @@
 * 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
-* 
+*
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
-* 
+*
 *************************************************************/
 
+
+
 #include "precompiled_sw.hxx"
 
 #include "WrapPropertyPanel.hxx"
@@ -43,51 +45,51 @@
 namespace sw { namespace sidebar {
 
 WrapPropertyPanel* WrapPropertyPanel::Create (
-    Window* pParent,
-    const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxFrame,
-    SfxBindings* pBindings)
+	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(A2S("no parent Window given to WrapPropertyPanel::Create"), NULL, 0);
-    if ( ! rxFrame.is())
-        throw ::com::sun::star::lang::IllegalArgumentException(A2S("no XFrame given to WrapPropertyPanel::Create"), NULL, 1);
-    if (pBindings == NULL)
-        throw ::com::sun::star::lang::IllegalArgumentException(A2S("no SfxBindings given to WrapPropertyPanel::Create"), NULL, 2);
-    
-    return new WrapPropertyPanel(
-        pParent,
-        rxFrame,
-        pBindings);
+	if (pParent == NULL)
+		throw ::com::sun::star::lang::IllegalArgumentException(A2S("no parent Window given to WrapPropertyPanel::Create"), NULL, 0);
+	if ( ! rxFrame.is())
+		throw ::com::sun::star::lang::IllegalArgumentException(A2S("no XFrame given to WrapPropertyPanel::Create"), NULL, 1);
+	if (pBindings == NULL)
+		throw ::com::sun::star::lang::IllegalArgumentException(A2S("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 )
-    : Control(pParent, SW_RES(RID_PROPERTYPANEL_SWOBJWRAP_PAGE))
-    , mxFrame( rxFrame )
-    , mpBindings(pBindings)
-    // visible controls
-    , mpRBNoWrap( ::sfx2::sidebar::ControlFactory::CreateCustomImageRadionButton( this, SW_RES(RB_NO_WRAP) ) )
-    , mpRBWrapLeft( ::sfx2::sidebar::ControlFactory::CreateCustomImageRadionButton( this, SW_RES(RB_WRAP_LEFT) ) )
-    , mpRBWrapRight( ::sfx2::sidebar::ControlFactory::CreateCustomImageRadionButton( this, SW_RES(RB_WRAP_RIGHT) ) )
-    , mpRBWrapParallel( ::sfx2::sidebar::ControlFactory::CreateCustomImageRadionButton( this, SW_RES(RB_WRAP_PARALLEL) ) )
-    , mpRBWrapThrough( ::sfx2::sidebar::ControlFactory::CreateCustomImageRadionButton( this, SW_RES(RB_WRAP_THROUGH) ) )
-    , mpRBIdealWrap( ::sfx2::sidebar::ControlFactory::CreateCustomImageRadionButton( this, SW_RES(RB_WRAP_IDEAL) ) )
-    // resources
-    , aWrapIL(6,2)
-    , aWrapILH(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)
+	Window* pParent,
+	const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxFrame,
+	SfxBindings* pBindings )
+	: Control(pParent, SW_RES(RID_PROPERTYPANEL_SWOBJWRAP_PAGE))
+	, mxFrame( rxFrame )
+	, mpBindings(pBindings)
+	// visible controls
+	, mpRBNoWrap( ::sfx2::sidebar::ControlFactory::CreateCustomImageRadionButton( this, SW_RES(RB_NO_WRAP) ) )
+	, mpRBWrapLeft( ::sfx2::sidebar::ControlFactory::CreateCustomImageRadionButton( this, SW_RES(RB_WRAP_LEFT) ) )
+	, mpRBWrapRight( ::sfx2::sidebar::ControlFactory::CreateCustomImageRadionButton( this, SW_RES(RB_WRAP_RIGHT) ) )
+	, mpRBWrapParallel( ::sfx2::sidebar::ControlFactory::CreateCustomImageRadionButton( this, SW_RES(RB_WRAP_PARALLEL) ) )
+	, mpRBWrapThrough( ::sfx2::sidebar::ControlFactory::CreateCustomImageRadionButton( this, SW_RES(RB_WRAP_THROUGH) ) )
+	, mpRBIdealWrap( ::sfx2::sidebar::ControlFactory::CreateCustomImageRadionButton( this, SW_RES(RB_WRAP_IDEAL) ) )
+	// resources
+	, aWrapIL(6,2)
+	, aWrapILH(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)
 {
-    Initialize();
-    FreeResource();
+	Initialize();
+	FreeResource();
 }
 
 
@@ -98,172 +100,174 @@ 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( IMG_NONE,
-                      ::GetImage( mxFrame, A2S(".uno:WrapOff"), sal_False, sal_False ) );
-    aWrapIL.AddImage( IMG_LEFT,
-                      ::GetImage( mxFrame, A2S(".uno:WrapLeft"), sal_False, sal_False ) );
-    aWrapIL.AddImage( IMG_RIGHT,
-                      ::GetImage( mxFrame, A2S(".uno:WrapRight"), sal_False, sal_False ) );
-    aWrapIL.AddImage( IMG_PARALLEL,
-                      ::GetImage( mxFrame, A2S(".uno:WrapOn"), sal_False, sal_False ) );
-    aWrapIL.AddImage( IMG_THROUGH,
-                      ::GetImage( mxFrame, A2S(".uno:WrapThrough"), sal_False, sal_False ) );
-    aWrapIL.AddImage( IMG_IDEAL,
-                      ::GetImage( mxFrame, A2S(".uno:WrapIdeal"), sal_False, sal_False ) );
-
-    aWrapILH.AddImage( IMG_NONE,
-                       ::GetImage( mxFrame, A2S(".uno:WrapOff"), sal_False, sal_True ) );
-    aWrapILH.AddImage( IMG_LEFT,
-                       ::GetImage( mxFrame, A2S(".uno:WrapLeft"), sal_False, sal_True ) );
-    aWrapILH.AddImage( IMG_RIGHT,
-                       ::GetImage( mxFrame, A2S(".uno:WrapRight"), sal_False, sal_True ) );
-    aWrapILH.AddImage( IMG_PARALLEL,
-                       ::GetImage( mxFrame, A2S(".uno:WrapOn"), sal_False, sal_True ) );
-    aWrapILH.AddImage( IMG_THROUGH,
-                       ::GetImage( mxFrame, A2S(".uno:WrapThrough"), sal_False, sal_True ) );
-    aWrapILH.AddImage( IMG_IDEAL,
-                       ::GetImage( mxFrame, A2S(".uno:WrapIdeal"), sal_False, sal_True ) );
-
-    mpRBNoWrap->SetModeRadioImage( aWrapIL.GetImage(IMG_NONE) );
-    mpRBNoWrap->SetModeRadioImage( aWrapILH.GetImage(IMG_NONE) , BMP_COLOR_HIGHCONTRAST );
-    if ( Application::GetSettings().GetLayoutRTL() )
-    {
-        mpRBWrapLeft->SetModeRadioImage( aWrapIL.GetImage(IMG_RIGHT) );
-        mpRBWrapLeft->SetModeRadioImage( aWrapILH.GetImage(IMG_RIGHT) , BMP_COLOR_HIGHCONTRAST );
-        mpRBWrapRight->SetModeRadioImage( aWrapIL.GetImage(IMG_LEFT) );
-        mpRBWrapRight->SetModeRadioImage( aWrapILH.GetImage(IMG_LEFT) , BMP_COLOR_HIGHCONTRAST );
-    }
-    else
-    {
-        mpRBWrapLeft->SetModeRadioImage( aWrapIL.GetImage(IMG_LEFT) );
-        mpRBWrapLeft->SetModeRadioImage( aWrapILH.GetImage(IMG_LEFT) , BMP_COLOR_HIGHCONTRAST );
-        mpRBWrapRight->SetModeRadioImage( aWrapIL.GetImage(IMG_RIGHT) );
-        mpRBWrapRight->SetModeRadioImage( aWrapILH.GetImage(IMG_RIGHT) , BMP_COLOR_HIGHCONTRAST );
-    }
-    mpRBWrapParallel->SetModeRadioImage( aWrapIL.GetImage(IMG_PARALLEL) );
-    mpRBWrapParallel->SetModeRadioImage( aWrapILH.GetImage(IMG_PARALLEL) , BMP_COLOR_HIGHCONTRAST );
-    mpRBWrapThrough->SetModeRadioImage( aWrapIL.GetImage(IMG_THROUGH) );
-    mpRBWrapThrough->SetModeRadioImage( aWrapILH.GetImage(IMG_THROUGH) , BMP_COLOR_HIGHCONTRAST );
-    mpRBIdealWrap->SetModeRadioImage( aWrapIL.GetImage(IMG_IDEAL) );
-    mpRBIdealWrap->SetModeRadioImage( aWrapILH.GetImage(IMG_IDEAL) , BMP_COLOR_HIGHCONTRAST );
-
-    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 );
+	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( IMG_NONE,
+					  ::GetImage( mxFrame, A2S(".uno:WrapOff"), sal_False, sal_False ) );
+	aWrapIL.AddImage( IMG_LEFT,
+					  ::GetImage( mxFrame, A2S(".uno:WrapLeft"), sal_False, sal_False ) );
+	aWrapIL.AddImage( IMG_RIGHT,
+					  ::GetImage( mxFrame, A2S(".uno:WrapRight"), sal_False, sal_False ) );
+	aWrapIL.AddImage( IMG_PARALLEL,
+					  ::GetImage( mxFrame, A2S(".uno:WrapOn"), sal_False, sal_False ) );
+	aWrapIL.AddImage( IMG_THROUGH,
+					  ::GetImage( mxFrame, A2S(".uno:WrapThrough"), sal_False, sal_False ) );
+	aWrapIL.AddImage( IMG_IDEAL,
+					  ::GetImage( mxFrame, A2S(".uno:WrapIdeal"), sal_False, sal_False ) );
+
+	aWrapILH.AddImage( IMG_NONE,
+					   ::GetImage( mxFrame, A2S(".uno:WrapOff"), sal_False, sal_True ) );
+	aWrapILH.AddImage( IMG_LEFT,
+					   ::GetImage( mxFrame, A2S(".uno:WrapLeft"), sal_False, sal_True ) );
+	aWrapILH.AddImage( IMG_RIGHT,
+					   ::GetImage( mxFrame, A2S(".uno:WrapRight"), sal_False, sal_True ) );
+	aWrapILH.AddImage( IMG_PARALLEL,
+					   ::GetImage( mxFrame, A2S(".uno:WrapOn"), sal_False, sal_True ) );
+	aWrapILH.AddImage( IMG_THROUGH,
+					   ::GetImage( mxFrame, A2S(".uno:WrapThrough"), sal_False, sal_True ) );
+	aWrapILH.AddImage( IMG_IDEAL,
+					   ::GetImage( mxFrame, A2S(".uno:WrapIdeal"), sal_False, sal_True ) );
+
+	mpRBNoWrap->SetModeRadioImage( aWrapIL.GetImage(IMG_NONE) );
+	mpRBNoWrap->SetModeRadioImage( aWrapILH.GetImage(IMG_NONE) , BMP_COLOR_HIGHCONTRAST );
+	if ( Application::GetSettings().GetLayoutRTL() )
+	{
+		mpRBWrapLeft->SetModeRadioImage( aWrapIL.GetImage(IMG_RIGHT) );
+		mpRBWrapLeft->SetModeRadioImage( aWrapILH.GetImage(IMG_RIGHT) , BMP_COLOR_HIGHCONTRAST );
+		mpRBWrapRight->SetModeRadioImage( aWrapIL.GetImage(IMG_LEFT) );
+		mpRBWrapRight->SetModeRadioImage( aWrapILH.GetImage(IMG_LEFT) , BMP_COLOR_HIGHCONTRAST );
+	}
+	else
+	{
+		mpRBWrapLeft->SetModeRadioImage( aWrapIL.GetImage(IMG_LEFT) );
+		mpRBWrapLeft->SetModeRadioImage( aWrapILH.GetImage(IMG_LEFT) , BMP_COLOR_HIGHCONTRAST );
+		mpRBWrapRight->SetModeRadioImage( aWrapIL.GetImage(IMG_RIGHT) );
+		mpRBWrapRight->SetModeRadioImage( aWrapILH.GetImage(IMG_RIGHT) , BMP_COLOR_HIGHCONTRAST );
+	}
+	mpRBWrapParallel->SetModeRadioImage( aWrapIL.GetImage(IMG_PARALLEL) );
+	mpRBWrapParallel->SetModeRadioImage( aWrapILH.GetImage(IMG_PARALLEL) , BMP_COLOR_HIGHCONTRAST );
+	mpRBWrapThrough->SetModeRadioImage( aWrapIL.GetImage(IMG_THROUGH) );
+	mpRBWrapThrough->SetModeRadioImage( aWrapILH.GetImage(IMG_THROUGH) , BMP_COLOR_HIGHCONTRAST );
+	mpRBIdealWrap->SetModeRadioImage( aWrapIL.GetImage(IMG_IDEAL) );
+	mpRBIdealWrap->SetModeRadioImage( aWrapILH.GetImage(IMG_IDEAL) , BMP_COLOR_HIGHCONTRAST );
+
+	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, sal_True );
-    mpBindings->GetDispatcher()->Execute( nSlot, SFX_CALLMODE_RECORD, &bStateItem, 0L );
-
-    return 0;
+	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, sal_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)
+	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( sal_False );
-        mpRBWrapLeft->Check( sal_False );
-        mpRBWrapRight->Check( sal_False );
-        mpRBWrapParallel->Check( sal_False );
-        mpRBWrapThrough->Check( sal_False );
-        mpRBIdealWrap->Check( sal_False );
-    }
+	(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( sal_False );
+		mpRBWrapLeft->Check( sal_False );
+		mpRBWrapRight->Check( sal_False );
+		mpRBWrapParallel->Check( sal_False );
+		mpRBWrapThrough->Check( sal_False );
+		mpRBIdealWrap->Check( sal_False );
+	}
 }
 
 } } // end of namespace ::sw::sidebar
+
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/sw/source/ui/sidebar/WrapPropertyPanel.hxx b/main/sw/source/ui/sidebar/WrapPropertyPanel.hxx
index ac18d625b1..ab9db12008 100644
--- a/main/sw/source/ui/sidebar/WrapPropertyPanel.hxx
+++ b/main/sw/source/ui/sidebar/WrapPropertyPanel.hxx
@@ -1,5 +1,5 @@
 /**************************************************************
-* 
+*
 * 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
@@ -7,18 +7,20 @@
 * 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
-* 
+*
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
-* 
+*
 *************************************************************/
 
+
+
 #ifndef SW_SIDEBAR_WRAP_PROPERTY_PANEL_HXX
 #define SW_SIDEBAR_WRAP_PROPERTY_PANEL_HXX
 
@@ -33,58 +35,60 @@
 
 namespace sw { namespace sidebar {
 
-    class WrapPropertyPanel
-        : public Control
-        , 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;
-
-        ::boost::scoped_ptr<ImageRadioButton> mpRBNoWrap;
-        ::boost::scoped_ptr<ImageRadioButton> mpRBWrapLeft;
-        ::boost::scoped_ptr<ImageRadioButton> mpRBWrapRight;
-        ::boost::scoped_ptr<ImageRadioButton> mpRBWrapParallel;
-        ::boost::scoped_ptr<ImageRadioButton> mpRBWrapThrough;
-        ::boost::scoped_ptr<ImageRadioButton> mpRBIdealWrap;
-
-        //Image resource.
-        ImageList aWrapIL;
-        ImageList aWrapILH;
-
-        //Controller 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*);
-    };
+	class WrapPropertyPanel
+		: public Control
+		, 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;
+
+		::boost::scoped_ptr<ImageRadioButton> mpRBNoWrap;
+		::boost::scoped_ptr<ImageRadioButton> mpRBWrapLeft;
+		::boost::scoped_ptr<ImageRadioButton> mpRBWrapRight;
+		::boost::scoped_ptr<ImageRadioButton> mpRBWrapParallel;
+		::boost::scoped_ptr<ImageRadioButton> mpRBWrapThrough;
+		::boost::scoped_ptr<ImageRadioButton> mpRBIdealWrap;
+
+		// Image resource
+		ImageList aWrapIL;
+		ImageList aWrapILH;
+
+		// Controller 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 noet sw=4 ts=4: */