From 811e7a83cbca79b0779ac2f77fc74b1f99c48439 Mon Sep 17 00:00:00 2001 From: Vladimir Glazounov Date: Wed, 26 Nov 2008 15:19:48 +0000 Subject: CWS-TOOLING: integrate CWS rtlchart01 --- chart2/source/controller/dialogs/Strings.src | 19 ++- chart2/source/controller/dialogs/TabPages.hrc | 12 +- .../controller/dialogs/TextDirectionListBox.cxx | 63 +++++++++ .../controller/dialogs/dlg_InsertDataLabel.cxx | 4 +- .../controller/dialogs/dlg_ObjectProperties.cxx | 11 +- chart2/source/controller/dialogs/hidother.src | 5 +- chart2/source/controller/dialogs/makefile.mk | 5 +- chart2/source/controller/dialogs/res_DataLabel.cxx | 32 ++++- chart2/source/controller/dialogs/res_DataLabel.hxx | 10 +- .../controller/dialogs/res_DataLabel_IDs.hrc | 7 +- .../controller/dialogs/res_DataLabel_tmpl.hrc | 17 ++- .../controller/dialogs/res_LegendPosition_tmpl.hrc | 5 +- chart2/source/controller/dialogs/tp_AxisLabel.cxx | 18 ++- chart2/source/controller/dialogs/tp_AxisLabel.hxx | 9 +- chart2/source/controller/dialogs/tp_AxisLabel.src | 59 +++------ chart2/source/controller/dialogs/tp_DataLabel.cxx | 4 +- chart2/source/controller/dialogs/tp_DataLabel.hxx | 2 +- chart2/source/controller/dialogs/tp_DataLabel.src | 2 +- .../controller/dialogs/tp_LegendPosition.cxx | 15 ++- .../controller/dialogs/tp_LegendPosition.hxx | 7 +- .../controller/dialogs/tp_LegendPosition.src | 23 +++- .../source/controller/dialogs/tp_TitleRotation.cxx | 41 +++++- .../source/controller/dialogs/tp_TitleRotation.hxx | 8 +- .../source/controller/dialogs/tp_TitleRotation.src | 19 ++- chart2/source/controller/inc/HelpIds.hrc | 7 +- .../source/controller/inc/TextDirectionListBox.hxx | 52 ++++++++ .../CharacterPropertyItemConverter.cxx | 4 +- chart2/source/inc/CharacterProperties.hxx | 4 +- chart2/source/inc/Strings.hrc | 10 +- chart2/source/tools/CharacterProperties.cxx | 13 +- chart2/source/view/main/ChartView.cxx | 143 +++++++++++++++++++++ chart2/source/view/main/PropertyMapper.cxx | 4 +- 32 files changed, 534 insertions(+), 100 deletions(-) create mode 100644 chart2/source/controller/dialogs/TextDirectionListBox.cxx create mode 100644 chart2/source/controller/inc/TextDirectionListBox.hxx (limited to 'chart2') diff --git a/chart2/source/controller/dialogs/Strings.src b/chart2/source/controller/dialogs/Strings.src index 87847d1a45e0..4cd86dbdd749 100644 --- a/chart2/source/controller/dialogs/Strings.src +++ b/chart2/source/controller/dialogs/Strings.src @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: Strings.src,v $ - * $Revision: 1.12 $ + * $Revision: 1.12.72.2 $ * * This file is part of OpenOffice.org. * @@ -549,5 +549,22 @@ String STR_DATA_EDITOR_INCORRECT_INPUT Text [ en-US ] = "Your last input is incorrect.\nIgnore this change and close the dialog?" ; }; +// frame direction ------------------------------------------------------------ + +String STR_TEXT_DIRECTION_LTR +{ + Text [ en-US ] = "Left-to-right"; +}; + +String STR_TEXT_DIRECTION_RTL +{ + Text [ en-US ] = "Right-to-left"; +}; + +String STR_TEXT_DIRECTION_SUPER +{ + Text [ en-US ] = "Use superordinate object settings"; +}; + //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- diff --git a/chart2/source/controller/dialogs/TabPages.hrc b/chart2/source/controller/dialogs/TabPages.hrc index 07ac44b68275..fb136c88d75e 100644 --- a/chart2/source/controller/dialogs/TabPages.hrc +++ b/chart2/source/controller/dialogs/TabPages.hrc @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: TabPages.hrc,v $ - * $Revision: 1.7 $ + * $Revision: 1.7.20.1 $ * * This file is part of OpenOffice.org. * @@ -35,7 +35,10 @@ //see attrib.hrc in old chart //#define TP_LEGEND_POS 900 -#define GRP_LEGEND 1 +#define GRP_LEGEND 1 +#define FL_LEGEND_TEXTORIENT 2 +#define FT_LEGEND_TEXTDIR 3 +#define LB_LEGEND_TEXTDIR 4 //#define TP_DATA_DESCR 901 @@ -60,6 +63,8 @@ #define CTR_DUMMY 6034 #define FT_DUMMY 6035 #define FL_ALIGN 6037 +#define FT_TEXTDIR 6038 +#define LB_TEXTDIR 6039 /* //Symbol-Tabpage (zum Teil sehr Aehnlich der SVX_AREA_TABPAGE) (obsolete) @@ -123,6 +128,9 @@ #define FL_SEPARATOR 18 +#define FT_AXIS_TEXTDIR 19 +#define LB_AXIS_TEXTDIR 20 + //#define TP_SCALE_Y 903 #define FL_SCALE_Y 1 diff --git a/chart2/source/controller/dialogs/TextDirectionListBox.cxx b/chart2/source/controller/dialogs/TextDirectionListBox.cxx new file mode 100644 index 000000000000..d1365b908eac --- /dev/null +++ b/chart2/source/controller/dialogs/TextDirectionListBox.cxx @@ -0,0 +1,63 @@ +/************************************************************************* +* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: TextDirectionListBox.cxx,v $ + * $Revision: 1.1.2.1 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * +************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_chart2.hxx" + +#include "TextDirectionListBox.hxx" +#include "ResId.hxx" +#include "Strings.hrc" +#include +#include + +namespace chart +{ + +TextDirectionListBox::TextDirectionListBox( Window* pParent, const ResId& rResId, Window* pWindow1, Window* pWindow2 ) : + svx::FrameDirectionListBox( pParent, rResId ) +{ + InsertEntryValue( String( SchResId( STR_TEXT_DIRECTION_LTR ) ), FRMDIR_HORI_LEFT_TOP ); + InsertEntryValue( String( SchResId( STR_TEXT_DIRECTION_RTL ) ), FRMDIR_HORI_RIGHT_TOP ); + InsertEntryValue( String( SchResId( STR_TEXT_DIRECTION_SUPER ) ), FRMDIR_ENVIRONMENT ); + + if( !SvtLanguageOptions().IsCTLFontEnabled() ) + { + Hide(); + if( pWindow1 ) pWindow1->Hide(); + if( pWindow2 ) pWindow2->Hide(); + } +} + +TextDirectionListBox::~TextDirectionListBox() +{ +} + +} //namespace chart + diff --git a/chart2/source/controller/dialogs/dlg_InsertDataLabel.cxx b/chart2/source/controller/dialogs/dlg_InsertDataLabel.cxx index 1ae69a053db0..79f4bf52d05b 100644 --- a/chart2/source/controller/dialogs/dlg_InsertDataLabel.cxx +++ b/chart2/source/controller/dialogs/dlg_InsertDataLabel.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: dlg_InsertDataLabel.cxx,v $ - * $Revision: 1.10 $ + * $Revision: 1.10.72.1 $ * * This file is part of OpenOffice.org. * @@ -47,7 +47,7 @@ DataLabelsDialog::DataLabelsDialog(Window* pWindow, const SfxItemSet& rInAttrs, m_aBtnOK(this, SchResId(BTN_OK)), m_aBtnCancel(this, SchResId(BTN_CANCEL)), m_aBtnHelp(this, SchResId(BTN_HELP)), - m_apDataLabelResources( new DataLabelResources(this,rInAttrs) ), + m_apDataLabelResources( new DataLabelResources(this,rInAttrs,false) ), m_rInAttrs(rInAttrs) { FreeResource(); diff --git a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx index ad8baae5b417..4084b30c9da4 100644 --- a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx +++ b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx @@ -64,19 +64,15 @@ #include #include #include +#include -#ifndef _SVX_SVXIDS_HRC #include -#endif - #include #include #include -#ifndef _SVX_DIALOGS_HRC #include -#endif #include #include @@ -399,6 +395,11 @@ SchAttribTabDlg::SchAttribTabDlg(Window* pParent, AddTabPage(RID_SVXPAGE_CHAR_NAME, String(SchResId(STR_PAGE_CHARACTERS))); AddTabPage(RID_SVXPAGE_CHAR_EFFECTS, String(SchResId(STR_PAGE_FONT_EFFECTS))); AddTabPage(RID_SVXPAGE_NUMBERFORMAT, String(SchResId(STR_PAGE_NUMBERS))); + if( SvtLanguageOptions().IsCTLFontEnabled() ) + /* When rotation is supported for equation text boxes, use + SchAlignmentTabPage::Create here. The special + SchAlignmentTabPage::CreateWithoutRotation can be deleted. */ + AddTabPage(TP_ALIGNMENT, String(SchResId(STR_PAGE_ALIGNMENT)), SchAlignmentTabPage::CreateWithoutRotation, NULL); break; } diff --git a/chart2/source/controller/dialogs/hidother.src b/chart2/source/controller/dialogs/hidother.src index 790a3cde87d8..8707088c4337 100644 --- a/chart2/source/controller/dialogs/hidother.src +++ b/chart2/source/controller/dialogs/hidother.src @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: hidother.src,v $ - * $Revision: 1.7 $ + * $Revision: 1.7.56.2 $ * * This file is part of OpenOffice.org. * @@ -88,6 +88,9 @@ hidspecial HID_SCH_PB_NUMBERFORMAT {HelpId= HID_SCH_PB_NUMBERFORMAT; }; hidspecial HID_SCH_PB_PERCENT_NUMBERFORMAT {HelpId= HID_SCH_PB_PERCENT_NUMBERFORMAT; }; hidspecial HID_SCH_DATALABEL_SEPARATOR {HelpId= HID_SCH_DATALABEL_SEPARATOR; }; hidspecial HID_SCH_DATALABEL_PLACEMENT {HelpId= HID_SCH_DATALABEL_PLACEMENT; }; +hidspecial HID_SCH_TEXTDIRECTION {HelpId= HID_SCH_TEXTDIRECTION; }; +hidspecial HID_SCH_TEXTDIRECTION_TITLE {HelpId= HID_SCH_TEXTDIRECTION_TITLE; }; +hidspecial HID_SCH_TEXTDIRECTION_EQUATION {HelpId= HID_SCH_TEXTDIRECTION_EQUATION; }; hidspecial HID_SCH_TITLE_MAIN {HelpId= HID_SCH_TITLE_MAIN; }; hidspecial HID_SCH_TITLE_SUB {HelpId= HID_SCH_TITLE_SUB; }; diff --git a/chart2/source/controller/dialogs/makefile.mk b/chart2/source/controller/dialogs/makefile.mk index 06534c3fb2af..f124a9dc7329 100644 --- a/chart2/source/controller/dialogs/makefile.mk +++ b/chart2/source/controller/dialogs/makefile.mk @@ -8,7 +8,7 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.19 $ +# $Revision: 1.19.72.1 $ # # This file is part of OpenOffice.org. # @@ -103,7 +103,8 @@ SLOFILES= \ $(SLO)$/RangeSelectionButton.obj \ $(SLO)$/RangeSelectionHelper.obj \ $(SLO)$/RangeSelectionListener.obj \ - $(SLO)$/RangeEdit.obj + $(SLO)$/RangeEdit.obj \ + $(SLO)$/TextDirectionListBox.obj # --- Resources --------------------------------------------------------------- diff --git a/chart2/source/controller/dialogs/res_DataLabel.cxx b/chart2/source/controller/dialogs/res_DataLabel.cxx index b75306b693cd..ff92fe45f385 100644 --- a/chart2/source/controller/dialogs/res_DataLabel.cxx +++ b/chart2/source/controller/dialogs/res_DataLabel.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: res_DataLabel.cxx,v $ - * $Revision: 1.5 $ + * $Revision: 1.5.72.1 $ * * This file is part of OpenOffice.org. * @@ -49,17 +49,15 @@ #include //SfxIntegerListItem #include +#include +#include // header for define RET_OK #include -#ifndef _SVX_SVXIDS_HRC #include -#endif // header for SvNumberFormatter #include -#ifndef _SVT_CONTROLDIMS_HRC_ #include -#endif //............................................................................. @@ -114,7 +112,7 @@ void lcl_setBoolItemToCheckBox( const SfxItemSet& rInAttrs, USHORT nWhichId, Che }//end anonymous namespace -DataLabelResources::DataLabelResources( Window* pWindow, const SfxItemSet& rInAttrs ) +DataLabelResources::DataLabelResources( Window* pWindow, const SfxItemSet& rInAttrs, bool bShowTextDirectionListBox ) : m_aCBNumber(pWindow, SchResId(CB_VALUE_AS_NUMBER)), m_aPB_NumberFormatForValue(pWindow, SchResId(PB_NUMBERFORMAT)), m_aCBPercent(pWindow, SchResId(CB_VALUE_AS_PERCENTAGE)), @@ -124,6 +122,8 @@ DataLabelResources::DataLabelResources( Window* pWindow, const SfxItemSet& rInAt m_aSeparatorResources(pWindow), m_aFT_LabelPlacement(pWindow, SchResId(FT_LABEL_PLACEMENT)), m_aLB_LabelPlacement(pWindow, SchResId(LB_LABEL_PLACEMENT)), + m_aFT_TextDirection(pWindow, SchResId(FT_LABEL_TEXTDIR)), + m_aLB_TextDirection(pWindow, SchResId(LB_LABEL_TEXTDIR), &m_aFT_TextDirection), m_pNumberFormatter(0), m_bNumberFormatMixedState(true), m_bPercentFormatMixedState(true), @@ -192,6 +192,18 @@ DataLabelResources::DataLabelResources( Window* pWindow, const SfxItemSet& rInAt aPos.Y() += nYDiff; m_aFT_LabelPlacement.SetPosPixel(aPos); + // hide "text direction" listbox is specified by caller + if( !bShowTextDirectionListBox ) + { + m_aFT_TextDirection.Hide(); + m_aLB_TextDirection.Hide(); + } + // move "text direction" listbox down below "label placement" listbox + long nNewY = m_aLB_LabelPlacement.GetPosPixel().Y() + m_aLB_LabelPlacement.GetSizePixel().Height() + aControlDistance.Height(); + nYDiff = nNewY - m_aLB_TextDirection.GetPosPixel().Y(); + m_aFT_TextDirection.SetPosPixel( m_aFT_TextDirection.GetPosPixel() + Point( 0, nYDiff ) ); + m_aLB_TextDirection.SetPosPixel( m_aLB_TextDirection.GetPosPixel() + Point( 0, nYDiff ) ); + m_aPB_NumberFormatForValue.SetClickHdl( LINK( this, DataLabelResources, NumberFormatDialogHdl ) ); m_aPB_NumberFormatForPercent.SetClickHdl( LINK( this, DataLabelResources, NumberFormatDialogHdl ) ); m_aCBNumber.SetClickHdl( LINK( this, DataLabelResources, CheckHdl )); @@ -283,6 +295,9 @@ void DataLabelResources::EnableControls() if( m_aCBCategory.IsChecked() ) ++nNumberOfCheckedLabelParts; m_aSeparatorResources.Enable( nNumberOfCheckedLabelParts > 1 ); + bool bEnableTextDir = nNumberOfCheckedLabelParts > 0; + m_aFT_TextDirection.Enable( bEnableTextDir ); + m_aLB_TextDirection.Enable( bEnableTextDir ); bool bEnablePlacement = nNumberOfCheckedLabelParts > 0 && m_aLB_LabelPlacement.GetEntryCount()>1; m_aFT_LabelPlacement.Enable( bEnablePlacement ); m_aLB_LabelPlacement.Enable( bEnablePlacement ); @@ -326,6 +341,9 @@ BOOL DataLabelResources::FillItemSet( SfxItemSet& rOutAttrs ) const rOutAttrs.Put( SfxInt32Item( SCHATTR_DATADESCR_PLACEMENT, nValue ) ); } + if( m_aLB_TextDirection.GetSelectEntryCount() > 0 ) + rOutAttrs.Put( SfxInt32Item( EE_PARA_WRITINGDIR, m_aLB_TextDirection.GetSelectEntryValue() ) ); + return TRUE; } @@ -363,6 +381,8 @@ void DataLabelResources::Reset(const SfxItemSet& rInAttrs) else m_aLB_LabelPlacement.SetNoSelection(); + if( rInAttrs.GetItemState(EE_PARA_WRITINGDIR, TRUE, &pPoolItem ) == SFX_ITEM_SET ) + m_aLB_TextDirection.SelectEntryValue( SvxFrameDirection(((const SvxFrameDirectionItem*)pPoolItem)->GetValue()) ); EnableControls(); } diff --git a/chart2/source/controller/dialogs/res_DataLabel.hxx b/chart2/source/controller/dialogs/res_DataLabel.hxx index 3cd59396c849..cadbf1230c45 100644 --- a/chart2/source/controller/dialogs/res_DataLabel.hxx +++ b/chart2/source/controller/dialogs/res_DataLabel.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: res_DataLabel.hxx,v $ - * $Revision: 1.5 $ + * $Revision: 1.5.72.1 $ * * This file is part of OpenOffice.org. * @@ -32,11 +32,10 @@ #include "res_TextSeparator.hxx" // header for class CheckBox -#ifndef _SV_BUTTON_HXX #include -#endif // header for class SfxItemSet #include +#include "TextDirectionListBox.hxx" class SvNumberFormatter; @@ -48,7 +47,7 @@ namespace chart class DataLabelResources { public: - DataLabelResources( Window* pParent, const SfxItemSet& rInAttrs ); + DataLabelResources( Window* pParent, const SfxItemSet& rInAttrs, bool bShowTextDirectionListBox ); virtual ~DataLabelResources(); BOOL FillItemSet(SfxItemSet& rOutAttrs) const; @@ -69,6 +68,9 @@ private: FixedText m_aFT_LabelPlacement; ListBox m_aLB_LabelPlacement; + FixedText m_aFT_TextDirection; + TextDirectionListBox m_aLB_TextDirection; + ::std::map< sal_Int32, USHORT > m_aPlacementToListBoxMap; ::std::map< USHORT, sal_Int32 > m_aListBoxToPlacementMap; diff --git a/chart2/source/controller/dialogs/res_DataLabel_IDs.hrc b/chart2/source/controller/dialogs/res_DataLabel_IDs.hrc index a241714a15dc..536b355980d0 100644 --- a/chart2/source/controller/dialogs/res_DataLabel_IDs.hrc +++ b/chart2/source/controller/dialogs/res_DataLabel_IDs.hrc @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: res_DataLabel_IDs.hrc,v $ - * $Revision: 1.5 $ + * $Revision: 1.5.72.1 $ * * This file is part of OpenOffice.org. * @@ -37,5 +37,8 @@ #define PB_PERCENT_NUMBERFORMAT 21 #define FT_LABEL_PLACEMENT 2 - #define LB_LABEL_PLACEMENT 2 + +#define FT_LABEL_TEXTDIR 31 +#define LB_LABEL_TEXTDIR 32 + diff --git a/chart2/source/controller/dialogs/res_DataLabel_tmpl.hrc b/chart2/source/controller/dialogs/res_DataLabel_tmpl.hrc index 3943056164b7..70d03376b51f 100644 --- a/chart2/source/controller/dialogs/res_DataLabel_tmpl.hrc +++ b/chart2/source/controller/dialogs/res_DataLabel_tmpl.hrc @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: res_DataLabel_tmpl.hrc,v $ - * $Revision: 1.11 $ + * $Revision: 1.11.20.2 $ * * This file is part of OpenOffice.org. * @@ -120,6 +120,21 @@ ListBox LB_LABEL_PLACEMENT \ DropDown=TRUE; \ DDExtraWidth = TRUE ; \ WORKAROUND \ +}; \ +FixedText FT_LABEL_TEXTDIR \ +{ \ + Pos = MAP_APPFONT ( xpos , ypos+120 ) ; \ + Size = MAP_APPFONT ( 64 , 8 ) ; \ + Text [ en-US ] = "Te~xt direction" ; \ +}; \ +ListBox LB_LABEL_TEXTDIR \ +{ \ + HelpID = HID_SCH_TEXTDIRECTION; \ + Pos = MAP_APPFONT ( xpos+66 , ypos+118 ) ; \ + Size = MAP_APPFONT ( 170 , 100 ) ; \ + Border = TRUE; \ + TabStop = TRUE; \ + DropDown = TRUE; \ }; #endif diff --git a/chart2/source/controller/dialogs/res_LegendPosition_tmpl.hrc b/chart2/source/controller/dialogs/res_LegendPosition_tmpl.hrc index 097977687aee..b0f056763f55 100644 --- a/chart2/source/controller/dialogs/res_LegendPosition_tmpl.hrc +++ b/chart2/source/controller/dialogs/res_LegendPosition_tmpl.hrc @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: res_LegendPosition_tmpl.hrc,v $ - * $Revision: 1.7 $ + * $Revision: 1.7.72.1 $ * * This file is part of OpenOffice.org. * @@ -77,4 +77,7 @@ RadioButton RBT_BOTTOM \ TabStop = TRUE ; \ }; +// height of RESOURCE_LEGENDPOSITION - don't forget to update when this is changed +#define RESOURCE_LEGENDPOSITION_HEIGHT 52 + #endif diff --git a/chart2/source/controller/dialogs/tp_AxisLabel.cxx b/chart2/source/controller/dialogs/tp_AxisLabel.cxx index fda0449dc376..ae20b1db1d2b 100644 --- a/chart2/source/controller/dialogs/tp_AxisLabel.cxx +++ b/chart2/source/controller/dialogs/tp_AxisLabel.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: tp_AxisLabel.cxx,v $ - * $Revision: 1.10 $ + * $Revision: 1.10.72.1 $ * * This file is part of OpenOffice.org. * @@ -42,6 +42,8 @@ // header for SfxInt32Item #include +#include +#include //............................................................................. namespace chart @@ -69,7 +71,10 @@ SchAxisLabelTabPage::SchAxisLabelTabPage( Window* pParent, const SfxItemSet& rIn aFtRotate( this, SchResId( FT_AXIS_LABEL_DEGREES ) ), aNfRotate( this, SchResId( NF_AXIS_LABEL_ORIENT ) ), aCbStacked( this, SchResId( PB_AXIS_LABEL_TEXTSTACKED ) ), - aOrientHlp( this, aCtrlDial, aNfRotate, aCbStacked ), + aOrientHlp( aCtrlDial, aNfRotate, aCbStacked ), + + m_aFtTextDirection( this, SchResId( FT_AXIS_TEXTDIR ) ), + m_aLbTextDirection( this, SchResId( LB_AXIS_TEXTDIR ), &m_aFtTextDirection ), m_bShowStaggeringControls( true ), @@ -149,6 +154,9 @@ BOOL SchAxisLabelTabPage::FillItemSet( SfxItemSet& rOutAttrs ) if( aCbShowDescription.GetState() != STATE_DONTKNOW ) rOutAttrs.Put( SfxBoolItem( SCHATTR_AXIS_SHOWDESCR, aCbShowDescription.IsChecked() ) ); + if( m_aLbTextDirection.GetSelectEntryCount() > 0 ) + rOutAttrs.Put( SfxInt32Item( EE_PARA_WRITINGDIR, m_aLbTextDirection.GetSelectEntryValue() ) ); + return TRUE; } @@ -202,6 +210,9 @@ void SchAxisLabelTabPage::Reset( const SfxItemSet& rInAttrs ) else aOrientHlp.SetStackedState( STATE_DONTKNOW ); + if( rInAttrs.GetItemState( EE_PARA_WRITINGDIR, TRUE, &pPoolItem ) == SFX_ITEM_SET ) + m_aLbTextDirection.SelectEntryValue( SvxFrameDirection(((const SvxFrameDirectionItem*)pPoolItem)->GetValue()) ); + // Text overlap ---------- aState = rInAttrs.GetItemState( SCHATTR_TEXT_OVERLAP, FALSE, &pPoolItem ); if( aState == SFX_ITEM_DONTCARE ) @@ -305,6 +316,9 @@ IMPL_LINK ( SchAxisLabelTabPage, ToggleShowLabel, void *, EMPTYARG ) aCbTextOverlap.Enable( bEnable ); aCbTextBreak.Enable( bEnable ); + m_aFtTextDirection.Enable( bEnable ); + m_aLbTextDirection.Enable( bEnable ); + return 0L; } //............................................................................. diff --git a/chart2/source/controller/dialogs/tp_AxisLabel.hxx b/chart2/source/controller/dialogs/tp_AxisLabel.hxx index 293a86e309c5..1e0aa8e578f0 100644 --- a/chart2/source/controller/dialogs/tp_AxisLabel.hxx +++ b/chart2/source/controller/dialogs/tp_AxisLabel.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: tp_AxisLabel.hxx,v $ - * $Revision: 1.8 $ + * $Revision: 1.8.72.1 $ * * This file is part of OpenOffice.org. * @@ -31,14 +31,12 @@ #define _CHART2_TP_AXISLABEL_HXX #include -// header for CheckBox -#ifndef _SV_BUTTON_HXX #include -#endif #include #include #include #include +#include "TextDirectionListBox.hxx" //............................................................................. namespace chart @@ -72,6 +70,9 @@ private: TriStateBox aCbStacked; svx::OrientationHelper aOrientHlp; + FixedText m_aFtTextDirection; + TextDirectionListBox m_aLbTextDirection; + BOOL m_bShowStaggeringControls; sal_Int32 m_nInitialDegrees; diff --git a/chart2/source/controller/dialogs/tp_AxisLabel.src b/chart2/source/controller/dialogs/tp_AxisLabel.src index 7d78e97dc7e9..090ef525de8f 100644 --- a/chart2/source/controller/dialogs/tp_AxisLabel.src +++ b/chart2/source/controller/dialogs/tp_AxisLabel.src @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: tp_AxisLabel.src,v $ - * $Revision: 1.10 $ + * $Revision: 1.10.72.1 $ * * This file is part of OpenOffice.org. * @@ -49,7 +49,7 @@ TabPage TP_AXIS_LABEL Pos = MAP_APPFONT ( 6 , 91 ) ; Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Rotate text" ; + Text [ en-US ] = "Text orientation" ; }; Control CT_AXIS_LABEL_DIAL { @@ -64,15 +64,12 @@ TabPage TP_AXIS_LABEL Pos = MAP_APPFONT ( 139 , 105 ) ; Size = MAP_APPFONT ( 115 , 10 ) ; TabStop = TRUE ; -// DR: TODO - after OOo 2.0 - enable localized strings -// Text [ de ] = "~Senkrecht gestapelt"; Text [ en-US ] = "Ve~rtically stacked"; }; FixedText FT_AXIS_LABEL_DEGREES { Pos = MAP_APPFONT ( 93 , 122 ) ; Size = MAP_APPFONT ( 60 , 8 ) ; - Text [ en-US ] = "~Degrees" ; }; NumericField NF_AXIS_LABEL_ORIENT @@ -173,42 +170,20 @@ TabPage TP_AXIS_LABEL Text [ en-US ] = "A~utomatic" ; }; -}; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + FixedText FT_AXIS_TEXTDIR + { + Pos = MAP_APPFONT ( 12 , 156 ) ; + Size = MAP_APPFONT ( 64 , 8 ) ; + Text [ en-US ] = "Te~xt direction" ; + }; + ListBox LB_AXIS_TEXTDIR + { + Pos = MAP_APPFONT ( 78 , 154 ) ; + Size = MAP_APPFONT ( 170 , 100 ) ; + Border = TRUE; + TabStop = TRUE; + DropDown = TRUE; + }; +}; diff --git a/chart2/source/controller/dialogs/tp_DataLabel.cxx b/chart2/source/controller/dialogs/tp_DataLabel.cxx index a0348b5a8dbd..35712ebcc566 100644 --- a/chart2/source/controller/dialogs/tp_DataLabel.cxx +++ b/chart2/source/controller/dialogs/tp_DataLabel.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: tp_DataLabel.cxx,v $ - * $Revision: 1.9 $ + * $Revision: 1.9.72.1 $ * * This file is part of OpenOffice.org. * @@ -42,7 +42,7 @@ namespace chart DataLabelsTabPage::DataLabelsTabPage(Window* pWindow, const SfxItemSet& rInAttrs) : SfxTabPage(pWindow, SchResId(TP_DATA_DESCR), rInAttrs), - m_aDataLabelResources(this, rInAttrs) + m_aDataLabelResources(this, rInAttrs, true) { FreeResource(); } diff --git a/chart2/source/controller/dialogs/tp_DataLabel.hxx b/chart2/source/controller/dialogs/tp_DataLabel.hxx index 85dbdcd8d8ab..9e5bd968154d 100644 --- a/chart2/source/controller/dialogs/tp_DataLabel.hxx +++ b/chart2/source/controller/dialogs/tp_DataLabel.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: tp_DataLabel.hxx,v $ - * $Revision: 1.5 $ + * $Revision: 1.5.72.1 $ * * This file is part of OpenOffice.org. * diff --git a/chart2/source/controller/dialogs/tp_DataLabel.src b/chart2/source/controller/dialogs/tp_DataLabel.src index 30050a7d390b..de4434759812 100644 --- a/chart2/source/controller/dialogs/tp_DataLabel.src +++ b/chart2/source/controller/dialogs/tp_DataLabel.src @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: tp_DataLabel.src,v $ - * $Revision: 1.4 $ + * $Revision: 1.4.72.1 $ * * This file is part of OpenOffice.org. * diff --git a/chart2/source/controller/dialogs/tp_LegendPosition.cxx b/chart2/source/controller/dialogs/tp_LegendPosition.cxx index 2702efadb2f9..c2c0ad7e28c4 100644 --- a/chart2/source/controller/dialogs/tp_LegendPosition.cxx +++ b/chart2/source/controller/dialogs/tp_LegendPosition.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: tp_LegendPosition.cxx,v $ - * $Revision: 1.8 $ + * $Revision: 1.8.72.1 $ * * This file is part of OpenOffice.org. * @@ -37,6 +37,8 @@ #include "chartview/ChartSfxItemIds.hxx" #include "NoWarningThisInCTOR.hxx" #include +#include +#include //............................................................................. namespace chart @@ -48,6 +50,9 @@ SchLegendPosTabPage::SchLegendPosTabPage(Window* pWindow, : SfxTabPage( pWindow, SchResId(TP_LEGEND_POS), rInAttrs ) , aGrpLegend( this, SchResId(GRP_LEGEND) ) , m_apLegendPositionResources( new LegendPositionResources(this) ) + , m_aFlTextOrient( this, SchResId( FL_LEGEND_TEXTORIENT ) ) + , m_aFtTextDirection( this, SchResId( FT_LEGEND_TEXTDIR ) ) + , m_aLbTextDirection( this, SchResId( LB_LEGEND_TEXTDIR ), &m_aFlTextOrient, &m_aFtTextDirection ) { FreeResource(); } @@ -65,12 +70,20 @@ SfxTabPage* SchLegendPosTabPage::Create(Window* pWindow, BOOL SchLegendPosTabPage::FillItemSet(SfxItemSet& rOutAttrs) { m_apLegendPositionResources->writeToItemSet(rOutAttrs); + + if( m_aLbTextDirection.GetSelectEntryCount() > 0 ) + rOutAttrs.Put( SfxInt32Item( EE_PARA_WRITINGDIR, m_aLbTextDirection.GetSelectEntryValue() ) ); + return TRUE; } void SchLegendPosTabPage::Reset(const SfxItemSet& rInAttrs) { m_apLegendPositionResources->initFromItemSet(rInAttrs); + + const SfxPoolItem* pPoolItem = 0; + if( rInAttrs.GetItemState( EE_PARA_WRITINGDIR, TRUE, &pPoolItem ) == SFX_ITEM_SET ) + m_aLbTextDirection.SelectEntryValue( SvxFrameDirection(((const SvxFrameDirectionItem*)pPoolItem)->GetValue()) ); } //............................................................................. diff --git a/chart2/source/controller/dialogs/tp_LegendPosition.hxx b/chart2/source/controller/dialogs/tp_LegendPosition.hxx index 90c11e418327..b4dcbea9f168 100644 --- a/chart2/source/controller/dialogs/tp_LegendPosition.hxx +++ b/chart2/source/controller/dialogs/tp_LegendPosition.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: tp_LegendPosition.hxx,v $ - * $Revision: 1.5 $ + * $Revision: 1.5.72.1 $ * * This file is part of OpenOffice.org. * @@ -36,6 +36,7 @@ #include //for auto_ptr #include +#include "TextDirectionListBox.hxx" //............................................................................. namespace chart @@ -50,6 +51,10 @@ private: ::std::auto_ptr< LegendPositionResources > m_apLegendPositionResources; + FixedLine m_aFlTextOrient; + FixedText m_aFtTextDirection; + TextDirectionListBox m_aLbTextDirection; + public: SchLegendPosTabPage(Window* pParent, const SfxItemSet& rInAttrs); virtual ~SchLegendPosTabPage(); diff --git a/chart2/source/controller/dialogs/tp_LegendPosition.src b/chart2/source/controller/dialogs/tp_LegendPosition.src index fce591ffea2c..ac1323bc5ebc 100644 --- a/chart2/source/controller/dialogs/tp_LegendPosition.src +++ b/chart2/source/controller/dialogs/tp_LegendPosition.src @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: tp_LegendPosition.src,v $ - * $Revision: 1.6 $ + * $Revision: 1.6.72.1 $ * * This file is part of OpenOffice.org. * @@ -44,4 +44,25 @@ TabPage TP_LEGEND_POS Text [ en-US ] = "Position" ; }; RESOURCE_LEGENDPOSITION( 12, 14 ) + + FixedLine FL_LEGEND_TEXTORIENT + { + Pos = MAP_APPFONT ( 6 , 14 + RESOURCE_LEGENDPOSITION_HEIGHT + 6 ) ; + Size = MAP_APPFONT ( 248 , 8 ) ; + Text [ en-US ] = "Text orientation" ; + }; + FixedText FT_LEGEND_TEXTDIR + { + Pos = MAP_APPFONT ( 12 , 14 + RESOURCE_LEGENDPOSITION_HEIGHT + 19 ) ; + Size = MAP_APPFONT ( 64 , 8 ) ; + Text [ en-US ] = "Te~xt direction" ; + }; + ListBox LB_LEGEND_TEXTDIR + { + Pos = MAP_APPFONT ( 78 , 14 + RESOURCE_LEGENDPOSITION_HEIGHT + 17 ) ; + Size = MAP_APPFONT ( 170 , 100 ) ; + Border = TRUE; + TabStop = TRUE; + DropDown = TRUE; + }; }; diff --git a/chart2/source/controller/dialogs/tp_TitleRotation.cxx b/chart2/source/controller/dialogs/tp_TitleRotation.cxx index 63093c417063..6733d9e08c3a 100644 --- a/chart2/source/controller/dialogs/tp_TitleRotation.cxx +++ b/chart2/source/controller/dialogs/tp_TitleRotation.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: tp_TitleRotation.cxx,v $ - * $Revision: 1.11 $ + * $Revision: 1.11.72.2 $ * * This file is part of OpenOffice.org. * @@ -35,6 +35,9 @@ #include "ResId.hxx" #include "TabPages.hrc" #include "chartview/ChartSfxItemIds.hxx" +#include "HelpIds.hrc" +#include +#include // header for class SfxInt32Item #include @@ -45,29 +48,47 @@ namespace chart //............................................................................. SchAlignmentTabPage::SchAlignmentTabPage(Window* pWindow, - const SfxItemSet& rInAttrs) : + const SfxItemSet& rInAttrs, bool bWithRotation) : SfxTabPage(pWindow, SchResId(TP_ALIGNMENT), rInAttrs), aFlAlign ( this, SchResId( FL_ALIGN ) ), aCtrlDial ( this, SchResId( CTR_DIAL ) ), aFtRotate ( this, SchResId( FT_DEGREES ) ), aNfRotate ( this, SchResId( NF_ORIENT ) ), aCbStacked ( this, SchResId( BTN_TXTSTACKED ) ), - aOrientHlp ( this, aCtrlDial, aNfRotate, aCbStacked ) + aOrientHlp ( aCtrlDial, aNfRotate, aCbStacked ), + aFtTextDirection( this, SchResId( FT_TEXTDIR ) ), + aLbTextDirection( this, SchResId( LB_TEXTDIR ), &aFtTextDirection ) { FreeResource(); aCbStacked.EnableTriState( FALSE ); aOrientHlp.AddDependentWindow( aFtRotate, STATE_CHECK ); + + if( !bWithRotation ) + { + aOrientHlp.Hide(); + Point aMove( 0, aCtrlDial.GetPosPixel().Y() - aFtTextDirection.GetPosPixel().Y() ); + aFtTextDirection.SetPosPixel( aFtTextDirection.GetPosPixel() + aMove ); + aLbTextDirection.SetPosPixel( aLbTextDirection.GetPosPixel() + aMove ); + + aLbTextDirection.SetHelpId( HID_SCH_TEXTDIRECTION_EQUATION ); + } } SchAlignmentTabPage::~SchAlignmentTabPage() { } -SfxTabPage* SchAlignmentTabPage::Create(Window* pWindow, - const SfxItemSet& rOutAttrs) +SfxTabPage* SchAlignmentTabPage::Create(Window* pParent, + const SfxItemSet& rInAttrs) +{ + return new SchAlignmentTabPage(pParent, rInAttrs); +} + +SfxTabPage* SchAlignmentTabPage::CreateWithoutRotation(Window* pParent, + const SfxItemSet& rInAttrs) { - return new SchAlignmentTabPage(pWindow, rOutAttrs); + return new SchAlignmentTabPage(pParent, rInAttrs, false); } BOOL SchAlignmentTabPage::FillItemSet(SfxItemSet& rOutAttrs) @@ -78,6 +99,10 @@ BOOL SchAlignmentTabPage::FillItemSet(SfxItemSet& rOutAttrs) sal_Int32 nDegrees = bStacked ? 0 : aCtrlDial.GetRotation(); rOutAttrs.Put( SfxInt32Item( SCHATTR_TEXT_DEGREES, nDegrees ) ); + + SvxFrameDirection aDirection( aLbTextDirection.GetSelectEntryValue() ); + rOutAttrs.Put( SfxInt32Item( EE_PARA_WRITINGDIR, aDirection ) ); + return TRUE; } @@ -91,6 +116,10 @@ void SchAlignmentTabPage::Reset(const SfxItemSet& rInAttrs) pItem = GetItem( rInAttrs, SCHATTR_TEXT_STACKED ); bool bStacked = pItem && ((const SfxBoolItem*)pItem)->GetValue(); aOrientHlp.SetStackedState( bStacked ? STATE_CHECK : STATE_NOCHECK ); + + + if( rInAttrs.GetItemState(EE_PARA_WRITINGDIR, TRUE, &pItem) == SFX_ITEM_SET) + aLbTextDirection.SelectEntryValue( SvxFrameDirection(((const SvxFrameDirectionItem*)pItem)->GetValue()) ); } //............................................................................. diff --git a/chart2/source/controller/dialogs/tp_TitleRotation.hxx b/chart2/source/controller/dialogs/tp_TitleRotation.hxx index 1b6dcfcbef46..fb208196480f 100644 --- a/chart2/source/controller/dialogs/tp_TitleRotation.hxx +++ b/chart2/source/controller/dialogs/tp_TitleRotation.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: tp_TitleRotation.hxx,v $ - * $Revision: 1.9 $ + * $Revision: 1.9.72.1 $ * * This file is part of OpenOffice.org. * @@ -36,6 +36,7 @@ #include #include #include +#include "TextDirectionListBox.hxx" //............................................................................. namespace chart @@ -51,12 +52,15 @@ private: svx::WrapField aNfRotate; TriStateBox aCbStacked; svx::OrientationHelper aOrientHlp; + FixedText aFtTextDirection; + TextDirectionListBox aLbTextDirection; public: - SchAlignmentTabPage(Window* pParent, const SfxItemSet& rInAttrs); + SchAlignmentTabPage(Window* pParent, const SfxItemSet& rInAttrs, bool bWithRotation = true); virtual ~SchAlignmentTabPage(); static SfxTabPage* Create(Window* pParent, const SfxItemSet& rInAttrs); + static SfxTabPage* CreateWithoutRotation(Window* pParent, const SfxItemSet& rInAttrs); virtual BOOL FillItemSet(SfxItemSet& rOutAttrs); virtual void Reset(const SfxItemSet& rInAttrs); }; diff --git a/chart2/source/controller/dialogs/tp_TitleRotation.src b/chart2/source/controller/dialogs/tp_TitleRotation.src index b80461efcc99..8d516c13fb0a 100644 --- a/chart2/source/controller/dialogs/tp_TitleRotation.src +++ b/chart2/source/controller/dialogs/tp_TitleRotation.src @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: tp_TitleRotation.src,v $ - * $Revision: 1.10 $ + * $Revision: 1.10.72.2 $ * * This file is part of OpenOffice.org. * @@ -75,7 +75,22 @@ TabPage TP_ALIGNMENT { Pos = MAP_APPFONT ( 6 , 3 ) ; Size = MAP_APPFONT ( 248 , 8 ) ; - Text [ en-US ] = "Text direction" ; + Text [ en-US ] = "Text orientation" ; + }; + FixedText FT_TEXTDIR + { + Pos = MAP_APPFONT ( 12 , 65 ) ; + Size = MAP_APPFONT ( 64 , 8 ) ; + Text [ en-US ] = "Te~xt direction" ; + }; + ListBox LB_TEXTDIR + { + HelpId = HID_SCH_TEXTDIRECTION_TITLE ; + Pos = MAP_APPFONT ( 78 , 63 ) ; + Size = MAP_APPFONT ( 170 , 100 ) ; + Border = TRUE; + TabStop = TRUE; + DropDown = TRUE; }; }; diff --git a/chart2/source/controller/inc/HelpIds.hrc b/chart2/source/controller/inc/HelpIds.hrc index de8a4b90b2e0..8277ff8c91a0 100644 --- a/chart2/source/controller/inc/HelpIds.hrc +++ b/chart2/source/controller/inc/HelpIds.hrc @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: HelpIds.hrc,v $ - * $Revision: 1.8 $ + * $Revision: 1.8.56.2 $ * * This file is part of OpenOffice.org. * @@ -31,7 +31,7 @@ #define CHART_HELPIDS_HRC #include -//next is 115 +//next is 118 //see old chart: schhids.h @@ -141,6 +141,9 @@ #define HID_SCH_PB_PERCENT_NUMBERFORMAT (HID_SCH_START + 89) #define HID_SCH_DATALABEL_SEPARATOR (HID_SCH_START + 90) #define HID_SCH_DATALABEL_PLACEMENT (HID_SCH_START + 91) +#define HID_SCH_TEXTDIRECTION (HID_SCH_START + 115) +#define HID_SCH_TEXTDIRECTION_TITLE (HID_SCH_START + 116) +#define HID_SCH_TEXTDIRECTION_EQUATION (HID_SCH_START + 117) #define HID_SCH_TITLE_MAIN (HID_SCH_START + 80) #define HID_SCH_TITLE_SUB (HID_SCH_START + 81) diff --git a/chart2/source/controller/inc/TextDirectionListBox.hxx b/chart2/source/controller/inc/TextDirectionListBox.hxx new file mode 100644 index 000000000000..fdd44069c5c0 --- /dev/null +++ b/chart2/source/controller/inc/TextDirectionListBox.hxx @@ -0,0 +1,52 @@ +/************************************************************************* +* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: TextDirectionListBox.hxx,v $ + * $Revision: 1.1.2.1 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * +************************************************************************/ + +#ifndef CHART2_TEXTDIRECTIONLISTBOX_HXX +#define CHART2_TEXTDIRECTIONLISTBOX_HXX + +#include + +class Window; + +namespace chart +{ + +class TextDirectionListBox : public svx::FrameDirectionListBox +{ +public: + explicit TextDirectionListBox( Window* pParent, const ResId& rResId, + Window* pWindow1 = 0, Window* pWindow2 = 0 ); + virtual ~TextDirectionListBox(); +}; + +} //namespace chart + +#endif + diff --git a/chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx b/chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx index 674fac30b3eb..5bd85ffa4d81 100644 --- a/chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: CharacterPropertyItemConverter.cxx,v $ - * $Revision: 1.14 $ + * $Revision: 1.14.56.1 $ * * This file is part of OpenOffice.org. * @@ -70,6 +70,8 @@ namespace IPM_MAP_ENTRY( EE_CHAR_OUTLINE, "CharContoured", 0 ) IPM_MAP_ENTRY( EE_CHAR_EMPHASISMARK, "CharEmphasis", 0 ) + IPM_MAP_ENTRY( EE_PARA_WRITINGDIR, "WritingMode", 0 ) + // IPM_MAP_ENTRY( EE_CHAR_FONTHEIGHT_CJK, "CharHeightAsian", 0 ) // IPM_MAP_ENTRY( EE_CHAR_FONTHEIGHT_CTL, "CharHeightComplex", 0 ) // IPM_MAP_ENTRY( EE_CHAR_WEIGHT_CJK, "CharWeightAsian", 0 ) diff --git a/chart2/source/inc/CharacterProperties.hxx b/chart2/source/inc/CharacterProperties.hxx index 9e6d78af449d..c3f2f40b0e9b 100644 --- a/chart2/source/inc/CharacterProperties.hxx +++ b/chart2/source/inc/CharacterProperties.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: CharacterProperties.hxx,v $ - * $Revision: 1.4 $ + * $Revision: 1.4.72.1 $ * * This file is part of OpenOffice.org. * @@ -121,6 +121,8 @@ public: PROP_CHAR_COMPLEX_POSTURE, PROP_CHAR_COMPLEX_LOCALE, + PROP_WRITING_MODE, + // don't use FAST_PROPERTY_ID_END_CHAR_PROP }; diff --git a/chart2/source/inc/Strings.hrc b/chart2/source/inc/Strings.hrc index 183d6c9a417e..50e5e4d94820 100644 --- a/chart2/source/inc/Strings.hrc +++ b/chart2/source/inc/Strings.hrc @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: Strings.hrc,v $ - * $Revision: 1.9 $ + * $Revision: 1.9.72.1 $ * * This file is part of OpenOffice.org. * @@ -33,7 +33,7 @@ // this includes no link dependency #include -//next is 277 +//next is 281 //#define RID_APP_START 30000 ////#define STR_NULL (RID_APP_START + 1) @@ -321,6 +321,12 @@ #define STR_DATA_EDITOR_INCORRECT_INPUT (RID_APP_START + 269) +// frame direction ------------------------------------------------------------ + +#define STR_TEXT_DIRECTION_LTR (RID_APP_START + 278) +#define STR_TEXT_DIRECTION_RTL (RID_APP_START + 279) +#define STR_TEXT_DIRECTION_SUPER (RID_APP_START + 280) + //----------------------------------------------------------------------------- /* ////#define STR_DIAGRAM_X_AXIS (RID_APP_START + 34) diff --git a/chart2/source/tools/CharacterProperties.cxx b/chart2/source/tools/CharacterProperties.cxx index 253c9966a501..937aec554215 100644 --- a/chart2/source/tools/CharacterProperties.cxx +++ b/chart2/source/tools/CharacterProperties.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: CharacterProperties.cxx,v $ - * $Revision: 1.11 $ + * $Revision: 1.11.46.1 $ * * This file is part of OpenOffice.org. * @@ -50,6 +50,7 @@ #include #include #include +#include #include @@ -454,6 +455,14 @@ void CharacterProperties::AddPropertiesToVector( ::getCppuType( reinterpret_cast< const lang::Locale * >(0)), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEDEFAULT )); + + // Writing Mode left to right vs right to left + rOutProperties.push_back( + Property( C2U( "WritingMode" ), + PROP_WRITING_MODE, + ::getCppuType( reinterpret_cast< const sal_Int16 * >(0)), /*com::sun::star::text::WritingMode2*/ + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::MAYBEDEFAULT )); } void CharacterProperties::AddDefaultsToMap( @@ -530,6 +539,8 @@ void CharacterProperties::AddDefaultsToMap( ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_COMPLEX_FONT_FAMILY, sal_Int16(aFontCTL.GetFamily()) ); ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_COMPLEX_CHAR_SET, sal_Int16(aFontCTL.GetCharSet()) ); ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_COMPLEX_FONT_PITCH, sal_Int16(aFontCTL.GetPitch()) ); + + ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_WRITING_MODE, sal_Int16( com::sun::star::text::WritingMode2::PAGE ) ); } bool CharacterProperties::IsCharacterPropertyHandle( sal_Int32 nHandle ) diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx index 28be0740d23d..276889f5c296 100644 --- a/chart2/source/view/main/ChartView.cxx +++ b/chart2/source/view/main/ChartView.cxx @@ -99,6 +99,13 @@ #include #include +#include +#include +#include +#include +#include +#include + //............................................................................. namespace chart { @@ -1112,6 +1119,140 @@ bool lcl_resizeAfterCompleteCreation( const uno::Reference< XDiagram >& xDiagram return DiagramHelper::isPieOrDonutChart( xDiagram ); } +void lcl_setDefaultWritingMode( ::boost::shared_ptr< DrawModelWrapper > pDrawModelWrapper, const Reference< frame::XModel >& xChartModel ) +{ + //get writing mode from parent document: + if( SvtLanguageOptions().IsCTLFontEnabled() ) + { + try + { + uno::Reference< container::XChild > xChild( xChartModel, uno::UNO_QUERY ); + sal_Int16 nWritingMode=-1; + if ( xChild.is() ) + { + uno::Reference< beans::XPropertySet > xParentProps( xChild->getParent(), uno::UNO_QUERY ); + uno::Reference< style::XStyleFamiliesSupplier > xStyleFamiliesSupplier( xParentProps, uno::UNO_QUERY ); + if( xStyleFamiliesSupplier.is() ) + { + uno::Reference< container::XNameAccess > xStylesFamilies( xStyleFamiliesSupplier->getStyleFamilies() ); + if( xStylesFamilies.is() ) + { + if( !xStylesFamilies->hasByName( C2U("PageStyles") ) ) + { + //draw/impress is parent document + uno::Reference< lang::XMultiServiceFactory > xFatcory( xParentProps, uno::UNO_QUERY ); + if( xFatcory.is() ) + { + uno::Reference< beans::XPropertySet > xDrawDefaults( xFatcory->createInstance( C2U( "com.sun.star.drawing.Defaults" ) ), uno::UNO_QUERY ); + if( xDrawDefaults.is() ) + xDrawDefaults->getPropertyValue( C2U("WritingMode") ) >>= nWritingMode; + } + } + else + { + uno::Reference< container::XNameAccess > xPageStyles( xStylesFamilies->getByName( C2U("PageStyles") ), uno::UNO_QUERY ); + if( xPageStyles.is() ) + { + rtl::OUString aPageStyle; + + uno::Reference< text::XTextDocument > xTextDocument( xParentProps, uno::UNO_QUERY ); + if( xTextDocument.is() ) + { + //writer is parent document + //retrieve the current page style from the text cursor property PageStyleName + + uno::Reference< text::XTextEmbeddedObjectsSupplier > xTextEmbeddedObjectsSupplier( xTextDocument, uno::UNO_QUERY ); + if( xTextEmbeddedObjectsSupplier.is() ) + { + uno::Reference< container::XNameAccess > xEmbeddedObjects( xTextEmbeddedObjectsSupplier->getEmbeddedObjects() ); + if( xEmbeddedObjects.is() ) + { + uno::Sequence< rtl::OUString > aNames( xEmbeddedObjects->getElementNames() ); + + sal_Int32 nCount = aNames.getLength(); + for( sal_Int32 nN=0; nN xEmbeddedProps( xEmbeddedObjects->getByName( aNames[nN] ), uno::UNO_QUERY ); + if( xEmbeddedProps.is() ) + { + static rtl::OUString aChartCLSID = rtl::OUString( SvGlobalName( SO3_SCH_CLASSID ).GetHexName()); + rtl::OUString aCLSID; + xEmbeddedProps->getPropertyValue( C2U("CLSID") ) >>= aCLSID; + if( aCLSID.equals(aChartCLSID) ) + { + uno::Reference< frame::XModel > xModel; + xEmbeddedProps->getPropertyValue( C2U("Model") ) >>= xModel; + if( xModel == xChartModel ) + { + uno::Reference< text::XTextContent > xEmbeddedObject( xEmbeddedProps, uno::UNO_QUERY ); + if( xEmbeddedObject.is() ) + { + uno::Reference< text::XTextRange > xAnchor( xEmbeddedObject->getAnchor() ); + if( xAnchor.is() ) + { + uno::Reference< beans::XPropertySet > xAnchorProps( xAnchor, uno::UNO_QUERY ); + if( xAnchorProps.is() ) + { + xAnchorProps->getPropertyValue( C2U("WritingMode") ) >>= nWritingMode; + } + uno::Reference< text::XText > xText( xAnchor->getText() ); + if( xText.is() ) + { + uno::Reference< beans::XPropertySet > xTextCursorProps( xText->createTextCursor(), uno::UNO_QUERY ); + if( xTextCursorProps.is() ) + xTextCursorProps->getPropertyValue( C2U("PageStyleName") ) >>= aPageStyle; + } + } + } + break; + } + } + } + } + } + } + if( !aPageStyle.getLength() ) + { + uno::Reference< text::XText > xText( xTextDocument->getText() ); + if( xText.is() ) + { + uno::Reference< beans::XPropertySet > xTextCursorProps( xText->createTextCursor(), uno::UNO_QUERY ); + if( xTextCursorProps.is() ) + xTextCursorProps->getPropertyValue( C2U("PageStyleName") ) >>= aPageStyle; + } + } + } + else + { + //Calc is parent document + xParentProps->getPropertyValue( C2U("PageStyle") ) >>= aPageStyle; + if(!aPageStyle.getLength()) + aPageStyle = C2U("Default"); + } + if( nWritingMode == -1 || nWritingMode == text::WritingMode2::PAGE ) + { + uno::Reference< beans::XPropertySet > xPageStyle( xPageStyles->getByName( aPageStyle ), uno::UNO_QUERY ); + if( xPageStyle.is() ) + xPageStyle->getPropertyValue( C2U("WritingMode") ) >>= nWritingMode; + } + } + } + } + } + } + if( nWritingMode != -1 && nWritingMode != text::WritingMode2::PAGE ) + { + if( pDrawModelWrapper.get() ) + pDrawModelWrapper->GetItemPool().SetPoolDefaultItem(SfxInt32Item(EE_PARA_WRITINGDIR, nWritingMode) ); + } + } + catch( uno::Exception& ex ) + { + ASSERT_EXCEPTION( ex ); + } + } +} + } //end anonymous namespace //------------ create complete diagram shape (inclusive axis and series) @@ -2177,6 +2318,8 @@ void ChartView::createShapes() // \-- } + lcl_setDefaultWritingMode( m_pDrawModelWrapper, m_xChartModel ); + awt::Size aPageSize = ChartModelHelper::getPageSize( m_xChartModel ); uno::Reference xPageShapes( ShapeFactory(m_xShapeFactory) diff --git a/chart2/source/view/main/PropertyMapper.cxx b/chart2/source/view/main/PropertyMapper.cxx index 70de9959b7ce..459f2e1dae86 100644 --- a/chart2/source/view/main/PropertyMapper.cxx +++ b/chart2/source/view/main/PropertyMapper.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: PropertyMapper.cxx,v $ - * $Revision: 1.11 $ + * $Revision: 1.11.46.1 $ * * This file is part of OpenOffice.org. * @@ -244,6 +244,8 @@ const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForCharacterProper ( C2U( "CharWeightComplex" ), C2U("CharWeightComplex") ) ( C2U( "CharWordMode" ), C2U("CharWordMode") ) + ( C2U( "WritingMode" ), C2U("WritingMode") ) + // ( C2U( "RubyText" ), C2U("RubyText") ) // ( C2U( "RubyAdjust" ), C2U("RubyAdjust") ) // ( C2U( "RubyCharStyleName" ), C2U("RubyStyleName") ) -- cgit