Added: openoffice/branches/sidebar/main/sw/source/ui/sidebar/PagePropertyPanel.src URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sw/source/ui/sidebar/PagePropertyPanel.src?rev=1456629&view=auto ============================================================================== --- openoffice/branches/sidebar/main/sw/source/ui/sidebar/PagePropertyPanel.src (added) +++ openoffice/branches/sidebar/main/sw/source/ui/sidebar/PagePropertyPanel.src Thu Mar 14 20:00:19 2013 @@ -0,0 +1,698 @@ +/************************************************************** +* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* 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 <sfx2/sidebar/propertypanel.hrc> +#include "PropertyPanel.hrc" +#include "PagePropertyPanel.hrc" +#include "helpid.h" + +// page property panel control +Control RID_PROPERTYPANEL_SWPAGE +{ + OutputSize = TRUE; + DialogControl = TRUE; + Border = FALSE; + Size = MAP_APPFONT( PROPERTYPAGE_WIDTH, PAGE_HEIGHT ); + HelpID = HID_PROPERTYPANEL_SWPAGE_SECTION; + Text = "Page"; + + FixedText FT_ORIENTATION + { + Pos = MAP_APPFONT ( FT_ORIENTATION_X, FT_ORIENTATION_Y ); + Size = MAP_APPFONT ( MBOX_WIDTH, TEXT_HEIGHT) ; + Text [ en-US ] = "~Orientation:"; + }; + ToolBox TB_ORIENTATION + { + Pos = MAP_APPFONT (TBX_ORIENTATION_X, TBX_ORIENTATION_Y) ; + HelpID = HID_SWPAGE_ORIENTATION; + SVLook = TRUE ; + TabStop = TRUE ; + Text = "Orientation" ; + ItemList = + { + ToolBoxItem + { + HelpID = HID_SWPAGE_TBI_ORIENTATION; + Identifier = TBI_ORIENTATION ; + Text [ en-US ] = "Orientation" ; + DropDown = TRUE ; + }; + }; + }; + String STR_QHELP_TB_ORIENTATION + { + Text [ en-US ] = "Select the paper orientation - vertically (portrait) or horizontally (landscape) - for the current page style."; + }; + + FixedText FT_MARGIN + { + Pos = MAP_APPFONT ( FT_MARGIN_X, FT_MARGIN_Y ); + Size = MAP_APPFONT ( MBOX_WIDTH + 50, TEXT_HEIGHT) ; + Text [ en-US ] = "~Margin:"; + }; + ToolBox TB_MARGIN + { + SVLook = TRUE ; + Pos = MAP_APPFONT (TBX_MARGIN_X, TBX_MARGIN_Y) ; + HelpID = HID_SWPAGE_MARGIN; + TabStop = TRUE ; + Text = "Margin" ; + ItemList = + { + ToolBoxItem + { + HelpID = HID_SWPAGE_TBI_MARGIN; + Identifier = TBI_MARGIN ; + Text [ en-US ] = "Margin" ; + DropDown = TRUE ; + }; + }; + }; + String STR_QHELP_TB_MARGIN + { + Text [ en-US ] = "Select the margin values for the current page style."; + }; + + FixedText FT_SIZE + { + Pos = MAP_APPFONT ( FT_SIZE_X, FT_SIZE_Y ); + Size = MAP_APPFONT ( MBOX_WIDTH, TEXT_HEIGHT) ; + Text [ en-US ] = "~Size:"; + }; + ToolBox TB_SIZE + { + SVLook = TRUE ; + Pos = MAP_APPFONT ( TBX_SIZE_X , TBX_SIZE_Y ) ; + HelpID = HID_SWPAGE_SIZE; + TabStop = TRUE ; + Text = "Size" ; + ItemList = + { + ToolBoxItem + { + HelpID = HID_SWPAGE_TBI_SIZE; + Identifier = TBI_SIZE ; + Text [ en-US ] = "Size" ; + DropDown = TRUE ; + }; + }; + }; + String STR_QHELP_TB_SIZE + { + Text [ en-US ] = "Select a predefined paper size for the current page style."; + }; + + FixedText FT_COLUMN + { + Pos = MAP_APPFONT ( FT_COLUMN_X, FT_COLUMN_Y ); + Size = MAP_APPFONT ( MBOX_WIDTH + 50, TEXT_HEIGHT) ; + Text [ en-US ] = "~Column:"; + }; + ToolBox TB_COLUMN + { + SVLook = TRUE ; + Pos = MAP_APPFONT ( TBX_COLUMN_X , TBX_COLUMN_Y ) ; + HelpID = HID_SWPAGE_COLUMN; + TabStop = TRUE ; + Text = "Column" ; + ItemList = + { + ToolBoxItem + { + HelpID = HID_SWPAGE_TBI_COLUMN; + Identifier = TBI_COLUMN; + Text [ en-US ] = "Column" ; + DropDown = TRUE ; + }; + }; + }; + String STR_QHELP_TB_COLUMN + { + Text [ en-US ] = "Select the layout and the number of columns for the current page style."; + }; + + Image IMG_PAGE_PORTRAIT + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/portraitcopy_24x24.png";}; + }; + Image IMG_PAGE_LANDSCAPE + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/Landscapecopy_24x24.png";}; + }; + Image IMG_PAGE_NARROW + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/format_L_narrow_24x24.png";}; + }; + Image IMG_PAGE_NORMAL + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/format_L_nomal_24x24.png";}; + }; + Image IMG_PAGE_WIDE + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/format_L_wide_24x24.png";}; + }; + Image IMG_PAGE_MIRRORED + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/format_L_mirror_24x24.png";}; + }; + Image IMG_PAGE_MARGIN_CUSTOM + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/format_L_copy_24x24.png";}; + }; + Image IMG_PAGE_NARROW_L + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/formatnarrow_24x24.png";}; + }; + Image IMG_PAGE_NORMAL_L + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/formatnormal_24x24.png";}; + }; + Image IMG_PAGE_WIDE_L + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/formatwide_24x24.png";}; + }; + Image IMG_PAGE_MIRRORED_L + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/formatmirror_24x24.png";}; + }; + Image IMG_PAGE_MARGIN_CUSTOM_L + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/formatcopy_24x24.png";}; + }; + Image IMG_PAGE_A3 + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/documentsize_L_A3_24x24.png";}; + }; + Image IMG_PAGE_A4 + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/documentsize_L_A4_24x24.png";}; + }; + Image IMG_PAGE_A5 + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/documentsize_L_A5_24x24.png";}; + }; + Image IMG_PAGE_B4 + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/documentsize_L_B4_24x24.png";}; + }; + Image IMG_PAGE_B5 + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/documentsize_L_B5_24x24.png";}; + }; + Image IMG_PAGE_C5 + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/documentsize_L_C5_24x24.png";}; + }; + Image IMG_PAGE_LETTER + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/documentsize_L_copy_24x24.png";}; + }; + Image IMG_PAGE_LEGAL + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/documentsize_L_copy_24x24.png";}; + }; + Image IMG_PAGE_SIZE_NONE + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/documentsize_L_copy_24x24.png";}; + }; + Image IMG_PAGE_A3_L + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/documentsizeA3_24x24.png";}; + }; + Image IMG_PAGE_A4_L + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/documentsizeA4_24x24.png";}; + }; + Image IMG_PAGE_A5_L + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/documentsizeA5_24x24.png";}; + }; + Image IMG_PAGE_B4_L + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/documentsizeB4_24x24.png";}; + }; + Image IMG_PAGE_B5_L + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/documentsizeB5_24x24.png";}; + }; + Image IMG_PAGE_C5_L + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/documentsizeC5_24x24.png";}; + }; + Image IMG_PAGE_LETTER_L + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/documentsizecopy_24x24.png";}; + }; + Image IMG_PAGE_LEGAL_L + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/documentsizecopy_24x24.png";}; + }; + Image IMG_PAGE_SIZE_NONE_L + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/documentsizecopy_24x24.png";}; + }; + Image IMG_PAGE_COLUMN_1 + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/column_L_1_24x24.png";}; + }; + Image IMG_PAGE_COLUMN_2 + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/column_L_2_24x24.png";}; + }; + Image IMG_PAGE_COLUMN_3 + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/column_L_3_24x24.png";}; + }; + Image IMG_PAGE_COLUMN_LEFT + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/column_L_left_24x24.png";}; + }; + Image IMG_PAGE_COLUMN_RIGHT + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/column_L_right_24x24.png";}; + }; + Image IMG_PAGE_COLUMN_NONE + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/column_L_copy_24x24.png";}; + }; + Image IMG_PAGE_COLUMN_1_L + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/column1_24x24.png";}; + }; + Image IMG_PAGE_COLUMN_2_L + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/column2_24x24.png";}; + }; + Image IMG_PAGE_COLUMN_3_L + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/column3_24x24.png";}; + }; + Image IMG_PAGE_COLUMN_LEFT_L + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/columnleft_24x24.png";}; + }; + Image IMG_PAGE_COLUMN_RIGHT_L + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/columnright_24x24.png";}; + }; + Image IMG_PAGE_COLUMN_NONE_L + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/columncopy_24x24.png";}; + }; +}; + +// popup for page orientation attribute +Control RID_POPUP_SWPAGE_ORIENTATION +{ + OutputSize = TRUE; + DialogControl = TRUE; + Border = FALSE; + Size = MAP_APPFONT( POPUPPANEL_MARGIN_SMALL * 2 + POPUP_BORDER_WIDTH + VS_WIDTH, ITEM_HEIGHT*2 + POPUPPANEL_MARGIN_SMALL*2 ); + + Control VS_ORIENTATION + { + Pos = MAP_APPFONT( POPUPPANEL_MARGIN_SMALL + OFFSET_X, POPUPPANEL_MARGIN_SMALL + OFFSET_Y); + Size = MAP_APPFONT ( VS_WIDTH , ITEM_HEIGHT*2); + HelpID = HID_SWPAGE_VS_ORIENTATION; + TabStop = TRUE ; + Text = "Orientation"; + }; + Image IMG_PORTRAIT + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/portraitcopy_24x24.png";}; + }; + Image IMG_LANDSCAPE + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/Landscapecopy_24x24.png";}; + }; + String STR_PORTRAIT + { + Text [ en-US ] = "Portrait"; + }; + String STR_LANDSCAPE + { + Text [ en-US ] = "Landscape"; + }; +}; + +// popup for page style's margin attributes +Control RID_POPUP_SWPAGE_MARGIN +{ + OutputSize = TRUE; + DialogControl = TRUE; + Border = FALSE; + Size = MAP_APPFONT( POPUPPANEL_MARGIN_SMALL * 2 + POPUP_BORDER_WIDTH + VS_WIDTH, MARGIN_PANEL_HEIGHT ); + + Control VS_MARGIN + { + Pos = MAP_APPFONT( POPUPPANEL_MARGIN_SMALL + OFFSET_X, POPUPPANEL_MARGIN_SMALL + OFFSET_Y ); + Size = MAP_APPFONT ( VS_WIDTH , ITEM_HEIGHT*5); + HelpID = HID_SWPAGE_VS_MARGIN; + TabStop = TRUE ; + Text = "Margin"; + }; + FixedText FT_CUSTOM + { + Pos = MAP_APPFONT ( FT_CUSTOM_X, FT_CUSTOM_Y ); + Size = MAP_APPFONT ( MBOX_WIDTH + 30, TEXT_HEIGHT) ; + Text [ en-US ] = "Custom:"; + }; + FixedText FT_LEFT + { + Pos = MAP_APPFONT ( FT_X, FT_LEFT_Y ); + Size = MAP_APPFONT ( 25, TEXT_HEIGHT) ; + Text [ en-US ] = "~Left:"; + }; + FixedText FT_INNER + { + Pos = MAP_APPFONT ( FT_X, FT_LEFT_Y ); + Size = MAP_APPFONT ( 25, TEXT_HEIGHT) ; + Text [ en-US ] = "I~nner:"; + }; + MetricField MF_SWLEFT_MARGIN + { + Border = TRUE; + Pos = MAP_APPFONT ( MF_X , LEFT_MF_Y ); + Size = MAP_APPFONT ( MBOX_WIDTH - 12, MBOX_HEIGHT ); + HelpID = HID_SWPAGE_LEFT_MARGIN; + Left = TRUE; + Repeat = TRUE; + Spin = TRUE; + Maximum = 9999; + DecimalDigits = 2; + Unit = FUNIT_CM; + Last = 9999; + SpinSize = 10; + }; + FixedText FT_RIGHT + { + Pos = MAP_APPFONT ( FT_X, FT_RIGHT_Y ); + Size = MAP_APPFONT ( 25, TEXT_HEIGHT) ; + Text [ en-US ] = "~Right:"; + }; + FixedText FT_OUTER + { + Pos = MAP_APPFONT ( FT_X, FT_RIGHT_Y ); + Size = MAP_APPFONT ( 25, TEXT_HEIGHT) ; + Text [ en-US ] = "O~uter:"; + }; + MetricField MF_SWRIGHT_MARGIN + { + Border = TRUE; + Pos = MAP_APPFONT ( MF_X , RIGHT_MF_Y ); + Size = MAP_APPFONT ( MBOX_WIDTH - 12, MBOX_HEIGHT ); + HelpID = HID_SWPAGE_RIGHT_MARGIN; + Left = TRUE; + Repeat = TRUE; + Spin = TRUE; + Maximum = 9999; + DecimalDigits = 2; + Unit = FUNIT_CM; + Last = 9999; + SpinSize = 10; + }; + FixedText FT_TOP + { + Pos = MAP_APPFONT ( FT_X, FT_TOP_Y ); + Size = MAP_APPFONT ( 25, TEXT_HEIGHT) ; + Text [ en-US ] = "~Top:"; + }; + MetricField MF_SWTOP_MARGIN + { + Border = TRUE; + Pos = MAP_APPFONT ( MF_X , TOP_MF_Y ); + Size = MAP_APPFONT ( MBOX_WIDTH - 12, MBOX_HEIGHT ); + HelpID = HID_SWPAGE_TOP_MARGIN; + Left = TRUE; + Repeat = TRUE; + Spin = TRUE; + Maximum = 9999; + DecimalDigits = 2; + Unit = FUNIT_CM; + Last = 9999; + SpinSize = 10; + }; + FixedText FT_BOTTOM + { + Pos = MAP_APPFONT ( FT_X, FT_BOTTOM_Y ); + Size = MAP_APPFONT ( 25, TEXT_HEIGHT) ; + Text [ en-US ] = "~Bottom:"; + }; + MetricField MF_SWBOTTOM_MARGIN + { + Border = TRUE; + Pos = MAP_APPFONT ( MF_X , BOTTOM_MF_Y ); + Size = MAP_APPFONT ( MBOX_WIDTH - 12, MBOX_HEIGHT ); + HelpID = HID_SWPAGE_BOTTOM_MARGIN; + Left = TRUE; + Repeat = TRUE; + Spin = TRUE; + Maximum = 9999; + DecimalDigits = 2; + Unit = FUNIT_CM; + Last = 9999; + SpinSize = 10; + }; + MetricField FLD_WIDTH_HEIGHT + { + Border = TRUE; + Left = TRUE; + Repeat = TRUE; + Spin = TRUE; + Maximum = 9999; + DecimalDigits = 2; + Unit = FUNIT_CM; + Last = 9999; + SpinSize = 10; + }; + + Image IMG_NARROW + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/format_L_narrow_24x24.png";}; + }; + Image IMG_NORMAL + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/format_L_nomal_24x24.png";}; + }; + Image IMG_WIDE + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/format_L_wide_24x24.png";}; + }; + Image IMG_MIRRORED + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/format_L_mirror_24x24.png";}; + }; + Image IMG_NARROW_L + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/formatnarrow_24x24.png";}; + }; + Image IMG_NORMAL_L + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/formatnormal_24x24.png";}; + }; + Image IMG_WIDE_L + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/formatwide_24x24.png";}; + }; + Image IMG_MIRRORED_L + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/formatmirror_24x24.png";}; + }; + Image IMG_CUSTOM + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/last_custom_common.png";}; + }; + Image IMG_CUSTOM_DIS + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/last_custom_common_grey.png";}; + }; + String STR_LCVALUE + { + Text [ en-US ] = "Last Custom Value"; + }; + String STR_NARROW + { + Text [ en-US ] = "Narrow"; + }; + String STR_NORMAL + { + Text [ en-US ] = "Normal"; + }; + String STR_WIDE + { + Text [ en-US ] = "Wide"; + }; + String STR_MIRRORED + { + Text [ en-US ] = "Mirrored"; + }; + String STR_MARGIN_TOOLTIP_LEFT + { + Text [ en-US ] = "Left: "; + }; + String STR_MARGIN_TOOLTIP_RIGHT + { + Text [ en-US ] = ". Right: "; + }; + String STR_MARGIN_TOOLTIP_INNER + { + Text [ en-US ] = "Inner: "; + }; + String STR_MARGIN_TOOLTIP_OUTER + { + Text [ en-US ] = ". Outer: "; + }; + String STR_MARGIN_TOOLTIP_TOP + { + Text [ en-US ] = ". Top: "; + }; + String STR_MARGIN_TOOLTIP_BOT + { + Text [ en-US ] = ". Bottom: "; + }; +}; + +// popup for page style's page size +Control RID_POPUP_SWPAGE_SIZE +{ + OutputSize = TRUE; + DialogControl = TRUE; + Border = FALSE; + Size = MAP_APPFONT( POPUPPANEL_MARGIN_SMALL * 2 + POPUP_BORDER_WIDTH + VS_WIDTH + 22, ITEM_HEIGHT2*8 + POPUPPANEL_MARGIN_SMALL*2 + CONTROL_SPACING_VERTICAL + 15 ); + + Control VS_SIZE + { + Pos = MAP_APPFONT( POPUPPANEL_MARGIN_SMALL + OFFSET_X, POPUPPANEL_MARGIN_SMALL + OFFSET_Y); + Size = MAP_APPFONT ( VS_WIDTH + 22 , ITEM_HEIGHT2*8); + HelpID = HID_SWPAGE_VS_SIZE; + TabStop = TRUE ; + Text = "Size"; + }; + PushButton CB_SIZE_MORE + { + Pos = MAP_APPFONT ( POPUPPANEL_MARGIN_SMALL + 2*OFFSET_X, POPUPPANEL_MARGIN_SMALL + 2*OFFSET_Y + ITEM_HEIGHT2*8 ) ; + Size = MAP_APPFONT ( VS_WIDTH - 2 + 22, 15 ) ; + HelpID = HID_SWPAGE_SIZE_MORE; + TabStop = TRUE ; + Text [ en-US ] = "~More Options"; + QuickHelpText [ en-US ] = "More Options" ; + }; + MetricField FLD_WIDTH_HEIGHT + { + Border = TRUE; + Left = TRUE; + Repeat = TRUE; + Spin = TRUE; + Maximum = 9999; + DecimalDigits = 2; + Unit = FUNIT_CM; + Last = 9999; + SpinSize = 10; + }; +}; + +// popup for page style's column attribute +Control RID_POPUP_SWPAGE_COLUMN +{ + OutputSize = TRUE; + DialogControl = TRUE; + Border = FALSE; + Size = MAP_APPFONT( POPUPPANEL_MARGIN_SMALL * 2 + POPUP_BORDER_WIDTH + VS_WIDTH - 15, ITEM_HEIGHT*5 + POPUPPANEL_MARGIN_SMALL*2 + CONTROL_SPACING_VERTICAL + 15 ); + + Control VS_COLUMN + { + Pos = MAP_APPFONT( POPUPPANEL_MARGIN_SMALL + OFFSET_X, POPUPPANEL_MARGIN_SMALL + OFFSET_Y); + Size = MAP_APPFONT ( VS_WIDTH -15 , ITEM_HEIGHT*5); + HelpID = HID_SWPAGE_VS_COLUMN; + TabStop = TRUE ; + Text = "Column"; + }; + PushButton CB_COLUMN_MORE + { + Pos = MAP_APPFONT ( POPUPPANEL_MARGIN_SMALL + 2*OFFSET_X, POPUPPANEL_MARGIN_SMALL + 2*OFFSET_Y + ITEM_HEIGHT*5 ) ; + Size = MAP_APPFONT ( VS_WIDTH - 2 - 15, 15 ) ; + HelpID = HID_SWPAGE_COLUMN_MORE; + TabStop = TRUE ; + Text [ en-US ] = "~More Options"; + QuickHelpText [ en-US ] = "More Options" ; + }; + Image IMG_ONE + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/column_L_1_24x24.png";}; + }; + Image IMG_TWO + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/column_L_2_24x24.png";}; + }; + Image IMG_THREE + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/column_L_3_24x24.png";}; + }; + Image IMG_LEFT + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/column_L_left_24x24.png";}; + }; + Image IMG_RIGHT + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/column_L_right_24x24.png";}; + }; + Image IMG_ONE_L + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/column1_24x24.png";}; + }; + Image IMG_TWO_L + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/column2_24x24.png";}; + }; + Image IMG_THREE_L + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/column3_24x24.png";}; + }; + Image IMG_LEFT_L + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/columnleft_24x24.png";}; + }; + Image IMG_RIGHT_L + { + ImageBitmap = Bitmap{File = "sidebar/pageproppanel/columnright_24x24.png";}; + }; + String STR_ONE + { + Text [ en-US ] = "1 Column"; + }; + String STR_TWO + { + Text [ en-US ] = "2 Columns"; + }; + String STR_THREE + { + Text [ en-US ] = "3 Columns"; + }; + String STR_LEFT + { + Text [ en-US ] = "Left"; + }; + String STR_RIGHT + { + Text [ en-US ] = "Right"; + }; +};
Added: openoffice/branches/sidebar/main/sw/source/ui/sidebar/PageSizeControl.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sw/source/ui/sidebar/PageSizeControl.cxx?rev=1456629&view=auto ============================================================================== --- openoffice/branches/sidebar/main/sw/source/ui/sidebar/PageSizeControl.cxx (added) +++ openoffice/branches/sidebar/main/sw/source/ui/sidebar/PageSizeControl.cxx Thu Mar 14 20:00:19 2013 @@ -0,0 +1,182 @@ +/************************************************************** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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" +#include "PagePropertyPanel.hxx" +#include "PagePropertyPanel.hrc" + +#include <cmdid.h> +#include <swtypes.hxx> + +#include <svx/sidebar/ValueSetWithTextControl.hxx> + +#include <tools/inetmime.hxx> + +namespace sw { namespace sidebar { + +PageSizeControl::PageSizeControl( + Window* pParent, + PagePropertyPanel& rPanel, + const Paper ePaper, + const sal_Bool bLandscape, + const FieldUnit eFUnit ) + : ::svx::sidebar::PopupControl( pParent, SW_RES(RID_POPUP_SWPAGE_SIZE) ) + , mpSizeValueSet( new ::svx::sidebar::ValueSetWithTextControl( ::svx::sidebar::ValueSetWithTextControl::TEXT_TEXT, this, SW_RES(VS_SIZE) ) ) + , maMoreButton( this, SW_RES(CB_SIZE_MORE) ) + , maWidthHeightField( this, SW_RES(FLD_WIDTH_HEIGHT) ) + , mePaper( ePaper ) + , maPaperList() + , mrPagePropPanel(rPanel) +{ + maWidthHeightField.Hide(); + SetFieldUnit( maWidthHeightField, eFUnit ); + + maPaperList.push_back( PAPER_A3 ); + maPaperList.push_back( PAPER_A4 ); + maPaperList.push_back( PAPER_A5 ); + maPaperList.push_back( PAPER_B4_ISO ); + maPaperList.push_back( PAPER_B5_ISO ); + maPaperList.push_back( PAPER_ENV_C5 ); + maPaperList.push_back( PAPER_LETTER ); + maPaperList.push_back( PAPER_LEGAL ); + + mpSizeValueSet->SetStyle( mpSizeValueSet->GetStyle() | WB_3DLOOK | WB_NO_DIRECTSELECT ); + mpSizeValueSet->SetColor( GetSettings().GetStyleSettings().GetMenuColor() ); + + sal_uInt16 nSelectedItem = 0; + { + 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 = HeightStr; + ItemText2 += String::CreateFromAscii(" x "); + ItemText2 += WidthStr; + 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; +} + + +IMPL_LINK(PageSizeControl, ImplSizeHdl, void *, pControl) +{ + mpSizeValueSet->SetNoSelection(); + if ( pControl == mpSizeValueSet ) + { + const sal_uInt16 nSelectedPaper = mpSizeValueSet->GetSelectItemId(); + const Paper ePaper = maPaperList[nSelectedPaper - 1]; + if ( ePaper != mePaper ) + { + mePaper = ePaper; + mrPagePropPanel.ExecuteSizeChange( mePaper ); + } + } + + mrPagePropPanel.ClosePageSizePopup(); + return 0; +} + +IMPL_LINK(PageSizeControl, MoreButtonClickHdl_Impl, void *, EMPTYARG) +{ + mrPagePropPanel.GetBindings()->GetDispatcher()->Execute( FN_FORMAT_PAGE_SETTING_DLG, SFX_CALLMODE_ASYNCHRON ); + + mrPagePropPanel.ClosePageSizePopup(); + return 0; +} + + +} } // end of namespace sw::sidebar + Added: openoffice/branches/sidebar/main/sw/source/ui/sidebar/PageSizeControl.hxx URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sw/source/ui/sidebar/PageSizeControl.hxx?rev=1456629&view=auto ============================================================================== --- openoffice/branches/sidebar/main/sw/source/ui/sidebar/PageSizeControl.hxx (added) +++ openoffice/branches/sidebar/main/sw/source/ui/sidebar/PageSizeControl.hxx Thu Mar 14 20:00:19 2013 @@ -0,0 +1,71 @@ +/************************************************************** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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_ + +#include <svx/sidebar/PopupControl.hxx> + +#include <i18npool/paper.hxx> + +#include <vcl/button.hxx> + +#include <vector> + +namespace svx { namespace sidebar { + class ValueSetWithTextControl; +} } + +namespace sw { namespace sidebar { + +class PagePropertyPanel; + + +class PageSizeControl + : public ::svx::sidebar::PopupControl +{ +public: + PageSizeControl( + Window* pParent, + PagePropertyPanel& rPanel, + const Paper ePaper, + const sal_Bool bLandscape, + const FieldUnit eFUnit ); + ~PageSizeControl(void); + +private: + ::svx::sidebar::ValueSetWithTextControl* mpSizeValueSet; + PushButton maMoreButton; + // hidden metric field + MetricField maWidthHeightField; + + Paper mePaper; + ::std::vector< Paper > maPaperList; + + PagePropertyPanel& mrPagePropPanel; + + DECL_LINK(ImplSizeHdl, void*); + DECL_LINK(MoreButtonClickHdl_Impl, void*); +}; + +} } // end of namespace sw::sidebar + +#endif Added: openoffice/branches/sidebar/main/sw/source/ui/sidebar/PropertyPanel.hrc URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sw/source/ui/sidebar/PropertyPanel.hrc?rev=1456629&view=auto ============================================================================== --- openoffice/branches/sidebar/main/sw/source/ui/sidebar/PropertyPanel.hrc (added) +++ openoffice/branches/sidebar/main/sw/source/ui/sidebar/PropertyPanel.hrc Thu Mar 14 20:00:19 2013 @@ -0,0 +1,37 @@ +/************************************************************************ + * + * Licensed Materials - Property of IBM. + * (C) Copyright IBM Corporation 2003, 2012. All Rights Reserved. + * U.S. Government Users Restricted Rights: + * Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. + * + ************************************************************************/ + +// + +#ifndef _SW_PROPERTY_SECTION_HRC +#define _SW_PROPERTY_SECTION_HRC + +#include "rcid.hrc" + +#define RID_PROPERTYPANEL_SWOBJWRAP_PAGE (RC_PROPERTYPANEL_BEGIN + 1) +//Added +#define RID_PROPERTYPANEL_SWPAGE (RC_PROPERTYPANEL_BEGIN + 2) +#define RID_POPUP_SWPAGE_MARGIN (RC_PROPERTYPANEL_BEGIN + 3) +#define RID_POPUP_SWPAGE_ORIENTATION (RC_PROPERTYPANEL_BEGIN + 4) +#define RID_POPUP_SWPAGE_COLUMN (RC_PROPERTYPANEL_BEGIN + 5) +#define RID_POPUP_SWPAGE_SIZE (RC_PROPERTYPANEL_BEGIN + 6) +//End of new code + +#define RID_STR_PANELDOCK_MODELDESIGN (RC_PROPERTYPANEL_BEGIN + 1) +#define RID_STR_PANELDOCK_MEDIAPLAYER (RC_PROPERTYPANEL_BEGIN + 2) + +#define PROPERTY_SECTION_END RID_IL_PANELDOCK_MENU_SW + +#if PROPERTY_SECTION_END > RC_PROPERTYPANEL_END +#error Resource-Id Ueberlauf in #file, #line +#endif + +#endif + + Added: openoffice/branches/sidebar/main/sw/source/ui/sidebar/SwPanelFactory.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sw/source/ui/sidebar/SwPanelFactory.cxx?rev=1456629&view=auto ============================================================================== --- openoffice/branches/sidebar/main/sw/source/ui/sidebar/SwPanelFactory.cxx (added) +++ openoffice/branches/sidebar/main/sw/source/ui/sidebar/SwPanelFactory.cxx Thu Mar 14 20:00:19 2013 @@ -0,0 +1,133 @@ +/************************************************************** + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * 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" + +#include <PagePropertyPanel.hxx> + +#include <sfx2/sidebar/SidebarPanelBase.hxx> +#include <sfx2/sfxbasecontroller.hxx> +#include <toolkit/helper/vclunohelper.hxx> +#include <vcl/window.hxx> +#include <rtl/ref.hxx> +#include <comphelper/namedvaluecollection.hxx> + +#include <boost/bind.hpp> + + +using namespace css; +using namespace cssu; +using ::rtl::OUString; + + +namespace sw { namespace sidebar { + +#define A2S(s) ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s)) +#define IMPLEMENTATION_NAME "org.apache.openoffice.comp.sw.sidebar.SwPanelFactory" +#define SERVICE_NAME "com.sun.star.ui.UIElementFactory" + + +::rtl::OUString SAL_CALL SwPanelFactory::getImplementationName (void) +{ + return A2S(IMPLEMENTATION_NAME); +} + + +cssu::Reference<cssu::XInterface> SAL_CALL SwPanelFactory::createInstance( + 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; +} + + +cssu::Sequence<OUString> SAL_CALL SwPanelFactory::getSupportedServiceNames (void) +{ + cssu::Sequence<OUString> aServiceNames (1); + aServiceNames[0] = A2S(SERVICE_NAME); + return aServiceNames; + +} + + +SwPanelFactory::SwPanelFactory (void) + : PanelFactoryInterfaceBase(m_aMutex) +{ +} + + +SwPanelFactory::~SwPanelFactory (void) +{ +} + + +Reference<ui::XUIElement> SAL_CALL SwPanelFactory::createUIElement ( + const ::rtl::OUString& rsResourceURL, + const ::cssu::Sequence<css::beans::PropertyValue>& rArguments) + throw( + container::NoSuchElementException, + lang::IllegalArgumentException, + RuntimeException) +{ + 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, + ::boost::bind(&PagePropertyPanel::ShowPageStyleFormatDialog, pPanel), + ui::LayoutSize(-1,-1,-1)); + } +#undef DoesResourceEndWith + + return xElement; +} + +} } // end of namespace sw::sidebar + +// eof Modified: openoffice/branches/sidebar/main/sw/source/ui/uiview/viewtab.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sw/source/ui/uiview/viewtab.cxx?rev=1456629&r1=1456628&r2=1456629&view=diff ============================================================================== --- openoffice/branches/sidebar/main/sw/source/ui/uiview/viewtab.cxx (original) +++ openoffice/branches/sidebar/main/sw/source/ui/uiview/viewtab.cxx Thu Mar 14 20:00:19 2013 @@ -558,6 +558,63 @@ void SwView::ExecTabWin( SfxRequest& rRe } } break; + case SID_ATTR_SWPAGE_COLUMN: + { + const SfxInt16Item aColumnItem( (const SfxInt16Item&)rReq.GetArgs()->Get(nSlot) ); + const sal_uInt16 nPageColumnType = aColumnItem.GetValue(); + + // nPageColumnType = + // 1 - single-columned page + // 2 - two-columned page + // 3 - three-columned page + // 4 - two-columned page with left column width of 2/3 of page width + // 5 - two-columned page with right column width of 2/3 of page width + + sal_uInt16 nCount = 2; + if ( nPageColumnType == 1 ) + { + nCount = 0; + } + else if ( nPageColumnType == 3 ) + { + nCount = 3; + } + + const sal_uInt16 nGutterWidth = 0; + + const SvxLRSpaceItem aLR( rDesc.GetMaster().GetLRSpace() ); + const long nLeft = aLR.GetLeft(); + const long nRight = aLR.GetRight(); + const long nWidth = nPageWidth - nLeft - nRight; + + SwFmtCol aCols( rDesc.GetMaster().GetCol() ); + aCols.Init( nCount, nGutterWidth, nWidth ); + aCols.SetWishWidth( nWidth ); + aCols.SetGutterWidth( nGutterWidth, nWidth ); + aCols.SetOrtho( sal_False, nGutterWidth, nWidth ); + + long nColumnLeft = 0; + long nColumnRight = 0; + if ( nPageColumnType == 4 ) + { + nColumnRight = (long)(nWidth/3); + nColumnLeft = nWidth - nColumnRight; + aCols.GetColumns()[0]->SetWishWidth( nColumnLeft ); + aCols.GetColumns()[1]->SetWishWidth( nColumnRight ); + } + else if ( nPageColumnType == 5 ) + { + nColumnLeft = (long)(nWidth/3); + nColumnRight = nWidth - nColumnLeft; + aCols.GetColumns()[0]->SetWishWidth( nColumnLeft ); + aCols.GetColumns()[1]->SetWishWidth( nColumnRight ); + } + + SwPageDesc aDesc( rDesc ); + aDesc.GetMaster().SetFmtAttr( aCols ); + rSh.ChgPageDesc( rSh.GetCurPageDesc(), aDesc ); + } + break; case SID_ATTR_TABSTOP_VERTICAL: case SID_ATTR_TABSTOP: { @@ -958,10 +1015,47 @@ void SwView::StateTabWin(SfxItemSet& rSe sal_uInt16 nWhich = aIter.FirstWhich(); sal_Bool bPutContentProtection = sal_False; - while ( nWhich ) - { - switch ( nWhich ) - { + while ( nWhich ) + { + switch ( nWhich ) + { + case SID_ATTR_SWPAGE_COLUMN: + { + sal_uInt16 nColumnType = 0; + + const SwFrmFmt& rMaster = rDesc.GetMaster(); + SwFmtCol aCol(rMaster.GetCol()); + const sal_uInt16 nCols = aCol.GetNumCols(); + if ( nCols == 0 ) + { + nColumnType = 1; + } + else if ( nCols == 2 ) + { + const sal_uInt16 nColLeft = aCol.CalcPrtColWidth(0, aCol.GetWishWidth()); + const sal_uInt16 nColRight = aCol.CalcPrtColWidth(1, aCol.GetWishWidth()); + + if ( abs(nColLeft - nColRight) <= 10 ) + { + nColumnType = 2; + } + else if( abs(nColLeft - nColRight*2) < 20 ) + { + nColumnType = 4; + } + else if( abs(nColLeft*2 - nColRight) < 20 ) + { + nColumnType = 5; + } + } + else if( nCols == 3 ) + { + nColumnType = 3; + } + + rSet.Put( SfxInt16Item( SID_ATTR_SWPAGE_COLUMN, nColumnType ) ); + } + break; // case RES_LR_SPACE: // case SID_ATTR_LRSPACE: case SID_ATTR_LONG_LRSPACE: Modified: openoffice/branches/sidebar/main/sw/source/ui/uno/unofreg.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sw/source/ui/uno/unofreg.cxx?rev=1456629&r1=1456628&r2=1456629&view=diff ============================================================================== --- openoffice/branches/sidebar/main/sw/source/ui/uno/unofreg.cxx (original) +++ openoffice/branches/sidebar/main/sw/source/ui/uno/unofreg.cxx Thu Mar 14 20:00:19 2013 @@ -124,7 +124,6 @@ extern uno::Sequence< OUString > SAL_CAL extern OUString SAL_CALL SwXMailMerge_getImplementationName() throw(); extern uno::Reference< uno::XInterface > SAL_CALL SwXMailMerge_createInstance(const uno::Reference< XMultiServiceFactory > & rSMgr) throw( uno::Exception ); -// --> OD 2007-05-24 #i73788# #include "cppuhelper/implementationentry.hxx" namespace comp_FinalThreadManager { @@ -135,7 +134,8 @@ com::sun::star::uno::Reference< com::sun com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > const & context ); } -// <-- + +#include "SwPanelFactory.hxx" // #ifdef __cplusplus @@ -144,10 +144,10 @@ extern "C" #endif SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( - const sal_Char ** ppEnvTypeName, + const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) { - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; + *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } static ::cppu::ImplementationEntry const entries[] = { @@ -159,155 +159,155 @@ static ::cppu::ImplementationEntry const }; SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( - const sal_Char * pImplName, - void * pServiceManager, + const sal_Char * pImplName, + void * pServiceManager, void * pRegistryKey ) { - void * pRet = 0; - if( pServiceManager ) - { - uno::Reference< XMultiServiceFactory > xMSF( - reinterpret_cast< XMultiServiceFactory * >( pServiceManager ) ); - - uno::Reference< XSingleServiceFactory > xFactory; - - const sal_Int32 nImplNameLen = strlen( pImplName ); - if( SwXMLImport_getImplementationName().equalsAsciiL( pImplName, - nImplNameLen ) ) - { - xFactory = ::cppu::createSingleFactory( xMSF, - SwXMLImport_getImplementationName(), - SwXMLImport_createInstance, - SwXMLImport_getSupportedServiceNames() ); - } - else if( SwXMLImportStyles_getImplementationName().equalsAsciiL( - pImplName, nImplNameLen ) ) - { - xFactory = ::cppu::createSingleFactory( xMSF, - SwXMLImportStyles_getImplementationName(), - SwXMLImportStyles_createInstance, - SwXMLImportStyles_getSupportedServiceNames() ); - } - else if( SwXMLImportContent_getImplementationName().equalsAsciiL( - pImplName, nImplNameLen ) ) - { - xFactory = ::cppu::createSingleFactory( xMSF, - SwXMLImportContent_getImplementationName(), - SwXMLImportContent_createInstance, - SwXMLImportContent_getSupportedServiceNames() ); - } - else if( SwXMLImportMeta_getImplementationName().equalsAsciiL( - pImplName, nImplNameLen ) ) - { - xFactory = ::cppu::createSingleFactory( xMSF, - SwXMLImportMeta_getImplementationName(), - SwXMLImportMeta_createInstance, - SwXMLImportMeta_getSupportedServiceNames() ); - } - else if( SwXMLImportSettings_getImplementationName().equalsAsciiL( - pImplName, nImplNameLen ) ) - { - xFactory = ::cppu::createSingleFactory( xMSF, - SwXMLImportSettings_getImplementationName(), - SwXMLImportSettings_createInstance, - SwXMLImportSettings_getSupportedServiceNames() ); - } - else if( SwXMLExportOOO_getImplementationName().equalsAsciiL( pImplName, - nImplNameLen ) ) - { - xFactory = ::cppu::createSingleFactory( xMSF, - SwXMLExportOOO_getImplementationName(), - SwXMLExportOOO_createInstance, - SwXMLExportOOO_getSupportedServiceNames() ); - } - else if( SwXMLExportStylesOOO_getImplementationName().equalsAsciiL( - pImplName, nImplNameLen ) ) - { - xFactory = ::cppu::createSingleFactory( xMSF, - SwXMLExportStylesOOO_getImplementationName(), - SwXMLExportStylesOOO_createInstance, - SwXMLExportStylesOOO_getSupportedServiceNames() ); - } - else if( SwXMLExportContentOOO_getImplementationName().equalsAsciiL( - pImplName, nImplNameLen ) ) - { - xFactory = ::cppu::createSingleFactory( xMSF, - SwXMLExportContentOOO_getImplementationName(), - SwXMLExportContentOOO_createInstance, - SwXMLExportContentOOO_getSupportedServiceNames() ); - } - else if( SwXMLExportMetaOOO_getImplementationName().equalsAsciiL( - pImplName, nImplNameLen ) ) - { - xFactory = ::cppu::createSingleFactory( xMSF, - SwXMLExportMetaOOO_getImplementationName(), - SwXMLExportMetaOOO_createInstance, - SwXMLExportMetaOOO_getSupportedServiceNames() ); - } - else if( SwXMLExportSettingsOOO_getImplementationName().equalsAsciiL( - pImplName, nImplNameLen ) ) - { - xFactory = ::cppu::createSingleFactory( xMSF, - SwXMLExportSettingsOOO_getImplementationName(), - SwXMLExportSettingsOOO_createInstance, - SwXMLExportSettingsOOO_getSupportedServiceNames() ); - } - else if( SwXMLExport_getImplementationName().equalsAsciiL( pImplName, - nImplNameLen ) ) - { - xFactory = ::cppu::createSingleFactory( xMSF, - SwXMLExport_getImplementationName(), - SwXMLExport_createInstance, - SwXMLExport_getSupportedServiceNames() ); - } - else if( SwXMLExportStyles_getImplementationName().equalsAsciiL( - pImplName, nImplNameLen ) ) - { - xFactory = ::cppu::createSingleFactory( xMSF, - SwXMLExportStyles_getImplementationName(), - SwXMLExportStyles_createInstance, - SwXMLExportStyles_getSupportedServiceNames() ); - } - else if( SwXMLExportContent_getImplementationName().equalsAsciiL( - pImplName, nImplNameLen ) ) - { - xFactory = ::cppu::createSingleFactory( xMSF, - SwXMLExportContent_getImplementationName(), - SwXMLExportContent_createInstance, - SwXMLExportContent_getSupportedServiceNames() ); - } - else if( SwXMLExportMeta_getImplementationName().equalsAsciiL( - pImplName, nImplNameLen ) ) - { - xFactory = ::cppu::createSingleFactory( xMSF, - SwXMLExportMeta_getImplementationName(), - SwXMLExportMeta_createInstance, - SwXMLExportMeta_getSupportedServiceNames() ); - } - else if( SwXMLExportSettings_getImplementationName().equalsAsciiL( - pImplName, nImplNameLen ) ) - { - xFactory = ::cppu::createSingleFactory( xMSF, - SwXMLExportSettings_getImplementationName(), - SwXMLExportSettings_createInstance, - SwXMLExportSettings_getSupportedServiceNames() ); - } + void * pRet = 0; + if( pServiceManager ) + { + uno::Reference< XMultiServiceFactory > xMSF( + reinterpret_cast< XMultiServiceFactory * >( pServiceManager ) ); + + uno::Reference< XSingleServiceFactory > xFactory; + + const sal_Int32 nImplNameLen = strlen( pImplName ); + if( SwXMLImport_getImplementationName().equalsAsciiL( pImplName, + nImplNameLen ) ) + { + xFactory = ::cppu::createSingleFactory( xMSF, + SwXMLImport_getImplementationName(), + SwXMLImport_createInstance, + SwXMLImport_getSupportedServiceNames() ); + } + else if( SwXMLImportStyles_getImplementationName().equalsAsciiL( + pImplName, nImplNameLen ) ) + { + xFactory = ::cppu::createSingleFactory( xMSF, + SwXMLImportStyles_getImplementationName(), + SwXMLImportStyles_createInstance, + SwXMLImportStyles_getSupportedServiceNames() ); + } + else if( SwXMLImportContent_getImplementationName().equalsAsciiL( + pImplName, nImplNameLen ) ) + { + xFactory = ::cppu::createSingleFactory( xMSF, + SwXMLImportContent_getImplementationName(), + SwXMLImportContent_createInstance, + SwXMLImportContent_getSupportedServiceNames() ); + } + else if( SwXMLImportMeta_getImplementationName().equalsAsciiL( + pImplName, nImplNameLen ) ) + { + xFactory = ::cppu::createSingleFactory( xMSF, + SwXMLImportMeta_getImplementationName(), + SwXMLImportMeta_createInstance, + SwXMLImportMeta_getSupportedServiceNames() ); + } + else if( SwXMLImportSettings_getImplementationName().equalsAsciiL( + pImplName, nImplNameLen ) ) + { + xFactory = ::cppu::createSingleFactory( xMSF, + SwXMLImportSettings_getImplementationName(), + SwXMLImportSettings_createInstance, + SwXMLImportSettings_getSupportedServiceNames() ); + } + else if( SwXMLExportOOO_getImplementationName().equalsAsciiL( pImplName, + nImplNameLen ) ) + { + xFactory = ::cppu::createSingleFactory( xMSF, + SwXMLExportOOO_getImplementationName(), + SwXMLExportOOO_createInstance, + SwXMLExportOOO_getSupportedServiceNames() ); + } + else if( SwXMLExportStylesOOO_getImplementationName().equalsAsciiL( + pImplName, nImplNameLen ) ) + { + xFactory = ::cppu::createSingleFactory( xMSF, + SwXMLExportStylesOOO_getImplementationName(), + SwXMLExportStylesOOO_createInstance, + SwXMLExportStylesOOO_getSupportedServiceNames() ); + } + else if( SwXMLExportContentOOO_getImplementationName().equalsAsciiL( + pImplName, nImplNameLen ) ) + { + xFactory = ::cppu::createSingleFactory( xMSF, + SwXMLExportContentOOO_getImplementationName(), + SwXMLExportContentOOO_createInstance, + SwXMLExportContentOOO_getSupportedServiceNames() ); + } + else if( SwXMLExportMetaOOO_getImplementationName().equalsAsciiL( + pImplName, nImplNameLen ) ) + { + xFactory = ::cppu::createSingleFactory( xMSF, + SwXMLExportMetaOOO_getImplementationName(), + SwXMLExportMetaOOO_createInstance, + SwXMLExportMetaOOO_getSupportedServiceNames() ); + } + else if( SwXMLExportSettingsOOO_getImplementationName().equalsAsciiL( + pImplName, nImplNameLen ) ) + { + xFactory = ::cppu::createSingleFactory( xMSF, + SwXMLExportSettingsOOO_getImplementationName(), + SwXMLExportSettingsOOO_createInstance, + SwXMLExportSettingsOOO_getSupportedServiceNames() ); + } + else if( SwXMLExport_getImplementationName().equalsAsciiL( pImplName, + nImplNameLen ) ) + { + xFactory = ::cppu::createSingleFactory( xMSF, + SwXMLExport_getImplementationName(), + SwXMLExport_createInstance, + SwXMLExport_getSupportedServiceNames() ); + } + else if( SwXMLExportStyles_getImplementationName().equalsAsciiL( + pImplName, nImplNameLen ) ) + { + xFactory = ::cppu::createSingleFactory( xMSF, + SwXMLExportStyles_getImplementationName(), + SwXMLExportStyles_createInstance, + SwXMLExportStyles_getSupportedServiceNames() ); + } + else if( SwXMLExportContent_getImplementationName().equalsAsciiL( + pImplName, nImplNameLen ) ) + { + xFactory = ::cppu::createSingleFactory( xMSF, + SwXMLExportContent_getImplementationName(), + SwXMLExportContent_createInstance, + SwXMLExportContent_getSupportedServiceNames() ); + } + else if( SwXMLExportMeta_getImplementationName().equalsAsciiL( + pImplName, nImplNameLen ) ) + { + xFactory = ::cppu::createSingleFactory( xMSF, + SwXMLExportMeta_getImplementationName(), + SwXMLExportMeta_createInstance, + SwXMLExportMeta_getSupportedServiceNames() ); + } + else if( SwXMLExportSettings_getImplementationName().equalsAsciiL( + pImplName, nImplNameLen ) ) + { + xFactory = ::cppu::createSingleFactory( xMSF, + SwXMLExportSettings_getImplementationName(), + SwXMLExportSettings_createInstance, + SwXMLExportSettings_getSupportedServiceNames() ); + } else if( SwXAutoTextContainer_getImplementationName().equalsAsciiL( - pImplName, nImplNameLen ) ) - { - xFactory = ::cppu::createSingleFactory( xMSF, + pImplName, nImplNameLen ) ) + { + xFactory = ::cppu::createSingleFactory( xMSF, SwXAutoTextContainer_getImplementationName(), SwXAutoTextContainer_createInstance, SwXAutoTextContainer_getSupportedServiceNames() ); - } + } else if( SwXModule_getImplementationName().equalsAsciiL( - pImplName, nImplNameLen ) ) - { - xFactory = ::cppu::createSingleFactory( xMSF, + pImplName, nImplNameLen ) ) + { + xFactory = ::cppu::createSingleFactory( xMSF, SwXModule_getImplementationName(), SwXModule_createInstance, SwXModule_getSupportedServiceNames() ); - } + } else if( SwXMailMerge_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) ) { @@ -317,61 +317,66 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL com SwXMailMerge_getSupportedServiceNames() ); } else if( SwXFilterOptions::getImplementationName_Static().equalsAsciiL( - pImplName, nImplNameLen ) ) - { - xFactory = ::cppu::createSingleFactory( xMSF, + pImplName, nImplNameLen ) ) + { + xFactory = ::cppu::createSingleFactory( xMSF, SwXFilterOptions::getImplementationName_Static(), SwXFilterOptions_createInstance, SwXFilterOptions::getSupportedServiceNames_Static() ); - } + } else if( SwTextDocument_getImplementationName().equalsAsciiL( - pImplName, nImplNameLen ) ) - { - xFactory = ::sfx2::createSfxModelFactory( xMSF, + pImplName, nImplNameLen ) ) + { + xFactory = ::sfx2::createSfxModelFactory( xMSF, SwTextDocument_getImplementationName(), SwTextDocument_createInstance, SwTextDocument_getSupportedServiceNames() ); - } + } else if( SwWebDocument_getImplementationName().equalsAsciiL( - pImplName, nImplNameLen ) ) - { - xFactory = ::cppu::createSingleFactory( xMSF, + pImplName, nImplNameLen ) ) + { + xFactory = ::cppu::createSingleFactory( xMSF, SwWebDocument_getImplementationName(), SwWebDocument_createInstance, SwWebDocument_getSupportedServiceNames() ); - } + } else if( SwGlobalDocument_getImplementationName().equalsAsciiL( - pImplName, nImplNameLen ) ) - { - xFactory = ::cppu::createSingleFactory( xMSF, + pImplName, nImplNameLen ) ) + { + xFactory = ::cppu::createSingleFactory( xMSF, SwGlobalDocument_getImplementationName(), SwGlobalDocument_createInstance, SwGlobalDocument_getSupportedServiceNames() ); - } + } else if( SwUnoModule_getImplementationName().equalsAsciiL( - pImplName, nImplNameLen ) ) - { - xFactory = ::cppu::createSingleFactory( xMSF, + pImplName, nImplNameLen ) ) + { + xFactory = ::cppu::createSingleFactory( xMSF, SwUnoModule_getImplementationName(), SwUnoModule_createInstance, SwUnoModule_getSupportedServiceNames() ); - } - // --> OD 2007-05-24 #i73788# + } + else if ( ::sw::sidebar::SwPanelFactory::getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) ) + { + xFactory = ::cppu::createSingleFactory( xMSF, + ::sw::sidebar::SwPanelFactory::getImplementationName(), + ::sw::sidebar::SwPanelFactory::createInstance, + ::sw::sidebar::SwPanelFactory::getSupportedServiceNames() ); + } else if( comp_FinalThreadManager::_getImplementationName().equalsAsciiL( pImplName, nImplNameLen ) ) { pRet = ::cppu::component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey, entries); } - // <-- if( xFactory.is()) - { - xFactory->acquire(); - pRet = xFactory.get(); - } - } - return pRet; + { + xFactory->acquire(); + pRet = xFactory.get(); + } + } + return pRet; } #ifdef __cplusplus Modified: openoffice/branches/sidebar/main/sw/util/sw.component URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sw/util/sw.component?rev=1456629&r1=1456628&r2=1456629&view=diff ============================================================================== --- openoffice/branches/sidebar/main/sw/util/sw.component (original) +++ openoffice/branches/sidebar/main/sw/util/sw.component Thu Mar 14 20:00:19 2013 @@ -97,4 +97,7 @@ <implementation name="com.sun.star.util.comp.FinalThreadManager"> <service name="com.sun.star.util.JobManager"/> </implementation> + <implementation name="org.apache.openoffice.comp.sw.sidebar.SwPanelFactory"> + <service name="com.sun.star.ui.UIElementFactory"/> + </implementation> </component>
