summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorThomas Benisch <tbe@openoffice.org>2009-09-08 10:19:21 +0000
committerThomas Benisch <tbe@openoffice.org>2009-09-08 10:19:21 +0000
commit01a8bc45ebfe6b517e541457abb6d121b6de8a71 (patch)
treea272bc8d41a4e3859369cf4059fdd6f642ef87a3 /chart2
parentf4d422a1b9935657c014bb754039455eb9d6c6a8 (diff)
#i12587# Inserting/editing arbitrary text objects in chart
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/controller/dialogs/ResourceIds.hrc177
-rw-r--r--chart2/source/controller/dialogs/dlg_ShapeParagraph.cxx96
-rw-r--r--chart2/source/controller/dialogs/dlg_ShapeParagraph.src70
-rw-r--r--chart2/source/controller/dialogs/makefile.mk416
-rw-r--r--chart2/source/controller/inc/ShapeController.hrc105
-rw-r--r--chart2/source/controller/inc/dlg_ShapeParagraph.hxx57
-rw-r--r--chart2/source/controller/main/ShapeController.cxx1420
-rw-r--r--chart2/source/controller/main/ShapeController.hxx205
-rw-r--r--chart2/source/controller/menus/ShapeEditContextMenu.src133
9 files changed, 1482 insertions, 1197 deletions
diff --git a/chart2/source/controller/dialogs/ResourceIds.hrc b/chart2/source/controller/dialogs/ResourceIds.hrc
index 522477d22c2d..a9a4b1611bb6 100644
--- a/chart2/source/controller/dialogs/ResourceIds.hrc
+++ b/chart2/source/controller/dialogs/ResourceIds.hrc
@@ -1,88 +1,89 @@
-/*************************************************************************
- *
- * 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: ResourceIds.hrc,v $
- * $Revision: 1.6 $
- *
- * 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
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CHART2_RESOURCE_IDS_HRC
-#define _CHART2_RESOURCE_IDS_HRC
-
-//-----------------------------------------------------------------------------
-//for strings see Strings.hrc
-
-//-----------------------------------------------------------------------------
-//for Bimaps see Bimaps.hrc and Bimaps_HC.hrc
-
-//-----------------------------------------------------------------------------
-//Dialog Ids:
-#define DLG_DIAGRAM_TYPE 743
-#define DLG_CHART_WIZARD 902
-#define DLG_DATA_SOURCE 901
-#define DLG_AXIS_OR_GRID 839
-#define DLG_DATA_DESCR 836
-#define DLG_LEGEND 835
-#define DLG_TITLE 834
-#define DLG_3D_VIEW 752
-#define DLG_OBJECT_PROPERTIES 903
-#define DLG_SPLINE_PROPERTIES 904
-#define DLG_DATA_TRENDLINE 841
-#define DLG_DATA_YERRORBAR 842
-#define DLG_SHAPE_FONT 921
-
-//-----------------------------------------------------------------------------
-//TabPage Ids:
-#define TP_LEGEND_POS 900
-#define TP_DATA_DESCR 901
-#define TP_ALIGNMENT 902
-//#define TP_SYMBOL 906
-#define TP_LAYOUT 907
-#define TP_OPTIONS 908
-#define TP_POLAROPTIONS 909
-#define TP_AXIS_LABEL 920
-#define TP_SCALE 903
-#define TP_AXIS_POSITIONS 904
-#define TP_CHARTTYPE 910
-#define TP_RANGECHOOSER 911
-#define TP_WIZARD_TITLEANDOBJECTS 912
-#define TP_LOCATION 913
-#define TP_DATA_SOURCE 914
-
-#define TP_3D_SCENEGEOMETRY 915
-#define TP_3D_SCENEAPPEARANCE 916
-#define TP_3D_SCENEILLUMINATION 917
-
-#define TP_TRENDLINE 918
-#define TP_YERRORBAR 919
-
-//-----------------------------------------------------------------------------
-//listbox Ids:
-#define LB_BAR_GEOMETRY 1000
-#define LB_TEXT_SEPARATOR 1001
-
-//-----------------------------------------------------------------------------
-
-#endif
+/*************************************************************************
+ *
+ * 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: ResourceIds.hrc,v $
+ * $Revision: 1.6 $
+ *
+ * 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
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _CHART2_RESOURCE_IDS_HRC
+#define _CHART2_RESOURCE_IDS_HRC
+
+//-----------------------------------------------------------------------------
+//for strings see Strings.hrc
+
+//-----------------------------------------------------------------------------
+//for Bimaps see Bimaps.hrc and Bimaps_HC.hrc
+
+//-----------------------------------------------------------------------------
+//Dialog Ids:
+#define DLG_DIAGRAM_TYPE 743
+#define DLG_CHART_WIZARD 902
+#define DLG_DATA_SOURCE 901
+#define DLG_AXIS_OR_GRID 839
+#define DLG_DATA_DESCR 836
+#define DLG_LEGEND 835
+#define DLG_TITLE 834
+#define DLG_3D_VIEW 752
+#define DLG_OBJECT_PROPERTIES 903
+#define DLG_SPLINE_PROPERTIES 904
+#define DLG_DATA_TRENDLINE 841
+#define DLG_DATA_YERRORBAR 842
+#define DLG_SHAPE_FONT 921
+#define DLG_SHAPE_PARAGRAPH 922
+
+//-----------------------------------------------------------------------------
+//TabPage Ids:
+#define TP_LEGEND_POS 900
+#define TP_DATA_DESCR 901
+#define TP_ALIGNMENT 902
+//#define TP_SYMBOL 906
+#define TP_LAYOUT 907
+#define TP_OPTIONS 908
+#define TP_POLAROPTIONS 909
+#define TP_AXIS_LABEL 920
+#define TP_SCALE 903
+#define TP_AXIS_POSITIONS 904
+#define TP_CHARTTYPE 910
+#define TP_RANGECHOOSER 911
+#define TP_WIZARD_TITLEANDOBJECTS 912
+#define TP_LOCATION 913
+#define TP_DATA_SOURCE 914
+
+#define TP_3D_SCENEGEOMETRY 915
+#define TP_3D_SCENEAPPEARANCE 916
+#define TP_3D_SCENEILLUMINATION 917
+
+#define TP_TRENDLINE 918
+#define TP_YERRORBAR 919
+
+//-----------------------------------------------------------------------------
+//listbox Ids:
+#define LB_BAR_GEOMETRY 1000
+#define LB_TEXT_SEPARATOR 1001
+
+//-----------------------------------------------------------------------------
+
+#endif
diff --git a/chart2/source/controller/dialogs/dlg_ShapeParagraph.cxx b/chart2/source/controller/dialogs/dlg_ShapeParagraph.cxx
new file mode 100644
index 000000000000..4e56aca25563
--- /dev/null
+++ b/chart2/source/controller/dialogs/dlg_ShapeParagraph.cxx
@@ -0,0 +1,96 @@
+/*************************************************************************
+ *
+ * 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: dlg_ShapeFont.cxx,v $
+ * $Revision: 1.0 $
+ *
+ * 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
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_chart2.hxx"
+
+#include "dlg_ShapeParagraph.hxx"
+#include "ResId.hxx"
+#include "ResourceIds.hrc"
+
+#include <svtools/cjkoptions.hxx>
+#include <svtools/intitem.hxx>
+#include <svx/dialogs.hrc>
+#include <svx/flagsdef.hxx>
+
+using ::com::sun::star::uno::Reference;
+using namespace ::com::sun::star;
+
+//.............................................................................
+namespace chart
+{
+//.............................................................................
+
+ShapeParagraphDialog::ShapeParagraphDialog( Window* pParent, const SfxItemSet* pAttr )
+ :SfxTabDialog( pParent, SchResId( DLG_SHAPE_PARAGRAPH ), pAttr )
+{
+ FreeResource();
+
+ SvtCJKOptions aCJKOptions;
+
+ AddTabPage( RID_SVXPAGE_STD_PARAGRAPH );
+ AddTabPage( RID_SVXPAGE_ALIGN_PARAGRAPH );
+ if ( aCJKOptions.IsAsianTypographyEnabled() )
+ {
+ AddTabPage( RID_SVXPAGE_PARA_ASIAN );
+ }
+ else
+ {
+ RemoveTabPage( RID_SVXPAGE_PARA_ASIAN );
+ }
+ AddTabPage( RID_SVXPAGE_TABULATOR );
+}
+
+ShapeParagraphDialog::~ShapeParagraphDialog()
+{
+}
+
+void ShapeParagraphDialog::PageCreated( USHORT nId, SfxTabPage& rPage )
+{
+ SfxAllItemSet aSet( *( GetInputSetImpl()->GetPool() ) );
+ switch ( nId )
+ {
+ case RID_SVXPAGE_TABULATOR:
+ {
+ aSet.Put( SfxUInt16Item( SID_SVXTABULATORTABPAGE_CONTROLFLAGS,
+ ( TABTYPE_ALL &~TABTYPE_LEFT ) | ( TABFILL_ALL &~TABFILL_NONE ) ) );
+ rPage.PageCreated( aSet );
+ }
+ break;
+ default:
+ {
+ }
+ break;
+ }
+}
+
+//.............................................................................
+} //namespace chart
+//.............................................................................
diff --git a/chart2/source/controller/dialogs/dlg_ShapeParagraph.src b/chart2/source/controller/dialogs/dlg_ShapeParagraph.src
new file mode 100644
index 000000000000..d927c643666d
--- /dev/null
+++ b/chart2/source/controller/dialogs/dlg_ShapeParagraph.src
@@ -0,0 +1,70 @@
+/*************************************************************************
+ *
+ * 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: dlg_ShapeFont.src,v $
+ * $Revision: 1.0 $
+ *
+ * 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
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "ResourceIds.hrc"
+#include <svx/dialogs.hrc>
+
+TabDialog DLG_SHAPE_PARAGRAPH
+{
+ OutputSize = TRUE ;
+ SVLook = TRUE ;
+ Size = MAP_APPFONT ( 289 , 176 ) ;
+ Text [ en-US ] = "Paragraph" ;
+ Moveable = TRUE ;
+ Closeable = TRUE ;
+ TabControl 1
+ {
+ OutputSize = TRUE ;
+ Pos = MAP_APPFONT ( 3 , 3 ) ;
+ Size = MAP_APPFONT ( 260 , 135 ) ;
+ PageList =
+ {
+ PageItem
+ {
+ Identifier = RID_SVXPAGE_STD_PARAGRAPH ;
+ Text [ en-US ] = "Indents & Spacing";
+ };
+ PageItem
+ {
+ Identifier = RID_SVXPAGE_ALIGN_PARAGRAPH ;
+ Text [ en-US ] = "Alignment";
+ };
+ PageItem
+ {
+ Identifier = RID_SVXPAGE_PARA_ASIAN ;
+ Text [ en-US ] = "Asian Typography";
+ };
+ PageItem
+ {
+ Identifier = RID_SVXPAGE_TABULATOR ;
+ Text [ en-US ] = "Tab";
+ };
+ };
+ };
+};
diff --git a/chart2/source/controller/dialogs/makefile.mk b/chart2/source/controller/dialogs/makefile.mk
index 02344ec73d5b..d87742e507a1 100644
--- a/chart2/source/controller/dialogs/makefile.mk
+++ b/chart2/source/controller/dialogs/makefile.mk
@@ -1,207 +1,209 @@
-#*************************************************************************
-#
-# 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: makefile.mk,v $
-#
-# $Revision: 1.19.72.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
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ= ..$/..$/..
-PRJINC= $(PRJ)$/source
-PRJNAME= chart2
-TARGET= chcdialogs
-
-ENABLE_EXCEPTIONS= TRUE
-VISIBILITY_HIDDEN=TRUE
-GEN_HID_OTHER=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE: settings.mk
-
-# i26518 the gcc-3.0.4 requires to enhance the template-depth
-# this seems to be a compiler issue, so we recommend not to use 3.0.x anymore
-.IF "$(COM)"=="GCC"
- CFLAGS+=-ftemplate-depth-128
-.ENDIF
-
-# --- export library -------------------------------------------------
-
-#object files to build and link together to lib $(SLB)$/$(TARGET).lib
-SLOFILES= \
- $(SLO)$/ObjectNameProvider.obj \
- $(SLO)$/TimerTriggeredControllerLock.obj \
- $(SLO)$/ChangingResource.obj \
- $(SLO)$/DataBrowser.obj \
- $(SLO)$/DataBrowserModel.obj \
- $(SLO)$/DialogModel.obj \
- $(SLO)$/TitleDialogData.obj \
- $(SLO)$/res_Titles.obj \
- $(SLO)$/res_TextSeparator.obj \
- $(SLO)$/res_ErrorBar.obj \
- $(SLO)$/res_Trendline.obj \
- $(SLO)$/res_BarGeometry.obj \
- $(SLO)$/res_LegendPosition.obj \
- $(SLO)$/res_DataLabel.obj \
- $(SLO)$/ChartTypeDialogController.obj \
- $(SLO)$/tp_ChartType.obj \
- $(SLO)$/tp_RangeChooser.obj \
- $(SLO)$/tp_Wizard_TitlesAndObjects.obj \
- $(SLO)$/tp_Location.obj \
- $(SLO)$/tp_AxisLabel.obj \
- $(SLO)$/tp_AxisPositions.obj \
- $(SLO)$/tp_DataLabel.obj \
- $(SLO)$/tp_DataSource.obj \
- $(SLO)$/tp_DataSourceControls.obj \
- $(SLO)$/tp_LegendPosition.obj \
- $(SLO)$/tp_PointGeometry.obj \
- $(SLO)$/tp_Scale.obj \
- $(SLO)$/tp_Trendline.obj \
- $(SLO)$/tp_ErrorBars.obj \
- $(SLO)$/tp_SeriesToAxis.obj \
- $(SLO)$/tp_TitleRotation.obj \
- $(SLO)$/tp_3D_SceneGeometry.obj \
- $(SLO)$/tp_3D_SceneAppearance.obj \
- $(SLO)$/tp_3D_SceneIllumination.obj \
- $(SLO)$/tp_PolarOptions.obj \
- $(SLO)$/dlg_ObjectProperties.obj \
- $(SLO)$/dlg_DataEditor.obj \
- $(SLO)$/dlg_DataSource.obj \
- $(SLO)$/dlg_View3D.obj \
- $(SLO)$/dlg_InsertAxis_Grid.obj \
- $(SLO)$/dlg_InsertDataLabel.obj \
- $(SLO)$/dlg_InsertLegend.obj \
- $(SLO)$/dlg_InsertTrendline.obj \
- $(SLO)$/dlg_InsertErrorBars.obj \
- $(SLO)$/dlg_InsertTitle.obj \
- $(SLO)$/dlg_CreationWizard.obj \
- $(SLO)$/dlg_CreationWizard_UNO.obj \
- $(SLO)$/dlg_ChartType_UNO.obj \
- $(SLO)$/dlg_ChartType.obj \
- $(SLO)$/dlg_NumberFormat.obj \
- $(SLO)$/dlg_ShapeFont.obj \
- $(SLO)$/RangeSelectionButton.obj \
- $(SLO)$/RangeSelectionHelper.obj \
- $(SLO)$/RangeSelectionListener.obj \
- $(SLO)$/RangeEdit.obj \
- $(SLO)$/TextDirectionListBox.obj
-
-# --- Resources ---------------------------------------------------------------
-
-# Bitmaps.src
-# Bitmaps_HC.src
-
-
-SRC1FILES= \
- res_TextSeparator.src \
- res_BarGeometry.src \
- tp_ChartType.src \
- tp_RangeChooser.src \
- tp_Wizard_TitlesAndObjects.src \
- tp_Location.src \
- tp_AxisLabel.src \
- tp_AxisPositions.src \
- tp_DataLabel.src \
- tp_DataSource.src \
- tp_LegendPosition.src \
- tp_PointGeometry.src \
- tp_Scale.src \
- tp_Trendline.src \
- tp_ErrorBars.src \
- tp_SeriesToAxis.src \
- tp_TitleRotation.src \
- tp_3D_SceneGeometry.src \
- tp_3D_SceneAppearance.src \
- tp_3D_SceneIllumination.src \
- tp_PolarOptions.src \
- dlg_ObjectProperties.src \
- Strings_Statistic.src \
- Strings_Scale.src \
- Strings_ChartTypes.src \
- Strings_AdditionalControls.src \
- Strings.src \
- Bitmaps.src \
- Bitmaps_HC.src \
- dlg_DataEditor.src \
- dlg_DataSource.src \
- dlg_View3D.src \
- dlg_InsertAxis_Grid.src \
- dlg_InsertDataLabel.src \
- dlg_InsertLegend.src \
- dlg_InsertTrendline.src \
- dlg_InsertErrorBars.src \
- dlg_InsertTitle.src \
- dlg_ChartType.src \
- dlg_CreationWizard.src \
- dlg_ShapeFont.src
-
-SRS1NAME=$(TARGET)
-
-# --- Targets -----------------------------------------------------------------
-LOCALIZE_ME=res_DataLabel_tmpl.hrc res_LegendPosition_tmpl.hrc res_Trendline_tmpl.hrc res_ErrorBar_tmpl.hrc res_Titlesx_tmpl.hrc res_SecondaryAxisCheckBoxes_tmpl.hrc
-.INCLUDE: target.mk
-$(SRS)$/chcdialogs.srs: $(INCCOM)$/res_DataLabel.hrc
-$(SRS)$/chcdialogs.srs: $(INCCOM)$/res_LegendPosition.hrc
-$(SRS)$/chcdialogs.srs: $(INCCOM)$/res_Trendline.hrc
-$(SRS)$/chcdialogs.srs: $(INCCOM)$/res_ErrorBar.hrc
-$(SRS)$/chcdialogs.srs: $(INCCOM)$/res_Titlesx.hrc
-$(SRS)$/chcdialogs.srs: $(INCCOM)$/res_SecondaryAxisCheckBoxes.hrc
-
-#dependencies:
-
-$(SRS)$/chcdialogs.srs: \
- Bitmaps.hrc \
- Bitmaps_HC.hrc \
- CommonResources.hrc \
- ResourceIds.hrc \
- ..$/..$/inc$/Strings.hrc \
- TabPages.hrc \
- dlg_CreationWizard.hrc \
- dlg_DataSource.hrc \
- dlg_InsertAxis_Grid.hrc \
- dlg_InsertDataLabel.hrc \
- dlg_InsertLegend.hrc \
- dlg_InsertTrendline.hrc \
- dlg_InsertErrorBars.hrc \
- dlg_InsertTitle.hrc \
- dlg_View3D.hrc \
- res_Titles.hrc \
- tp_3D_SceneAppearance.hrc \
- tp_3D_SceneGeometry.hrc \
- tp_3D_SceneIllumination.hrc \
- tp_PolarOptions.hrc \
- tp_ChartType.hrc \
- tp_DataSource.hrc \
- tp_Location.hrc \
- tp_RangeChooser.hrc \
- tp_Wizard_TitlesAndObjects.hrc
-
-# res_DataLabel.hrc \
-# res_LegendPosition.hrc \
-# res_Statistic.hrc \
-
-#$(SRS)$/chcdialogs.srs: $(SOLARINCDIR)$/svx$/globlmn.hrc
-
+#*************************************************************************
+#
+# 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: makefile.mk,v $
+#
+# $Revision: 1.19.72.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
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+PRJ= ..$/..$/..
+PRJINC= $(PRJ)$/source
+PRJNAME= chart2
+TARGET= chcdialogs
+
+ENABLE_EXCEPTIONS= TRUE
+VISIBILITY_HIDDEN=TRUE
+GEN_HID_OTHER=TRUE
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE: settings.mk
+
+# i26518 the gcc-3.0.4 requires to enhance the template-depth
+# this seems to be a compiler issue, so we recommend not to use 3.0.x anymore
+.IF "$(COM)"=="GCC"
+ CFLAGS+=-ftemplate-depth-128
+.ENDIF
+
+# --- export library -------------------------------------------------
+
+#object files to build and link together to lib $(SLB)$/$(TARGET).lib
+SLOFILES= \
+ $(SLO)$/ObjectNameProvider.obj \
+ $(SLO)$/TimerTriggeredControllerLock.obj \
+ $(SLO)$/ChangingResource.obj \
+ $(SLO)$/DataBrowser.obj \
+ $(SLO)$/DataBrowserModel.obj \
+ $(SLO)$/DialogModel.obj \
+ $(SLO)$/TitleDialogData.obj \
+ $(SLO)$/res_Titles.obj \
+ $(SLO)$/res_TextSeparator.obj \
+ $(SLO)$/res_ErrorBar.obj \
+ $(SLO)$/res_Trendline.obj \
+ $(SLO)$/res_BarGeometry.obj \
+ $(SLO)$/res_LegendPosition.obj \
+ $(SLO)$/res_DataLabel.obj \
+ $(SLO)$/ChartTypeDialogController.obj \
+ $(SLO)$/tp_ChartType.obj \
+ $(SLO)$/tp_RangeChooser.obj \
+ $(SLO)$/tp_Wizard_TitlesAndObjects.obj \
+ $(SLO)$/tp_Location.obj \
+ $(SLO)$/tp_AxisLabel.obj \
+ $(SLO)$/tp_AxisPositions.obj \
+ $(SLO)$/tp_DataLabel.obj \
+ $(SLO)$/tp_DataSource.obj \
+ $(SLO)$/tp_DataSourceControls.obj \
+ $(SLO)$/tp_LegendPosition.obj \
+ $(SLO)$/tp_PointGeometry.obj \
+ $(SLO)$/tp_Scale.obj \
+ $(SLO)$/tp_Trendline.obj \
+ $(SLO)$/tp_ErrorBars.obj \
+ $(SLO)$/tp_SeriesToAxis.obj \
+ $(SLO)$/tp_TitleRotation.obj \
+ $(SLO)$/tp_3D_SceneGeometry.obj \
+ $(SLO)$/tp_3D_SceneAppearance.obj \
+ $(SLO)$/tp_3D_SceneIllumination.obj \
+ $(SLO)$/tp_PolarOptions.obj \
+ $(SLO)$/dlg_ObjectProperties.obj \
+ $(SLO)$/dlg_DataEditor.obj \
+ $(SLO)$/dlg_DataSource.obj \
+ $(SLO)$/dlg_View3D.obj \
+ $(SLO)$/dlg_InsertAxis_Grid.obj \
+ $(SLO)$/dlg_InsertDataLabel.obj \
+ $(SLO)$/dlg_InsertLegend.obj \
+ $(SLO)$/dlg_InsertTrendline.obj \
+ $(SLO)$/dlg_InsertErrorBars.obj \
+ $(SLO)$/dlg_InsertTitle.obj \
+ $(SLO)$/dlg_CreationWizard.obj \
+ $(SLO)$/dlg_CreationWizard_UNO.obj \
+ $(SLO)$/dlg_ChartType_UNO.obj \
+ $(SLO)$/dlg_ChartType.obj \
+ $(SLO)$/dlg_NumberFormat.obj \
+ $(SLO)$/dlg_ShapeFont.obj \
+ $(SLO)$/dlg_ShapeParagraph.obj \
+ $(SLO)$/RangeSelectionButton.obj \
+ $(SLO)$/RangeSelectionHelper.obj \
+ $(SLO)$/RangeSelectionListener.obj \
+ $(SLO)$/RangeEdit.obj \
+ $(SLO)$/TextDirectionListBox.obj
+
+# --- Resources ---------------------------------------------------------------
+
+# Bitmaps.src
+# Bitmaps_HC.src
+
+
+SRC1FILES= \
+ res_TextSeparator.src \
+ res_BarGeometry.src \
+ tp_ChartType.src \
+ tp_RangeChooser.src \
+ tp_Wizard_TitlesAndObjects.src \
+ tp_Location.src \
+ tp_AxisLabel.src \
+ tp_AxisPositions.src \
+ tp_DataLabel.src \
+ tp_DataSource.src \
+ tp_LegendPosition.src \
+ tp_PointGeometry.src \
+ tp_Scale.src \
+ tp_Trendline.src \
+ tp_ErrorBars.src \
+ tp_SeriesToAxis.src \
+ tp_TitleRotation.src \
+ tp_3D_SceneGeometry.src \
+ tp_3D_SceneAppearance.src \
+ tp_3D_SceneIllumination.src \
+ tp_PolarOptions.src \
+ dlg_ObjectProperties.src \
+ Strings_Statistic.src \
+ Strings_Scale.src \
+ Strings_ChartTypes.src \
+ Strings_AdditionalControls.src \
+ Strings.src \
+ Bitmaps.src \
+ Bitmaps_HC.src \
+ dlg_DataEditor.src \
+ dlg_DataSource.src \
+ dlg_View3D.src \
+ dlg_InsertAxis_Grid.src \
+ dlg_InsertDataLabel.src \
+ dlg_InsertLegend.src \
+ dlg_InsertTrendline.src \
+ dlg_InsertErrorBars.src \
+ dlg_InsertTitle.src \
+ dlg_ChartType.src \
+ dlg_CreationWizard.src \
+ dlg_ShapeFont.src \
+ dlg_ShapeParagraph.src
+
+SRS1NAME=$(TARGET)
+
+# --- Targets -----------------------------------------------------------------
+LOCALIZE_ME=res_DataLabel_tmpl.hrc res_LegendPosition_tmpl.hrc res_Trendline_tmpl.hrc res_ErrorBar_tmpl.hrc res_Titlesx_tmpl.hrc res_SecondaryAxisCheckBoxes_tmpl.hrc
+.INCLUDE: target.mk
+$(SRS)$/chcdialogs.srs: $(INCCOM)$/res_DataLabel.hrc
+$(SRS)$/chcdialogs.srs: $(INCCOM)$/res_LegendPosition.hrc
+$(SRS)$/chcdialogs.srs: $(INCCOM)$/res_Trendline.hrc
+$(SRS)$/chcdialogs.srs: $(INCCOM)$/res_ErrorBar.hrc
+$(SRS)$/chcdialogs.srs: $(INCCOM)$/res_Titlesx.hrc
+$(SRS)$/chcdialogs.srs: $(INCCOM)$/res_SecondaryAxisCheckBoxes.hrc
+
+#dependencies:
+
+$(SRS)$/chcdialogs.srs: \
+ Bitmaps.hrc \
+ Bitmaps_HC.hrc \
+ CommonResources.hrc \
+ ResourceIds.hrc \
+ ..$/..$/inc$/Strings.hrc \
+ TabPages.hrc \
+ dlg_CreationWizard.hrc \
+ dlg_DataSource.hrc \
+ dlg_InsertAxis_Grid.hrc \
+ dlg_InsertDataLabel.hrc \
+ dlg_InsertLegend.hrc \
+ dlg_InsertTrendline.hrc \
+ dlg_InsertErrorBars.hrc \
+ dlg_InsertTitle.hrc \
+ dlg_View3D.hrc \
+ res_Titles.hrc \
+ tp_3D_SceneAppearance.hrc \
+ tp_3D_SceneGeometry.hrc \
+ tp_3D_SceneIllumination.hrc \
+ tp_PolarOptions.hrc \
+ tp_ChartType.hrc \
+ tp_DataSource.hrc \
+ tp_Location.hrc \
+ tp_RangeChooser.hrc \
+ tp_Wizard_TitlesAndObjects.hrc
+
+# res_DataLabel.hrc \
+# res_LegendPosition.hrc \
+# res_Statistic.hrc \
+
+#$(SRS)$/chcdialogs.srs: $(SOLARINCDIR)$/svx$/globlmn.hrc
+
diff --git a/chart2/source/controller/inc/ShapeController.hrc b/chart2/source/controller/inc/ShapeController.hrc
index 2016e46c6c82..6d7aa994bb28 100644
--- a/chart2/source/controller/inc/ShapeController.hrc
+++ b/chart2/source/controller/inc/ShapeController.hrc
@@ -1,52 +1,53 @@
-/*************************************************************************
- *
- * 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: ShapeController.hrc,v $
- * $Revision: 1.0 $
- *
- * 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
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CHART_SHAPECONTROLLER_HRC
-#define CHART_SHAPECONTROLLER_HRC
-
-//-----------------------------------------------------------------------------
-//Command Ids:
-#define COMMAND_ID_FORMAT_LINE 1
-#define COMMAND_ID_FORMAT_AREA 2
-#define COMMAND_ID_TEXT_ATTRIBUTES 3
-#define COMMAND_ID_TRANSFORM_DIALOG 4
-#define COMMAND_ID_OBJECT_TITLE_DESCRIPTION 5
-#define COMMAND_ID_RENAME_OBJECT 6
-#define COMMAND_ID_ARRANGE_ROW 7
-#define COMMAND_ID_BRING_TO_FRONT 8
-#define COMMAND_ID_FORWARD 9
-#define COMMAND_ID_BACKWARD 10
-#define COMMAND_ID_SEND_TO_BACK 11
-#define COMMAND_ID_CUT 12
-#define COMMAND_ID_COPY 13
-#define COMMAND_ID_PASTE 14
-#define COMMAND_ID_FONT_DIALOG 15
-
-// CHART_SHAPECONTROLLER_HRC
-#endif
+/*************************************************************************
+ *
+ * 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: ShapeController.hrc,v $
+ * $Revision: 1.0 $
+ *
+ * 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
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef CHART_SHAPECONTROLLER_HRC
+#define CHART_SHAPECONTROLLER_HRC
+
+//-----------------------------------------------------------------------------
+//Command Ids:
+#define COMMAND_ID_FORMAT_LINE 1
+#define COMMAND_ID_FORMAT_AREA 2
+#define COMMAND_ID_TEXT_ATTRIBUTES 3
+#define COMMAND_ID_TRANSFORM_DIALOG 4
+#define COMMAND_ID_OBJECT_TITLE_DESCRIPTION 5
+#define COMMAND_ID_RENAME_OBJECT 6
+#define COMMAND_ID_ARRANGE_ROW 7
+#define COMMAND_ID_BRING_TO_FRONT 8
+#define COMMAND_ID_FORWARD 9
+#define COMMAND_ID_BACKWARD 10
+#define COMMAND_ID_SEND_TO_BACK 11
+#define COMMAND_ID_CUT 12
+#define COMMAND_ID_COPY 13
+#define COMMAND_ID_PASTE 14
+#define COMMAND_ID_FONT_DIALOG 15
+#define COMMAND_ID_PARAGRAPH_DIALOG 16
+
+// CHART_SHAPECONTROLLER_HRC
+#endif
diff --git a/chart2/source/controller/inc/dlg_ShapeParagraph.hxx b/chart2/source/controller/inc/dlg_ShapeParagraph.hxx
new file mode 100644
index 000000000000..f9ad8ab41c7a
--- /dev/null
+++ b/chart2/source/controller/inc/dlg_ShapeParagraph.hxx
@@ -0,0 +1,57 @@
+/*************************************************************************
+ *
+ * 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: dlg_ShapeFont.hxx,v $
+ * $Revision: 1.0 $
+ *
+ * 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
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef CHART2_DLG_SHAPEPARAGRAPH_HXX
+#define CHART2_DLG_SHAPEPARAGRAPH_HXX
+
+#include <sfx2/tabdlg.hxx>
+
+//.............................................................................
+namespace chart
+{
+//.............................................................................
+
+/** dialog for paragraph properties of shapes
+ */
+class ShapeParagraphDialog : public SfxTabDialog
+{
+public:
+ ShapeParagraphDialog( Window* pParent, const SfxItemSet* pAttr );
+ virtual ~ShapeParagraphDialog();
+
+private:
+ virtual void PageCreated( USHORT nId, SfxTabPage& rPage );
+};
+
+//.............................................................................
+} // namespace chart
+//.............................................................................
+
+// CHART2_DLG_SHAPEPARAGRAPH_HXX
+#endif
diff --git a/chart2/source/controller/main/ShapeController.cxx b/chart2/source/controller/main/ShapeController.cxx
index 1fc5017b5f43..00c7f7f34b63 100644
--- a/chart2/source/controller/main/ShapeController.cxx
+++ b/chart2/source/controller/main/ShapeController.cxx
@@ -1,684 +1,736 @@
-/*************************************************************************
- *
- * 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: ShapeController.cxx,v $
- * $Revision: 1.0 $
- *
- * 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
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_chart2.hxx"
-
-#include "ShapeController.hxx"
-#include "ShapeController.hrc"
-#include "ChartController.hxx"
-#include "ChartWindow.hxx"
-#include "ViewElementListProvider.hxx"
-#include "dlg_ShapeFont.hxx"
-#include "chartview/DrawModelWrapper.hxx"
-#include "macros.hxx"
-
-#include <com/sun/star/frame/XStorable.hpp>
-
-#include <vos/mutex.hxx>
-#include <vcl/msgbox.hxx>
-#include <vcl/svapp.hxx>
-#include <svx/drawitem.hxx>
-#include <svx/svxdlg.hxx>
-#include <svx/svxids.hrc>
-#include <svx/dialogs.hrc>
-
-#include <boost/scoped_ptr.hpp>
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::frame;
-
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-
-//.............................................................................
-namespace chart
-{
-//.............................................................................
-
-ShapeController::ShapeController( const Reference< uno::XComponentContext >& rxContext,
- ChartController* pController )
- :FeatureCommandDispatchBase( rxContext )
- ,m_pChartController( pController )
-{
-}
-
-ShapeController::~ShapeController()
-{
-}
-
-void ShapeController::initialize()
-{
- FeatureCommandDispatchBase::initialize();
-}
-
-// WeakComponentImplHelperBase
-void ShapeController::disposing()
-{
-}
-
-// XEventListener
-void ShapeController::disposing( const lang::EventObject& /* Source */ )
- throw (uno::RuntimeException)
-{
-}
-
-FeatureState ShapeController::getState( const ::rtl::OUString& rCommand )
-{
- FeatureState aReturn;
- aReturn.bEnabled = false;
- aReturn.aState <<= false;
-
- bool bWritable = false;
- if ( m_pChartController )
- {
- Reference< frame::XStorable > xStorable( m_pChartController->getModel(), uno::UNO_QUERY );
- if ( xStorable.is() )
- {
- bWritable = !xStorable->isReadonly();
- }
- }
-
- sal_uInt16 nFeatureId = m_aSupportedFeatures[ rCommand ].nFeatureId;
-
- switch ( nFeatureId )
- {
- case COMMAND_ID_FORMAT_LINE:
- case COMMAND_ID_FORMAT_AREA:
- case COMMAND_ID_TEXT_ATTRIBUTES:
- case COMMAND_ID_TRANSFORM_DIALOG:
- case COMMAND_ID_OBJECT_TITLE_DESCRIPTION:
- case COMMAND_ID_RENAME_OBJECT:
- {
- aReturn.bEnabled = bWritable;
- aReturn.aState <<= false;
- }
- break;
- case COMMAND_ID_BRING_TO_FRONT:
- case COMMAND_ID_FORWARD:
- {
- aReturn.bEnabled = ( bWritable && isForwardPossible() );
- aReturn.aState <<= false;
- }
- break;
- case COMMAND_ID_BACKWARD:
- case COMMAND_ID_SEND_TO_BACK:
- {
-
- aReturn.bEnabled = ( bWritable && isBackwardPossible() );
- aReturn.aState <<= false;
- }
- break;
- case COMMAND_ID_FONT_DIALOG:
- {
- aReturn.bEnabled = bWritable;
- aReturn.aState <<= false;
- }
- break;
- default:
- {
- aReturn.bEnabled = false;
- aReturn.aState <<= false;
- }
- break;
- }
-
- return aReturn;
-}
-
-void ShapeController::execute( const ::rtl::OUString& rCommand, const Sequence< beans::PropertyValue>& rArgs )
-{
- (void)rArgs;
-
- sal_uInt16 nFeatureId = m_aSupportedFeatures[ rCommand ].nFeatureId;
-
- switch ( nFeatureId )
- {
- case COMMAND_ID_FORMAT_LINE:
- {
- executeDispatch_FormatLine();
- }
- break;
- case COMMAND_ID_FORMAT_AREA:
- {
- executeDispatch_FormatArea();
- }
- break;
- case COMMAND_ID_TEXT_ATTRIBUTES:
- {
- executeDispatch_TextAttributes();
- }
- break;
- case COMMAND_ID_TRANSFORM_DIALOG:
- {
- executeDispatch_TransformDialog();
- }
- break;
- case COMMAND_ID_OBJECT_TITLE_DESCRIPTION:
- {
- executeDispatch_ObjectTitleDescription();
- }
- break;
- case COMMAND_ID_RENAME_OBJECT:
- {
- executeDispatch_RenameObject();
- }
- break;
- case COMMAND_ID_BRING_TO_FRONT:
- case COMMAND_ID_FORWARD:
- case COMMAND_ID_BACKWARD:
- case COMMAND_ID_SEND_TO_BACK:
- {
- executeDispatch_ChangeZOrder( nFeatureId );
- }
- break;
- case COMMAND_ID_FONT_DIALOG:
- {
- executeDispatch_FontDialog();
- }
- break;
- default:
- {
- }
- break;
- }
-}
-
-void ShapeController::describeSupportedFeatures()
-{
- implDescribeSupportedFeature( ".uno:FormatLine", COMMAND_ID_FORMAT_LINE, CommandGroup::FORMAT );
- implDescribeSupportedFeature( ".uno:FormatArea", COMMAND_ID_FORMAT_AREA, CommandGroup::FORMAT );
- implDescribeSupportedFeature( ".uno:TextAttributes", COMMAND_ID_TEXT_ATTRIBUTES, CommandGroup::FORMAT );
- implDescribeSupportedFeature( ".uno:TransformDialog", COMMAND_ID_TRANSFORM_DIALOG, CommandGroup::FORMAT );
- implDescribeSupportedFeature( ".uno:ObjectTitleDescription", COMMAND_ID_OBJECT_TITLE_DESCRIPTION, CommandGroup::FORMAT );
- implDescribeSupportedFeature( ".uno:RenameObject", COMMAND_ID_RENAME_OBJECT, CommandGroup::FORMAT );
- implDescribeSupportedFeature( ".uno:BringToFront", COMMAND_ID_BRING_TO_FRONT, CommandGroup::FORMAT );
- implDescribeSupportedFeature( ".uno:Forward", COMMAND_ID_FORWARD, CommandGroup::FORMAT );
- implDescribeSupportedFeature( ".uno:Backward", COMMAND_ID_BACKWARD, CommandGroup::FORMAT );
- implDescribeSupportedFeature( ".uno:SendToBack", COMMAND_ID_SEND_TO_BACK, CommandGroup::FORMAT );
- implDescribeSupportedFeature( ".uno:FontDialog", COMMAND_ID_FONT_DIALOG, CommandGroup::EDIT );
-}
-
-IMPL_LINK( ShapeController, CheckNameHdl, AbstractSvxNameDialog*, pDialog )
-{
- String aName;
- if ( pDialog )
- {
- pDialog->GetName( aName );
- }
- if ( aName.Len() )
- {
- DrawViewWrapper* pDrawViewWrapper = ( m_pChartController ? m_pChartController->GetDrawViewWrapper() : NULL );
- if ( pDrawViewWrapper && pDrawViewWrapper->getNamedSdrObject( aName ) )
- {
- return 0;
- }
- }
- return 1;
-}
-
-void ShapeController::executeDispatch_FormatLine()
-{
- if ( m_pChartController )
- {
- Window* pParent = dynamic_cast< Window* >( m_pChartController->m_pChartWindow );
- DrawModelWrapper* pDrawModelWrapper = m_pChartController->GetDrawModelWrapper();
- DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
- if ( pParent && pDrawModelWrapper && pDrawViewWrapper )
- {
- SdrObject* pSelectedObj = pDrawViewWrapper->getSelectedObject();
- SfxItemSet aAttr( pDrawViewWrapper->GetDefaultAttr() );
- BOOL bHasMarked = pDrawViewWrapper->AreObjectsMarked();
- if ( bHasMarked )
- {
- pDrawViewWrapper->MergeAttrFromMarked( aAttr, FALSE );
- }
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- if ( pFact )
- {
- ::boost::scoped_ptr< SfxAbstractTabDialog > pDlg(
- pFact->CreateSvxLineTabDialog( pParent, &aAttr, &pDrawModelWrapper->getSdrModel(),
- RID_SVXDLG_LINE, pSelectedObj, bHasMarked ) );
- if ( pDlg.get() && ( pDlg->Execute() == RET_OK ) )
- {
- const SfxItemSet* pOutAttr = pDlg->GetOutputItemSet();
- if ( bHasMarked )
- {
- pDrawViewWrapper->SetAttrToMarked( *pOutAttr, FALSE );
- }
- else
- {
- pDrawViewWrapper->SetDefaultAttr( *pOutAttr, FALSE );
- }
- }
- }
- }
- }
-}
-
-void ShapeController::executeDispatch_FormatArea()
-{
- if ( m_pChartController )
- {
- Window* pParent = dynamic_cast< Window* >( m_pChartController->m_pChartWindow );
- DrawModelWrapper* pDrawModelWrapper = m_pChartController->GetDrawModelWrapper();
- DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
- if ( pParent && pDrawModelWrapper && pDrawViewWrapper )
- {
- SfxItemSet aAttr( pDrawViewWrapper->GetDefaultAttr() );
- BOOL bHasMarked = pDrawViewWrapper->AreObjectsMarked();
- if ( bHasMarked )
- {
- pDrawViewWrapper->MergeAttrFromMarked( aAttr, FALSE );
- }
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- if ( pFact )
- {
- ::boost::scoped_ptr< AbstractSvxAreaTabDialog > pDlg(
- pFact->CreateSvxAreaTabDialog( pParent, &aAttr, &pDrawModelWrapper->getSdrModel(),
- RID_SVXDLG_AREA, pDrawViewWrapper ) );
- if ( pDlg.get() )
- {
- SfxItemPool& rItemPool = pDrawViewWrapper->GetModel()->GetItemPool();
- SfxItemSet aSet( rItemPool, rItemPool.GetFirstWhich(), rItemPool.GetLastWhich() );
- const SvxColorTableItem* pColorItem = static_cast< const SvxColorTableItem* >( aSet.GetItem( SID_COLOR_TABLE ) );
- if ( pColorItem && pColorItem->GetColorTable() == XColorTable::GetStdColorTable() )
- {
- pDlg->DontDeleteColorTable();
- }
- if ( pDlg->Execute() == RET_OK )
- {
- const SfxItemSet* pOutAttr = pDlg->GetOutputItemSet();
- if ( bHasMarked )
- {
- pDrawViewWrapper->SetAttrToMarked( *pOutAttr, FALSE );
- }
- else
- {
- pDrawViewWrapper->SetDefaultAttr( *pOutAttr, FALSE );
- }
- }
- }
- }
- }
- }
-}
-
-void ShapeController::executeDispatch_TextAttributes()
-{
- if ( m_pChartController )
- {
- Window* pParent = dynamic_cast< Window* >( m_pChartController->m_pChartWindow );
- DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
- if ( pParent && pDrawViewWrapper )
- {
- SfxItemSet aAttr( pDrawViewWrapper->GetDefaultAttr() );
- BOOL bHasMarked = pDrawViewWrapper->AreObjectsMarked();
- if ( bHasMarked )
- {
- pDrawViewWrapper->MergeAttrFromMarked( aAttr, FALSE );
- }
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- if ( pFact )
- {
- ::boost::scoped_ptr< SfxAbstractTabDialog > pDlg(
- pFact->CreateTextTabDialog( pParent, &aAttr, RID_SVXDLG_TEXT, pDrawViewWrapper ) );
- if ( pDlg.get() && ( pDlg->Execute() == RET_OK ) )
- {
- const SfxItemSet* pOutAttr = pDlg->GetOutputItemSet();
- if ( bHasMarked )
- {
- pDrawViewWrapper->SetAttributes( *pOutAttr );
- }
- else
- {
- pDrawViewWrapper->SetDefaultAttr( *pOutAttr, FALSE );
- }
- }
- }
- }
- }
-}
-
-void ShapeController::executeDispatch_TransformDialog()
-{
- if ( m_pChartController )
- {
- Window* pParent = dynamic_cast< Window* >( m_pChartController->m_pChartWindow );
- DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
- if ( pParent && pDrawViewWrapper )
- {
- SdrObject* pSelectedObj = pDrawViewWrapper->getSelectedObject();
- if ( pSelectedObj && pSelectedObj->GetObjIdentifier() == OBJ_CAPTION )
- {
- // item set for caption
- SfxItemSet aAttr( pDrawViewWrapper->GetModel()->GetItemPool() );
- pDrawViewWrapper->GetAttributes( aAttr );
- // item set for position and size
- SfxItemSet aGeoAttr( pDrawViewWrapper->GetGeoAttrFromMarked() );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- if ( pFact )
- {
- ::boost::scoped_ptr< SfxAbstractTabDialog > pDlg(
- pFact->CreateCaptionDialog( pParent, pDrawViewWrapper, RID_SVXDLG_CAPTION ) );
- if ( pDlg.get() )
- {
- const USHORT* pRange = pDlg->GetInputRanges( *aAttr.GetPool() );
- SfxItemSet aCombAttr( *aAttr.GetPool(), pRange );
- aCombAttr.Put( aAttr );
- aCombAttr.Put( aGeoAttr );
- pDlg->SetInputSet( &aCombAttr );
- if ( pDlg->Execute() == RET_OK )
- {
- const SfxItemSet* pOutAttr = pDlg->GetOutputItemSet();
- pDrawViewWrapper->SetAttributes( *pOutAttr );
- pDrawViewWrapper->SetGeoAttrToMarked( *pOutAttr );
- }
- }
- }
- }
- else
- {
- SfxItemSet aGeoAttr( pDrawViewWrapper->GetGeoAttrFromMarked() );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- if ( pFact )
- {
- ::boost::scoped_ptr< SfxAbstractTabDialog > pDlg(
- pFact->CreateSvxTransformTabDialog( pParent, &aGeoAttr, pDrawViewWrapper, RID_SVXDLG_TRANSFORM ) );
- if ( pDlg.get() && ( pDlg->Execute() == RET_OK ) )
- {
- const SfxItemSet* pOutAttr = pDlg->GetOutputItemSet();
- pDrawViewWrapper->SetGeoAttrToMarked( *pOutAttr );
- }
- }
- }
- }
- }
-}
-
-void ShapeController::executeDispatch_ObjectTitleDescription()
-{
- if ( m_pChartController )
- {
- DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
- if ( pDrawViewWrapper && pDrawViewWrapper->GetMarkedObjectCount() == 1 )
- {
- SdrObject* pSelectedObj = pDrawViewWrapper->getSelectedObject();
- if ( pSelectedObj )
- {
- String aTitle( pSelectedObj->GetTitle() );
- String aDescription( pSelectedObj->GetDescription() );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- if ( pFact )
- {
- ::boost::scoped_ptr< AbstractSvxObjectTitleDescDialog > pDlg(
- pFact->CreateSvxObjectTitleDescDialog( NULL, aTitle, aDescription, RID_SVXDLG_OBJECT_TITLE_DESC ) );
- if ( pDlg.get() && ( pDlg->Execute() == RET_OK ) )
- {
- pDlg->GetTitle( aTitle );
- pDlg->GetDescription( aDescription );
- pSelectedObj->SetTitle( aTitle );
- pSelectedObj->SetDescription( aDescription );
- }
- }
- }
- }
- }
-}
-
-void ShapeController::executeDispatch_RenameObject()
-{
- if ( m_pChartController )
- {
- DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
- if ( pDrawViewWrapper && pDrawViewWrapper->GetMarkedObjectCount() == 1 )
- {
- SdrObject* pSelectedObj = pDrawViewWrapper->getSelectedObject();
- if ( pSelectedObj )
- {
- String aName( pSelectedObj->GetName() );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- if ( pFact )
- {
- ::boost::scoped_ptr< AbstractSvxObjectNameDialog > pDlg(
- pFact->CreateSvxObjectNameDialog( NULL, aName, RID_SVXDLG_OBJECT_NAME ) );
- pDlg->SetCheckNameHdl( LINK( this, ShapeController, CheckNameHdl ) );
- if ( pDlg.get() && ( pDlg->Execute() == RET_OK ) )
- {
- pDlg->GetName( aName );
- if ( aName != pSelectedObj->GetName() )
- {
- pSelectedObj->SetName( aName );
- }
- }
- }
- }
- }
- }
-}
-
-void ShapeController::executeDispatch_ChangeZOrder( sal_uInt16 nId )
-{
- DrawViewWrapper* pDrawViewWrapper = ( m_pChartController ? m_pChartController->GetDrawViewWrapper() : NULL );
- if ( pDrawViewWrapper )
- {
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- switch ( nId )
- {
- case COMMAND_ID_BRING_TO_FRONT:
- {
- if ( isForwardPossible() )
- {
- pDrawViewWrapper->PutMarkedToTop();
- }
- }
- break;
- case COMMAND_ID_FORWARD:
- {
- if ( isForwardPossible() )
- {
- pDrawViewWrapper->MovMarkedToTop();
- }
- }
- break;
- case COMMAND_ID_BACKWARD:
- {
- if ( isBackwardPossible() )
- {
- pDrawViewWrapper->MovMarkedToBtm();
- }
- }
- break;
- case COMMAND_ID_SEND_TO_BACK:
- {
- if ( isBackwardPossible() )
- {
- SdrObject* pFirstObj = getFirstAdditionalShape();
- pDrawViewWrapper->PutMarkedBehindObj( pFirstObj );
- }
- }
- break;
- default:
- {
- }
- break;
- }
- }
-}
-
-void ShapeController::executeDispatch_FontDialog()
-{
- if ( m_pChartController )
- {
- Window* pParent = dynamic_cast< Window* >( m_pChartController->m_pChartWindow );
- DrawModelWrapper* pDrawModelWrapper = m_pChartController->GetDrawModelWrapper();
- DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
- if ( pParent && pDrawModelWrapper && pDrawViewWrapper )
- {
- SfxItemSet aAttr( pDrawViewWrapper->GetModel()->GetItemPool() );
- pDrawViewWrapper->GetAttributes( aAttr );
- ViewElementListProvider aViewElementListProvider( pDrawModelWrapper );
- ::vos::OGuard aGuard( Application::GetSolarMutex() );
- ::boost::scoped_ptr< ShapeFontDialog > pDlg( new ShapeFontDialog( pParent, &aAttr, &aViewElementListProvider ) );
- if ( pDlg.get() && ( pDlg->Execute() == RET_OK ) )
- {
- const SfxItemSet* pOutAttr = pDlg->GetOutputItemSet();
- pDrawViewWrapper->SetAttributes( *pOutAttr );
- }
- }
- }
-}
-
-SdrObject* ShapeController::getFirstAdditionalShape()
-{
- SdrObject* pFirstObj = NULL;
-
- try
- {
- DrawModelWrapper* pDrawModelWrapper = ( m_pChartController ? m_pChartController->GetDrawModelWrapper() : NULL );
- if ( pDrawModelWrapper )
- {
- Reference< drawing::XShape > xFirstShape;
- Reference< drawing::XDrawPage > xDrawPage( pDrawModelWrapper->getMainDrawPage() );
- Reference< drawing::XShapes > xDrawPageShapes( xDrawPage, uno::UNO_QUERY_THROW );
- Reference< drawing::XShapes > xChartRoot( DrawModelWrapper::getChartRootShape( xDrawPage ) );
- sal_Int32 nCount = xDrawPageShapes->getCount();
- for ( sal_Int32 i = 0; i < nCount; ++i )
- {
- Reference< drawing::XShape > xShape;
- if ( xDrawPageShapes->getByIndex( i ) >>= xShape )
- {
- if ( xShape.is() && xShape != xChartRoot )
- {
- xFirstShape = xShape;
- break;
- }
- }
- }
- if ( xFirstShape.is() )
- {
- pFirstObj = DrawViewWrapper::getSdrObject( xFirstShape );
- }
- }
- }
- catch ( uno::Exception& ex )
- {
- ASSERT_EXCEPTION( ex );
- }
-
- return pFirstObj;
-}
-
-SdrObject* ShapeController::getLastAdditionalShape()
-{
- SdrObject* pLastObj = NULL;
-
- try
- {
- DrawModelWrapper* pDrawModelWrapper = ( m_pChartController ? m_pChartController->GetDrawModelWrapper() : NULL );
- if ( pDrawModelWrapper )
- {
- Reference< drawing::XShape > xLastShape;
- Reference< drawing::XDrawPage > xDrawPage( pDrawModelWrapper->getMainDrawPage() );
- Reference< drawing::XShapes > xDrawPageShapes( xDrawPage, uno::UNO_QUERY_THROW );
- Reference< drawing::XShapes > xChartRoot( DrawModelWrapper::getChartRootShape( xDrawPage ) );
- sal_Int32 nCount = xDrawPageShapes->getCount();
- for ( sal_Int32 i = nCount - 1; i >= 0; --i )
- {
- Reference< drawing::XShape > xShape;
- if ( xDrawPageShapes->getByIndex( i ) >>= xShape )
- {
- if ( xShape.is() && xShape != xChartRoot )
- {
- xLastShape = xShape;
- break;
- }
- }
- }
- if ( xLastShape.is() )
- {
- pLastObj = DrawViewWrapper::getSdrObject( xLastShape );
- }
- }
- }
- catch ( uno::Exception& ex )
- {
- ASSERT_EXCEPTION( ex );
- }
-
- return pLastObj;
-}
-
-bool ShapeController::isBackwardPossible()
-{
- if ( m_pChartController && m_pChartController->m_aSelection.isAdditionalShapeSelected() )
- {
- DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
- if ( pDrawViewWrapper )
- {
- SdrObject* pSelectedObj = pDrawViewWrapper->getSelectedObject();
- SdrObject* pFirstObj = getFirstAdditionalShape();
- if ( pSelectedObj && pFirstObj && pSelectedObj != pFirstObj )
- {
- return true;
- }
- }
- }
- return false;
-}
-
-bool ShapeController::isForwardPossible()
-{
- if ( m_pChartController && m_pChartController->m_aSelection.isAdditionalShapeSelected() )
- {
- DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
- if ( pDrawViewWrapper )
- {
- SdrObject* pSelectedObj = pDrawViewWrapper->getSelectedObject();
- SdrObject* pLastObj = getLastAdditionalShape();
- if ( pSelectedObj && pLastObj && pSelectedObj != pLastObj )
- {
- return true;
- }
- }
- }
- return false;
-}
-
-//.............................................................................
-} // namespace chart
-//.............................................................................
+/*************************************************************************
+ *
+ * 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: ShapeController.cxx,v $
+ * $Revision: 1.0 $
+ *
+ * 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
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_chart2.hxx"
+
+#include "ShapeController.hxx"
+#include "ShapeController.hrc"
+#include "ChartController.hxx"
+#include "ChartWindow.hxx"
+#include "ViewElementListProvider.hxx"
+#include "dlg_ShapeFont.hxx"
+#include "dlg_ShapeParagraph.hxx"
+#include "chartview/DrawModelWrapper.hxx"
+#include "macros.hxx"
+
+#include <com/sun/star/frame/XStorable.hpp>
+
+#include <vos/mutex.hxx>
+#include <vcl/msgbox.hxx>
+#include <vcl/svapp.hxx>
+#include <svx/brkitem.hxx>
+#include <svx/dialogs.hrc>
+#include <svx/drawitem.hxx>
+#include <svx/eeitem.hxx>
+#include <svx/hyznitem.hxx>
+#include <svx/orphitem.hxx>
+#include <svx/spltitem.hxx>
+#include <svx/svxdlg.hxx>
+#include <svx/svxids.hrc>
+#include <svx/widwitem.hxx>
+
+#include <boost/scoped_ptr.hpp>
+
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::frame;
+
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::uno::Sequence;
+
+//.............................................................................
+namespace chart
+{
+//.............................................................................
+
+ShapeController::ShapeController( const Reference< uno::XComponentContext >& rxContext,
+ ChartController* pController )
+ :FeatureCommandDispatchBase( rxContext )
+ ,m_pChartController( pController )
+{
+}
+
+ShapeController::~ShapeController()
+{
+}
+
+void ShapeController::initialize()
+{
+ FeatureCommandDispatchBase::initialize();
+}
+
+// WeakComponentImplHelperBase
+void ShapeController::disposing()
+{
+}
+
+// XEventListener
+void ShapeController::disposing( const lang::EventObject& /* Source */ )
+ throw (uno::RuntimeException)
+{
+}
+
+FeatureState ShapeController::getState( const ::rtl::OUString& rCommand )
+{
+ FeatureState aReturn;
+ aReturn.bEnabled = false;
+ aReturn.aState <<= false;
+
+ bool bWritable = false;
+ if ( m_pChartController )
+ {
+ Reference< frame::XStorable > xStorable( m_pChartController->getModel(), uno::UNO_QUERY );
+ if ( xStorable.is() )
+ {
+ bWritable = !xStorable->isReadonly();
+ }
+ }
+
+ sal_uInt16 nFeatureId = m_aSupportedFeatures[ rCommand ].nFeatureId;
+
+ switch ( nFeatureId )
+ {
+ case COMMAND_ID_FORMAT_LINE:
+ case COMMAND_ID_FORMAT_AREA:
+ case COMMAND_ID_TEXT_ATTRIBUTES:
+ case COMMAND_ID_TRANSFORM_DIALOG:
+ case COMMAND_ID_OBJECT_TITLE_DESCRIPTION:
+ case COMMAND_ID_RENAME_OBJECT:
+ {
+ aReturn.bEnabled = bWritable;
+ aReturn.aState <<= false;
+ }
+ break;
+ case COMMAND_ID_BRING_TO_FRONT:
+ case COMMAND_ID_FORWARD:
+ {
+ aReturn.bEnabled = ( bWritable && isForwardPossible() );
+ aReturn.aState <<= false;
+ }
+ break;
+ case COMMAND_ID_BACKWARD:
+ case COMMAND_ID_SEND_TO_BACK:
+ {
+
+ aReturn.bEnabled = ( bWritable && isBackwardPossible() );
+ aReturn.aState <<= false;
+ }
+ break;
+ case COMMAND_ID_FONT_DIALOG:
+ case COMMAND_ID_PARAGRAPH_DIALOG:
+ {
+ aReturn.bEnabled = bWritable;
+ aReturn.aState <<= false;
+ }
+ break;
+ default:
+ {
+ aReturn.bEnabled = false;
+ aReturn.aState <<= false;
+ }
+ break;
+ }
+
+ return aReturn;
+}
+
+void ShapeController::execute( const ::rtl::OUString& rCommand, const Sequence< beans::PropertyValue>& rArgs )
+{
+ (void)rArgs;
+
+ sal_uInt16 nFeatureId = m_aSupportedFeatures[ rCommand ].nFeatureId;
+
+ switch ( nFeatureId )
+ {
+ case COMMAND_ID_FORMAT_LINE:
+ {
+ executeDispatch_FormatLine();
+ }
+ break;
+ case COMMAND_ID_FORMAT_AREA:
+ {
+ executeDispatch_FormatArea();
+ }
+ break;
+ case COMMAND_ID_TEXT_ATTRIBUTES:
+ {
+ executeDispatch_TextAttributes();
+ }
+ break;
+ case COMMAND_ID_TRANSFORM_DIALOG:
+ {
+ executeDispatch_TransformDialog();
+ }
+ break;
+ case COMMAND_ID_OBJECT_TITLE_DESCRIPTION:
+ {
+ executeDispatch_ObjectTitleDescription();
+ }
+ break;
+ case COMMAND_ID_RENAME_OBJECT:
+ {
+ executeDispatch_RenameObject();
+ }
+ break;
+ case COMMAND_ID_BRING_TO_FRONT:
+ case COMMAND_ID_FORWARD:
+ case COMMAND_ID_BACKWARD:
+ case COMMAND_ID_SEND_TO_BACK:
+ {
+ executeDispatch_ChangeZOrder( nFeatureId );
+ }
+ break;
+ case COMMAND_ID_FONT_DIALOG:
+ {
+ executeDispatch_FontDialog();
+ }
+ break;
+ case COMMAND_ID_PARAGRAPH_DIALOG:
+ {
+ executeDispatch_ParagraphDialog();
+ }
+ break;
+ default:
+ {
+ }
+ break;
+ }
+}
+
+void ShapeController::describeSupportedFeatures()
+{
+ implDescribeSupportedFeature( ".uno:FormatLine", COMMAND_ID_FORMAT_LINE, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:FormatArea", COMMAND_ID_FORMAT_AREA, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:TextAttributes", COMMAND_ID_TEXT_ATTRIBUTES, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:TransformDialog", COMMAND_ID_TRANSFORM_DIALOG, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:ObjectTitleDescription", COMMAND_ID_OBJECT_TITLE_DESCRIPTION, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:RenameObject", COMMAND_ID_RENAME_OBJECT, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:BringToFront", COMMAND_ID_BRING_TO_FRONT, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:Forward", COMMAND_ID_FORWARD, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:Backward", COMMAND_ID_BACKWARD, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:SendToBack", COMMAND_ID_SEND_TO_BACK, CommandGroup::FORMAT );
+ implDescribeSupportedFeature( ".uno:FontDialog", COMMAND_ID_FONT_DIALOG, CommandGroup::EDIT );
+ implDescribeSupportedFeature( ".uno:ParagraphDialog", COMMAND_ID_PARAGRAPH_DIALOG, CommandGroup::EDIT );
+}
+
+IMPL_LINK( ShapeController, CheckNameHdl, AbstractSvxNameDialog*, pDialog )
+{
+ String aName;
+ if ( pDialog )
+ {
+ pDialog->GetName( aName );
+ }
+ if ( aName.Len() )
+ {
+ DrawViewWrapper* pDrawViewWrapper = ( m_pChartController ? m_pChartController->GetDrawViewWrapper() : NULL );
+ if ( pDrawViewWrapper && pDrawViewWrapper->getNamedSdrObject( aName ) )
+ {
+ return 0;
+ }
+ }
+ return 1;
+}
+
+void ShapeController::executeDispatch_FormatLine()
+{
+ if ( m_pChartController )
+ {
+ Window* pParent = dynamic_cast< Window* >( m_pChartController->m_pChartWindow );
+ DrawModelWrapper* pDrawModelWrapper = m_pChartController->GetDrawModelWrapper();
+ DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
+ if ( pParent && pDrawModelWrapper && pDrawViewWrapper )
+ {
+ SdrObject* pSelectedObj = pDrawViewWrapper->getSelectedObject();
+ SfxItemSet aAttr( pDrawViewWrapper->GetDefaultAttr() );
+ BOOL bHasMarked = pDrawViewWrapper->AreObjectsMarked();
+ if ( bHasMarked )
+ {
+ pDrawViewWrapper->MergeAttrFromMarked( aAttr, FALSE );
+ }
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
+ if ( pFact )
+ {
+ ::boost::scoped_ptr< SfxAbstractTabDialog > pDlg(
+ pFact->CreateSvxLineTabDialog( pParent, &aAttr, &pDrawModelWrapper->getSdrModel(),
+ RID_SVXDLG_LINE, pSelectedObj, bHasMarked ) );
+ if ( pDlg.get() && ( pDlg->Execute() == RET_OK ) )
+ {
+ const SfxItemSet* pOutAttr = pDlg->GetOutputItemSet();
+ if ( bHasMarked )
+ {
+ pDrawViewWrapper->SetAttrToMarked( *pOutAttr, FALSE );
+ }
+ else
+ {
+ pDrawViewWrapper->SetDefaultAttr( *pOutAttr, FALSE );
+ }
+ }
+ }
+ }
+ }
+}
+
+void ShapeController::executeDispatch_FormatArea()
+{
+ if ( m_pChartController )
+ {
+ Window* pParent = dynamic_cast< Window* >( m_pChartController->m_pChartWindow );
+ DrawModelWrapper* pDrawModelWrapper = m_pChartController->GetDrawModelWrapper();
+ DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
+ if ( pParent && pDrawModelWrapper && pDrawViewWrapper )
+ {
+ SfxItemSet aAttr( pDrawViewWrapper->GetDefaultAttr() );
+ BOOL bHasMarked = pDrawViewWrapper->AreObjectsMarked();
+ if ( bHasMarked )
+ {
+ pDrawViewWrapper->MergeAttrFromMarked( aAttr, FALSE );
+ }
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
+ if ( pFact )
+ {
+ ::boost::scoped_ptr< AbstractSvxAreaTabDialog > pDlg(
+ pFact->CreateSvxAreaTabDialog( pParent, &aAttr, &pDrawModelWrapper->getSdrModel(),
+ RID_SVXDLG_AREA, pDrawViewWrapper ) );
+ if ( pDlg.get() )
+ {
+ SfxItemPool& rItemPool = pDrawViewWrapper->GetModel()->GetItemPool();
+ SfxItemSet aSet( rItemPool, rItemPool.GetFirstWhich(), rItemPool.GetLastWhich() );
+ const SvxColorTableItem* pColorItem = static_cast< const SvxColorTableItem* >( aSet.GetItem( SID_COLOR_TABLE ) );
+ if ( pColorItem && pColorItem->GetColorTable() == XColorTable::GetStdColorTable() )
+ {
+ pDlg->DontDeleteColorTable();
+ }
+ if ( pDlg->Execute() == RET_OK )
+ {
+ const SfxItemSet* pOutAttr = pDlg->GetOutputItemSet();
+ if ( bHasMarked )
+ {
+ pDrawViewWrapper->SetAttrToMarked( *pOutAttr, FALSE );
+ }
+ else
+ {
+ pDrawViewWrapper->SetDefaultAttr( *pOutAttr, FALSE );
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+void ShapeController::executeDispatch_TextAttributes()
+{
+ if ( m_pChartController )
+ {
+ Window* pParent = dynamic_cast< Window* >( m_pChartController->m_pChartWindow );
+ DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
+ if ( pParent && pDrawViewWrapper )
+ {
+ SfxItemSet aAttr( pDrawViewWrapper->GetDefaultAttr() );
+ BOOL bHasMarked = pDrawViewWrapper->AreObjectsMarked();
+ if ( bHasMarked )
+ {
+ pDrawViewWrapper->MergeAttrFromMarked( aAttr, FALSE );
+ }
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
+ if ( pFact )
+ {
+ ::boost::scoped_ptr< SfxAbstractTabDialog > pDlg(
+ pFact->CreateTextTabDialog( pParent, &aAttr, RID_SVXDLG_TEXT, pDrawViewWrapper ) );
+ if ( pDlg.get() && ( pDlg->Execute() == RET_OK ) )
+ {
+ const SfxItemSet* pOutAttr = pDlg->GetOutputItemSet();
+ if ( bHasMarked )
+ {
+ pDrawViewWrapper->SetAttributes( *pOutAttr );
+ }
+ else
+ {
+ pDrawViewWrapper->SetDefaultAttr( *pOutAttr, FALSE );
+ }
+ }
+ }
+ }
+ }
+}
+
+void ShapeController::executeDispatch_TransformDialog()
+{
+ if ( m_pChartController )
+ {
+ Window* pParent = dynamic_cast< Window* >( m_pChartController->m_pChartWindow );
+ DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
+ if ( pParent && pDrawViewWrapper )
+ {
+ SdrObject* pSelectedObj = pDrawViewWrapper->getSelectedObject();
+ if ( pSelectedObj && pSelectedObj->GetObjIdentifier() == OBJ_CAPTION )
+ {
+ // item set for caption
+ SfxItemSet aAttr( pDrawViewWrapper->GetModel()->GetItemPool() );
+ pDrawViewWrapper->GetAttributes( aAttr );
+ // item set for position and size
+ SfxItemSet aGeoAttr( pDrawViewWrapper->GetGeoAttrFromMarked() );
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
+ if ( pFact )
+ {
+ ::boost::scoped_ptr< SfxAbstractTabDialog > pDlg(
+ pFact->CreateCaptionDialog( pParent, pDrawViewWrapper, RID_SVXDLG_CAPTION ) );
+ if ( pDlg.get() )
+ {
+ const USHORT* pRange = pDlg->GetInputRanges( *aAttr.GetPool() );
+ SfxItemSet aCombAttr( *aAttr.GetPool(), pRange );
+ aCombAttr.Put( aAttr );
+ aCombAttr.Put( aGeoAttr );
+ pDlg->SetInputSet( &aCombAttr );
+ if ( pDlg->Execute() == RET_OK )
+ {
+ const SfxItemSet* pOutAttr = pDlg->GetOutputItemSet();
+ pDrawViewWrapper->SetAttributes( *pOutAttr );
+ pDrawViewWrapper->SetGeoAttrToMarked( *pOutAttr );
+ }
+ }
+ }
+ }
+ else
+ {
+ SfxItemSet aGeoAttr( pDrawViewWrapper->GetGeoAttrFromMarked() );
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
+ if ( pFact )
+ {
+ ::boost::scoped_ptr< SfxAbstractTabDialog > pDlg(
+ pFact->CreateSvxTransformTabDialog( pParent, &aGeoAttr, pDrawViewWrapper, RID_SVXDLG_TRANSFORM ) );
+ if ( pDlg.get() && ( pDlg->Execute() == RET_OK ) )
+ {
+ const SfxItemSet* pOutAttr = pDlg->GetOutputItemSet();
+ pDrawViewWrapper->SetGeoAttrToMarked( *pOutAttr );
+ }
+ }
+ }
+ }
+ }
+}
+
+void ShapeController::executeDispatch_ObjectTitleDescription()
+{
+ if ( m_pChartController )
+ {
+ DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
+ if ( pDrawViewWrapper && pDrawViewWrapper->GetMarkedObjectCount() == 1 )
+ {
+ SdrObject* pSelectedObj = pDrawViewWrapper->getSelectedObject();
+ if ( pSelectedObj )
+ {
+ String aTitle( pSelectedObj->GetTitle() );
+ String aDescription( pSelectedObj->GetDescription() );
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
+ if ( pFact )
+ {
+ ::boost::scoped_ptr< AbstractSvxObjectTitleDescDialog > pDlg(
+ pFact->CreateSvxObjectTitleDescDialog( NULL, aTitle, aDescription, RID_SVXDLG_OBJECT_TITLE_DESC ) );
+ if ( pDlg.get() && ( pDlg->Execute() == RET_OK ) )
+ {
+ pDlg->GetTitle( aTitle );
+ pDlg->GetDescription( aDescription );
+ pSelectedObj->SetTitle( aTitle );
+ pSelectedObj->SetDescription( aDescription );
+ }
+ }
+ }
+ }
+ }
+}
+
+void ShapeController::executeDispatch_RenameObject()
+{
+ if ( m_pChartController )
+ {
+ DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
+ if ( pDrawViewWrapper && pDrawViewWrapper->GetMarkedObjectCount() == 1 )
+ {
+ SdrObject* pSelectedObj = pDrawViewWrapper->getSelectedObject();
+ if ( pSelectedObj )
+ {
+ String aName( pSelectedObj->GetName() );
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
+ if ( pFact )
+ {
+ ::boost::scoped_ptr< AbstractSvxObjectNameDialog > pDlg(
+ pFact->CreateSvxObjectNameDialog( NULL, aName, RID_SVXDLG_OBJECT_NAME ) );
+ pDlg->SetCheckNameHdl( LINK( this, ShapeController, CheckNameHdl ) );
+ if ( pDlg.get() && ( pDlg->Execute() == RET_OK ) )
+ {
+ pDlg->GetName( aName );
+ if ( aName != pSelectedObj->GetName() )
+ {
+ pSelectedObj->SetName( aName );
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+void ShapeController::executeDispatch_ChangeZOrder( sal_uInt16 nId )
+{
+ DrawViewWrapper* pDrawViewWrapper = ( m_pChartController ? m_pChartController->GetDrawViewWrapper() : NULL );
+ if ( pDrawViewWrapper )
+ {
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ switch ( nId )
+ {
+ case COMMAND_ID_BRING_TO_FRONT:
+ {
+ if ( isForwardPossible() )
+ {
+ pDrawViewWrapper->PutMarkedToTop();
+ }
+ }
+ break;
+ case COMMAND_ID_FORWARD:
+ {
+ if ( isForwardPossible() )
+ {
+ pDrawViewWrapper->MovMarkedToTop();
+ }
+ }
+ break;
+ case COMMAND_ID_BACKWARD:
+ {
+ if ( isBackwardPossible() )
+ {
+ pDrawViewWrapper->MovMarkedToBtm();
+ }
+ }
+ break;
+ case COMMAND_ID_SEND_TO_BACK:
+ {
+ if ( isBackwardPossible() )
+ {
+ SdrObject* pFirstObj = getFirstAdditionalShape();
+ pDrawViewWrapper->PutMarkedBehindObj( pFirstObj );
+ }
+ }
+ break;
+ default:
+ {
+ }
+ break;
+ }
+ }
+}
+
+void ShapeController::executeDispatch_FontDialog()
+{
+ if ( m_pChartController )
+ {
+ Window* pParent = dynamic_cast< Window* >( m_pChartController->m_pChartWindow );
+ DrawModelWrapper* pDrawModelWrapper = m_pChartController->GetDrawModelWrapper();
+ DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
+ if ( pParent && pDrawModelWrapper && pDrawViewWrapper )
+ {
+ SfxItemSet aAttr( pDrawViewWrapper->GetModel()->GetItemPool() );
+ pDrawViewWrapper->GetAttributes( aAttr );
+ ViewElementListProvider aViewElementListProvider( pDrawModelWrapper );
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ ::boost::scoped_ptr< ShapeFontDialog > pDlg( new ShapeFontDialog( pParent, &aAttr, &aViewElementListProvider ) );
+ if ( pDlg.get() && ( pDlg->Execute() == RET_OK ) )
+ {
+ const SfxItemSet* pOutAttr = pDlg->GetOutputItemSet();
+ pDrawViewWrapper->SetAttributes( *pOutAttr );
+ }
+ }
+ }
+}
+
+void ShapeController::executeDispatch_ParagraphDialog()
+{
+ if ( m_pChartController )
+ {
+ Window* pParent = dynamic_cast< Window* >( m_pChartController->m_pChartWindow );
+ DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
+ if ( pParent && pDrawViewWrapper )
+ {
+ SfxItemPool& rPool = pDrawViewWrapper->GetModel()->GetItemPool();
+ SfxItemSet aAttr( rPool );
+ pDrawViewWrapper->GetAttributes( aAttr );
+
+ SfxItemSet aNewAttr( rPool,
+ EE_ITEMS_START, EE_ITEMS_END,
+ SID_ATTR_PARA_HYPHENZONE, SID_ATTR_PARA_HYPHENZONE,
+ SID_ATTR_PARA_PAGEBREAK, SID_ATTR_PARA_PAGEBREAK,
+ SID_ATTR_PARA_SPLIT, SID_ATTR_PARA_SPLIT,
+ SID_ATTR_PARA_WIDOWS, SID_ATTR_PARA_WIDOWS,
+ SID_ATTR_PARA_ORPHANS, SID_ATTR_PARA_ORPHANS,
+ 0 );
+ aNewAttr.Put( aAttr );
+ aNewAttr.Put( SvxHyphenZoneItem( sal_False, SID_ATTR_PARA_HYPHENZONE ) );
+ aNewAttr.Put( SvxFmtBreakItem( SVX_BREAK_NONE, SID_ATTR_PARA_PAGEBREAK ) );
+ aNewAttr.Put( SvxFmtSplitItem( sal_True, SID_ATTR_PARA_SPLIT) );
+ aNewAttr.Put( SvxWidowsItem( 0, SID_ATTR_PARA_WIDOWS) );
+ aNewAttr.Put( SvxOrphansItem( 0, SID_ATTR_PARA_ORPHANS) );
+
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ ::boost::scoped_ptr< ShapeParagraphDialog > pDlg( new ShapeParagraphDialog( pParent, &aNewAttr ) );
+ if ( pDlg.get() && ( pDlg->Execute() == RET_OK ) )
+ {
+ const SfxItemSet* pOutAttr = pDlg->GetOutputItemSet();
+ pDrawViewWrapper->SetAttributes( *pOutAttr );
+ }
+ }
+ }
+}
+
+SdrObject* ShapeController::getFirstAdditionalShape()
+{
+ SdrObject* pFirstObj = NULL;
+
+ try
+ {
+ DrawModelWrapper* pDrawModelWrapper = ( m_pChartController ? m_pChartController->GetDrawModelWrapper() : NULL );
+ if ( pDrawModelWrapper )
+ {
+ Reference< drawing::XShape > xFirstShape;
+ Reference< drawing::XDrawPage > xDrawPage( pDrawModelWrapper->getMainDrawPage() );
+ Reference< drawing::XShapes > xDrawPageShapes( xDrawPage, uno::UNO_QUERY_THROW );
+ Reference< drawing::XShapes > xChartRoot( DrawModelWrapper::getChartRootShape( xDrawPage ) );
+ sal_Int32 nCount = xDrawPageShapes->getCount();
+ for ( sal_Int32 i = 0; i < nCount; ++i )
+ {
+ Reference< drawing::XShape > xShape;
+ if ( xDrawPageShapes->getByIndex( i ) >>= xShape )
+ {
+ if ( xShape.is() && xShape != xChartRoot )
+ {
+ xFirstShape = xShape;
+ break;
+ }
+ }
+ }
+ if ( xFirstShape.is() )
+ {
+ pFirstObj = DrawViewWrapper::getSdrObject( xFirstShape );
+ }
+ }
+ }
+ catch ( uno::Exception& ex )
+ {
+ ASSERT_EXCEPTION( ex );
+ }
+
+ return pFirstObj;
+}
+
+SdrObject* ShapeController::getLastAdditionalShape()
+{
+ SdrObject* pLastObj = NULL;
+
+ try
+ {
+ DrawModelWrapper* pDrawModelWrapper = ( m_pChartController ? m_pChartController->GetDrawModelWrapper() : NULL );
+ if ( pDrawModelWrapper )
+ {
+ Reference< drawing::XShape > xLastShape;
+ Reference< drawing::XDrawPage > xDrawPage( pDrawModelWrapper->getMainDrawPage() );
+ Reference< drawing::XShapes > xDrawPageShapes( xDrawPage, uno::UNO_QUERY_THROW );
+ Reference< drawing::XShapes > xChartRoot( DrawModelWrapper::getChartRootShape( xDrawPage ) );
+ sal_Int32 nCount = xDrawPageShapes->getCount();
+ for ( sal_Int32 i = nCount - 1; i >= 0; --i )
+ {
+ Reference< drawing::XShape > xShape;
+ if ( xDrawPageShapes->getByIndex( i ) >>= xShape )
+ {
+ if ( xShape.is() && xShape != xChartRoot )
+ {
+ xLastShape = xShape;
+ break;
+ }
+ }
+ }
+ if ( xLastShape.is() )
+ {
+ pLastObj = DrawViewWrapper::getSdrObject( xLastShape );
+ }
+ }
+ }
+ catch ( uno::Exception& ex )
+ {
+ ASSERT_EXCEPTION( ex );
+ }
+
+ return pLastObj;
+}
+
+bool ShapeController::isBackwardPossible()
+{
+ if ( m_pChartController && m_pChartController->m_aSelection.isAdditionalShapeSelected() )
+ {
+ DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
+ if ( pDrawViewWrapper )
+ {
+ SdrObject* pSelectedObj = pDrawViewWrapper->getSelectedObject();
+ SdrObject* pFirstObj = getFirstAdditionalShape();
+ if ( pSelectedObj && pFirstObj && pSelectedObj != pFirstObj )
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+bool ShapeController::isForwardPossible()
+{
+ if ( m_pChartController && m_pChartController->m_aSelection.isAdditionalShapeSelected() )
+ {
+ DrawViewWrapper* pDrawViewWrapper = m_pChartController->GetDrawViewWrapper();
+ if ( pDrawViewWrapper )
+ {
+ SdrObject* pSelectedObj = pDrawViewWrapper->getSelectedObject();
+ SdrObject* pLastObj = getLastAdditionalShape();
+ if ( pSelectedObj && pLastObj && pSelectedObj != pLastObj )
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+//.............................................................................
+} // namespace chart
+//.............................................................................
diff --git a/chart2/source/controller/main/ShapeController.hxx b/chart2/source/controller/main/ShapeController.hxx
index d39876790a67..4da2ff8b3b1a 100644
--- a/chart2/source/controller/main/ShapeController.hxx
+++ b/chart2/source/controller/main/ShapeController.hxx
@@ -1,102 +1,103 @@
-/*************************************************************************
- *
- * 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: ShapeController.hxx,v $
- * $Revision: 1.0 $
- *
- * 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
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef CHART2_SHAPECONTROLLER_HXX
-#define CHART2_SHAPECONTROLLER_HXX
-
-#include "FeatureCommandDispatchBase.hxx"
-#include <tools/link.hxx>
-
-class AbstractSvxNameDialog;
-class SdrObject;
-
-//.............................................................................
-namespace chart
-{
-//.............................................................................
-
-class ChartController;
-
-/** This is a CommandDispatch implementation for shapes.
- */
-class ShapeController: public FeatureCommandDispatchBase
-{
- friend class ControllerCommandDispatch;
-
-public:
- ShapeController( const ::com::sun::star::uno::Reference<
- ::com::sun::star::uno::XComponentContext >& rxContext, ChartController* pController );
- virtual ~ShapeController();
-
- // late initialisation, especially for adding as listener
- virtual void initialize();
-
-protected:
- // WeakComponentImplHelperBase
- virtual void SAL_CALL disposing();
-
- // XEventListener
- virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source )
- throw (::com::sun::star::uno::RuntimeException);
-
- // state of a feature
- virtual FeatureState getState( const ::rtl::OUString& rCommand );
-
- // execute a feature
- virtual void execute( const ::rtl::OUString& rCommand, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& rArgs );
-
- // all the features which should be handled by this class
- virtual void describeSupportedFeatures();
-
-private:
- DECL_LINK( CheckNameHdl, AbstractSvxNameDialog* );
-
- void executeDispatch_FormatLine();
- void executeDispatch_FormatArea();
- void executeDispatch_TextAttributes();
- void executeDispatch_TransformDialog();
- void executeDispatch_ObjectTitleDescription();
- void executeDispatch_RenameObject();
- void executeDispatch_ChangeZOrder( sal_uInt16 nId );
- void executeDispatch_FontDialog();
-
- SdrObject* getFirstAdditionalShape();
- SdrObject* getLastAdditionalShape();
- bool isBackwardPossible();
- bool isForwardPossible();
-
- ChartController* m_pChartController;
-};
-
-//.............................................................................
-} // namespace chart
-//.............................................................................
-
-// CHART2_SHAPECONTROLLER_HXX
-#endif
+/*************************************************************************
+ *
+ * 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: ShapeController.hxx,v $
+ * $Revision: 1.0 $
+ *
+ * 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
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef CHART2_SHAPECONTROLLER_HXX
+#define CHART2_SHAPECONTROLLER_HXX
+
+#include "FeatureCommandDispatchBase.hxx"
+#include <tools/link.hxx>
+
+class AbstractSvxNameDialog;
+class SdrObject;
+
+//.............................................................................
+namespace chart
+{
+//.............................................................................
+
+class ChartController;
+
+/** This is a CommandDispatch implementation for shapes.
+ */
+class ShapeController: public FeatureCommandDispatchBase
+{
+ friend class ControllerCommandDispatch;
+
+public:
+ ShapeController( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::uno::XComponentContext >& rxContext, ChartController* pController );
+ virtual ~ShapeController();
+
+ // late initialisation, especially for adding as listener
+ virtual void initialize();
+
+protected:
+ // WeakComponentImplHelperBase
+ virtual void SAL_CALL disposing();
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ // state of a feature
+ virtual FeatureState getState( const ::rtl::OUString& rCommand );
+
+ // execute a feature
+ virtual void execute( const ::rtl::OUString& rCommand, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& rArgs );
+
+ // all the features which should be handled by this class
+ virtual void describeSupportedFeatures();
+
+private:
+ DECL_LINK( CheckNameHdl, AbstractSvxNameDialog* );
+
+ void executeDispatch_FormatLine();
+ void executeDispatch_FormatArea();
+ void executeDispatch_TextAttributes();
+ void executeDispatch_TransformDialog();
+ void executeDispatch_ObjectTitleDescription();
+ void executeDispatch_RenameObject();
+ void executeDispatch_ChangeZOrder( sal_uInt16 nId );
+ void executeDispatch_FontDialog();
+ void executeDispatch_ParagraphDialog();
+
+ SdrObject* getFirstAdditionalShape();
+ SdrObject* getLastAdditionalShape();
+ bool isBackwardPossible();
+ bool isForwardPossible();
+
+ ChartController* m_pChartController;
+};
+
+//.............................................................................
+} // namespace chart
+//.............................................................................
+
+// CHART2_SHAPECONTROLLER_HXX
+#endif
diff --git a/chart2/source/controller/menus/ShapeEditContextMenu.src b/chart2/source/controller/menus/ShapeEditContextMenu.src
index dc9b9881f7f6..c98886b855d0 100644
--- a/chart2/source/controller/menus/ShapeEditContextMenu.src
+++ b/chart2/source/controller/menus/ShapeEditContextMenu.src
@@ -1,64 +1,69 @@
-/*************************************************************************
- *
- * 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: ShapeContextMenu.src,v $
- * $Revision: 1.0 $
- *
- * 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
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#include "MenuResIds.hrc"
-#include "ShapeController.hrc"
-
-#include <svx/svxids.hrc>
-
-Menu RID_CONTEXTMENU_SHAPEEDIT
-{
- ItemList =
- {
- MenuItem
- {
- Identifier = COMMAND_ID_FONT_DIALOG;
- Command = ".uno:FontDialog";
- };
- MenuItem
- {
- Separator = TRUE;
- };
- MenuItem
- {
- Identifier = COMMAND_ID_CUT;
- Command = ".uno:Cut";
- };
- MenuItem
- {
- Identifier = COMMAND_ID_COPY;
- Command = ".uno:Copy";
- };
- MenuItem
- {
- Identifier = COMMAND_ID_PASTE;
- Command = ".uno:Paste";
- };
- };
-};
+/*************************************************************************
+ *
+ * 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: ShapeContextMenu.src,v $
+ * $Revision: 1.0 $
+ *
+ * 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
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#include "MenuResIds.hrc"
+#include "ShapeController.hrc"
+
+#include <svx/svxids.hrc>
+
+Menu RID_CONTEXTMENU_SHAPEEDIT
+{
+ ItemList =
+ {
+ MenuItem
+ {
+ Identifier = COMMAND_ID_FONT_DIALOG;
+ Command = ".uno:FontDialog";
+ };
+ MenuItem
+ {
+ Identifier = COMMAND_ID_PARAGRAPH_DIALOG;
+ Command = ".uno:ParagraphDialog";
+ };
+ MenuItem
+ {
+ Separator = TRUE;
+ };
+ MenuItem
+ {
+ Identifier = COMMAND_ID_CUT;
+ Command = ".uno:Cut";
+ };
+ MenuItem
+ {
+ Identifier = COMMAND_ID_COPY;
+ Command = ".uno:Copy";
+ };
+ MenuItem
+ {
+ Identifier = COMMAND_ID_PASTE;
+ Command = ".uno:Paste";
+ };
+ };
+};