diff options
Diffstat (limited to 'binfilter/bf_sch/source/ui')
73 files changed, 19214 insertions, 0 deletions
diff --git a/binfilter/bf_sch/source/ui/app/makefile.mk b/binfilter/bf_sch/source/ui/app/makefile.mk new file mode 100644 index 000000000000..7838be06e489 --- /dev/null +++ b/binfilter/bf_sch/source/ui/app/makefile.mk @@ -0,0 +1,92 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# 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. +# +#************************************************************************* + +EXTERNAL_WARNINGS_NOT_ERRORS := TRUE +PRJ=..$/..$/..$/.. +BFPRJ=..$/..$/.. + +PROJECTPCH=sch +PROJECTPCHSOURCE=$(BFPRJ)$/util$/sch_sch + +PRJNAME=binfilter +TARGET=sch_app + +NO_HIDS=TRUE + +BMP_OUT=$(RES) +BMP_IN =$(BFPRJ)$/res + +# --- Settings ----------------------------------------------------- +.INCLUDE : settings.mk +INC+= -I$(PRJ)$/inc$/bf_sch +# --- Files -------------------------------------------------------- + +#IMGLST_SRS=$(SRS)$/app.srs + +SRS1NAME=$(TARGET) +SRC1FILES = sch_app.src \ + sch_strings.src + +DEPOBJFILES = \ + $(SLO)$/sch_schlib.obj + +SLOFILES = \ + $(SLO)$/sch_schdll.obj \ + $(SLO)$/sch_schmod.obj \ + $(SLO)$/sch_schresid.obj \ + $(SLO)$/sch_schopt.obj \ + $(SLO)$/sch_globopt.obj + +LIB2TARGET = $(SLB)$/bf_ysch.lib +LIB2ARCHIV = $(LB)$/libbf_ysch.a +LIB2OBJFILES = $(SLO)$/sch_schlib.obj + + +.IF "$(GUI)" == "WNT" +NOOPTFILES=\ + $(SLO)$/sch_schdll.obj +.ENDIF + + + +# --- Targets ------------------------------------------------------- + +.INCLUDE : target.mk + +$(INCCOM)$/schlib.hxx: makefile.mk +.IF "$(GUI)"=="UNX" + $(RM) $@ + echo \#define DLL_NAME \"libbf_sch$(DLLPOSTFIX)$(DLLPOST)\" >$@ +.ELSE + echo $(EMQ)#define DLL_NAME $(EMQ)"bf_sch$(DLLPOSTFIX)$(DLLPOST)$(EMQ)" >$@ +.ENDIF + +$(SRS)$/sch_app.srs: $(PRJ)$/inc$/bf_svx$/globlmn.hrc + +$(SLO)$/sch_schlib.obj : $(INCCOM)$/schlib.hxx + + diff --git a/binfilter/bf_sch/source/ui/app/sch_app.src b/binfilter/bf_sch/source/ui/app/sch_app.src new file mode 100644 index 000000000000..6dc18b84f299 --- /dev/null +++ b/binfilter/bf_sch/source/ui/app/sch_app.src @@ -0,0 +1,227 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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. + * + ************************************************************************/ +#define NO_LOCALIZE_EXPORT + + +/* StarView ressource file */ + +#include <bf_svx/globlmn.hrc> +#include "app.hrc" +#include "res_bmp.hrc" +#include "bf_svx/dialogs.hrc" +#include "schhids.h" + +#define IMAGE_STDBTN_COLOR Color { Red = 0xff00; Green = 0x0000; Blue = 0xff00; } +#define IMAGE_HCBTN_COLOR IMAGE_STDBTN_COLOR + +#define IMAGE_ID_LIST \ + IdList = { \ + SID_NEWDOCDIRECT; \ + SID_OPENDOC; \ + SID_PRINTDOCDIRECT; \ + SID_SAVEDOC; \ + SID_CUT; \ + SID_COPY; \ + SID_PASTE; \ + SID_UNDO; \ + SID_REDO; \ + SID_TOGGLE_TITLE; \ + SID_TOGGLE_LEGEND; \ + SID_TOGGLE_AXIS_TITLE; \ + SID_TOGGLE_AXIS_DESCR; \ + SID_TOGGLE_GRID_HORZ; \ + SID_TOGGLE_GRID_VERT; \ + SID_DIAGRAM_TYPE; \ + SID_AUTOFORMAT; \ + SID_DIAGRAM_DATA; \ + SID_DATA_IN_ROWS; \ + SID_DATA_IN_COLUMNS; \ + SID_SCALE_TEXT; \ + SID_EXTENDEDHELP; \ + SID_WIN_FULLSCREEN;\ + SID_NEW_ARRANGEMENT;\ + SID_ATTR_TRANSFORM;\ + }; \ + IdCount = { \ + 25; \ + }; + + + + +String RID_DRAW_TOOLBOX +{ + Text [ de ] = "Werkzeugleiste" ; + Text [ en-US ] = "Main Toolbar" ; + Text [ x-comment ] = " "; + Text[ pt ] = "Barra de ferramentas"; + Text[ ru ] = "Ð“Ð»Ð°Ð²Ð½Ð°Ñ Ð¿Ð°Ð½ÐµÐ»ÑŒ инÑтрументов"; + Text[ el ] = "ΓÏαμμή εÏγαλείων"; + Text[ nl ] = "Werktuigbalk"; + Text[ fr ] = "Barre d'instruments"; + Text[ es ] = "Barra de herramientas"; + Text[ fi ] = "Päätyökalurivi"; + Text[ ca ] = "Barra d'eines principal"; + Text[ it ] = "Barra degli strumenti"; + Text[ da ] = "Værktøjslinje"; + Text[ sv ] = "Verktygslist"; + Text[ pl ] = "Główny pasek narzÄ™dzi"; + Text[ pt-BR ] = "Barra de Ferramentas Principal"; + Text[ th ] = "à¹à¸–บเครื่à¸à¸‡à¸¡à¸·à¸à¸«à¸¥à¸±à¸"; + Text[ ja ] = "標準ツールãƒãƒ¼"; + Text[ ko ] = "주 ë„구 모ìŒ"; + Text[ zh-CN ] = "主工具æ "; + Text[ zh-TW ] = "主工具列"; + Text[ tr ] = "Ana araç çubuÄŸu"; + Text[ hi-IN ] = "पà¥à¤°à¤§à¤¾à¤¨ औज़ार पटà¥à¤Ÿà¥€"; + Text[ ar ] = "شريط الأدوات"; + Text[ he ] = "‮סרגל ר×שי‬"; +}; + +ToolBox RID_DRAW_TOOLBOX +{ + HelpId = RID_DRAW_TOOLBOX ; + Customize = TRUE ; + LineSpacing = TRUE ; + Dockable = TRUE ; + Moveable = TRUE ; + Sizeable = TRUE ; + Closeable = TRUE ; + Zoomable = TRUE ; + Scroll = TRUE ; + HideWhenDeactivate = TRUE ; + Border = TRUE ; + SVLook = TRUE ; + Align = BOXALIGN_LEFT ; + Size = MAP_APPFONT ( 0 , 0 ) ; + MenuStrings = TRUE ; + ItemList = + { + ToolBoxItem + { + Identifier = SID_TOGGLE_TITLE ; + HelpID = SID_TOGGLE_TITLE ; + }; + ToolBoxItem + { + Identifier = SID_TOGGLE_LEGEND ; + HelpID = SID_TOGGLE_LEGEND ; + }; + ToolBoxItem + { + Identifier = SID_TOGGLE_AXIS_TITLE ; + HelpID = SID_TOGGLE_AXIS_TITLE ; + }; + ToolBoxItem + { + Identifier = SID_TOGGLE_AXIS_DESCR ; + HelpID = SID_TOGGLE_AXIS_DESCR ; + }; + ToolBoxItem + { + Identifier = SID_TOGGLE_GRID_HORZ ; + HelpID = SID_TOGGLE_GRID_HORZ ; + }; + ToolBoxItem + { + Identifier = SID_TOGGLE_GRID_VERT ; + HelpID = SID_TOGGLE_GRID_VERT ; + }; + ToolBoxItem + { + Type = TOOLBOXITEM_SEPARATOR ; + }; + ToolBoxItem + { + Identifier = SID_DIAGRAM_TYPE ; + HelpID = SID_DIAGRAM_TYPE ; + }; + ToolBoxItem + { + Identifier = SID_AUTOFORMAT ; + HelpID = HID_SCH_CHART_AUTO_FORMAT ; + }; + ToolBoxItem + { + Type = TOOLBOXITEM_SEPARATOR ; + }; + ToolBoxItem + { + Identifier = SID_DIAGRAM_DATA ; + HelpID = SID_DIAGRAM_DATA ; + }; + ToolBoxItem + { + Identifier = SID_DATA_IN_ROWS ; + HelpID = SID_DATA_IN_ROWS ; + }; + ToolBoxItem + { + Identifier = SID_DATA_IN_COLUMNS ; + HelpID = SID_DATA_IN_COLUMNS ; + }; + ToolBoxItem + { + Type = TOOLBOXITEM_SEPARATOR ; + }; + ToolBoxItem + { + Identifier = SID_SCALE_TEXT ; + HelpID = SID_SCALE_TEXT ; + }; + ToolBoxItem + { + Identifier = SID_NEW_ARRANGEMENT ; + HelpID = SID_NEW_ARRANGEMENT ; + }; + }; +}; + + +// *** Popup-Menus *** + +#include "sch_menuids.src" + + + + + + + +#undef IS_DEFAULT +#include "sch_menu.src" + + + + + + + + + + + diff --git a/binfilter/bf_sch/source/ui/app/sch_globopt.cxx b/binfilter/bf_sch/source/ui/app/sch_globopt.cxx new file mode 100644 index 000000000000..b28dc53e8d4f --- /dev/null +++ b/binfilter/bf_sch/source/ui/app/sch_globopt.cxx @@ -0,0 +1,113 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 "globopt.hxx" + +#include <stdio.h> + +#include <bf_svtools/syslocale.hxx> +#include <unotools/configitem.hxx> +namespace binfilter { + +// ================================================================================ + +/*N*/ namespace +/*N*/ { +/*N*/ +/*N*/ bool IsMetric() +/*N*/ { +/*N*/ SvtSysLocale aSysLocale; +/*N*/ const LocaleDataWrapper* pLocWrapper = aSysLocale.GetLocaleDataPtr(); +/*N*/ MeasurementSystem eSys = pLocWrapper->getMeasurementSystemEnum(); +/*N*/ +/*N*/ return ( eSys == MEASURE_METRIC ); +/*N*/ } + +// ---------------------------------------- + +/*N*/ class CalcConfigItem : public ::utl::ConfigItem +/*N*/ { +/*N*/ public: +/*N*/ CalcConfigItem() : +/*N*/ ConfigItem( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Office.Calc/Layout" ))) +/*N*/ {} +/*N*/ +/*N*/ FieldUnit GetMeasureUnit(); + void Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames ); + void Commit(); +/*N*/ }; + +/*N*/ FieldUnit CalcConfigItem::GetMeasureUnit() +/*N*/ { +/*N*/ FieldUnit eResult( FUNIT_CM ); +/*N*/ +/*N*/ ::com::sun::star::uno::Sequence< ::rtl::OUString > aNames( 1 ); +/*N*/ if( IsMetric() ) +/*N*/ aNames[ 0 ] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Other/MeasureUnit/Metric" )); +/*N*/ else +/*N*/ aNames[ 0 ] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Other/MeasureUnit/NonMetric" )); +/*N*/ +/*N*/ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > aResult( +/*N*/ GetProperties( aNames )); +/*N*/ +/*N*/ if( aResult[ 0 ].hasValue() ) +/*N*/ { +/*N*/ sal_Int32 nValue; +/*N*/ aResult[ 0 ] >>= nValue; +/*N*/ eResult = static_cast< FieldUnit >( nValue ); +/*N*/ } +/*N*/ +/*N*/ return eResult; +/*N*/ } + +void CalcConfigItem::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames ) {} +void CalcConfigItem::Commit() {} + + +} // anonymous namespace + +// ================================================================================ + +namespace sch +{ + +namespace util +{ + +/*N*/ FieldUnit GetMeasureUnit() +/*N*/ { +/*N*/ static CalcConfigItem aCfgItem; +/*N*/ FieldUnit aUnit( aCfgItem.GetMeasureUnit() ); +/*N*/ +/*N*/ return aCfgItem.GetMeasureUnit(); +/*N*/ } + +} // namespace util +} // namespace sch +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/app/sch_menu.src b/binfilter/bf_sch/source/ui/app/sch_menu.src new file mode 100644 index 000000000000..8e823a9b219f --- /dev/null +++ b/binfilter/bf_sch/source/ui/app/sch_menu.src @@ -0,0 +1,1955 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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. + * + ************************************************************************/ +#define NO_LOCALIZE_EXPORT + + + +#ifndef _GLOBLMN_HRC //autogen +#include <bf_svx/globlmn.hrc> +#endif + +#include "sch_menuids.src" + +#define MN_SUB_VIEW 91 +#define MN_SUB_TOOLBAR 92 +#define MN_SUB_GRAPHIC 93 +#define MN_SUB_SPELLING 94 +#define MN_SUB_TEMPLATES 95 + + +#define MN_WIN 28 +#define WORKAROUND_20 20 +#define WORKAROUND_21 21 +#define WORKAROUND_22 22 +#define WORKAROUND_23 23 +#define WORKAROUND_25 25 + + + // defines fuer das Helpmenu + // in globlmn.hrc nur fuer Writer benoetigt +#ifndef MN_HELP +#define MN_HELP +#endif + +#ifdef IS_DEFAULT +Accelerator RID_DEFAULTACCEL +#else +Accelerator RID_ACCEL +#endif +{ + ItemList = + { + AcceleratorItem + { + Identifier = SID_SHOW_ITEMBROWSER ; + Key = KeyCode + { + Code = KEY_9 ; + Shift = TRUE ; + Modifier1 = TRUE ; + Modifier2 = TRUE ; + }; + }; + AcceleratorItem + { + Identifier = SID_NEWDOC ; + Key = KeyCode + { + Function = KEYFUNC_NEW ; + }; + }; + AcceleratorItem + { + Identifier = SID_OPENDOC ; + Key = KeyCode + { + Function = KEYFUNC_OPEN ; + }; + }; + AcceleratorItem + { + Identifier = SID_SAVEDOC ; + Key = KeyCode + { + Function = KEYFUNC_SAVE ; + }; + }; + AcceleratorItem + { + Identifier = SID_SAVEASDOC ; + Key = KeyCode + { + Function = KEYFUNC_SAVEAS ; + }; + }; + AcceleratorItem + { + Identifier = SID_PRINTDOC ; + Key = KeyCode + { + Function = KEYFUNC_PRINT ; + }; + }; + AcceleratorItem + { + Identifier = SID_QUITAPP ; + Key = KeyCode + { + Function = KEYFUNC_QUIT ; + }; + }; + AcceleratorItem + { + Identifier = SID_CUT ; + Key = KeyCode + { + Function = KEYFUNC_CUT ; + }; + }; + AcceleratorItem + { + Identifier = SID_COPY ; + Key = KeyCode + { + Function = KEYFUNC_COPY ; + }; + }; + AcceleratorItem + { + Identifier = SID_PASTE ; + Key = KeyCode + { + Function = KEYFUNC_PASTE ; + }; + }; + AcceleratorItem + { + Identifier = SID_DELETE ; + Key = KeyCode + { + Function = KEYFUNC_DELETE ; + }; + }; + AcceleratorItem + { + Identifier = SID_UNDO ; + Key = KeyCode + { + Function = KEYFUNC_UNDO ; + }; + }; + AcceleratorItem + { + Identifier = SID_REDO ; + Key = KeyCode + { + Function = KEYFUNC_REDO ; + }; + }; + AcceleratorItem + { + Identifier = SID_REPEAT ; + Key = KeyCode + { + Function = KEYFUNC_REPEAT ; + }; + }; + AcceleratorItem + { + Identifier = SID_FOCUSURLBOX ; + Key = KeyCode + { + Code = KEY_O ; + Shift = TRUE ; Modifier1 = TRUE ; Modifier2 = FALSE ; + }; + }; + AcceleratorItem + { + Identifier = SID_WIN_FULLSCREEN ; + Key = KeyCode + { + Code = KEY_J ; + Shift = TRUE ; + Modifier1 = TRUE ; + Modifier2 = FALSE ; + }; + }; + AcceleratorItem + { + Identifier = SID_DESKTOPMODE ; + Key = KeyCode + { + Code = KEY_I ; + Shift = TRUE ; + Modifier1 = TRUE ; + Modifier2 = FALSE ; + }; + }; + AcceleratorItem + { + Identifier = SID_CLOSEWIN ; + Key = KeyCode + { + Function = KEYFUNC_CLOSE ; + }; + }; + }; +}; + +#ifdef IS_DEFAULT +Menu RID_DEFAULTMENU +#else +Menu RID_MENU +#endif +{ + ItemList = + { + MenuItem + { + ITEM_FILE_PICKLIST + SubMenu = Menu + { + ItemList = + { + MenuItem + { + Identifier = SID_NEWDOCDIRECT ; + HelpID = SID_NEWDOCDIRECT ; + Text [ de ] = "~Neu" ; + Text [ en-US ] = "~New" ; + Text [ x-comment ] = " "; + Text[ pt ] = "~Novo"; + Text[ ru ] = "Созд~ать"; + Text[ el ] = "~ΔημιουÏγία"; + Text[ nl ] = "~Nieuw"; + Text[ fr ] = "N~ouveau"; + Text[ es ] = "~Nuevo"; + Text[ fi ] = "~Uusi"; + Text[ ca ] = "~Nou"; + Text[ it ] = "Nuovo"; + Text[ da ] = "~Ny(t)"; + Text[ sv ] = "~Nytt"; + Text[ pl ] = "~Nowy"; + Text[ pt-BR ] = "~Novo"; + Text[ th ] = "ใ~หม่"; + Text[ ja ] = "æ–°è¦ä½œæˆ(~N)"; + Text[ ko ] = "새로 만들기(~N)"; + Text[ zh-CN ] = "新建(~N)"; + Text[ zh-TW ] = "開啟新檔(~N)"; + Text[ tr ] = "Yeni"; + Text[ hi-IN ] = "~नया"; + Text[ ar ] = "جديد"; + Text[ he ] = "‮חדש‬"; + }; + MenuItem + { + ITEM_FILE_OPENDOC + }; + ITEM_FILE_AUTOPILOT + MenuItem + { + Separator = TRUE ; + }; + MenuItem + { + ITEM_FILE_CLOSEDOC + }; + MenuItem + { + ITEM_FILE_SAVEDOC + }; + MenuItem + { + ITEM_FILE_SAVEASDOC + }; + MenuItem + { + ITEM_FILE_SAVEDOCS + }; + MenuItem + { + ITEM_FILE_LASTVERSIONDOC + }; + MenuItem + { + ITEM_FILE_VERSIONDIALOG + }; + MenuItem + { + ITEM_FILE_MAIL_SENDDOC + }; + MenuItem + { + Separator = TRUE ; + }; + MenuItem + { + ITEM_FILE_DOCINFO + }; + MenuItem + { + Separator = TRUE ; + }; + MenuItem + { + ITEM_FILE_PRINTDOC + }; + MenuItem + { + ITEM_FILE_SETUPPRINTER + }; + MenuItem + { + Separator = TRUE ; + }; + MenuItem + { + ITEM_FILE_QUITAPP + }; + }; + }; + }; + MenuItem + { + Identifier = WORKAROUND_20 ; + HelpID = 20 ; + Text [ de ] = "~Bearbeiten" ; + Text [ en-US ] = "~Edit" ; + SubMenu = Menu + { + ItemList = + { + MenuItem + { + ITEM_EDIT_UNDO + }; + MenuItem + { + ITEM_EDIT_REDO + }; + MenuItem + { + ITEM_EDIT_REPEAT + }; + MenuItem + { + Separator = TRUE ; + }; + MenuItem + { + Identifier = SID_DIAGRAM_DATA ; + HelpID = SID_DIAGRAM_DATA ; + Text [ de ] = "~Diagrammdaten" ; + Text [ en-US ] = "~Chart Data" ; + Text [ x-comment ] = " "; + Text[ pt ] = "~Dados do gráfico"; + Text[ ru ] = "~Данные диаграммы"; + Text[ el ] = "~ΔεδομÎνα διαγÏάμματος"; + Text[ nl ] = "~Diagramgegevens"; + Text[ fr ] = "~Données du diagramme"; + Text[ es ] = "Datos del ~diagrama"; + Text[ fi ] = "~Kaaviotiedot"; + Text[ ca ] = "Dades del ~diagrama "; + Text[ it ] = "~Dati del diagramma"; + Text[ da ] = "Diagramdata"; + Text[ sv ] = "~Diagramdata"; + Text[ pl ] = "Dane wykresu"; + Text[ pt-BR ] = "Diagrammdaten"; + Text[ th ] = "ข้à¸à¸¡à¸¹à¸¥à¹~ผนภูมิ"; + Text[ ja ] = "グラフã®ãƒ‡ãƒ¼ã‚¿(~C)"; + Text[ ko ] = "차트 ë°ì´í„°(~C)"; + Text[ zh-CN ] = "图表数æ®(~C)"; + Text[ zh-TW ] = "圖表資料(~C)"; + Text[ tr ] = "~Karakter Verisi"; + Text[ hi-IN ] = "~चारà¥à¤Ÿà¥ डॉटा"; + Text[ ar ] = "بيانات الرسم البياني"; + Text[ he ] = "~Diagrammdaten"; + }; + MenuItem + { + Separator = TRUE ; + }; + MenuItem + { + ITEM_EDIT_CUT + }; + MenuItem + { + ITEM_EDIT_COPY + }; + MenuItem + { + ITEM_EDIT_PASTE + }; + }; + }; + Text [ x-comment ] = " "; + Text[ pt ] = "~Editar"; + Text[ ru ] = "~Правка"; + Text[ el ] = "~ΕπεξεÏγασία"; + Text[ nl ] = "Be~werken"; + Text[ fr ] = "~Édition"; + Text[ es ] = "~Editar"; + Text[ fi ] = "~Muokkaa"; + Text[ ca ] = "~Edita"; + Text[ it ] = "~Modifica"; + Text[ da ] = "~Rediger"; + Text[ sv ] = "~Redigera"; + Text[ pl ] = "~Edytuj"; + Text[ pt-BR ] = "~Editar"; + Text[ th ] = "à¹~à¸à¹‰à¹„ข"; + Text[ ja ] = "編集(~E)"; + Text[ ko ] = "편집(~E)"; + Text[ zh-CN ] = "编辑(~E)"; + Text[ zh-TW ] = "編輯(~E)"; + Text[ tr ] = "Dü~zenle"; + Text[ hi-IN ] = "~संपादन"; + Text[ ar ] = "~تØرير"; + Text[ he ] = "‮עריכה‬"; + }; + MenuItem + { + Identifier = WORKAROUND_21 ; + HelpID = 21 ; + Text [ de ] = "~Ansicht" ; + Text [ en-US ] = "~View" ; + SubMenu = Menu + { + ItemList = + { + MenuItem + { + Identifier = MN_SUB_TOOLBAR ; + HelpID = MN_SUB_TOOLBAR ; + Text [ de ] = "S~ymbolleisten" ; + SubMenu = Menu + { + ItemList = + { + MenuItem + { + ITEM_VIEW_TOGGLEFUNCTIONBAR + }; + MenuItem + { + Identifier = SID_TOGGLETOOLBAR ; + HelpID = SID_TOGGLETOOLBAR ; + Text [ de ] = "~Werkzeugleiste" ; + Text [ en-US ] = "Main ~Toolbar" ; + Text [ x-comment ] = " "; + Text[ pt ] = "Barra de ~ferramentas"; + Text[ ru ] = "~Панель инÑтрументов"; + Text[ el ] = "~ΓÏαμμή εÏγαλειών"; + Text[ nl ] = "~Werktuigbalk"; + Text[ fr ] = "Barre d'~instruments"; + Text[ es ] = "Barra de ~herramientas"; + Text[ fi ] = "Pää~työkalurivi"; + Text[ ca ] = "Barra d'~eines principal"; + Text[ it ] = "Barra st~rumenti"; + Text[ da ] = "~Værktøjslinje"; + Text[ sv ] = "~Verktygslist"; + Text[ pl ] = "Pasek narzÄ™dziowy"; + Text[ pt-BR ] = "Barra de ~ferramentas"; + Text[ th ] = "à¹~ถบเครื่à¸à¸‡à¸¡à¸·à¸à¸«à¸¥à¸±à¸"; + Text[ ja ] = "標準ツールãƒãƒ¼(~T)"; + Text[ ko ] = "주 ë„구 모ìŒ(~T)"; + Text[ zh-CN ] = "主工具æ (~T)"; + Text[ zh-TW ] = "主工具列(~T)"; + Text[ tr ] = "Ana ~AraççubuÄŸu"; + Text[ hi-IN ] = "~मà¥à¤–à¥à¤¯ औज़ार पटà¥à¤Ÿà¥€"; + Text[ ar ] = "شريط الأدوات"; + Text[ he ] = "~Werkzeugleiste"; + }; + MenuItem + { + ITEM_INSERT_HYPERLINK_INSERT + }; + MenuItem + { + Separator = TRUE ; + }; + MenuItem + { + Identifier = SID_CUSTOMIZETOOLBOX ; + HelpID = SID_CUSTOMIZETOOLBOX ; + Text [ de ] = "~Bearbeiten..." ; + Text [ en-US ] = "Customi~ze..." ; + Text [ x-comment ] = " "; + Text[ pt ] = "~Personalizar..."; + Text[ ru ] = "~Правка..."; + Text[ el ] = "~ΕπεξεÏγασία..."; + Text[ nl ] = "Be~werken..."; + Text[ fr ] = "~Personnaliser..."; + Text[ es ] = "~Personalizar..."; + Text[ fi ] = "Mukau~ta"; + Text[ ca ] = "Personalit~za..."; + Text[ it ] = "~Modifica..."; + Text[ da ] = "~Rediger..."; + Text[ sv ] = "~Redigera..."; + Text[ pl ] = "Edytuj..."; + Text[ pt-BR ] = "~Configurar..."; + Text[ th ] = "à¸à¸³à¸«à¸™à¸”เ~à¸à¸‡..."; + Text[ ja ] = "カスタマイズ(~Z)..."; + Text[ ko ] = "ì‚¬ìš©ìž ì •ì˜(~Z)..."; + Text[ zh-CN ] = "编辑(~Z)..."; + Text[ zh-TW ] = "編輯(~Z)..."; + Text[ tr ] = "Özelle~ÅŸtir..."; + Text[ hi-IN ] = "~वà¥à¤¯à¤µà¤¸à¥à¤¥à¤¾ करो..."; + Text[ ar ] = "تØرير..."; + Text[ he ] = "~Bearbeiten..."; + }; + }; + }; + Text [ en-US ] = "~Toolbars" ; + Text [ x-comment ] = " "; + Text[ pt ] = "Barras de ~ferramentas"; + Text[ ru ] = "Панели Ñимволов"; + Text[ el ] = "ΓÏαμμÎÏ‚ σ~υμβόλων"; + Text[ nl ] = "~Werkbalken"; + Text[ fr ] = "Barres d'~outils"; + Text[ es ] = "~Barras de sÃmbolos"; + Text[ fi ] = "~Työkalurivit"; + Text[ ca ] = "~Barres d'eines"; + Text[ it ] = "~Barre dei simboli"; + Text[ da ] = "Ikonlin~jer"; + Text[ sv ] = "S~ymbollister"; + Text[ pl ] = "Paski symboli"; + Text[ pt-BR ] = "Barras de ~ferramentas"; + Text[ th ] = "à¹~ถบเครื่à¸à¸‡à¸¡à¸·à¸"; + Text[ ja ] = "ツールãƒãƒ¼(~T)"; + Text[ ko ] = "ë„구 모ìŒ(~T)"; + Text[ zh-CN ] = "å›¾æ ‡æ (~T)"; + Text[ zh-TW ] = "工具列(~T)"; + Text[ tr ] = "~Araç çubukları"; + Text[ hi-IN ] = "~औज़ार पटà¥à¤Ÿà¥€"; + Text[ ar ] = "أشرطة الرموز"; + Text[ he ] = "‮סרגלי כלי×‬"; + }; + MenuItem + { + ITEM_VIEW_TOGGLESTATUSBAR //ITEM_VIEW_TASKBAR + }; + MenuItem + { + ITEM_VIEW_TOGGLEIMESTATUSWINDOW + }; + MenuItem + { + Separator = TRUE ; + }; + ITEM_VIEW_SCREENMODE + }; + }; + Text [ x-comment ] = " "; + Text[ pt ] = "~Ver"; + Text[ ru ] = "~Вид"; + Text[ el ] = "Î Ïο~βολή"; + Text[ nl ] = "Beel~d"; + Text[ fr ] = "~Affichage"; + Text[ es ] = "~Ver"; + Text[ fi ] = "~Näytä"; + Text[ ca ] = "~Visualitza"; + Text[ it ] = "~Visualizza"; + Text[ da ] = "~Vis"; + Text[ sv ] = "Vi~sa"; + Text[ pl ] = "~Widok"; + Text[ pt-BR ] = "~Ver"; + Text[ th ] = "~มุมมà¸à¸‡"; + Text[ ja ] = "表示(~V)"; + Text[ ko ] = "보기(~V)"; + Text[ zh-CN ] = "视图(~V)"; + Text[ zh-TW ] = "檢視(~V)"; + Text[ tr ] = "~Görüntüle"; + Text[ hi-IN ] = "~à ¤¦à ¥ƒà ¤¶à ¥Âà ¤¯"; + Text[ ar ] = "~عرض"; + Text[ he ] = "‮תצוגה‬"; + }; + MenuItem + { + Identifier = WORKAROUND_22 ; + HelpID = 22 ; + Text [ de ] = "~Einfügen" ; + Text [ en-US ] = "~Insert" ; + SubMenu = Menu + { + ItemList = + { + MenuItem + { + Identifier = SID_INSERT_TITLE ; + HelpID = SID_INSERT_TITLE ; + Text [ de ] = "~Titel..." ; + Text [ en-US ] = "~Title..." ; + Text [ x-comment ] = " "; + Text[ pt ] = "~TÃtulo..."; + Text[ ru ] = "~Заголовок..."; + Text[ el ] = "~Τίτλος..."; + Text[ nl ] = "~Titel..."; + Text[ fr ] = "~Titre..."; + Text[ es ] = "~TÃtulo..."; + Text[ fi ] = "~Otsikko"; + Text[ ca ] = "~TÃtol..."; + Text[ it ] = "~Titolo..."; + Text[ da ] = "Titel..."; + Text[ sv ] = "~Rubrik..."; + Text[ pl ] = "~TytuÅ‚..."; + Text[ pt-BR ] = "T?tulo..."; + Text[ th ] = "~ชื่à¸..."; + Text[ ja ] = "タイトル(~T)..."; + Text[ ko ] = "ì œëª©(~T)..."; + Text[ zh-CN ] = "æ ‡é¢˜(~T)..."; + Text[ zh-TW ] = "標題(~T)..."; + Text[ tr ] = "~BaÅŸlık..."; + Text[ hi-IN ] = "~Title..."; + Text[ ar ] = "عنوان..."; + Text[ he ] = "‮כותרת...‬"; + }; + MenuItem + { + Identifier = SID_INSERT_CHART_LEGEND ; + HelpID = SID_INSERT_CHART_LEGEND ; + Text [ de ] = "~Legende..." ; + Text [ en-US ] = "~Legend..." ; + Text [ x-comment ] = " "; + Text[ pt ] = "~Legenda..."; + Text[ ru ] = "Легенда..."; + Text[ el ] = "Υπόμνημα..."; + Text[ nl ] = "~Legenda..."; + Text[ fr ] = "~Légende..."; + Text[ es ] = "~Leyenda..."; + Text[ fi ] = "~Selite..."; + Text[ ca ] = "~Llegenda..."; + Text[ it ] = "~Legenda..."; + Text[ da ] = "Forklaring..."; + Text[ sv ] = "~Förklaring..."; + Text[ pl ] = "~Legenda..."; + Text[ pt-BR ] = "Legenda..."; + Text[ th ] = "~คำà¸à¸˜à¸´à¸šà¸²à¸¢..."; + Text[ ja ] = "凡例(~L)..."; + Text[ ko ] = "범례(~L)..."; + Text[ zh-CN ] = "图例(~L)..."; + Text[ zh-TW ] = "圖例(~L)..."; + Text[ tr ] = "~Gösterge"; + Text[ hi-IN ] = "~लेज़नà¥à¤¡à¤¼..."; + Text[ ar ] = "Ù…ÙØªØ§Ø Ø§Ù„Ø±Ø³Ù… البياني..."; + Text[ he ] = "~Legende..."; + }; + MenuItem + { + Identifier = SID_INSERT_DESCRIPTION ; + HelpID = SID_INSERT_DESCRIPTION ; + Text [ de ] = "~Datenbeschriftung..." ; + Text [ en-US ] = "~Data Labels..." ; + Text[ pt ] = "~Rótulos de dados..."; + Text[ ru ] = "~ПодпиÑÑŒ данных..."; + Text[ el ] = "ΕπιγÏαφή δε~δομÎνων..."; + Text[ nl ] = "~Gegevenslabels..."; + Text[ fr ] = "Étiquetage des ~données..."; + Text[ es ] = "~Etiqueta datos..."; + Text[ fi ] = "~Tietonimiöt"; + Text[ ca ] = "Etiquetes de ~dades..."; + Text[ it ] = "~Dicitura dati..."; + Text[ da ] = "Dataetiketter..."; + Text[ sv ] = "~Dataetiketter..."; + Text[ pl ] = "~Etykiety danych..."; + Text[ pt-BR ] = "Descri??o dos dados..."; + Text[ th ] = "ป้ายชื่à¸~ข้à¸à¸¡à¸¹à¸¥..."; + Text[ ja ] = "データラベル(~D)..."; + Text[ ko ] = "ë°ì´í„° ë ˆì´ë¸”(~D)..."; + Text[ zh-CN ] = "æ•°æ®æ ‡å¿—(~D)..."; + Text[ zh-TW ] = "資料標籤(~D)..."; + Text[ tr ] = "~Veri Etiketleri..."; + Text[ hi-IN ] = "~Data Labels..."; + Text[ ar ] = "عنونة البيانات..."; + Text[ he ] = "~Datenbeschriftung..."; + }; + MenuItem + { + Identifier = SID_INSERT_AXIS ; + HelpID = SID_INSERT_AXIS ; + Text [ de ] = "~Achsen..." ; + Text [ en-US ] = "~Axes..." ; +// Text [ norwegian ] = "Akse og rutenett" ; +// Text [ italian ] = "~Assi e Griglia..." ; +// Text [ portuguese_brazilian ] = "Eixo e grade" ; +// Text [ portuguese ] = "Eixos e ~grelhas..." ; +// Text [ finnish ] = "Akseli ja taustaruudukko" ; +// Text [ danish ] = "Akser og gitterlinjer..." ; +// Text [ french ] = "~Axes et grilles..." ; +// Text [ swedish ] = "~Axlar och stödraster..." ; +// Text [ dutch ] = "~Assen en rasters..." ; +// Text [ spanish ] = "~Ejes y cuadrículas..." ; +// Text[ chinese_simplified ] = "ÖáÊýÖµºÍÍø¸ñÏß(~A)..."; +// Text[ russian ] = "~Îñè è ñåòêè..."; +// Text[ polish ] = "Osie i siatki..."; +// Text[ japanese ] = "Ž²‚Æ–Ú·ü(~A)..."; +// Text[ chinese_traditional ] = "¶b©Mºô®æ½u(~A)..."; +// Text[ arabic ] = "ãÍÇæÑ æÔÈßÇÊ..."; + Text [ x-comment ] = " "; + Text[ pt ] = "Ei~xos..."; + Text[ ru ] = "~ОÑи..."; + Text[ el ] = "Άξον~ες..."; + Text[ nl ] = "~Assen..."; + Text[ fr ] = "~Axes..."; + Text[ es ] = "~Ejes..."; + Text[ fi ] = "~Akselit"; + Text[ ca ] = "~Eixos..."; + Text[ it ] = "~Assi..."; + Text[ da ] = "Akser..."; + Text[ sv ] = "~Axlar..."; + Text[ pl ] = "~Osie..."; + Text[ pt-BR ] = "Eixo e grade"; + Text[ th ] = "à¹~à¸à¸™..."; + Text[ ja ] = "軸(~A)..."; + Text[ ko ] = "축(~A)..."; + Text[ zh-CN ] = "è½´(~A)..."; + Text[ zh-TW ] = "軸(~A)..."; + Text[ tr ] = "~Eksenler..."; + Text[ hi-IN ] = "~Axes..."; + Text[ ar ] = "Ù…Øاور..."; + Text[ he ] = "~Achsen..."; + }; + MenuItem + { + Identifier = SID_INSERT_GRIDS ; + HelpID = SID_INSERT_GRIDS ; + Text [ de ] = "~Gitter..."; + Text [ en-US ] = "~Grids..."; + Text [ x-comment ] = " "; + Text[ pt ] = "~Grelhas..."; + Text[ ru ] = "~Сетка..."; + Text[ el ] = "ΠλÎ~γμα..."; + Text[ nl ] = "~Rasters..."; + Text[ fr ] = "~Grilles..."; + Text[ es ] = "~CuadrÃculas..."; + Text[ fi ] = "~Ruudukot"; + Text[ ca ] = "~Graelles..."; + Text[ it ] = "~Griglia..."; + Text[ da ] = "Gitre..."; + Text[ sv ] = "~Gitter..."; + Text[ pl ] = "~Siatki..."; + Text[ pt-BR ] = "~Gridlines..."; + Text[ th ] = "เ~ส้นตาราง..."; + Text[ ja ] = "目盛線(~G)..."; + Text[ ko ] = "ëˆˆê¸ˆì„ (~G)..."; + Text[ zh-CN ] = "ç½‘æ ¼çº¿(~G)..."; + Text[ zh-TW ] = "ç¶²æ ¼ç·š(~G)..."; + Text[ tr ] = "~Izgaralar..."; + Text[ hi-IN ] = "~Grids..."; + Text[ ar ] = "شبكات..."; + Text[ he ] = "~Gitter..."; + }; + MenuItem + { + Identifier = SID_INSERT_STATISTICS ; + HelpID = SID_INSERT_STATISTICS ; + Text [ de ] = "~Statistik..." ; + Text [ en-US ] = "~Statistics..." ; + Text [ x-comment ] = " "; + Text[ pt ] = "~EstatÃstica..."; + Text[ ru ] = "СтатиÑтика..."; + Text[ el ] = "~Στατιστικά..."; + Text[ nl ] = "~Statistiek..."; + Text[ fr ] = "~Statistiques..."; + Text[ es ] = "~EstadÃstica..."; + Text[ fi ] = "~Tilastotiedot"; + Text[ ca ] = "~EstadÃstica..."; + Text[ it ] = "~Statistica..."; + Text[ da ] = "Statistik..."; + Text[ sv ] = "~Statistik..."; + Text[ pl ] = "~Statystyka..."; + Text[ pt-BR ] = "Eixo e grade"; + Text[ th ] = "~สถิติ..."; + Text[ ja ] = "統計(~S)..."; + Text[ ko ] = "통계(~S)..."; + Text[ zh-CN ] = "统计(~S)..."; + Text[ zh-TW ] = "統計(~S)..."; + Text[ tr ] = "~Ä°statistikler..."; + Text[ hi-IN ] = "~Statistics..."; + Text[ ar ] = "Ø¥Øصائيات..."; + Text[ he ] = "‮סטטיסטיקות...‬"; + }; + //------------------------------ + MenuItem { Separator = TRUE ; }; + //------------------------------ + MenuItem + { + Identifier = SID_CHARMAP ; + HelpId = SID_CHARMAP ; + Text [ de ] = "~Sonderzeichen..." ; + Text [ en-US ] = "S~pecial Character..." ; + Text [ x-comment ] = " "; + Text[ pt ] = "~Caracteres especiais..."; + Text[ ru ] = "Специальные Ñимволы..."; + Text[ el ] = "Ειδικοί ~χαÏακτήÏες..."; + Text[ nl ] = "~Speciale tekens..."; + Text[ fr ] = "~Caractères spéciaux..."; + Text[ es ] = "~SÃmbolos..."; + Text[ fi ] = "E~rikoismerkki"; + Text[ ca ] = "~SÃmbols..."; + Text[ it ] = "Caratteri ~speciali..."; + Text[ da ] = "~Specialtegn..."; + Text[ sv ] = "S~pecialtecken..."; + Text[ pl ] = "~Znaki specjalne..."; + Text[ pt-BR ] = "S?mbolo..."; + Text[ th ] = "ตัวà¸à¸±à¸à¸‚ระพิเ~ศษ..."; + Text[ ja ] = "記å·ã¨ç‰¹æ®Šæ–‡å—(~P)..."; + Text[ ko ] = "기호 ë° íŠ¹ìˆ˜ 문ìž(~P)..."; + Text[ zh-CN ] = "特殊å—符(~P)..."; + Text[ zh-TW ] = "特殊å—å…ƒ(~P)..."; + Text[ tr ] = "~Özel Karakterler..."; + Text[ hi-IN ] = "~विशेष अकà¥à¤·à¤°..."; + Text[ ar ] = "رموز خاصة..."; + Text[ he ] = "~Sonderzeichen..."; + }; + }; + + + + + + + + }; + Text [ x-comment ] = " "; + Text[ pt ] = "~Inserir"; + Text[ ru ] = "Ð’ÑÑ‚~авка"; + Text[ el ] = "~Εισαγωγή"; + Text[ nl ] = "~Invoegen"; + Text[ fr ] = "~Insertion"; + Text[ es ] = "~Insertar"; + Text[ fi ] = "~Lisää"; + Text[ ca ] = "~Insereix"; + Text[ it ] = "~Inserisci"; + Text[ da ] = "~Indsæt"; + Text[ sv ] = "~Infoga"; + Text[ pl ] = "W~staw"; + Text[ pt-BR ] = "~Inserir"; + Text[ th ] = "à¹~ทรà¸"; + Text[ ja ] = "挿入(~I)"; + Text[ ko ] = "삽입(~I)"; + Text[ zh-CN ] = "æ’å…¥(~I)"; + Text[ zh-TW ] = "æ’å…¥(~I)"; + Text[ tr ] = "~Ekle"; + Text[ hi-IN ] = "~छिपकाओ"; + Text[ ar ] = "إد~راج"; + Text[ he ] = "~Einfügen"; + }; + MenuItem + { + Identifier = WORKAROUND_23 ; + HelpID = 23 ; + Text [ de ] = "~Format" ; + Text [ en-US ] = "F~ormat" ; + SubMenu = Menu + { + ItemList = + { + MenuItem + { + Identifier = SID_DIAGRAM_OBJECTS ; + HelpID = SID_DIAGRAM_OBJECTS ; + Text [ de ] = "~Objekteigenschaften..." ; + Text [ en-US ] = "~Object Properties..." ; + Text [ x-comment ] = " "; + Text[ pt ] = "~Propriedades do objecto..."; + Text[ ru ] = "~СвойÑтва объекта..."; + Text[ el ] = "Ιδιότητες αντικειμÎν~ων..."; + Text[ nl ] = "~Objecteigenschappen"; + Text[ fr ] = "Propriétés de l'~objet..."; + Text[ es ] = "~Propiedades del objeto..."; + Text[ fi ] = "~Objektin ominaisuudet"; + Text[ ca ] = "~Propietats de l'objecte..."; + Text[ it ] = "Proprietà ~oggetto..."; + Text[ da ] = "Objektegenskaber..."; + Text[ sv ] = "~Objektegenskaper..."; + Text[ pl ] = "WÅ‚aÅ›ciwoÅ›ci obiektu..."; + Text[ pt-BR ] = "Linha de dados/~ponto..."; + Text[ th ] = "คุณสมบัติ~วัตถุ..."; + Text[ ja ] = "オブジェクトã®å±žæ€§(~O)..."; + Text[ ko ] = "개체 ë“±ë¡ ì •ë³´(~O)..."; + Text[ zh-CN ] = "对象属性(~O)..."; + Text[ zh-TW ] = "物件屬性(~O)..."; + Text[ tr ] = "~Nesne Özellikleri..."; + Text[ hi-IN ] = "~वसà¥à¤¤à¥ का विशेषतायें..."; + Text[ ar ] = "خصائص الكائن..."; + Text[ he ] = "~Objekteigenschaften..."; + }; + MN_TRANSFORM; + MenuItem + { + Separator = TRUE ; + }; + MenuItem + { + Identifier = SID_CHART_TITLE ; + HelpID = SID_CHART_TITLE ; + Text [ de ] = "~Titel" ; + Text [ en-US ] = "~Title" ; + SubMenu = Menu + { + ItemList = + { + MenuItem + { + Identifier = SID_DIAGRAM_TITLE_MAIN ; + HelpID = SID_DIAGRAM_TITLE_MAIN ; + Text [ de ] = "~Haupttitel..." ; + Text [ en-US ] = "~Main Title..." ; + Text [ x-comment ] = " "; + Text[ pt ] = "~TÃtulo principal..."; + Text[ ru ] = "Главный заголовок..."; + Text[ el ] = "~ΚÏÏιος τίτλος..."; + Text[ nl ] = "~Hoofdtitel..."; + Text[ fr ] = "Titre ~principal..."; + Text[ es ] = "TÃtulo ~principal..."; + Text[ fi ] = "~Pääotsikko"; + Text[ ca ] = "TÃtol ~principal..."; + Text[ it ] = "Titolo principale..."; + Text[ da ] = "Hovedtitel..."; + Text[ sv ] = "~Huvudrubrik..."; + Text[ pl ] = "TytuÅ‚ główny..."; + Text[ pt-BR ] = "TÃtulo ~principal..."; + Text[ th ] = "ชื่à¸~หลัà¸..."; + Text[ ja ] = "メインタイトル(~M)..."; + Text[ ko ] = "주 ì œëª©(~M)..."; + Text[ zh-CN ] = "ä¸»æ ‡é¢˜(~M)..."; + Text[ zh-TW ] = "主標題(~M)..."; + Text[ tr ] = "Ana ~BaÅŸlık.."; + Text[ hi-IN ] = "~पà¥à¤°à¤§à¤¾à¤¨ शीरà¥à¤·à¤•à¥..."; + Text[ ar ] = "العنوان الرئيسي..."; + Text[ he ] = "~Haupttitel..."; + }; + MenuItem + { + Identifier = SID_DIAGRAM_TITLE_SUB ; + HelpID = SID_DIAGRAM_TITLE_SUB ; + Text [ de ] = "~Untertitel..." ; + Text [ en-US ] = "S~ubtitle..." ; + Text [ x-comment ] = " "; + Text[ pt ] = "~SubtÃtulo..."; + Text[ ru ] = "Подзаголовок..."; + Text[ el ] = "~Υπότιτλος..."; + Text[ nl ] = "~Subtitel..."; + Text[ fr ] = "~Sous-titre..."; + Text[ es ] = "~SubtÃtulo..."; + Text[ fi ] = "Ala~otsikko"; + Text[ ca ] = "~SubtÃtol..."; + Text[ it ] = "Sottotitolo..."; + Text[ da ] = "Undertitel..."; + Text[ sv ] = "~Underrubrik..."; + Text[ pl ] = "PodtytuÅ‚..."; + Text[ pt-BR ] = "~Sub-tÃtulo..."; + Text[ th ] = "ชื่à¸~รà¸à¸‡..."; + Text[ ja ] = "サブタイトル(~U)..."; + Text[ ko ] = "ë¶€ì œ(~U)..."; + Text[ zh-CN ] = "åˆ†æ ‡é¢˜(~U)..."; + Text[ zh-TW ] = "分標題(~U)..."; + Text[ tr ] = "~AltbaÅŸlık..."; + Text[ hi-IN ] = "उ~पशीरà¥à¤·à¤•..."; + Text[ ar ] = "عنوان Ùرعي..."; + Text[ he ] = "~Untertitel..."; + }; + MenuItem + { + Identifier = SID_DIAGRAM_TITLE_X ; + HelpID = SID_DIAGRAM_TITLE_X ; + Text [ de ] = "~X-Achsentitel..." ; + Text [ en-US ] = "Title (~X Axis)..." ; + Text [ x-comment ] = " "; + Text[ pt ] = "TÃtulo do eixo ~X..."; + Text[ ru ] = "Заголовок оÑи X..."; + Text[ el ] = "Τίτλος άξονα ~X..."; + Text[ nl ] = "Titel ~X-as..."; + Text[ fr ] = "Titre de l'axe ~X..."; + Text[ es ] = "TÃtulo del eje ~X..."; + Text[ fi ] = "Otsikko (~X-akseli)"; + Text[ ca ] = "TÃtol de l'eix ~X..."; + Text[ it ] = "Titolo asse ~X..."; + Text[ da ] = "X-aksetitel..."; + Text[ sv ] = "~X-axelrubrik..."; + Text[ pl ] = "TytuÅ‚ osi X..."; + Text[ pt-BR ] = "TÃtulo do eixo ~X..."; + Text[ th ] = "ชื่ภ(à¹à¸à¸™~X )..."; + Text[ ja ] = "X軸タイトル...(~X)"; + Text[ ko ] = "X축 ì œëª©(~X)..."; + Text[ zh-CN ] = "~X è½´æ ‡é¢˜..."; + Text[ zh-TW ] = "標題(~X 軸)..."; + Text[ tr ] = "BaÅŸlık (~X Ekseni)..."; + Text[ hi-IN ] = "~X अकà¥à¤· का शीरà¥à¤·à¤•...."; + Text[ ar ] = "عنوان المØور س..."; + Text[ he ] = "~X-Achsentitel..."; + }; + MenuItem + { + Identifier = SID_DIAGRAM_TITLE_Y ; + HelpID = SID_DIAGRAM_TITLE_Y ; + Text [ de ] = "~Y-Achsentitel..." ; + Text [ en-US ] = "Title (~Y Axis)..." ; + Text [ x-comment ] = " "; + Text[ pt ] = "TÃtulo do eixo ~Y..."; + Text[ ru ] = "Заголовок оÑи Y..."; + Text[ el ] = "Τίτλος άξονα ~Y..."; + Text[ nl ] = "Titel ~ Y -as..."; + Text[ fr ] = "Titre de l'axe ~Y..."; + Text[ es ] = "TÃtulo del eje ~Y..."; + Text[ fi ] = "Otsikko (~Y-akseli)"; + Text[ ca ] = "TÃtol de l'eix ~Y..."; + Text[ it ] = "Titolo asse ~Y..."; + Text[ da ] = "Y-aksetitel..."; + Text[ sv ] = "~Y-axelrubrik..."; + Text[ pl ] = "TytuÅ‚ osi Y..."; + Text[ pt-BR ] = "TÃtulo do eixo ~Y..."; + Text[ th ] = "ชื่ภ(à¹à¸à¸™~Y )..."; + Text[ ja ] = "Y軸タイトル...(~Y)"; + Text[ ko ] = "Y축 ì œëª©(~Y)..."; + Text[ zh-CN ] = "~Y è½´æ ‡é¢˜..."; + Text[ zh-TW ] = "標題(~Y 軸)..."; + Text[ tr ] = "BaÅŸlık (~Y Eksen)..."; + Text[ hi-IN ] = "~Y अकà¥à¤· का शीरà¥à¤·à¤•..."; + Text[ ar ] = "عنوان المØور ص..."; + Text[ he ] = "~Y-Achsentitel..."; + }; + MenuItem + { + Identifier = SID_DIAGRAM_TITLE_Z ; + HelpID = SID_DIAGRAM_TITLE_Z ; + Text [ de ] = "~Z-Achsentitel..." ; + Text [ en-US ] = "Title (~Z Axis)..." ; + Text [ x-comment ] = " "; + Text[ pt ] = "TÃtulo do eixo ~Z..."; + Text[ ru ] = "Заголовок оÑи Z..."; + Text[ el ] = "Τίτλος άξονα ~Z..."; + Text[ nl ] = "Titel ~Z-as..."; + Text[ fr ] = "Titre de l'axe ~Z..."; + Text[ es ] = "TÃtulo del eje ~Z..."; + Text[ fi ] = "Otsikko (~Z-akseli)"; + Text[ ca ] = "TÃtol de l'eix ~Z..."; + Text[ it ] = "Titolo asse ~Z..."; + Text[ da ] = "Z-aksetitel..."; + Text[ sv ] = "~Z-axelrubrik..."; + Text[ pl ] = "TytuÅ‚ osi Z..."; + Text[ pt-BR ] = "TÃtulo do eixo ~Z..."; + Text[ th ] = "ชื่ภ(à¹à¸à¸™~Z )..."; + Text[ ja ] = "Z軸タイトル...(~Z)"; + Text[ ko ] = "Z축 ì œëª©(~Z)..."; + Text[ zh-CN ] = "~Z è½´æ ‡é¢˜..."; + Text[ zh-TW ] = "標題(~Z 軸)..."; + Text[ tr ] = "BaÅŸlık (~Z Ekseni)..."; + Text[ hi-IN ] = "~Z अकà¥à¤· का शीरà¥à¤·à¤•..."; + Text[ ar ] = "عنوان المØور ع..."; + Text[ he ] = "~Z-Achsentitel..."; + }; + MenuItem + { + Identifier = SID_DIAGRAM_TITLE_ALL ; + HelpID = SID_DIAGRAM_TITLE_ALL ; + Text [ de ] = "~Alle Titel..." ; + Text [ en-US ] = "~All Titles..." ; + Text [ x-comment ] = " "; + Text[ pt ] = "~Todos os tÃtulos..."; + Text[ ru ] = "Ð’Ñе заголовки..."; + Text[ el ] = "Όλ~οι οι τίτλοι..."; + Text[ nl ] = "~Alle titels..."; + Text[ fr ] = "T~ous les titres..."; + Text[ es ] = "~Todos los tÃtulos..."; + Text[ fi ] = "Kaikki otsikot..."; + Text[ ca ] = "~Tots els tÃtols..."; + Text[ it ] = "~Tutti i titoli..."; + Text[ da ] = "Alle titler..."; + Text[ sv ] = "~Alla rubriker..."; + Text[ pl ] = "Wszystkie tytuÅ‚y..."; + Text[ pt-BR ] = "~Todos os tÃtulos..."; + Text[ th ] = "ชื่à¸à¸—ั้งหมด..."; + Text[ ja ] = "ã™ã¹ã¦ã®ã‚¿ã‚¤ãƒˆãƒ«(~A)..."; + Text[ ko ] = "ëª¨ë“ ì œëª©(~A)..."; + Text[ zh-CN ] = "å…¨éƒ¨çš„æ ‡é¢˜(~A)..."; + Text[ zh-TW ] = "全部的標題(~A)..."; + Text[ tr ] = "Bütün BaÅŸlıklar..."; + Text[ hi-IN ] = "सब शीरà¥à¤·à¤•à¥..."; + Text[ ar ] = "كل العناوين..."; + Text[ he ] = "~Alle Titel..."; + }; + }; + }; + Text [ x-comment ] = " "; + Text[ pt ] = "~TÃtulo"; + Text[ ru ] = "Заголовок"; + Text[ el ] = "~Τίτλος"; + Text[ nl ] = "Tite~l"; + Text[ fr ] = "~Titre"; + Text[ es ] = "~TÃtulo"; + Text[ fi ] = "~Otsikko"; + Text[ ca ] = "~TÃtol"; + Text[ it ] = "~Titolo"; + Text[ da ] = "Titel"; + Text[ sv ] = "~Rubrik"; + Text[ pl ] = "TytuÅ‚"; + Text[ pt-BR ] = "~T?tulo"; + Text[ th ] = "~ชื่à¸"; + Text[ ja ] = "タイトル(~T)"; + Text[ ko ] = "ì œëª©(~T)"; + Text[ zh-CN ] = "æ ‡é¢˜(~T)"; + Text[ zh-TW ] = "標題(~T)"; + Text[ tr ] = "~BaÅŸlık"; + Text[ hi-IN ] = "~उपाधि"; + Text[ ar ] = "العنوان"; + Text[ he ] = "‮כותרת‬"; + }; + MenuItem + { + Identifier = SID_LEGEND ; + HelpID = SID_LEGEND ; + Text [ de ] = "~Legende..." ; + Text [ en-US ] = "~Legend..." ; + Text [ x-comment ] = " "; + Text[ pt ] = "~Legenda..."; + Text[ ru ] = "Легенда..."; + Text[ el ] = "Υπόμνημα..."; + Text[ nl ] = "~Legenda..."; + Text[ fr ] = "~Légende..."; + Text[ es ] = "~Leyenda..."; + Text[ fi ] = "~Selite..."; + Text[ ca ] = "~Llegenda..."; + Text[ it ] = "~Legenda..."; + Text[ da ] = "Forklaring..."; + Text[ sv ] = "Förk~laring..."; + Text[ pl ] = "Legenda..."; + Text[ pt-BR ] = "~Legenda..."; + Text[ th ] = "~คำà¸à¸˜à¸´à¸šà¸²à¸¢..."; + Text[ ja ] = "凡例(~L)..."; + Text[ ko ] = "범례(~L)..."; + Text[ zh-CN ] = "图例(~L)..."; + Text[ zh-TW ] = "圖例(~L)..."; + Text[ tr ] = "~Gösterge"; + Text[ hi-IN ] = "~लेज़नà¥à¤¡à¤¼..."; + Text[ ar ] = "Ù…ÙØªØ§Ø Ø§Ù„Ø±Ø³Ù… البياني..."; + Text[ he ] = "~Legende..."; + }; + MenuItem + { + Identifier = SID_DIAGRAM_AXIS ; + HelpID = SID_DIAGRAM_AXIS ; + Text [ de ] = "~Achse" ; + Text [ en-US ] = "A~xis" ; + SubMenu = Menu + { + ItemList = + { + MenuItem + { + Identifier = SID_DIAGRAM_AXIS_X ; + HelpID = SID_DIAGRAM_AXIS_X ; + Text [ de ] = "~X-Achse..." ; + Text [ en-US ] = "~X Axis..." ; + Text [ x-comment ] = " "; + Text[ pt ] = "Eixo ~X..."; + Text[ ru ] = "ОÑÑŒ X..."; + Text[ el ] = "Άξονας ~Χ..."; + Text[ nl ] = "~X-as..."; + Text[ fr ] = "Axe ~X..."; + Text[ es ] = "Eje ~X..."; + Text[ fi ] = "~X-akseli"; + Text[ ca ] = "Eix ~X..."; + Text[ it ] = "Asse ~X..."; + Text[ da ] = "X-akse..."; + Text[ sv ] = "~X-axel..."; + Text[ pl ] = "OÅ› X..."; + Text[ pt-BR ] = "Eixo ~X..."; + Text[ th ] = "à¹à¸à¸™~X ..."; + Text[ ja ] = "X軸...(~X)"; + Text[ ko ] = "X축(~X)..."; + Text[ zh-CN ] = "~X è½´..."; + Text[ zh-TW ] = "~X 軸..."; + Text[ tr ] = "~X Ekseni..."; + Text[ hi-IN ] = "~X अकà¥à¤·"; + Text[ ar ] = "المØور س..."; + Text[ he ] = "~X-Achse..."; + }; + MenuItem + { + Identifier = SID_DIAGRAM_AXIS_Y ; + HelpID = SID_DIAGRAM_AXIS_Y ; + Text [ de ] = "~Y-Achse..." ; + Text [ en-US ] = "~Y Axis..." ; + Text [ x-comment ] = " "; + Text[ pt ] = "Eixo ~Y..."; + Text[ ru ] = "ОÑÑŒ Y..."; + Text[ el ] = "Άξονας ~Y..."; + Text[ nl ] = "~Y-as..."; + Text[ fr ] = "Axe ~Y..."; + Text[ es ] = "Eje ~Y..."; + Text[ fi ] = "~Y-akseli..."; + Text[ ca ] = "Eix ~Y..."; + Text[ it ] = "Asse ~Y..."; + Text[ da ] = "Y-akse..."; + Text[ sv ] = "~Y-axel..."; + Text[ pl ] = "OÅ› Y..."; + Text[ pt-BR ] = "Eixo ~Y..."; + Text[ th ] = "à¹à¸à¸™~Y ..."; + Text[ ja ] = "Y軸...(~Y)"; + Text[ ko ] = "Y축(~Y)..."; + Text[ zh-CN ] = "~Y è½´..."; + Text[ zh-TW ] = "~Y 軸..."; + Text[ tr ] = "~Y Ekseni..."; + Text[ hi-IN ] = "~Y अकà¥à¤·"; + Text[ ar ] = "المØور ص..."; + Text[ he ] = "~Y-Achse..."; + }; + MenuItem + { + Identifier = SID_DIAGRAM_AXIS_Z ; + HelpID = SID_DIAGRAM_AXIS_Z ; + Text [ de ] = "~Z-Achse..." ; + Text [ en-US ] = "~Z Axis..." ; + Text [ x-comment ] = " "; + Text[ pt ] = "Eixo ~Z..."; + Text[ ru ] = "ОÑÑŒ Z..."; + Text[ el ] = "Άξονας ~Z..."; + Text[ nl ] = "~Z-as..."; + Text[ fr ] = "Axe ~Z..."; + Text[ es ] = "Eje ~Z..."; + Text[ fi ] = "~Z-akseli..."; + Text[ ca ] = "Eix ~Z..."; + Text[ it ] = "Asse ~Z..."; + Text[ da ] = "Z-akse..."; + Text[ sv ] = "~Z-axel..."; + Text[ pl ] = "OÅ› Z..."; + Text[ pt-BR ] = "Eixo ~Z..."; + Text[ th ] = "à¹à¸à¸™~Z ..."; + Text[ ja ] = "Z軸...(~Z)"; + Text[ ko ] = "Z축(~Z)..."; + Text[ zh-CN ] = "~Z è½´..."; + Text[ zh-TW ] = "~Z 軸..."; + Text[ tr ] = "~Z Ekseni..."; + Text[ hi-IN ] = "~Z अकà¥à¤·"; + Text[ ar ] = "المØور ع..."; + Text[ he ] = "~Z-Achse..."; + }; + MenuItem + { + Identifier = SID_DIAGRAM_AXIS_A ; + HelpID = SID_DIAGRAM_AXIS_A ; + Text [ de ] = "~Sekundäre X-Achse..." ; + Text [ en-US ] = "~Secondary X Axis..."; + Text [ x-comment ] = " "; + Text[ pt ] = "Eixo X ~secundário..."; + Text[ ru ] = "Ð”Ð¾Ð¿Ð¾Ð»Ð½Ð¸Ñ‚ÐµÐ»ÑŒÐ½Ð°Ñ Ð¾ÑÑŒ X..."; + Text[ el ] = "~ΔευτεÏεÏων άξονας Χ..."; + Text[ nl ] = "~Secundaire X as..."; + Text[ fr ] = "Axe X ~secondaire..."; + Text[ es ] = "Eje ~secundario X..."; + Text[ fi ] = "Toissijainen X-akseli..."; + Text[ ca ] = "Eix X secundari..."; + Text[ it ] = "Asse ~X secondario..."; + Text[ da ] = "Sekundær X-akse..."; + Text[ sv ] = "Sekundär X-axel..."; + Text[ pl ] = "Pomocnicze osie X..."; + Text[ pt-BR ] = "2nd X Axis..."; + Text[ th ] = "à¹à¸à¸™ X ทุติยภูมิ..."; + Text[ ja ] = "第2X軸(~S)..."; + Text[ ko ] = "2ì°¨ X축..."; + Text[ zh-CN ] = "第二个 Y è½´(~S)..."; + Text[ zh-TW ] = "第二個 X 軸(~S)..."; + Text[ tr ] = "~Ä°kinci X Ekseni..."; + Text[ hi-IN ] = "दूसरे X अकà¥à¤·..."; + Text[ ar ] = "المØور س الÙرعي..."; + Text[ he ] = "~Sekundäre X-Achse..."; + }; + MenuItem + { + Identifier = SID_DIAGRAM_AXIS_B ; + HelpID = SID_DIAGRAM_AXIS_B ; + Text [ de ] = "~Sekundäre Y-Achse..." ; + Text [ en-US ] = "S~econdary Y Axis..."; + Text [ x-comment ] = " "; + Text[ pt ] = "Eixo Y ~secundário..."; + Text[ ru ] = "Ð”Ð¾Ð¿Ð¾Ð»Ð½Ð¸Ñ‚ÐµÐ»ÑŒÐ½Ð°Ñ Ð¾ÑÑŒ Y..."; + Text[ el ] = "~ΔευτεÏεÏων άξονας Y..."; + Text[ nl ] = "~Secundaire Y-as..."; + Text[ fr ] = "Axe Y s~econdaire..."; + Text[ es ] = "~Eje secundario Y..."; + Text[ fi ] = "Toissijainen Y-akseli..."; + Text[ ca ] = "Eix Y secundari..."; + Text[ it ] = "Asse ~Y secondario..."; + Text[ da ] = "Sekundær Y-akse..."; + Text[ sv ] = "~Sekundär Y-axel..."; + Text[ pl ] = "Pomocnicza oÅ› Y..."; + Text[ pt-BR ] = "~Secondary Y-Axis..."; + Text[ th ] = "à¹à¸à¸™ Y ทุติยภูมิ..."; + Text[ ja ] = "第2Y軸(~E)..."; + Text[ ko ] = "2ì°¨ Y축..."; + Text[ zh-CN ] = "第二个 Y è½´(~E)..."; + Text[ zh-TW ] = "第二個 Y 軸(~e)..."; + Text[ tr ] = "~Ä°kinci Y Ekseni..."; + Text[ hi-IN ] = "~2nd Y Axis..."; + Text[ ar ] = "المØور ص Ùرعي..."; + Text[ he ] = "~Sekundäre Y-Achse..."; + }; + MenuItem + { + Identifier = SID_DIAGRAM_AXIS_ALL ; + HelpID = SID_DIAGRAM_AXIS_ALL ; + Text [ de ] = "~Alle Achsen..." ; + Text [ en-US ] = "~All Axes..." ; + Text [ x-comment ] = " "; + Text[ pt ] = "~Todos os eixos..."; + Text[ ru ] = "Ð’Ñе оÑи..."; + Text[ el ] = "ÎŒ~λοι οι άξονες..."; + Text[ nl ] = "~Alle assen..."; + Text[ fr ] = "~Tous les axes..."; + Text[ es ] = "~Todos los ejes..."; + Text[ fi ] = "Kaikki akselit..."; + Text[ ca ] = "Tots els eixos..."; + Text[ it ] = "~Tutti gli assi..."; + Text[ da ] = "Alle akser..."; + Text[ sv ] = "~Alla axlar..."; + Text[ pl ] = "Wszystkie osie..."; + Text[ pt-BR ] = "~Todos os eixos..."; + Text[ th ] = "à¹à¸à¸™à¸—ั้งหมด..."; + Text[ ja ] = "ã™ã¹ã¦ã®è»¸(~A)..."; + Text[ ko ] = "ëª¨ë“ ì¶•..."; + Text[ zh-CN ] = "所有的轴(~A)..."; + Text[ zh-TW ] = "所有的軸(~A)..."; + Text[ tr ] = "~Tüm Eksenler..."; + Text[ hi-IN ] = "सब अकà¥à¤·..."; + Text[ ar ] = "كل المØاور..."; + Text[ he ] = "~Alle Achsen..."; + }; + }; + }; + Text [ x-comment ] = " "; + Text[ pt ] = "~Eixo"; + Text[ ru ] = "ОÑÑŒ"; + Text[ el ] = "Άξον~ας"; + Text[ nl ] = "~As"; + Text[ fr ] = "A~xe"; + Text[ es ] = "~Eje"; + Text[ fi ] = "A~kselit"; + Text[ ca ] = "Ei~x"; + Text[ it ] = "A~sse"; + Text[ da ] = "Akse"; + Text[ sv ] = "~Axel"; + Text[ pl ] = "OÅ›"; + Text[ pt-BR ] = "~Eixo"; + Text[ th ] = "à¹à¸~น"; + Text[ ja ] = "軸(~X)"; + Text[ ko ] = "축(~X)"; + Text[ zh-CN ] = "è½´(~X)"; + Text[ zh-TW ] = "軸(~X)"; + Text[ tr ] = "~Eksen"; + Text[ hi-IN ] = "अ~कà¥à¤·"; + Text[ ar ] = "Ù…Øور"; + Text[ he ] = "~Achse"; + }; + MenuItem + { + Identifier = SID_DIAGRAM_GRID ; + HelpID = SID_DIAGRAM_GRID ; + // ### ACHTUNG: Neuer Text in Resource? ~Gitter : ~Gitter... + Text [ de ] = "~Gitter" ; + Text [ en-US ] = "~Grid" ; + // ### ACHTUNG: Neuer Text in Resource? Gitter bearbeiten : Gitter bearbeiten... + SubMenu = Menu + { + ItemList = + { + MenuItem + { + Identifier = SID_DIAGRAM_GRID_Y_MAIN ; + HelpID = SID_DIAGRAM_GRID_Y_MAIN ; + Text [ de ] = "~X-Achsenhauptgitter..." ; + Text [ en-US ] = "~X Axis Main Grid..." ; + Text [ x-comment ] = " "; + Text[ pt ] = "Grelha ~principal do eixo X..."; + Text[ ru ] = "ОÑÐ½Ð¾Ð²Ð½Ð°Ñ Ñетка оÑи X..."; + Text[ el ] = "ΚÏÏιο πλÎγμα άξονα ~Χ..."; + Text[ nl ] = "Hoofdraster ~X-as..."; + Text[ fr ] = "Grille principale de l'axe ~X..."; + Text[ es ] = "CuadrÃcula principal del eje ~X...."; + Text[ fi ] = "~X-akselin pääruudukko"; + Text[ ca ] = "Graella principal de l'eix ~X..."; + Text[ it ] = "Griglia principale asse ~X..."; + Text[ da ] = "X-akse overordnet gitter..."; + Text[ sv ] = "~X-axelhuvudgitter..."; + Text[ pl ] = "Główna siatka osi X..."; + Text[ pt-BR ] = "~Y-Achsenhauptgitter..."; + Text[ th ] = "เส้นตารางหลัà¸à¹à¸à¸™~ X ..."; + Text[ ja ] = "X軸主目盛線...(~X)"; + Text[ ko ] = "X축 주 ëˆˆê¸ˆì„ (~X)..."; + Text[ zh-CN ] = "~X è½´ä¸»ç½‘æ ¼çº¿..."; + Text[ zh-TW ] = "~X è»¸ä¸»ç¶²æ ¼ç·š..."; + Text[ tr ] = "X ~Koordinatı Ana Izgarası..."; + Text[ hi-IN ] = "~X अकà¥à¤· का पà¥à¤°à¤§à¤¾à¤¨ जाल..."; + Text[ ar ] = "الشبكة الرئيسية للمØور س..."; + Text[ he ] = "~X-Achsenhauptgitter..."; + }; + MenuItem + { + Identifier = SID_DIAGRAM_GRID_X_MAIN ; + HelpID = SID_DIAGRAM_GRID_X_MAIN ; + Text [ de ] = "~Y-Achsenhauptgitter..." ; + Text [ en-US ] = "~Y Axis Main Grid..." ; + Text [ x-comment ] = " "; + Text[ pt ] = "Grelha principal do eixo ~Y..."; + Text[ ru ] = "ОÑÐ½Ð¾Ð²Ð½Ð°Ñ Ñетка оÑи Y..."; + Text[ el ] = "ΚÏÏιο πλÎγμα άξονα ~Y..."; + Text[ nl ] = "Hoofdraster ~Y-as..."; + Text[ fr ] = "Grille principale de l'axe ~Y..."; + Text[ es ] = "CuadrÃcula principal del eje ~Y..."; + Text[ fi ] = "~Y-akselin pääruudukko..."; + Text[ ca ] = "Graella principal de l'eix ~Y..."; + Text[ it ] = "Griglia principale asse ~Y..."; + Text[ da ] = "Y-akse overordnet gitter..."; + Text[ sv ] = "~Y-axelhuvudgitter..."; + Text[ pl ] = "Główna siatka osi Y..."; + Text[ pt-BR ] = "~X-Achsenhauptgitter..."; + Text[ th ] = "เส้นตารางหลัà¸à¹à¸à¸™~Y ..."; + Text[ ja ] = "Y軸主目盛線...(~Y)"; + Text[ ko ] = "Y축 주 ëˆˆê¸ˆì„ (~Y)..."; + Text[ zh-CN ] = "~Y è½´ä¸»ç½‘æ ¼çº¿..."; + Text[ zh-TW ] = "~Y è»¸ç¶²æ ¼ç·š..."; + Text[ tr ] = "~Y Ekseni Ana Izgarası..."; + Text[ hi-IN ] = "~Y अकà¥à¤· का पà¥à¤°à¤§à¤¾à¤¨ जाल..."; + Text[ ar ] = "الشبكة الرئيسية للمØور ص..."; + Text[ he ] = "~Y-Achsenhauptgitter..."; + }; + MenuItem + { + Identifier = SID_DIAGRAM_GRID_Z_MAIN ; + HelpID = SID_DIAGRAM_GRID_Z_MAIN ; + Text [ de ] = "~Z-Achsenhauptgitter..." ; + Text [ en-US ] = "~Z Axis Main Grid..." ; + Text [ x-comment ] = " "; + Text[ pt ] = "Grelha p~rincipal do eixo Z..."; + Text[ ru ] = "ОÑÐ½Ð¾Ð²Ð½Ð°Ñ Ñетка оÑи Z..."; + Text[ el ] = "ΚÏÏιο πλÎγμα άξονα ~Z..."; + Text[ nl ] = "Hoofdraster ~Z-as..."; + Text[ fr ] = "Grille principale de l'axe ~Z..."; + Text[ es ] = "CuadrÃcula principal del eje ~Z..."; + Text[ fi ] = "~Z-akselin pääruudukko..."; + Text[ ca ] = "Graella principal de l'eix ~Z..."; + Text[ it ] = "Griglia principale asse ~Z..."; + Text[ da ] = "Z-akse overordnet gitter..."; + Text[ sv ] = "~Z-axelhuvudgitter..."; + Text[ pl ] = "Główna siatka osi Z..."; + Text[ pt-BR ] = "Grade principal do eixo ~Z..."; + Text[ th ] = "เส้นตารางหลัà¸à¹à¸à¸™~Z ..."; + Text[ ja ] = "Z軸主目盛線...(~Z)"; + Text[ ko ] = "Z축 주 ëˆˆê¸ˆì„ (~Z)..."; + Text[ zh-CN ] = "~Z è½´ä¸»ç½‘æ ¼çº¿..."; + Text[ zh-TW ] = "~Z è»¸ä¸»ç¶²æ ¼ç·š..."; + Text[ tr ] = "~Z Ekseni Ana Izgarası..."; + Text[ hi-IN ] = "~Z अकà¥à¤· का पà¥à¤°à¤§à¤¾à¤¨ जाल..."; + Text[ ar ] = "شبكة رئيسية للمØور ع..."; + Text[ he ] = "~Z-Achsenhauptgitter..."; + }; + MenuItem + { + Identifier = SID_DIAGRAM_GRID_Y_HELP ; + HelpID = SID_DIAGRAM_GRID_Y_HELP ; + Text [ de ] = "X-A~chsenhilfsgitter..." ; + Text [ en-US ] = "X Axis ~Minor Grid..." ; + Text [ x-comment ] = " "; + Text[ pt ] = "Grelha auxiliar do eixo ~X..."; + Text[ ru ] = "ÐŸÑ€Ð¾Ð¼ÐµÐ¶ÑƒÑ‚Ð¾Ñ‡Ð½Ð°Ñ Ñетка оÑи X..."; + Text[ el ] = "Βοη~θητικό πλÎγμα του άξονα Χ..."; + Text[ nl ] = "Hulpraster ~X-as..."; + Text[ fr ] = "Grille auxiliaire de l'axe ~X..."; + Text[ es ] = "CuadrÃcula auxiliar del eje ~X..."; + Text[ fi ] = "X-akselin toissijainen ruudukko..."; + Text[ ca ] = "CuadrÃcula auxiliar de l'eix ~X..."; + Text[ it ] = "Griglia ausiliaria a~sse X..."; + Text[ da ] = "X-akse underordnet gitter..."; + Text[ sv ] = "X-axels~tödgitter..."; + Text[ pl ] = "Pomocnicza siatka osi X..."; + Text[ pt-BR ] = "~Y-Achsenhilfsgitter..."; + Text[ th ] = "เส้นตาราง~รà¸à¸‡à¹à¸à¸™ X ..."; + Text[ ja ] = "X軸補助目盛線(~M)..."; + Text[ ko ] = "X축 ë³´ì¡° ëˆˆê¸ˆì„ (~M)..."; + Text[ zh-CN ] = "X è½´æ¬¡ç½‘æ ¼çº¿(~M)..."; + Text[ zh-TW ] = "X è»¸æ¬¡ç¶²æ ¼ç·š(~M)..."; + Text[ tr ] = "X Ekseni ~Küçük Izgarası..."; + Text[ hi-IN ] = "X अकà¥à¤· का ~छोटा जाल..."; + Text[ ar ] = "شبكة مساعدة للمØور س..."; + Text[ he ] = "X-A~chsenhilfsgitter..."; + }; + MenuItem + { + Identifier = SID_DIAGRAM_GRID_X_HELP ; + HelpID = SID_DIAGRAM_GRID_X_HELP ; + Text [ de ] = "Y-Ac~hsenhilfsgitter..." ; + Text [ en-US ] = "Y Axis Minor ~Grid..." ; + Text [ x-comment ] = " "; + Text[ pt ] = "Grelha auxiliar do eixo ~Y..."; + Text[ ru ] = "ÐŸÑ€Ð¾Ð¼ÐµÐ¶ÑƒÑ‚Ð¾Ñ‡Ð½Ð°Ñ Ñетка оÑи Y..."; + Text[ el ] = "Βοη~θητικό πλÎγμα του άξονα Y..."; + Text[ nl ] = "Hulpraster ~Y-as..."; + Text[ fr ] = "Grille auxiliaire de l'axe ~Y..."; + Text[ es ] = "CuadrÃcula auxiliar del eje ~Y..."; + Text[ fi ] = "Y-akselin toissijainen ruudukko..."; + Text[ ca ] = "CuadrÃcula auxiliar de l'eix ~Y..."; + Text[ it ] = "Griglia ausiliaria ~asse Y..."; + Text[ da ] = "Y-akse underordnet gitter..."; + Text[ sv ] = "Y-axel~stödgitter..."; + Text[ pl ] = "Pomocnicza siatka osi Y..."; + Text[ pt-BR ] = "~X-Achsenhilfsgitter..."; + Text[ th ] = "เ~ส้นตารางรà¸à¸‡à¹à¸à¸™ Y..."; + Text[ ja ] = "Y軸補助目盛線(~G)..."; + Text[ ko ] = "Y축 ë³´ì¡° ëˆˆê¸ˆì„ (~G)..."; + Text[ zh-CN ] = "Y è½´æ¬¡ç½‘æ ¼çº¿(~G)..."; + Text[ zh-TW ] = "Y è»¸æ¬¡ç¶²æ ¼ç·š(~G)..."; + Text[ tr ] = "Y Ekseni Küçük ~Izgarası..."; + Text[ hi-IN ] = "Y अकà¥à¤· का ~छोटा जाल..."; + Text[ ar ] = "شبكة مساعدة للمØور ص..."; + Text[ he ] = "Y-Ac~hsenhilfsgitter..."; + }; + MenuItem + { + Identifier = SID_DIAGRAM_GRID_Z_HELP ; + HelpID = SID_DIAGRAM_GRID_Z_HELP ; + Text [ de ] = "Z-Ach~senhilfsgitter..." ; + Text [ en-US ] = "Z Ax~is Minor Grid..." ; + Text [ x-comment ] = " "; + Text[ pt ] = "Grelha a~uxiliar do eixo Z..."; + Text[ ru ] = "ÐŸÑ€Ð¾Ð¼ÐµÐ¶ÑƒÑ‚Ð¾Ñ‡Ð½Ð°Ñ Ñетка оÑи Z..."; + Text[ el ] = "Βοηθητικό πλÎγμα του άξονα Z..."; + Text[ nl ] = "Hulpraster ~Z-as..."; + Text[ fr ] = "Grille auxiliaire de l'axe ~Z..."; + Text[ es ] = "CuadrÃcula auxiliar del eje ~Z..."; + Text[ fi ] = "Z Ak~selin toissijainen ruudukko..."; + Text[ ca ] = "CuadrÃcula auxiliar de l'eix ~Z..."; + Text[ it ] = "Griglia ausiliaria ass~e Z..."; + Text[ da ] = "Z-akse underordnet gitter..."; + Text[ sv ] = "Z-axelstö~dgitter..."; + Text[ pl ] = "Pomocnicza siatka osi Z..."; + Text[ pt-BR ] = "~Z-Achsenhilfsgitter..."; + Text[ th ] = "เส้นตารางรà¸à¸‡à¹à¸~น Z ..."; + Text[ ja ] = "Z軸補助目盛線(~I)..."; + Text[ ko ] = "Z축 ë³´ì¡° ëˆˆê¸ˆì„ (~I)..."; + Text[ zh-CN ] = "Z è½´æ¬¡ç½‘æ ¼çº¿(~I)..."; + Text[ zh-TW ] = "Z è»¸æ¬¡ç¶²æ ¼ç·š(~I)..."; + Text[ tr ] = "Z Ek~seni Küçük Izgarası..."; + Text[ hi-IN ] = "Z अकà¥à¤· का ~छोटा जाल..."; + Text[ ar ] = "شبكة مساعدة للمØور ع..."; + Text[ he ] = "Z-Ach~senhilfsgitter..."; + }; + MenuItem + { + Identifier = SID_DIAGRAM_GRID_ALL ; + HelpID = SID_DIAGRAM_GRID_ALL ; + Text [ de ] = "~Alle Achsengitter..." ; + Text [ en-US ] = "~All Axis Grids..." ; + Text [ x-comment ] = " "; + Text[ pt ] = "~Todas as grelhas dos eixos..."; + Text[ ru ] = "Ð’Ñе Ñетки оÑи..."; + Text[ el ] = "Όλ~α τα πλÎγματα αξόνων..."; + Text[ nl ] = "~Alle asrasters..."; + Text[ fr ] = "~Toutes les grilles d'axes..."; + Text[ es ] = "~Todas las cuadrÃculas de ejes..."; + Text[ fi ] = "~Kaikki akseliruudukot..."; + Text[ ca ] = "~Totes les graelles de l'eix..."; + Text[ it ] = "Tutte le griglie degli assi..."; + Text[ da ] = "Alle aksegitre..."; + Text[ sv ] = "~Alla axelgitter..."; + Text[ pl ] = "Wszystkie siatki osi..."; + Text[ pt-BR ] = "~Todas as grades dos eixos..."; + Text[ th ] = "เส้นตารางà¹à¸à¸™~ทั้งหมด..."; + Text[ ja ] = "ã™ã¹ã¦ã®è»¸ç›®ç››ç·š(~A)..."; + Text[ ko ] = "ëª¨ë“ ì¶• ëˆˆê¸ˆì„ (~A)..."; + Text[ zh-CN ] = "å…¨éƒ¨çš„è½´ç½‘æ ¼çº¿(~A)..."; + Text[ zh-TW ] = "æ‰€æœ‰çš„è»¸ç¶²æ ¼ç·š(~A)..."; + Text[ tr ] = "~Tüm Eksen Izgaraları..."; + Text[ hi-IN ] = "~सब अकà¥à¤· का जाल.."; + Text[ ar ] = "كل شبكات المØاور..."; + Text[ he ] = "~Alle Achsengitter..."; + }; + }; + }; + Text [ x-comment ] = " "; + Text[ pt ] = "~Grelha"; + Text[ ru ] = "Сетка"; + Text[ el ] = "ΠλÎ~γμα"; + Text[ nl ] = "~Raster"; + Text[ fr ] = "~Grille"; + Text[ es ] = "~CuadrÃcula"; + Text[ fi ] = "~Ruudukko"; + Text[ ca ] = "~Graella"; + Text[ it ] = "~Griglia"; + Text[ da ] = "Gitter"; + Text[ sv ] = "~Gitter"; + Text[ pl ] = "Siatka"; + Text[ pt-BR ] = "~Grade..."; + Text[ th ] = "เ~ส้นตาราง"; + Text[ ja ] = "目盛線(~G)"; + Text[ ko ] = "ëˆˆê¸ˆì„ (~G)"; + Text[ zh-CN ] = "ç½‘æ ¼çº¿(~G)"; + Text[ zh-TW ] = "ç¶²æ ¼ç·š(~G)"; + Text[ tr ] = "~Izgara"; + Text[ hi-IN ] = "~जाल"; + Text[ ar ] = "شبكة"; + Text[ he ] = "~Gitter"; + }; + MenuItem + { + Separator = TRUE ; + }; + MenuItem + { + Identifier = SID_DIAGRAM_WALL ; + HelpID = SID_DIAGRAM_WALL ; + Text [ de ] = "Diagramm~wand..." ; + Text [ en-US ] = "Chart ~Wall..." ; + Text [ x-comment ] = " "; + Text[ pt ] = "~Parede do gráfico..."; + Text[ ru ] = "Стена диаграммы..."; + Text[ el ] = "Τοίχο~Ï‚ διαγÏάμματος..."; + Text[ nl ] = "Diagram~wand..."; + Text[ fr ] = "P~aroi du diagramme..."; + Text[ es ] = "~Pared del diagrama..."; + Text[ fi ] = "Kaavio~seinä..."; + Text[ ca ] = "~Pla lateral del diagrama..."; + Text[ it ] = "~Pareti del diagramma..."; + Text[ da ] = "Diagramvæg..."; + Text[ sv ] = "Diagram~vägg..."; + Text[ pl ] = "Åšciana wykresu..."; + Text[ pt-BR ] = "Diagram ~wall..."; + Text[ th ] = "~ผนังà¹à¸œà¸™à¸ ูมิ..."; + Text[ ja ] = "グラフã®å£é¢(~W)..."; + Text[ ko ] = "차트 옆면(~W)..."; + Text[ zh-CN ] = "图表背景墙(~W)..."; + Text[ zh-TW ] = "圖表背景牆(~W)..."; + Text[ tr ] = "Harita ~Alanı..."; + Text[ hi-IN ] = "चारà¥à¤Ÿ ~वॉल..."; + Text[ ar ] = "Øائط الرسم البياني..."; + Text[ he ] = "Diagramm~wand..."; + }; + MenuItem + { + Identifier = SID_DIAGRAM_FLOOR ; + HelpID = SID_DIAGRAM_FLOOR ; + Text [ de ] = "Diagramm~boden..." ; + Text [ en-US ] = "~Chart Floor..." ; + Text [ x-comment ] = " "; + Text[ pt ] = "~Base do gráfico..."; + Text[ ru ] = "ОÑнование диаграммы..."; + Text[ el ] = "Δά~πεδο διαγÏάμματος..."; + Text[ nl ] = "Diagram~bodem..."; + Text[ fr ] = "P~lancher du diagramme..."; + Text[ es ] = "~Base del diagrama..."; + Text[ fi ] = "~Kaavion perusta"; + Text[ ca ] = "Base del ~diagrama..."; + Text[ it ] = "~Pavimento del diagramma..."; + Text[ da ] = "Diagramgulv..."; + Text[ sv ] = "D~iagramgolv..."; + Text[ pl ] = "PodÅ‚oże wykresu..."; + Text[ pt-BR ] = "Diagram ~floor..."; + Text[ th ] = "พื้นà¹à¸œ~นภูมิ..."; + Text[ ja ] = "グラフã®åºŠé¢(~C)..."; + Text[ ko ] = "차트 ë°‘ë©´(~C)..."; + Text[ zh-CN ] = "图表基底(~C)..."; + Text[ zh-TW ] = "座標軸(~C)..."; + Text[ tr ] = "~Karakter Altı..."; + Text[ hi-IN ] = "~चारà¥à¤Ÿà¥ फ़ोरà¥..."; + Text[ ar ] = "أرضية الرسم البياني..."; + Text[ he ] = "Diagramm~boden..."; + }; + MenuItem + { + Identifier = SID_DIAGRAM_AREA ; + HelpID = SID_DIAGRAM_AREA ; + Text [ de ] = "Diagram~mfläche..." ; + Text [ en-US ] = "C~hart Area..." ; + Text [ x-comment ] = " "; + Text[ pt ] = "Ã~rea do gráfico..."; + Text[ ru ] = "ОблаÑÑ‚ÑŒ диаграммы..."; + Text[ el ] = "ΠεÏιοχή διαγÏά~μματος..."; + Text[ nl ] = "Diagram~oppervlak..."; + Text[ fr ] = "~Arrière-plan du diagramme..."; + Text[ es ] = "~Superficie del diagrama..."; + Text[ fi ] = "Kaa~vioalue"; + Text[ ca ] = "~Àrea de diagrama..."; + Text[ it ] = "~Area del diagramma..."; + Text[ da ] = "DiagramomrÃ¥de..."; + Text[ sv ] = "Diagra~momrÃ¥de..."; + Text[ pl ] = "Obszar wykresu..."; + Text[ pt-BR ] = "?~rea do diagrama..."; + Text[ th ] = "พื้นที่à¹à¸œà¸™~ภูมิ..."; + Text[ ja ] = "グラフエリア(~H)..."; + Text[ ko ] = "차트 ì˜ì—(~H)..."; + Text[ zh-CN ] = "图表平é¢(~H)..."; + Text[ zh-TW ] = "圖表平é¢(~H)..."; + Text[ tr ] = "K~arakter Alanı..."; + Text[ hi-IN ] = "चा~रà¥à¤Ÿ विसà¥à¤¤à¥€à¤°à¥à¤£..."; + Text[ ar ] = "مساØØ© الرسم البياني..."; + Text[ he ] = "Diagram~mfläche..."; + }; + MenuItem + { + Separator = TRUE ; + }; + MenuItem + { + Identifier = SID_DIAGRAM_TYPE ; + HelpID = SID_DIAGRAM_TYPE ; + Text [ de ] = "~Diagrammtyp..." ; + Text [ en-US ] = "Cha~rt Type..." ; + Text [ x-comment ] = " "; + Text[ pt ] = "~Tipo de gráfico..."; + Text[ ru ] = "Тип диаграммы..."; + Text[ el ] = "ΤÏπος ~διαγÏάμματος..."; + Text[ nl ] = "Diagram~type..."; + Text[ fr ] = "Type de ~diagramme..."; + Text[ es ] = "~Tipo de diagrama..."; + Text[ fi ] = "Kaa~viotyyppi..."; + Text[ ca ] = "Tipus de diag~rama..."; + Text[ it ] = "Ti~po di diagramma..."; + Text[ da ] = "Diagramtype..."; + Text[ sv ] = "~Diagramtyp..."; + Text[ pl ] = "Typ wykresu..."; + Text[ pt-BR ] = "~Tipo de diagrama..."; + Text[ th ] = "ชนิดà¹à¸œà¸™à¸ ู~มิ..."; + Text[ ja ] = "グラフã®ç¨®é¡ž(~R)..."; + Text[ ko ] = "차트 ìœ í˜•(~R)..."; + Text[ zh-CN ] = "图表类型(~R)..."; + Text[ zh-TW ] = "圖表類型(~R)..."; + Text[ tr ] = "Ka~rakter Türü..."; + Text[ hi-IN ] = "चा~रà¥à¤Ÿ वरà¥à¤—...."; + Text[ ar ] = "نوع الرسم البياني..."; + Text[ he ] = "~Diagrammtyp..."; + }; + MenuItem + { + Identifier = SID_AUTOFORMAT ; + HelpID = HID_SCH_CHART_AUTO_FORMAT ; + /* ### ACHTUNG: Neuer Text in Resource? Auto~Format... : Auto~format... */ + /* ### ACHTUNG: Neuer Text in Resource? Auto~Format... : Auto~format... */ + Text [ de ] = "Auto~Format..." ; + Text [ en-US ] = "Auto~Format..." ; + Text [ x-comment ] = " "; + Text[ pt ] = "Auto~Formato..."; + Text[ ru ] = "Ðвтоформат..."; + Text[ el ] = "ΑυτοΜοÏ~φή..."; + Text[ nl ] = "A~utoOpmaak..."; + Text[ fr ] = "Auto~Format..."; + Text[ es ] = "~Formateado automático..."; + Text[ fi ] = "~Automaattinen muotoilu"; + Text[ ca ] = "A~utoFormat..."; + Text[ it ] = "~Formattazione automatica..."; + Text[ da ] = "AutoFormat..."; + Text[ sv ] = "Auto~Format..."; + Text[ pl ] = "Autoformat..."; + Text[ pt-BR ] = "Auto ~formata??o..."; + Text[ th ] = "~รูปà¹à¸šà¸šà¸à¸±à¸•à¹‚นมัติ..."; + Text[ ja ] = "オートフォーマット(~F)..."; + Text[ ko ] = "ìžë™ ì„œì‹(~F)..."; + Text[ zh-CN ] = "è‡ªåŠ¨æ ¼å¼(~F)..."; + Text[ zh-TW ] = "è‡ªå‹•æ ¼å¼(~F)..."; + Text[ tr ] = "Otomatık ~Biçim..."; + Text[ hi-IN ] = "सà¥à¤µà¤šà¤¾à¤²à¤¿à¤¤ ~ढंग से रचना..."; + Text[ ar ] = "تنسيق تلقائي..."; + Text[ he ] = "‮עיצוב ×וטומטי...‬"; + }; + MenuItem + { + Identifier = SID_3D_WIN ; + HelpID = SID_3D_WIN ; + Text [ de ] = "~3D-Effekte" ; + Text [ en-US ] = "~3D Effects" ; + Text [ x-comment ] = " "; + Text[ pt ] = "~Efeitos-3D"; + Text[ ru ] = "Ðффекты 3-Ðœ"; + Text[ el ] = "ΕφΠ~3Δ"; + Text[ nl ] = "3D-~effecten"; + Text[ fr ] = "~Effets 3D"; + Text[ es ] = "~Efectos 3D"; + Text[ fi ] = "~Kolmiulotteiset tehosteet"; + Text[ ca ] = "Efectes ~3D"; + Text[ it ] = "Effetti ~3D"; + Text[ da ] = "3D-effekter"; + Text[ sv ] = "~3D-effekter"; + Text[ pl ] = "Efekty 3-W"; + Text[ pt-BR ] = "3D-~Effekte"; + Text[ th ] = "ลัà¸à¸©à¸“ะพิเศษ~3มิติ"; + Text[ ja ] = "3D 効果(~3)"; + Text[ ko ] = "3D 효과"; + Text[ zh-CN ] = "~3 维效果"; + Text[ zh-TW ] = "~3D 效果"; + Text[ tr ] = "~3D Efektleri"; + Text[ hi-IN ] = "~3D पà¥à¤°à¤à¤¾à¤µ"; + Text[ ar ] = "تأثيرات ثلاثية الأبعاد"; + Text[ he ] = "~3D-Effekte"; + }; + MenuItem + { + Identifier = SID_3D_VIEW ; + HelpID = SID_3D_VIEW ; + Text [ de ] = "3D-An~sicht..." ; + Text [ en-US ] = "3~D View..." ; + Text [ x-comment ] = " "; + Text[ pt ] = "~Vista 3D..."; + Text[ ru ] = "Вид 3-Ðœ..."; + Text[ el ] = "Î Ïο~βολή 3Δ..."; + Text[ nl ] = "~3D-weergave..."; + Text[ fr ] = "Affichage ~3D..."; + Text[ es ] = "~Ver en 3D..."; + Text[ fi ] = "Kolmi~ulotteinen näkymä..."; + Text[ ca ] = "Vista 3~D..."; + Text[ it ] = "~Vista 3D..."; + Text[ da ] = "3D-visning..."; + Text[ sv ] = "3D-v~y..."; + Text[ pl ] = "Widok 3-W..."; + Text[ pt-BR ] = "~Ver 3D..."; + Text[ th ] = "มุมมà¸à¸‡ 3~มิติ..."; + Text[ ja ] = "3D 表示...(~D)"; + Text[ ko ] = "3D 보기(~D)..."; + Text[ zh-CN ] = "~3 维视图..."; + Text[ zh-TW ] = "~3D 檢視..."; + Text[ tr ] = "3~B Görünüm..."; + Text[ hi-IN ] = "3~D दृशà¥à¤¯"; + Text[ ar ] = "عرض ثلاثي الأبعاد..."; + Text[ he ] = "3D-An~sicht..."; + }; + MenuItem + { + Separator = TRUE ; + }; + MN_ROW_POSITION; + }; +}; + Text[ pt ] = "~Formatar"; + Text[ ru ] = "Фор~мат"; + Text[ el ] = "ΜοÏ~φοποίηση"; + Text[ nl ] = "~Formaat"; + Text[ fr ] = "Forma~t"; + Text[ es ] = "~Formato"; + Text[ fi ] = "~Muotoile"; + Text[ ca ] = "F~ormata"; + Text[ it ] = "F~ormato"; + Text[ da ] = "Forma~ter"; + Text[ sv ] = "F~ormat"; + Text[ pl ] = "Format"; + Text[ pt-BR ] = "Form~at"; + Text[ th ] = "รู~ปà¹à¸šà¸š"; + Text[ ja ] = "書å¼(~O)"; + Text[ ko ] = "ì„œì‹(~O)"; + Text[ zh-CN ] = "æ ¼å¼(~O)"; + Text[ zh-TW ] = "æ ¼å¼(~O)"; + Text[ tr ] = "~Biçim"; + Text[ hi-IN ] = "~रचना"; + Text[ ar ] = "تنس~يق"; + Text[ he ] = "‮עיצוב‬"; + }; + MenuItem + { + Identifier = WORKAROUND_25 ; + HelpID = 25 ; + Text [ de ] = "E~xtras" ; + Text [ en-US ] = "~Tools" ; + SubMenu = Menu + { + ItemList = + { + MenuItem + { + ITEM_TOOLS_CONFIG + }; + ITEM_MN_OPTIONS + /* + MenuItem + { + Identifier = SID_OPTIONS ; + HelpID = SID_OPTIONS ; + Text [ de ] = "Optionen..." ; + Text [ en-US ] = "Options..." ; + }; + */ + }; + }; + Text [ x-comment ] = " "; + Text[ pt ] = "~Ferramentas"; + Text[ ru ] = "~СервиÑ"; + Text[ el ] = "Ε~Ïγαλεία"; + Text[ nl ] = "E~xtra"; + Text[ fr ] = "~Outils"; + Text[ es ] = "~Herramientas"; + Text[ fi ] = "~Työkalut"; + Text[ ca ] = "Ei~nes"; + Text[ it ] = "~Strumenti"; + Text[ da ] = "Fun~ktioner"; + Text[ sv ] = "~Verktyg"; + Text[ pl ] = "~NarzÄ™dzia"; + Text[ pt-BR ] = "F~erramentas"; + Text[ th ] = "เ~ครื่à¸à¸‡à¸¡à¸·à¸"; + Text[ ja ] = "ツール(~T)"; + Text[ ko ] = "ë„구(~T)"; + Text[ zh-CN ] = "工具(~T)"; + Text[ zh-TW ] = "工具(~T)"; + Text[ tr ] = "~Araçlar"; + Text[ hi-IN ] = "~औज़ार"; + Text[ ar ] = "Ø£~دوات"; + Text[ he ] = "‮כלי×‬"; + }; + ITEM_WINDOW_MENU + ITEM_HELP_MENU + }; +}; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/binfilter/bf_sch/source/ui/app/sch_menuids.src b/binfilter/bf_sch/source/ui/app/sch_menuids.src new file mode 100644 index 000000000000..ed5744277f90 --- /dev/null +++ b/binfilter/bf_sch/source/ui/app/sch_menuids.src @@ -0,0 +1,180 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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. + * + ************************************************************************/ +#define NO_LOCALIZE_EXPORT + + +#include "app.hrc" + + +#define MN_ROW_POSITION \ +MenuItem\ +{\ + Identifier = SID_ROW_POSITION ; \ + HelpID = SID_ROW_POSITION;\ + Text [ de ] = "A~nordnung" ; \ + Text [ en-US ] = "A~rrangement" ; \ + Text[ pt ] = "~Disposição";\ + Text[ ru ] = "РаÑположение";\ + Text[ el ] = "Τακτοποίηση";\ + Text[ nl ] = "~Rangschikking";\ + Text[ fr ] = "~Disposition";\ + Text[ es ] = "~Disposición";\ + Text[ fi ] = "J~ärjestys";\ + Text[ ca ] = "~Organitza";\ + Text[ it ] = "~Disponi";\ + Text[ da ] = "Placering";\ + Text[ sv ] = "~Placering";\ + Text[ pl ] = "~Rozmieszczenie";\ + Text[ pt-BR ] = "Dis~posição";\ + Text[ th ] = "จั~ดเรียง";\ + Text[ ja ] = "é…ç½®(~R)";\ + Text[ ko ] = "배치(~R)";\ + Text[ zh-CN ] = "排åº(~R)";\ + Text[ zh-TW ] = "排åº(~R)";\ + Text[ tr ] = "Düzenleme";\ + Text[ hi-IN ] = "A~rrangement";\ + Text[ ar ] = "الترتيب";\ + Text[ he ] = "A~nordnung";\ + SubMenu = Menu\ + {\ + ItemList = \ + {\ + MenuItem\ + {\ + Identifier = SID_ROW_MOREFRONT ; \ + HelpID = SID_ROW_MOREFRONT;\ + Text [ de ] = "W~eiter nach vorn" ; \ + Text [ en-US ] = "Bring ~Forward" ; \ + Text [ x-comment ] = " ";\ + Text[ pt ] = "~Mais para a frente";\ + Text[ ru ] = "ПеремеÑтить ~вперед";\ + Text[ el ] = "Îœ~εταφοÏά Îνα επίπεδο εμπÏός";\ + Text[ nl ] = "Naar v~oren";\ + Text[ fr ] = "V~ers l'avant";\ + Text[ es ] = "Traer ~adelante";\ + Text[ fi ] = "Siirrä ~eteenpäin";\ + Text[ ca ] = "Porta al ~davant";\ + Text[ it ] = "Porta più avanti";\ + Text[ da ] = "Længere ~fremad";\ + Text[ sv ] = "Längre fra~m";\ + Text[ pl ] = "P~rzesuÅ„ do przodu";\ + Text[ pt-BR ] = "A~vançar";\ + Text[ th ] = "นำไป~ข้างหน้า";\ + Text[ ja ] = "å‰æ–¹ã«ç§»å‹•(~F)";\ + Text[ ko ] = "앞으로 ì´ë™(~F)";\ + Text[ zh-CN ] = "上移一层(~F)";\ + Text[ zh-TW ] = "上移一層(~F)";\ + Text[ tr ] = "~Bir öne getir";\ + Text[ hi-IN ] = "~आगे पà¥à¤°à¤¸à¥à¤¤à¥à¤¤ करना";\ + Text[ ar ] = "Ø¥Øضار أماماً";\ + Text[ he ] = "W~eiter nach vorn";\ + };\ + MenuItem\ + {\ + Identifier = SID_ROW_MOREBACK ; \ + HelpID = SID_ROW_MOREBACK;\ + Text [ de ] = "Weiter ~nach hinten" ; \ + Text [ en-US ] = "Send Back~ward" ; \ + Text [ x-comment ] = " ";\ + Text[ pt ] = "Mais para o f~undo";\ + Text[ ru ] = "ПеремеÑтить ~назад";\ + Text[ el ] = "~ΜεταφοÏά πίσω";\ + Text[ nl ] = "Naar a~chteren";\ + Text[ fr ] = "~Vers l'arrière";\ + Text[ es ] = "Enviar a~trás";\ + Text[ fi ] = "Siirrä taakse~päin";\ + Text[ ca ] = "Envia cap ~enrere";\ + Text[ it ] = "Porta più i~ndietro";\ + Text[ da ] = "Længere ~tilbage";\ + Text[ sv ] = "Längre ba~k";\ + Text[ pl ] = "Pr~zesuÅ„ do tyÅ‚u";\ + Text[ pt-BR ] = "Rec~uar";\ + Text[ th ] = "ส่งà¸à¸¥à¸±à¸šà¸‚้าง~หลัง";\ + Text[ ja ] = "後方ã«ç§»å‹•(~W)";\ + Text[ ko ] = "뒤로 ì´ë™(~W)";\ + Text[ zh-CN ] = "下移一层(~W)";\ + Text[ zh-TW ] = "下移一層(~W)";\ + Text[ tr ] = "Bir alta gönder";\ + Text[ hi-IN ] = "पिछली ~ओर à¤à¥‡à¤œà¥‹";\ + Text[ ar ] = "إرسال خلÙاً";\ + Text[ he ] = "Weiter ~nach hinten";\ + };\ + };\ + };\ +} + \ + +#define MN_TRANSFORM \ + MenuItem\ + {\ + Identifier = SID_ATTR_TRANSFORM ; \ + HelpID = SID_ATTR_TRANSFORM ; \ + Text [ de ] = "P~osition und Größe..." ; \ + Text [ en-US ] = "Position and Si~ze..." ; \ + Text [ x-comment ] = " ";\ + Text[ pt ] = "P~osição e tamanho...";\ + Text[ ru ] = "~ÐŸÐ¾Ð·Ð¸Ñ†Ð¸Ñ Ð¸ размер...";\ + Text[ el ] = "ΘÎση και μÎγεθ~ος...";\ + Text[ nl ] = "~Positie en grootte...";\ + Text[ fr ] = "P~osition et taille...";\ + Text[ es ] = "P~osición y tamaño...";\ + Text[ fi ] = "Sijainti ja ko~ko";\ + Text[ ca ] = "Position and Si~ze...";\ + Text[ it ] = "P~osizione e dimensione...";\ + Text[ da ] = "Pla~cering og størrelse...";\ + Text[ sv ] = "P~osition och storlek...";\ + Text[ pl ] = "~Pozycja i rozmiar...";\ + Text[ pt-BR ] = "P~osi??o e Tamanho...";\ + Text[ th ] = "ตำà¹à¸«à¸™à¹ˆà¸‡à¹à¸¥à¸°à¸‚~นาด...";\ + Text[ ja ] = "ä½ç½®ã¨ã‚µã‚¤ã‚º(~Z)...";\ + Text[ ko ] = "위치 ë° í¬ê¸°(~Z)...";\ + Text[ zh-CN ] = "ä½ç½®å’Œå¤§å°(~Z)...";\ + Text[ zh-TW ] = "ä½ç½®å’Œå¤§å°(~Z)...";\ + Text[ tr ] = "Konum ve ~Boyut";\ + Text[ hi-IN ] = "Position and Si~ze...";\ + Text[ ar ] = "...الموضع والØجم~";\ + Text[ he ] = "P~osition und Größe...";\ + } + +// EOF + + + + + + + + + + + + + + + + + diff --git a/binfilter/bf_sch/source/ui/app/sch_schdll.cxx b/binfilter/bf_sch/source/ui/app/sch_schdll.cxx new file mode 100644 index 000000000000..1a147a17711f --- /dev/null +++ b/binfilter/bf_sch/source/ui/app/sch_schdll.cxx @@ -0,0 +1,311 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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. + * + ************************************************************************/ + +#ifdef _MSC_VER +#pragma hdrstop +#endif + +#include <bf_svx/svxids.hrc> + +#include "docshell.hxx" +#include "schmod.hxx" +#include "app.hrc" +#include "schresid.hxx" +#include "memchrt.hxx" +#include "res_bmp.hrc" // contains define for RID_MENU, RID_ACCEL + +#include "globopt.hxx" +namespace binfilter { + +/************************************************************************* +|* +|* Initialisierung aus SfxApplicaton::Init() +|* +\************************************************************************/ + +/*N*/ void __EXPORT SchDLL::Init() +/*N*/ { +/*N*/ // called directly after loading the DLL +/*N*/ // do whatever you want, you may use Sd-DLL too +/*N*/ +/*N*/ // the SchModule must be created (may loaded by doc-fac or direct) +/*N*/ SchModuleDummy** ppShlPtr = (SchModuleDummy**) GetAppData(BF_SHL_SCH); +/*N*/ if ( (*ppShlPtr)->IsLoaded() ) return; +/*N*/ +/*N*/ SvFactory* pFact = PTR_CAST(SvFactory,(*ppShlPtr)->pSchChartDocShellFactory); +/*N*/ +/*N*/ delete (*ppShlPtr); +/*N*/ (*ppShlPtr) = new SchModule(pFact); +/*N*/ +/*N*/ SfxModule* pMod = SCH_MOD(); +/*N*/ +/*N*/ pMod->PutItem( SfxUInt16Item( SID_ATTR_METRIC, ::binfilter::sch::util::GetMeasureUnit() )); +/*N*/ } + +/************************************************************************* +|* +|* Deinitialisierung +|* +\************************************************************************/ + +/*N*/ void __EXPORT SchDLL::Exit() +/*N*/ { +/*N*/ // the SchModule must be destroyed +/*N*/ SchModuleDummy** ppShlPtr = (SchModuleDummy**) GetAppData(BF_SHL_SCH); +/*N*/ delete (*ppShlPtr); +/*N*/ (*ppShlPtr) = NULL; +/*N*/ } + + +/*N*/ extern_c void __LOADONCALLAPI SchSetTransparent( SvInPlaceObjectRef aIPObj, BOOL bTransp ) +/*N*/ {DBG_BF_ASSERT(0, "STRIP"); //STRIP001 +/*N*/ } + +/************************************************************************* +|* +|* +|* +\************************************************************************/ + +/*N*/ extern_c void __LOADONCALLAPI SchUpdate( SvInPlaceObjectRef aIPObj, +/*N*/ SchMemChart* pData, OutputDevice* pOut ) +/*N*/ { +/*N*/ SchChartDocShellRef aSchChartDocShellRef = &aIPObj; +/*N*/ +/*N*/ if( aSchChartDocShellRef.Is() ) +/*N*/ { +/*N*/ #ifdef DBG_UTIL +/*N*/ if( !pData ) +/*N*/ DBG_TRACE( "SchUpdate was called without MemChart" ); +/*N*/ #endif +/*N*/ ChartModel& rDoc = aSchChartDocShellRef->GetDoc(); +/*N*/ +/*N*/ if( pData ) +/*N*/ { +/*N*/ rDoc.SetChartDataBuffered( *pData, FALSE ); // don't update titles. This can't be done via SchUpdate +/*N*/ rDoc.CheckForNewAxisNumFormat(); +/*N*/ rDoc.SetChanged(); // #72576# +/*N*/ +/*N*/ ::com::sun::star::chart::ChartDataChangeEvent aEvent; +/*N*/ aEvent.Type = ::com::sun::star::chart::ChartDataChangeType_ALL; +/*N*/ aEvent.StartColumn = 0; +/*N*/ aEvent.EndColumn = 0; +/*N*/ aEvent.StartRow = 0; +/*N*/ aEvent.EndRow = 0; +/*N*/ +/*N*/ aSchChartDocShellRef->DataModified( aEvent ); +/*N*/ } +/*N*/ else +/*N*/ { +/*N*/ rDoc.BuildChart( FALSE ); +/*N*/ } +/*N*/ } +/*N*/ +/*N*/ aIPObj->SendViewChanged(); +/*N*/ } + +/************************************************************************* +|* +|* +|* +\************************************************************************/ + +/*N*/ extern_c void __LOADONCALLAPI SchUpdateAttr( SvInPlaceObjectRef aIPObj, +/*N*/ SchMemChart* pData, +/*N*/ const SfxItemSet& rAttr, +/*N*/ OutputDevice* pOut ) +/*N*/ { +/*N*/ DBG_ASSERT(pData, "Kein Chart-Datenobjekt angegeben!"); +/*N*/ if(!pData)return; +/*N*/ +/*N*/ SchChartDocShellRef aSchChartDocShellRef = &aIPObj; +/*N*/ +/*N*/ if (aSchChartDocShellRef.Is()) +/*N*/ { +/*N*/ +/*N*/ ChartModel& rDoc = aSchChartDocShellRef->GetDoc(); +/*N*/ +/*N*/ rDoc.SetChartData(*new SchMemChart(*pData)); +/*N*/ rDoc.PutAttr(rAttr); +/*N*/ +/*N*/ if( pOut ) +/*N*/ {DBG_BF_ASSERT(0, "STRIP");} //STRIP001 aSchChartDocShellRef->UpdateChart(pOut); +/*N*/ else +/*N*/ rDoc.BuildChart(TRUE); +/*N*/ } +/*N*/ +/*N*/ aIPObj->SendViewChanged(); +/*N*/ } + +/************************************************************************* +|* +|* +|* +\************************************************************************/ + +/*N*/ extern_c SchMemChart* __LOADONCALLAPI SchGetChartData (SvInPlaceObjectRef aIPObj) +/*N*/ { +/*N*/ SchChartDocShellRef aSchChartDocShellRef = &aIPObj; +/*N*/ +/*N*/ if (aSchChartDocShellRef.Is()) +/*N*/ { +/*N*/ ChartModel& rDoc = aSchChartDocShellRef->GetDoc(); +/*N*/ SchMemChart* pMemChart = rDoc.GetChartData (); +/*N*/ +/*N*/ if (pMemChart) +/*N*/ { +/*N*/ pMemChart->SetMainTitle(rDoc.MainTitle()); +/*N*/ pMemChart->SetSubTitle(rDoc.SubTitle()); +/*N*/ pMemChart->SetXAxisTitle(rDoc.XAxisTitle()); +/*N*/ pMemChart->SetYAxisTitle(rDoc.YAxisTitle()); +/*N*/ pMemChart->SetZAxisTitle(rDoc.ZAxisTitle()); +/*N*/ } +/*N*/ +/*N*/ return pMemChart; +/*N*/ } +/*N*/ else return 0; +/*N*/ } + +/************************************************************************* +|* +|* +|* +\************************************************************************/ + +/*N*/ extern_c SchMemChart* __LOADONCALLAPI SchNewMemChartNone () +/*N*/ { +/*N*/ DBG_BF_ASSERT(0, "STRIP");return NULL; //STRIP001 return new SchMemChart; +/*N*/ } + +/************************************************************************* +|* +|* +|* +\************************************************************************/ + +/*N*/ extern_c SchMemChart* __LOADONCALLAPI SchNewMemChartXY (short nCols, short nRows) +/*N*/ { +/*N*/ return new SchMemChart (nCols, nRows); +/*N*/ } + +/************************************************************************* +|* +|* +|* +\************************************************************************/ + +/*N*/ extern_c SchMemChart* __LOADONCALLAPI SchNewMemChartCopy (const SchMemChart &rMemChart) +/*N*/ { +/*?*/ DBG_BF_ASSERT(0, "STRIP"); return NULL;//STRIP001 return new SchMemChart (rMemChart); +/*N*/ } + +/************************************************************************* +|* +|* +|* +\************************************************************************/ + +/*N*/ extern_c ChartModel* __LOADONCALLAPI SchGetModel (SvInPlaceObjectRef aIPObj) +/*N*/ {DBG_BF_ASSERT(0, "STRIP"); return 0; //STRIP001 +/*N*/ } + +/*N*/ extern_c void __LOADONCALLAPI SchGetDefaultForColumnText( +/*N*/ const SchMemChart& rMemChart, sal_Int32 nCol, String& aResult ) +/*N*/ { +/*N*/ aResult = rMemChart.GetDefaultColumnText( nCol ); +/*N*/ } + +/*N*/ extern_c void __LOADONCALLAPI SchGetDefaultForRowText( +/*N*/ const SchMemChart& rMemChart, sal_Int32 nRow, String& aResult ) +/*N*/ { +/*N*/ aResult = rMemChart.GetDefaultRowText( nRow ); +/*N*/ } + +/*N*/ extern_c void __LOADONCALLAPI SchConvertChartRangeForWriter( +/*N*/ SchMemChart& rMemChart, BOOL bOldToNew ) +/*N*/ { +/*N*/ rMemChart.ConvertChartRangeForWriter( bOldToNew ); +/*N*/ } + +/*N*/ extern_c void __LOADONCALLAPI SchConvertChartRangeForCalc( +/*N*/ SchMemChart& rMemChart, BOOL bOldToNew ) +/*N*/ { +/*?*/ DBG_BF_ASSERT(0, "STRIP"); //STRIP001 rMemChart.ConvertChartRangeForCalc( bOldToNew ); +/*N*/ } + +/*N*/ extern_c void __LOADONCALLAPI SchMemChartResetTranslation( +/*N*/ SchMemChart& rMemChart, long *pTable,long nCnt ) +/*N*/ { +/*?*/ DBG_BF_ASSERT(0, "STRIP"); //STRIP001 rMemChart.ResetTranslation( pTable, nCnt ); +/*N*/ } + +/*N*/ extern_c void __LOADONCALLAPI SchMemChartUpdateTranslation( +/*N*/ SchMemChart& rMemChart, long *pTable, long nCnt ) +/*N*/ { +/*?*/ DBG_BF_ASSERT(0, "STRIP"); //STRIP001 rMemChart.UpdateTranslation( pTable, nCnt ); +/*N*/ } + +/*N*/ extern_c void __LOADONCALLAPI SchMemChartInsertCols( SchMemChart& rMemChart, +/*N*/ short nAtCol, short nCount) +/*N*/ { +/*N*/ rMemChart.InsertCols( nAtCol, nCount ); +/*N*/ } + +/*N*/ extern_c void __LOADONCALLAPI SchMemChartRemoveCols( SchMemChart& rMemChart, +/*N*/ short nAtCol, short nCount) +/*N*/ { +/*?*/ DBG_BF_ASSERT(0, "STRIP"); //STRIP001 rMemChart.RemoveCols( nAtCol, nCount ); +/*N*/ } + +/*N*/ extern_c void __LOADONCALLAPI SchMemChartInsertRows( SchMemChart& rMemChart, +/*N*/ short nAtRow, short nCount) +/*N*/ { +/*N*/ rMemChart.InsertRows( nAtRow, nCount ); +/*N*/ } + +/*N*/ extern_c void __LOADONCALLAPI SchMemChartRemoveRows( SchMemChart& rMemChart, +/*N*/ short nAtRow, short nCount) +/*N*/ { +/*?*/ DBG_BF_ASSERT(0, "STRIP"); //STRIP001 rMemChart.RemoveRows( nAtRow, nCount ); +/*N*/ } + +/*N*/ extern_c void __LOADONCALLAPI SchMemChartSwapCols( SchMemChart& rMemChart, +/*N*/ int nAtCol1, int nAtCol2) +/*N*/ { +/*?*/ DBG_BF_ASSERT(0, "STRIP"); //STRIP001 rMemChart.SwapCols( nAtCol1, nAtCol2 ); +/*N*/ } + +/*N*/ extern_c void __LOADONCALLAPI SchMemChartSwapRows( SchMemChart& rMemChart, +/*N*/ int nAtRow1,int nAtRow2) +/*N*/ { +/*?*/ DBG_BF_ASSERT(0, "STRIP"); //STRIP001 rMemChart.SwapRows( nAtRow1, nAtRow2 ); +/*N*/ } + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/app/sch_schlib.cxx b/binfilter/bf_sch/source/ui/app/sch_schlib.cxx new file mode 100644 index 000000000000..843e86dbd0ad --- /dev/null +++ b/binfilter/bf_sch/source/ui/app/sch_schlib.cxx @@ -0,0 +1,340 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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. + * + ************************************************************************/ + +#ifdef _MSC_VER +#pragma optimize("",off) +#endif + + +#include <bf_sfx2/docfilt.hxx> + +#include <bf_sfx2/app.hxx> + +#include <comphelper/classids.hxx> + +#include <sot/formats.hxx> +#include "schmod.hxx" +#include "docshell.hxx" +#include "schlib.hxx" + +class ValueSet; + +#include "res_bmp.hrc" +namespace binfilter { + +#define SCH_FORMAT_STR_50_FORMAT String( RTL_CONSTASCII_USTRINGPARAM( "StarChart 5.0" )) + +/*?*/ TYPEINIT1( SchModuleDummy, SfxModule ); + +extern "C" { static void SAL_CALL thisModule() {} } + +/*?*/ SFX_IMPL_OBJECTFACTORY_LIB( SchChartDocShell, SFXOBJECTSHELL_STD_NORMAL, schart, + SvGlobalName(BF_SO3_SCH_CLASSID), Sch, String( RTL_CONSTASCII_USTRINGPARAM( DLL_NAME )) ) +// from macro: void __EXPORT SchChartDocShell::InitFactory() +/*?*/ { +/*?*/ ULONG nFormat50 = SOT_FORMATSTR_ID_STARCHART_50; +/*?*/ SfxObjectFactory& rFactory = (SfxObjectFactory&)Factory(); +/*?*/ rFactory.SetDocumentServiceName(String::CreateFromAscii("com.sun.star.chart.ChartDocument")); +/*?*/ } + +/************************************************************************* +|* +|* Konstruktor +|* +\************************************************************************/ + +/*?*/ SchDLL::SchDLL() +/*?*/ { +/*?*/ } + +/************************************************************************* +|* +|* Destruktor +|* +\************************************************************************/ + +/*?*/ SchDLL::~SchDLL() +/*?*/ { +/*?*/ } + +/************************************************************************* +|* +|* +|* +\************************************************************************/ + + +/*?*/ void SchDLL::LibInit() +/*?*/ { +/*?*/ // Das Anlegen des ResMgr ist nur fuer die obige Filter-Registierung +/*?*/ // notwendig. Sobald dort kein SdResId mehr notwendig ist, kann das +/*?*/ // Anlegen entfallen +/*?*/ SchChartDocShell::RegisterFactory(SDT_SCH_DOCFACTPRIO); +/*?*/ +/*?*/ SCH_MOD() = (SchModule *) new SchModuleDummy(NULL, TRUE, &SchChartDocShell::Factory() ); +/*?*/ } + +/************************************************************************* +|* +|* +|* +\************************************************************************/ + + +/*?*/ void SchDLL::LibExit() +/*?*/ { +/*?*/ FreeLibSch(); +/*?*/ +/*?*/ // destroy the dummy-module with Object-Factory-Pointer +/*?*/ DELETEZ( SCH_MOD() ); +/*?*/ } + +/************************************************************************* +|* +|* +|* +\************************************************************************/ + + +/*N*/ void __EXPORT SchDLL::Update( SvInPlaceObjectRef aIPObj, SchMemChart* pData, OutputDevice* pOut ) +/*N*/ { +/*N*/ void (__LOADONCALLAPI*fp)(SvInPlaceObjectRef, SchMemChart*, OutputDevice*); +/*N*/ +/*N*/ fp = (void (__LOADONCALLAPI*)(SvInPlaceObjectRef, SchMemChart*, OutputDevice*))GetFuncSch("SchUpdate"); +/*N*/ +/*N*/ if (fp) +/*N*/ { +/*N*/ fp(aIPObj, pData, pOut); +/*N*/ } +/*N*/ } + +/************************************************************************* +|* +|* +|* +\************************************************************************/ + + +/*N*/ SchMemChart* __EXPORT SchDLL::GetChartData (SvInPlaceObjectRef aIPObj) +/*N*/ { +/*N*/ SchMemChart* (__LOADONCALLAPI*fp)(SvInPlaceObjectRef); +/*N*/ +/*N*/ fp = (SchMemChart* (__LOADONCALLAPI*)(SvInPlaceObjectRef aIPObj))GetFuncSch("SchGetChartData"); +/*N*/ +/*N*/ return fp +/*N*/ ? fp (aIPObj) +/*N*/ : 0; +/*N*/ } + +/************************************************************************* +|* +|* +|* +\************************************************************************/ + +/*N*/ SchMemChart* __EXPORT SchDLL::NewMemChart (short nCols, short nRows) +/*N*/ { +/*N*/ SchMemChart* (__LOADONCALLAPI*fp)(short, short); +/*N*/ +/*N*/ fp = (SchMemChart* (__LOADONCALLAPI*)(short, short))GetFuncSch("SchNewMemChartXY"); +/*N*/ +/*N*/ if (fp) +/*N*/ { +/*N*/ return fp(nCols, nRows); +/*N*/ } +/*N*/ else return 0; +/*N*/ } + +/************************************************************************* +|* +|* +|* +\************************************************************************/ + +/*N*/ void __EXPORT SchDLL::GetDefaultForColumnText( const SchMemChart& rMemChart, sal_Int32 nCol, String& aResult ) +/*N*/ { +/*N*/ void (__LOADONCALLAPI*fp)( const SchMemChart&, sal_Int32, String& ); +/*N*/ +/*N*/ fp = (void (__LOADONCALLAPI*)( const SchMemChart&, sal_Int32, String& ))GetFuncSch("SchGetDefaultForColumnText"); +/*N*/ +/*N*/ if( fp ) +/*N*/ { +/*N*/ fp( rMemChart, nCol, aResult ); +/*N*/ } +/*N*/ } + +/*N*/ void __EXPORT SchDLL::GetDefaultForRowText( const SchMemChart& rMemChart, sal_Int32 nRow, String& aResult ) +/*N*/ { +/*N*/ void (__LOADONCALLAPI*fp)( const SchMemChart&, sal_Int32, String& ); +/*N*/ +/*N*/ fp = (void (__LOADONCALLAPI*)( const SchMemChart&, sal_Int32, String& ))GetFuncSch("SchGetDefaultForRowText"); +/*N*/ +/*N*/ if( fp ) +/*N*/ { +/*N*/ fp( rMemChart, nRow, aResult ); +/*N*/ } +/*N*/ } + +/*N*/ void __EXPORT SchDLL::ConvertChartRangeForWriter( SchMemChart& rMemChart, +/*N*/ BOOL bOldToNew ) +/*N*/ { +/*N*/ void (__LOADONCALLAPI* fp )( SchMemChart&, BOOL ) +/*N*/ = (void (__LOADONCALLAPI*)( SchMemChart&, BOOL )) +/*N*/ GetFuncSch("SchConvertChartRangeForWriter"); +/*N*/ if( fp ) +/*N*/ fp( rMemChart, bOldToNew ); +/*N*/ } + +/*N*/ void __EXPORT SchDLL::MemChartInsertCols( SchMemChart& rMemChart, +/*N*/ short nAtCol, short nCount) +/*N*/ { +/*N*/ void (__LOADONCALLAPI* fp )( SchMemChart&, short, short ) +/*N*/ = (void (__LOADONCALLAPI*)( SchMemChart&, short, short )) +/*N*/ GetFuncSch("SchMemChartInsertCols"); +/*N*/ if( fp ) +/*N*/ fp( rMemChart, nAtCol, nCount ); +/*N*/ } +/*?*/ void __EXPORT SchDLL::MemChartRemoveCols( SchMemChart& rMemChart, +/*?*/ short nAtCol, short nCount) +/*?*/ { +/*?*/ void (__LOADONCALLAPI* fp )( SchMemChart&, short, short ) +/*?*/ = (void (__LOADONCALLAPI*)( SchMemChart&, short, short )) +/*?*/ GetFuncSch("SchMemChartRemoveCols"); +/*?*/ if( fp ) +/*?*/ fp( rMemChart, nAtCol, nCount ); +/*?*/ } + +/*N*/ void __EXPORT SchDLL::MemChartInsertRows( SchMemChart& rMemChart, +/*N*/ short nAtRow, short nCount ) +/*N*/ { +/*N*/ void (__LOADONCALLAPI* fp )( SchMemChart&, short, short ) +/*N*/ = (void (__LOADONCALLAPI*)( SchMemChart&, short, short )) +/*N*/ GetFuncSch("SchMemChartInsertRows"); +/*N*/ if( fp ) +/*N*/ fp( rMemChart, nAtRow, nCount ); +/*N*/ } +/*?*/ void __EXPORT SchDLL::MemChartRemoveRows( SchMemChart& rMemChart, +/*?*/ short nAtRow, short nCount ) +/*?*/ { +/*?*/ void (__LOADONCALLAPI* fp )( SchMemChart&, short, short ) +/*?*/ = (void (__LOADONCALLAPI*)( SchMemChart&, short, short )) +/*?*/ GetFuncSch("SchMemChartRemoveRows"); +/*?*/ if( fp ) +/*?*/ fp( rMemChart, nAtRow, nCount ); +/*?*/ } + +/************************************************************************* +|* +|* Lade Module von aussen +|* +\************************************************************************/ + +/*?*/ SfxModule *SchModuleDummy::Load() +/*?*/ { +/*?*/ return (LoadLibSch() ? SCH_MOD() : NULL); +/*?*/ } + +/************************************************************************* +|* +|* Bestimme die GUID abh. von der Version +|* +\************************************************************************/ + +/*?*/ const SvGlobalName SchModuleDummy::GetID (USHORT nFileFormat) +/*?*/ { +/*?*/ SvGlobalName aName; +/*?*/ +/*?*/ switch (nFileFormat) +/*?*/ { +/*?*/ case SOFFICE_FILEFORMAT_60: +/*?*/ { +/*?*/ aName = SvGlobalName(BF_SO3_SCH_CLASSID_60); +/*?*/ } +/*?*/ break; +/*?*/ +/*?*/ case SOFFICE_FILEFORMAT_50: +/*?*/ { +/*?*/ aName = SvGlobalName(BF_SO3_SCH_CLASSID_50); +/*?*/ } +/*?*/ break; +/*?*/ +/*?*/ case SOFFICE_FILEFORMAT_40: +/*?*/ { +/*?*/ aName = SvGlobalName(BF_SO3_SCH_CLASSID_40); +/*?*/ } +/*?*/ break; +/*?*/ +/*?*/ case SOFFICE_FILEFORMAT_31: +/*?*/ { +/*?*/ aName = SvGlobalName(BF_SO3_SCH_CLASSID_30); +/*?*/ } +/*?*/ break; +/*?*/ +/*?*/ default: +/*?*/ { +/*?*/ DBG_ERROR( "Unknown file format" ); +/*?*/ } +/*?*/ break; +/*?*/ } +/*?*/ +/*?*/ return aName; +/*?*/ } + +/************************************************************************* +|* +|* Bestimme die Version aus der GUID +|* +\************************************************************************/ + +/*?*/ USHORT SchModuleDummy::HasID (const SvGlobalName &rName) +/*?*/ { +/*?*/ USHORT nRet = 0; +/*?*/ +/*?*/ if (GetID(SOFFICE_FILEFORMAT_31) == rName) +/*?*/ { +/*?*/ nRet = SOFFICE_FILEFORMAT_31; +/*?*/ } +/*?*/ else if (GetID(SOFFICE_FILEFORMAT_40) == rName) +/*?*/ { +/*?*/ nRet = SOFFICE_FILEFORMAT_40; +/*?*/ } +/*?*/ else if (GetID(SOFFICE_FILEFORMAT_50) == rName) +/*?*/ { +/*?*/ nRet = SOFFICE_FILEFORMAT_50; +/*?*/ } +/*?*/ else if (GetID(SOFFICE_FILEFORMAT_60) == rName) +/*?*/ { +/*?*/ nRet = SOFFICE_FILEFORMAT_60; +/*?*/ } +/*?*/ +/*?*/ return(nRet); +/*?*/ } + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/app/sch_schmod.cxx b/binfilter/bf_sch/source/ui/app/sch_schmod.cxx new file mode 100644 index 000000000000..fe8ca7261715 --- /dev/null +++ b/binfilter/bf_sch/source/ui/app/sch_schmod.cxx @@ -0,0 +1,142 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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. + * + ************************************************************************/ + +#define ITEMID_SEARCH SID_SEARCH_ITEM + +#ifdef _MSC_VER +#pragma hdrstop +#endif + + +#include <bf_svx/svxids.hrc> +#include <bf_sfx2/app.hxx> +#include <vcl/status.hxx> +#include <bf_svx/svdobj.hxx> + +#define _SCH_DLL // fuer SD_MOD() +#include "schmod.hxx" +#include "schresid.hxx" + +#include "app.hrc" +#include "glob.hrc" +#include "strings.hrc" +#include "res_bmp.hrc" + +namespace binfilter { + +/*N*/ TYPEINIT1( SchModuleDummy, SfxModule ); +/*N*/ TYPEINIT1( SchModule, SchModuleDummy ); + +/************************************************************************* +|* +|* Ctor +|* +\************************************************************************/ + +/*N*/ SchModule::SchModule(SvFactory* pObjFact) : +/*N*/ SchModuleDummy(SFX_APP()->CreateResManager("bf_sch"), FALSE, pObjFact), //STRIP005 +/*N*/ pXOutDevPool( NULL ), +/*N*/ pDragData( NULL ), +/*N*/ pClipboardData( NULL ), +/*N*/ mpTransferDragDrop( NULL ), +/*N*/ mpTransferClipboard( NULL ), +/*N*/ mpTransferSelectionClipbd( NULL ), +/*N*/ pChartOptions( NULL ) +/*N*/ { +/*N*/ pSchObjFactory = new SchObjFactory(); +/*N*/ +/*N*/ if (!pSchObjFactory->GetInserted()) +/*N*/ { +/*N*/ SdrObjFactory::InsertMakeObjectHdl(LINK(pSchObjFactory, SchObjFactory, MakeObject)); +/*N*/ SdrObjFactory::InsertMakeUserDataHdl(LINK(pSchObjFactory, SchObjFactory, MakeUserData)); +/*N*/ +/*N*/ pSchObjFactory->SetInserted(TRUE); +/*N*/ } +/*N*/ +/*N*/ // #62493# this factory exists already +/*N*/ //pE3dFactory = new E3dObjFactory(); +/*N*/ //SdrObjFactory::InsertMakeObjectHdl(LINK(pE3dFactory, E3dObjFactory, MakeObject)); +/*N*/ +/*N*/ SetName( String( RTL_CONSTASCII_USTRINGPARAM( "StarChart" )) ); +/*N*/ +/*N*/ // establish listener, so that the module is informed +/*N*/ // right before the application is going to be shut down +/*N*/ StartListening( *SFX_APP() ); +/*N*/ } + +/************************************************************************* +|* +|* Dtor +|* +\************************************************************************/ + +/*N*/ SchModule::~SchModule() +/*N*/ { +/*N*/ if (pSchObjFactory) +/*N*/ { +/*N*/ if (pSchObjFactory->GetInserted()) +/*N*/ { +/*N*/ SdrObjFactory::RemoveMakeObjectHdl(LINK(pSchObjFactory, SchObjFactory, MakeObject)); +/*N*/ SdrObjFactory::RemoveMakeUserDataHdl(LINK(pSchObjFactory, SchObjFactory, MakeUserData)); +/*N*/ } +/*N*/ +/*N*/ delete pSchObjFactory; +/*N*/ } +/*N*/ } + + +/*?*/ SfxModule *SchModuleDummy::Load() +/*?*/ { +/*?*/ return NULL; +/*?*/ } + +/*N*/ SchOptions* SchModule::GetSchOptions() +/*N*/ { +/*N*/ if( ! pChartOptions ) +/*N*/ pChartOptions = new SchOptions(); +/*N*/ +/*N*/ return pChartOptions; +/*N*/ } + +/************************************************************************* +|* +|* get notifications +|* +\************************************************************************/ + +/*N*/ void SchModule::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) +/*N*/ { +/*N*/ if( rHint.ISA( SfxSimpleHint ) && +/*N*/ ( (SfxSimpleHint&) rHint ).GetId() == SFX_HINT_DEINITIALIZING ) +/*N*/ { +/*N*/ delete pChartOptions, pChartOptions = NULL; +/*N*/ } +/*N*/ } +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/app/sch_schopt.cxx b/binfilter/bf_sch/source/ui/app/sch_schopt.cxx new file mode 100644 index 000000000000..deb0dd1f1362 --- /dev/null +++ b/binfilter/bf_sch/source/ui/app/sch_schopt.cxx @@ -0,0 +1,177 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 <com/sun/star/uno/Sequence.hxx> +// header for SvStream +// header for SAL_STATIC_CAST +#include <sal/types.h> + +#include "schopt.hxx" + +#include "schresid.hxx" +#include "strings.hrc" +namespace binfilter { + +using namespace ::com::sun::star; + +#define SCH_OPTIONS_VERSION_001 USHORT( 1 ) + + +// -------------------- +// class SchColorTable +// -------------------- +/*N*/ SchColorTable::SchColorTable() +/*N*/ { +/*N*/ } + + +/*N*/ BOOL SchColorTable::Insert( ULONG nKey, XColorEntry* pEntry ) +/*N*/ { +/*N*/ return Table::Insert( nKey, (void*)pEntry ); +/*N*/ } + + + +/*N*/ void SchColorTable::ClearAndDestroy() +/*N*/ { +/*N*/ for( ULONG i = Count(); i; ) +/*N*/ delete Get( --i ); +/*N*/ Clear(); +/*N*/ } + +/*N*/ XColorEntry* SchColorTable::Get( ULONG nKey ) const +/*N*/ { +/*N*/ return SAL_STATIC_CAST( XColorEntry*, Table::Get( nKey ) ); +/*N*/ } + +/*N*/ Color SchColorTable::GetColor( ULONG nKey ) const +/*N*/ { +/*N*/ XColorEntry* pEntry = Get( nKey ); +/*N*/ if( pEntry ) +/*N*/ return pEntry->GetColor(); +/*N*/ +/*N*/ return COL_BLACK; +/*N*/ } + +/*N*/ ColorData SchColorTable::GetColorData( ULONG nKey ) const +/*N*/ { +/*N*/ return GetColor( nKey ).GetRGBColor(); +/*N*/ } + + +// ==================== +// class SchOptions +// ==================== + +/*N*/ SchOptions::SchOptions() : +/*N*/ ::utl::ConfigItem( ::rtl::OUString::createFromAscii( "Office.Chart" )), +/*N*/ mbIsInitialized( FALSE ) +/*N*/ { +/*N*/ maPropertyNames.realloc( 1 ); +/*N*/ maPropertyNames[ 0 ] = ::rtl::OUString::createFromAscii( "DefaultColor/Series" ); +/*N*/ } + +/*N*/ SchOptions::~SchOptions() +/*N*/ { +/*N*/ maDefColors.ClearAndDestroy(); +/*N*/ } + +/*N*/ const SchColorTable& SchOptions::GetDefaultColors() +/*N*/ { +/*N*/ if( ! mbIsInitialized ) +/*N*/ { +/*N*/ mbIsInitialized = RetrieveOptions(); +/*N*/ } +/*N*/ +/*N*/ return maDefColors; +/*N*/ } + + +/*N*/ BOOL SchOptions::RetrieveOptions() +/*N*/ { +/*N*/ // get sequence containing all properties +/*N*/ +/*N*/ uno::Sequence< ::rtl::OUString > aNames = GetPropertyNames(); +/*N*/ uno::Sequence< uno::Any > aProperties( aNames.getLength()); +/*N*/ aProperties = GetProperties( aNames ); +/*N*/ +/*N*/ if( aProperties.getLength() == aNames.getLength()) +/*N*/ { +/*N*/ // 1. default colors for series +/*N*/ maDefColors.ClearAndDestroy(); +/*N*/ uno::Sequence< sal_Int64 > aColorSeq; +/*N*/ aProperties[ 0 ] >>= aColorSeq; +/*N*/ +/*N*/ sal_Int32 nCount = aColorSeq.getLength(); +/*N*/ Color aCol; +/*N*/ +/*N*/ // create strings for entry names +/*N*/ String aResName( SchResId( STR_DIAGRAM_ROW )); +/*N*/ String aPrefix, aPostfix, aName; +/*N*/ xub_StrLen nPos = aResName.SearchAscii( "$(ROW)" ); +/*N*/ if( nPos != STRING_NOTFOUND ) +/*N*/ { +/*N*/ aPrefix = String( aResName, 0, nPos ); +/*N*/ aPostfix = String( aResName, nPos + sizeof( "$(ROW)" ) - 1, STRING_LEN ); +/*N*/ } +/*N*/ else +/*?*/ aPrefix = aResName; +/*N*/ +/*N*/ // set color values +/*N*/ for( sal_Int32 i=0; i < nCount; i++ ) +/*N*/ { +/*N*/ aCol.SetColor( SAL_STATIC_CAST( ColorData, aColorSeq[ i ] )); +/*N*/ +/*N*/ aName = aPrefix; +/*N*/ aName.Append( String::CreateFromInt32( i + 1 )); +/*N*/ aName.Append( aPostfix ); +/*N*/ +/*N*/ maDefColors.Insert( i, new XColorEntry( aCol, aName ) ); +/*N*/ } +/*N*/ return TRUE; +/*N*/ } +/*N*/ return FALSE; +/*N*/ } + +void SchOptions::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames ) {} +void SchOptions::Commit() {} + + +// -------------------- +// class SchColorTableItem +// -------------------- + + + + + + + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/app/sch_schresid.cxx b/binfilter/bf_sch/source/ui/app/sch_schresid.cxx new file mode 100644 index 000000000000..5a5e038e7d74 --- /dev/null +++ b/binfilter/bf_sch/source/ui/app/sch_schresid.cxx @@ -0,0 +1,55 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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. + * + ************************************************************************/ + + +#ifdef _MSC_VER +#pragma hdrstop +#endif + +#include "schmod.hxx" +#include "schresid.hxx" +namespace binfilter { + + +/************************************************************************* +|* +|* Funktionsbeschreibung +|* +\************************************************************************/ + +/*N*/ SchResId::SchResId(USHORT nId) : +/*N*/ ResId( nId, *SCH_MOD1()->GetResMgr() ) +/*N*/ { +/*N*/ } + + + + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/app/sch_strings.src b/binfilter/bf_sch/source/ui/app/sch_strings.src new file mode 100644 index 000000000000..67946f8eed6a --- /dev/null +++ b/binfilter/bf_sch/source/ui/app/sch_strings.src @@ -0,0 +1,1058 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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. + * + ************************************************************************/ +#define NO_LOCALIZE_EXPORT + +#include "strings.hrc" +String RID_BUILDVERSION +{ + Text [ de ] = UPDVER ; + Text [ en-US ] = UPDVER ; +}; +String STR_AREA +{ + Text [ de ] = "Fläche" ; + Text [ en-US ] = "Area" ; + Text[ pt ] = "Preenchimento"; + Text[ ru ] = "ОблаÑÑ‚ÑŒ"; + Text[ el ] = "Επιφάνεια"; + Text[ nl ] = "Vlak"; + Text[ fr ] = "Remplissage"; + Text[ es ] = "Ãrea"; + Text[ fi ] = "Alue"; + Text[ ca ] = "Àrea"; + Text[ it ] = "Area"; + Text[ da ] = "OmrÃ¥de"; + Text[ sv ] = "Yta"; + Text[ pl ] = "Obszar"; + Text[ pt-BR ] = "Ãrea"; + Text[ th ] = "พื้นที่"; + Text[ ja ] = "エリア"; + Text[ ko ] = "ì˜ì—"; + Text[ zh-CN ] = "å……å¡«å¹³é¢"; + Text[ zh-TW ] = "å……å¡«å¹³é¢"; + Text[ tr ] = "Yüzey"; + Text[ hi-IN ] = "विसà¥à¤¤à¥€à¤°à¥à¤£"; + Text[ ar ] = "تعبئة الكائن"; + Text[ he ] = "Fläche"; +}; +String STR_LINE +{ + Text [ de ] = "Linie" ; + Text [ en-US ] = "Line" ; + Text[ pt ] = "Linha"; + Text[ ru ] = "ЛиниÑ"; + Text[ el ] = "ΓÏαμμή"; + Text[ nl ] = "Lijn"; + Text[ fr ] = "Ligne"; + Text[ es ] = "LÃnea"; + Text[ fi ] = "Viiva"; + Text[ ca ] = "LÃnia"; + Text[ it ] = "Linea"; + Text[ da ] = "Linje"; + Text[ sv ] = "Linje"; + Text[ pl ] = "Linia"; + Text[ pt-BR ] = "Linha"; + Text[ th ] = "บรรทัด"; + Text[ ja ] = "折れ線"; + Text[ ko ] = "ì„ "; + Text[ zh-CN ] = "线æ¡"; + Text[ zh-TW ] = "ç·šæ¢"; + Text[ tr ] = "Çizgi"; + Text[ hi-IN ] = "Line"; + Text[ ar ] = "خط"; + Text[ he ] = "Linie"; +}; +String STR_LINES +{ + Text [ de ] = "Linien" ; + Text [ en-US ] = "Lines" ; + Text[ pt ] = "Linhas"; + Text[ ru ] = "Линии"; + Text[ el ] = "ΓÏαμμÎÏ‚"; + Text[ nl ] = "Lijnen"; + Text[ fr ] = "Lignes"; + Text[ es ] = "LÃneas"; + Text[ fi ] = "Rivit"; + Text[ ca ] = "LÃnies"; + Text[ it ] = "Linee"; + Text[ da ] = "Linjer"; + Text[ sv ] = "Linjer"; + Text[ pl ] = "Linie"; + Text[ pt-BR ] = "Linhas"; + Text[ th ] = "บรรทัด"; + Text[ ja ] = "折れ線"; + Text[ ko ] = "ì„ "; + Text[ zh-CN ] = "线æ¡"; + Text[ zh-TW ] = "ç·šæ¢"; + Text[ tr ] = "Çizgi"; + Text[ hi-IN ] = "Lines"; + Text[ ar ] = "خطوط"; + Text[ he ] = "Linien"; +}; +String STR_COLUMNS +{ + Text [ de ] = "Säulen" ; + Text [ en-US ] = "Columns" ; + Text[ pt ] = "Barras"; + Text[ ru ] = "ГиÑтограмма"; + Text[ el ] = "Στήλες"; + Text[ nl ] = "kolommen"; + Text[ fr ] = "Colonnes"; + Text[ es ] = "Columnas"; + Text[ fi ] = "Pylväs"; + Text[ ca ] = "Columnes"; + Text[ it ] = "Colonne"; + Text[ da ] = "Søjler"; + Text[ sv ] = "Staplar"; + Text[ pl ] = "Kolumny"; + Text[ pt-BR ] = "Colunas"; + Text[ th ] = "คà¸à¸¥à¸±à¸¡à¸™à¹Œà¹Œ"; + Text[ ja ] = "縦棒"; + Text[ ko ] = "단"; + Text[ zh-CN ] = "柱"; + Text[ zh-TW ] = "柱"; + Text[ tr ] = "Sütun"; + Text[ hi-IN ] = "सà¥à¤¤à¤‚à¤"; + Text[ ar ] = "أعمدة"; + Text[ he ] = "‮טורי×‬"; +}; +String STR_BARS +{ + Text [ de ] = "Balken" ; + Text [ en-US ] = "Bars" ; + Text [ x-comment ] = "èëè: Ïîëîñû - -"; + Text[ pt ] = "Barras"; + Text[ ru ] = "ЛинейчатаÑ"; + Text[ el ] = "Ράβδοι"; + Text[ nl ] = "balken"; + Text[ fr ] = "Barres"; + Text[ es ] = "Barras"; + Text[ fi ] = "Palkit"; + Text[ ca ] = "Barres"; + Text[ it ] = "Barre"; + Text[ da ] = "Liggende søjler"; + Text[ sv ] = "Liggande staplar"; + Text[ pl ] = "SÅ‚upki"; + Text[ pt-BR ] = "Barras"; + Text[ th ] = "à¹à¸–บ"; + Text[ ja ] = "横棒"; + Text[ ko ] = "ë°”"; + Text[ zh-CN ] = "æ¡"; + Text[ zh-TW ] = "æ¢"; + Text[ tr ] = "Çubuk"; + Text[ hi-IN ] = "पटà¥à¤Ÿà¥€"; + Text[ ar ] = "أعمدة"; + Text[ he ] = "Balken"; +}; +String STR_AREAS +{ + Text [ de ] = "Flächen" ; + Text [ en-US ] = "Areas" ; + Text[ pt ] = "Ãreas"; + Text[ ru ] = "ОблаÑти"; + Text[ el ] = "Επιφάνειες"; + Text[ nl ] = "vlakken"; + Text[ fr ] = "Zones"; + Text[ es ] = "Ãreas"; + Text[ fi ] = "Alueet"; + Text[ ca ] = "Àrees"; + Text[ it ] = "Aree"; + Text[ da ] = "OmrÃ¥der"; + Text[ sv ] = "Ytor"; + Text[ pl ] = "Obszary"; + Text[ pt-BR ] = "Ãreas"; + Text[ th ] = "พื้นที่"; + Text[ ja ] = "エリア"; + Text[ ko ] = "ë©´"; + Text[ zh-CN ] = "å¹³é¢"; + Text[ zh-TW ] = "å¹³é¢"; + Text[ tr ] = "Yüzey"; + Text[ hi-IN ] = "विसà¥à¤¤à¥€à¤°à¥à¤£"; + Text[ ar ] = "مناطق"; + Text[ he ] = "Flächen"; +}; +String STR_CIRCLES +{ + Text [ de ] = "Kreise" ; + Text [ en-US ] = "Pies" ; + Text[ pt ] = "Sectores"; + Text[ ru ] = "КруговаÑ"; + Text[ el ] = "ΚÏκλοι"; + Text[ nl ] = "cirkels"; + Text[ fr ] = "Secteurs"; + Text[ es ] = "CÃrculos"; + Text[ fi ] = "Ympyräkaaviot"; + Text[ ca ] = "Diagrames de sectors"; + Text[ it ] = "Torta"; + Text[ da ] = "Cirkler"; + Text[ sv ] = "Cirklar"; + Text[ pl ] = "KoÅ‚a"; + Text[ pt-BR ] = "Pizzas"; + Text[ th ] = "พาย"; + Text[ ja ] = "円"; + Text[ ko ] = "ì›í˜•"; + Text[ zh-CN ] = "圆"; + Text[ zh-TW ] = "圓"; + Text[ tr ] = "Daire"; + Text[ hi-IN ] = "वृतखणà¥à¤¡"; + Text[ ar ] = "دوائر"; + Text[ he ] = "Kreise"; +}; +String STR_XY +{ + Text [ de ] = "XY-Diagramm" ; + Text [ en-US ] = "XY Chart" ; + Text[ pt ] = "Gráfico XY"; + Text[ ru ] = "Диаграмма XY"; + Text[ el ] = "ΔιάγÏαμμα XY"; + Text[ nl ] = "XY-diagram"; + Text[ fr ] = "Diagramme XY"; + Text[ es ] = "Diagrama XY"; + Text[ fi ] = "XY-kaavio"; + Text[ ca ] = "Diagrama XY"; + Text[ it ] = "Diagramma XY"; + Text[ da ] = "XY-diagram"; + Text[ sv ] = "XY-diagram"; + Text[ pl ] = "Wykres XY"; + Text[ pt-BR ] = "Gráfico XY"; + Text[ th ] = "à¹à¸œà¸™à¸ ูมิXY "; + Text[ ja ] = "散布図"; + Text[ ko ] = "XY 차트"; + Text[ zh-CN ] = "XY 图表"; + Text[ zh-TW ] = "XY-圖表"; + Text[ tr ] = "XY ÅŸeması"; + Text[ hi-IN ] = "XY चारà¥à¤Ÿ"; + Text[ ar ] = "رسم بياني س ص"; + Text[ he ] = "XY-Diagramm"; +}; +String STR_XYZ +{ + Text [ de ] = "XYZ-Diagramm" ; + Text [ en-US ] = "XYZ Chart" ; + Text[ pt ] = "Gráfico XYZ"; + Text[ ru ] = "Диаграмма XYZ"; + Text[ el ] = "ΔιάγÏαμμα XYZ"; + Text[ nl ] = "XYZ-diagram"; + Text[ fr ] = "Diagramme XYZ"; + Text[ es ] = "Diagrama XYZ"; + Text[ fi ] = "XYZ-kaavio"; + Text[ ca ] = "Diagrama XYZ"; + Text[ it ] = "Diagramma XYZ"; + Text[ da ] = "XYZ-diagram"; + Text[ sv ] = "XYZ-diagram"; + Text[ pl ] = "Wykres XYZ"; + Text[ pt-BR ] = "Gráfico XYZ"; + Text[ th ] = "à¹à¸œà¸™à¸ ูมิXYZ "; + Text[ ja ] = "XYZ軸図表"; + Text[ ko ] = "XYZ 차트"; + Text[ zh-CN ] = "XYZ 图表"; + Text[ zh-TW ] = "XYZ-圖表"; + Text[ tr ] = "XYZ ÅŸeması"; + Text[ hi-IN ] = "XYZ चारà¥à¤Ÿ "; + Text[ ar ] = "رسم بياني س ص ع"; + Text[ he ] = "XYZ-Diagramm"; +}; +String STR_NORMAL +{ + Text [ de ] = "Normal" ; + Text [ en-US ] = "Normal" ; + Text[ pt ] = "Normal"; + Text[ ru ] = "ОбычнаÑ"; + Text[ el ] = "Κανονικά"; + Text[ nl ] = "Normaal"; + Text[ fr ] = "Normal"; + Text[ es ] = "Normal"; + Text[ fi ] = "Normaali"; + Text[ ca ] = "Normal"; + Text[ it ] = "Normale"; + Text[ da ] = "Normal"; + Text[ sv ] = "Normal"; + Text[ pl ] = "ZwykÅ‚y"; + Text[ pt-BR ] = "Normal"; + Text[ th ] = "ปà¸à¸•à¸´"; + Text[ ja ] = "標準"; + Text[ ko ] = "표준"; + Text[ zh-CN ] = "一般"; + Text[ zh-TW ] = "一般"; + Text[ tr ] = "Normal"; + Text[ hi-IN ] = "नॉरà¥à¤®à¤²à¥"; + Text[ ar ] = "عادية"; + Text[ he ] = "Normal"; +}; +String STR_STACKED +{ + Text [ de ] = "Gestapelt" ; + Text [ en-US ] = "Stacked" ; + Text[ pt ] = "Empilhado"; + Text[ ru ] = "С накоплением"; + Text[ el ] = "Σε στοίβα"; + Text[ nl ] = "Gestapeld"; + Text[ fr ] = "Empilé"; + Text[ es ] = "En pilas"; + Text[ fi ] = "Pinottuna"; + Text[ ca ] = "Apilat"; + Text[ it ] = "Sovrapposto"; + Text[ da ] = "Stablet"; + Text[ sv ] = "Staplat"; + Text[ pl ] = "Skumulowany"; + Text[ pt-BR ] = "Empilhado"; + Text[ th ] = "à¸à¸à¸‡à¸‹à¹‰à¸à¸™"; + Text[ ja ] = "ç©ã¿ä¸Šã’"; + Text[ ko ] = "누ì ëœ"; + Text[ zh-CN ] = "é‡å "; + Text[ zh-TW ] = "é‡ç–Š"; + Text[ tr ] = "Yığılmış"; + Text[ hi-IN ] = "Stacked"; + Text[ ar ] = "متراكمة"; + Text[ he ] = "Gestapelt"; +}; +String STR_PERCENT +{ + Text [ de ] = "Prozent" ; + Text [ en-US ] = "Percent" ; + Text[ pt ] = "Percentual"; + Text[ ru ] = "ПроцентнаÑ"; + Text[ el ] = "Ποσοστό (%)"; + Text[ nl ] = "Procent"; + Text[ fr ] = "Pourcentage"; + Text[ es ] = "Porcentaje"; + Text[ fi ] = "Prosenttia"; + Text[ ca ] = "Percentatge"; + Text[ it ] = "Percentuale"; + Text[ da ] = "Procent"; + Text[ sv ] = "Procent"; + Text[ pl ] = "Procent"; + Text[ pt-BR ] = "Percentual"; + Text[ th ] = "เปà¸à¸£à¹Œà¹€à¸‹à¹‡à¸™à¸•à¹Œ"; + Text[ ja ] = "パーセント"; + Text[ ko ] = "백분율"; + Text[ zh-CN ] = "百分比"; + Text[ zh-TW ] = "百分比"; + Text[ tr ] = "Yüzde"; + Text[ hi-IN ] = "पà¥à¤°à¤¤à¤¿à¤¶à¤¤"; + Text[ ar ] = "النسبة المئوية"; + Text[ he ] = "Prozent"; +}; + +String STR_DEEP +{ + Text [ de ] = "Tief" ; + Text [ en-US ] = "Deep" ; + Text[ pt ] = "Fundo"; + Text[ ru ] = "Глубина"; + Text[ el ] = "Σε βάθος"; + Text[ nl ] = "met diepte"; + Text[ fr ] = "Profond"; + Text[ es ] = "Profundidad"; + Text[ fi ] = "Syvyys"; + Text[ ca ] = "Profund"; + Text[ it ] = "In profondità "; + Text[ da ] = "Dyb"; + Text[ sv ] = "Djup"; + Text[ pl ] = "GÅ‚Ä™boki"; + Text[ pt-BR ] = "Profundo"; + Text[ th ] = "ลึà¸"; + Text[ ja ] = "奥行ãã‚ã‚Š"; + Text[ ko ] = "깊ì´"; + Text[ zh-CN ] = "深度"; + Text[ zh-TW ] = "深度"; + Text[ tr ] = "Derin"; + Text[ hi-IN ] = "गहरा"; + Text[ ar ] = "عميقة"; + Text[ he ] = "Tief"; +}; + +String STR_2D +{ + Text [ de ] = "2D-" ; + Text [ en-US ] = "2D " ; + Text[ pt ] = "2D-"; + Text[ ru ] = "ДвумернаÑ"; + Text[ el ] = "2Δ-"; + Text[ nl ] = "2D-"; + Text[ fr ] = "2D-"; + Text[ es ] = "2D-"; + Text[ fi ] = "Kaksiulotteinen "; + Text[ ca ] = "2D "; + Text[ it ] = "2D-"; + Text[ da ] = "2D-"; + Text[ sv ] = "2D-"; + Text[ pl ] = "2D"; + Text[ pt-BR ] = "2D-"; + Text[ th ] = "2มิติ "; + Text[ ja ] = "2D"; + Text[ ko ] = "2D"; + Text[ zh-CN ] = "2 ç»´"; + Text[ zh-TW ] = "å¹³é¢"; + Text[ tr ] = "2B-"; + Text[ hi-IN ] = "2D "; + Text[ ar ] = "ثنائي الأبعاد"; + Text[ he ] = "2D-"; +}; +String STR_3D +{ + Text [ de ] = "3D-" ; + Text [ en-US ] = "3D " ; + Text[ pt ] = "3D-"; + Text[ ru ] = "ТрехмернаÑ"; + Text[ el ] = "3Δ-"; + Text[ nl ] = "3D-"; + Text[ fr ] = "3D-"; + Text[ es ] = "3D-"; + Text[ fi ] = "Kolmiulotteisuus "; + Text[ ca ] = "3D "; + Text[ it ] = "3D-"; + Text[ da ] = "3D-"; + Text[ sv ] = "3D-"; + Text[ pl ] = "3D"; + Text[ pt-BR ] = "3D-"; + Text[ th ] = "3มิติ "; + Text[ ja ] = "3D"; + Text[ ko ] = "3D"; + Text[ zh-CN ] = "3 ç»´"; + Text[ zh-TW ] = "3D"; + Text[ tr ] = "3B-"; + Text[ hi-IN ] = "3D "; + Text[ ar ] = "ثلاثي الأبعاد"; + Text[ he ] = "3D-"; +}; +String STR_DIAGRAM +{ + Text [ de ] = "Diagramm" ; + Text [ en-US ] = "Chart" ; + Text[ pt ] = "Gráfico"; + Text[ ru ] = "Диаграмма"; + Text[ el ] = "ΔιάγÏαμμα"; + Text[ nl ] = "Diagram"; + Text[ fr ] = "Diagramme"; + Text[ es ] = "Diagrama"; + Text[ fi ] = "Kaavio"; + Text[ ca ] = "Diagrama"; + Text[ it ] = "Diagramma"; + Text[ da ] = "Diagram"; + Text[ sv ] = "Diagram"; + Text[ pl ] = "Wykres"; + Text[ pt-BR ] = "Gráfico"; + Text[ th ] = "à¹à¸œà¸™à¸ ูมิ"; + Text[ ja ] = "グラフ"; + Text[ ko ] = "차트"; + Text[ zh-CN ] = "图表"; + Text[ zh-TW ] = "圖表"; + Text[ tr ] = "Åžema"; + Text[ hi-IN ] = "चारà¥à¤Ÿ "; + Text[ ar ] = "رسم بياني"; + Text[ he ] = "‮תרשי×‬"; +}; +String STR_DIAGRAM_ROW +{ + // $(ROW) can be a number or the caption of the row in quotes + Text [ de ] = "Datenreihe $(ROW)" ; + Text [ en-US ] = "Data Series $(ROW)" ; + Text[ pt ] = "Série de dados $(ROW)"; + Text[ ru ] = "Ð Ñд данных $(ROW)"; + Text[ el ] = "ΓÏαμμή δεδομÎνων $(ROW)"; + Text[ nl ] = "Gegevensreeks $(ROW)"; + Text[ fr ] = "Série de données $(ROW)"; + Text[ es ] = "Serie de datos $(ROW)"; + Text[ fi ] = "Tietojoukot $(ROW)"; + Text[ ca ] = "Sèrie de dades $(ROW)"; + Text[ it ] = "Serie di dati $(ROW)"; + Text[ da ] = "Dataserie $(ROW)"; + Text[ sv ] = "Dataserie $(ROW)"; + Text[ pl ] = "Seria danych $(ROW)"; + Text[ pt-BR ] = "Série de Dados $(ROW)"; + Text[ th ] = "ชุดข้à¸à¸¡à¸¹à¸¥ $(ROW)"; + Text[ ja ] = "系列$(ROW)"; + Text[ ko ] = "ì—°ì† ë°ì´í„° $(ROW)"; + Text[ zh-CN ] = "æ•°æ®ç»„ $(ROW)"; + Text[ zh-TW ] = "資料欄 $(ROW)"; + Text[ tr ] = "Veri dizisi $(ROW)"; + Text[ hi-IN ] = "ड़ॉटा शà¥à¤°à¥ƒà¤‚खला $(पकà¥à¤¤à¤¿à¤‚)"; + Text[ ar ] = "ص٠البيانات $(ROW)"; + Text[ he ] = "Datenreihe $(ROW)"; +}; + + + +String STR_DEFAULTVIEW +{ + Text [ de ] = "Default" ; + Text [ en-US ] = "Default" ; + Text[ pt ] = "Padrão"; + Text[ ru ] = "Стандарт"; + Text[ el ] = "Î Ïοεπιλογή"; + Text[ nl ] = "Standaard"; + Text[ fr ] = "Défaut"; + Text[ es ] = "Predeterminado"; + Text[ fi ] = "Oletus"; + Text[ ca ] = "Per defecte"; + Text[ it ] = "Predefinito"; + Text[ da ] = "Standard"; + Text[ sv ] = "Standard"; + Text[ pl ] = "DomyÅ›lnie"; + Text[ pt-BR ] = "Padrão"; + Text[ th ] = "ค่าเริ่มต้น"; + Text[ ja ] = "標準"; + Text[ ko ] = "기본값"; + Text[ zh-CN ] = "默认"; + Text[ zh-TW ] = "默èª"; + Text[ tr ] = "Standart"; + Text[ hi-IN ] = "अनà¥à¤ªà¤¸à¥à¤¥à¤¿à¤¤à¤¿"; + Text[ ar ] = "اÙتراضي"; + Text[ he ] = "‮ברירת מחדל‬"; +}; + +String STR_OPEN_DOCUMENT +{ + Text [ de ] = "Dokument laden" ; + Text [ en-US ] = "Load document" ; + Text[ pt ] = "Carregar documento"; + Text[ ru ] = "Загрузить документ"; + Text[ el ] = "ΦόÏτωση εγγÏάφου"; + Text[ nl ] = "Document laden"; + Text[ fr ] = "Charger un document"; + Text[ es ] = "Cargar documento"; + Text[ fi ] = "Lataa asiakirja"; + Text[ ca ] = "Carrega el document"; + Text[ it ] = "Apri documento"; + Text[ da ] = "Indlæs dokument"; + Text[ sv ] = "Ladda dokument"; + Text[ pl ] = "Åaduj dokument"; + Text[ pt-BR ] = "Carregar documento"; + Text[ th ] = "โหลดเà¸à¸à¸ªà¸²à¸£"; + Text[ ja ] = "ドã‚ュメントをèªã¿è¾¼ã‚€"; + Text[ ko ] = "문서 로드"; + Text[ zh-CN ] = "装入文档"; + Text[ zh-TW ] = "載入文件"; + Text[ tr ] = "Belge yükle"; + Text[ hi-IN ] = "Load document"; + Text[ ar ] = "تØميل المستند"; + Text[ he ] = "â€®×˜×¢×™× ×ª מסמך‬"; +}; +String STR_SAVE_DOCUMENT +{ + Text [ en-US ] = "Save document"; + Text [ de ] = "Dokument speichern" ; + Text [ en-US ] = "Save document" ; + Text [ de ] = "Dokument speichern" ; + Text[ pt ] = "Guardar documento"; + Text[ ru ] = "Сохранить документ"; + Text[ el ] = "Αποθήκευση εγγÏάφου"; + Text[ nl ] = "Document opslaan"; + Text[ fr ] = "Enregistrer le document"; + Text[ es ] = "Guardar documento"; + Text[ fi ] = "Tallenna asiakirja"; + Text[ ca ] = "Desa el document"; + Text[ it ] = "Salva documento"; + Text[ da ] = "Gem dokument"; + Text[ sv ] = "Spara dokument"; + Text[ pl ] = "Zapisz dokument"; + Text[ pt-BR ] = "Salvar documento"; + Text[ th ] = "บันทึà¸à¹€à¸à¸à¸ªà¸²à¸£"; + Text[ ja ] = "ドã‚ュメントã®ä¿å˜"; + Text[ ko ] = "문서 ì €ìž¥"; + Text[ zh-CN ] = "å˜ç›˜æ–‡æ¡£"; + Text[ zh-TW ] = "儲å˜æ–‡ä»¶"; + Text[ tr ] = "Belgeyi kaydet"; + Text[ hi-IN ] = "लेखपतà¥à¤° संचित करो"; + Text[ ar ] = "ØÙظ المستند"; + Text[ he ] = "Dokument speichern"; +}; +String STR_GRAPHIC +{ + Text [ de ] = "Chart" ; + Text [ en-US ] = "Chart" ; + Text[ pt ] = "Chart"; + Text[ ru ] = "Диаграмма"; + Text[ el ] = "ΔιάγÏαμμα"; + Text[ nl ] = "Chart"; + Text[ fr ] = "Diagramme"; + Text[ es ] = "Diagrama"; + Text[ fi ] = "Kaavio"; + Text[ ca ] = "Diagrama"; + Text[ it ] = "Diagramma"; + Text[ da ] = "Diagram"; + Text[ sv ] = "Chart"; + Text[ pl ] = "Wykres"; + Text[ pt-BR ] = "Gráfico"; + Text[ th ] = "à¹à¸œà¸™à¸ ูมิ"; + Text[ ja ] = "グラフ"; + Text[ ko ] = "차트"; + Text[ zh-CN ] = "图表"; + Text[ zh-TW ] = "圖表"; + Text[ tr ] = "Åžema"; + Text[ hi-IN ] = "चारà¥à¤Ÿ"; + Text[ ar ] = "رسم بياني"; + Text[ he ] = "‮תרשי×‬"; +}; +String STR_CHART_DOCUMENT +{ + Text [ de ] = "Diagramm" ; + Text [ en-US ] = "Chart" ; + Text[ pt ] = "Gráfico"; + Text[ ru ] = "Диаграмма"; + Text[ el ] = "ΔιάγÏαμμα"; + Text[ nl ] = "Diagram"; + Text[ fr ] = "Diagramme"; + Text[ es ] = "Diagrama"; + Text[ fi ] = "Kaavio"; + Text[ ca ] = "Diagrama"; + Text[ it ] = "Diagramma"; + Text[ da ] = "Diagram"; + Text[ sv ] = "Diagram"; + Text[ pl ] = "Wykres"; + Text[ pt-BR ] = "Gráfico"; + Text[ th ] = "à¹à¸œà¸™à¸ ูมิ"; + Text[ ja ] = "グラフ"; + Text[ ko ] = "차트"; + Text[ zh-CN ] = "图表"; + Text[ zh-TW ] = "圖表"; + Text[ tr ] = "Åžema"; + Text[ hi-IN ] = "चारà¥à¤Ÿ"; + Text[ ar ] = "رسم بياني"; + Text[ he ] = "‮תרשי×‬"; +}; +String STR_CHART_DOCUMENT_FULLTYPE_60 +{ + Text [ de ] = "%PRODUCTNAME 6.0 Diagramm" ; + Text [ en-US ] = "%PRODUCTNAME 6.0 Chart" ; + Text[ pt ] = "%PRODUCTNAME 6.0 Gráfico"; + Text[ ru ] = "Диаграмма %PRODUCTNAME 6.0"; + Text[ el ] = "%PRODUCTNAME 6.0 ΔιάγÏαμμα"; + Text[ nl ] = "%PRODUCTNAME 6.0 Diagram"; + Text[ fr ] = "%PRODUCTNAME 6.0 Diagramme"; + Text[ es ] = "%PRODUCTNAME 6.0 - Diagrama"; + Text[ fi ] = "%PRODUCTNAME 6.0 Chart"; + Text[ ca ] = "%PRODUCTNAME 6.0 Diagrama"; + Text[ it ] = "%PRODUCTNAME 6.0 Diagramma"; + Text[ da ] = "%PRODUCTNAME 6.0-diagram"; + Text[ sv ] = "%PRODUCTNAME 6.0 Diagram"; + Text[ pl ] = "%PRODUCTNAME 6.0 Chart"; + Text[ pt-BR ] = "%PRODUCTNAME 6.0 Chart"; + Text[ th ] = "à¹à¸œà¸™à¸ ูมิ%PRODUCTNAME 6.0 "; + Text[ ja ] = "%PRODUCTNAME 6.0 グラフ"; + Text[ ko ] = "%PRODUCTNAME 6.0 차트"; + Text[ zh-CN ] = "%PRODUCTNAME 6.0 图表"; + Text[ zh-TW ] = "%PRODUCTNAME 6.0 圖表"; + Text[ tr ] = "%PRODUCTNAME 6.0 Çizelgesi"; + Text[ hi-IN ] = "%PRODUCTNAME 6.0 चारà¥à¤Ÿ"; + Text[ ar ] = "رسم بياني %PRODUCTNAME 6.0"; + Text[ he ] = "%PRODUCTNAME 6.0 Diagramm"; +}; +String STR_CHART_DOCUMENT_FULLTYPE_50 +{ + Text [ de ] = "%PRODUCTNAME 5.0 Diagramm" ; + Text [ en-US ] = "%PRODUCTNAME 5.0 Chart" ; + Text[ pt ] = "Gráfico (%PRODUCTNAME 5.0)"; + Text[ ru ] = "Диаграмма %PRODUCTNAME 5.0"; + Text[ el ] = "ΔιάγÏαμμα (%PRODUCTNAME 5.0)"; + Text[ nl ] = "%PRODUCTNAME 5.0 diagram"; + Text[ fr ] = "%PRODUCTNAME 5.0 Diagramme"; + Text[ es ] = "%PRODUCTNAME 5.0 - Diagrama"; + Text[ fi ] = "%PRODUCTNAME 5.0 Chart"; + Text[ ca ] = "%PRODUCTNAME 5.0 Diagrama"; + Text[ it ] = "Diagramma %PRODUCTNAME 5.0"; + Text[ da ] = "%PRODUCTNAME 5.0 diagram"; + Text[ sv ] = "%PRODUCTNAME 5.0 Diagram"; + Text[ pl ] = "%PRODUCTNAME 5.0 Chart"; + Text[ pt-BR ] = "%PRODUCTNAME 5.0 Chart"; + Text[ th ] = "à¹à¸œà¸™à¸ ูมิ%PRODUCTNAME 5.0 "; + Text[ ja ] = "%PRODUCTNAME 5.0 グラフ"; + Text[ ko ] = "%PRODUCTNAME 5.0 차트"; + Text[ zh-CN ] = "%PRODUCTNAME 5.0 图表"; + Text[ zh-TW ] = "%PRODUCTNAME 5.0 圖表"; + Text[ tr ] = "%PRODUCTNAME 5.0 ÅŸeması"; + Text[ hi-IN ] = "%PRODUCTNAME 5.0 चारà¥à¤Ÿ"; + Text[ ar ] = "رسم بياني %PRODUCTNAME 5.0"; + Text[ he ] = "%PRODUCTNAME 5.0 Diagramm"; +}; +String STR_CHART_DOCUMENT_FULLTYPE_40 +{ + Text [ de ] = "%PRODUCTNAME 4.0 Diagramm" ; + Text [ en-US ] = "%PRODUCTNAME 4.0 Chart" ; + Text[ pt ] = "Gráfico (%PRODUCTNAME 4.0)"; + Text[ ru ] = "Диаграмма %PRODUCTNAME 4.0"; + Text[ el ] = "ΔιάγÏαμμα (%PRODUCTNAME 4.0)"; + Text[ nl ] = "%PRODUCTNAME 4.0 diagram"; + Text[ fr ] = "%PRODUCTNAME 4.0 Diagramme"; + Text[ es ] = "%PRODUCTNAME 4.0 - Diagrama"; + Text[ fi ] = "%PRODUCTNAME 4.0 Chart"; + Text[ ca ] = "%PRODUCTNAME 4.0 Diagrama"; + Text[ it ] = "Diagramma %PRODUCTNAME 4.0"; + Text[ da ] = "%PRODUCTNAME 4.0 diagram"; + Text[ sv ] = "%PRODUCTNAME 4.0 Diagram"; + Text[ pl ] = "%PRODUCTNAME 4.0 Chart"; + Text[ pt-BR ] = "%PRODUCTNAME 4.0 Chart"; + Text[ th ] = "à¹à¸œà¸™à¸ ูมิ%PRODUCTNAME 4.0 "; + Text[ ja ] = "%PRODUCTNAME 4.0 グラフ"; + Text[ ko ] = "%PRODUCTNAME 4.0 차트"; + Text[ zh-CN ] = "%PRODUCTNAME 4.0 图表"; + Text[ zh-TW ] = "%PRODUCTNAME 4.0 圖表"; + Text[ tr ] = "%PRODUCTNAME 4.0 ÅŸeması"; + Text[ hi-IN ] = "%PRODUCTNAME 4.0 चारà¥à¤Ÿ"; + Text[ ar ] = "رسم بياني %PRODUCTNAME 4.0"; + Text[ he ] = "%PRODUCTNAME 4.0 Diagramm"; +}; +String STR_CHART_DOCUMENT_FULLTYPE_31 +{ + Text [ de ] = "%PRODUCTNAME 3.0 Diagramm" ; + Text [ en-US ] = "%PRODUCTNAME 3.0 Chart" ; + Text[ pt ] = "Gráfico (%PRODUCTNAME 3.0)"; + Text[ ru ] = "Диаграмма %PRODUCTNAME 3.0"; + Text[ el ] = "ΔιάγÏαμμα (%PRODUCTNAME 3.0)"; + Text[ nl ] = "%PRODUCTNAME 3.0 diagram"; + Text[ fr ] = "%PRODUCTNAME 3.0 Diagramme"; + Text[ es ] = "%PRODUCTNAME 3.0 - Diagrama"; + Text[ fi ] = "%PRODUCTNAME 3.0 Chart"; + Text[ ca ] = "%PRODUCTNAME 3.0 Diagrama"; + Text[ it ] = "Diagramma %PRODUCTNAME 3.0"; + Text[ da ] = "%PRODUCTNAME 3.0 diagram"; + Text[ sv ] = "%PRODUCTNAME 3.0 Diagram"; + Text[ pl ] = "%PRODUCTNAME 3.0 Chart"; + Text[ pt-BR ] = "%PRODUCTNAME 3.0 Chart"; + Text[ th ] = "à¹à¸œà¸™à¸ ูมิ%PRODUCTNAME 3.0 "; + Text[ ja ] = "%PRODUCTNAME 3.0 グラフ"; + Text[ ko ] = "%PRODUCTNAME 3.0 차트"; + Text[ zh-CN ] = "%PRODUCTNAME 3.0 图表"; + Text[ zh-TW ] = "%PRODUCTNAME 3.0 圖表"; + Text[ tr ] = "%PRODUCTNAME 3.0 ÅŸeması"; + Text[ hi-IN ] = "%PRODUCTNAME 3.0 चारà¥à¤Ÿ"; + Text[ ar ] = "رسم بياني %PRODUCTNAME 3.0"; + Text[ he ] = "%PRODUCTNAME 3.0 Diagramm"; +}; +String STR_BAD_PASSWORD_OR_FILE_CORRUPTED +{ + Text [ de ] = "Das Kennwort ist falsch oder die Datei beschädigt." ; + Text [ en-US ] = "The password is incorrect or the file is damaged." ; + Text[ pt ] = "Ou a senha está incorrecta ou o ficheiro danificado."; + Text[ ru ] = "Ðеправильный пароль или файл поврежден."; + Text[ el ] = "Ο κωδικός Ï€Ïόσβασης είναι εσφαλμÎνος ή το αÏχείο ελαττωματικό."; + Text[ nl ] = "Het wachtwoord is niet juist of het bestand is beschadigd"; + Text[ fr ] = "Le mot de passe est incorrect ou le fichier est défectueux."; + Text[ es ] = "La contraseña no es válida o el archivo está dañado."; + Text[ fi ] = "Salasana on virheellinen tai tiedosto on vahingoittunut."; + Text[ ca ] = "La contrasenya no és correcta o el fitxer està danyat."; + Text[ it ] = "La password è errata o il file è danneggiato."; + Text[ da ] = "Adgangskoden er forkert eller filen er beskadiget."; + Text[ sv ] = "Lösenordet är felaktigt eller filen skadad."; + Text[ pl ] = "NieprawidÅ‚owe hasÅ‚o lub uszkodzony plik."; + Text[ pt-BR ] = "A senha é invalida ou o arquivo está corrompido."; + Text[ th ] = "รหัสผ่านไม่ถูà¸à¸•à¹‰à¸à¸‡à¸«à¸£à¸·à¸à¹à¸Ÿà¹‰à¸¡à¹€à¸ªà¸µà¸¢à¸«à¸²à¸¢"; + Text[ ja ] = "パスワードãŒé–“é•ã£ã¦ã„ã‚‹ã‹ã€ã¾ãŸã¯ãƒ•ã‚¡ã‚¤ãƒ«ã«å•é¡ŒãŒã‚ã‚Šã¾ã™ã€‚"; + Text[ ko ] = "암호가 틀리거나 파ì¼ì´ ì†ìƒë˜ì—ˆìŠµë‹ˆë‹¤."; + Text[ zh-CN ] = "æ— æ•ˆçš„å¯†ç 或文件已ç»è¢«æŸå。"; + Text[ zh-TW ] = "無效的密碼或檔案已經被æ壞。"; + Text[ tr ] = "Åžifre yanlış veya dosya zarar görmüş."; + Text[ hi-IN ] = "The password is incorrect or the file is damaged."; + Text[ ar ] = "إما أن كلمة السر غير صØÙŠØØ© أو أن المل٠تالÙ."; + Text[ he ] = "Das Kennwort ist falsch oder die Datei beschädigt."; +}; + + +String STR_REGRESSION_LINEAR +{ + Text [ de ] = "Lineare Regression" ; + Text [ en-US ] = "Linear regression" ; + Text[ pt ] = "Regressão linear"; + Text[ ru ] = "Ð›Ð¸Ð½ÐµÐ¹Ð½Ð°Ñ Ñ€ÐµÐ³Ñ€ÐµÑÑиÑ"; + Text[ el ] = "ΓÏαμμική παλινδÏόμηση"; + Text[ nl ] = "Lineaire regressie"; + Text[ fr ] = "Régression linéaire"; + Text[ es ] = "Regresión lineal"; + Text[ fi ] = "Lineaarinen regressio"; + Text[ ca ] = "Regressió lineal"; + Text[ it ] = "Regressione lineare"; + Text[ da ] = "Lineær regression"; + Text[ sv ] = "Linjär regression"; + Text[ pl ] = "Regresja liniowa"; + Text[ pt-BR ] = "Regressão linear"; + Text[ th ] = "ถดถà¸à¸¢à¹à¸šà¸šà¹€à¸ªà¹‰à¸™à¸•à¸£à¸‡"; + Text[ ja ] = "線形回帰"; + Text[ ko ] = "ì„ íšŒê·€ì„ "; + Text[ zh-CN ] = "ç‰å·®å›žå½’"; + Text[ zh-TW ] = "ç‰å·®å›žæ¸"; + Text[ tr ] = "DoÄŸrusal regresyon"; + Text[ hi-IN ] = "Linear regression"; + Text[ ar ] = "انØدار خطي"; + Text[ he ] = "Lineare Regression"; +}; +String STR_REGRESSION_LOG +{ + Text [ de ] = "Logarithmische Regression" ; + Text [ en-US ] = "Logarithm regression" ; + Text[ pt ] = "Regressão logarÃtmica"; + Text[ ru ] = "ЛогарифмичеÑÐºÐ°Ñ Ñ€ÐµÐ³Ñ€ÐµÑÑиÑ"; + Text[ el ] = "ΛογαÏιθμική παλινδÏόμηση"; + Text[ nl ] = "Logaritmische regressie"; + Text[ fr ] = "Régression logarithmique"; + Text[ es ] = "Regresión logarÃtmica"; + Text[ fi ] = "Logaritminen regressio"; + Text[ ca ] = "Regressió logarÃtmica"; + Text[ it ] = "Regressione logaritmica"; + Text[ da ] = "Logaritmisk regression"; + Text[ sv ] = "Logaritmisk regression"; + Text[ pl ] = "Regresja logarytmiczna"; + Text[ pt-BR ] = "Regressão logarÃtmica"; + Text[ th ] = "ถดถà¸à¸¢à¹à¸šà¸šà¸¥à¸à¸à¸²à¸£à¸´à¸˜à¸¶à¸¡"; + Text[ ja ] = "対数ã®å›žå¸°"; + Text[ ko ] = "로그 íšŒê·€ì„ "; + Text[ zh-CN ] = "对数回归"; + Text[ zh-TW ] = "å°æ•¸å›žæ¸"; + Text[ tr ] = "Logaritmik regresyon"; + Text[ hi-IN ] = "लघà¥à¤—णक रिगà¥à¤°à¥‡à¤¶à¥à¤¯à¤¨"; + Text[ ar ] = "انØدار لوغاريتمي"; + Text[ he ] = "Logarithmische Regression"; +}; +String STR_REGRESSION_EXP +{ + Text [ de ] = "Exponentielle Regression" ; + Text [ en-US ] = "Exponential Regression" ; + Text[ pt ] = "Regressão exponencial"; + Text[ ru ] = "ÐкÑÐ¿Ð¾Ð½ÐµÐ½Ñ†Ð¸Ð°Ð»ÑŒÐ½Ð°Ñ Ñ€ÐµÐ³Ñ€ÐµÑÑиÑ"; + Text[ el ] = "Εκθετική παλινδÏόμηση"; + Text[ nl ] = "Exponentiële regressie"; + Text[ fr ] = "Régression exponentielle"; + Text[ es ] = "Regresión exponencial"; + Text[ fi ] = "Eksponentiaalinen regressio"; + Text[ ca ] = "Regressió exponencial"; + Text[ it ] = "Regressione esponenziale"; + Text[ da ] = "Eksponentiel regression"; + Text[ sv ] = "Exponentiell regression"; + Text[ pl ] = "Regresja wykÅ‚adnicza"; + Text[ pt-BR ] = "Regressão exponencial"; + Text[ th ] = "ถดถà¸à¸¢à¹à¸šà¸šà¹€à¸à¹‡à¸à¸‹à¹Œà¹‚ปเนนเชียล"; + Text[ ja ] = "指数ã®å›žå¸°"; + Text[ ko ] = "지수 íšŒê·€ì„ "; + Text[ zh-CN ] = "指数回归"; + Text[ zh-TW ] = "指數回æ¸"; + Text[ tr ] = "Ãœstel regresyon"; + Text[ hi-IN ] = "Exponential Regression"; + Text[ ar ] = "انØدار أسي"; + Text[ he ] = "Exponentielle Regression"; +}; +String STR_REGRESSION_POWER +{ + Text [ de ] = "Potenzielle Regression" ; + Text [ en-US ] = "Power regression" ; + Text[ pt ] = "Regressão potencial"; + Text[ ru ] = "ÐŸÐ¾Ñ‚ÐµÐ½Ñ†Ð¸Ð°Ð»ÑŒÐ½Ð°Ñ Ñ€ÐµÐ³Ñ€ÐµÑÑиÑ"; + Text[ el ] = "Δυναμική παλινδÏόμηση"; + Text[ nl ] = "Potentiële regressie"; + Text[ fr ] = "Régression potentielle"; + Text[ es ] = "Regresión potencial"; + Text[ fi ] = "Polynomiregressio"; + Text[ ca ] = "Regressió potencial"; + Text[ it ] = "Regressione potenziale"; + Text[ da ] = "Potentiel regression"; + Text[ sv ] = "Potentiell regression"; + Text[ pl ] = "Regresja potÄ™gowa"; + Text[ pt-BR ] = "Regressão de potência"; + Text[ th ] = "à¸à¸³à¸¥à¸±à¸‡à¸à¸²à¸£à¸–ดถà¸à¸¢"; + Text[ ja ] = "乗羃ã®å›žå¸°"; + Text[ ko ] = "í¼í…ì…œíšŒê·€ì„ "; + Text[ zh-CN ] = "ä½èƒ½å›žå½’"; + Text[ zh-TW ] = "指數回æ¸"; + Text[ tr ] = "Kuvvet regresyonu"; + Text[ hi-IN ] = "पवर रिगà¥à¤°à¥‡à¤¶à¥à¤¯à¤¨"; + Text[ ar ] = "انØدار القدرة"; + Text[ he ] = "Potenzielle Regression"; +}; + +String STR_STATISTICS_IN_LEGEND +{ + // comment + Text [ x-comment ] = "BM: This determines how a statistics string (STR_REGRESSION_...) appears in the legend, e.g. in german \"Lineare Regression, Spalte 3\" will appear for \"$(STATTYP), $(ROWNAME)\""; + // comment + Text [ de ] = "$(STATTYP), $(ROWNAME)"; + Text [ en-US ] = "$(STATTYP), $(ROWNAME) " ; + Text[ pt ] = "$(STATTYP), $(ROWNAME)"; + Text[ ru ] = "$(STATTYP), $(ROWNAME)"; + Text[ el ] = "$(STATTYP), $(ROWNAME)"; + Text[ nl ] = "$(STATTYP), $(ROWNAME)"; + Text[ fr ] = "$(STATTYP), $(ROWNAME)"; + Text[ es ] = "$(STATTYP), $(ROWNAME)"; + Text[ fi ] = "$(STATTYP), $(ROWNAME) "; + Text[ ca ] = "$(STATTYP), $(ROWNAME) "; + Text[ it ] = "$(STATTYP), $(ROWNAME)"; + Text[ da ] = "$(STATTYP), $(ROWNAME)"; + Text[ sv ] = "$(STATTYP), $(ROWNAME)"; + Text[ pl ] = "$(STATTYP), $(ROWNAME)"; + Text[ pt-BR ] = "$(STATTYP), $(ROWNAME)"; + Text[ th ] = "$(STATTYP), $(ROWNAME) "; + Text[ ja ] = "$(STATTYP)ã€$(ROWNAME)"; + Text[ ko ] = "$(STATTYP), $(ROWNAME)"; + Text[ zh-CN ] = "$(STATTYP), $(ROWNAME)"; + Text[ zh-TW ] = "$(STATTYP), $(ROWNAME)"; + Text[ tr ] = "$(STATTYP), $(ROWNAME)"; + Text[ hi-IN ] = "$(STATTYP), $(ROWNAME) "; + Text[ ar ] = "$(STATTYP), $(ROWNAME)"; + Text[ he ] = "$(STATTYP), $(ROWNAME) "; +}; + + + + + +//----------------------------------- + +//----------------------------------- + +//----------------------------------- + +//----------------------------------- +//----------------------------------- +//----------------------------------- + + +// some strings merged using arguments now + + + + +// some more strings for QuickHelp + + + + + + + + + + + +//----------------------------------- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/binfilter/bf_sch/source/ui/app/sch_typemap.cxx b/binfilter/bf_sch/source/ui/app/sch_typemap.cxx new file mode 100644 index 000000000000..2d2aa21748c3 --- /dev/null +++ b/binfilter/bf_sch/source/ui/app/sch_typemap.cxx @@ -0,0 +1,117 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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. + * + ************************************************************************/ + + +#ifdef _MSC_VER +#pragma hdrstop +#endif + +#include <bf_svx/eeitem.hxx> + +#include "eetext.hxx" +#include <bf_svx/fontitem.hxx> +#include <bf_svx/postitem.hxx> +#include <bf_svx/wghtitem.hxx> +#include <bf_svx/shdditem.hxx> +#include <bf_svx/cntritem.hxx> +#include <bf_svx/crsditem.hxx> +#include <bf_svx/udlnitem.hxx> +#include <bf_svx/fhgtitem.hxx> +#include <bf_svx/colritem.hxx> + +#include <bf_svx/svxids.hrc> + +#define ITEMID_FMTSPLIT 0 +#define ITEMID_PAGEMODEL 0 +#include "eetext.hxx" + +#define ITEMID_LINE 0 +#define ITEMID_BRUSH 0 +#define ITEMID_FMTBREAK 0 +#define ITEMID_FMTKEEP 0 +#define ITEMID_SIZE 0 +#include <bf_svx/sizeitem.hxx> + +#define ITEMID_PAGE 0 + + +#include <bf_svtools/stritem.hxx> + +#define ITEMID_AUTHOR 0 +#define ITEMID_DATE 0 +#define ITEMID_TEXT 0 + +#define ITEMID_SEARCH 0 + +#define ITEMID_HORJUSTIFY 0 +#define ITEMID_VERJUSTIFY 0 +#define ITEMID_ORIENTATION 0 + +#include <bf_svx/zoomitem.hxx> + +#define ITEMID_CHARTSTYLE 0 +#include <bf_svx/chrtitem.hxx> + +#include <bf_sfx2/msg.hxx> + +namespace binfilter { + +/*?*/ typedef SfxVoidItem CharSetItem; +/*?*/ typedef SfxVoidItem FontFamilyItem; +/*?*/ typedef SfxVoidItem FontPitchItem; +/*?*/ typedef SfxVoidItem FontAlignItem; +/*?*/ typedef SfxVoidItem FontWeightItem; +/*?*/ typedef SfxVoidItem FontUnderlineItem; +/*?*/ typedef SfxVoidItem FontStrikeoutItem; +/*?*/ typedef SfxVoidItem FontItalicItem; +/*?*/ typedef SfxVoidItem SvxDbTypeItem; +/*?*/ typedef SfxVoidItem SvxLineSpaceItem; +/*?*/ typedef SfxVoidItem SvxInterLineSpaceItem; +/*?*/ typedef SfxVoidItem SvxBreakItem; +/*?*/ typedef SfxVoidItem BrushStyleItem; +/*?*/ typedef SfxVoidItem SvxNumTypeItem; +/*?*/ typedef SfxVoidItem SvxShadowLocationItem; +/*?*/ typedef SfxVoidItem SvxChooseControlEnumItem; +/*?*/ typedef SfxVoidItem SvxDrawToolEnumItem; +/*?*/ typedef SfxVoidItem SvxChooseControlItem; +/*?*/ typedef SfxVoidItem SvxDrawToolItem; +/*?*/ typedef SfxVoidItem SvxCellHorJustifyEnumItem; +/*?*/ typedef SfxVoidItem SvxCellVerJustifyEnumItem; +/*?*/ typedef SfxVoidItem SvxCellOrientationEnumItem; +/*?*/ typedef SfxEnumItem SvxStyleTypeItem; + +#define SFX_TYPEMAP +#include "schslots.hxx" + + + + + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/docshell/makefile.mk b/binfilter/bf_sch/source/ui/docshell/makefile.mk new file mode 100644 index 000000000000..4b572861acb5 --- /dev/null +++ b/binfilter/bf_sch/source/ui/docshell/makefile.mk @@ -0,0 +1,61 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# 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. +# +#************************************************************************* + +EXTERNAL_WARNINGS_NOT_ERRORS := TRUE +PRJ=..$/..$/..$/.. +BFPRJ=..$/..$/.. + +PROJECTPCH=sch +PROJECTPCHSOURCE=$(BFPRJ)$/util$/sch_sch + +PRJNAME=binfilter +TARGET=sch_docshell + +#GEN_HID=TRUE +#GEN_HID_OTHER=TRUE +NO_HIDS=TRUE + +ENABLE_EXCEPTIONS = TRUE + +# --- Settings ----------------------------------------------------- +.INCLUDE : settings.mk +INC+= -I$(PRJ)$/inc$/bf_sch +# --- Files -------------------------------------------------------- + +CXXFILES = $(BFPRJ)$/util$/sch_sch.cxx \ + sch_docshell.cxx \ + sch_docshel1.cxx + +SLOFILES = \ + $(SLO)$/sch_docshell.obj \ + $(SLO)$/sch_docshel1.obj + + +# --- Targets ------------------------------------------------------- + +.INCLUDE : target.mk + diff --git a/binfilter/bf_sch/source/ui/docshell/sch_docshel1.cxx b/binfilter/bf_sch/source/ui/docshell/sch_docshel1.cxx new file mode 100644 index 000000000000..9109aef3388f --- /dev/null +++ b/binfilter/bf_sch/source/ui/docshell/sch_docshel1.cxx @@ -0,0 +1,192 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 _SVX_SVXIDS_HRC +#define ITEMID_FONTLIST SID_ATTR_CHAR_FONTLIST +#define ITEMID_NUMBERINFO SID_ATTR_NUMBERFORMAT_INFO +#define ITEMID_COLOR_TABLE SID_COLOR_TABLE +#define ITEMID_GRADIENT_LIST SID_GRADIENT_LIST +#define ITEMID_HATCH_LIST SID_HATCH_LIST +#define ITEMID_BITMAP_LIST SID_BITMAP_LIST +#define ITEMID_DASH_LIST SID_DASH_LIST +#define ITEMID_LINEEND_LIST SID_LINEEND_LIST +#include <bf_svx/svxids.hrc> +#endif + +#include <bf_sfx2/app.hxx> + +#include "app.hrc" +#include "strings.hrc" +#include "res_bmp.hrc" +#include "docshell.hxx" + +namespace binfilter { + +/************************************************************************* +|* +|* Zeichnen der DocShell (mittels der Hilfsklasse SchViewSpecial) +|* +\************************************************************************/ + + + + +/************************************************************************* +|* +|* +|* +\************************************************************************/ + + +/************************************************************************* +|* +|* Bitmap der StyleFamily zurueckgeben (zunaechst Dummy) +|* +\************************************************************************/ + +/*N*/ SfxStyleSheetBasePool* SchChartDocShell::GetStyleSheetPool() throw() +/*N*/ { +/*N*/ return (SfxStyleSheetBasePool*)pChDoc->GetStyleSheetPool(); +/*N*/ } + +/************************************************************************* +|* +|* Vorlage einfuegen (zunaechst nur Dummy) +|* +\************************************************************************/ + + +/************************************************************************* +|* +|* Vorlage entfernen (zunaechst nur Dummy) +|* +\************************************************************************/ + + +/************************************************************************* +|* +|* Chart updaten +|* +\************************************************************************/ + + +/************************************************************************* +|* +|* +|* +\************************************************************************/ + +/*N*/ Rectangle SchChartDocShell::GetVisArea(USHORT nAspect) const throw() +/*N*/ { +/*N*/ return SfxInPlaceObject::GetVisArea((nAspect == ASPECT_THUMBNAIL) ? +/*N*/ ASPECT_CONTENT : nAspect); +/*N*/ } + +/************************************************************************* +|* +|* VisArea fuer InPlace setzen +|* +\************************************************************************/ + +/*N*/ void SchChartDocShell::SetVisArea(const Rectangle& rRect) throw() +/*N*/ { +/*N*/ Rectangle aRect(rRect); +/*N*/ aRect.SetPos(Point(0, 0)); +/*N*/ +/*N*/ if( GetCreateMode() == SFX_CREATE_MODE_EMBEDDED ) +/*N*/ { +/*N*/ // sets the modified flag +/*N*/ SfxInPlaceObject::SetVisArea( rRect ); +/*N*/ +/*N*/ // #107434# propagate modified status to changed status at model +/*N*/ if( pChDoc && IsModified() ) +/*N*/ pChDoc->SetChanged( TRUE ); +/*N*/ } +/*N*/ else +/*N*/ { +/*N*/ // does not set the modified flag +/*?*/ SvEmbeddedObject::SetVisArea( rRect ); +/*N*/ } +/*N*/ +/*N*/ if( GetCreateMode() != SFX_CREATE_MODE_INTERNAL ) +/*N*/ { +/*N*/ Size aSize; +/*N*/ +/*N*/ if (rRect.IsEmpty ()) +/*N*/ aSize = Size (); +/*N*/ else +/*N*/ aSize = GetVisArea(ASPECT_CONTENT).GetSize(); +/*N*/ +/*N*/ SdrPage* pPage = pChDoc->GetPage(0); +/*N*/ +/*N*/ if(aSize.Width() > 0 && aSize.Height() > 0) +/*N*/ { +/*N*/ if( !pPage || aSize != pPage->GetSize() ) +/*N*/ { +/*N*/ pChDoc->ResizePage(aSize); +/*N*/ +/*N*/ // notify the controller +/*N*/ // note: the controller is only available in in-place +/*N*/ // Broadcast( SchVisAreaChangedHint( rRect ) ); +/*N*/ } +/*N*/ } +/*N*/ } +/*N*/ } + +/************************************************************************* +|* +|* OLE-Status +|* +\************************************************************************/ + +/*N*/ ULONG SchChartDocShell::GetMiscStatus() const throw() +/*N*/ { +/*N*/ // Chart soll stets selber resizen +/*N*/ ULONG nStatus = SfxInPlaceObject::GetMiscStatus() | +/*N*/ SVOBJ_MISCSTATUS_SERVERRESIZE | +/*N*/ SVOBJ_MISCSTATUS_RESIZEONPRINTERCHANGE; +/*N*/ +/*N*/ return nStatus; +/*N*/ } + +/*N*/ void SchChartDocShell::SetModified( BOOL bModified ) throw() +/*N*/ { +/*N*/ if( IsEnableSetModified() ) +/*N*/ { +/*N*/ SfxInPlaceObject::SetModified( bModified ); +/*N*/ DBG_ASSERT( pChDoc, "Invalid ChartModel" ); +/*N*/ if( ! pChDoc->IsLockedBuild()) +/*N*/ Broadcast( SfxSimpleHint( SFX_HINT_DOCCHANGED ) ); +/*N*/ } +/*N*/ } + + + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/docshell/sch_docshell.cxx b/binfilter/bf_sch/source/ui/docshell/sch_docshell.cxx new file mode 100644 index 000000000000..c33fe7df87a9 --- /dev/null +++ b/binfilter/bf_sch/source/ui/docshell/sch_docshell.cxx @@ -0,0 +1,1072 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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. + * + ************************************************************************/ + +#define ITEMID_FONTLIST SID_ATTR_CHAR_FONTLIST +#define ITEMID_NUMBERINFO SID_ATTR_NUMBERFORMAT_INFO +#define ITEMID_COLOR_TABLE SID_COLOR_TABLE +#define ITEMID_GRADIENT_LIST SID_GRADIENT_LIST +#define ITEMID_HATCH_LIST SID_HATCH_LIST +#define ITEMID_BITMAP_LIST SID_BITMAP_LIST +#define ITEMID_DASH_LIST SID_DASH_LIST +#define ITEMID_LINEEND_LIST SID_LINEEND_LIST + +#include <sot/formats.hxx> +#include <bf_sfx2/app.hxx> +#include <bf_svx/svxids.hrc> +#include <comphelper/classids.hxx> +#include <bf_sfx2/printer.hxx> +#include <bf_svtools/ctrltool.hxx> +#include <bf_sfx2/progress.hxx> +#include <bf_svtools/sfxecode.hxx> +#include <bf_svx/drawitem.hxx> +#include <bf_svtools/style.hxx> +#include <bf_svtools/saveopt.hxx> +#include <bf_svtools/pathoptions.hxx> +#include <bf_svx/svxids.hrc> +#include <rtl/logfile.hxx> + +#include "app.hrc" +#include "strings.hrc" +#include "res_bmp.hrc" +#include "schresid.hxx" +#include "schview.hxx" +#include "schmod.hxx" + +#include "ChXChartDocument.hxx" +#include "ChXChartData.hxx" +#include "SchXMLWrapper.hxx" +#include "memchrt.hxx" + +namespace binfilter { + +#define POOL_BUFFER_SIZE (USHORT)32768 +#define BASIC_BUFFER_SIZE (USHORT)8192 +#define DOCUMENT_BUFFER_SIZE (USHORT)32768 + +#define SCH_STYLE_SHEET_NAME String( RTL_CONSTASCII_USTRINGPARAM( "SfxStyleSheets" )) + +#define SCH_DEFAULT_CHART_SIZE_WIDTH 8000 +#define SCH_DEFAULT_CHART_SIZE_HEIGHT 7000 + +using namespace ::com::sun::star::uno; + + +// STATIC DATA ----------------------------------------------------------- + +static const String __FAR_DATA aStarChartDoc = String( RTL_CONSTASCII_USTRINGPARAM( "StarChartDocument" )); + +//---------------------------------------------------------------------- + +/************************************************************************* +|* +|* SFX-Slotmaps und -Definitionen +|* +\************************************************************************/ + + +namespace +{ + +/** This class sets EnableSetModified( TRUE ) in the CTOR, and + EnableSetModified( FALSE ) in the DTOR. Thus, this can be used to safeld do + changes at the model without resulting in a modification. + */ +class lcl_NoModificationGuard +{ +public: + lcl_NoModificationGuard( SvPersist * pPersist ) : + m_pPersist( pPersist ), + m_bModifyingWasEnabled( pPersist ? pPersist->IsEnableSetModified() : FALSE ) + { + if( m_bModifyingWasEnabled && + m_pPersist ) + m_pPersist->EnableSetModified( FALSE ); + } + + ~lcl_NoModificationGuard() + { + if( m_bModifyingWasEnabled && + m_pPersist ) + m_pPersist->EnableSetModified( TRUE ); + } + +private: + SvPersist * m_pPersist; + BOOL m_bModifyingWasEnabled; +}; +} + +using namespace ::com::sun::star; + +/*N*/ SFX_IMPL_OBJECTFACTORY_DLL(SchChartDocShell, schart, +/*N*/ SvGlobalName(BF_SO3_SCH_CLASSID), Sch) + +/*N*/ TYPEINIT1(SchChartDocShell, SfxObjectShell); + +/************************************************************************* +|* +|* shared construction - used by internal CTOR and InitNew +|* +\************************************************************************/ + +/*N*/ void SchChartDocShell::Construct() throw() +/*N*/ { +/*N*/ DBG_ASSERT( pChDoc, "SchChartDocShell::Construct() called with no valid model!" ); +/*N*/ //Wird fuer die ModelCollection benoetigt +/*N*/ SetPool(&pChDoc->GetItemPool()); +/*N*/ if( pUndoManager ) +/*?*/ delete pUndoManager; +/*N*/ pUndoManager = new SfxUndoManager; +/*N*/ +/*N*/ // Listen, bzw. Tables im ItemSet der DocShell anlegen +/*N*/ UpdateTablePointers(); +/*N*/ +/*N*/ if (pChDoc->GetPageCount() == 0L) +/*N*/ { +/*N*/ // Seite einfuegen +/*N*/ SdrPage* pPage = pChDoc->AllocPage(FALSE); +/*N*/ pPage->SetSize(GetVisArea(ASPECT_CONTENT).GetSize()); +/*N*/ pChDoc->InsertPage(pPage); +/*N*/ } +/*N*/ +/*N*/ // #i2914# remove menu item for 'Save Copy as...' +/*N*/ SvVerbList * pVerbList = new SvVerbList( GetVerbList() ); +/*N*/ +/*N*/ ULONG nCount = pVerbList->Count(); +/*N*/ ULONG i = 0; +/*N*/ for( ; i < nCount; ++i ) +/*N*/ { +/*N*/ // The Id 3 is the verb for 'Save Copy as...' +/*N*/ if( pVerbList->GetObject( i ).GetId() == 3 ) +/*N*/ { +/*N*/ pVerbList->Remove( i ); +/*N*/ break; +/*N*/ } +/*N*/ } +/*N*/ SetVerbList( pVerbList, TRUE ); +/*N*/ +/*N*/ } + +/*N*/ void SchChartDocShell::DataModified( chart::ChartDataChangeEvent& aEvent ) throw() +/*N*/ { +/*N*/ uno::Reference< chart::XChartDocument > xChartDoc( GetModel(), uno::UNO_QUERY ); +/*N*/ if( xChartDoc.is() ) +/*N*/ { +/*N*/ uno::Reference< chart::XChartData > xData = xChartDoc->getData(); +/*N*/ if( xData.is() ) +/*N*/ { +/*N*/ ChXChartData* pChXData = ChXChartData::getImplementation( xData ); +/*N*/ if( pChXData ) +/*N*/ { +/*N*/ pChXData->DataModified( aEvent ); +/*N*/ } +/*N*/ } +/*N*/ } +/*N*/ } + + +/************************************************************************* +|* +|* Default CTOR - this one is called by the factory from SFX +|* +\************************************************************************/ + +/*N*/ SchChartDocShell::SchChartDocShell(SfxObjectCreateMode eMode) throw() : +/*N*/ SfxObjectShell(eMode), +/*N*/ pUndoManager(NULL), +/*N*/ pPrinter(NULL), +/*N*/ pFontList(NULL), +/*N*/ pChDoc(NULL), +/*N*/ bInitNewNoNewDoc(FALSE), +/*N*/ bOwnPrinter(FALSE), +/*N*/ mbClipboardExport( FALSE ) +/*N*/ { +/*N*/ CHART_TRACE( "SchChartDocShell::SchChartDocShell(SfxObjectCreateMode)" ); +/*N*/ SetShell(this); +/*N*/ SetModel( new ChXChartDocument( this )); +/*N*/ } + +/************************************************************************* +|* +|* CTOR used by dragserver +|* +\************************************************************************/ + + +/************************************************************************* +|* +|* Destruktor +|* +\************************************************************************/ + +/*N*/ SchChartDocShell::~SchChartDocShell() throw() +/*N*/ { +/*N*/ CHART_TRACE( "SchChartDocShell::~SchChartDocShell" ); +/*N*/ +/*N*/ delete pFontList; +/*N*/ +/*N*/ delete pUndoManager; +/*N*/ +/*N*/ if( pChDoc ) +/*N*/ { +/*N*/ pChDoc->ClearUndoBuffer(); // clear draw undo actions +/*N*/ pChDoc->SetMaxUndoActionCount( 1 ); // don't add further undo actions +/*N*/ } +/*N*/ +/*N*/ if(bOwnPrinter) +/*N*/ delete pPrinter; +/*N*/ +/*N*/ delete pChDoc; +/*N*/ } + +/*N*/ SfxUndoManager* SchChartDocShell::GetUndoManager() throw() +/*N*/ { +/*N*/ return pUndoManager; +/*N*/ } + +/************************************************************************* +|* +|* SfxPrinter ggf. erzeugen und zurueckgeben +|* +\************************************************************************/ +/*N*/ SfxPrinter* SchChartDocShell::GetPrinter() throw() +/*N*/ { +/*N*/ if (!pPrinter) +/*N*/ { +/*N*/ SfxBoolItem aItem(SID_PRINTER_NOTFOUND_WARN, TRUE); +/*N*/ // ItemSet mit speziellem Poolbereich anlegen +/*N*/ SfxItemSet* pSet = new SfxItemSet(GetPool(), +/*N*/ SID_PRINTER_NOTFOUND_WARN, +/*N*/ SID_PRINTER_NOTFOUND_WARN, 0); +/*N*/ pSet->Put(aItem); +/*N*/ pPrinter = new SfxPrinter(pSet); +/*N*/ bOwnPrinter = TRUE; +/*N*/ +/*N*/ MapMode aMapMode = pPrinter->GetMapMode(); +/*N*/ aMapMode.SetMapUnit(MAP_100TH_MM); +/*N*/ pPrinter->SetMapMode(aMapMode); +/*N*/ +/*N*/ if (pChDoc) +/*N*/ { +/*N*/ if (pPrinter != pChDoc->GetRefDevice()) +/*N*/ pChDoc->SetRefDevice(pPrinter); +/*N*/ +/*N*/ if (pPrinter != pChDoc->GetOutliner()->GetRefDevice()) +/*N*/ pChDoc->GetOutliner()->SetRefDevice(pPrinter); +/*N*/ } +/*N*/ } +/*N*/ +/*N*/ return pPrinter; +/*N*/ } + + +/************************************************************************* +|* +|* neuen SfxPrinter setzen +|* +\************************************************************************/ +/*N*/ void SchChartDocShell::SetPrinter( SfxPrinter* pNewPrinter, BOOL bIsDeletedHere ) throw() +/*N*/ { +/*N*/ bool bFirstTimeSettingPrinter = ( pPrinter == NULL ); +/*N*/ +/*N*/ // Printer may only be used, if the MapUnit is correct +/*N*/ if( pNewPrinter && +/*N*/ pNewPrinter->GetMapMode().GetMapUnit() == MAP_100TH_MM ) +/*N*/ { +/*N*/ if (pPrinter && bOwnPrinter && (pPrinter != pNewPrinter)) +/*N*/ { +/*?*/ delete pPrinter; +/*?*/ bOwnPrinter = FALSE; +/*N*/ } +/*N*/ +/*N*/ bOwnPrinter = bIsDeletedHere; +/*N*/ +/*N*/ pPrinter = pNewPrinter; +/*N*/ if(pFontList)delete pFontList; +/*N*/ OutputDevice* pOut = Application::GetDefaultDevice(); // #67730# +/*N*/ pFontList = new FontList( pPrinter, pOut, FALSE ); +/*N*/ PutItem(SvxFontListItem(pFontList)); +/*N*/ } +/*N*/ else +/*?*/ if( bIsDeletedHere ) +/*?*/ delete pNewPrinter; +/*N*/ +/*N*/ OutputDevice * pRefDev = GetRefDevice(); +/*N*/ if( pChDoc && +/*N*/ pRefDev && +/*N*/ pRefDev->GetMapMode().GetMapUnit() == MAP_100TH_MM ) +/*N*/ { +/*N*/ // set ref device at document at its outliner as well +/*N*/ OutputDevice * pRefDev = GetRefDevice(); +/*N*/ if( pRefDev && pRefDev->GetMapMode().GetMapUnit() == MAP_100TH_MM ) +/*N*/ { +/*N*/ pChDoc->SetRefDevice( pRefDev ); +/*N*/ pChDoc->GetOutliner()->SetRefDevice( pRefDev ); +/*N*/ +/*N*/ // re-render chart with new ref-device +/*N*/ +/*N*/ // call EnableSetModified( FALSE ) temporarily and safely +/*N*/ lcl_NoModificationGuard aNoModGuard( this ); +/*N*/ +/*N*/ if( ! bFirstTimeSettingPrinter && +/*N*/ pChDoc->IsInitialized() ) +/*N*/ { +/*?*/ pChDoc->BuildChart( FALSE ); +/*N*/ } +/*N*/ } +/*N*/ } +/*N*/ } + +/************************************************************************* +|* +|* +|* +\************************************************************************/ + +/************************************************************************* +|* +|* +|* +\************************************************************************/ +/*N*/ void SchChartDocShell::OnDocumentPrinterChanged(Printer* pNewPrinter) throw() +/*N*/ { +/*N*/ // we have no rtti, thus assert that we have an SfxPrinter +/*N*/ SetPrinter( reinterpret_cast< SfxPrinter * >( pNewPrinter ) ); +/*N*/ } + +/*N*/ OutputDevice * SchChartDocShell::GetRefDevice() +/*N*/ { +/*N*/ if ( GetProtocol().IsInPlaceActive() || +/*N*/ SFX_CREATE_MODE_EMBEDDED == GetCreateMode() ) +/*N*/ { +/*N*/ OutputDevice* pOutDev = GetDocumentRefDev(); +/*N*/ if ( pOutDev ) +/*N*/ return pOutDev; +/*N*/ } +/*N*/ +/*N*/ return GetPrinter(); +/*N*/ } + +/************************************************************************* +|* +|* InitNew, (Dokument wird neu erzeugt): Streams oeffnen +|* +\************************************************************************/ + +/*N*/ BOOL SchChartDocShell::InitNew( SvStorage * pStor ) throw() +/*N*/ { +/*N*/ CHART_TRACE1( "SchChartDocShell::InitNew pModel=%lx", (long)pChDoc ); +/*N*/ +/*N*/ if( SfxInPlaceObject::InitNew( pStor )) +/*N*/ { +/*N*/ if(!pChDoc) +/*N*/ { +/*N*/ pChDoc = new ChartModel( SvtPathOptions().GetPalettePath(), this ); +/*N*/ // set new model at ChXChartDocument +/*N*/ ChXChartDocument* pImpl = ChXChartDocument::getImplementation( GetModel() ); +/*N*/ if( pImpl ) +/*N*/ pImpl->SetChartModel( pChDoc ); +/*N*/ Construct(); +/*N*/ } +/*N*/ if( pChDoc ) +/*N*/ { +/*N*/ if(bInitNewNoNewDoc) +/*?*/ pChDoc->NewOrLoadCompleted(DOC_LOADED); +/*N*/ else +/*N*/ pChDoc->NewOrLoadCompleted(NEW_DOC); +/*N*/ } +/*N*/ +/*N*/ SetVisArea(Rectangle(Point(0, 0), Size( SCH_DEFAULT_CHART_SIZE_WIDTH, SCH_DEFAULT_CHART_SIZE_HEIGHT ))); +/*N*/ +/*N*/ return TRUE; +/*N*/ } +/*N*/ +/*N*/ return FALSE; +/*N*/ } + +/************************************************************************* +|* +|* Load: Pools und Dokument laden +|* +\************************************************************************/ + +/*N*/ BOOL SchChartDocShell::Load(SvStorage * pStor) throw() +/*N*/ { +/*N*/ RTL_LOGFILE_CONTEXT_AUTHOR (context, "sch", "af119097", "::SchChartDocShell::Load"); +/*N*/ +/*N*/ CHART_TRACE( "SchChartDocShell::Load" ); +/*N*/ +/*N*/ BOOL bRet = FALSE; +/*N*/ +/*N*/ pChDoc = new ChartModel( SvtPathOptions().GetPalettePath(), this ); +/*N*/ SetPool( &pChDoc->GetItemPool()); +/*N*/ ChXChartDocument* pImpl = ChXChartDocument::getImplementation( GetModel() ); +/*N*/ if( pImpl ) +/*?*/ pImpl->SetChartModel( pChDoc ); +/*N*/ +/*N*/ sal_Bool bIsXML = pStor->GetVersion() >= SOFFICE_FILEFORMAT_60; +/*N*/ +/*N*/ if( bIsXML ) +/*N*/ { +/*N*/ } +/*N*/ else +/*N*/ { +/*N*/ ULONG nStorFmt = pStor->GetFormat(); +/*N*/ RTL_LOGFILE_CONTEXT_TRACE1 (context, "binary format %lu", nStorFmt); +/*N*/ +/*N*/ // do some initializations +/*N*/ Construct(); +/*N*/ +/*N*/ pProgress = NULL; +/*N*/ +/*N*/ if ( nStorFmt == SOT_FORMATSTR_ID_STARCHART_50 || +/*N*/ nStorFmt == SOT_FORMATSTR_ID_STARCHART_40 || +/*N*/ nStorFmt == SOT_FORMATSTR_ID_STARCHART || +/*N*/ nStorFmt == SOT_FORMATSTR_ID_STARCHARTDOCUMENT_50 +/*N*/ ) +/*N*/ { +/*N*/ if( GetCreateMode() != SFX_CREATE_MODE_EMBEDDED ) +/*N*/ pProgress = new SfxProgress( this, String( SchResId( STR_OPEN_DOCUMENT )), 100 ); +/*N*/ +/*N*/ if( pProgress ) +/*N*/ pProgress->SetState( 0, 100 ); +/*N*/ +/*N*/ bRet = SfxInPlaceObject::Load( pStor ); +/*N*/ +/*N*/ if( pProgress ) +/*N*/ pProgress->SetState( 30 ); +/*N*/ +/*N*/ if( bRet ) +/*N*/ { +/*N*/ SetWaitCursor( TRUE ); +/*N*/ +/*N*/ // Pool und StyleSheet Pool laden +/*N*/ String aStyleSheetsStr( SCH_STYLE_SHEET_NAME ); +/*N*/ +/*N*/ if (pStor->IsStream(aStyleSheetsStr)) +/*N*/ { +/*N*/ ULONG nError; +/*N*/ SvStorageStreamRef rPoolStream = pStor->OpenStream( aStyleSheetsStr ); +/*N*/ rPoolStream->SetVersion( pStor->GetVersion()); +/*N*/ if( ! rPoolStream->GetError()) +/*N*/ { +/*N*/ rPoolStream->SetBufferSize( POOL_BUFFER_SIZE ); +/*N*/ nError = rPoolStream->GetError(); +/*N*/ GetPool().SetFileFormatVersion( (USHORT)pStor->GetVersion ()); +/*N*/ GetPool().Load( *rPoolStream ); +/*N*/ nError = rPoolStream->GetError(); +/*N*/ if( nError ) +/*N*/ { +/*?*/ DBG_ERROR1( "Errorcode 0x%x loading Pool", nError ); +/*?*/ rPoolStream->ResetError(); +/*?*/ SetError( ERRCODE_WARNING_MASK | nError ); +/*N*/ } +/*N*/ GetStyleSheetPool()->Load( *rPoolStream ); +/*N*/ nError = rPoolStream->GetError(); +/*N*/ if( nError ) +/*N*/ { +/*?*/ DBG_ERROR1( "Errorcode 0x%x loading StyleSheet-Pool", nError ); +/*?*/ rPoolStream->ResetError(); +/*?*/ SetError( ERRCODE_WARNING_MASK | nError ); +/*N*/ } +/*N*/ rPoolStream->SetBufferSize( 0 ); +/*N*/ } +/*N*/ else bRet = FALSE; +/*N*/ } +/*N*/ else bRet = FALSE; +/*N*/ +/*N*/ if( pProgress ) +/*N*/ pProgress->SetState( 70 ); +/*N*/ +/*N*/ // wenn gewuenscht, das Dokument laden +/*N*/ if (bRet && (GetCreateMode() != SFX_CREATE_MODE_ORGANIZER)) +/*N*/ { +/*N*/ // Model der Drawing Engine laden +/*N*/ if (pStor->IsStream( aStarChartDoc )) +/*N*/ { +/*N*/ SvStorageStreamRef rDocumentStream = pStor->OpenStream( aStarChartDoc ); +/*N*/ rDocumentStream->SetVersion( pStor->GetVersion()); +/*N*/ GetPool().SetFileFormatVersion ( (USHORT)pStor->GetVersion()); +/*N*/ if( ! rDocumentStream->GetError()) +/*N*/ { +/*N*/ rDocumentStream->SetBufferSize( DOCUMENT_BUFFER_SIZE ); +/*N*/ rDocumentStream->SetKey( pStor->GetKey()); // set password +/*N*/ +/*N*/ // read ChartModel +/*N*/ *rDocumentStream >> *pChDoc; +/*N*/ +/*N*/ bRet = ( rDocumentStream->GetError() == 0 ); +/*N*/ +/*N*/ // garbled with password? +/*N*/ if( ! bRet ) +/*N*/ { +/*?*/ if( pStor->GetKey().Len() == 0 ) +/*?*/ { +/*?*/ // no password set => cannot load +/*?*/ SetError( ERRCODE_SFX_DOLOADFAILED ); +/*?*/ } +/*?*/ else +/*?*/ { +/*?*/ // password was set, but obviously wrong +/*?*/ SetError( ERRCODE_SFX_WRONGPASSWORD ); +/*?*/ } +/*N*/ } +/*N*/ +/*N*/ rDocumentStream->SetBufferSize( 0 ); +/*N*/ } +/*N*/ else bRet = FALSE; +/*N*/ } +/*N*/ else bRet = FALSE; +/*N*/ } +/*N*/ +/*N*/ if( pProgress ) +/*N*/ pProgress->SetState( 100 ); +/*N*/ +/*N*/ // (noch) keine ungesicherten Aenderungen im Model +/*N*/ if (bRet) +/*N*/ { + + // #i39672# convert range strings to new XML compatible format + + // Note: Formerly, the parent storage was queried to + // find out whether it is a Writer or a Calc. This + // worked, because it was done in SaveAs(). It is + // better to do the conversion right after loading, + // however here we have no parent. So both conversions + // are called. This works, because the things written + // to the SomeData strings is so different, that both + // routines won't convert the data for the wrong + // format. (Note: only the conversion from old to new, + // i.e. the call with parameter TRUE, work like this, as + // the new format is the same for both) + + // try Writer + bool bConverted = + pChDoc->GetChartData()->ConvertChartRangeForWriter( TRUE ); + + // try Calc + if( ! bConverted ) + { + SchMemChart* pData = pChDoc->GetChartData(); + if( pData && + pData->SomeData3().Len() > 0 && + (pData->GetChartRange().maRanges.size() == 0) ) + bConverted = pData->ConvertChartRangeForCalc( TRUE ); + } + +/*N*/ pChDoc->SetChanged( FALSE ); +/*N*/ pChDoc->NewOrLoadCompleted( DOC_LOADED ); +/*N*/ } +/*N*/ +/*N*/ SetWaitCursor( FALSE ); +/*N*/ } +/*N*/ +/*N*/ if( pProgress ) +/*N*/ pProgress->SetState( 100 ); +/*N*/ +/*N*/ if (bRet) +/*N*/ { +/*N*/ UpdateTablePointers(); +/*N*/ FinishedLoading( SFX_LOADED_ALL ); +/*N*/ } +/*N*/ } +/*N*/ else +/*N*/ { +/*?*/ pStor->SetError( SVSTREAM_WRONGVERSION ); +/*N*/ } +/*N*/ +/*N*/ if( pProgress ) +/*N*/ { +/*N*/ delete pProgress; +/*N*/ pProgress = NULL; +/*N*/ } +/*N*/ } +/*N*/ +/*N*/ return bRet; +/*N*/ } + +/************************************************************************* +|* +|* +|* +\************************************************************************/ + + /********************************************************************** + * StarOffice XML-Filter Export + **********************************************************************/ + + /********************************************************************** + * StarOffice XML-Filter Import + **********************************************************************/ + +// ------------------------------------------------------------ + + +// ------------------------------------------------------------ + +/*N*/ BOOL SchChartDocShell::Save() throw() +/*N*/ { +/*N*/ RTL_LOGFILE_CONTEXT_AUTHOR (context, "sch", "af119097", "::SchChartDocShell::Save"); +/*N*/ +/*N*/ SvStorage* pStor = GetStorage(); +/*N*/ DBG_ASSERT( pStor, "Save() without Storage called!" ); + if (!pStor) + return FALSE; +/*N*/ +/*N*/ long nFileFormat = pStor->GetVersion(); +/*N*/ sal_Bool bIsXML = nFileFormat >= SOFFICE_FILEFORMAT_60; +/*N*/ BOOL bRet = FALSE; +/*N*/ +/*N*/ if( bIsXML ) +/*N*/ { +/*N*/ RTL_LOGFILE_CONTEXT_TRACE (context, "XML format"); +/*N*/ bRet = SfxInPlaceObject::Save(); +/*N*/ + /********************************************************************** + * StarOffice XML-Filter Export + **********************************************************************/ +/*N*/ Reference< ::com::sun::star::frame::XModel> xModel(GetModel()); +/*N*/ SchXMLWrapper aFilter( xModel, *pStor, +/*N*/ GetCreateMode() != SFX_CREATE_MODE_EMBEDDED ); +/*N*/ +/*N*/ // update user info before writing +/*N*/ UpdateDocInfoForSave(); +/*N*/ +/*N*/ bRet = aFilter.Export(); + + FinishedLoading( SFX_LOADED_ALL ); +/*N*/ } +/*N*/ else // binary format <= 5.0 +/*N*/ { +/*N*/ pChDoc->PrepareAxisStorage(); +/*N*/ SvStorageStreamRef rDocumentStream = pStor->OpenStream( aStarChartDoc ); +/*N*/ +/*N*/ if( rDocumentStream.Is() && ! rDocumentStream->GetError() ) +/*N*/ { +/*N*/ rDocumentStream->SetVersion( pStor->GetVersion() ); +/*N*/ +/*N*/ if( nFileFormat <= SOFFICE_FILEFORMAT_40 && pChDoc->IsReal3D()) +/*N*/ { +/*?*/ CHART_TRACE( "Fileformat 4.0" ); +/*?*/ pChDoc->PrepareOld3DStorage(); +/*N*/ } +/*N*/ +/*N*/ bRet = SfxInPlaceObject::Save(); +/*N*/ +/*N*/ // komprimiert/native speichern? +/*N*/ const BOOL bSaveNative = FALSE; +/*N*/ const BOOL bSaveCompressed = FALSE; +/*N*/ +/*N*/ pChDoc->SetSaveCompressed( bSaveCompressed ); +/*N*/ pChDoc->SetSaveNative( bSaveNative ); +/*N*/ +/*N*/ if( bRet ) +/*N*/ { +/*N*/ pChDoc->PreSave(); +/*N*/ +/*N*/ SetWaitCursor( TRUE ); +/*N*/ +/*N*/ SvStorageStreamRef rPoolStream = pStor->OpenStream( SCH_STYLE_SHEET_NAME ); +/*N*/ if( ! rPoolStream->GetError()) +/*N*/ { +/*N*/ rPoolStream->SetSize( 0 ); +/*N*/ rPoolStream->SetBufferSize( POOL_BUFFER_SIZE ); +/*N*/ GetPool().Store( *rPoolStream ); +/*N*/ +/*N*/ +/*N*/ // the style sheet pool uses next() and first() methods without resetting +/*N*/ // the search mask (?) so it has to be done here +/*N*/ GetStyleSheetPool()->SetSearchMask( SFX_STYLE_FAMILY_ALL ); +/*N*/ // FALSE = also save unused style sheets +/*N*/ GetStyleSheetPool()->Store( *rPoolStream, FALSE ); +/*N*/ rPoolStream->SetBufferSize( 0 ); +/*N*/ +/*N*/ } +/*N*/ else bRet = FALSE; +/*N*/ if (bRet) +/*N*/ bRet = rPoolStream->GetError() == 0; +/*N*/ DBG_ASSERT(bRet, "Fehler beim Schreiben der Pools"); +/*N*/ +/*N*/ if( ! rDocumentStream->GetError()) +/*N*/ { + // #i56310# set SomeData strings according to + // ChartRange in MemChart like it is done in SaveAs + SvPersist* pParent = GetParent(); + if( pParent ) + { + // determine which is parent application + SvGlobalName aGlobalName; + ULONG nFileFormat; + String aAppName, aFullName, aShortName; + pParent->FillClass( &aGlobalName, &nFileFormat, + &aAppName, &aFullName, &aShortName, + SOFFICE_FILEFORMAT_60 ); + + if( nFileFormat == SOT_FORMATSTR_ID_STARCALC_60 ) + pChDoc->GetChartData()->ConvertChartRangeForCalc( FALSE ); + else if( nFileFormat == SOT_FORMATSTR_ID_STARWRITER_60 ) + pChDoc->GetChartData()->ConvertChartRangeForWriter( FALSE ); + } +/*N*/ rDocumentStream->SetSize( 0 ); +/*N*/ rDocumentStream->SetBufferSize( DOCUMENT_BUFFER_SIZE ); +/*N*/ *rDocumentStream << *pChDoc; +/*N*/ rDocumentStream->SetBufferSize( 0 ); +/*N*/ } +/*N*/ else +/*N*/ bRet = FALSE; +/*N*/ +/*N*/ if (bRet) +/*N*/ bRet = rDocumentStream->GetError() == 0; +/*N*/ DBG_ASSERT(bRet, "Fehler beim Schreiben des Models"); +/*N*/ +/*N*/ // finished +/*N*/ +/*N*/ SetWaitCursor( FALSE ); +/*N*/ +/*N*/ pChDoc->PostSave(); +/*N*/ } +/*N*/ +/*N*/ +/*N*/ if(nFileFormat <= SOFFICE_FILEFORMAT_40 && pChDoc->IsReal3D()) +/*N*/ { +/*?*/ pChDoc->CleanupOld3DStorage(); +/*N*/ } +/*N*/ } +/*N*/ } +/*N*/ +/*N*/ return bRet; +/*N*/ } + +/************************************************************************* +|* +|* +|* +\************************************************************************/ + +/*N*/ BOOL SchChartDocShell::SaveAs(SvStorage * pStor) throw() +/*N*/ { +/*N*/ RTL_LOGFILE_CONTEXT_AUTHOR (context, "sch", "af119097", "::SchChartDocShell::SaveAs"); +/*N*/ +/*N*/ CHART_TRACE( "SchChartDocShell::SaveAs" ); +/*N*/ DBG_ASSERT( pStor, "SaveAs() without Storage called!" ); + if (!pStor) + return FALSE; +/*N*/ +/*N*/ BOOL bRet = FALSE; +/*N*/ +/*N*/ long nOldFormat = GetStorage()->GetVersion(); +/*N*/ long nNewFormat = pStor->GetVersion(); +/*N*/ +/*N*/ BOOL bIsXML = nNewFormat >= SOFFICE_FILEFORMAT_60; +/*N*/ BOOL bFormatChanges = (nOldFormat != nNewFormat); +/*N*/ +/*N*/ // If chart was loaded from binary format it has never been built. +/*N*/ if( ! pChDoc->IsInitialized()) +/*N*/ pChDoc->Initialize(); +/*N*/ +/*N*/ if( bIsXML ) +/*N*/ { +/*N*/ RTL_LOGFILE_CONTEXT_TRACE (context, "XML format"); +/*N*/ bRet = SfxInPlaceObject::SaveAs( pStor ); +/*N*/ + /********************************************************************** + * StarOffice XML-Filter Export + **********************************************************************/ +/*N*/ Reference< ::com::sun::star::frame::XModel> xModel(GetModel()); +/*N*/ SchXMLWrapper aFilter( xModel, *pStor, +/*N*/ GetCreateMode() != SFX_CREATE_MODE_EMBEDDED ); +/*N*/ +/*N*/ // update user info before writing +/*N*/ UpdateDocInfoForSave(); +/*N*/ +/*N*/ // old storage was binary format +/*N*/ if( bFormatChanges ) +/*N*/ { +/*N*/ // convert SomeData-strings from Calc/Writer to data structure +/*N*/ SvPersist* pParent = GetParent(); +/*N*/ if( pParent ) +/*N*/ { +/*?*/ // determine which is parent application + + +/** removed since the actually come up and the fprintf even in pro builds +DBG_BF_ASSERT(0, "STRIP"); +DBG_ERROR( "Conversion routine called" ); +fprintf( stderr, "BM: Conversion routine called\n" ); +*/ + SvGlobalName aGlobalName; + /*?*/ ULONG nFileFormat; + /*?*/ String aAppName, aFullName, aShortName; + /*?*/ pParent->FillClass( &aGlobalName, &nFileFormat, + /*?*/ &aAppName, &aFullName, &aShortName, + /*?*/ SOFFICE_FILEFORMAT_60 ); + /*?*/ + /*?*/ // calc does this conversion itself except when object was + /*?*/ // copied to clipboard. In this case SomeData3 was filled before. + /*?*/ if( nFileFormat == SOT_FORMATSTR_ID_STARCALC_60 ) + /*?*/ { + /*?*/ SchMemChart* pData = pChDoc->GetChartData(); + /*?*/ if( pData && + /*?*/ pData->SomeData3().Len() > 0 && + /*?*/ (pData->GetChartRange().maRanges.size() == 0) ) + /*?*/ { + /*?*/ pData->ConvertChartRangeForCalc( TRUE ); + /*?*/ } + /*?*/ } + /*?*/ else if( nFileFormat == SOT_FORMATSTR_ID_STARWRITER_60 ) + /*?*/ pChDoc->GetChartData()->ConvertChartRangeForWriter( TRUE ); + + /*N*/ } +/*N*/ +/*N*/ bRet = aFilter.Export(); +/*N*/ } +/*N*/ } +/*N*/ else // binary format <= 5.0 +/*N*/ { +/*N*/ pChDoc->PrepareAxisStorage(); +/*N*/ long nFileFormat = pStor->GetVersion(); +/*N*/ RTL_LOGFILE_CONTEXT_TRACE1 (context, "binary format %ld", nFileFormat); +/*N*/ if(nFileFormat <= SOFFICE_FILEFORMAT_40 && pChDoc->IsReal3D()) +/*N*/ { +/*N*/ pChDoc->PrepareOld3DStorage(); +/*N*/ CHART_TRACE( "Fileformat 4.0" ); +/*N*/ } +/*N*/ +/*N*/ bRet = SfxInPlaceObject::SaveAs( pStor ); +/*N*/ +/*N*/ // compressed or native format +/*N*/ const BOOL bSaveNative = FALSE; +/*N*/ const BOOL bSaveCompressed = FALSE; +/*N*/ +/*N*/ pChDoc->SetSaveCompressed( bSaveCompressed ); +/*N*/ pChDoc->SetSaveNative( bSaveNative ); +/*N*/ +/*N*/ if (bRet) +/*N*/ { +/*N*/ pChDoc->PreSave(); +/*N*/ SvStorageStreamRef rPoolStream = pStor->OpenStream( SCH_STYLE_SHEET_NAME ); +/*N*/ rPoolStream->SetVersion( pStor->GetVersion ()); +/*N*/ +/*N*/ SetWaitCursor( TRUE ); +/*N*/ +/*N*/ if( ! rPoolStream->GetError()) +/*N*/ { +/*N*/ rPoolStream->SetBufferSize(POOL_BUFFER_SIZE); +/*N*/ GetPool().SetFileFormatVersion( (USHORT)pStor->GetVersion ()); +/*N*/ GetPool().Store( *rPoolStream ); +/*N*/ +/*N*/ +/*N*/ // the style sheet pool uses next() and first() methods without resetting +/*N*/ // the search mask (?) so it has to be done here +/*N*/ GetStyleSheetPool()->SetSearchMask( SFX_STYLE_FAMILY_ALL ); +/*N*/ // FALSE = also save unused style sheets +/*N*/ GetStyleSheetPool()->Store( *rPoolStream, FALSE ); +/*N*/ rPoolStream->SetBufferSize( 0 ); +/*N*/ +/*N*/ } +/*N*/ else +/*N*/ bRet = FALSE; +/*N*/ +/*N*/ if( bRet ) +/*N*/ bRet = rPoolStream->GetError() == 0; +/*N*/ DBG_ASSERT( bRet, "Fehler beim Schreiben der Pools" ); +/*N*/ +/*N*/ SvStorageStreamRef rDocumentStream = pStor->OpenStream( aStarChartDoc ); +/*N*/ rDocumentStream->SetVersion( pStor->GetVersion()); +/*N*/ GetPool().SetFileFormatVersion ( (USHORT)pStor->GetVersion ()); +/*N*/ +/*N*/ if( ! rDocumentStream->GetError()) +/*N*/ { +/*N*/ // old storage was XML format +/*N*/ // always convert as internal storage is only the chart range +/*N*/ // if( bFormatChanges ) +/*N*/ // { +/*N*/ // convert data structure from Calc/Writer to SomeData strings +/*N*/ SvPersist* pParent = GetParent(); +/*N*/ if( pParent ) +/*N*/ { +/*N*/ // determine which is parent application +/*N*/ SvGlobalName aGlobalName; +/*N*/ ULONG nFileFormat; +/*N*/ String aAppName, aFullName, aShortName; +/*N*/ pParent->FillClass( &aGlobalName, &nFileFormat, +/*N*/ &aAppName, &aFullName, &aShortName, +/*N*/ SOFFICE_FILEFORMAT_60 ); +/*N*/ +/*N*/ if( nFileFormat == SOT_FORMATSTR_ID_STARCALC_60 ) +/*?*/ pChDoc->GetChartData()->ConvertChartRangeForCalc( FALSE ); +/*N*/ else if( nFileFormat == SOT_FORMATSTR_ID_STARWRITER_60 ) +/*N*/ pChDoc->GetChartData()->ConvertChartRangeForWriter( FALSE ); +/*N*/ } +/*N*/ // } +/*N*/ +/*N*/ rDocumentStream->SetBufferSize( DOCUMENT_BUFFER_SIZE ); +/*N*/ rDocumentStream->SetKey( pStor->GetKey()); // set password +/*N*/ *rDocumentStream << *pChDoc; +/*N*/ rDocumentStream->SetBufferSize( 0 ); +/*N*/ } +/*N*/ else bRet = FALSE; +/*N*/ if( bRet ) +/*N*/ bRet = rDocumentStream->GetError() == 0; +/*N*/ DBG_ASSERT( bRet, "Fehler beim Schreiben des Models" ); +/*N*/ +/*N*/ // finished +/*N*/ +/*N*/ SetWaitCursor( FALSE ); +/*N*/ +/*N*/ pChDoc->PostSave(); +/*N*/ } +/*N*/ +/*N*/ +/*N*/ if( nFileFormat <= SOFFICE_FILEFORMAT_40 && pChDoc->IsReal3D()) +/*N*/ { +/*N*/ pChDoc->CleanupOld3DStorage(); +/*N*/ } +/*N*/ } +/*N*/ +/*N*/ return bRet; +/*N*/ } + +/************************************************************************* +|* +|* +|* +\************************************************************************/ + +/*N*/ BOOL SchChartDocShell::SaveCompleted( SvStorage * pStor ) throw() +/*N*/ { +/*N*/ CHART_TRACE( "SchChartDocShell::SaveCompleted" ); +/*N*/ +/*N*/ BOOL bRet = SfxInPlaceObject::SaveCompleted( pStor ); +/*N*/ +/*N*/ if( bRet ) +/*N*/ { +/*N*/ if( pStor && pChDoc ) +/*N*/ { +/*N*/ // #99758# SetChanged was called here which called SetModified(). I +/*N*/ // removed this, since it is not clear why this was introduced in +/*N*/ // rev. 1.48 (loading of files with additional graphics does not set +/*N*/ // the modified flag to true) +/*N*/ +/*N*/ // throw away old graphics streams +/*N*/ pChDoc->HandsOff(); +/*N*/ } +/*N*/ } +/*N*/ return bRet; +/*N*/ } + +/************************************************************************* +|* +|* Tabellenzeiger auffrischen +|* +\************************************************************************/ +/*N*/ void SchChartDocShell::UpdateTablePointers() throw() +/*N*/ { +/*N*/ PutItem(SvxColorTableItem(pChDoc->GetColorTable())); +/*N*/ PutItem(SvxGradientListItem(pChDoc->GetGradientList())); +/*N*/ PutItem(SvxHatchListItem(pChDoc->GetHatchList())); +/*N*/ PutItem(SvxBitmapListItem(pChDoc->GetBitmapList())); +/*N*/ PutItem(SvxDashListItem(pChDoc->GetDashList())); +/*N*/ PutItem(SvxLineEndListItem(pChDoc->GetLineEndList())); +/*N*/ +/*N*/ if(pFontList)delete pFontList; +/*N*/ +/*N*/ if ( GetCreateMode() == SFX_CREATE_MODE_EMBEDDED && !pPrinter ) +/*N*/ { +/*N*/ // OLE-Objekt: kein Printer anlegen +/*?*/ pFontList = new FontList( Application::GetDefaultDevice(), NULL, FALSE ); // #67730# +/*N*/ } +/*N*/ else +/*N*/ { +/*N*/ pFontList = new FontList(GetPrinter(), NULL, FALSE); +/*N*/ } +/*N*/ +/*N*/ SvxFontListItem aFontListItem(pFontList); +/*N*/ PutItem(aFontListItem); +/*N*/ +/*N*/ // PutItem(SvxNumberInfoItem(pChDoc->GetNumFormatter())); +/*N*/ } + +/************************************************************************* +|* +|* FillClass +|* +\************************************************************************/ + +/*N*/ void SchChartDocShell::FillClass(SvGlobalName* pClassName, +/*N*/ ULONG* pFormat, +/*N*/ String* pAppName, +/*N*/ String* pFullTypeName, +/*N*/ String* pShortTypeName, +/*N*/ long nFileFormat) const throw() +/*N*/ { +/*N*/ SfxInPlaceObject::FillClass(pClassName, pFormat, pAppName, pFullTypeName, +/*N*/ pShortTypeName, nFileFormat); +/*N*/ +/*N*/ if (nFileFormat == SOFFICE_FILEFORMAT_31) +/*N*/ { +/*N*/ *pClassName = SvGlobalName(BF_SO3_SCH_CLASSID_30); +/*N*/ *pFormat = SOT_FORMATSTR_ID_STARCHART; +/*N*/ (*pAppName).AssignAscii( RTL_CONSTASCII_STRINGPARAM( "Schart 3.1" )); +/*N*/ *pFullTypeName = String(SchResId(STR_CHART_DOCUMENT_FULLTYPE_31)); +/*N*/ *pShortTypeName = String(SchResId(STR_CHART_DOCUMENT)); +/*N*/ } +/*N*/ else if (nFileFormat == SOFFICE_FILEFORMAT_40) +/*N*/ { +/*N*/ *pClassName = SvGlobalName(BF_SO3_SCH_CLASSID_40); +/*N*/ *pFormat = SOT_FORMATSTR_ID_STARCHART_40; +/*N*/ *pFullTypeName = String(SchResId(STR_CHART_DOCUMENT_FULLTYPE_40)); +/*N*/ *pShortTypeName = String(SchResId(STR_CHART_DOCUMENT)); +/*N*/ } +/*N*/ else if (nFileFormat == SOFFICE_FILEFORMAT_50) +/*N*/ { +/*N*/ *pClassName = SvGlobalName(BF_SO3_SCH_CLASSID_50); + + // for binfilter, we need the FormatIDs to be set. Not setting them + // has always been an error (!) + *pFormat = SOT_FORMATSTR_ID_STARCHART_50; + +/*N*/ *pFullTypeName = String(SchResId(STR_CHART_DOCUMENT_FULLTYPE_50)); +/*N*/ *pShortTypeName = String(SchResId(STR_CHART_DOCUMENT)); +/*N*/ } +/*N*/ else if (nFileFormat == SOFFICE_FILEFORMAT_60) +/*N*/ { +/*N*/ *pClassName = SvGlobalName(BF_SO3_SCH_CLASSID_60); + + // for binfilter, we need the FormatIDs to be set. Not setting them + // has always been an error (!) + *pFormat = SOT_FORMATSTR_ID_STARCHART_60; + +/*N*/ *pFullTypeName = String(SchResId(STR_CHART_DOCUMENT_FULLTYPE_60)); +/*N*/ *pShortTypeName = String(SchResId(STR_CHART_DOCUMENT)); +/*N*/ } +/*N*/ } + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/inc/ChXChartData.hxx b/binfilter/bf_sch/source/ui/inc/ChXChartData.hxx new file mode 100644 index 000000000000..586ccb1c4d3b --- /dev/null +++ b/binfilter/bf_sch/source/ui/inc/ChXChartData.hxx @@ -0,0 +1,167 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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_DATA_HXX +#define _CHART_DATA_HXX + +#include <cppuhelper/implbase4.hxx> +// header for OInterfaceContainerHelper +#include <cppuhelper/interfacecontainer.hxx> + +#include <com/sun/star/chart/XChartDataArray.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/lang/XUnoTunnel.hpp> +#include <com/sun/star/lang/XComponent.hpp> +namespace binfilter { + +class ChartModel; + +// ---------------------------------------- +// ChXChartData +// ---------------------------------------- + +class ChXChartData : public cppu::WeakImplHelper4< + ::com::sun::star::chart::XChartData, + ::com::sun::star::lang::XServiceInfo, + ::com::sun::star::lang::XEventListener, + ::com::sun::star::lang::XUnoTunnel > +{ +private: + ::osl::Mutex maMutex; + cppu::OInterfaceContainerHelper maListeners; + +protected: + ChartModel* mpModel; + +public: + // the model is used for listening for the 'death' of the ChartModel + ChXChartData( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > xModel, + ChartModel* pModel ); + virtual ~ChXChartData(); + + ::osl::Mutex& GetMutex() { return maMutex; } + + virtual void DataModified( ::com::sun::star::chart::ChartDataChangeEvent& ); + + static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId() throw(); + static ChXChartData* getImplementation( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > ) throw(); + + // XChartData + virtual void SAL_CALL addChartDataChangeEventListener( + const ::com::sun::star::uno::Reference< ::com::sun::star::chart::XChartDataChangeEventListener >& aListener ) + throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL removeChartDataChangeEventListener( + const ::com::sun::star::uno::Reference< ::com::sun::star::chart::XChartDataChangeEventListener >& aListener ) + throw( ::com::sun::star::uno::RuntimeException ); + virtual double SAL_CALL getNotANumber() throw( ::com::sun::star::uno::RuntimeException ); + virtual sal_Bool SAL_CALL isNotANumber( double nNumber ) throw( ::com::sun::star::uno::RuntimeException ); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw( ::com::sun::star::uno::RuntimeException ); + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) + throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() + throw( ::com::sun::star::uno::RuntimeException ); + + // XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) + throw( ::com::sun::star::uno::RuntimeException ); + + // XEventListener listens to disposing of XModel + virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) + throw( ::com::sun::star::uno::RuntimeException ); +}; + + +// ---------------------------------------- +// ChXChartDataArray +// ---------------------------------------- + +class ChXChartDataArray : + public ChXChartData, + public ::com::sun::star::chart::XChartDataArray +{ +private: + static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > maTypeSequence; + +public: + // the model is used for listening for the 'death' of the ChartModel + ChXChartDataArray( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > xModel, + ChartModel* pModel ); + virtual ~ChXChartDataArray(); + + // XInterface + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) + throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL acquire() throw(); + virtual void SAL_CALL release() throw(); + + // XTypeProvider + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() + throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() + throw( ::com::sun::star::uno::RuntimeException ); + + // XChartDataArray + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< double > > SAL_CALL getData() + throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setData( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< double > >& aData ) + throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getRowDescriptions() + throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setRowDescriptions( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aRowDescriptions ) + throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getColumnDescriptions() + throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setColumnDescriptions( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aColumnDescriptions ) + throw( ::com::sun::star::uno::RuntimeException ); + + // XChartData ( ::XChartDataArray ) + virtual void SAL_CALL addChartDataChangeEventListener( + const ::com::sun::star::uno::Reference< ::com::sun::star::chart::XChartDataChangeEventListener >& aListener ) + throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL removeChartDataChangeEventListener( + const ::com::sun::star::uno::Reference< ::com::sun::star::chart::XChartDataChangeEventListener >& aListener ) + throw( ::com::sun::star::uno::RuntimeException ); + virtual double SAL_CALL getNotANumber() throw( ::com::sun::star::uno::RuntimeException ); + virtual sal_Bool SAL_CALL isNotANumber( double nNumber ) throw( ::com::sun::star::uno::RuntimeException ); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw( ::com::sun::star::uno::RuntimeException ); + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) + throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() + throw( ::com::sun::star::uno::RuntimeException ); +}; + +} //namespace binfilter +#endif // _CHART_DATA_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/inc/ChXChartDataChangeEventListener.hxx b/binfilter/bf_sch/source/ui/inc/ChXChartDataChangeEventListener.hxx new file mode 100644 index 000000000000..a07d44ec1481 --- /dev/null +++ b/binfilter/bf_sch/source/ui/inc/ChXChartDataChangeEventListener.hxx @@ -0,0 +1,72 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 _CHXCHARTDATACHANGEEVENTLISTENER_HXX +#define _CHXCHARTDATACHANGEEVENTLISTENER_HXX + +#include <cppuhelper/implbase1.hxx> // helper for implementations + +#include <com/sun/star/chart/XChartDataChangeEventListener.hpp> +namespace binfilter { + +class ChXChartDocument; + +class ChXChartDataChangeEventListener : + public cppu::WeakImplHelper1< ::com::sun::star::chart::XChartDataChangeEventListener > +{ +private: + ChXChartDocument *mpXDoc; + +public: + ChXChartDataChangeEventListener(); + virtual ~ChXChartDataChangeEventListener(){}; + + void Reset() throw(); + void SetOwner( ChXChartDocument* pXDoc ) throw(); + + // XChartDataChangeEventListener + virtual void SAL_CALL chartDataChanged( const ::com::sun::star::chart::ChartDataChangeEvent& aEvent ) + throw( ::com::sun::star::uno::RuntimeException ); + + // XEventListener + virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) + throw( ::com::sun::star::uno::RuntimeException ); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw( ::com::sun::star::uno::RuntimeException ); + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) + throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() + throw( ::com::sun::star::uno::RuntimeException ); +}; + +} //namespace binfilter +#endif // _CHXCHARTDATACHANGEEVENTLISTENER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/inc/ChXChartDrawPage.hxx b/binfilter/bf_sch/source/ui/inc/ChXChartDrawPage.hxx new file mode 100644 index 000000000000..e7147e03eea2 --- /dev/null +++ b/binfilter/bf_sch/source/ui/inc/ChXChartDrawPage.hxx @@ -0,0 +1,105 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 _CHXCHARTDRAWPAGE_HXX_ +#define _CHXCHARTDRAWPAGE_HXX_ + +#include <bf_svx/unopage.hxx> +#include <com/sun/star/beans/XPropertySet.hpp> + +// header for SvxItemPropertySet +#include <bf_svx/unoprov.hxx> +namespace binfilter { + +class ChartModel; + +class ChXChartDrawPage : + public ::com::sun::star::beans::XPropertySet, + public SvxDrawPage +{ +private: + ChartModel* mpModel; + SvxItemPropertySet maPropSet; + + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > maTypeSequence; + +public: + ChXChartDrawPage( ChartModel* pModel ); + virtual ~ChXChartDrawPage() throw(); + + // XInterface + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) + throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL acquire() throw(); + virtual void SAL_CALL release() throw(); + + // XTypeProvider + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() + throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() + throw( ::com::sun::star::uno::RuntimeException ); + + // XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() + throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, + const ::com::sun::star::uno::Any& aValue ) + throw( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::beans::PropertyVetoException, + ::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) + throw( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) + throw( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) + throw( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) + throw( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) + throw( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException ); +}; + +} //namespace binfilter +#endif // _CHXCHARTDRAWPAGE_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/inc/ChXChartObject.hxx b/binfilter/bf_sch/source/ui/inc/ChXChartObject.hxx new file mode 100644 index 000000000000..8ecb5d5dc1e8 --- /dev/null +++ b/binfilter/bf_sch/source/ui/inc/ChXChartObject.hxx @@ -0,0 +1,230 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 _CHXCHART_OBJECT_HXX +#define _CHXCHART_OBJECT_HXX + +#include <cppuhelper/implbase8.hxx> + +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/beans/XMultiPropertySet.hpp> +#include <com/sun/star/beans/XPropertyState.hpp> +#include <com/sun/star/beans/XMultiPropertyStates.hpp> +#include <com/sun/star/drawing/XShape.hpp> +#include <com/sun/star/lang/XComponent.hpp> +#include <com/sun/star/lang/XUnoTunnel.hpp> +#include <cppuhelper/interfacecontainer.hxx> + +// header for SvxServiceInfoHelper, SvxItemPropertySet +#include <bf_svx/unoprov.hxx> +namespace binfilter { + +class ChartModel; +class SdrObject; + +class ChXChartObject : public cppu::WeakImplHelper8< + ::com::sun::star::beans::XPropertySet, + ::com::sun::star::beans::XMultiPropertySet, + ::com::sun::star::beans::XPropertyState, + ::com::sun::star::beans::XMultiPropertyStates, + ::com::sun::star::drawing::XShape, + ::com::sun::star::lang::XComponent, + ::com::sun::star::lang::XServiceInfo, + ::com::sun::star::lang::XUnoTunnel > +{ +protected: + SvxItemPropertySet maPropSet; + ChartModel* mpModel; + long mnWhichId; + long mnIndex; // typically a data row index + +public: + ChXChartObject( long _MapId, ChartModel* _Model, long _WhichId, long _Index = -1 ); + virtual ~ChXChartObject(); + + virtual long GetId() const; + SdrObject* GetCurrentSdrObject() const; + static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId() throw(); + + // XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() + throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, + const ::com::sun::star::uno::Any& aValue ) + throw( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::beans::PropertyVetoException, + ::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) + throw( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) + throw( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) + throw( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) + throw( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) + throw( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException ); + + // XMultiPropertySet + virtual void SAL_CALL setPropertyValues ( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, + const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) + throw ( ::com::sun::star::beans::PropertyVetoException, + ::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyValues ( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) + throw ( ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertiesChangeListener ( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) + throw ( ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertiesChangeListener ( + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) + throw ( ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL firePropertiesChangeEvent ( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) + throw ( ::com::sun::star::uno::RuntimeException); + + + // XPropertyState + virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) + throw( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) + throw( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) + throw( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& aPropertyName ) + throw( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException ); + + // XMultiPropertyStates +/* virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates ( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) + throw ( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException); +*/ virtual void SAL_CALL setAllPropertiesToDefault (void) + throw ( ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertiesToDefault ( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) + throw ( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyDefaults ( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) + throw ( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + + // XShape + virtual ::com::sun::star::awt::Point SAL_CALL getPosition() throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setPosition( const ::com::sun::star::awt::Point& aPosition ) + throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::awt::Size SAL_CALL getSize() throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setSize( const ::com::sun::star::awt::Size& aSize ) + throw( ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::uno::RuntimeException ); + + // XComponent + virtual void SAL_CALL dispose() throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) + throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) + throw( ::com::sun::star::uno::RuntimeException ); + + // XServiceInfo + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) + throw( ::com::sun::star::uno::RuntimeException ); + + // XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) + throw( ::com::sun::star::uno::RuntimeException ); + + +protected: + /** @descr In an array of SfxItemPropertyMap entries advance from the position pointed to + by pProperty to that property that has the name given by pPropertyName. If the + property list does not contain such an entry an UnknownPropertyException is thrown. + @param pProperty Pointer into an array of properties. It is modified such that after + the methods returns it points to a property with the same name as pPropertyName. + @param pPropertyName Name of the property that is searched for. + */ + void AdvanceToName (const SfxItemPropertyMap *& pProperty, + const ::rtl::OUString * pPropertyName); + + /** @descr Creates an item set and fill it with the models default values. + If derived classes need other than the default which ranges, the have to overload + this method. + @return Returns a pointer to an item set. The caller is responsible for deleting it. + */ + virtual SfxItemSet * CreateItemSet (void); + + /** @descr Retrieve the value of the property specified by rProperty from the item set given + by rAttributes and put it into rValue. + @param rProperty Specifies the property in question. + @param rValue The property's value is stored into this argument. + @param rAttributes The item set that contains all relevant items from which the property + value is extracted. + */ + virtual void GetPropertyValue (const SfxItemPropertyMap & rProperty, + ::com::sun::star::uno::Any & rValue, + SfxItemSet & rAttributes); + +private: + /// List of listeners for the XComponent interface. + ::cppu::OInterfaceContainerHelper maListenerList; + + /// Mutex used by the interface container. + ::osl::Mutex maMutex; +}; + +} //namespace binfilter +#endif // _CHXCHART_OBJECT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/inc/ChXDataPoint.hxx b/binfilter/bf_sch/source/ui/inc/ChXDataPoint.hxx new file mode 100644 index 000000000000..85bb2232dc14 --- /dev/null +++ b/binfilter/bf_sch/source/ui/inc/ChXDataPoint.hxx @@ -0,0 +1,144 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 _SCH_DATA_POINT_HXX +#define _SCH_DATA_POINT_HXX + +#include <cppuhelper/implbase5.hxx> + +#include <com/sun/star/drawing/XShapeDescriptor.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/beans/XPropertyState.hpp> +#include <com/sun/star/lang/XUnoTunnel.hpp> + +// header for SvxItemPropertySet +#include <bf_svx/unoprov.hxx> +namespace binfilter { + +class ChartModel; + +class ChXDataPoint : public cppu::WeakImplHelper5< + ::com::sun::star::beans::XPropertySet, + ::com::sun::star::beans::XPropertyState, + ::com::sun::star::drawing::XShapeDescriptor, + ::com::sun::star::lang::XServiceInfo, + ::com::sun::star::lang::XUnoTunnel > +{ +private: + SvxItemPropertySet maPropSet; + ChartModel* mpModel; + + sal_Int32 mnCol, mnRow; + + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > getStatisticsProperties( const sal_Int32 nId ) const; + void AddDataPointAttr( SfxItemSet& rOutAttributes ); + +public: + ChXDataPoint( sal_Int32 _Col, sal_Int32 _Row, ChartModel* _Model = NULL ); + virtual ~ChXDataPoint(); + + sal_Int32 GetCol() const { return mnCol; } + sal_Int32 GetRow() const { return mnRow; } + + static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId() throw(); + + // XTypeProvider + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() + throw( ::com::sun::star::uno::RuntimeException ); + + // XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() + throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, + const ::com::sun::star::uno::Any& aValue ) + throw( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::beans::PropertyVetoException, + ::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) + throw( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) + throw( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) + throw( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) + throw( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) + throw( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException ); + + // XPropertyState + virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) + throw( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) + throw( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) + throw( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& aPropertyName ) + throw( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException ); + + // XShapeDescriptor + virtual ::rtl::OUString SAL_CALL getShapeType() throw( ::com::sun::star::uno::RuntimeException ); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw( ::com::sun::star::uno::RuntimeException ); + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) + throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() + throw( ::com::sun::star::uno::RuntimeException ); + + // XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) + throw( ::com::sun::star::uno::RuntimeException ); +}; + +} //namespace binfilter +#endif // _SCH_DATA_POINT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/inc/ChXDataRow.hxx b/binfilter/bf_sch/source/ui/inc/ChXDataRow.hxx new file mode 100644 index 000000000000..d31fa7a0b36a --- /dev/null +++ b/binfilter/bf_sch/source/ui/inc/ChXDataRow.hxx @@ -0,0 +1,138 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 _SCH_DATA_ROW_HXX +#define _SCH_DATA_ROW_HXX + +#include <cppuhelper/implbase5.hxx> + +#include <com/sun/star/drawing/XShapeDescriptor.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/beans/XPropertyState.hpp> +#include <com/sun/star/lang/XUnoTunnel.hpp> + +// header for SvxItemPropertySet +#include <bf_svx/unoprov.hxx> +namespace binfilter { + +class ChartModel; + +class ChXDataRow : public cppu::WeakImplHelper5< + ::com::sun::star::beans::XPropertySet, + ::com::sun::star::beans::XPropertyState, + ::com::sun::star::drawing::XShapeDescriptor, + ::com::sun::star::lang::XServiceInfo, + ::com::sun::star::lang::XUnoTunnel > +{ +private: + SvxItemPropertySet maPropSet; + ChartModel* mpModel; + + sal_Int32 mnRow; + + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > getStatisticsProperties( sal_Int32 nId ) const; + +public: + ChXDataRow( sal_Int32 _Row, ChartModel* _Model = NULL ); + virtual ~ChXDataRow(); + + sal_Int32 GetRow() const { return mnRow; } + + static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId() throw(); + + // XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() + throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, + const ::com::sun::star::uno::Any& aValue ) + throw( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::beans::PropertyVetoException, + ::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) + throw( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) + throw( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) + throw( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) + throw( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) + throw( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException ); + + // XPropertyState + virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) + throw( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) + throw( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) + throw( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& aPropertyName ) + throw( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException ); + + // XShapeDescriptor + virtual ::rtl::OUString SAL_CALL getShapeType() throw( ::com::sun::star::uno::RuntimeException ); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw( ::com::sun::star::uno::RuntimeException ); + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) + throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() + throw( ::com::sun::star::uno::RuntimeException ); + + // XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) + throw( ::com::sun::star::uno::RuntimeException ); +}; + +} //namespace binfilter +#endif // _SCH_DATA_ROW_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/inc/ChXDiagram.hxx b/binfilter/bf_sch/source/ui/inc/ChXDiagram.hxx new file mode 100644 index 000000000000..0c1a0831020b --- /dev/null +++ b/binfilter/bf_sch/source/ui/inc/ChXDiagram.hxx @@ -0,0 +1,474 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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_DIAGRAM_HXX +#define _CHART_DIAGRAM_HXX + +#include <cppuhelper/implbase.hxx> + +#include <com/sun/star/chart/XDiagram.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/chart/XTwoAxisXSupplier.hpp> +#include <com/sun/star/chart/XTwoAxisYSupplier.hpp> +#include <com/sun/star/chart/XAxisZSupplier.hpp> +#include <com/sun/star/chart/XStatisticDisplay.hpp> +#include <com/sun/star/chart/X3DDisplay.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/beans/XMultiPropertySet.hpp> +#include <com/sun/star/beans/XPropertyState.hpp> +#include <com/sun/star/beans/XMultiPropertyStates.hpp> +#include <com/sun/star/lang/XUnoTunnel.hpp> +#include <com/sun/star/lang/IndexOutOfBoundsException.hpp> +#include <com/sun/star/lang/XComponent.hpp> +#include <com/sun/star/lang/XEventListener.hpp> +#include <cppuhelper/interfacecontainer.hxx> + +// header for class SvxItemPropertySet +#include <bf_svx/unoipset.hxx> +namespace binfilter { + +class ChartModel; +class SchChartDocShell; +} //namespace binfilter +// GrP gcc 2.95.2 on Mac OS X chokes on this huge template class. +// Expand the template by hand. +//#if ! (defined(MACOSX) && ( __GNUC__ < 3 )) +#if 1 + +// Construct a WeakImplHelper14 with the emphasis on 14. +// Fourteen interfaces are two to many to use the newer template definition +// of WeakImplHelper. +#define __IFC14 Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10,\ + Ifc11, Ifc12, Ifc13, Ifc14 +#define __CLASS_IFC14 class Ifc1, class Ifc2, class Ifc3, class Ifc4, \ + class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10,\ + class Ifc11, class Ifc12, class Ifc13, class Ifc14 +#define __PUBLIC_IFC14 public Ifc1, public Ifc2, public Ifc3, public Ifc4,\ + public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9,\ + public Ifc10, public Ifc11, public Ifc12, public Ifc13, public Ifc14 + +__DEF_IMPLHELPER_PRE(14) + __IFC_WRITEOFFSET(1) __IFC_WRITEOFFSET(2) __IFC_WRITEOFFSET(3)\ + __IFC_WRITEOFFSET(4) __IFC_WRITEOFFSET(5) __IFC_WRITEOFFSET(6)\ + __IFC_WRITEOFFSET(7) __IFC_WRITEOFFSET(8) __IFC_WRITEOFFSET(9)\ + __IFC_WRITEOFFSET(10) __IFC_WRITEOFFSET(11) __IFC_WRITEOFFSET(12)\ + __IFC_WRITEOFFSET(13) __IFC_WRITEOFFSET(14) +__DEF_IMPLHELPER_POST(14) + +// !defined(MACOSX) +#else +// defined(MACOSX) && (__GNUC__ < 3 ) + +namespace cppu { + struct ClassData14 : public ClassDataBase + { + Type_Offset arType2Offset[ 14 ]; + ClassData14( ) SAL_THROW( () ) + : ClassDataBase( 14 ) + {} + }; + + class SAL_NO_VTABLE ImplHelperBase14 + : public ::com::sun::star::lang::XTypeProvider + , public ::com::sun::star::chart::XDiagram, + public ::com::sun::star::chart::XAxisZSupplier, + public ::com::sun::star::chart::XTwoAxisXSupplier, + public ::com::sun::star::chart::XTwoAxisYSupplier, + public ::com::sun::star::chart::XStatisticDisplay, + public ::com::sun::star::chart::X3DDisplay, + public ::com::sun::star::beans::XPropertySet, + public ::com::sun::star::beans::XMultiPropertySet, + public ::com::sun::star::beans::XPropertyState, + public ::com::sun::star::beans::XMultiPropertyStates, + public ::com::sun::star::lang::XServiceInfo, + public ::com::sun::star::lang::XUnoTunnel, + public ::com::sun::star::lang::XComponent, + public ::com::sun::star::lang::XEventListener + { + protected: + ClassData & SAL_CALL getClassData( ClassDataBase & s_aCD ) SAL_THROW( () ) + { + ClassData & rCD = * static_cast< ClassData * >( &s_aCD ); + if (! rCD.bOffsetsInit) + { + ::osl::MutexGuard aGuard( getImplHelperInitMutex() ); + if (! rCD.bOffsetsInit) + { + char * pBase = (char *)this; + rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< ::com::sun::star::chart::XDiagram > *)0 ), + (char *)(::com::sun::star::chart::XDiagram *)this - pBase ); + rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< ::com::sun::star::chart::XAxisZSupplier > *)0 ), + (char *)(::com::sun::star::chart::XAxisZSupplier *)this - pBase ); + rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< ::com::sun::star::chart::XTwoAxisXSupplier > *)0 ), + (char *)(::com::sun::star::chart::XTwoAxisXSupplier *)this - pBase ); + rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< ::com::sun::star::chart::XTwoAxisYSupplier > *)0 ), + (char *)(::com::sun::star::chart::XTwoAxisYSupplier *)this - pBase ); + rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< ::com::sun::star::chart::XStatisticDisplay > *)0 ), + (char *)(::com::sun::star::chart::XStatisticDisplay *)this - pBase ); + rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< ::com::sun::star::chart::X3DDisplay > *)0 ), + (char *)(::com::sun::star::chart::X3DDisplay *)this - pBase ); + rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > *)0 ), + (char *)(::com::sun::star::beans::XPropertySet *)this - pBase ); + rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XMultiPropertySet > *)0 ), + (char *)(::com::sun::star::beans::XMultiPropertySet *)this - pBase ); + rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState > *)0 ), + (char *)(::com::sun::star::beans::XPropertyState *)this - pBase ); + rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XMultiPropertyStates > *)0 ), + (char *)(::com::sun::star::beans::XMultiPropertyStates *)this - pBase ); + rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XServiceInfo > *)0 ), + (char *)(::com::sun::star::lang::XServiceInfo *)this - pBase ); + rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XUnoTunnel > *)0 ), + (char *)(::com::sun::star::lang::XUnoTunnel *)this - pBase ); + rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > *)0 ), + (char *)(::com::sun::star::lang::XComponent *)this - pBase ); + rCD.writeTypeOffset( ::getCppuType( (const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > *)0 ), + (char *)(::com::sun::star::lang::XEventListener *)this - pBase ); + rCD.bOffsetsInit = sal_True; + } + } + return rCD; + } + }; + + + class SAL_NO_VTABLE ImplHelper14 + : public ImplHelperBase14 + { + static ClassData14 s_aCD; + public: + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) + { return getClassData( s_aCD ).query( rType, (ImplHelperBase14 *)this ); } + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) + { return getClassData( s_aCD ).getTypes(); } + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) + { return getClassData( s_aCD ).getImplementationId(); } + }; + + + class SAL_NO_VTABLE WeakImplHelper14 + : public ::cppu::OWeakObject + , public ImplHelperBase14 + { + static ClassData14 s_aCD; + public: + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException) + { + ::com::sun::star::uno::Any aRet( getClassData( s_aCD ).query( rType, (ImplHelperBase14 *)this ) ); + return (aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType )); + } + virtual void SAL_CALL acquire() throw () + { OWeakObject::acquire(); } + virtual void SAL_CALL release() throw () + { OWeakObject::release(); } + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException) + { return getClassData( s_aCD ).getTypes(); } + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException) + { return getClassData( s_aCD ).getImplementationId(); } + }; + + // namespace ::cppu +} + +#endif +namespace binfilter {//STRIP009 + class ChXDiagram : public ::cppu::WeakImplHelper14 + < + ::com::sun::star::chart::XDiagram, + ::com::sun::star::chart::XAxisZSupplier, + ::com::sun::star::chart::XTwoAxisXSupplier, // : XAxisXSupplier + ::com::sun::star::chart::XTwoAxisYSupplier, // : XAxisYSupplier + ::com::sun::star::chart::XStatisticDisplay, + ::com::sun::star::chart::X3DDisplay, + ::com::sun::star::beans::XPropertySet, + ::com::sun::star::beans::XMultiPropertySet, + ::com::sun::star::beans::XPropertyState, + ::com::sun::star::beans::XMultiPropertyStates, + ::com::sun::star::lang::XServiceInfo, + ::com::sun::star::lang::XUnoTunnel, + ::com::sun::star::lang::XComponent, + ::com::sun::star::lang::XEventListener + > +{ +private: + ::rtl::OUString maServiceName; + sal_Int32 mnBaseType; + ChartModel* mpModel; + SvxItemPropertySet maPropSet; + + // some shape references (ChXChartObjects) + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mxXAxisTitle; + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mxYAxisTitle; + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mxZAxisTitle; + + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mxXAxis; + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mxYAxis; + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mxZAxis; + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mxSecXAxis; + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mxSecYAxis; + + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mxMajorGridX; + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mxMajorGridY; + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mxMajorGridZ; + + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mxMinorGridX; + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mxMinorGridY; + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mxMinorGridZ; + + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mxMinMaxLine; + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mxUpBar; + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mxDownBar; + + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mxWall; + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mxFloor; + + + ::com::sun::star::uno::Any GetAnyByItem( SfxItemSet& aSet, const SfxItemPropertyMap* pMap ); + +public: + ChXDiagram( SchChartDocShell* pShell, sal_Bool bPreInit = sal_True ); + virtual ~ChXDiagram(); + + void SetServiceName( const ::rtl::OUString& u ) throw() { maServiceName = u; } + const ::rtl::OUString& getServiceName() throw() { return maServiceName; } + sal_Bool SetDocShell( SchChartDocShell* pDocShell, sal_Bool bKeepModel = sal_False ) throw(); + + static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId() throw(); + static ChXDiagram* getImplementation( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > ) throw(); + + // XDiagram + virtual ::rtl::OUString SAL_CALL getDiagramType() throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getDataRowProperties( sal_Int32 Row ) + throw( ::com::sun::star::uno::RuntimeException, + ::com::sun::star::lang::IndexOutOfBoundsException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getDataPointProperties( sal_Int32 Column, sal_Int32 Row ) + throw( ::com::sun::star::uno::RuntimeException, + ::com::sun::star::lang::IndexOutOfBoundsException ); + + // XShape ( ::XDiagram ) + virtual ::com::sun::star::awt::Size SAL_CALL getSize() + throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setSize( const ::com::sun::star::awt::Size& ) + throw( ::com::sun::star::beans::PropertyVetoException, + ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::awt::Point SAL_CALL getPosition() + throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setPosition( const ::com::sun::star::awt::Point& ) + throw( ::com::sun::star::uno::RuntimeException ); + + // XShapeDescriptor ( ::XShape ::XDiagram ) + virtual ::rtl::OUString SAL_CALL getShapeType() throw( ::com::sun::star::uno::RuntimeException ); + + + // XAxisXSupplier, XAxisYSupplier, XAxisZSupplier, + // XTwoAxisXSupplier, XTwoAxisYSupplier + virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > SAL_CALL getXAxisTitle() + throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > SAL_CALL getYAxisTitle() + throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > SAL_CALL getZAxisTitle() + throw( ::com::sun::star::uno::RuntimeException ); + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getXAxis() + throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getYAxis() + throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getZAxis() + throw( ::com::sun::star::uno::RuntimeException ); + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getSecondaryXAxis() + throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getSecondaryYAxis() + throw( ::com::sun::star::uno::RuntimeException ); + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getXMainGrid() + throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getYMainGrid() + throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getZMainGrid() + throw( ::com::sun::star::uno::RuntimeException ); + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getXHelpGrid() + throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getYHelpGrid() + throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getZHelpGrid() + throw( ::com::sun::star::uno::RuntimeException ); + + + // XStatisticDisplay + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getMinMaxLine() + throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getUpBar() + throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getDownBar() + throw( ::com::sun::star::uno::RuntimeException ); + + + // X3DDisplay + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getWall() + throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL getFloor() + throw( ::com::sun::star::uno::RuntimeException ); + + // XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() + throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, + const ::com::sun::star::uno::Any& aValue ) + throw( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::beans::PropertyVetoException, + ::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) + throw( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) + throw( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) + throw( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) + throw( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) + throw( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException ); + + // XMultiPropertySet + virtual void SAL_CALL setPropertyValues ( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, + const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) + throw (::com::sun::star::beans::PropertyVetoException, + ::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyValues ( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertiesChangeListener ( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertiesChangeListener ( + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL firePropertiesChangeEvent ( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) + throw (::com::sun::star::uno::RuntimeException); + + // XPropertyState + virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) + throw( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) + throw( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) + throw( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& aPropertyName ) + throw( ::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException ); + + // XMultiPropertyStates + // getPropertyStates already part of interface XPropertyState + virtual void SAL_CALL setAllPropertiesToDefault (void) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertiesToDefault ( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyDefaults ( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + + // XServiceInfo + // supportsService is handled by SvxServiceInfoHelper + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw( ::com::sun::star::uno::RuntimeException ); + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) + throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() + throw( ::com::sun::star::uno::RuntimeException ); + + + // XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) + throw( ::com::sun::star::uno::RuntimeException ); + + // XComponent + virtual void SAL_CALL dispose() throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) + throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) + throw( ::com::sun::star::uno::RuntimeException ); + + // XEventListener + virtual void SAL_CALL disposing (const ::com::sun::star::lang::EventObject & Source) + throw (::com::sun::star::uno::RuntimeException); + +protected: + /** @descr In an array of SfxItemPropertyMap entries advance from the position pointed to + by pProperty to that property that has the name given by pPropertyName. If the + property list does not contain such an entry an UnknownPropertyException is thrown. + @param pProperty Pointer into an array of properties. It is modified such that after + the methods returns it points to a property with the same name as pPropertyName. + @param pPropertyName Name of the property that is searched for. + */ + void AdvanceToName (const SfxItemPropertyMap *& pProperty, + const ::rtl::OUString * pPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException); + +private: + /// Mutex used by the interface container. + ::osl::Mutex maMutex; + + /// List of listeners for the XComponent interface. + ::cppu::OInterfaceContainerHelper maListenerList; +}; + +} //namespace binfilter +#endif // _CHART_DIAGRAM_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/inc/ChartArea.hxx b/binfilter/bf_sch/source/ui/inc/ChartArea.hxx new file mode 100644 index 000000000000..49ff1c541e1e --- /dev/null +++ b/binfilter/bf_sch/source/ui/inc/ChartArea.hxx @@ -0,0 +1,65 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 _CHARTAREA_HXX_ +#define _CHARTAREA_HXX_ + +#include "ChXChartObject.hxx" +namespace binfilter { + +class ChartArea : public ChXChartObject +{ +public: + ChartArea( ChartModel* pModel, sal_Int32 nObjectId ); + virtual ~ChartArea(); + + // helpers for XUnoTunnel + static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId() throw(); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() + throw( ::com::sun::star::uno::RuntimeException ); + + // XTypeProvider + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() + throw( ::com::sun::star::uno::RuntimeException ); + + // XShapeDescriptor + virtual ::rtl::OUString SAL_CALL getShapeType() throw( ::com::sun::star::uno::RuntimeException ); + + // XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) + throw( ::com::sun::star::uno::RuntimeException ); + +}; + +} //namespace binfilter +#endif // _CHARTAREA_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/inc/ChartGrid.hxx b/binfilter/bf_sch/source/ui/inc/ChartGrid.hxx new file mode 100644 index 000000000000..6f1b31bdf3b1 --- /dev/null +++ b/binfilter/bf_sch/source/ui/inc/ChartGrid.hxx @@ -0,0 +1,65 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 _CHARTGRID_HXX_ +#define _CHARTGRID_HXX_ + +#include "ChXChartObject.hxx" +namespace binfilter { + +class ChartGrid : public ChXChartObject +{ +public: + ChartGrid( ChartModel* pModel, sal_Int32 nObjectId ); + virtual ~ChartGrid(); + + // helpers for XUnoTunnel + static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId() throw(); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() + throw( ::com::sun::star::uno::RuntimeException ); + + // XTypeProvider + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() + throw( ::com::sun::star::uno::RuntimeException ); + + // XShapeDescriptor + virtual ::rtl::OUString SAL_CALL getShapeType() throw( ::com::sun::star::uno::RuntimeException ); + + // XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) + throw( ::com::sun::star::uno::RuntimeException ); + +}; + +} //namespace binfilter +#endif // _CHARTGRID_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/inc/ChartLegend.hxx b/binfilter/bf_sch/source/ui/inc/ChartLegend.hxx new file mode 100644 index 000000000000..e6f6bff55057 --- /dev/null +++ b/binfilter/bf_sch/source/ui/inc/ChartLegend.hxx @@ -0,0 +1,65 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 _CHARTLEGEND_HXX_ +#define _CHARTLEGEND_HXX_ + +#include "ChXChartObject.hxx" +namespace binfilter { + +class ChartLegend : public ChXChartObject +{ +public: + ChartLegend( ChartModel* pModel ); + virtual ~ChartLegend(); + + // helpers for XUnoTunnel + static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId() throw(); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() + throw( ::com::sun::star::uno::RuntimeException ); + + // XTypeProvider + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() + throw( ::com::sun::star::uno::RuntimeException ); + + // XShapeDescriptor + virtual ::rtl::OUString SAL_CALL getShapeType() throw( ::com::sun::star::uno::RuntimeException ); + + // XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) + throw( ::com::sun::star::uno::RuntimeException ); + +}; + +} //namespace binfilter +#endif // _CHARTLEGEND_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/inc/ChartLine.hxx b/binfilter/bf_sch/source/ui/inc/ChartLine.hxx new file mode 100644 index 000000000000..babbd6646355 --- /dev/null +++ b/binfilter/bf_sch/source/ui/inc/ChartLine.hxx @@ -0,0 +1,65 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 _CHARTLINE_HXX_ +#define _CHARTLINE_HXX_ + +#include "ChXChartObject.hxx" +namespace binfilter { + +class ChartLine : public ChXChartObject +{ +public: + ChartLine( ChartModel* pModel, sal_Int32 nObjectId, sal_Int32 nIndex = -1 ); + virtual ~ChartLine(); + + // helpers for XUnoTunnel + static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId() throw(); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() + throw( ::com::sun::star::uno::RuntimeException ); + + // XTypeProvider + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() + throw( ::com::sun::star::uno::RuntimeException ); + + // XShapeDescriptor + virtual ::rtl::OUString SAL_CALL getShapeType() throw( ::com::sun::star::uno::RuntimeException ); + + // XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) + throw( ::com::sun::star::uno::RuntimeException ); + +}; + +} //namespace binfilter +#endif // _CHARTLINE_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/inc/ChartTitle.hxx b/binfilter/bf_sch/source/ui/inc/ChartTitle.hxx new file mode 100644 index 000000000000..3f51b107abdd --- /dev/null +++ b/binfilter/bf_sch/source/ui/inc/ChartTitle.hxx @@ -0,0 +1,70 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 _CHARTTITLE_HXX_ +#define _CHARTTITLE_HXX_ + +#include "ChXChartObject.hxx" +namespace binfilter { + +class ChartTitle : public ChXChartObject +{ +public: + ChartTitle( ChartModel* pModel, sal_Int32 nObjectId ); + virtual ~ChartTitle(); + + // helpers for XUnoTunnel + static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId() throw(); + + /// special handling of title specific properties. Sub of getPropertyValues() + void GetPropertyValue( const SfxItemPropertyMap & rProperty, + ::com::sun::star::uno::Any & rValue, + SfxItemSet & rAttributes ); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() + throw( ::com::sun::star::uno::RuntimeException ); + + // XTypeProvider + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() + throw( ::com::sun::star::uno::RuntimeException ); + + // XShapeDescriptor + virtual ::rtl::OUString SAL_CALL getShapeType() throw( ::com::sun::star::uno::RuntimeException ); + + // XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) + throw( ::com::sun::star::uno::RuntimeException ); + +}; + +} //namespace binfilter +#endif // _CHARTTITLE_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/inc/SchTransferable.hxx b/binfilter/bf_sch/source/ui/inc/SchTransferable.hxx new file mode 100644 index 000000000000..0587bcd0e5cd --- /dev/null +++ b/binfilter/bf_sch/source/ui/inc/SchTransferable.hxx @@ -0,0 +1,72 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 _SCH_TRANSFERABLE_HXX_ +#define _SCH_TRANSFERABLE_HXX_ + +#include <bf_svtools/transfer.hxx> + +/*N*/ #include <tools/debug.hxx> //for stripping +class Graphic; +class VirtualDevice; +namespace binfilter { +class SdrModel; +class SdrExchangeView; + +class SchTransferable : + public TransferableHelper +{ +private: + SdrExchangeView * mpSourceView; + +protected: + + // implementation of TransferableHelper methods + +public: + + /** CTOR for clipboard, drag and drop and selection clipboard + @param pObjModel the model containing all objects for the clipboard. + The transferable becomes the owner of this model. + @param pSrcView the view for drag and drop and the selection clipboard + The transferable does not care about destruction of this view + @param rObjDesc A descriptor object that holds properties like the starting + position of a drag action + @param bLateInit If true, the actual data is created in GetData (on paste), + else data is created on construction + */ + SchTransferable( SdrModel* pObjModel, + SdrExchangeView* pSrcView, + const TransferableObjectDescriptor& rObjDesc, + sal_Bool bLateInit = sal_False ); + const SdrExchangeView* GetView() throw() { return mpSourceView; } +}; + +} //namespace binfilter +#endif // _SCH_TRANSFERABLE_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/inc/dlgctrls.hxx b/binfilter/bf_sch/source/ui/inc/dlgctrls.hxx new file mode 100644 index 000000000000..be1d70797136 --- /dev/null +++ b/binfilter/bf_sch/source/ui/inc/dlgctrls.hxx @@ -0,0 +1,57 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 SD_DLGCTRLS_HXX +#define SD_DLGCTRLS_HXX + +#include <vcl/lstbox.hxx> +#include <vcl/window.hxx> + +#include "schresid.hxx" +namespace binfilter { + +/************************************************************************* +|* +|* FadeEffectLB +|* +\************************************************************************/ +class FadeEffectLB : public ListBox +{ + +public: + FadeEffectLB( Window* pParent, SchResId Id ) : ListBox( pParent, Id ) {} + FadeEffectLB( Window* pParent, WinBits aWB ) : ListBox( pParent, aWB ) {} + + virtual void Fill(); +}; + +} //namespace binfilter +#endif // SD_DLGCTRLS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/inc/fudrarea.hxx b/binfilter/bf_sch/source/ui/inc/fudrarea.hxx new file mode 100644 index 000000000000..3b5ea2d2c417 --- /dev/null +++ b/binfilter/bf_sch/source/ui/inc/fudrarea.hxx @@ -0,0 +1,52 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 _SCH_FUDRAREA_HXX +#define _SCH_FUDRAREA_HXX + +#include "fupoor.hxx" +namespace binfilter { + +class SchFuDrawingArea : public SchFuPoor +{ + public: + SchFuDrawingArea(SchViewShell* pViewSh, SchWindow* pWin, + SchView* pView, ChartModel* pDoc, + SfxRequest& rReq); + + virtual ~SchFuDrawingArea(); + + virtual void Activate() {} + virtual void Deactivate() {} +}; + +} //namespace binfilter +#endif // _SCH_FUDRAREA_HXX + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/inc/fudraw.hxx b/binfilter/bf_sch/source/ui/inc/fudraw.hxx new file mode 100644 index 000000000000..18d12f2fb9fe --- /dev/null +++ b/binfilter/bf_sch/source/ui/inc/fudraw.hxx @@ -0,0 +1,184 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 _SCH_FUDRAW_HXX +#define _SCH_FUDRAW_HXX + +#include "fupoor.hxx" +namespace binfilter { + +/************************************************************************* +|* +|* Basisklasse fuer alle Drawmodul-spezifischen Funktionen +|* +\************************************************************************/ + +class SdrObject; + +class SchFuDraw : public SchFuPoor +{ +protected: + Pointer aNewPointer; + Pointer aOldPointer; + BOOL bMBDown; + + /** possible directions in which to select objects + */ + enum lcl_Selection_Direction + { + lcl_SELECT_PREVIOUS, + lcl_SELECT_NEXT, + lcl_SELECT_FIRST, + lcl_SELECT_LAST + }; + + /** possible directions in which to move an object + */ + enum lcl_Movement_Direction + { + lcl_MOVE_LEFT, + lcl_MOVE_RIGHT, + lcl_MOVE_UP, + lcl_MOVE_DOWN + }; + + /** marks the next/previous/first or last object in the current + group of chart objects. + + @param eDirection determines in which direction to travel + + @param nDepth is to prevent a loop in recursion. When + selecting a new object, this may be invalid. In this + case the method tries the next object. If the last + object is reached without success, the first is + selected using a recursive call. If no valid objects + are available at all this parameter avoids a loop + (which should normally never occur). + + @param bEnterDiagram determines if during navigation the + diagram should be ignored as group and its content + rather be treated as top-level objects. This parameter + is especially needed so that the diagram can still be + selected (without entering). + + @returns TRUE, if an object could be marked + */ + + /** moves an object in one of the four directions given in + lcl_Movement_Direction. This is only possible for top-level + chart objects, i.e., titles, legend and diagram + + @param eDirection the direction in which to move. If an + object is too close to the edge, the object is not + moved. + + @param nAmount the amount of units to be moved about. The + unit can be 100th of a mm or pixels depending on what + bPixel is set to. + + @param bPixel If true, the amount nAmount is treated as pixels + in the current window, otherwise the current logical + unit is used, which in a chart is always 100th of a mm. + + @returns TRUE, if the object could be moved + */ + + /** resizes an object by the amount given into the larger of width + and height. In the smaller extent the amount is calculated + such that the resize is proportional. + + @param nAmount the amount by which the object will be resized. + The amount will be added to the larger extent (width or + height). The resize is proportional in the other + direction. + + @param bPixel If true, the amount nAmount is treated as pixels + in the current window for the larger of width and + height. Otherwise the current logical unit is used, + which in a chart is always 100th of a mm. + + @returns TRUE, if the object could be resized + */ + + /** moves a pie segment by the given amount in percent + + @param bOut if true increases the offset, otherwise decreases + the offset. The offset stays always between 0 and 100. + + @param nAmount the amount of percent by which the pie segment + is dragged. + + @returns TRUE, if the object was a pie and could be moved + */ + + /** determines if the object currently selected is valid, i.e. it + may be selected in the UI for making changes. + + @returns true, if a valid object is selected. + */ + + /** For some objects only the 8 green handles of the group are + shown, for others a special handling is required, e.g. bars in + a bar chart. This is done here for the currently selected + object. + */ + + /** Some groups in a chart may not be entered, e.g. an axis + object. Otherwise you would be able to select all tick-mark + objects or labels. + + @returns true, if the currently selected object is a group + that may be entered, e.g. a data series object. + */ + + /** get the object which is currently selected in the UI. In the + chart this can only be one object at a time. + */ + + /** after move or resize there have to be some things set at chart + objects and the model. It is called by MoveMarkedObject. + */ + +public: + + SchFuDraw(SchViewShell* pViewSh, SchWindow* pWin, SchView* pView, + ChartModel* pDoc, SfxRequest& rReq); + virtual ~SchFuDraw(); + + + virtual void Activate(); + + virtual void ForcePointer(const MouseEvent* pMEvt = NULL); + +}; + +} //namespace binfilter +#endif // _SCH_FUDRAW_HXX + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/inc/fupoor.hxx b/binfilter/bf_sch/source/ui/inc/fupoor.hxx new file mode 100644 index 000000000000..5cd79ac586f3 --- /dev/null +++ b/binfilter/bf_sch/source/ui/inc/fupoor.hxx @@ -0,0 +1,106 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 _SCH_FUPOOR_HXX +#define _SCH_FUPOOR_HXX +//------------------------------------------------------------------ +// +// dieses Define dient nur zum Testen und darf auf keinen Fall aktiv bleiben +// Bei Umstellungen alle Files nach SIG_CHARTMODELDEFSCHDOC durchsuchen +// #define ChartModel SchChartDocument +//------------------------------------------------------------------ + +#include <vcl/dialog.hxx> + +#include "objid.hxx" +namespace binfilter { + +class SchView; +class SchViewShell; +class SchWindow; +class ChartModel; +class SfxRequest; + +#define HITPIX 2 // Hit-Toleranz in Pixel +#define DRGPIX 2 // Drag MinMove in Pixel + + +/************************************************************************* +|* +|* Basisklasse fuer alle Funktionen +|* +\************************************************************************/ + +class SchFuPoor +{ +protected: + SchView* pView; + SchViewShell* pViewShell; + SchWindow* pWindow; + ChartModel* pChDoc; + + USHORT nSlotId; + USHORT nSlotValue; + + Dialog* pDialog; + + Timer aDragTimer; // fuer Drag&Drop + DECL_LINK(DragHdl, Timer*); + BOOL bIsInDragMode; + Point aMDPos; // Position von MouseButtonDown + + SdrObject *pMarkedObj; + SchObjectId *pMarkedObjId; + UINT16 nMarkedID; + + BOOL bFirstMouseMove; + + +public: + + SchFuPoor(SchViewShell* pViewSh, SchWindow* pWin, SchView* pView, + ChartModel* pDoc, SfxRequest& rReq); + virtual ~SchFuPoor(); + + + // Mouse- & Key-Events; Returnwert=TRUE: Event wurde bearbeitet + + virtual void Activate(); // Function aktivieren + virtual void Deactivate(); // Function deaktivieren + + + + USHORT GetSlotID() const { return( nSlotId ); } + +}; + +} //namespace binfilter +#endif // _SCH_FUPOOR_HXX + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/inc/fuscale.hxx b/binfilter/bf_sch/source/ui/inc/fuscale.hxx new file mode 100644 index 000000000000..1bcaa52fceab --- /dev/null +++ b/binfilter/bf_sch/source/ui/inc/fuscale.hxx @@ -0,0 +1,50 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 _SCH_FUSCALE_HXX +#define _SCH_FUSCALE_HXX + +#include "fupoor.hxx" +namespace binfilter { + +class SchFuScale : public SchFuPoor +{ + public: + SchFuScale(SchViewShell* pViewSh, SchWindow* pWin, SchView* pView, + ChartModel* pDoc, SfxRequest& rReq); + virtual ~SchFuScale(); + + virtual void Activate(); // Function aktivieren + virtual void Deactivate(); // Function deaktivieren +}; + +} //namespace binfilter +#endif // _SCH_FUSCALE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/inc/fusel.hxx b/binfilter/bf_sch/source/ui/inc/fusel.hxx new file mode 100644 index 000000000000..44b85d68b741 --- /dev/null +++ b/binfilter/bf_sch/source/ui/inc/fusel.hxx @@ -0,0 +1,69 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 _SCH_FUSEL_HXX +#define _SCH_FUSEL_HXX + + +#include "fudraw.hxx" +namespace binfilter { + +class SdrDragMethod; +class SdrCircObj; + +/************************************************************************* +|* +|* Basisklasse fuer alle Funktionen +|* +\************************************************************************/ + +class SchFuSelection : public SchFuDraw +{ +protected: + BOOL bWasSelected; + BOOL bVCAction; + SdrDragMethod* pDragMethod; + + +public: + + SchFuSelection(SchViewShell* pViewSh, SchWindow* pWin, SchView* pView, + ChartModel* pDoc, SfxRequest& rReq); + + virtual ~SchFuSelection(); + + + virtual void Activate(); + virtual void Deactivate(); +}; + +} //namespace binfilter +#endif // _SCH_FUSEL_HXX + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/inc/fuzoom.hxx b/binfilter/bf_sch/source/ui/inc/fuzoom.hxx new file mode 100644 index 000000000000..ac998999cad5 --- /dev/null +++ b/binfilter/bf_sch/source/ui/inc/fuzoom.hxx @@ -0,0 +1,71 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 _SCH_FUZOOM_HXX +#define _SCH_FUZOOM_HXX + + +#include "fupoor.hxx" +namespace binfilter { + +/************************************************************************* +|* +|* Funktion Zoom +|* +\************************************************************************/ + +class SchFuZoom : public SchFuPoor +{ + protected: + Point aBeginPos; + Rectangle aZoomRect; + BOOL bVisible; + BOOL bStartDrag; + Pointer aPtr; + + public: + SchFuZoom(SchViewShell* pViewSh, SchWindow* pWin, SchView* pView, + ChartModel* pDoc, SfxRequest& rReq); + + virtual ~SchFuZoom(); + // Mouse- & Key-Events + virtual BOOL KeyInput(const KeyEvent& rKEvt); + virtual BOOL MouseMove(const MouseEvent& rMEvt); + virtual BOOL MouseButtonUp(const MouseEvent& rMEvt); + virtual BOOL MouseButtonDown(const MouseEvent& rMEvt); + + virtual void Activate(); // Function aktivieren + virtual void Deactivate(); // Function deaktivieren +}; + + + +} //namespace binfilter +#endif // _SCH_FUZOOM_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/inc/globopt.hxx b/binfilter/bf_sch/source/ui/inc/globopt.hxx new file mode 100644 index 000000000000..1194c5c47422 --- /dev/null +++ b/binfilter/bf_sch/source/ui/inc/globopt.hxx @@ -0,0 +1,58 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 _SCH_GLOBOPT_HXX +#define _SCH_GLOBOPT_HXX + +#include <vcl/fldunit.hxx> +namespace binfilter { + +namespace sch +{ + +namespace util +{ + +/** @descr Retrieve the FieldUnit to be used for the UI. This unit is retrieved + from the registry settings of the Calc application. + + If this setting can not be found there is a fallback to cm which is the most + common setting worldwide (or not?) + + @return the FieldUnit enum. See <vcl/fldunit.hxx> for definition + */ +FieldUnit GetMeasureUnit(); + +} // namespace util +} // namespace sch + + +// _SCH_GLOBOPT_HXX +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/inc/guiutil.hxx b/binfilter/bf_sch/source/ui/inc/guiutil.hxx new file mode 100644 index 000000000000..cd0e590b28b1 --- /dev/null +++ b/binfilter/bf_sch/source/ui/inc/guiutil.hxx @@ -0,0 +1,45 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 _SCH_GUI_UTIL_HXX +#define _SCH_GUI_UTIL_HXX + +#include <tools/solar.h> +namespace binfilter { +class ChartModel; + +class GuiUtilities +{ +public: + static USHORT GetObjectNameResId(UINT16 nObjId, ChartModel& rDoc); +}; + +} //namespace binfilter +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/inc/res_bmp.hrc b/binfilter/bf_sch/source/ui/inc/res_bmp.hrc new file mode 100644 index 000000000000..ddd968c8d16f --- /dev/null +++ b/binfilter/bf_sch/source/ui/inc/res_bmp.hrc @@ -0,0 +1,54 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 <bf_sfx2/sfx.hrc> + + +//#define RID_APP_START 30000 +#define RID_DRAW_TOOLBOX (RID_SCH_START + 1) +#define RID_STATUSBAR (RID_APP_START + 10002) +//#define RID_ALIGNMENT (RID_APP_START + 3) +//#define RID_ZOOM (RID_APP_START + 4) +//#define RID_CONTROLS (RID_APP_START + 5) +//#define RID_TEXT_TOOLBOX (RID_APP_START + 6) + + + + + +#define RID_ACCEL (RID_APP_START + 80) +#define RID_MENU (RID_APP_START + 81) +#define RID_PORTAL_MENU (RID_APP_START + 82) + + + + + + +// Popup-Menus + + +//*** diff --git a/binfilter/bf_sch/source/ui/inc/res_hc_bmp.hrc b/binfilter/bf_sch/source/ui/inc/res_hc_bmp.hrc new file mode 100644 index 000000000000..fdb4a0146fdc --- /dev/null +++ b/binfilter/bf_sch/source/ui/inc/res_hc_bmp.hrc @@ -0,0 +1,126 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 <bf_svtools/solar.hrc> + +// RID_SCH_START is 30512 (see svtools/solar.hrc) + +// chart types + +#define BMP_AREAS_2D_HC ( RID_SCH_START + 0 ) +#define BMP_AREAS_2D_1_HC ( RID_SCH_START + 1 ) +#define BMP_AREAS_2D_3_HC ( RID_SCH_START + 2 ) +#define BMP_AREAS_3D_HC ( RID_SCH_START + 3 ) +#define BMP_AREAS_3D_1_HC ( RID_SCH_START + 4 ) +#define BMP_AREAS_3D_2_HC ( RID_SCH_START + 5 ) +#define BMP_BARS_2D_HC ( RID_SCH_START + 6 ) +#define BMP_BARS_2D_1_HC ( RID_SCH_START + 7 ) +#define BMP_BARS_2D_2_HC ( RID_SCH_START + 8 ) +#define BMP_BARS_2D_3_HC ( RID_SCH_START + 9 ) +#define BMP_BARS_3D_HC ( RID_SCH_START + 10 ) +#define BMP_BARS_3D_1_HC ( RID_SCH_START + 11 ) +#define BMP_BARS_3D_2_HC ( RID_SCH_START + 12 ) +#define BMP_BARS_3D_3_HC ( RID_SCH_START + 13 ) +#define BMP_CIRCLES_2D_HC ( RID_SCH_START + 14 ) +#define BMP_CIRCLES_2D_1_HC ( RID_SCH_START + 15 ) +#define BMP_CIRCLES_2D_2_HC ( RID_SCH_START + 16 ) +#define BMP_CIRCLES_3D_HC ( RID_SCH_START + 17 ) +#define BMP_COLUMNS_2D_HC ( RID_SCH_START + 18 ) +#define BMP_COLUMNS_2D_1_HC ( RID_SCH_START + 19 ) +#define BMP_COLUMNS_2D_2_HC ( RID_SCH_START + 20 ) +#define BMP_COLUMNS_2D_3_HC ( RID_SCH_START + 21 ) +#define BMP_COLUMNS_2D_4_HC ( RID_SCH_START + 22 ) +#define BMP_COLUMNS_3D_HC ( RID_SCH_START + 23 ) +#define BMP_COLUMNS_3D_1_HC ( RID_SCH_START + 24 ) +#define BMP_COLUMNS_3D_2_HC ( RID_SCH_START + 25 ) +#define BMP_COLUMNS_3D_3_HC ( RID_SCH_START + 26 ) +#define BMP_DONUT1_2D_HC ( RID_SCH_START + 27 ) +#define BMP_KEGELQ_3D_1_HC ( RID_SCH_START + 28 ) +#define BMP_KEGELQ_3D_2_HC ( RID_SCH_START + 29 ) +#define BMP_KEGELQ_3D_3_HC ( RID_SCH_START + 30 ) +#define BMP_KEGELQ_3D_4_HC ( RID_SCH_START + 31 ) +#define BMP_KEGEL_3D_1_HC ( RID_SCH_START + 32 ) +#define BMP_KEGEL_3D_2_HC ( RID_SCH_START + 33 ) +#define BMP_KEGEL_3D_3_HC ( RID_SCH_START + 34 ) +#define BMP_KEGEL_3D_4_HC ( RID_SCH_START + 35 ) +#define BMP_LINESYMB_2D_HC ( RID_SCH_START + 36 ) +#define BMP_LINESYMB_2D_1_HC ( RID_SCH_START + 37 ) +#define BMP_LINESYMB_2D_2_HC ( RID_SCH_START + 38 ) +#define BMP_LINESYMB_2D_3_HC ( RID_SCH_START + 39 ) +#define BMP_LINES_2D_HC ( RID_SCH_START + 40 ) +#define BMP_LINES_2D_1_HC ( RID_SCH_START + 41 ) +#define BMP_LINES_2D_2_HC ( RID_SCH_START + 42 ) +#define BMP_LINES_2D_3_HC ( RID_SCH_START + 43 ) +#define BMP_LINES_3D_HC ( RID_SCH_START + 44 ) +#define BMP_NETSYMB_2D_HC ( RID_SCH_START + 45 ) +#define BMP_NETSYMB_2D_PERCENT_HC ( RID_SCH_START + 46 ) +#define BMP_NETSYMB_2D_STACK_HC ( RID_SCH_START + 47 ) +#define BMP_NET_2D_HC ( RID_SCH_START + 48 ) +#define BMP_NET_2D_PERCENT_HC ( RID_SCH_START + 49 ) +#define BMP_NET_2D_STACK_HC ( RID_SCH_START + 50 ) +#define BMP_PYRAMIDQ_3D_1_HC ( RID_SCH_START + 51 ) +#define BMP_PYRAMIDQ_3D_2_HC ( RID_SCH_START + 52 ) +#define BMP_PYRAMIDQ_3D_3_HC ( RID_SCH_START + 53 ) +#define BMP_PYRAMIDQ_3D_4_HC ( RID_SCH_START + 54 ) +#define BMP_PYRAMID_3D_1_HC ( RID_SCH_START + 55 ) +#define BMP_PYRAMID_3D_2_HC ( RID_SCH_START + 56 ) +#define BMP_PYRAMID_3D_3_HC ( RID_SCH_START + 57 ) +#define BMP_PYRAMID_3D_4_HC ( RID_SCH_START + 58 ) +#define BMP_ROEHRE_3D_1_HC ( RID_SCH_START + 59 ) +#define BMP_ROEHRE_3D_2_HC ( RID_SCH_START + 60 ) +#define BMP_ROEHRE_3D_3_HC ( RID_SCH_START + 61 ) +#define BMP_ROEHRE_3D_4_HC ( RID_SCH_START + 62 ) +#define BMP_SAEULE_3D_1_HC ( RID_SCH_START + 63 ) +#define BMP_SAEULE_3D_2_HC ( RID_SCH_START + 64 ) +#define BMP_SAEULE_3D_3_HC ( RID_SCH_START + 65 ) +#define BMP_SAEULE_3D_4_HC ( RID_SCH_START + 66 ) +#define BMP_SPLINE_B_HC ( RID_SCH_START + 67 ) +#define BMP_SPLINE_B_SYMBOL_HC ( RID_SCH_START + 68 ) +#define BMP_SPLINE_CUBIC_HC ( RID_SCH_START + 69 ) +#define BMP_SPLINE_CUBIC_SYMBOL_HC ( RID_SCH_START + 70 ) +#define BMP_STOCK_1_HC ( RID_SCH_START + 71 ) +#define BMP_STOCK_2_HC ( RID_SCH_START + 72 ) +#define BMP_STOCK_3_HC ( RID_SCH_START + 73 ) +#define BMP_STOCK_4_HC ( RID_SCH_START + 74 ) +#define BMP_SURF_3D_HC ( RID_SCH_START + 75 ) +#define BMP_XYSYMB_2D_HC ( RID_SCH_START + 76 ) +#define BMP_XYZSYMB_3D_HC ( RID_SCH_START + 77 ) +#define BMP_XYZ_3D_HC ( RID_SCH_START + 78 ) +#define BMP_XY_2D_HC ( RID_SCH_START + 79 ) +#define BMP_COLUMNS_2D_5_HC ( RID_SCH_START + 80 ) + +// statistics + +#define BMP_INDICATE_NONE_HC ( RID_SCH_START + 81 ) +#define BMP_INDICATE_BOTH_HC ( RID_SCH_START + 82 ) +#define BMP_INDICATE_UP_HC ( RID_SCH_START + 83 ) +#define BMP_INDICATE_DOWN_HC ( RID_SCH_START + 84 ) + +#define BMP_REGRESSION_NONE_HC ( RID_SCH_START + 85 ) +#define BMP_REGRESSION_LINEAR_HC ( RID_SCH_START + 86 ) +#define BMP_REGRESSION_LOG_HC ( RID_SCH_START + 87 ) +#define BMP_REGRESSION_EXP_HC ( RID_SCH_START + 88 ) +#define BMP_REGRESSION_POWER_HC ( RID_SCH_START + 89 ) diff --git a/binfilter/bf_sch/source/ui/inc/schhids.h b/binfilter/bf_sch/source/ui/inc/schhids.h new file mode 100644 index 000000000000..d24b7712f918 --- /dev/null +++ b/binfilter/bf_sch/source/ui/inc/schhids.h @@ -0,0 +1,93 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 <bf_svtools/solar.hrc> + +#define HID_SCH_DATA_ROW (HID_SCH_START + 0) +#define HID_SCH_DATA_LINE (HID_SCH_START + 1) +#define HID_SCH_DATA_POINT (HID_SCH_START + 2) +#define HID_SCH_DIAGRAM_X_AXIS (HID_SCH_START + 3) + +#define HID_SCH_ALIGNMENT (HID_SCH_START + 4) +#define HID_SCH_LEGEND_POS (HID_SCH_START + 5) +#define HID_SCH_DATA_DESCR (HID_SCH_START + 6) +#define HID_SCH_SCALE_Y (HID_SCH_START + 7) +#define HID_SCH_STAT (HID_SCH_START + 8) +#define HID_SCH_WIN_DOCUMENT (HID_SCH_START + 9) +#define HID_SCH_CTL_DATA (HID_SCH_START + 10) +#define HID_SCH_CT_INDICATE (HID_SCH_START + 11) +#define HID_SCH_CT_REGRESS (HID_SCH_START + 12) +#define HID_SCH_CT_1_CHARTTYPE (HID_SCH_START + 13) +#define HID_SCH_CT_2_CHARTVARIANT (HID_SCH_START + 14) +#define HID_SCH_CTL_TYPE (HID_SCH_START + 15) +#define HID_SCH_CTL_VARIANT (HID_SCH_START + 16) +#define HID_SCH_CTL_LIGHT (HID_SCH_START + 17) +#define HID_SCH_CT_INDICATE2 (HID_SCH_START + 18) +#define HID_SCH_CT_REGRESS2 (HID_SCH_START + 19) +#define HID_SCH_TBI_EDIT_CANCEL (HID_SCH_START + 20) +#define HID_SCH_TBI_EDIT_ACCEPT (HID_SCH_START + 21) +#define HID_SCH_TBI_DATA_TRANSFER (HID_SCH_START + 22) +#define HID_SCH_TBI_DATA_INSERT_ROW (HID_SCH_START + 23) +#define HID_SCH_TBI_DATA_INSERT_COL (HID_SCH_START + 24) +#define HID_SCH_TBI_DATA_DELETE_ROW (HID_SCH_START + 25) +#define HID_SCH_TBI_DATA_DELETE_COL (HID_SCH_START + 26) +#define HID_SCH_TBI_DATA_SWAP_COL (HID_SCH_START + 27) +#define HID_SCH_TBI_DATA_SWAP_ROW (HID_SCH_START + 28) +#define HID_SCH_TBI_DATA_SORT_ROW (HID_SCH_START + 29) +#define HID_SCH_TBI_DATA_SORT_COL (HID_SCH_START + 30) +#define HID_SCH_TBI_DATA_SORT_TABLE_ROW (HID_SCH_START + 31) +#define HID_SCH_TBI_DATA_SORT_TABLE_COL (HID_SCH_START + 32) + +#define HID_SCH_TBX_EDIT (HID_SCH_START + 33) +#define HID_SCH_TBX_DATA (HID_SCH_START + 34) + + +#define HID_SCH_ALIGNMENT_CTR_DIAL (HID_SCH_START + 35) +#define HID_SCH_ALIGNMENT_STACKED (HID_SCH_START + 36) +#define HID_SCH_ALIGNMENT_DEGREES (HID_SCH_START + 37) + +#define HID_SCH_LAYOUT (HID_SCH_START + 38) + +#define HID_SCH_TBX_EDIT_FIELD (HID_SCH_START + 39) +#define HID_SCH_DIAGRAM_Y_AXIS (HID_SCH_START + 40)//war mal 3 + +#define HID_SCH_DEF_COLOR (HID_SCH_START + 41) +#define HID_SCH_TP_AXIS_LABEL (HID_SCH_START + 42) + +#define HID_SCH_NUM_OF_LINES (HID_SCH_START + 43) + +#define HID_SCH_CHART_AUTO_FORMAT (HID_SCH_START + 44) + +// HID_SCH_START should be 63280 (checked 25.Nov 2002) + +// 453 == SCH_IF_CHARTVIEWSHELL, da SFX_INTERFACE_LIB kein +// Define sondern neuerdings ein Enum ist +#define HID_SCH_VIEWSHELL_DOCUMENT (453) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/inc/sdvcbrw.hxx b/binfilter/bf_sch/source/ui/inc/sdvcbrw.hxx new file mode 100644 index 000000000000..209cc45e6a00 --- /dev/null +++ b/binfilter/bf_sch/source/ui/inc/sdvcbrw.hxx @@ -0,0 +1,71 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 _SDVCBRW_HXX +#define _SDVCBRW_HXX +/* +#include <bf_svx/vcbrw.hxx> +*/ +#include <bf_svtools/brdcst.hxx> + +#include <bf_svtools/lstner.hxx> +namespace binfilter { + +class SdrView; + +/************************************************************************* +|* +|* Klasse fuer Browser +|* +\************************************************************************/ +class SdVCBrowser : public VCBrowser //, public SfxListener, public SfxBroadcaster +{ +protected: + SdrView* pView; + BOOL bUpdate; + + BOOL Close(); + + virtual void SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, + const SfxHint& rHint, const TypeId& rHintType ); + void Modify(); + + +public: + SdVCBrowser( Window* pParent ); + + void Update( SdrView* pView ); +}; + + + + +} //namespace binfilter +#endif // _SDVCBRW_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/inc/tbx_ww.hxx b/binfilter/bf_sch/source/ui/inc/tbx_ww.hxx new file mode 100644 index 000000000000..c5e9c6c5964c --- /dev/null +++ b/binfilter/bf_sch/source/ui/inc/tbx_ww.hxx @@ -0,0 +1,61 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 _SCH_TBX_WW_HXX +#define _SCH_TBX_WW_HXX + +#include <vcl/toolbox.hxx> +#include <bf_sfx2/tbxctrl.hxx> + + +#include "schresid.hxx" +namespace binfilter { + +//------------------------------------------------------------------------ + +class SchPopupWindowTbx : public SfxPopupWindow +{ +private: + ToolBox aTbx; + +public: + SchPopupWindowTbx( USHORT nId, SfxToolBoxControl* pTbxCtl, + SchResId aRIdWin, SchResId aRIdTbx, + SfxBindings& rBindings ); + ~SchPopupWindowTbx() {} + + void StartSelection() { aTbx.StartSelection(); } + void SelectHdl( void* p ); +}; + +} //namespace binfilter +#endif // _SCH_TBX_WW_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/unoidl/descr/ChXChartAxis.xml b/binfilter/bf_sch/source/ui/unoidl/descr/ChXChartAxis.xml new file mode 100644 index 000000000000..83090d61c2ad --- /dev/null +++ b/binfilter/bf_sch/source/ui/unoidl/descr/ChXChartAxis.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE module-description PUBLIC "-//StarOffice//DTD ComponentDescription 1.0//EN" "module-description.dtd"> +<module-description xmlns:xlink="http://www.w3.org/1999/xlink"> + <module-name>sch</module-name> + <component-description> + <author>Bjoern Milcke</author> + <name>com.sun.star.comp.office.ChXChartAxis</name> + <description> + This component provides access to axis objects of a chart +</description> + <loader-name>com.sun.star.loader.SharedLibrary</loader-name> + <language>c++</language> + <status value="final"/> + <supported-service>com.sun.star.chart.ChartAxis</supported-service> + <supported-service>com.sun.star.drawing.LineProperties</supported-service> + <supported-service>com.sun.star.style.CharacterProperties</supported-service> + <supported-service>com.sun.star.xml.UserDefinedAttributeSupplier</supported-service> + </component-description> +</module-description> diff --git a/binfilter/bf_sch/source/ui/unoidl/descr/ChXChartData.xml b/binfilter/bf_sch/source/ui/unoidl/descr/ChXChartData.xml new file mode 100644 index 000000000000..ca50925fac39 --- /dev/null +++ b/binfilter/bf_sch/source/ui/unoidl/descr/ChXChartData.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE module-description PUBLIC "-//StarOffice//DTD ComponentDescription 1.0//EN" "module-description.dtd"> +<module-description xmlns:xlink="http://www.w3.org/1999/xlink"> + <module-name>sch</module-name> + <component-description> + <author>Bjoern Milcke</author> + <name>com.sun.star.comp.office.ChXChartData</name> + <description> + This component yields access to the data of a chart +</description> + <loader-name>com.sun.star.loader.SharedLibrary</loader-name> + <language>c++</language> + <status value="final"/> + <supported-service>com.sun.star.chart.ChartData</supported-service> + </component-description> +</module-description> diff --git a/binfilter/bf_sch/source/ui/unoidl/descr/ChXChartDataArray.xml b/binfilter/bf_sch/source/ui/unoidl/descr/ChXChartDataArray.xml new file mode 100644 index 000000000000..431a44fc5b47 --- /dev/null +++ b/binfilter/bf_sch/source/ui/unoidl/descr/ChXChartDataArray.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE module-description PUBLIC "-//StarOffice//DTD ComponentDescription 1.0//EN" "module-description.dtd"> +<module-description xmlns:xlink="http://www.w3.org/1999/xlink"> + <module-name>sch</module-name> + <component-description> + <author>Bjoern Milcke</author> + <name>com.sun.star.comp.office.ChXChartDataArray</name> + <description> + With this component you can retrieve or alter the data of a chart +</description> + <loader-name>com.sun.star.loader.SharedLibrary</loader-name> + <language>c++</language> + <status value="final"/> + <supported-service>com.sun.star.chart.ChartData</supported-service> + <supported-service>com.sun.star.chart.ChartDataArray</supported-service> + </component-description> +</module-description> diff --git a/binfilter/bf_sch/source/ui/unoidl/descr/ChXChartDocument.xml b/binfilter/bf_sch/source/ui/unoidl/descr/ChXChartDocument.xml new file mode 100644 index 000000000000..08ae9a42fc0a --- /dev/null +++ b/binfilter/bf_sch/source/ui/unoidl/descr/ChXChartDocument.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE module-description PUBLIC "-//StarOffice//DTD ComponentDescription 1.0//EN" "module-description.dtd"> +<module-description xmlns:xlink="http://www.w3.org/1999/xlink"> + <module-name>sch</module-name> + <component-description> + <author>Bjoern Milcke</author> + <name>com.sun.star.comp.office.ChXChartDocument</name> + <description> + This component represents the document (XModel) that + contains a chart +</description> + <loader-name>com.sun.star.loader.SharedLibrary</loader-name> + <language>c++</language> + <status value="final"/> + <supported-service>com.sun.star.chart.ChartDocument</supported-service> + <supported-service>com.sun.star.chart.ChartTableAddressSupplier</supported-service> + <supported-service>com.sun.star.xml.UserDefinedAttributeSupplier</supported-service> + </component-description> +</module-description> diff --git a/binfilter/bf_sch/source/ui/unoidl/descr/ChXChartView.xml b/binfilter/bf_sch/source/ui/unoidl/descr/ChXChartView.xml new file mode 100644 index 000000000000..79a9d9c1a2d5 --- /dev/null +++ b/binfilter/bf_sch/source/ui/unoidl/descr/ChXChartView.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE module-description PUBLIC "-//StarOffice//DTD ComponentDescription 1.0//EN" "module-description.dtd"> +<module-description xmlns:xlink="http://www.w3.org/1999/xlink"> + <module-name>sch</module-name> + <component-description> + <author>Bjoern Milcke</author> + <name>com.sun.star.comp.office.ChXChartView</name> + <description> + This component provides access to the view of a chart document. + It can be used to select objects inside the chart as if clicked + using the mouse. +</description> + <loader-name>com.sun.star.loader.SharedLibrary</loader-name> + <language>c++</language> + <status value="final"/> + <supported-service>com.sun.star.view.OfficeDocumentView</supported-service> + </component-description> +</module-description> diff --git a/binfilter/bf_sch/source/ui/unoidl/descr/ChXDataPoint.xml b/binfilter/bf_sch/source/ui/unoidl/descr/ChXDataPoint.xml new file mode 100644 index 000000000000..69b167ea53f6 --- /dev/null +++ b/binfilter/bf_sch/source/ui/unoidl/descr/ChXDataPoint.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE module-description PUBLIC "-//StarOffice//DTD ComponentDescription 1.0//EN" "module-description.dtd"> +<module-description xmlns:xlink="http://www.w3.org/1999/xlink"> + <module-name>sch</module-name> + <component-description> + <author>Bjoern Milcke</author> + <name>com.sun.star.comp.office.ChXDataPoint</name> + <description> + This component bears properties for data point objects of + a chart +</description> + <loader-name>com.sun.star.loader.SharedLibrary</loader-name> + <language>c++</language> + <status value="final"/> + <supported-service>com.sun.star.chart.ChartDataPointProperties</supported-service> + <supported-service>com.sun.star.drawing.LineProperties</supported-service> + <supported-service>com.sun.star.drawing.FillProperties</supported-service> + <supported-service>com.sun.star.style.CharacterProperties</supported-service> + <supported-service>com.sun.star.xml.UserDefinedAttributeSupplier</supported-service> + </component-description> +</module-description> diff --git a/binfilter/bf_sch/source/ui/unoidl/descr/ChXDataRow.xml b/binfilter/bf_sch/source/ui/unoidl/descr/ChXDataRow.xml new file mode 100644 index 000000000000..18487050d2bf --- /dev/null +++ b/binfilter/bf_sch/source/ui/unoidl/descr/ChXDataRow.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE module-description PUBLIC "-//StarOffice//DTD ComponentDescription 1.0//EN" "module-description.dtd"> +<module-description xmlns:xlink="http://www.w3.org/1999/xlink"> + <module-name>sch</module-name> + <component-description> + <author>Bjoern Milcke</author> + <name>com.sun.star.comp.office.ChXDataRow</name> + <description> + This component provides properties for a series of a chart, + i.e. a group of corresponding data points +</description> + <loader-name>com.sun.star.loader.SharedLibrary</loader-name> + <language>c++</language> + <status value="final"/> + <supported-service>com.sun.star.chart.ChartDataPointProperties</supported-service> + <supported-service>com.sun.star.chart.ChartDataRowProperties</supported-service> + <supported-service>com.sun.star.chart.ChartStatistics</supported-service> + <supported-service>com.sun.star.drawing.LineProperties</supported-service> + <supported-service>com.sun.star.drawing.FillProperties</supported-service> + <supported-service>com.sun.star.style.CharacterProperties</supported-service> + <supported-service>com.sun.star.xml.UserDefinedAttributeSupplier</supported-service> + </component-description> +</module-description> diff --git a/binfilter/bf_sch/source/ui/unoidl/descr/ChXDiagram.xml b/binfilter/bf_sch/source/ui/unoidl/descr/ChXDiagram.xml new file mode 100644 index 000000000000..e567ffeb8a05 --- /dev/null +++ b/binfilter/bf_sch/source/ui/unoidl/descr/ChXDiagram.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE module-description PUBLIC "-//StarOffice//DTD ComponentDescription 1.0//EN" "module-description.dtd"> +<module-description xmlns:xlink="http://www.w3.org/1999/xlink"> + <module-name>sch</module-name> + <component-description> + <author>Bjoern Milcke</author> + <name>com.sun.star.comp.office.ChXDiagram</name> + <description> + This component provides access to the plotting area of the chart, + i.e. the object where the chart data is represented graphically. +</description> + <loader-name>com.sun.star.loader.SharedLibrary</loader-name> + <language>c++</language> + <status value="final"/> + <supported-service>com.sun.star.chart.Diagram</supported-service> + <supported-service>com.sun.star.chart.LineDiagram</supported-service> + <supported-service>com.sun.star.chart.ChartAxisXSupplier</supported-service> + <supported-service>com.sun.star.chart.ChartAxisYSupplier</supported-service> + <supported-service>com.sun.star.chart.ChartTwoAxisXSupplier</supported-service> + <supported-service>com.sun.star.chart.ChartTwoAxisYSupplier</supported-service> + <supported-service>com.sun.star.chart.StackableDiagram</supported-service> + <supported-service>com.sun.star.chart.Dim3DDiagram</supported-service> + <supported-service>com.sun.star.chart.AreaDiagram</supported-service> + <supported-service>com.sun.star.chart.BarDiagram</supported-service> + <supported-service>com.sun.star.chart.PieDiagram</supported-service> + <supported-service>com.sun.star.chart.DonutDiagram</supported-service> + <supported-service>com.sun.star.chart.XYDiagram</supported-service> + <supported-service>com.sun.star.chart.NetDiagram</supported-service> + <supported-service>com.sun.star.chart.StockDiagram</supported-service> + <supported-service>com.sun.star.xml.UserDefinedAttributeSupplier</supported-service> + </component-description> +</module-description> diff --git a/binfilter/bf_sch/source/ui/unoidl/descr/ChartArea.xml b/binfilter/bf_sch/source/ui/unoidl/descr/ChartArea.xml new file mode 100644 index 000000000000..285472f6760d --- /dev/null +++ b/binfilter/bf_sch/source/ui/unoidl/descr/ChartArea.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE module-description PUBLIC "-//StarOffice//DTD ComponentDescription 1.0//EN" "module-description.dtd"> +<module-description xmlns:xlink="http://www.w3.org/1999/xlink"> + <module-name>sch</module-name> + <component-description> + <author>Bjoern Milcke</author> + <name>com.sun.star.comp.office.ChartArea</name> + <description> + This component represents the background object of the entire + chart region. +</description> + <loader-name>com.sun.star.loader.SharedLibrary</loader-name> + <language>c++</language> + <status value="final"/> + <supported-service>com.sun.star.chart.ChartArea</supported-service> + <supported-service>com.sun.star.drawing.FillProperties</supported-service> + <supported-service>com.sun.star.drawing.LineProperties</supported-service> + <supported-service>com.sun.star.xml.UserDefinedAttributeSupplier</supported-service> + </component-description> +</module-description> diff --git a/binfilter/bf_sch/source/ui/unoidl/descr/ChartGrid.xml b/binfilter/bf_sch/source/ui/unoidl/descr/ChartGrid.xml new file mode 100644 index 000000000000..0652b89f6595 --- /dev/null +++ b/binfilter/bf_sch/source/ui/unoidl/descr/ChartGrid.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE module-description PUBLIC "-//StarOffice//DTD ComponentDescription 1.0//EN" "module-description.dtd"> +<module-description xmlns:xlink="http://www.w3.org/1999/xlink"> + <module-name>sch</module-name> + <component-description> + <author>Bjoern Milcke</author> + <name>com.sun.star.comp.office.ChartGrid</name> + <description> + This component provides access to the line objects representing + grids inside the plot area of a chart +</description> + <loader-name>com.sun.star.loader.SharedLibrary</loader-name> + <language>c++</language> + <status value="final"/> + <supported-service>com.sun.star.chart.ChartGrid</supported-service> + <supported-service>com.sun.star.drawing.LineProperties</supported-service> + <supported-service>com.sun.star.xml.UserDefinedAttributeSupplier</supported-service> + </component-description> +</module-description> diff --git a/binfilter/bf_sch/source/ui/unoidl/descr/ChartLegend.xml b/binfilter/bf_sch/source/ui/unoidl/descr/ChartLegend.xml new file mode 100644 index 000000000000..de8c69cf85e1 --- /dev/null +++ b/binfilter/bf_sch/source/ui/unoidl/descr/ChartLegend.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE module-description PUBLIC "-//StarOffice//DTD ComponentDescription 1.0//EN" "module-description.dtd"> +<module-description xmlns:xlink="http://www.w3.org/1999/xlink"> + <module-name>sch</module-name> + <component-description> + <author>Bjoern Milcke</author> + <name>com.sun.star.comp.office.ChartLegend</name> + <description> + This component provides access to the legend object of a chart +</description> + <loader-name>com.sun.star.loader.SharedLibrary</loader-name> + <language>c++</language> + <status value="final"/> + <supported-service>com.sun.star.chart.ChartLegend</supported-service> + <supported-service>com.sun.star.style.CharacterProperties</supported-service> + <supported-service>com.sun.star.drawing.FillProperties</supported-service> + <supported-service>com.sun.star.drawing.LineProperties</supported-service> + <supported-service>com.sun.star.xml.UserDefinedAttributeSupplier</supported-service> + </component-description> +</module-description> diff --git a/binfilter/bf_sch/source/ui/unoidl/descr/ChartLine.xml b/binfilter/bf_sch/source/ui/unoidl/descr/ChartLine.xml new file mode 100644 index 000000000000..4e03597f6875 --- /dev/null +++ b/binfilter/bf_sch/source/ui/unoidl/descr/ChartLine.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE module-description PUBLIC "-//StarOffice//DTD ComponentDescription 1.0//EN" "module-description.dtd"> +<module-description xmlns:xlink="http://www.w3.org/1999/xlink"> + <module-name>sch</module-name> + <component-description> + <author>Bjoern Milcke</author> + <name>com.sun.star.comp.office.ChartLine</name> + <description> + This component provides line properties of several linear objects + in a chart like a mean-value-line or a regression curve +</description> + <loader-name>com.sun.star.loader.SharedLibrary</loader-name> + <language>c++</language> + <status value="final"/> + <supported-service>com.sun.star.chart.ChartLine</supported-service> + <supported-service>com.sun.star.drawing.LineProperties</supported-service> + <supported-service>com.sun.star.xml.UserDefinedAttributeSupplier</supported-service> + </component-description> +</module-description> diff --git a/binfilter/bf_sch/source/ui/unoidl/descr/ChartTitle.xml b/binfilter/bf_sch/source/ui/unoidl/descr/ChartTitle.xml new file mode 100644 index 000000000000..8972f3c97f5b --- /dev/null +++ b/binfilter/bf_sch/source/ui/unoidl/descr/ChartTitle.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE module-description PUBLIC "-//StarOffice//DTD ComponentDescription 1.0//EN" "module-description.dtd"> +<module-description xmlns:xlink="http://www.w3.org/1999/xlink"> + <module-name>sch</module-name> + <component-description> + <author>Bjoern Milcke</author> + <name>com.sun.star.comp.office.ChartTitle</name> + <description> + This component provides main-/subtitle of the chart and + titles of axis objects +</description> + <loader-name>com.sun.star.loader.SharedLibrary</loader-name> + <language>c++</language> + <status value="final"/> + <supported-service>com.sun.star.chart.ChartTitle</supported-service> + <supported-service>com.sun.star.drawing.Shape</supported-service> + <supported-service>com.sun.star.style.CharacterProperties</supported-service> + <supported-service>com.sun.star.xml.UserDefinedAttributeSupplier</supported-service> + </component-description> +</module-description> diff --git a/binfilter/bf_sch/source/ui/unoidl/makefile.mk b/binfilter/bf_sch/source/ui/unoidl/makefile.mk new file mode 100644 index 000000000000..041c621a164c --- /dev/null +++ b/binfilter/bf_sch/source/ui/unoidl/makefile.mk @@ -0,0 +1,90 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# 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. +# +#************************************************************************* + +EXTERNAL_WARNINGS_NOT_ERRORS := TRUE +PRJ=..$/..$/..$/.. +BFPRJ=..$/..$/.. + +PRJNAME = binfilter +PROJECTPCH = sch +PROJECTPCHSOURCE = $(BFPRJ)$/util$/sch_sch +TARGET = sch_chxchart +ENABLE_EXCEPTIONS = TRUE +BOOTSTRAP_SERVICE = FALSE + +# --- Settings ----------------------------------------------------- +.INCLUDE : settings.mk +INC+= -I$(PRJ)$/inc$/bf_sch + +.IF "$(GUI)" == "WNT" +CFLAGS+=-Zm500 +.ENDIF + +# --- Files -------------------------------------------------------- + +CXXFILES = \ + sch_ChXChartAxis.cxx \ + sch_ChXChartData.cxx \ + sch_ChXChartDataChangeEventListener.cxx \ + sch_ChXChartDocument.cxx \ + sch_ChXChartObject.cxx \ + sch_ChXDataPoint.cxx \ + sch_ChXDataRow.cxx \ + sch_ChXDiagram.cxx \ + sch_mapprov.cxx \ + sch_ChXChartDrawPage.cxx \ + sch_ChartLegend.cxx \ + sch_ChartTitle.cxx \ + sch_ChartLegend.cxx \ + sch_ChartArea.cxx \ + sch_ChartLine.cxx \ + sch_ChartGrid.cxx \ + sch_register.cxx \ + sch_unodoc.cxx + +SLOFILES = \ + $(SLO)$/sch_ChXChartAxis.obj \ + $(SLO)$/sch_ChXChartData.obj \ + $(SLO)$/sch_ChXChartDataChangeEventListener.obj \ + $(SLO)$/sch_ChXChartDocument.obj \ + $(SLO)$/sch_ChXChartObject.obj \ + $(SLO)$/sch_ChXDataPoint.obj \ + $(SLO)$/sch_ChXDataRow.obj \ + $(SLO)$/sch_ChXDiagram.obj \ + $(SLO)$/sch_mapprov.obj \ + $(SLO)$/sch_ChXChartDrawPage.obj \ + $(SLO)$/sch_ChartLegend.obj \ + $(SLO)$/sch_ChartTitle.obj \ + $(SLO)$/sch_ChartArea.obj \ + $(SLO)$/sch_ChartLine.obj \ + $(SLO)$/sch_ChartGrid.obj \ + $(SLO)$/sch_register.obj \ + $(SLO)$/sch_unodoc.obj + +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk diff --git a/binfilter/bf_sch/source/ui/unoidl/sch_ChXChartAxis.cxx b/binfilter/bf_sch/source/ui/unoidl/sch_ChXChartAxis.cxx new file mode 100644 index 000000000000..021e4add9e08 --- /dev/null +++ b/binfilter/bf_sch/source/ui/unoidl/sch_ChXChartAxis.cxx @@ -0,0 +1,901 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 "ChXChartAxis.hxx" +#include "schattr.hxx" + +// header for class OGuard +// header for class Application +#include <vcl/svapp.hxx> +#include <rtl/uuid.h> +#include <rtl/memory.h> +#include <rtl/ustring.h> + +// header for SvxDoubleItem +#ifndef _SVX_CHRTITEM_HXX +#define ITEMID_DOUBLE 0 +#define ITEMID_CHARTTEXTORDER SCHATTR_TEXT_ORDER +#define ITEMID_CHARTTEXTORIENT SCHATTR_TEXT_ORIENT + +#include <bf_svtools/eitem.hxx> + +#endif +#include "charttyp.hxx" +// header for SvxUnoTextRangeBase +// for OWN_ATTR_... +#include <bf_svx/unoshprp.hxx> +// for SID_ATTR_... +#include <bf_svx/svxids.hrc> +#include <bf_svx/unoshape.hxx> + +#include <com/sun/star/chart/ChartAxisArrangeOrderType.hpp> + +#include "chaxis.hxx" +#include "mapprov.hxx" +#include "pairs.hxx" + +#include "unonames.hxx" + +namespace binfilter { + +using namespace ::rtl; +using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::beans; + + +ChXChartAxis::ChXChartAxis( ChartModel* _Model, long _WhichId ) : + ChXChartObject( CHMAP_AXIS, _Model, _WhichId ) +{ +} + +ChXChartAxis::~ChXChartAxis() +{} + + +::rtl::OUString SAL_CALL ChXChartAxis::getImplementationName() +throw( uno::RuntimeException ) +{ + return SCH_ASCII_TO_OU( "ChXChartAxis" ); +} + +uno::Sequence< ::rtl::OUString > SAL_CALL ChXChartAxis::getSupportedServiceNames() + throw( uno::RuntimeException ) +{ + SolarMutexGuard aGuard; + + uno::Sequence< ::rtl::OUString > aSeq( 4 ); + aSeq[ 0 ] = ::rtl::OUString::createFromAscii( "com.sun.star.chart.ChartAxis" ); + aSeq[ 1 ] = ::rtl::OUString::createFromAscii( "com.sun.star.drawing.LineProperties" ); + aSeq[ 2 ] = ::rtl::OUString::createFromAscii( "com.sun.star.style.CharacterProperties" ); + aSeq[ 3 ] = ::rtl::OUString::createFromAscii( "com.sun.star.xml.UserDefinedAttributeSupplier" ); + + return aSeq; +} + +// generate a unique Id +const uno::Sequence< sal_Int8 > & ChXChartAxis::getUnoTunnelId() throw() +{ + static uno::Sequence< sal_Int8 > * pSeq = 0; + if( !pSeq ) + { + osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); + if( !pSeq ) + { + static uno::Sequence< sal_Int8 > aSeq( 16 ); + rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True ); + pSeq = &aSeq; + } + } + return *pSeq; +} + +void ChXChartAxis::InitNumberFormatter() throw( uno::RuntimeException ) +{ + if( ! rNumberFormatter.is()) + { + if( mpModel ) + rNumberFormatter = new SvNumberFormatsSupplierObj( mpModel->GetNumFormatter() ); + else + rNumberFormatter = new SvNumberFormatsSupplierObj(); + } + + if( ! rNumberFormatter.is()) + throw uno::RuntimeException(); +} + +// XNumberFormatsSupplier +uno::Reference< beans::XPropertySet > SAL_CALL ChXChartAxis::getNumberFormatSettings() throw( uno::RuntimeException ) +{ + SolarMutexGuard aGuard; + InitNumberFormatter(); + + return rNumberFormatter.get()->getNumberFormatSettings(); +} + +uno::Reference< util::XNumberFormats > SAL_CALL ChXChartAxis::getNumberFormats() throw( uno::RuntimeException ) +{ + SolarMutexGuard aGuard; + InitNumberFormatter(); + + return rNumberFormatter.get()->getNumberFormats(); +} + +// XInterface +uno::Any SAL_CALL ChXChartAxis::queryInterface( const uno::Type & rType ) + throw ( uno::RuntimeException ) +{ + uno::Any aAny = ChXChartObject::queryInterface( rType ); + + if( ! aAny.hasValue() ) + { + InitNumberFormatter(); + aAny = rNumberFormatter.get()->queryInterface( rType ); + } + + return aAny; +} + +void SAL_CALL ChXChartAxis::acquire() throw() +{ + ChXChartObject::acquire(); +} + +void SAL_CALL ChXChartAxis::release() throw() +{ + ChXChartObject::release(); +} + +// XTypeProvider +uno::Sequence< uno::Type > SAL_CALL ChXChartAxis::getTypes() throw( uno::RuntimeException ) +{ + if( maTypeSequence.getLength() == 0 ) + { + const uno::Sequence< uno::Type > aBaseTypes( ChXChartObject::getTypes() ); + const sal_Int32 nBaseTypes = aBaseTypes.getLength(); + const uno::Type* pBaseTypes = aBaseTypes.getConstArray(); + + maTypeSequence.realloc( nBaseTypes + 1 ); // Note: Keep the size updated !! + uno::Type* pTypes = maTypeSequence.getArray(); + + *pTypes++ = ::getCppuType((const uno::Reference< util::XNumberFormatsSupplier >*)0); + + for( sal_Int32 nType = 0; nType < nBaseTypes; nType++ ) + *pTypes++ = *pBaseTypes++; + } + + return maTypeSequence; +} + +uno::Sequence< sal_Int8 > SAL_CALL ChXChartAxis::getImplementationId() throw( uno::RuntimeException ) +{ + static uno::Sequence< sal_Int8 > aId; + if( aId.getLength() == 0 ) + { + aId.realloc( 16 ); + rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True ); + } + return aId; +} + +// XShapeDescriptor +::rtl::OUString SAL_CALL ChXChartAxis::getShapeType() + throw( uno::RuntimeException ) +{ + return ::rtl::OUString::createFromAscii( "com.sun.star.chart.ChartAxis" ); +} + +// XUnoTunnel +sal_Int64 SAL_CALL ChXChartAxis::getSomething( const uno::Sequence< sal_Int8 >& aIdentifier ) + throw( uno::RuntimeException ) +{ + if( aIdentifier.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), + aIdentifier.getConstArray(), 16 ) ) + { + return (sal_Int64)this; + } + return 0; +} + +// XPropertySet +uno::Any SAL_CALL ChXChartAxis::getPropertyValue( const ::rtl::OUString& PropertyName ) + throw( beans::UnknownPropertyException, + lang::WrappedTargetException, + uno::RuntimeException ) +{ + SolarMutexGuard aGuard; + + if( mpModel ) + { + uno::Any aAny; + if( PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( UNONAME_TEXT_ORDER ))) + { + SfxItemSet aSet( mpModel->GetItemPool(), SCHATTR_TEXT_ORDER, SCHATTR_TEXT_ORDER ); + mpModel->GetAttr( mnWhichId, aSet ); + + chart::ChartAxisArrangeOrderType eArrOrder; + SvxChartTextOrder eTextOrder = + ((const SvxChartTextOrderItem&)(aSet.Get( SCHATTR_TEXT_ORDER ))).GetValue(); + + switch( eTextOrder ) + { + case CHTXTORDER_SIDEBYSIDE: + eArrOrder = chart::ChartAxisArrangeOrderType_SIDE_BY_SIDE; break; + case CHTXTORDER_DOWNUP: + eArrOrder = chart::ChartAxisArrangeOrderType_STAGGER_EVEN; break; + case CHTXTORDER_UPDOWN: + eArrOrder = chart::ChartAxisArrangeOrderType_STAGGER_ODD; break; + case CHTXTORDER_AUTO: + default: + eArrOrder = chart::ChartAxisArrangeOrderType_AUTO; break; + } + aAny <<= eArrOrder; + return aAny; + } + else if( PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( UNONAME_NUMBERFORMAT ))) + { + // if we have a percent chart use the correct number format item + ChartType aType( mpModel ); + if( aType.IsPercent()) + { + SfxItemSet aSet( mpModel->GetItemPool(), SCHATTR_AXIS_NUMFMTPERCENT, SCHATTR_AXIS_NUMFMTPERCENT ); + mpModel->GetAttr( mnWhichId, aSet ); + + aAny <<= (sal_Int32)(((const SfxUInt32Item&)(aSet.Get( SCHATTR_AXIS_NUMFMTPERCENT ))).GetValue()); + return aAny; + } + } + } + + return ChXChartObject::getPropertyValue( PropertyName ); +} + +void SAL_CALL ChXChartAxis::setPropertyValue( const ::rtl::OUString& aPropertyName, const uno::Any& aValue ) + throw( beans::UnknownPropertyException, + beans::PropertyVetoException, + lang::IllegalArgumentException, + lang::WrappedTargetException, + uno::RuntimeException ) +{ + SolarMutexGuard aGuard; + + if( mpModel && mnWhichId != CHOBJID_ANY ) + { + const SfxItemPropertyMap* pMap = maPropSet.getPropertyMapEntry( aPropertyName ); + + if( pMap && pMap->nWID ) + { + if( pMap->nFlags & beans::PropertyAttribute::READONLY ) + throw beans::PropertyVetoException(); + + USHORT nWID = pMap->nWID; + + // create item set that contains nWID and maybe more + USHORT nAutoWid = 0; + SfxItemSet* pSet = NULL; + switch( nWID ) + { + // min/max/stepmain/stephelp/origin need to disable the auto-settings + case SCHATTR_AXIS_MIN: + nAutoWid = SCHATTR_AXIS_AUTO_MIN; + break; + case SCHATTR_AXIS_MAX: + nAutoWid = SCHATTR_AXIS_AUTO_MAX; + break; + case SCHATTR_AXIS_STEP_MAIN: + nAutoWid = SCHATTR_AXIS_AUTO_STEP_MAIN; + break; + case SCHATTR_AXIS_STEP_HELP: + nAutoWid = SCHATTR_AXIS_AUTO_STEP_HELP; + break; + case SCHATTR_AXIS_ORIGIN: + nAutoWid = SCHATTR_AXIS_AUTO_ORIGIN; + break; + + case SCHATTR_AXIS_LOGARITHM: + pSet = new SfxItemSet( mpModel->GetItemPool(), nWID, nWID, + SCHATTR_AXIS_AUTO_STEP_MAIN, SCHATTR_AXIS_AUTO_STEP_MAIN, + SCHATTR_AXIS_MIN, SCHATTR_AXIS_MIN, + SCHATTR_AXIS_MAX, SCHATTR_AXIS_MAX, 0 ); + break; + case SCHATTR_AXIS_AUTO_STEP_MAIN: + pSet = new SfxItemSet( mpModel->GetItemPool(), nWID, nWID, + SCHATTR_AXIS_STEP_MAIN, SCHATTR_AXIS_STEP_MAIN, 0 ); + break; + case SCHATTR_AXIS_AUTO_STEP_HELP: + pSet = new SfxItemSet( mpModel->GetItemPool(), nWID, nWID, + SCHATTR_AXIS_STEP_HELP, SCHATTR_AXIS_STEP_HELP, 0 ); + break; + + case XATTR_LINEEND: + case XATTR_LINESTART: + case XATTR_LINEDASH: + // there is a special handling done in the base class for this + ChXChartObject::setPropertyValue( aPropertyName, aValue ); + return; // RETURN ! + + case SCHATTR_AXIS_NUMFMT: + { + ChartType aType( mpModel ); + if( aType.IsPercent()) + { + nWID = SCHATTR_AXIS_NUMFMTPERCENT; + } + } + // intentionally not breaking ! (nWID just changed) + default: + pSet = new SfxItemSet( mpModel->GetItemPool(), nWID, nWID ); + } + if( nAutoWid ) + pSet = new SfxItemSet( mpModel->GetItemPool(), nWID, nWID, + nAutoWid, nAutoWid, 0 ); + DBG_ASSERT( pSet, "ItemSet was not created!" ); + + mpModel->GetAttr( mnWhichId, *pSet ); + + if( pSet->GetItemState( nWID ) != SFX_ITEM_SET ) + { + // get default from ItemPool + if( mpModel->GetItemPool().IsWhich( nWID )) + { + pSet->Put( mpModel->GetItemPool().GetDefaultItem( nWID )); + } + else if( nWID != SID_ATTR_NUMBERFORMAT_SOURCE ) + { +#ifdef DBG_UTIL + String aTmpString( aPropertyName ); + ByteString aProp( aTmpString, RTL_TEXTENCODING_ASCII_US ); + DBG_ERROR2( "ChartAxis: Property %s has an invalid ID (%d)", aProp.GetBuffer(), nWID ); +#endif + } + } + + // special treatment for some properties + switch( nWID ) + { + case SCHATTR_TEXT_ORDER: + { + SvxChartTextOrder eTextOrder; + chart::ChartAxisArrangeOrderType eArrOrder; + if( ! ( aValue >>= eArrOrder )) + { + // basic might give us an int instead of the enum type + sal_Int32 nIntVal; + if( aValue >>= nIntVal ) + { + eArrOrder = SAL_STATIC_CAST( chart::ChartAxisArrangeOrderType, nIntVal ); + } + } + switch( eArrOrder ) + { + case chart::ChartAxisArrangeOrderType_SIDE_BY_SIDE: + eTextOrder = CHTXTORDER_SIDEBYSIDE; break; + case chart::ChartAxisArrangeOrderType_STAGGER_EVEN: + eTextOrder = CHTXTORDER_DOWNUP; break; + case chart::ChartAxisArrangeOrderType_STAGGER_ODD: + eTextOrder = CHTXTORDER_UPDOWN; break; + case chart::ChartAxisArrangeOrderType_AUTO: + default: + eTextOrder = CHTXTORDER_AUTO; break; + } + pSet->Put( SvxChartTextOrderItem( eTextOrder )); + } + break; + case SCHATTR_TEXT_ORIENT: + { + sal_Bool bVal; + if( aValue >>= bVal ) + { + pSet->Put( SvxChartTextOrientItem( + bVal + ? CHTXTORIENT_STACKED + : CHTXTORIENT_AUTOMATIC )); + } + } + break; + case SCHATTR_AXIS_AUTO_STEP_MAIN: + case SCHATTR_AXIS_AUTO_STEP_HELP: + { + sal_Bool bVal; + aValue >>= bVal; + if( ! bVal ) + { + USHORT nStepWID = ( (nWID == SCHATTR_AXIS_AUTO_STEP_MAIN) ? + SCHATTR_AXIS_STEP_MAIN : + SCHATTR_AXIS_STEP_HELP ); + + BOOL bLog = FALSE; + ChartAxis* pAxis = mpModel->GetAxis( mnWhichId ); + if( pAxis ) + bLog = pAxis->IsLogarithm(); + const SfxPoolItem* pPoolItem = NULL; + if( pSet->GetItemState( nStepWID, TRUE, &pPoolItem ) == SFX_ITEM_SET ) + { + double fOld = ((const SvxDoubleItem*)pPoolItem)->GetValue(); + if( fOld <= (bLog? 1.0: 0.0) ) + pSet->Put( SvxDoubleItem( bLog? 10.0 : 1.0, nStepWID ) ); + } + } + maPropSet.setPropertyValue( pMap, aValue, *pSet ); + } + break; + case SCHATTR_AXIS_LOGARITHM: + { + sal_Bool bVal; + aValue >>= bVal; + if( bVal ) + { + // for logarithmic scale always use automatic steps + pSet->Put( SfxBoolItem( SCHATTR_AXIS_AUTO_STEP_MAIN, TRUE ) ); + + const SfxPoolItem* pPoolItem = NULL; + double fMin = 0.0; + if( pSet->GetItemState( SCHATTR_AXIS_MIN, TRUE, &pPoolItem ) == SFX_ITEM_SET ) + { + fMin = ((const SvxDoubleItem*)pPoolItem)->GetValue(); + if( fMin <= 0.0 ) + pSet->Put( SvxDoubleItem( 1.0, SCHATTR_AXIS_MIN ) ); + } + if( pSet->GetItemState( SCHATTR_AXIS_MAX, TRUE, &pPoolItem ) == SFX_ITEM_SET ) + { + if( ((const SvxDoubleItem*)pPoolItem)->GetValue() <= fMin ) + pSet->Put( SvxDoubleItem( fMin * 10.0, SCHATTR_AXIS_MAX )); + } + } + maPropSet.setPropertyValue( pMap, aValue, *pSet ); + } + break; + + case SCHATTR_AXIS_STEP_MAIN: + case SCHATTR_AXIS_STEP_HELP: + { + BOOL bLog = FALSE; + ChartAxis* pAxis = mpModel->GetAxis( mnWhichId ); + if( pAxis ) + bLog = pAxis->IsLogarithm(); + double fVal; + aValue >>= fVal; + if( fVal <= bLog? 1.0: 0.0 ) + throw lang::IllegalArgumentException(); + + pSet->Put( SfxBoolItem( nAutoWid, FALSE )); + maPropSet.setPropertyValue( pMap, aValue, *pSet ); + } + break; + + case SCHATTR_AXIS_MIN: + case SCHATTR_AXIS_MAX: + { + ChartAxis* pAxis = mpModel->GetAxis( mnWhichId ); + double fVal; + aValue >>= fVal; + if( pAxis && + pAxis->IsLogarithm() && fVal <= 0.0 ) + throw lang::IllegalArgumentException(); + + pSet->Put( SfxBoolItem( nAutoWid, FALSE )); + maPropSet.setPropertyValue( pMap, aValue, *pSet ); + } + break; + + case SCHATTR_AXIS_ORIGIN: + pSet->Put( SfxBoolItem( nAutoWid, FALSE )); + maPropSet.setPropertyValue( pMap, aValue, *pSet ); + break; + + case SCHATTR_AXIS_NUMFMTPERCENT: + // was mapped from SCHATTR_AXIS_NUMFMT, so don't use standard mechanism + { + sal_Int32 nFmt; + aValue >>= nFmt; + pSet->Put( SfxUInt32Item( nWID, nFmt )); + } + break; + + case SID_ATTR_NUMBERFORMAT_SOURCE: + // this is not a which id (>4999) + { + sal_Bool bUseSource = sal_False; + aValue >>= bUseSource; + pSet->Put( SfxBoolItem( nWID, bUseSource )); + } + break; + + default: + // CL: convert special character properties + if( !SvxUnoTextRangeBase::SetPropertyValueHelper( *pSet, pMap, aValue, *pSet )) + maPropSet.setPropertyValue( pMap, aValue, *pSet ); + break; + } + + if( pSet->Count() ) + mpModel->ChangeAttr( *pSet, mnWhichId ); + else + throw beans::UnknownPropertyException(); + + delete pSet; + } + else + { + throw beans::UnknownPropertyException(); + } + } +} + + + +/* + In contrast to calling the method setPropertyValue (singular) for every given property name + the implementation of this method exploits the following properties: + 1: Both the given sequence of property names and the member property map are sorted according + to the property names. + 2: The item set which gathers all items changed by setting the properties is created only once. + 3: The solar mutex is acquired only once. +*/ +void SAL_CALL ChXChartAxis::setPropertyValues ( + const Sequence<OUString > & aPropertyNames, + const Sequence<Any > & aValues ) + throw ( beans::PropertyVetoException, + lang::IllegalArgumentException, + lang::WrappedTargetException, + uno::RuntimeException) +{ + SolarMutexGuard aGuard; + + if (mpModel == NULL || mnWhichId == CHOBJID_ANY) + return; + + // Get pointers to first elements of lists. + const SfxItemPropertyMap * pProperty = maPropSet.getPropertyMap (); + const OUString * pPropertyName = aPropertyNames.getConstArray (); + const Any * pValue = aValues.getConstArray (); + + USHORT nWID, nAutoWID; + + // Create the item which collects all items modified by setting a property. + SfxItemSet aAttributes (mpModel->GetItemPool(), nAxisWhichPairs); + mpModel->GetAttr (mnWhichId, aAttributes); + + // Iterate over all the given property names. + sal_Int32 nCounter = aPropertyNames.getLength(); + while (nCounter-- > 0) + { + AdvanceToName (pProperty, pPropertyName); + + nWID = pProperty->nWID; + + if (pProperty == NULL || pProperty->nWID == 0) + { + OUString sMessage = OUString (RTL_CONSTASCII_USTRINGPARAM ( "ChXChartAxis::setPropertyValues: unknown property ")); + sMessage += *pPropertyName; + throw UnknownPropertyException (sMessage, (::cppu::OWeakObject*)this); + } + + // If the item that internally represents the property is not set, then get it's + // default value. + if (aAttributes.GetItemState(nWID) != SFX_ITEM_SET) + { + // Get default from the model's item pool. + if (mpModel->GetItemPool().IsWhich (nWID)) + aAttributes.Put (mpModel->GetItemPool().GetDefaultItem(nWID)); +#ifdef DBG_UTIL + else if (nWID != SID_ATTR_NUMBERFORMAT_SOURCE) + { + String aTmpString (*pPropertyName); + ByteString aProp( aTmpString, RTL_TEXTENCODING_ASCII_US ); + DBG_ERROR2( "ChartAxis: Property %s has an invalid ID (%d)", aProp.GetBuffer(), nWID ); + } +#endif + } + + // Set the property's new value and handle some special cases. + switch (nWID) + { + case SCHATTR_TEXT_ORDER: + { + SvxChartTextOrder eTextOrder; + chart::ChartAxisArrangeOrderType eArrOrder; + if ( ! ( *pValue >>= eArrOrder )) + { + // basic might give us an int instead of the enum type + sal_Int32 nIntVal; + if( *pValue >>= nIntVal ) + eArrOrder = SAL_STATIC_CAST (chart::ChartAxisArrangeOrderType, nIntVal); + } + switch( eArrOrder ) + { + case chart::ChartAxisArrangeOrderType_SIDE_BY_SIDE: + eTextOrder = CHTXTORDER_SIDEBYSIDE; + break; + case chart::ChartAxisArrangeOrderType_STAGGER_EVEN: + eTextOrder = CHTXTORDER_DOWNUP; + break; + case chart::ChartAxisArrangeOrderType_STAGGER_ODD: + eTextOrder = CHTXTORDER_UPDOWN; + break; + case chart::ChartAxisArrangeOrderType_AUTO: + default: + eTextOrder = CHTXTORDER_AUTO; + break; + } + aAttributes.Put (SvxChartTextOrderItem( eTextOrder)); + } + break; + + case SCHATTR_TEXT_ORIENT: + { + sal_Bool bVal; + if( *pValue >>= bVal ) + { + aAttributes.Put( SvxChartTextOrientItem( + bVal + ? CHTXTORIENT_STACKED + : CHTXTORIENT_AUTOMATIC )); + } + } + break; + + case SCHATTR_AXIS_AUTO_STEP_MAIN: + case SCHATTR_AXIS_AUTO_STEP_HELP: + { + sal_Bool bVal; + *pValue >>= bVal; + if( ! bVal ) + { + USHORT nStepWID = ( (nWID == SCHATTR_AXIS_AUTO_STEP_MAIN) ? + SCHATTR_AXIS_STEP_MAIN : + SCHATTR_AXIS_STEP_HELP ); + + BOOL bLog = FALSE; + ChartAxis* pAxis = mpModel->GetAxis( mnWhichId ); + if( pAxis ) + bLog = pAxis->IsLogarithm(); + const SfxPoolItem* pPoolItem = NULL; + if( aAttributes.GetItemState( nStepWID, TRUE, &pPoolItem ) == SFX_ITEM_SET ) + { + double fOld = ((const SvxDoubleItem*)pPoolItem)->GetValue(); + if( fOld <= (bLog? 1.0: 0.0) ) + aAttributes.Put( SvxDoubleItem( bLog? 10.0 : 1.0, nStepWID ) ); + } + } + maPropSet.setPropertyValue( pProperty, *pValue, aAttributes ); + } + break; + + case SCHATTR_AXIS_LOGARITHM: + { + sal_Bool bVal; + *pValue >>= bVal; + if( bVal ) + { + // for logarithmic scale always use automatic steps + aAttributes.Put( SfxBoolItem( SCHATTR_AXIS_AUTO_STEP_MAIN, TRUE ) ); + + const SfxPoolItem* pPoolItem = NULL; + double fMin = 0.0; + if( aAttributes.GetItemState( SCHATTR_AXIS_MIN, TRUE, &pPoolItem ) == SFX_ITEM_SET ) + { + fMin = ((const SvxDoubleItem*)pPoolItem)->GetValue(); + if( fMin <= 0.0 ) + aAttributes.Put( SvxDoubleItem( 1.0, SCHATTR_AXIS_MIN ) ); + } + if( aAttributes.GetItemState( SCHATTR_AXIS_MAX, TRUE, &pPoolItem ) == SFX_ITEM_SET ) + { + if( ((const SvxDoubleItem*)pPoolItem)->GetValue() <= fMin ) + aAttributes.Put( SvxDoubleItem( fMin * 10.0, SCHATTR_AXIS_MAX )); + } + } + maPropSet.setPropertyValue( pProperty, *pValue, aAttributes ); + } + break; + + case SCHATTR_AXIS_STEP_MAIN: + case SCHATTR_AXIS_STEP_HELP: + { + BOOL bLog = FALSE; + ChartAxis* pAxis = mpModel->GetAxis( mnWhichId ); + if( pAxis ) + bLog = pAxis->IsLogarithm(); + double fVal; + *pValue >>= fVal; + if( fVal <= bLog? 1.0: 0.0 ) + throw lang::IllegalArgumentException(); + + if (nWID == SCHATTR_AXIS_STEP_MAIN) + nAutoWID = SCHATTR_AXIS_AUTO_STEP_MAIN; + else + nAutoWID = SCHATTR_AXIS_AUTO_STEP_HELP; + aAttributes.Put( SfxBoolItem( nAutoWID, FALSE )); + maPropSet.setPropertyValue( pProperty, *pValue, aAttributes ); + } + break; + + case SCHATTR_AXIS_MIN: + case SCHATTR_AXIS_MAX: + { + ChartAxis* pAxis = mpModel->GetAxis( mnWhichId ); + double fVal; + *pValue >>= fVal; + if ( pAxis + && pAxis->IsLogarithm() + && fVal <= 0.0) + throw lang::IllegalArgumentException(); + if (nWID == SCHATTR_AXIS_MIN) + nAutoWID = SCHATTR_AXIS_AUTO_MIN; + else + nAutoWID = SCHATTR_AXIS_AUTO_MAX; + + aAttributes.Put( SfxBoolItem( nAutoWID, FALSE )); + maPropSet.setPropertyValue (pProperty, *pValue, aAttributes); + } + break; + + case SCHATTR_AXIS_ORIGIN: + aAttributes.Put (SfxBoolItem (SCHATTR_AXIS_AUTO_ORIGIN, FALSE)); + maPropSet.setPropertyValue (pProperty, *pValue, aAttributes); + break; + + case SCHATTR_AXIS_NUMFMTPERCENT: + // was mapped from SCHATTR_AXIS_NUMFMT, so don't use standard mechanism + { + sal_Int32 nFmt; + *pValue >>= nFmt; + aAttributes.Put( SfxUInt32Item( nWID, nFmt )); + } + break; + + case SID_ATTR_NUMBERFORMAT_SOURCE: + // this is not a which id (>4999) + { + sal_Bool bUseSource = sal_False; + *pValue >>= bUseSource; + aAttributes.Put (SfxBoolItem( nWID, bUseSource)); + } + break; + + case XATTR_LINEEND: + case XATTR_LINESTART: + case XATTR_LINEDASH: + if (pProperty->nMemberId == MID_NAME ) + { + ::rtl::OUString aString; + if (*pValue >>= aString) + SvxShape::SetFillAttribute (nWID, aString, aAttributes, mpModel); + break; + } + // note: this fall-through is intended + + default: + // CL: convert special character properties + if( !SvxUnoTextRangeBase::SetPropertyValueHelper ( + aAttributes, pProperty, *pValue, aAttributes)) + maPropSet.setPropertyValue (pProperty, *pValue, aAttributes); + break; + } + + // Advance to the next property, property name and value. + pPropertyName++; + pValue++; + } + + // Finally set the modified item set to the axis. + mpModel->ChangeAttr (aAttributes, mnWhichId); +} + + + + +/* +Sequence<PropertyState > SAL_CALL ChXChartAxis::getPropertyStates( + const Sequence<OUString > & aPropertyNames) + throw( UnknownPropertyException, + RuntimeException ) +{ + SolarMutexGuard aGuard; + + const sal_Int32 nCount = aPropertyNames.getLength(); + const ::rtl::OUString * pName = aPropertyNames.getConstArray(); + Sequence<PropertyState > aStates (nCount); + PropertyState * pState = aStates.getArray(); + + if (mpModel == NULL) + return aStates; + + for (sal_Int32 nIdx = 0; nIdx < nCount; nIdx++) + pState[nIdx] = getPropertyState (pName[nIdx]); + + return aStates; +} +*/ + + +//===== protected methods ======================================================================= + +SfxItemSet * ChXChartAxis::CreateItemSet (void) +{ + SfxItemSet * pAttributes = new SfxItemSet (mpModel->GetItemPool(), nAxisWhichPairs); + mpModel->GetAttr (mnWhichId, *pAttributes, mnIndex); + return pAttributes; +} + + + +void ChXChartAxis::GetPropertyValue (const SfxItemPropertyMap & rProperty, + ::com::sun::star::uno::Any & rValue, + SfxItemSet & rAttributes) +{ + switch (rProperty.nWID) + { + case SCHATTR_TEXT_ORDER: + { + chart::ChartAxisArrangeOrderType eArrOrder; + + switch (((const SvxChartTextOrderItem&)(rAttributes.Get( SCHATTR_TEXT_ORDER ))).GetValue()) + { + case CHTXTORDER_SIDEBYSIDE: + eArrOrder = chart::ChartAxisArrangeOrderType_SIDE_BY_SIDE; + break; + case CHTXTORDER_DOWNUP: + eArrOrder = chart::ChartAxisArrangeOrderType_STAGGER_EVEN; + break; + case CHTXTORDER_UPDOWN: + eArrOrder = chart::ChartAxisArrangeOrderType_STAGGER_ODD; + break; + case CHTXTORDER_AUTO: + default: + eArrOrder = chart::ChartAxisArrangeOrderType_AUTO; + break; + } + rValue <<= eArrOrder; + break; + } + case SCHATTR_AXIS_NUMFMT: + { + // if we have a percent chart use the correct number format item + ChartType aType( mpModel ); + if( aType.IsPercent()) + { + rValue <<= (sal_Int32)(((const SfxUInt32Item&)(rAttributes.Get( SCHATTR_AXIS_NUMFMTPERCENT ))).GetValue()); + } + else + { + rValue <<= (sal_Int32)(((const SfxUInt32Item&)(rAttributes.Get( SCHATTR_AXIS_NUMFMT ))).GetValue()); + } + } + break; + + + default: + ChXChartObject::GetPropertyValue (rProperty, rValue, rAttributes); + } +} + + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/unoidl/sch_ChXChartData.cxx b/binfilter/bf_sch/source/ui/unoidl/sch_ChXChartData.cxx new file mode 100644 index 000000000000..0f03b7f3478a --- /dev/null +++ b/binfilter/bf_sch/source/ui/unoidl/sch_ChXChartData.cxx @@ -0,0 +1,479 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 "ChXChartData.hxx" + +// header for SvxServiceInfoHelper +#include <bf_svx/unoprov.hxx> +// header for class OGuard +// header for rtl_createUuid +#include <rtl/uuid.h> +// header for class Application +#include <vcl/svapp.hxx> + +#include "chtmodel.hxx" +#include "memchrt.hxx" +namespace binfilter { + +#ifndef SCH_ASCII_TO_OU +#define SCH_ASCII_TO_OU( s ) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( s ) ) +#endif + +using namespace ::com::sun::star; + +#define SCH_BIN_MIN(a,b) ( ((a)<(b))? (a) : (b) ) + +// ---------------------------------------- +// class ChXChartData +// ---------------------------------------- + +ChXChartData::ChXChartData( uno::Reference< lang::XComponent > xModel, + ChartModel* pModel ) : + maListeners( GetMutex() ), + mpModel( pModel ) +{ + if( xModel.is()) + { + uno::Reference< lang::XEventListener > xListener = this; + xModel->addEventListener( xListener ); + } + + DBG_WARNING( "Parameter pModel is NULL." ); +} + +ChXChartData::~ChXChartData() +{} + +void ChXChartData::DataModified( chart::ChartDataChangeEvent& aEvent ) +{ + if( !maListeners.getLength() ) return; + + uno::Reference< uno::XInterface > xSrc( SAL_STATIC_CAST( cppu::OWeakObject*, this ), uno::UNO_QUERY ); + if( xSrc.is() ) + aEvent.Source = xSrc; + + cppu::OInterfaceIteratorHelper aIter( maListeners ); + + while( aIter.hasMoreElements() ) + { + uno::Reference< chart::XChartDataChangeEventListener > xListener( aIter.next(), uno::UNO_QUERY ); + xListener->chartDataChanged( aEvent ); + } +} + +// generate a uniqueId +const uno::Sequence< sal_Int8 > & ChXChartData::getUnoTunnelId() throw() +{ + static uno::Sequence< sal_Int8 > * pSeq = 0; + if( !pSeq ) + { + osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); + if( !pSeq ) + { + static uno::Sequence< sal_Int8 > aSeq( 16 ); + rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True ); + pSeq = &aSeq; + } + } + return *pSeq; +} + +ChXChartData* ChXChartData::getImplementation( uno::Reference< uno::XInterface > xData ) throw() +{ + uno::Reference< lang::XUnoTunnel > xUT( xData, uno::UNO_QUERY ); + if( xUT.is() ) + return reinterpret_cast< ChXChartData * >( xUT->getSomething( ChXChartData::getUnoTunnelId() )); + else + return NULL; +} + +// XChartData +void SAL_CALL ChXChartData::addChartDataChangeEventListener( + const uno::Reference< chart::XChartDataChangeEventListener >& aListener ) + throw( uno::RuntimeException ) +{ + uno::Reference< uno::XInterface > xIntf( aListener, uno::UNO_QUERY ); + if( xIntf.is() ) + maListeners.addInterface( xIntf ); +} + +void SAL_CALL ChXChartData::removeChartDataChangeEventListener( + const uno::Reference< chart::XChartDataChangeEventListener >& aListener ) + throw( uno::RuntimeException ) +{ + uno::Reference< uno::XInterface > xIntf( aListener, uno::UNO_QUERY ); + if( xIntf.is() ) + maListeners.removeInterface( xIntf ); +} + +double SAL_CALL ChXChartData::getNotANumber() throw( ::com::sun::star::uno::RuntimeException ) +{ + return DBL_MIN; +} + +sal_Bool SAL_CALL ChXChartData::isNotANumber( double nNumber ) throw( ::com::sun::star::uno::RuntimeException ) +{ + return (nNumber == getNotANumber()); +} + + +// XServiceInfo +::rtl::OUString SAL_CALL ChXChartData::getImplementationName() + throw( uno::RuntimeException ) +{ + return SCH_ASCII_TO_OU( "ChXChartData" ); +} + +sal_Bool SAL_CALL ChXChartData::supportsService( const ::rtl::OUString& ServiceName ) + throw( uno::RuntimeException ) +{ + return SvxServiceInfoHelper::supportsService( ServiceName, getSupportedServiceNames() ); +} + +uno::Sequence< ::rtl::OUString > SAL_CALL ChXChartData::getSupportedServiceNames() + throw( uno::RuntimeException ) +{ + uno::Sequence< ::rtl::OUString > aSeq; + SvxServiceInfoHelper::addToSequence( aSeq, 1, "com.sun.star.chart.ChartData"); + return aSeq; +} + +// XUnoTunnel +sal_Int64 SAL_CALL ChXChartData::getSomething( const uno::Sequence< sal_Int8 >& aIdentifier ) + throw( uno::RuntimeException ) +{ + if( aIdentifier.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), + aIdentifier.getConstArray(), 16 ) ) + { + return reinterpret_cast< sal_Int64 >( this ); + } + return 0; +} + +// XEventListener listens to disposing of XModel +void SAL_CALL ChXChartData::disposing( const lang::EventObject& Source ) throw( uno::RuntimeException ) +{ + // XModel is disposed -> mpModel is invalid now + mpModel = NULL; +} + +// ---------------------------------------- +// class ChXChartDataArray +// ---------------------------------------- +uno::Sequence< uno::Type > ChXChartDataArray::maTypeSequence; + +ChXChartDataArray::ChXChartDataArray( uno::Reference< lang::XComponent > xModel, + ChartModel* pModel ) : + ChXChartData( xModel, pModel ) +{} + +ChXChartDataArray::~ChXChartDataArray() +{} + +// XInterface +uno::Any SAL_CALL ChXChartDataArray::queryInterface( const uno::Type& aType ) + throw( uno::RuntimeException ) +{ + if( aType == ::getCppuType((const uno::Reference< chart::XChartDataArray >*)0) ) + return uno::makeAny( uno::Reference< chart::XChartDataArray >(this)); + else + return ChXChartData::queryInterface( aType ); +} + +void SAL_CALL ChXChartDataArray::acquire() throw() +{ + ChXChartData::acquire(); +} + +void SAL_CALL ChXChartDataArray::release() throw() +{ + ChXChartData::release(); +} + + +// XTypeProvider +uno::Sequence< uno::Type > SAL_CALL ChXChartDataArray::getTypes() throw( uno::RuntimeException ) +{ + if( maTypeSequence.getLength() == 0 ) + { + uno::Sequence< uno::Type > aBaseTypes( ChXChartData::getTypes() ); + uno::Type* pBaseTypes = aBaseTypes.getArray(); + + maTypeSequence.realloc( aBaseTypes.getLength() + 1 ); // keep updated!! + uno::Type* pTypes = maTypeSequence.getArray(); + + // additional interfaces (1) + *pTypes++ = ::getCppuType((const uno::Reference< chart::XChartDataArray >*)0); + + for( sal_Int32 nType = aBaseTypes.getLength(); nType; nType-- ) + *pTypes++ = *pBaseTypes++; + } + return maTypeSequence; +} + +uno::Sequence< sal_Int8 > SAL_CALL ChXChartDataArray::getImplementationId() throw( uno::RuntimeException ) +{ + static uno::Sequence< sal_Int8 > aId; + if( aId.getLength() == 0 ) + { + aId.realloc( 16 ); + rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True ); + } + return aId; +} + + +// XChartDataArray +uno::Sequence< uno::Sequence< double > > SAL_CALL ChXChartDataArray::getData() throw( uno::RuntimeException ) +{ + DBG_ASSERT( mpModel, "No Model" ); + if( ! mpModel ) + return uno::Sequence< uno::Sequence< double > >(); + + SolarMutexGuard aGuard; + + double *pData; + + // get MemChart: + SchMemChart* pDocData = mpModel->GetChartData(); + + // number of rows and columns + sal_Int32 nCol, nColCnt = pDocData->GetColCount(); + sal_Int32 nRow, nRowCnt = pDocData->GetRowCount(); + + // create array + uno::Sequence< uno::Sequence< double > > aSequence( nRowCnt ); + uno::Sequence< double >* pSeqArray = aSequence.getArray(); + for( nRow = 0; nRow < nRowCnt; nRow++ ) + { + pSeqArray[ nRow ].realloc( nColCnt ); + } + + // copy data from MemChart to the array: + for( nRow = 0; nRow < nRowCnt; nRow++ ) + { + pData = pSeqArray[ nRow ].getArray(); // get row + for( nCol = 0; nCol < nColCnt; nCol++ ) + { + pData[ nCol ] = pDocData->GetData( (short)nCol, (short)nRow ); // copy data to column + } + } + return aSequence; +} + +void SAL_CALL ChXChartDataArray::setData( const uno::Sequence< uno::Sequence< double > >& aData ) + throw( uno::RuntimeException ) +{ + DBG_ASSERT( mpModel, "No Model" ); + if( ! mpModel ) + return; + + SolarMutexGuard aGuard; + + // get number of rows/columns + const uno::Sequence< double >* pSequence = aData.getConstArray(); + sal_Int32 nRow, nRowCnt = aData.getLength(); + sal_Int32 nCol, nColCnt = 0; + + const double* pData = NULL; + if( nRowCnt ) + { + pData = pSequence[ 0 ].getConstArray(); + nColCnt = pSequence->getLength(); + } + + // compare size to the size of the existing MemChart + SchMemChart* pDocData = mpModel->GetChartData(); + + if( nColCnt != (sal_Int32)pDocData->GetColCount() || + nRowCnt != (sal_Int32)pDocData->GetRowCount() ) + { // change size, i.e. create new MemChart + pDocData = new SchMemChart( (short)nColCnt, (short)nRowCnt ); + // save as much as possible (title, ...) + pDocData->SetNonNumericData( *(mpModel->GetChartData()) ); + } + + // copy data + for( nRow = 0; nRow < nRowCnt; nRow++ ) + { + pData = pSequence[ nRow ].getConstArray(); + for( nCol = 0; nCol < nColCnt; nCol++ ) + { + pDocData->SetData( (short)nCol, (short)nRow,pData[ nCol ] ); + } + } + + // data is only changed if new MemChart was created (otherwise everything is already in the chart) + // (Wird nur gewechselt, wenn neues erzeugt wurde (sonst ist schon alles im Chart)) + mpModel->ChangeChartData( *pDocData, FALSE ); + + // call listeners + chart::ChartDataChangeEvent aEvent; + aEvent.Type = chart::ChartDataChangeType_ALL; + aEvent.StartColumn = 0; + aEvent.EndColumn = 0; + aEvent.StartRow = 0; + aEvent.EndRow = 0; + + DataModified( aEvent ); +} + +uno::Sequence< ::rtl::OUString > SAL_CALL ChXChartDataArray::getRowDescriptions() throw( uno::RuntimeException ) +{ + DBG_ASSERT( mpModel, "No Model" ); + if( ! mpModel ) + return uno::Sequence< ::rtl::OUString >(); + + SolarMutexGuard aGuard; + + SchMemChart* pDocData = mpModel->GetChartData(); + sal_Int32 nRow, nRowCnt = pDocData->GetRowCount(); + + uno::Sequence< ::rtl::OUString > aResult( nRowCnt ); + + ::rtl::OUString* pResultArray = aResult.getArray(); + for( nRow = 0; nRow < nRowCnt; nRow++ ) + { + pResultArray[ nRow ] = pDocData->GetRowText( (short)nRow ); + } + + return aResult; +} + +void SAL_CALL ChXChartDataArray::setRowDescriptions( const uno::Sequence< ::rtl::OUString >& aRowDescriptions ) + throw( uno::RuntimeException ) +{ + DBG_ASSERT( mpModel, "No Model" ); + if( ! mpModel ) + return; + + SolarMutexGuard aGuard; + + SchMemChart* pDocData = mpModel->GetChartData(); + sal_Int32 nRow, nRowCnt = SCH_BIN_MIN( (sal_Int32)pDocData->GetRowCount(), aRowDescriptions.getLength() ); + ::rtl::OUString* pString = ( (uno::Sequence< ::rtl::OUString >&)aRowDescriptions ).getArray(); + + for( nRow = 0; nRow < nRowCnt; nRow++ ) + { + pDocData->SetRowText( (short)nRow, pString[ nRow ] ); + } + mpModel->BuildChart( FALSE ); +} + +uno::Sequence< ::rtl::OUString > SAL_CALL ChXChartDataArray::getColumnDescriptions() throw( uno::RuntimeException ) +{ + DBG_ASSERT( mpModel, "No Model" ); + if( ! mpModel ) + return uno::Sequence< ::rtl::OUString >(); + + SolarMutexGuard aGuard; + + SchMemChart* pDocData = mpModel->GetChartData(); + sal_Int32 nCol, nColCnt = pDocData->GetColCount(); + uno::Sequence< ::rtl::OUString > aResult( nColCnt ); + + ::rtl::OUString *pResultArray = aResult.getArray(); + for( nCol = 0; nCol < nColCnt; nCol++ ) + { + pResultArray[ nCol ] = pDocData->GetColText( (short)nCol); + } + return aResult; +} + + void SAL_CALL ChXChartDataArray::setColumnDescriptions( const uno::Sequence< ::rtl::OUString >& aColumnDescriptions ) + throw( uno::RuntimeException ) +{ + DBG_ASSERT( mpModel, "No Model" ); + if( ! mpModel ) + return; + + SolarMutexGuard aGuard; + + SchMemChart* pDocData = mpModel->GetChartData(); + sal_Int32 nCol, nColCnt = SCH_BIN_MIN( (sal_Int32)pDocData->GetColCount(), aColumnDescriptions.getLength() ); + + ::rtl::OUString* pString = ( (uno::Sequence< ::rtl::OUString >&)aColumnDescriptions ).getArray(); + + for( nCol = 0; nCol < nColCnt; nCol++ ) + { + pDocData->SetColText( (short)nCol, pString[ nCol ] ); + } + mpModel->BuildChart( FALSE ); +} + + +// XChartData + void SAL_CALL ChXChartDataArray::addChartDataChangeEventListener( + const uno::Reference< chart::XChartDataChangeEventListener >& aListener ) + throw( uno::RuntimeException ) +{ + ChXChartData::addChartDataChangeEventListener( aListener ); +} + +void SAL_CALL ChXChartDataArray::removeChartDataChangeEventListener( + const uno::Reference< chart::XChartDataChangeEventListener >& aListener ) + throw( uno::RuntimeException ) +{ + ChXChartData::removeChartDataChangeEventListener( aListener ); +} + +double SAL_CALL ChXChartDataArray::getNotANumber() throw( uno::RuntimeException ) +{ + return ChXChartData::getNotANumber(); +} + +sal_Bool SAL_CALL ChXChartDataArray::isNotANumber( double nNumber ) throw( uno::RuntimeException ) +{ + return ChXChartData::isNotANumber( nNumber ); +} + + +// XServiceInfo +::rtl::OUString SAL_CALL ChXChartDataArray::getImplementationName() + throw( uno::RuntimeException ) +{ + return SCH_ASCII_TO_OU( "ChXChartDataArray" ); +} + +sal_Bool SAL_CALL ChXChartDataArray::supportsService( const ::rtl::OUString& ServiceName ) + throw( uno::RuntimeException ) +{ + return ChXChartData::supportsService( ServiceName ); +} + +uno::Sequence< ::rtl::OUString > SAL_CALL ChXChartDataArray::getSupportedServiceNames() + throw( uno::RuntimeException ) +{ + uno::Sequence< ::rtl::OUString > aSeq( ChXChartData::getSupportedServiceNames() ); + SvxServiceInfoHelper::addToSequence( aSeq, 1, "com.sun.star.chart.ChartDataArray" ); + return aSeq; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/unoidl/sch_ChXChartDataChangeEventListener.cxx b/binfilter/bf_sch/source/ui/unoidl/sch_ChXChartDataChangeEventListener.cxx new file mode 100644 index 000000000000..598aa4481da4 --- /dev/null +++ b/binfilter/bf_sch/source/ui/unoidl/sch_ChXChartDataChangeEventListener.cxx @@ -0,0 +1,109 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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. + * + ************************************************************************/ + +// header for class Application +#include <vcl/svapp.hxx> +// header for class OGuard +#include <osl/mutex.hxx> + +#include "ChXChartDataChangeEventListener.hxx" +#include "ChXChartDocument.hxx" +namespace binfilter { + +#ifndef SCH_ASCII_TO_OU +#define SCH_ASCII_TO_OU( s ) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( s ) ) +#endif + +// using namespace osl; +using namespace rtl; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star; + +ChXChartDataChangeEventListener::ChXChartDataChangeEventListener() +{ + mpXDoc = NULL; +} + +void ChXChartDataChangeEventListener::SetOwner( ChXChartDocument* pXDoc ) throw() +{ + SolarMutexGuard aGuard; + + mpXDoc = pXDoc; +} + +void ChXChartDataChangeEventListener::Reset() throw() +{ + SolarMutexGuard aGuard; + mpXDoc = NULL; +} + +// XChartDataChangeEventListener +void SAL_CALL ChXChartDataChangeEventListener::chartDataChanged( const chart::ChartDataChangeEvent& aEvent ) + throw( uno::RuntimeException ) +{ + SolarMutexGuard aGuard; + if( mpXDoc ) + mpXDoc->RefreshData( aEvent ); +} + +// XEventListener +void SAL_CALL ChXChartDataChangeEventListener::disposing( const lang::EventObject& Source ) throw( uno::RuntimeException ) +{ + Reset(); +} + +// XServiceInfo +::rtl::OUString SAL_CALL ChXChartDataChangeEventListener::getImplementationName() throw( uno::RuntimeException ) +{ + return SCH_ASCII_TO_OU( "ChXChartDataChangeEventListener" ); +} + +sal_Bool SAL_CALL ChXChartDataChangeEventListener::supportsService( const OUString& ServiceName ) + throw( uno::RuntimeException ) +{ + uno::Sequence< OUString > aSNL = getSupportedServiceNames(); + const OUString * pArray = aSNL.getConstArray(); + for( INT32 i = 0; i < aSNL.getLength(); i++ ) + if( pArray[i] == ServiceName ) + return TRUE; + return FALSE; +} + +uno::Sequence< ::rtl::OUString > SAL_CALL ChXChartDataChangeEventListener::getSupportedServiceNames() + throw( uno::RuntimeException ) +{ + SolarMutexGuard aGuard; + + uno::Sequence< OUString > aServSeq( 0 ); + return aServSeq; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/unoidl/sch_ChXChartDocument.cxx b/binfilter/bf_sch/source/ui/unoidl/sch_ChXChartDocument.cxx new file mode 100644 index 000000000000..d2b0c0175a77 --- /dev/null +++ b/binfilter/bf_sch/source/ui/unoidl/sch_ChXChartDocument.cxx @@ -0,0 +1,1681 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 "ChXChartDocument.hxx" +#include "ChXDiagram.hxx" +#include "ChXChartData.hxx" +#include "ChXChartDataChangeEventListener.hxx" +#include "ChXChartDrawPage.hxx" + +#include "ChartLegend.hxx" +#include "ChartTitle.hxx" +#include "ChartArea.hxx" + + +#include <bf_svx/UnoNamespaceMap.hxx> +#include <bf_svx/xmlgrhlp.hxx> + +#include "mapprov.hxx" +// header for SvxChartLegendPosItem +#ifndef _SVX_CHRTITEM_HXX +#include "schattr.hxx" +#define ITEMID_CHARTLEGENDPOS SCHATTR_LEGEND_POS + +#include <bf_svtools/eitem.hxx> + +#endif +#include "docshell.hxx" +#include "objid.hxx" + +#include "schgroup.hxx" + +// for access to table addresses +#include "memchrt.hxx" + +// header for SvNumberFormatsSupplierObj +#include <bf_svtools/numuno.hxx> + +// header for class OGuard +// header for class Application +#include <vcl/svapp.hxx> +#include <bf_svx/unofill.hxx> +#include <bf_svx/unoshcol.hxx> + +#include <com/sun/star/lang/XInitialization.hpp> +#include <com/sun/star/lang/XServiceName.hpp> +#include <com/sun/star/beans/PropertyAttribute.hpp> +#include "unonames.hxx" +#include <rtl/uuid.h> + +namespace binfilter { + +extern SchUnoPropertyMapProvider aSchMapProvider; + +using namespace ::com::sun::star; +using ::rtl::OUString; + +sal_Int32 ChXChartDocument::mnInstanceCounter = 0; +SchAddInCollection * ChXChartDocument::mpAddInCollection = NULL; + +SchAddInCollection& ChXChartDocument::GetAddInCollection() +{ + if( mpAddInCollection == NULL ) + mpAddInCollection = new SchAddInCollection(); + + return *mpAddInCollection; +} + +ChXChartDocument::ChXChartDocument( SchChartDocShell* pShell ) : + SfxBaseModel( pShell ), + m_pModel( NULL ), + m_aPropSet( aSchMapProvider.GetMap( CHMAP_DOC, NULL )) +{ + if( pShell ) + { + SolarMutexGuard aSolarGuard; + + m_pDocShell = pShell; + if( m_pDocShell->GetModelPtr()) + SetChartModel( m_pDocShell->GetModelPtr()); + } + else + DBG_WARNING( "Parameter pShell is NULL." ); + + ++mnInstanceCounter; +} + +ChXChartDocument::~ChXChartDocument() +{ + if( m_rXDiagram.is() ) + { + osl::Guard< osl::Mutex > aGuard( GetMutex()); + ChXDiagram* pDiagram = ChXDiagram::getImplementation( m_rXDiagram ); + if( pDiagram ) + pDiagram->SetDocShell( NULL ); + uno::Reference<lang::XComponent> xComponent (m_rXDiagram,uno::UNO_QUERY); + if (xComponent.is()) + { + try + { + xComponent->removeEventListener (this); + xComponent->dispose(); + } + catch( uno::RuntimeException & aEx ) + { + DBG_ERROR1( "Exception caught in DTOR: %s", + ::rtl::OUStringToOString( aEx.Message, RTL_TEXTENCODING_ASCII_US ).getStr() ); + } + } + } + if( --mnInstanceCounter == 0 ) + { + delete mpAddInCollection; + mpAddInCollection = NULL; + } +} + +// public methods +void ChXChartDocument::setDiagramType( const ::rtl::OUString& aType, + sal_Bool bKeepAddin /* = sal_False */ ) throw() +{ + SolarMutexGuard aGuard; + + if( ! m_pModel ) + return; + + // never show sorting dialog + m_pModel->SetChartStatusFlag( CHS_USER_NOQUERY ); + + // disable AddIn if requested + if( bKeepAddin ) + m_pModel->SetChartStatusFlag( CHS_KEEP_ADDIN ); + else + m_pModel->ResetChartStatusFlag( CHS_KEEP_ADDIN ); + + // all chart types start with the prefix com.sun.star.chart + if( 0 == aType.compareToAscii( RTL_CONSTASCII_STRINGPARAM( SCH_X_STR_CHTYPE_NAMESPACE ))) + { + // get postfix using copy( beginIndex ) + ::rtl::OUString aPostfix = aType.copy( RTL_CONSTASCII_LENGTH( SCH_X_STR_CHTYPE_NAMESPACE )); + + if( aPostfix.compareToAscii( RTL_CONSTASCII_STRINGPARAM( SCH_X_STR_CHTYPE_LINE )) == 0 ) + m_pModel->SetBaseType( CHTYPE_LINE ); + else if( aPostfix.compareToAscii( RTL_CONSTASCII_STRINGPARAM( SCH_X_STR_CHTYPE_AREA )) == 0 ) + m_pModel->SetBaseType( CHTYPE_AREA ); + else if( aPostfix.compareToAscii( RTL_CONSTASCII_STRINGPARAM( SCH_X_STR_CHTYPE_PIE )) == 0 ) + m_pModel->SetBaseType( CHTYPE_CIRCLE); + else if( aPostfix.compareToAscii( RTL_CONSTASCII_STRINGPARAM( SCH_X_STR_CHTYPE_BAR )) == 0 ) + m_pModel->SetBaseType( CHTYPE_BAR); + else if( aPostfix.compareToAscii( RTL_CONSTASCII_STRINGPARAM( SCH_X_STR_CHTYPE_XY )) == 0 ) + m_pModel->SetBaseType( CHTYPE_XY ); + else if( aPostfix.compareToAscii( RTL_CONSTASCII_STRINGPARAM( SCH_X_STR_CHTYPE_NET )) == 0 ) + m_pModel->SetBaseType( CHTYPE_NET ); + else if( aPostfix.compareToAscii( RTL_CONSTASCII_STRINGPARAM( SCH_X_STR_CHTYPE_DONUT )) == 0 ) + m_pModel->SetBaseType( CHTYPE_DONUT ); + else if( aPostfix.compareToAscii( RTL_CONSTASCII_STRINGPARAM( SCH_X_STR_CHTYPE_STOCK )) == 0 ) + m_pModel->SetBaseType( CHTYPE_STOCK ); + } +} + +sal_Bool ChXChartDocument::setBaseDiagramType( sal_Bool bSet ) throw() +{ + if( bSet ) + { + if( maBaseDiagramType.getLength()) + { + // 2nd param: keep reference to AddIn in model + setDiagramType( maBaseDiagramType, sal_True ); + return sal_True; + } + } + else // unset + { + if( m_pModel ) + m_pModel->SetBaseType( CHTYPE_ADDIN ); + return sal_True; + } + + return sal_False; +} + +void ChXChartDocument::SetChartModel( ChartModel* pModel ) throw() +{ + osl::Guard< osl::Mutex > aGuard( GetMutex()); + + m_pModel = pModel; + m_aPropSet = SvxItemPropertySet( aSchMapProvider.GetMap( CHMAP_DOC, m_pModel )); +} + +void ChXChartDocument::RefreshData( const chart::ChartDataChangeEvent& aEvent ) throw() +{ + osl::Guard< osl::Mutex > aGuard( GetMutex()); + + // copy new data ( in member m_xChartData ) + if( m_xChartData.is() ) + { + // get XChartDataArray representation of m_xChartData + uno::Reference< chart::XChartDataArray > xDataArray( m_xChartData, uno::UNO_QUERY ); + + if( xDataArray.is() ) + { + // new data object using own doc shell + uno::Reference< lang::XComponent > xComp( SAL_STATIC_CAST( SfxBaseModel*, this )); + ChXChartDataArray* pNewDataArray = new ChXChartDataArray( xComp, m_pModel ); + chart::XChartDataArray* pSrcArray = xDataArray.get(); + + // the get-methods re-retrieve the (changed) data from the SchMemChart + pNewDataArray->setData( pSrcArray->getData() ); + pNewDataArray->setRowDescriptions( pSrcArray->getRowDescriptions() ); + pNewDataArray->setColumnDescriptions( pSrcArray->getColumnDescriptions() ); + + // remember the new data as member + m_xChartData = SAL_STATIC_CAST( ChXChartData*, pNewDataArray ); + } + } +} + +// generate a uniqueId +const uno::Sequence< sal_Int8 > & ChXChartDocument::getUnoTunnelId() throw() +{ + static uno::Sequence< sal_Int8 > * pSeq = 0; + if( !pSeq ) + { + osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); + if( !pSeq ) + { + static uno::Sequence< sal_Int8 > aSeq( 16 ); + rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True ); + pSeq = &aSeq; + } + } + return *pSeq; +} + +ChXChartDocument* ChXChartDocument::getImplementation( uno::Reference< uno::XInterface > xData ) throw() +{ + uno::Reference< lang::XUnoTunnel > xUT( xData, uno::UNO_QUERY ); + if( xUT.is() ) + return (ChXChartDocument*)xUT->getSomething( ChXChartDocument::getUnoTunnelId() ); + else + return NULL; +} + + +// XInterface +uno::Any SAL_CALL ChXChartDocument::queryInterface( const uno::Type & rType ) + throw( uno::RuntimeException ) +{ + uno::Any aAny = SfxBaseModel::queryInterface( rType ); + if( aAny.hasValue() ) + return aAny; + + return ::cppu::queryInterface( + rType, + ( lang::XMultiServiceFactory* )this, + ( beans::XPropertySet* )this, + ( chart::XChartDocument* )this, + ( lang::XServiceInfo* )this, + ( util::XNumberFormatsSupplier* )this, + ( drawing::XDrawPageSupplier* )this, + ( lang::XUnoTunnel* )this ); +} + +void SAL_CALL ChXChartDocument::acquire() throw() +{ + SfxBaseModel::acquire(); +} + +void SAL_CALL ChXChartDocument::release() throw() +{ + SfxBaseModel::release(); +} + +// XMultiServiceFactory +uno::Reference< uno::XInterface > SAL_CALL ChXChartDocument::createInstance( const ::rtl::OUString& aServiceSpecifier ) + throw( uno::Exception, uno::RuntimeException ) +{ + bool bServiceFound = false; + uno::Reference< uno::XInterface > xResult; + + // 1. create a new built-in diagram type + if( 0 == aServiceSpecifier.compareToAscii( RTL_CONSTASCII_STRINGPARAM( SCH_X_STR_CHTYPE_NAMESPACE ))) + { + ::rtl::OUString aPostfix = aServiceSpecifier.copy( RTL_CONSTASCII_LENGTH( SCH_X_STR_CHTYPE_NAMESPACE )); + + if( 0 == aPostfix.compareToAscii( RTL_CONSTASCII_STRINGPARAM( SCH_X_STR_CHTYPE_LINE )) || + 0 == aPostfix.compareToAscii( RTL_CONSTASCII_STRINGPARAM( SCH_X_STR_CHTYPE_AREA )) || + 0 == aPostfix.compareToAscii( RTL_CONSTASCII_STRINGPARAM( SCH_X_STR_CHTYPE_BAR )) || + 0 == aPostfix.compareToAscii( RTL_CONSTASCII_STRINGPARAM( SCH_X_STR_CHTYPE_PIE )) || + 0 == aPostfix.compareToAscii( RTL_CONSTASCII_STRINGPARAM( SCH_X_STR_CHTYPE_XY )) || + 0 == aPostfix.compareToAscii( RTL_CONSTASCII_STRINGPARAM( SCH_X_STR_CHTYPE_NET )) || + 0 == aPostfix.compareToAscii( RTL_CONSTASCII_STRINGPARAM( SCH_X_STR_CHTYPE_DONUT )) || + 0 == aPostfix.compareToAscii( RTL_CONSTASCII_STRINGPARAM( SCH_X_STR_CHTYPE_STOCK ))) + { + ChXDiagram* pDiagram = new ChXDiagram( m_pDocShell, FALSE ); + pDiagram->SetServiceName( aServiceSpecifier ); + + xResult.set( static_cast< cppu::OWeakObject * >( pDiagram ) ); + bServiceFound = true; + } + } + // 2. create drawing services for XML + else if( 0 == aServiceSpecifier.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.drawing." ))) + { + ::rtl::OUString aPostfix = aServiceSpecifier.copy( RTL_CONSTASCII_LENGTH( "com.sun.star.drawing." )); + + bServiceFound = true; + + // get a table for XML ex-/import + if( 0 == aPostfix.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "DashTable" ))) + { + if( ! xDashTable.is()) + xDashTable = SvxUnoDashTable_createInstance( m_pModel ); + xResult = xDashTable; + } + else if( 0 == aPostfix.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "GradientTable" ))) + { + if( ! xGradientTable.is()) + xGradientTable = SvxUnoGradientTable_createInstance( m_pModel ); + xResult = xGradientTable; + } + else if( 0 == aPostfix.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "HatchTable" ))) + { + if( ! xHatchTable.is()) + xHatchTable = SvxUnoHatchTable_createInstance( m_pModel ); + xResult = xHatchTable; + } + else if( 0 == aPostfix.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "BitmapTable" ))) + { + if( ! xBitmapTable.is()) + xBitmapTable = SvxUnoBitmapTable_createInstance( m_pModel ); + xResult = xBitmapTable; + } + else if( 0 == aPostfix.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "TransparencyGradientTable" ))) + { + if( ! xTransparencyGradientTable.is()) + xTransparencyGradientTable = SvxUnoTransGradientTable_createInstance( m_pModel ); + xResult = xTransparencyGradientTable; + } + else if( 0 == aPostfix.compareToAscii( RTL_CONSTASCII_STRINGPARAM( "MarkerTable" ))) + { + if( ! xMarkerTable.is()) + xMarkerTable = SvxUnoMarkerTable_createInstance( m_pModel ); + xResult = xMarkerTable; + } + else + bServiceFound = false; + } + + // 3. XML namespace-map for alien attributes + if( ! bServiceFound && + 0 == aServiceSpecifier.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.xml.NamespaceMap") ) ) + { + static sal_uInt16 aWhichIds[] = { SCHATTR_USER_DEFINED_ATTR, 0 }; + xResult = svx::NamespaceMap_createInstance( aWhichIds, &m_pModel->GetPool() ); + bServiceFound = true; + } + + // 4. graphics resolver + if( ! bServiceFound && + 0 == aServiceSpecifier.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.document.ExportGraphicObjectResolver") ) ) + { + xResult = static_cast< ::cppu::OWeakObject * >( new SvXMLGraphicHelper( GRAPHICHELPER_MODE_WRITE )); + bServiceFound = true; + } + if( ! bServiceFound && + 0 == aServiceSpecifier.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.document.ImportGraphicObjectResolver") ) ) + { + xResult = static_cast< ::cppu::OWeakObject * >( new SvXMLGraphicHelper( GRAPHICHELPER_MODE_READ )); + bServiceFound = true; + } + + // 5. embedded object resolver + if( ! bServiceFound && + ( 0 == aServiceSpecifier.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.document.ExportEmbeddedObjectResolver" )) + || 0 == aServiceSpecifier.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.document.ImportEmbeddedObjectResolver" )))) + { + // Charts do not support EmbeddedObjectResolvers, so they return an empty + // reference, but as the request is well known, no assertion is printed + bServiceFound = true; + } + + // 6. create a shape + if( ! bServiceFound ) + { + // try to get a shape + try + { + xResult = SvxUnoDrawMSFactory::createInstance( aServiceSpecifier ); + bServiceFound = true; + } + catch( const uno::Exception& aEx ) + { + // couldn't create shape + } + } + + // 7. try to create an AddIn + if( ! bServiceFound ) + { + uno::Reference< util::XRefreshable > xAddIn = GetAddInCollection().GetAddInByName( aServiceSpecifier ); + if( xAddIn.is()) + { + xResult = xAddIn; + bServiceFound = true; + } + } + + OSL_ENSURE( bServiceFound, + ::rtl::OUStringToOString( + ::rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( + "createInstance() failed in creating the service " )) + + aServiceSpecifier, + RTL_TEXTENCODING_ASCII_US ).getStr() ); + + return xResult; +} + +uno::Reference< uno::XInterface > SAL_CALL ChXChartDocument::createInstanceWithArguments( + const ::rtl::OUString& ServiceSpecifier, const uno::Sequence< uno::Any >& Arguments ) + throw( uno::Exception, uno::RuntimeException ) +{ + if( 0 == ServiceSpecifier.compareToAscii( RTL_CONSTASCII_STRINGPARAM( SCH_X_STR_CHTYPE_NAMESPACE ))) + { + if( Arguments.getLength() ) + throw lang::IllegalArgumentException(); + else + return createInstance( ServiceSpecifier ); + } + + return SvxUnoDrawMSFactory::createInstanceWithArguments( ServiceSpecifier, Arguments ); +} + +uno::Sequence< ::rtl::OUString > SAL_CALL ChXChartDocument::getAvailableServiceNames() + throw( uno::RuntimeException ) +{ + ::std::vector< OUString > aServices; + + // chart types + aServices.push_back( OUString::createFromAscii( SCH_X_STR_CHTYPE_NAMESPACE SCH_X_STR_CHTYPE_LINE )); + aServices.push_back( OUString::createFromAscii( SCH_X_STR_CHTYPE_NAMESPACE SCH_X_STR_CHTYPE_AREA )); + aServices.push_back( OUString::createFromAscii( SCH_X_STR_CHTYPE_NAMESPACE SCH_X_STR_CHTYPE_BAR )); + aServices.push_back( OUString::createFromAscii( SCH_X_STR_CHTYPE_NAMESPACE SCH_X_STR_CHTYPE_PIE )); + aServices.push_back( OUString::createFromAscii( SCH_X_STR_CHTYPE_NAMESPACE SCH_X_STR_CHTYPE_XY )); + aServices.push_back( OUString::createFromAscii( SCH_X_STR_CHTYPE_NAMESPACE SCH_X_STR_CHTYPE_NET )); + aServices.push_back( OUString::createFromAscii( SCH_X_STR_CHTYPE_NAMESPACE SCH_X_STR_CHTYPE_DONUT )); + aServices.push_back( OUString::createFromAscii( SCH_X_STR_CHTYPE_NAMESPACE SCH_X_STR_CHTYPE_STOCK )); + + // style tables (for XML) + aServices.push_back( OUString::createFromAscii( "com.sun.star.drawing.DashTable" )); + aServices.push_back( OUString::createFromAscii( "com.sun.star.drawing.GradientTable" )); + aServices.push_back( OUString::createFromAscii( "com.sun.star.drawing.HatchTable" )); + aServices.push_back( OUString::createFromAscii( "com.sun.star.drawing.BitmapTable" )); + aServices.push_back( OUString::createFromAscii( "com.sun.star.drawing.TransparencyGradientTable" )); + aServices.push_back( OUString::createFromAscii( "com.sun.star.drawing.MarkerTable" )); + + // XML namespacemap / object resolver + aServices.push_back( OUString::createFromAscii( "com.sun.star.xml.NamespaceMap" )); + aServices.push_back( OUString::createFromAscii( "com.sun.star.document.ExportGraphicObjectResolver" )); + aServices.push_back( OUString::createFromAscii( "com.sun.star.document.ImportGraphicObjectResolver" )); + + // shapes + uno::Sequence< OUString > aDrawServices( SvxUnoDrawMSFactory::getAvailableServiceNames() ); + const OUString * pArr = aDrawServices.getConstArray(); + aServices.insert( aServices.end(), pArr, pArr + aDrawServices.getLength() ); + + // add-ins + uno::Sequence< OUString > aAddIns( GetAddInCollection().GetAddInNames() ); + pArr = aAddIns.getConstArray(); + aServices.insert( aServices.end(), pArr, pArr + aAddIns.getLength() ); + + return uno::Sequence< OUString >( &(* aServices.begin()), aServices.size() ); +} + + +// XPropertySet +uno::Reference< beans::XPropertySetInfo > SAL_CALL ChXChartDocument::getPropertySetInfo() + throw( uno::RuntimeException ) +{ + return m_aPropSet.getPropertySetInfo(); +} + +void SAL_CALL ChXChartDocument::setPropertyValue( const ::rtl::OUString& aPropertyName, const uno::Any& aValue ) + throw( beans::UnknownPropertyException, + beans::PropertyVetoException, + lang::IllegalArgumentException, + lang::WrappedTargetException, + uno::RuntimeException ) +{ + SolarMutexGuard aGuard; + + if( m_pModel ) + { + const SfxItemPropertyMap* pMap = m_aPropSet.getPropertyMapEntry( aPropertyName ); + if( pMap && pMap->nWID ) + { + if( pMap->nFlags & beans::PropertyAttribute::READONLY ) + throw beans::PropertyVetoException(); + + USHORT nWID = pMap->nWID; + + switch( nWID ) + { + case CHATTR_DIAGRAM_START: // dummy id for "HasLegend" + { + sal_Bool bVal; + aValue >>= bVal; + m_pModel->SetShowLegend( bVal ); + m_pModel->SetLegendHasBeenMoved( FALSE ); + m_pModel->BuildChart( FALSE ); + } + break; + + case CHATTR_ADDR_CATEGORIES: + case CHATTR_ADDR_SERIES: + case CHATTR_ADDR_CHART: + case CHATTR_TABLE_NUMBER_LIST: + case CHATTR_EXPORT_TABLE: + case CHATTR_FIRST_COL_LABELS: + case CHATTR_FIRST_ROW_LABELS: + { + SchMemChart* pData = m_pModel->GetChartData(); + if( pData ) + { + switch( nWID ) + { + case CHATTR_ADDR_CATEGORIES: + { + ::rtl::OUString aCatAddr; + aValue >>= aCatAddr; + pData->SetCategoriesRangeAddress( aCatAddr ); + } + break; + case CHATTR_ADDR_SERIES: + { + uno::Sequence< chart::ChartSeriesAddress > aSeriesAddresses; + aValue >>= aSeriesAddresses; + pData->SetSeriesAddresses( aSeriesAddresses ); + } + break; + case CHATTR_ADDR_CHART: + { + ::rtl::OUString aAddr; + aValue >>= aAddr; + pData->getChartRangeForXMLString( aAddr ); + } + break; + case CHATTR_TABLE_NUMBER_LIST: + { + ::rtl::OUString aList; + aValue >>= aList; + pData->parseTableNumberList( aList ); + } + break; + case CHATTR_EXPORT_TABLE: + { + sal_Bool bValueToSet; + aValue >>= bValueToSet; + + SchChartRange aRange = pData->GetChartRange(); + if( aRange.mbKeepCopyOfData != bValueToSet ) + { + aRange.mbKeepCopyOfData = bValueToSet; + pData->SetChartRange( aRange ); + } + } + break; + case CHATTR_FIRST_COL_LABELS: + { + sal_Bool bValueToSet; + aValue >>= bValueToSet; + + SchChartRange aRange = pData->GetChartRange(); + if( aRange.mbFirstColumnContainsLabels != bValueToSet ) + { + aRange.mbFirstColumnContainsLabels = bValueToSet; + pData->SetChartRange( aRange ); + } + } + break; + case CHATTR_FIRST_ROW_LABELS: + { + sal_Bool bValueToSet; + aValue >>= bValueToSet; + + SchChartRange aRange = pData->GetChartRange(); + if( aRange.mbFirstRowContainsLabels != bValueToSet ) + { + aRange.mbFirstRowContainsLabels = bValueToSet; + pData->SetChartRange( aRange ); + } + } + break; + } + } + else + DBG_ERROR( "invalid SchMemChart" ); + } + break; + + case CHATTR_TRANSLATED_COLS: + case CHATTR_TRANSLATED_ROWS: + { + SchMemChart* pData = m_pModel->GetChartData(); + if( pData ) + { + uno::Sequence< sal_Int32 > aSeq; + aValue >>= aSeq; + + if( ! SetTransSequence( pData, CHATTR_TRANSLATED_COLS == nWID, aSeq )) + { + ::rtl::OUString aMsg( + RTL_CONSTASCII_STRINGPARAM( "Conflict on setting row-/col translation" ), + RTL_TEXTENCODING_ASCII_US ); + uno::RuntimeException aExcept( aMsg, static_cast< ::cppu::OWeakObject* >( this )); + throw aExcept; + } + } + else + DBG_ERROR( "invalid SchMemChart" ); + } + break; + + default: + { + SfxItemSet aSet( m_pModel->GetPool(), nWID, nWID ); + m_pModel->GetAttr( aSet ); + + if( ! aSet.Count() ) + { + // get default from ItemPool + if( m_pModel->GetItemPool().IsWhich( nWID ) ) + { + aSet.Put( m_pModel->GetItemPool().GetDefaultItem( pMap->nWID ) ); + } + else + { +#ifdef DBG_UTIL + String aTmpString( aPropertyName ); + ByteString aProp( aTmpString, RTL_TEXTENCODING_ASCII_US ); + DBG_ERROR2( "Diagram: Property %s has an invalid ID (%d)", aProp.GetBuffer(), nWID ); +#endif + } + } + if( aSet.Count()) + { + m_aPropSet.setPropertyValue( pMap, aValue, aSet ); + m_pModel->PutAttr( aSet ); + m_pModel->BuildChart( FALSE ); + } + else + { + throw beans::UnknownPropertyException(); + } + } + break; + } + } + else if( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "BaseDiagram" ) )) + { + aValue >>= maBaseDiagramType; + setBaseDiagramType( sal_True ); + } + else if( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ExportForClipboard" ))) + { + sal_Bool bBool; + aValue >>= bBool; + m_pDocShell->SetClipboardExport( bBool ); + } + else + { + throw beans::UnknownPropertyException(); + } + } + else + DBG_WARNING( "No Model" ); +} + +uno::Any SAL_CALL ChXChartDocument::getPropertyValue( const ::rtl::OUString& aPropertyName ) + throw( beans::UnknownPropertyException, + lang::WrappedTargetException, + uno::RuntimeException ) +{ + SolarMutexGuard aGuard; + + uno::Any aAny; + if( m_pModel ) + { + const SfxItemPropertyMap* pMap = m_aPropSet.getPropertyMapEntry( aPropertyName ); + if( pMap && pMap->nWID ) + { + USHORT nWID = pMap->nWID; + + switch( nWID ) + { + case CHATTR_ADDITIONAL_SHAPES: + aAny <<= GetAdditionalShapes(); + return aAny; // RETURN + + case CHATTR_DIAGRAM_START: // dummy id for "HasLegend" + { + SfxItemSet rSet( m_pModel->GetFullLegendAttr() ); + const SfxPoolItem *pPoolItem = NULL; + SvxChartLegendPos ePos = CHLEGEND_RIGHT; + if( rSet.GetItemState( SCHATTR_LEGEND_POS, TRUE, &pPoolItem ) == SFX_ITEM_SET ) + { + ePos = ((const SvxChartLegendPosItem*)pPoolItem)->GetValue(); + } + aAny <<= sal_Bool( ePos != CHLEGEND_NONE ); + } + break; + + case CHATTR_ADDR_CATEGORIES: + case CHATTR_ADDR_SERIES: + case CHATTR_ADDR_CHART: + case CHATTR_TABLE_NUMBER_LIST: + case CHATTR_EXPORT_TABLE: + case CHATTR_FIRST_COL_LABELS: + case CHATTR_FIRST_ROW_LABELS: + { + SchMemChart* pData = m_pModel->GetChartData(); + if( pData ) + { + switch( nWID ) + { + case CHATTR_ADDR_CATEGORIES: + aAny <<= pData->GetCategoriesRangeAddress(); + break; + case CHATTR_ADDR_SERIES: + aAny <<= pData->GetSeriesAddresses(); + break; + case CHATTR_ADDR_CHART: + aAny <<= pData->getXMLStringForChartRange(); + break; + case CHATTR_TABLE_NUMBER_LIST: + aAny <<= pData->createTableNumberList(); + break; + case CHATTR_EXPORT_TABLE: + { + // data table is always exported for standalone charts + // if container (Calc/Writer) has set the property not + // to export the data then do so + DBG_ASSERT( pData, "Invalid MemChart" ); + const SchChartRange& rRange = pData->GetChartRange(); + sal_Bool bResult = rRange.mbKeepCopyOfData; + + // if export was set to false it might nontheless be + // necessary to export data for inserting the chart into + // a different container from clipboard + if( !bResult && m_pDocShell ) + aAny <<= m_pDocShell->GetClipboardExport(); + + aAny <<= bResult; + } + break; + case CHATTR_FIRST_COL_LABELS: + { + const SchChartRange& rRange = pData->GetChartRange(); + aAny <<= (sal_Bool)(rRange.mbFirstColumnContainsLabels); + } + break; + case CHATTR_FIRST_ROW_LABELS: + { + const SchChartRange& rRange = pData->GetChartRange(); + aAny <<= (sal_Bool)(rRange.mbFirstRowContainsLabels); + } + break; + } + } + else + DBG_ERROR( "invalid SchMemChart" ); + } + break; + + case CHATTR_HAS_TRANSLATED_COLS: + case CHATTR_HAS_TRANSLATED_ROWS: + case CHATTR_TRANSLATED_COLS: + case CHATTR_TRANSLATED_ROWS: + { + SchMemChart* pData = m_pModel->GetChartData(); + if( pData ) + { + long nTranslation = pData->GetTranslation(); + switch( nWID ) + { + case CHATTR_HAS_TRANSLATED_COLS: + aAny <<= (sal_Bool)( nTranslation == TRANS_COL ); + break; + case CHATTR_HAS_TRANSLATED_ROWS: + aAny <<= (sal_Bool)( nTranslation == TRANS_ROW ); + break; + case CHATTR_TRANSLATED_COLS: + case CHATTR_TRANSLATED_ROWS: + aAny <<= GetTransSequence( pData, (CHATTR_TRANSLATED_COLS == nWID)); + break; + } + } + else + DBG_ERROR( "invalid SchMemChart" ); + } + break; + + default: + { + SfxItemSet aSet( m_pModel->GetPool(), nWID, nWID ); + m_pModel->GetAttr( aSet ); + + if( ! aSet.Count() ) + { + // get default from ItemPool + if( m_pModel->GetItemPool().IsWhich( nWID ) ) + { + aSet.Put( m_pModel->GetItemPool().GetDefaultItem( pMap->nWID ) ); + } + else + { +#ifdef DBG_UTIL + String aTmpString( aPropertyName ); + ByteString aProp( aTmpString, RTL_TEXTENCODING_ASCII_US ); + DBG_ERROR2( "Diagram: Property %s has an invalid ID (%d)", aProp.GetBuffer(), nWID ); +#endif + } + } + if( aSet.Count() ) + aAny = m_aPropSet.getPropertyValue( pMap, aSet ); + else + throw beans::UnknownPropertyException(); + + if( *pMap->pType != aAny.getValueType() ) + { + // since the sfx uint16 item now exports a sal_Int32, we may have to fix this here + if( ( *pMap->pType == ::getCppuType((const sal_Int16*)0)) && aAny.getValueType() == ::getCppuType((const sal_Int32*)0) ) + { + sal_Int32 nValue; + aAny >>= nValue; + aAny <<= static_cast< sal_Int16 >( nValue ); + } + else + { + DBG_ERROR( "getPropertyValue(): wrong Type!" ); + } + } + } + } + } + else if( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "BaseDiagram" ) )) + { + aAny <<= maBaseDiagramType; + } + else if( aPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "AddIn" ) )) + { + if( m_pModel ) + { + uno::Reference< util::XRefreshable > xAddIn = m_pModel->GetChartAddIn(); + aAny <<= xAddIn; + } + } + else + throw beans::UnknownPropertyException(); + } + else + DBG_WARNING( "No Model" ); + + return aAny; +} + +void SAL_CALL ChXChartDocument::addPropertyChangeListener( const ::rtl::OUString& aPropertyName, + const uno::Reference< beans::XPropertyChangeListener >& xListener ) + throw( beans::UnknownPropertyException, + lang::WrappedTargetException, + uno::RuntimeException ) +{} + +void SAL_CALL ChXChartDocument::removePropertyChangeListener( const ::rtl::OUString& aPropertyName, + const uno::Reference< beans::XPropertyChangeListener >& aListener ) + throw( beans::UnknownPropertyException, + lang::WrappedTargetException, + uno::RuntimeException ) +{} + +void SAL_CALL ChXChartDocument::addVetoableChangeListener( const ::rtl::OUString& PropertyName, + const uno::Reference< beans::XVetoableChangeListener >& aListener ) + throw( beans::UnknownPropertyException, + lang::WrappedTargetException, + uno::RuntimeException ) +{} + +void SAL_CALL ChXChartDocument::removeVetoableChangeListener( const ::rtl::OUString& PropertyName, + const uno::Reference< beans::XVetoableChangeListener >& aListener ) + throw( beans::UnknownPropertyException, + lang::WrappedTargetException, + uno::RuntimeException ) +{} + +// XChartDocument + +uno::Reference< drawing::XShape > SAL_CALL ChXChartDocument::getTitle() throw( uno::RuntimeException ) +{ + osl::Guard< osl::Mutex > aGuard( GetMutex()); + if( ! mxMainTitle.is()) + { + mxMainTitle = new ChartTitle( m_pModel, CHOBJID_TITLE_MAIN ); + uno::Reference<lang::XComponent> xComponent (mxMainTitle, uno::UNO_QUERY); + if (xComponent.is()) + xComponent->addEventListener (this); + } + + return mxMainTitle; +} + +uno::Reference< drawing::XShape > SAL_CALL ChXChartDocument::getSubTitle() throw( uno::RuntimeException ) +{ + osl::Guard< osl::Mutex > aGuard( GetMutex()); + if( ! mxSubTitle.is()) + { + mxSubTitle = new ChartTitle( m_pModel, CHOBJID_TITLE_SUB ); + uno::Reference<lang::XComponent> xComponent (mxSubTitle, uno::UNO_QUERY); + if (xComponent.is()) + xComponent->addEventListener (this); + } + + return mxSubTitle; +} + +uno::Reference< drawing::XShape > SAL_CALL ChXChartDocument::getLegend() throw( uno::RuntimeException ) +{ + osl::Guard< osl::Mutex > aGuard( GetMutex()); + if( ! mxLegend.is()) + { + mxLegend = new ChartLegend( m_pModel ); + uno::Reference<lang::XComponent> xComponent (mxLegend, uno::UNO_QUERY); + if (xComponent.is()) + xComponent->addEventListener (this); + } + + return mxLegend; +} + +uno::Reference< beans::XPropertySet > SAL_CALL ChXChartDocument::getArea() throw( uno::RuntimeException ) +{ + osl::Guard< osl::Mutex > aGuard( GetMutex()); + if( ! mxArea.is()) + { + mxArea = new ChartArea( m_pModel, CHOBJID_DIAGRAM_AREA ); + uno::Reference<lang::XComponent> xComponent (mxArea, uno::UNO_QUERY); + if (xComponent.is()) + xComponent->addEventListener (this); + } + + return mxArea; +} + +uno::Reference< chart::XDiagram > SAL_CALL ChXChartDocument::getDiagram() throw( uno::RuntimeException ) +{ + osl::Guard< osl::Mutex > aGuard( GetMutex()); + if( ! m_rXDiagram.is() ) + { + m_rXDiagram = new ChXDiagram( m_pDocShell ); + uno::Reference<lang::XComponent> xComponent (m_rXDiagram, uno::UNO_QUERY); + if (xComponent.is()) + xComponent->addEventListener (this); + } + + return m_rXDiagram; +} + +void SAL_CALL ChXChartDocument::setDiagram( const uno::Reference< chart::XDiagram >& _NewDiagram ) + throw( uno::RuntimeException ) +{ + if( _NewDiagram == m_rXDiagram ) + return; + + osl::Guard< osl::Mutex > aGuard( GetMutex()); + + uno::Reference< util::XRefreshable > xAddIn( _NewDiagram, uno::UNO_QUERY ); + if( xAddIn.is()) + { + // use AddIn + if( m_pModel ) + { + SolarMutexGuard aGuard; + m_pModel->SetChartAddIn( xAddIn ); + + // initialize AddIn with this as chart document + uno::Reference< lang::XInitialization > xInit( xAddIn, uno::UNO_QUERY ); + if( xInit.is()) + { + uno::Any aParam; + uno::Reference< chart::XChartDocument > xDoc( (chart::XChartDocument*)this, uno::UNO_QUERY ); + aParam <<= xDoc; + uno::Sequence< uno::Any > aSeq( &aParam, 1 ); + xInit->initialize( aSeq ); + } + + // remember service name in member ChXDiagram instance + uno::Reference< lang::XServiceName > xServiceName( xAddIn, uno::UNO_QUERY ); + if( xServiceName.is()) + { + uno::Reference<lang::XComponent> xComponent (m_rXDiagram,uno::UNO_QUERY); + if (xComponent.is()) + { + xComponent->removeEventListener (this); + xComponent->dispose(); + } + + ChXDiagram* pDiagram = new ChXDiagram( m_pDocShell, TRUE ); + pDiagram->SetServiceName( xServiceName->getServiceName() ); + m_rXDiagram = pDiagram; + xComponent = uno::Reference<lang::XComponent>(m_rXDiagram, uno::UNO_QUERY); + if (xComponent.is()) + xComponent->addEventListener (this); + } + } + else + { + DBG_ERROR( "No Model - Couldn't attach AddIn" ); + } + } + else + { + // the new diagram is only set here + // when you have an addin the old diagram is kept as + // 'parent diagram' + + // clear addin + if( m_pModel ) + { + SolarMutexGuard aGuard; + uno::Reference< util::XRefreshable > xRefreshable; + m_pModel->SetChartAddIn( xRefreshable ); + } + + // invalidate and release old diagram + if( m_rXDiagram.is()) + { + uno::Reference<lang::XComponent> xComponent (m_rXDiagram,uno::UNO_QUERY); + if (xComponent.is()) + { + xComponent->removeEventListener (this); + xComponent->dispose(); + } + + ChXDiagram* pDiagram = ChXDiagram::getImplementation( m_rXDiagram ); + if( pDiagram ) + pDiagram->SetDocShell( SchChartDocShellRef() ); + } + + // set new diagram + if( _NewDiagram.is() ) + { + ChXDiagram* pDiagram = ChXDiagram::getImplementation( _NewDiagram ); + if( pDiagram ) + { + if( m_pDocShell ) + { + if( pDiagram->SetDocShell( m_pDocShell, sal_True )) // keep model (is copied) + { + // update local model + if( m_pModel ) + { + SolarMutexGuard aGuard; + m_pModel = m_pDocShell->GetModelPtr(); + } + } + else + { + // model was invalid + // so set correct chart type to current model + setDiagramType( pDiagram->getServiceName()); + } + } + } + uno::Reference<lang::XComponent> xComponent (m_rXDiagram, uno::UNO_QUERY); + if (xComponent.is()) + xComponent->removeEventListener (this); + m_rXDiagram = _NewDiagram; + xComponent = uno::Reference<lang::XComponent>(m_rXDiagram, uno::UNO_QUERY); + if (xComponent.is()) + xComponent->addEventListener (this); + } + } +} + +uno::Reference< chart::XChartData > SAL_CALL ChXChartDocument::getData() throw( uno::RuntimeException ) +{ + osl::Guard< osl::Mutex > aGuard( GetMutex()); + if( ! m_xChartData.is()) + { + uno::Reference< lang::XComponent > xComp( SAL_STATIC_CAST( SfxBaseModel*, this )); + // XChartData is inherited twice + m_xChartData = SAL_STATIC_CAST( chart::XChartDataArray*, + new ChXChartDataArray( xComp, m_pModel )); + } + + return m_xChartData; +} + +void SAL_CALL ChXChartDocument::attachData( const uno::Reference< chart::XChartData >& _Data ) + throw( uno::RuntimeException ) +{ + osl::ClearableGuard< osl::Mutex > aGuard( GetMutex()); + + if( ! _Data.is() ) + return; + + if( ! m_xEventListener.is() ) + { + ChXChartDataChangeEventListener *pEvtListener = new ChXChartDataChangeEventListener; + if( pEvtListener ) + { + pEvtListener->Reset(); // Reset not implemented yet + pEvtListener->SetOwner( this ); // become owner of event listener + m_xEventListener = pEvtListener; // remember Listener as member + } + } + + // add listener to XChartDataArray + uno::Reference< chart::XChartDataArray > xChDataArray( _Data, uno::UNO_QUERY ); + + if( xChDataArray.is() ) + xChDataArray->addChartDataChangeEventListener( m_xEventListener ); + + // copy new Data + m_xChartData = _Data; + aGuard.clear(); + + chart::ChartDataChangeEvent aEvent; + + aEvent.Type = chart::ChartDataChangeType_ALL; + aEvent.StartColumn = 0; + aEvent.EndColumn = 0; + aEvent.StartRow = 0; + aEvent.EndRow = 0; + + RefreshData( aEvent ); // set initial data +} + + +// XModel ( ::SfxBaseModel ) +sal_Bool SAL_CALL ChXChartDocument::attachResource( const ::rtl::OUString& aURL, + const uno::Sequence< beans::PropertyValue >& aArgs ) + throw( uno::RuntimeException ) +{ + return SfxBaseModel::attachResource( aURL, aArgs ); +} + +::rtl::OUString SAL_CALL ChXChartDocument::getURL() throw( uno::RuntimeException ) +{ + return SfxBaseModel::getURL(); +} + +uno::Sequence< beans::PropertyValue > SAL_CALL ChXChartDocument::getArgs() throw( uno::RuntimeException ) +{ + return SfxBaseModel::getArgs(); +} + +void SAL_CALL ChXChartDocument::connectController( const uno::Reference< frame::XController >& xController ) + throw( uno::RuntimeException ) +{ + SfxBaseModel::connectController( xController ); +} + +void SAL_CALL ChXChartDocument::disconnectController( const uno::Reference< frame::XController >& xController ) + throw( uno::RuntimeException ) +{ + SfxBaseModel::disconnectController( xController ); +} + +uno::Reference< frame::XController > SAL_CALL ChXChartDocument::getCurrentController() throw( uno::RuntimeException ) +{ + return SfxBaseModel::getCurrentController(); +} + +void SAL_CALL ChXChartDocument::setCurrentController( const uno::Reference< frame::XController >& xController ) + throw( container::NoSuchElementException, uno::RuntimeException ) +{ + SfxBaseModel::setCurrentController( xController ); +} + +uno::Reference< uno::XInterface > SAL_CALL ChXChartDocument::getCurrentSelection() throw( uno::RuntimeException ) +{ + return SfxBaseModel::getCurrentSelection(); +} + +void SAL_CALL ChXChartDocument::lockControllers() throw( uno::RuntimeException ) +{ + if( m_pModel ) + { + SolarMutexGuard aGuard; + m_pModel->LockBuild(); + } + else + throw uno::RuntimeException(); +} + +void SAL_CALL ChXChartDocument::unlockControllers() throw( uno::RuntimeException ) +{ + if( m_pModel ) + { + SolarMutexGuard aGuard; + m_pModel->UnlockBuild(); + } + else + throw uno::RuntimeException(); +} + +sal_Bool SAL_CALL ChXChartDocument::hasControllersLocked() throw( uno::RuntimeException ) +{ + if( m_pModel ) + { + SolarMutexGuard aGuard; + return m_pModel->IsLockedBuild(); + } + else + return sal_False; +} + +// XTypeProvider ( ::SfxBaseModel ) +uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL ChXChartDocument::getTypes() + throw( uno::RuntimeException ) +{ + if( maTypeSequence.getLength() == 0 ) + { + osl::Guard< osl::Mutex > aGuard( GetMutex()); + + const uno::Sequence< uno::Type > aBaseTypes( SfxBaseModel::getTypes() ); + const sal_Int32 nBaseTypes = aBaseTypes.getLength(); + const uno::Type* pBaseTypes = aBaseTypes.getConstArray(); + + maTypeSequence.realloc( nBaseTypes + 7 ); // Note: Keep the size updated !! + uno::Type* pTypes = maTypeSequence.getArray(); + + *pTypes++ = ::getCppuType((const uno::Reference< lang::XMultiServiceFactory >*)0); + *pTypes++ = ::getCppuType((const uno::Reference< beans::XPropertySet >*)0); + *pTypes++ = ::getCppuType((const uno::Reference< chart::XChartDocument >*)0); + *pTypes++ = ::getCppuType((const uno::Reference< lang::XServiceInfo >*)0); + *pTypes++ = ::getCppuType((const uno::Reference< util::XNumberFormatsSupplier >*)0); + *pTypes++ = ::getCppuType((const uno::Reference< drawing::XDrawPageSupplier >*)0); + *pTypes++ = ::getCppuType((const uno::Reference< lang::XUnoTunnel >*)0); + + for( sal_Int32 nType = 0; nType < nBaseTypes; nType++ ) + *pTypes++ = *pBaseTypes++; + } + + return maTypeSequence; +} + +uno::Sequence< sal_Int8 > SAL_CALL ChXChartDocument::getImplementationId() + throw( uno::RuntimeException ) +{ + static uno::Sequence< sal_Int8 > aId; + if( aId.getLength() == 0 ) + { + aId.realloc( 16 ); + rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True ); + } + return aId; +} + + + + +// XComponent ( ::XModel ::SfxModel ) +void SAL_CALL ChXChartDocument::dispose() throw( uno::RuntimeException ) +{ + osl::Guard< osl::Mutex > aGuard( GetMutex()); + + uno::Reference<lang::XComponent> xComponent; + if (mxMainTitle.is()) + { + xComponent = uno::Reference<lang::XComponent>(mxMainTitle,uno::UNO_QUERY); + if (xComponent.is()) + { + xComponent->removeEventListener (this); + xComponent->dispose (); + mxMainTitle = NULL; + } + } + if (mxSubTitle.is()) + { + xComponent = uno::Reference<lang::XComponent>(mxSubTitle,uno::UNO_QUERY); + if (xComponent.is()) + { + xComponent->removeEventListener (this); + xComponent->dispose (); + mxSubTitle = NULL; + } + } + if (mxLegend.is()) + { + xComponent = uno::Reference<lang::XComponent>(mxLegend,uno::UNO_QUERY); + if (xComponent.is()) + { + xComponent->removeEventListener (this); + xComponent->dispose (); + mxLegend = NULL; + } + } + if (mxArea.is()) + { + xComponent = uno::Reference<lang::XComponent>(mxArea,uno::UNO_QUERY); + if (xComponent.is()) + { + xComponent->removeEventListener (this); + xComponent->dispose (); + mxArea = NULL; + } + } + + if( m_rXDiagram.is()) + { + ChXDiagram* pDiagram = ChXDiagram::getImplementation( m_rXDiagram ); + if( pDiagram ) + pDiagram->SetDocShell( NULL ); + xComponent = uno::Reference<lang::XComponent>(m_rXDiagram,uno::UNO_QUERY); + if (xComponent.is()) + { + xComponent->removeEventListener (this); + xComponent->dispose(); + m_rXDiagram = NULL; + } + } + m_pModel = NULL; + + SfxBaseModel::dispose(); +} + + + + +void SAL_CALL ChXChartDocument::addEventListener( const uno::Reference< lang::XEventListener >& xListener ) + throw( uno::RuntimeException ) +{ + SfxBaseModel::addEventListener( xListener ); +} + +void SAL_CALL ChXChartDocument::removeEventListener( const uno::Reference< lang::XEventListener >& aListener ) + throw( uno::RuntimeException ) +{ + SfxBaseModel::removeEventListener( aListener ); +} + +// XNumberFormatsSupplier +void ChXChartDocument::InitNumberFormatter() throw( uno::RuntimeException ) +{ + osl::Guard< osl::Mutex > aGuard( GetMutex()); + if( ! mrNumberFormatter.is()) + { + if( m_pModel ) + { + SolarMutexGuard aGuard; + mrNumberFormatter = new SvNumberFormatsSupplierObj( m_pModel->GetNumFormatter() ); + } + else + mrNumberFormatter = new SvNumberFormatsSupplierObj(); + } + + if( ! mrNumberFormatter.is()) + throw uno::RuntimeException(); +} + +uno::Reference< beans::XPropertySet > SAL_CALL ChXChartDocument::getNumberFormatSettings() throw( uno::RuntimeException ) +{ + if( ! mrNumberFormatter.is()) + InitNumberFormatter(); + + return mrNumberFormatter.get()->getNumberFormatSettings(); +} + +uno::Reference< util::XNumberFormats > SAL_CALL ChXChartDocument::getNumberFormats() throw( uno::RuntimeException ) +{ + if( ! mrNumberFormatter.is()) + InitNumberFormatter(); + + return mrNumberFormatter.get()->getNumberFormats(); +} + +// XServiceInfo +::rtl::OUString SAL_CALL ChXChartDocument::getImplementationName() + throw( uno::RuntimeException ) +{ + return SCH_ASCII_TO_OU( "ChXChartDocument" ); +} + +sal_Bool SAL_CALL ChXChartDocument::supportsService( const ::rtl::OUString& ServiceName ) + throw( uno::RuntimeException ) +{ + return SvxServiceInfoHelper::supportsService( ServiceName, getSupportedServiceNames() ); +} + +uno::Sequence< ::rtl::OUString > SAL_CALL ChXChartDocument::getSupportedServiceNames() + throw( uno::RuntimeException ) +{ + uno::Sequence< ::rtl::OUString > aSeq( 4 ); + ::rtl::OUString* pStr = aSeq.getArray(); + pStr[ 0 ] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.OfficeDocument" )); + pStr[ 1 ] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.chart.ChartDocument" )); + pStr[ 2 ] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.chart.ChartTableAddressSupplier" )); + pStr[ 3 ] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.xml.UserDefinedAttributeSupplier" )); + + return aSeq; +} + +// XDrawPageSupplier +uno::Reference< drawing::XDrawPage > SAL_CALL ChXChartDocument::getDrawPage() + throw( uno::RuntimeException ) +{ + osl::Guard< osl::Mutex > aGuard( GetMutex()); + + if( ! mrDrawPage.is() && m_pModel ) + { + mrDrawPage = new ChXChartDrawPage( m_pModel ); + uno::WeakReference< uno::XInterface > xPage( mrDrawPage ); + // set page wrapper (member can be used as this class is declared as friend) + m_pModel->GetPage( 0 )->mxUnoPage = xPage; + } + + return mrDrawPage; +} + +// XUnoTunnel +sal_Int64 SAL_CALL ChXChartDocument::getSomething( const uno::Sequence< sal_Int8 >& aIdentifier ) + throw( uno::RuntimeException ) +{ + if( aIdentifier.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), + aIdentifier.getConstArray(), 16 ) ) + { + return (sal_Int64)this; + } + + // in XML the implementation of the XNumberFormatsSupplier (SvNumberFormatsSupplierObj) is queried + // so return this member here + + if( ! mrNumberFormatter.is()) + InitNumberFormatter(); + + uno::Reference< lang::XUnoTunnel > xUnoTunnel( mrNumberFormatter, uno::UNO_QUERY ); + if( xUnoTunnel.is()) + return xUnoTunnel->getSomething( aIdentifier ); + + return 0; +} + + + +// XEeventListener +//virtual +void SAL_CALL ChXChartDocument::disposing (const lang::EventObject & Source) + throw (uno::RuntimeException) +{ + sal_Bool bChangeProperty = sal_False; + ::rtl::OUString aProperty; + + if (Source.Source == m_rXDiagram) + m_rXDiagram = NULL; + else if (Source.Source == mxMainTitle) + { + mxMainTitle = NULL; + aProperty = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( UNONAME_TITLE_SHOW_MAIN )); + bChangeProperty = sal_True; + } + else if (Source.Source == mxSubTitle) + { + mxSubTitle = NULL; + aProperty = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( UNONAME_TITLE_SHOW_SUB )); + bChangeProperty = sal_True; + } + else if (Source.Source == mxLegend) + { + mxLegend = NULL; + aProperty = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( UNONAME_HASLEGEND )); + bChangeProperty = sal_True; + } + else if (Source.Source == mxArea) + { + mxArea = NULL; + } + + if ( ! bChangeProperty) + return; + + // Inform the document shell of the disposing of Source.Source. + SolarMutexGuard aGuard; + + SchChartDocShell* pDocSh = (SchChartDocShell*)GetObjectShell(); + if (pDocSh == NULL) + return; + uno::Reference< beans::XPropertySet > xDocProp( pDocSh->GetBaseModel(), uno::UNO_QUERY ); + if( xDocProp.is()) + { + uno::Any aFalseBool; + aFalseBool <<= (sal_Bool)(sal_False); + try + { + xDocProp->setPropertyValue( aProperty, aFalseBool ); + } + catch( beans::UnknownPropertyException ) + { + DBG_WARNING( "cannot set property to false" ); + } + } + + SfxBaseModel::disposing( Source ); +} + +// get additional non-chart shapes for XML export +uno::Reference< drawing::XShapes > ChXChartDocument::GetAdditionalShapes() +{ + uno::Reference< drawing::XShapes > xFoundShapes; + + if( m_pModel == NULL ) + return xFoundShapes; + + // iterate 'flat' over all top-level objects + // and determine all that are no chart objects + // i.e. which have no SchObjectId set as user data + ::std::vector< uno::Reference< drawing::XShape > > aShapeVector; + SdrObjListIter aIter( *(m_pModel->GetPage( 0 )), IM_FLAT ); + SdrObject* pObj; + while( aIter.IsMore()) + { + pObj = aIter.Next(); + + if( GetObjectId( *pObj ) != NULL ) + continue; + + // we have no chart user data, i.e. a non-chart object + + // check if chart is inventor. This has to be changed for XML exportability + if( pObj->GetObjInventor() == SchInventor && + pObj->ISA( SchObjGroup )) + { + static_cast< SchObjGroup* >( pObj )->SetUseChartInventor( false ); + } + + uno::Reference< drawing::XShape > xShape( pObj->getUnoShape(), uno::UNO_QUERY ); + if( xShape.is() ) + aShapeVector.push_back( xShape ); + } + if( ! aShapeVector.empty()) + { + // create a shape collection + xFoundShapes = uno::Reference< drawing::XShapes >( SvxShapeCollection_NewInstance(), uno::UNO_QUERY ); + + DBG_ASSERT( xFoundShapes.is(), "Couldn't create a shape collection!" ); + if( xFoundShapes.is()) + { + ::std::vector< uno::Reference< drawing::XShape > >::iterator aIter; + for( aIter = aShapeVector.begin(); aIter != aShapeVector.end(); ++aIter ) + xFoundShapes->add( *aIter ); + } +// } + } + + return xFoundShapes; +} + +uno::Sequence< sal_Int32 > ChXChartDocument::GetTransSequence( SchMemChart* pData, bool bColumns ) +{ + uno::Sequence< sal_Int32 > aResult; + + if( pData ) + { + long nTranslation = pData->GetTranslation(); + + if( bColumns ) + { + short nColCount = pData->GetColCount(); + aResult.realloc( nColCount ); + sal_Int32* pSeq = aResult.getArray(); + const sal_Int32* pTransArray = pData->GetColTranslation(); + sal_Int32 i; + + if( nTranslation == TRANS_COL && + pTransArray != NULL ) + { + for( i = 0; i < nColCount; ++i ) + pSeq[ i ] = pTransArray[ i ]; + } + else + { + // identity sequence + for( i = 0; i < nColCount; ++i ) + pSeq[ i ] = i; + } + } + else // rows + { + short nRowCount = pData->GetRowCount(); + aResult.realloc( nRowCount ); + sal_Int32* pSeq = aResult.getArray(); + const sal_Int32* pTransArray = pData->GetRowTranslation(); + sal_Int32 i; + + if( nTranslation == TRANS_ROW && + pTransArray != NULL ) + { + for( i = 0; i < nRowCount; ++i ) + pSeq[ i ] = pTransArray[ i ]; + } + else + { + // identity sequence + for( i = 0; i < nRowCount; ++i ) + pSeq[ i ] = i; + } + } + } + else + { + DBG_ERROR( "Invalid MemChart" ); + } + + return aResult; +} + +bool ChXChartDocument::SetTransSequence( SchMemChart* pData, bool bColumns, const uno::Sequence< sal_Int32 >& rSeq ) +{ + bool bResult = false; + + if( pData ) + { + long nTranslation = pData->GetTranslation(); + + if( bColumns ) + { + if( nTranslation != TRANS_ROW && + pData->GetColCount() == rSeq.getLength() ) + { + pData->SetTranslation( TRANS_COL ); + pData->SetColTranslation( rSeq.getConstArray()); + bResult = true; + } + } + else // rows + { + if( nTranslation != TRANS_COL && + pData->GetRowCount() == rSeq.getLength() ) + { + pData->SetTranslation( TRANS_ROW ); + pData->SetRowTranslation( rSeq.getConstArray()); + bResult = true; + } + } + + } + else + { + DBG_ERROR( "Invalid MemChart" ); + } + + return bResult; +} +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/unoidl/sch_ChXChartDrawPage.cxx b/binfilter/bf_sch/source/ui/unoidl/sch_ChXChartDrawPage.cxx new file mode 100644 index 000000000000..4c54aa078fde --- /dev/null +++ b/binfilter/bf_sch/source/ui/unoidl/sch_ChXChartDrawPage.cxx @@ -0,0 +1,252 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 "ChXChartDrawPage.hxx" +#include "chtmodel.hxx" + +// header for class OGuard +// header for class Application +#include <vcl/svapp.hxx> +#include <com/sun/star/beans/PropertyAttribute.hpp> +#include <rtl/uuid.h> +namespace binfilter { + + +using namespace ::com::sun::star; + +#define CHART_DRAW_PAGE_WIDTH_ID 1 +#define CHART_DRAW_PAGE_HEIGHT_ID 2 + +const SfxItemPropertyMap* ImplGetChartDrawPageMap() +{ + // Propertymap fuer einen Outliner Text + static const SfxItemPropertyMap aChartDrawPage[] = + { + { MAP_CHAR_LEN( "Width" ), CHART_DRAW_PAGE_WIDTH_ID, &::getCppuType((const sal_Int32*)0), 0, 0 }, + { MAP_CHAR_LEN( "Height" ), CHART_DRAW_PAGE_HEIGHT_ID, &::getCppuType((const sal_Int32*)0), 0, 0 }, + { 0,0,0,0,0 } + }; + + return aChartDrawPage; +} + +ChXChartDrawPage::ChXChartDrawPage( ChartModel* pModel ) : + SvxDrawPage( pModel? pModel->GetPage( 0 ): NULL ), + mpModel( pModel ), + maPropSet( ImplGetChartDrawPageMap() ) +{ + DBG_ASSERT( pModel != NULL, "ChXChartDrawPage: Invalid model (=> invalid page)" ); +} + +ChXChartDrawPage::~ChXChartDrawPage() throw() +{} + + +// XInterface +uno::Any SAL_CALL ChXChartDrawPage::queryInterface( const uno::Type & rType ) + throw( uno::RuntimeException ) +{ + uno::Any aAny = SvxDrawPage::queryInterface( rType ); + if( aAny.hasValue() ) + return aAny; + + return ::cppu::queryInterface( + rType, + ( beans::XPropertySet* )this ); +} + +void SAL_CALL ChXChartDrawPage::acquire() throw() +{ + SvxDrawPage::acquire(); +} + +void SAL_CALL ChXChartDrawPage::release() throw() +{ + SvxDrawPage::release(); +} + +// XTypeProvider +uno::Sequence< uno::Type > SAL_CALL ChXChartDrawPage::getTypes() throw( uno::RuntimeException ) +{ + if( maTypeSequence.getLength() == 0 ) + { + const uno::Sequence< uno::Type > aBaseTypes( SvxDrawPage::getTypes() ); + const sal_Int32 nBaseTypes = aBaseTypes.getLength(); + const uno::Type* pBaseTypes = aBaseTypes.getConstArray(); + + maTypeSequence.realloc( nBaseTypes + 1 ); // Note: Keep the size updated !! + uno::Type* pTypes = maTypeSequence.getArray(); + + *pTypes++ = ::getCppuType((const uno::Reference< beans::XPropertySet >*)0); + + for( sal_Int32 nType = 0; nType < nBaseTypes; nType++ ) + *pTypes++ = *pBaseTypes++; + } + + return maTypeSequence; +} + +uno::Sequence< sal_Int8 > SAL_CALL ChXChartDrawPage::getImplementationId() throw( uno::RuntimeException ) +{ + static uno::Sequence< sal_Int8 > aId; + if( aId.getLength() == 0 ) + { + aId.realloc( 16 ); + rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True ); + } + return aId; +} + +// XPropertySet +uno::Reference< beans::XPropertySetInfo > SAL_CALL ChXChartDrawPage::getPropertySetInfo() + throw( uno::RuntimeException ) +{ + SolarMutexGuard aGuard; + + return maPropSet.getPropertySetInfo(); +} + +void SAL_CALL ChXChartDrawPage::setPropertyValue( const ::rtl::OUString& aPropertyName, const uno::Any& aValue ) + throw( beans::UnknownPropertyException, + beans::PropertyVetoException, + lang::IllegalArgumentException, + lang::WrappedTargetException, + uno::RuntimeException ) +{ + SolarMutexGuard aGuard; + + const SfxItemPropertyMap* pMap = maPropSet.getPropertyMapEntry( aPropertyName ); + if( mpModel && + pMap && pMap->nWID ) + { + if( pMap->nFlags & beans::PropertyAttribute::READONLY ) + throw beans::PropertyVetoException(); + + switch( pMap->nWID ) + { + case CHART_DRAW_PAGE_WIDTH_ID: + { + const SdrPage* pPage = mpModel->GetPage( 0 ); + if( pPage ) + { + sal_Int32 nWidth; + aValue >>= nWidth; + Size aSize = pPage->GetSize(); + aSize.setWidth( nWidth ); + + mpModel->ResizePage( aSize ); + } + } + break; + case CHART_DRAW_PAGE_HEIGHT_ID: + { + const SdrPage* pPage = mpModel->GetPage( 0 ); + if( pPage ) + { + sal_Int32 nHeight; + aValue >>= nHeight; + Size aSize = pPage->GetSize(); + aSize.setHeight( nHeight ); + + mpModel->ResizePage( aSize ); + } + } + break; + } + } +} + +uno::Any SAL_CALL ChXChartDrawPage::getPropertyValue( const ::rtl::OUString& aPropertyName ) + throw( beans::UnknownPropertyException, + lang::WrappedTargetException, + uno::RuntimeException ) +{ + SolarMutexGuard aGuard; + + uno::Any aResult; + const SfxItemPropertyMap* pMap = maPropSet.getPropertyMapEntry( aPropertyName ); + + if( mpModel && + pMap && pMap->nWID ) + { + switch( pMap->nWID ) + { + case CHART_DRAW_PAGE_WIDTH_ID: + { + const SdrPage* pPage = mpModel->GetPage( 0 ); + if( pPage ) + { + Size aSize = pPage->GetSize(); + aResult <<= aSize.getWidth(); + } + } + break; + case CHART_DRAW_PAGE_HEIGHT_ID: + { + const SdrPage* pPage = mpModel->GetPage( 0 ); + if( pPage ) + { + Size aSize = pPage->GetSize(); + aResult <<= aSize.getHeight(); + } + } + break; + } + } + return aResult; +} + +void SAL_CALL ChXChartDrawPage::addPropertyChangeListener( const ::rtl::OUString& aPropertyName, + const uno::Reference< beans::XPropertyChangeListener >& xListener ) + throw( beans::UnknownPropertyException, + lang::WrappedTargetException, + uno::RuntimeException ) +{} + +void SAL_CALL ChXChartDrawPage::removePropertyChangeListener( const ::rtl::OUString& aPropertyName, + const uno::Reference< beans::XPropertyChangeListener >& aListener ) + throw( beans::UnknownPropertyException, + lang::WrappedTargetException, + uno::RuntimeException ) +{} + +void SAL_CALL ChXChartDrawPage::addVetoableChangeListener( const ::rtl::OUString& PropertyName, + const uno::Reference< beans::XVetoableChangeListener >& aListener ) + throw( beans::UnknownPropertyException, + lang::WrappedTargetException, + uno::RuntimeException ) +{} + +void SAL_CALL ChXChartDrawPage::removeVetoableChangeListener( const ::rtl::OUString& PropertyName, + const uno::Reference< beans::XVetoableChangeListener >& aListener ) + throw( beans::UnknownPropertyException, + lang::WrappedTargetException, + uno::RuntimeException ) +{} +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/unoidl/sch_ChXChartObject.cxx b/binfilter/bf_sch/source/ui/unoidl/sch_ChXChartObject.cxx new file mode 100644 index 000000000000..a8e6a97cd87c --- /dev/null +++ b/binfilter/bf_sch/source/ui/unoidl/sch_ChXChartObject.cxx @@ -0,0 +1,1419 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 "ChXChartObject.hxx" +#include "schattr.hxx" + +// header for class OGuard +// header for class Application +#include <vcl/svapp.hxx> + +// header for SvxUnoTextRangeBase +// for OWN_ATTR_... +#include <bf_svx/unoshprp.hxx> +// for SID_ATTR_... +#include <bf_svx/svxids.hrc> +#include <bf_svx/unoshape.hxx> + +#include <rtl/uuid.h> +#include <rtl/memory.h> + +#ifndef _SVX_CHRTITEM_HXX //autogen +#define ITEMID_DOUBLE 0 +#define ITEMID_CHARTTEXTORDER SCHATTR_TEXT_ORDER +#define ITEMID_CHARTTEXTORIENT SCHATTR_TEXT_ORIENT +#define ITEMID_CHARTLEGENDPOS SCHATTR_LEGEND_POS +#define ITEMID_CHARTDATADESCR SCHATTR_DATADESCR_DESCR + +#include <bf_svtools/eitem.hxx> + +#endif +#include <bf_svx/xflbstit.hxx> +#include <bf_svx/xflbmtit.hxx> + +#include "app.hrc" // for SID_TEXTBREAK + +#include "mapprov.hxx" +#include "globfunc.hxx" // for GlobalGenerate3DAttrDefaultItem + +#include <com/sun/star/chart/ChartLegendPosition.hpp> + +// header for any2enum +#include <comphelper/extract.hxx> + +#include <memory> +#include "unonames.hxx" +namespace binfilter { + + +extern SchUnoPropertyMapProvider aSchMapProvider; + +using namespace ::com::sun::star; +using namespace ::rtl; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::beans; + +ChXChartObject::ChXChartObject( long _MapId, ChartModel* _Model, long _WhichId, long _Index ) : + maPropSet( aSchMapProvider.GetMap( (short)_MapId, _Model )), + mpModel( _Model ), + mnWhichId( _WhichId? _WhichId: CHOBJID_ANY ), + mnIndex( _Index ), + maListenerList (maMutex) +{} + +ChXChartObject::~ChXChartObject() +{} + +long ChXChartObject::GetId() const +{ + return mnWhichId; +} + +// XShape + +// the following 'Hack' methods are copied from bf_svx/unodraw/unoshape.cxx +// they are needed as long as the drawing layer requires this + +sal_Bool needLogicRectHack( SdrObject* pObj ) +{ + if( pObj->GetObjInventor() == SdrInventor) + { + switch(pObj->GetObjIdentifier()) + { + case OBJ_GRUP: + case OBJ_LINE: + case OBJ_POLY: + case OBJ_PLIN: + case OBJ_PATHLINE: + case OBJ_PATHFILL: + case OBJ_FREELINE: + case OBJ_FREEFILL: + case OBJ_SPLNLINE: + case OBJ_SPLNFILL: + case OBJ_EDGE: + case OBJ_PATHPOLY: + case OBJ_PATHPLIN: + case OBJ_MEASURE: + return sal_True; + } + } + return sal_False; +} + +Rectangle getLogicRectHack( SdrObject* pObj ) +{ + if(needLogicRectHack(pObj)) + { + return pObj->GetSnapRect(); + } + else + { + return pObj->GetLogicRect(); + } +} + +void setLogicRectHack( SdrObject* pObj, const Rectangle& rRect ) +{ + if(needLogicRectHack(pObj)) + { + pObj->SetSnapRect( rRect ); + } + else + { + pObj->SetLogicRect( rRect ); + } +} + +SdrObject* ChXChartObject::GetCurrentSdrObject() const +{ + SolarMutexGuard aGuard; + + SdrObject* pResult = NULL; + if( mpModel ) + pResult = mpModel->GetObjectWithId( mnWhichId ); + + // use first subobject for axes + if( pResult && + pResult->ISA( SdrObjGroup ) && + ( mnWhichId == CHOBJID_DIAGRAM_X_AXIS || + mnWhichId == CHOBJID_DIAGRAM_Y_AXIS || + mnWhichId == CHOBJID_DIAGRAM_Z_AXIS || + mnWhichId == CHOBJID_DIAGRAM_A_AXIS || + mnWhichId == CHOBJID_DIAGRAM_B_AXIS )) + { + pResult = pResult->GetSubList()->GetObj( 0 ); + } + + return pResult; +} + +// XShape interface methods +awt::Point SAL_CALL ChXChartObject::getPosition() throw( uno::RuntimeException ) +{ + SolarMutexGuard aGuard; + + SdrObject* pObj = GetCurrentSdrObject(); + if( pObj ) + { + Rectangle aRect( getLogicRectHack( pObj )); + Point aPt( aRect.Left(), aRect.Top() ); + + // Position is relative to anchor - calculate absoulte position + aPt -= pObj->GetAnchorPos(); + + return awt::Point( aPt.X(), aPt.Y() ); + } + else + DBG_ERROR( "Couldn't get position due to invalid SdrObject" ); + + return awt::Point(); +} + +void SAL_CALL ChXChartObject::setPosition( const awt::Point& aPosition ) throw( uno::RuntimeException ) +{ + switch( mnWhichId ) + { + // the following objects can not be positioned + case CHOBJID_DIAGRAM_X_AXIS: + case CHOBJID_DIAGRAM_Y_AXIS: + case CHOBJID_DIAGRAM_Z_AXIS: + case CHOBJID_DIAGRAM_AREA: + case CHOBJID_DIAGRAM_WALL: + DBG_ERROR( "Cannot set position of this object" ); + return; + } + + SolarMutexGuard aGuard; + + SdrObject* pObj = GetCurrentSdrObject(); + if( pObj ) + { + Rectangle aRect( getLogicRectHack( pObj ) ); + Point aLocalPos( aPosition.X, aPosition.Y ); + + // Position is absolute - position relative to anchor is required + aLocalPos -= pObj->GetAnchorPos(); + + long nDX = aLocalPos.X() - aRect.Left(); + long nDY = aLocalPos.Y() - aRect.Top(); + + if( nDX != 0 || nDY != 0 ) + { + pObj->Move( Size( nDX, nDY ) ); + if( mpModel ) + { + mpModel->SetChanged(); + + mpModel->SetUseRelativePositions( TRUE ); + mpModel->SetHasBeenMoved( mnWhichId ); + } + } + } + else + DBG_ERROR( "Couldn't set position due to invalid SdrObject" ); +} + +awt::Size SAL_CALL ChXChartObject::getSize() throw( uno::RuntimeException ) +{ + SolarMutexGuard aGuard; + + SdrObject* pObj = GetCurrentSdrObject(); + if( pObj ) + { + Rectangle aRect( getLogicRectHack( pObj )); + Size aObjSize( aRect.GetWidth(), aRect.GetHeight() ); + return awt::Size( aObjSize.getWidth(), aObjSize.getHeight() ); + } + else + DBG_ERROR( "Couldn't get size due to invalid SdrObject" ); + + return awt::Size(); +} + +void SAL_CALL ChXChartObject::setSize( const awt::Size& aSize ) + throw( beans::PropertyVetoException, uno::RuntimeException ) +{ + // set size is not supported by any chart object except + // the diagram which is covered by ChXDiagram + + DBG_ERROR( "Size of chart objects cannot be changed" ); +} + +// XPropertySet +uno::Reference< beans::XPropertySetInfo > SAL_CALL ChXChartObject::getPropertySetInfo() throw( uno::RuntimeException ) +{ + SolarMutexGuard aGuard; + return maPropSet.getPropertySetInfo(); +} + +void SAL_CALL ChXChartObject::setPropertyValue( const ::rtl::OUString& aPropertyName, const uno::Any& aValue ) + throw( beans::UnknownPropertyException, + beans::PropertyVetoException, + lang::IllegalArgumentException, + lang::WrappedTargetException, + uno::RuntimeException ) +{ + SolarMutexGuard aGuard; + + if( mpModel && mnWhichId != CHOBJID_ANY ) + { + if( aPropertyName.compareToAscii( UNONAME_TEXT_STRING ) == 0 ) + { + ::rtl::OUString aStr; + aValue >>= aStr; + mpModel->SetTitle( mnWhichId, aStr ); + mpModel->BuildChart( FALSE ); + return; + } + + const SfxItemPropertyMap* pMap = maPropSet.getPropertyMapEntry( aPropertyName ); + + if( pMap && pMap->nWID ) + { + if( pMap->nFlags & beans::PropertyAttribute::READONLY ) + throw beans::PropertyVetoException(); + + USHORT nWID = pMap->nWID; + + // create itemset capable of holding necessary items + SfxItemSet* pSet = NULL; + switch( nWID ) + { + case OWN_ATTR_FILLBMP_MODE: + pSet = new SfxItemSet( mpModel->GetItemPool(), + XATTR_FILLBMP_STRETCH, XATTR_FILLBMP_STRETCH, + XATTR_FILLBMP_TILE, XATTR_FILLBMP_TILE, 0 ); + break; + + default: + pSet = new SfxItemSet( mpModel->GetItemPool(), nWID, nWID ); + break; + } + + // special handling + switch( nWID ) + { + case SCHATTR_LEGEND_POS: + if( mnWhichId == CHOBJID_LEGEND ) + { + chart::ChartLegendPosition ePos; + cppu::any2enum< chart::ChartLegendPosition >( ePos, aValue ); + //ToDo: NONE shouldn't be used to disable the legend. There should be a way + // to set the position to 'unanchored' plus a flag for + // 'vertically|horizontally' extending + mpModel->SetShowLegend( ePos != chart::ChartLegendPosition_NONE ); + mpModel->SetLegendHasBeenMoved( FALSE ); + // note: SetShowLegend sets pos to CHLEGEND_RIGHT + pSet->Put( SvxChartLegendPosItem( + SAL_STATIC_CAST( SvxChartLegendPos, SAL_STATIC_CAST( int, ePos )))); + } + break; + + case SCHATTR_TEXT_ORIENT: + { + sal_Bool bVal; + if( aValue >>= bVal ) + { + pSet->Put( SvxChartTextOrientItem( + bVal + ? CHTXTORIENT_STACKED + : CHTXTORIENT_AUTOMATIC )); + } + } + break; + + case OWN_ATTR_FILLBMP_MODE: + do + { + drawing::BitmapMode eMode; + if(!(aValue >>= eMode) ) + { + sal_Int32 nMode; + if(!(aValue >>= nMode)) + break; + + eMode = (drawing::BitmapMode)nMode; + } + pSet->Put( XFillBmpStretchItem( eMode == drawing::BitmapMode_STRETCH ) ); + pSet->Put( XFillBmpTileItem( eMode == drawing::BitmapMode_REPEAT ) ); + } + while(0); + break; + + case XATTR_FILLBITMAP: + case XATTR_FILLGRADIENT: + case XATTR_FILLHATCH: + case XATTR_FILLFLOATTRANSPARENCE: + case XATTR_LINEEND: + case XATTR_LINESTART: + case XATTR_LINEDASH: + if( pMap->nMemberId == MID_NAME ) + { + ::rtl::OUString aStr; + if( aValue >>= aStr ) + SvxShape::SetFillAttribute( nWID, aStr, *pSet, mpModel ); + break; + } + // note: this fall-through is intended + + default: + // some item is required for cloning + mpModel->GetAttr( mnWhichId, *pSet, mnIndex ); + + if( ! pSet->Count() && + mpModel->GetItemPool().IsWhich( nWID ) && + ! (( OWN_ATTR_VALUE_START <= nWID ) && ( nWID <= OWN_ATTR_VALUE_END ))) + { + pSet->Put( mpModel->GetItemPool().GetDefaultItem( nWID )); + } + + // CL: convert special character properties + if( ! SvxUnoTextRangeBase::SetPropertyValueHelper( *pSet, pMap, aValue, *pSet )) + { + // standard mapping of any to item + maPropSet.setPropertyValue( pMap, aValue, *pSet ); + } + break; + } + + if( pSet->Count() ) + mpModel->ChangeAttr( *pSet, mnWhichId, mnIndex ); + + delete pSet; + } + } + else + { + throw beans::UnknownPropertyException(); + } +} + +uno::Any SAL_CALL ChXChartObject::getPropertyValue( const ::rtl::OUString& PropertyName ) + throw( beans::UnknownPropertyException, + lang::WrappedTargetException, + uno::RuntimeException ) +{ + SolarMutexGuard aGuard; + + uno::Any aResultaAny; + sal_Bool bPropertyUnknown = sal_False; + + if( mpModel && mnWhichId != CHOBJID_ANY ) + { + // titles + if( PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( UNONAME_TEXT_STRING ))) + { + aResultaAny <<= ::rtl::OUString( mpModel->GetTitle( mnWhichId )); + return aResultaAny; + } + + // legend alignment + if( mnWhichId == CHOBJID_LEGEND && + PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( UNONAME_CHARTLEGENDALIGN ))) + { + SfxItemSet rSet = mpModel->GetLegendAttr(); + const SfxPoolItem *pPoolItem = NULL; + SvxChartLegendPos ePos = + rSet.GetItemState( SCHATTR_LEGEND_POS,TRUE, &pPoolItem) == SFX_ITEM_SET + ? ((const SvxChartLegendPosItem*)pPoolItem)->GetValue() + : CHLEGEND_RIGHT; + chart::ChartLegendPosition ePosition = (chart::ChartLegendPosition)ePos; + aResultaAny <<= ePosition; + return aResultaAny; + } + + // properties using map + const SfxItemPropertyMap* pMap = maPropSet.getPropertyMapEntry( PropertyName ); + if( pMap && pMap->nWID ) + { + USHORT nWID = pMap->nWID; + + if( nWID == OWN_ATTR_FILLBMP_MODE ) + { + SfxItemSet aSet( mpModel->GetItemPool(), + XATTR_FILLBMP_STRETCH, XATTR_FILLBMP_STRETCH, + XATTR_FILLBMP_TILE, XATTR_FILLBMP_TILE, 0 ); + + // get 'full attributes', ie some members are copied to the set + mpModel->GetAttr( mnWhichId, aSet, mnIndex ); + + XFillBmpStretchItem* pStretchItem = (XFillBmpStretchItem*)&aSet.Get( XATTR_FILLBMP_STRETCH ); + XFillBmpTileItem* pTileItem = (XFillBmpTileItem*)&aSet.Get( XATTR_FILLBMP_TILE ); + + if( pTileItem && pTileItem->GetValue() ) + { + aResultaAny <<= drawing::BitmapMode_REPEAT; + } + else if( pStretchItem && pStretchItem->GetValue() ) + { + aResultaAny <<= drawing::BitmapMode_STRETCH; + } + else + { + aResultaAny <<= drawing::BitmapMode_NO_REPEAT; + } + return aResultaAny; + } + + std::auto_ptr<SfxItemSet> aSet; + switch (nWID) + { + case SCHATTR_TEXT_DEGREES: + // Needing the text orientation for adapting + // CHTXTORIENT_AUTOMATIC to corresponging degrees. + aSet = std::auto_ptr<SfxItemSet> (new SfxItemSet (mpModel->GetItemPool(), + nWID, nWID, + SCHATTR_TEXT_ORIENT,SCHATTR_TEXT_ORIENT, + 0)); + break; + + default: + // Just interested in the single item. + aSet = std::auto_ptr<SfxItemSet> (new SfxItemSet (mpModel->GetItemPool(), + nWID, nWID)); + } + + // get 'full attributes', ie some members are copied to the set + mpModel->GetAttr( mnWhichId, *aSet, mnIndex ); + + if( SvxUnoTextRangeBase::GetPropertyValueHelper( *aSet, pMap, aResultaAny )) + return aResultaAny; + + // item is not set => use default + if( !aSet->Count() ) + { + // get default value from pool + if( mpModel->GetItemPool().IsWhich( nWID ) ) + { + if( ! ( OWN_ATTR_VALUE_START <= nWID && nWID <= OWN_ATTR_VALUE_END )) // 'private' properties from SvxShape + { + aSet->Put( mpModel->GetItemPool().GetDefaultItem( nWID ) ); + } + } + else if( nWID == SID_TEXTBREAK ) + { + aSet->Put( SfxBoolItem( SID_TEXTBREAK, + ( mnWhichId == CHOBJID_DIAGRAM_X_AXIS || + mnWhichId == CHOBJID_DIAGRAM_A_AXIS ))); + } + else if( nWID == SID_ATTR_NUMBERFORMAT_SOURCE ) + { + aSet->Put( SfxBoolItem( SID_ATTR_NUMBERFORMAT_SOURCE, TRUE )); + } + else + { +#ifdef DBG_UTIL + String aTmpString( PropertyName ); + ByteString aProp( aTmpString, RTL_TEXTENCODING_ASCII_US ); + DBG_ERROR2( "Diagram: Property %s has an invalid ID (%d)", aProp.GetBuffer(), nWID ); +#endif + } + } + + // item or default has been set + if( aSet->Count() ) + { + // Special case: Axis title rotation angle. + if (nWID == SCHATTR_TEXT_DEGREES) + { + // Automatic text orientation is changed into corresponding + // rotation angle. + SvxChartTextOrient eOrientation = + ((const SvxChartTextOrientItem&)aSet->Get( + SCHATTR_TEXT_ORIENT)).GetValue(); + if (eOrientation == CHTXTORIENT_AUTOMATIC) + { + switch (mnWhichId) + { + case CHOBJID_DIAGRAM_TITLE_X_AXIS: + if (mpModel->IsXVertikal()) + eOrientation = CHTXTORIENT_BOTTOMTOP; + else + eOrientation = CHTXTORIENT_AUTOMATIC; + break; + + case CHOBJID_DIAGRAM_TITLE_Y_AXIS: + if (mpModel->IsXVertikal()) + eOrientation = CHTXTORIENT_AUTOMATIC; + else + eOrientation = CHTXTORIENT_BOTTOMTOP; + break; + + case CHOBJID_DIAGRAM_TITLE_Z_AXIS: + if (mpModel->IsXVertikal()) + eOrientation = CHTXTORIENT_TOPBOTTOM; + else + eOrientation = CHTXTORIENT_AUTOMATIC; + break; + + default: + eOrientation = CHTXTORIENT_AUTOMATIC; + break; + } + long nAngle = GetTextRotation (*aSet, eOrientation); + aSet->Put (SfxInt32Item (SCHATTR_TEXT_DEGREES, nAngle)); + } + } + + if( nWID == SCHATTR_TEXT_ORIENT ) + { + // map enum to bool: only stacked or not stacked is interesting + SvxChartTextOrient eOrientation = + ((const SvxChartTextOrientItem&)aSet->Get( + SCHATTR_TEXT_ORIENT)).GetValue(); + aResultaAny <<= static_cast< sal_Bool >( eOrientation == CHTXTORIENT_STACKED ); + } + else + { + // get value from ItemSet + aResultaAny = maPropSet.getPropertyValue( pMap, *aSet ); + if( *pMap->pType != aResultaAny.getValueType() ) + { + // since the sfx uint16 item now exports a sal_Int32, we may have to fix this here + if( ( *pMap->pType == ::getCppuType((const sal_Int16*)0)) && aResultaAny.getValueType() == ::getCppuType((const sal_Int32*)0) ) + { + sal_Int32 nValue; + aResultaAny >>= nValue; + aResultaAny <<= static_cast< sal_Int16 >( nValue ); + } + else + { + DBG_ERROR( "getPropertyValue(): wrong Type!" ); + } + } + } + } + else + { + bPropertyUnknown = sal_True; + } + } + else + { + bPropertyUnknown = sal_True; + } + + if( bPropertyUnknown ) + { + ::rtl::OUString aMessage( RTL_CONSTASCII_USTRINGPARAM( "Chart Object: Unknown Property " )); + aMessage += PropertyName; + beans::UnknownPropertyException aExcpt( aMessage, (::cppu::OWeakObject*)this ); + throw aExcpt; + } + } + + return aResultaAny; +} + +void SAL_CALL ChXChartObject::addPropertyChangeListener( const ::rtl::OUString& aPropertyName, + const uno::Reference< beans::XPropertyChangeListener >& xListener ) + throw( beans::UnknownPropertyException, + lang::WrappedTargetException, + uno::RuntimeException ) +{} + +void SAL_CALL ChXChartObject::removePropertyChangeListener( const ::rtl::OUString& aPropertyName, + const uno::Reference< beans::XPropertyChangeListener >& aListener ) + throw( beans::UnknownPropertyException, + lang::WrappedTargetException, + uno::RuntimeException ) +{} + +void SAL_CALL ChXChartObject::addVetoableChangeListener( const ::rtl::OUString& PropertyName, + const uno::Reference< beans::XVetoableChangeListener >& aListener ) + throw( beans::UnknownPropertyException, + lang::WrappedTargetException, + uno::RuntimeException ) +{} + +void SAL_CALL ChXChartObject::removeVetoableChangeListener( const ::rtl::OUString& PropertyName, + const uno::Reference< beans::XVetoableChangeListener >& aListener ) + throw( beans::UnknownPropertyException, + lang::WrappedTargetException, + uno::RuntimeException ) +{} + + + +//===== XMultiPropertySet =================================================== + +/* + In contrast to calling the method setPropertyValue (singular) for every given property name + the implementation of this method exploits the following properties: + 1: Both the given sequence of property names and the member property map are sorted according + to the property names. + 2: The item set which gathers all items changed by setting the properties is created only once. + 3: The solar mutex is acquired only once. +*/ +void SAL_CALL ChXChartObject::setPropertyValues ( + const uno::Sequence< ::rtl::OUString >& aPropertyNames, + const uno::Sequence< uno::Any >& aValues ) + throw ( beans::PropertyVetoException, + lang::IllegalArgumentException, + lang::WrappedTargetException, + uno::RuntimeException) +{ + SolarMutexGuard aGuard; + + // Get pointers to first elements of lists. + const SfxItemPropertyMap * pProperty = maPropSet.getPropertyMap (); + const OUString * pPropertyName = aPropertyNames.getConstArray (); + const Any * pValue = aValues.getConstArray (); + + // Check preconditions. + if (mpModel == NULL) + throw UnknownPropertyException (OUString(RTL_CONSTASCII_USTRINGPARAM( + "ChXChartObject::setPropertyValues: no model")), (::cppu::OWeakObject*)this); + if (mnWhichId == CHOBJID_ANY) + throw UnknownPropertyException (OUString(RTL_CONSTASCII_USTRINGPARAM( + "ChXChartObject::setPropertyValues: invalid object")), (::cppu::OWeakObject*)this); + if (pProperty == NULL || pProperty->pName == NULL) + throw UnknownPropertyException (OUString(RTL_CONSTASCII_USTRINGPARAM( + "ChXChartObject::setPropertyValues: empty property list")), (::cppu::OWeakObject*)this); + + // Some variables used in the following loop. + USHORT nWID; + + // Item set used to collect all modifications from the individual properties to set. + SfxItemSet aModifications (mpModel->GetItemPool()); + mpModel->GetAttr (mnWhichId, aModifications, mnIndex); + + // Iterate over all the given property names. + sal_Int32 nCounter = aPropertyNames.getLength(); + while (nCounter-- > 0) + { + AdvanceToName (pProperty, pPropertyName); + + // Handle the properties in the property map. The case statements handle + // the special cases while the default statement handles all remaining cases. + switch (nWID = pProperty->nWID) + { + case CHATTR_TITLE_MAIN: + // Handle special cases of title objects. + { + OUString aString; + *pValue >>= aString; + mpModel->SetTitle (mnWhichId, aString); + mpModel->BuildChart (FALSE); + } + break; + + case SCHATTR_LEGEND_POS: + // This one is only valid if this object is a legend. + if (mnWhichId == CHOBJID_LEGEND) + { + chart::ChartLegendPosition ePos; + cppu::any2enum< chart::ChartLegendPosition >(ePos, *pValue); + // ToDo: NONE shouldn't be used to disable the legend. There should + // be a way to set the position to 'unanchored' plus a flag for + // 'vertically|horizontally' extending + mpModel->SetShowLegend (ePos != chart::ChartLegendPosition_NONE); + mpModel->SetLegendHasBeenMoved (FALSE); + // note: SetShowLegend sets pos to CHLEGEND_RIGHT + aModifications.Put (SvxChartLegendPosItem ( + SAL_STATIC_CAST (SvxChartLegendPos, + SAL_STATIC_CAST (int, ePos)))); + } + break; + + case SCHATTR_TEXT_ORIENT: + { + sal_Bool bVal; + if( *pValue >>= bVal ) + { + aModifications.Put( SvxChartTextOrientItem( + bVal + ? CHTXTORIENT_STACKED + : CHTXTORIENT_AUTOMATIC )); + } + } + break; + + case OWN_ATTR_FILLBMP_MODE: + { + drawing::BitmapMode eMode; + if ( ! (*pValue >>= eMode)) + { + sal_Int32 nMode; + if ( ! (*pValue >>= nMode)) + break; + eMode = (drawing::BitmapMode)nMode; + } + aModifications.Put (XFillBmpStretchItem (eMode==drawing::BitmapMode_STRETCH)); + aModifications.Put (XFillBmpTileItem (eMode==drawing::BitmapMode_REPEAT)); + } + break; + + case XATTR_FILLBITMAP: + case XATTR_FILLGRADIENT: + case XATTR_FILLHATCH: + case XATTR_FILLFLOATTRANSPARENCE: + case XATTR_LINEEND: + case XATTR_LINESTART: + case XATTR_LINEDASH: + if (pProperty->nMemberId == MID_NAME ) + { + ::rtl::OUString aString; + if (*pValue >>= aString) + SvxShape::SetFillAttribute (nWID, aString, aModifications, mpModel); + break; + } + // note: this fall-through is intended + + default: +/* if ( aModifications.Count() == 0 + && mpModel->GetItemPool().IsWhich (nWID) + && ! ((nWID >= OWN_ATTR_VALUE_START) && (nWID <= OWN_ATTR_VALUE_END))) + { + aModifications.Put (mpModel->GetItemPool().GetDefaultItem (nWID)); + } +*/ + // First look if we are looking at a special character property. + if ( ! SvxUnoTextRangeBase::SetPropertyValueHelper (aModifications, pProperty, + *pValue, aModifications)) + { + // Not a special character property. + // Convert the given property value to an item and set it. + maPropSet.setPropertyValue (pProperty, *pValue, aModifications); + } + break; + } + + // Advance to the next property, property name and value. + pPropertyName++; + pValue++; + } + // Propagate the modified item set to the chart model. + if (aModifications.Count() > 0) + mpModel->ChangeAttr (aModifications, mnWhichId, mnIndex); +} + + + +/* + Again three facts are exploited: + 1. Getting the solar mutex once outside the main loop. + 2. Using the sorting of both the given list of property names and of the list of properties. + 3. Creating and filling once of the model's item set. + + This method uses two methods to make it usable in a generic way by derived classes. + 1. CreateItemSet creates and fills an item set with all known items which is used to set the + requested properties. + 2. GetPropertyValue is used to retrieve the individual values. + Both methods can be overloaded to implement class specific behaviour. + +*/ +uno::Sequence< uno::Any > SAL_CALL ChXChartObject::getPropertyValues ( + const uno::Sequence< ::rtl::OUString >& aPropertyNames ) + throw ( uno::RuntimeException) +{ +#if 0 + uno::Sequence<uno::Any> aResult (aPropertyNames.getLength()); + + for (sal_Int32 i=0; i<aPropertyNames.getLength(); i++) + { + aResult[i] = getPropertyValue (aPropertyNames[i]); + } + + return aResult; +#endif + SolarMutexGuard aGuard; + + // This sequence is filled with the requested values for the given property names. + Sequence<Any> aResult (aPropertyNames.getLength()); + + // Get pointers to first elements of lists. + const SfxItemPropertyMap * pProperty = maPropSet.getPropertyMap (); + const OUString * pPropertyName = aPropertyNames.getConstArray (); + Any * pValue = aResult.getArray (); + + // Check preconditions. + if (mpModel == NULL || mnWhichId == CHOBJID_ANY) + return aResult; + + // Get the models attributes. + SfxItemSet * pAttributes = CreateItemSet(); + + // Iterate over all given property names. + sal_Int32 nCounter = aPropertyNames.getLength(); + while (nCounter-- > 0) + { + AdvanceToName (pProperty, pPropertyName); + + GetPropertyValue (*pProperty, *pValue, *pAttributes); + + // Advance to the next property, property name and value. + pPropertyName++; + pValue++; + } + + delete pAttributes; + return aResult; +} + + + + +void SAL_CALL ChXChartObject::addPropertiesChangeListener ( + const uno::Sequence< ::rtl::OUString >& aPropertyNames, + const uno::Reference< beans::XPropertiesChangeListener >& xListener ) + throw ( uno::RuntimeException) +{ + // Not implemented. +} + + + + +void SAL_CALL ChXChartObject::removePropertiesChangeListener ( + const uno::Reference< beans::XPropertiesChangeListener >& xListener ) + throw ( uno::RuntimeException) +{ + // Not implemented. +} + + + + +void SAL_CALL ChXChartObject::firePropertiesChangeEvent ( + const uno::Sequence< ::rtl::OUString >& aPropertyNames, + const uno::Reference< beans::XPropertiesChangeListener >& xListener ) + throw ( uno::RuntimeException) +{ + // Not implemented. +} + + + +// XPropertyState +beans::PropertyState SAL_CALL ChXChartObject::getPropertyState( const ::rtl::OUString& PropertyName ) + throw( beans::UnknownPropertyException, uno::RuntimeException ) +{ + SolarMutexGuard aGuard; + + const SfxItemPropertyMap* pMap = maPropSet.getPropertyMapEntry( PropertyName ); + + if( mpModel && + pMap && pMap->nWID ) + { + USHORT nWID = pMap->nWID; + + if( mnWhichId == CHOBJID_LEGEND && + nWID == CHATTR_LEGEND_POS ) + { + const SfxItemSet& rSet = mpModel->GetLegendAttr(); + SfxItemState aState = rSet.GetItemState( SCHATTR_LEGEND_POS, sal_False ); + + if( aState == SFX_ITEM_DEFAULT ) + return beans::PropertyState_DEFAULT_VALUE; + else + return beans::PropertyState_DIRECT_VALUE; + } + else if( nWID == CHATTR_TITLE_MAIN || // property 'String' for ALL titles + nWID == SID_TEXTBREAK ) // x, y and z axis have different defaults + { + return beans::PropertyState_DIRECT_VALUE; + } + else if( pMap->nWID == OWN_ATTR_FILLBMP_MODE ) + { + SfxItemSet aSet( mpModel->GetItemPool(), + XATTR_FILLBMP_STRETCH, XATTR_FILLBMP_STRETCH, + XATTR_FILLBMP_TILE, XATTR_FILLBMP_TILE, 0 ); + mpModel->GetAttr( mnWhichId, aSet, mnIndex ); + + if( aSet.GetItemState( XATTR_FILLBMP_STRETCH, false ) == SFX_ITEM_SET || + aSet.GetItemState( XATTR_FILLBMP_TILE, false ) == SFX_ITEM_SET ) + return beans::PropertyState_DIRECT_VALUE; + else + return beans::PropertyState_DEFAULT_VALUE; + } + else + { + SfxItemSet aSet( mpModel->GetItemPool(), nWID, nWID ); + mpModel->GetAttr( mnWhichId, aSet, mnIndex ); + + switch( aSet.GetItemState( nWID, sal_False ) ) + { + case SFX_ITEM_DONTCARE: + case SFX_ITEM_DISABLED: + return beans::PropertyState_AMBIGUOUS_VALUE; + case SFX_ITEM_READONLY: + case SFX_ITEM_SET: + return beans::PropertyState_DIRECT_VALUE; + case SFX_ITEM_DEFAULT: + return beans::PropertyState_DEFAULT_VALUE; + case SFX_ITEM_UNKNOWN: + default: + throw beans::UnknownPropertyException(); + } + } + } + + return beans::PropertyState_DIRECT_VALUE; +} + +uno::Sequence< beans::PropertyState > SAL_CALL ChXChartObject::getPropertyStates( + const uno::Sequence< ::rtl::OUString > & aPropertyNames) + throw( beans::UnknownPropertyException, + uno::RuntimeException ) +{ +#if 0 + SolarMutexGuard aGuard; + + const sal_Int32 nCount = aPropertyNames.getLength(); + const ::rtl::OUString * pName = aPropertyNames.getConstArray(); + Sequence<PropertyState > aStates (nCount); + PropertyState * pState = aStates.getArray(); + + if (mpModel == NULL) + return aStates; + + for (sal_Int32 nIdx = 0; nIdx < nCount; nIdx++) + pState[nIdx] = getPropertyState (pName[nIdx]); + + return aStates; +#else + SolarMutexGuard aGuard; + + // Get pointers to first elements of lists. + const SfxItemPropertyMap * pProperty = maPropSet.getPropertyMap (); + const sal_Int32 nCount = aPropertyNames.getLength(); + const OUString * pPropertyName = aPropertyNames.getConstArray(); + Sequence<PropertyState > aStates (nCount); + PropertyState * pState = aStates.getArray(); + + // Check precondition. + if (mpModel == NULL) + return aStates; + + // Get the models attributes. + SfxItemSet aAttributes (mpModel->GetItemPool(), + mpModel->GetAttr (mnWhichId, mnIndex).GetRanges()); + mpModel->GetAttr (mnWhichId, aAttributes, mnIndex); + + // Some variables used in the following loop. + USHORT nWID; + + // Iterate over all given property names. + sal_Int32 nCounter = aPropertyNames.getLength(); + while (nCounter-- > 0) + { + AdvanceToName (pProperty, pPropertyName); + + switch (nWID = pProperty->nWID) + { + case CHATTR_LEGEND_POS: + if (mnWhichId == CHOBJID_LEGEND) + { + const SfxItemSet& rSet = mpModel->GetLegendAttr(); + SfxItemState aState = rSet.GetItemState( SCHATTR_LEGEND_POS, sal_False ); + + if( aState == SFX_ITEM_DEFAULT ) + *pState = PropertyState_DEFAULT_VALUE; + else + *pState = PropertyState_DIRECT_VALUE; + } + break; + + case CHATTR_TITLE_MAIN: // property 'String' for ALL titles + case SID_TEXTBREAK: // x, y and z axis have different defaults + *pState = PropertyState_DIRECT_VALUE; + break; + + case OWN_ATTR_FILLBMP_MODE: + if ( aAttributes.GetItemState( XATTR_FILLBMP_STRETCH, false ) == SFX_ITEM_SET + || aAttributes.GetItemState( XATTR_FILLBMP_TILE, false ) == SFX_ITEM_SET ) + *pState = PropertyState_DIRECT_VALUE; + else + *pState = PropertyState_DEFAULT_VALUE; + break; + + case SID_ATTR_NUMBERFORMAT_SOURCE: + if( aAttributes.GetItemState( SID_ATTR_NUMBERFORMAT_SOURCE ) != SFX_ITEM_SET ) + *pState = PropertyState_DEFAULT_VALUE; + else + *pState = PropertyState_DIRECT_VALUE; + break; + + default: + switch (aAttributes.GetItemState( nWID, sal_False )) + { + case SFX_ITEM_DONTCARE: + case SFX_ITEM_DISABLED: + *pState = PropertyState_AMBIGUOUS_VALUE; + break; + + case SFX_ITEM_READONLY: + case SFX_ITEM_SET: + *pState = PropertyState_DIRECT_VALUE; + break; + + case SFX_ITEM_DEFAULT: + *pState = PropertyState_DEFAULT_VALUE; + break; + + case SFX_ITEM_UNKNOWN: + default: + { + OUString aMessage (RTL_CONSTASCII_USTRINGPARAM ( "Chart Object: Unknown Property " )); + aMessage += *pPropertyName; + throw UnknownPropertyException (aMessage, (::cppu::OWeakObject*)this ); + } + } + } + pPropertyName ++; + pState ++; + } + + return aStates; +#endif +} + +void SAL_CALL ChXChartObject::setPropertyToDefault( const ::rtl::OUString& PropertyName ) + throw( beans::UnknownPropertyException, + uno::RuntimeException ) +{ + SolarMutexGuard aGuard; + + const SfxItemPropertyMap* pMap = maPropSet.getPropertyMapEntry( PropertyName ); + + if( mpModel ) + { + // set an empty item to change attribute to default + SfxItemSet aSet( mpModel->GetItemPool(), pMap->nWID, pMap->nWID ); + mpModel->ChangeAttr( aSet, mnWhichId, mnIndex ); + } +} + +uno::Any SAL_CALL ChXChartObject::getPropertyDefault( const ::rtl::OUString& aPropertyName ) + throw( beans::UnknownPropertyException, + lang::WrappedTargetException, + uno::RuntimeException ) +{ + const SfxItemPropertyMap* pMap = maPropSet.getPropertyMapEntry( aPropertyName ); + SfxItemSet aSet( mpModel->GetItemPool(), pMap->nWID, pMap->nWID ); + + if( mpModel->GetItemPool().IsWhich( pMap->nWID )) + { + aSet.Put( mpModel->GetItemPool().GetDefaultItem( pMap->nWID )); + } + else if( pMap->nWID == SID_TEXTBREAK ) + { + // default for x axis is true, false for y/z + BOOL bTextBreak = + ( mnWhichId == CHOBJID_DIAGRAM_X_AXIS || + mnWhichId == CHOBJID_DIAGRAM_A_AXIS ); + aSet.Put( SfxBoolItem( SID_TEXTBREAK, bTextBreak )); + } + else + throw beans::UnknownPropertyException(); + + uno::Any aAny = maPropSet.getPropertyValue( pMap, aSet ); + + if( *pMap->pType != aAny.getValueType() ) + { + // since the sfx uint16 item now exports a sal_Int32, we may have to fix this here + if( ( *pMap->pType == ::getCppuType((const sal_Int16*)0)) && aAny.getValueType() == ::getCppuType((const sal_Int32*)0) ) + { + sal_Int32 nValue; + aAny >>= nValue; + aAny <<= static_cast< sal_Int16 >( nValue ); + } + else + { + DBG_ERROR( "getPropertyDefault(): wrong Type!" ); + } + } + + return aAny; +} + + + + +// XMultiPropertyStates + +// ChXChartObject::getPropertyStates is also part of XPropertyState and is defined above. + + + +void SAL_CALL ChXChartObject::setAllPropertiesToDefault (void) + throw ( uno::RuntimeException) +{ + DBG_ERROR ("ChXChartObject::setAllPropertiesToDefault"); +} + + + + +void SAL_CALL ChXChartObject::setPropertiesToDefault ( + const uno::Sequence< ::rtl::OUString >& aPropertyNames ) + throw ( beans::UnknownPropertyException, + uno::RuntimeException) +{ + for (sal_Int32 i=0; i<aPropertyNames.getLength(); i++) + { + setPropertyToDefault (aPropertyNames[i]); + } +} + + + + +uno::Sequence< uno::Any > SAL_CALL ChXChartObject::getPropertyDefaults ( + const uno::Sequence< ::rtl::OUString >& aPropertyNames ) + throw ( beans::UnknownPropertyException, + lang::WrappedTargetException, + uno::RuntimeException) +{ + uno::Sequence<uno::Any> aResult (aPropertyNames.getLength()); + + for (sal_Int32 i=0; i<aPropertyNames.getLength(); i++) + { + aResult[i] = getPropertyDefault (aPropertyNames[i]); + } + + return aResult; +} + + + +// XComponent +void SAL_CALL ChXChartObject::dispose() throw( uno::RuntimeException ) +{ + ::com::sun::star::lang::EventObject aEvent (*this); + maListenerList.disposeAndClear (aEvent); +} + +void SAL_CALL ChXChartObject::addEventListener( const uno::Reference< lang::XEventListener >& xListener ) + throw( uno::RuntimeException ) +{ + maListenerList.addInterface (xListener); +} + +void SAL_CALL ChXChartObject::removeEventListener( const uno::Reference< lang::XEventListener >& xListener ) + throw( uno::RuntimeException ) +{ + maListenerList.removeInterface (xListener); +} + +// XServiceInfo +sal_Bool SAL_CALL ChXChartObject::supportsService( const ::rtl::OUString& ServiceName ) + throw( uno::RuntimeException ) +{ + return SvxServiceInfoHelper::supportsService( ServiceName, getSupportedServiceNames() ); +} + + +// generate a uniqueId +const uno::Sequence< sal_Int8 > & ChXChartObject::getUnoTunnelId() throw() +{ + static uno::Sequence< sal_Int8 > * pSeq = 0; + if( !pSeq ) + { + osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); + if( !pSeq ) + { + static uno::Sequence< sal_Int8 > aSeq( 16 ); + rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True ); + pSeq = &aSeq; + } + } + return *pSeq; +} + +// XUnoTunnel +sal_Int64 SAL_CALL ChXChartObject::getSomething( const uno::Sequence< sal_Int8 >& aIdentifier ) + throw( uno::RuntimeException ) +{ + if( aIdentifier.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), + aIdentifier.getConstArray(), 16 ) ) + { + return (sal_Int64)this; + } + return 0; +} + + + +//===== protected methods ======================================================================= + +void ChXChartObject::AdvanceToName (const SfxItemPropertyMap *& pProperty, + const OUString * pPropertyName) +{ + sal_Int32 nComparisonResult; + + // Advance over the property list to the property with the current name. + while ((nComparisonResult=pPropertyName->compareToAscii (pProperty->pName)) > 0) + { + pProperty++; + if (pProperty->pName == NULL) + { + // We reached the end of the property list. Therefore all remaining given + // property names can not be found. + OUString sMessage = OUString (RTL_CONSTASCII_USTRINGPARAM ( "ChXChartObject::setPropertyValues: unknown property ")); + sMessage += *pPropertyName; + throw UnknownPropertyException (sMessage, (::cppu::OWeakObject*)this); + } + } + if (nComparisonResult < 0) + { + // All remaining given property names can not match (because they lie + // alphabetically before) the remaining properties => Error + OUString sMessage = OUString (RTL_CONSTASCII_USTRINGPARAM ( "ChXChartObject::setPropertyValues: unknown property ")); + sMessage += *pPropertyName; + throw UnknownPropertyException (sMessage, (::cppu::OWeakObject*)this); + } + + // If we get here then we have found the propert with the name pProperty->pName. +} + + + +SfxItemSet * ChXChartObject::CreateItemSet (void) +{ + SfxItemSet * pAttributes = new SfxItemSet (mpModel->GetItemPool()); + mpModel->GetAttr (mnWhichId, *pAttributes, mnIndex); + return pAttributes; +} + + + + +void ChXChartObject::GetPropertyValue (const SfxItemPropertyMap & rProperty, + Any & rValue, + SfxItemSet & rAttributes) +{ + USHORT nWID = rProperty.nWID; + + switch (nWID) + { + case CHATTR_TITLE_MAIN: + rValue <<= OUString( mpModel->GetTitle( mnWhichId )); + break; + + case SCHATTR_LEGEND_POS: + if (mnWhichId == CHOBJID_LEGEND) + { + SfxItemSet rSet = mpModel->GetLegendAttr(); + const SfxPoolItem *pPoolItem = NULL; + SvxChartLegendPos ePos = + rSet.GetItemState( SCHATTR_LEGEND_POS,TRUE, &pPoolItem) == SFX_ITEM_SET + ? ((const SvxChartLegendPosItem*)pPoolItem)->GetValue() + : CHLEGEND_RIGHT; + chart::ChartLegendPosition ePosition = (chart::ChartLegendPosition)ePos; + rValue <<= ePosition; + } + break; + + case OWN_ATTR_FILLBMP_MODE: + { + XFillBmpStretchItem * pStretchItem = (XFillBmpStretchItem*)&rAttributes.Get ( + XATTR_FILLBMP_STRETCH ); + XFillBmpTileItem * pTileItem = (XFillBmpTileItem*)&rAttributes.Get ( + XATTR_FILLBMP_TILE ); + + if( pTileItem && pTileItem->GetValue() ) + rValue <<= drawing::BitmapMode_REPEAT; + else if( pStretchItem && pStretchItem->GetValue() ) + rValue <<= drawing::BitmapMode_STRETCH; + else + rValue <<= drawing::BitmapMode_NO_REPEAT; + } + break; + + case SCHATTR_TEXT_ORIENT: + rValue <<= static_cast< sal_Bool >( + CHTXTORIENT_STACKED == + static_cast< const SvxChartTextOrientItem & >( rAttributes.Get( SCHATTR_TEXT_ORIENT )).GetValue() ); + break; + + default : + // Handle some special properties. + if (SvxUnoTextRangeBase::GetPropertyValueHelper (rAttributes, &rProperty, rValue)) + break; + + // item is not set => use default + switch (rAttributes.GetItemState (nWID, FALSE)) + { + case SFX_ITEM_UNKNOWN: + { + OUString sMessage (RTL_CONSTASCII_USTRINGPARAM ( "ChXChartObject::getPropertyValues: unknown property ")); + sMessage += OUString::createFromAscii(rProperty.pName); + throw UnknownPropertyException (sMessage, (::cppu::OWeakObject*)this); + } + + case SFX_ITEM_DEFAULT: + // Get default value from the item pool. + if ( mpModel->GetItemPool().IsWhich( nWID ) + && (nWID < OWN_ATTR_VALUE_START || nWID > OWN_ATTR_VALUE_END)) + { + // `Private' properties from SvxShape. + rAttributes.Put( mpModel->GetItemPool().GetDefaultItem( nWID ) ); + } + else if( nWID == SID_TEXTBREAK ) + { + rAttributes.Put( SfxBoolItem( SID_TEXTBREAK, + ( mnWhichId == CHOBJID_DIAGRAM_X_AXIS + || mnWhichId == CHOBJID_DIAGRAM_A_AXIS ))); + } + else if( nWID == SID_ATTR_NUMBERFORMAT_SOURCE ) + { + rAttributes.Put( SfxBoolItem( SID_ATTR_NUMBERFORMAT_SOURCE, TRUE )); + } + else + { +#ifdef DBG_UTIL + DBG_ERROR2( "Diagram: Property %s has an invalid ID (%d)", + rProperty.pName, nWID ); +#endif + } + // Fall through. + + default : + rValue = maPropSet.getPropertyValue( &rProperty, rAttributes ); + if( *rProperty.pType != rValue.getValueType() ) + { + // since the sfx uint16 item now exports a sal_Int32, we may have to fix this here + if( ( *rProperty.pType == ::getCppuType((const sal_Int16*)0)) && rValue.getValueType() == ::getCppuType((const sal_Int32*)0) ) + { + sal_Int32 nValue; + rValue >>= nValue; + rValue <<= static_cast< sal_Int16 >( nValue ); + } + else + { + DBG_ERROR( "GetPropertyValue(): wrong Type!" ); + } + } + } + } +} +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/unoidl/sch_ChXDataPoint.cxx b/binfilter/bf_sch/source/ui/unoidl/sch_ChXDataPoint.cxx new file mode 100644 index 000000000000..25f6aab346d2 --- /dev/null +++ b/binfilter/bf_sch/source/ui/unoidl/sch_ChXDataPoint.cxx @@ -0,0 +1,874 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 "ChXDataPoint.hxx" +#include "mapprov.hxx" + +// header for SvxServiceInfoHelper +// header for class OGuard +// header for class Application +#include <vcl/svapp.hxx> +// header for SvxUnoTextRangeBase +// for OWN_ATTR_... +#include <bf_svx/unoshprp.hxx> +// for SID_ATTR_... +#include <bf_svx/svxids.hrc> +#include <bf_svx/unoshape.hxx> +#include <rtl/uuid.h> +#include <rtl/memory.h> + +#include "schattr.hxx" + +#ifndef _SVX_BRSHITEM_HXX +#define ITEMID_BRUSH SCHATTR_SYMBOL_BRUSH +#include <bf_svx/brshitem.hxx> +#endif +// header for SVX_SYMBOLTYPE_BRUSHITEM +#include <bf_svx/tabline.hxx> +#include <bf_svx/unoapi.hxx> + +#include <bf_svx/xflbstit.hxx> +#include <bf_svx/xflbmtit.hxx> + +#include <com/sun/star/chart/ChartDataCaption.hpp> + +// header for SvxChartDataDescrItem +#ifndef _SVX_CHRTITEM_HXX +#define ITEMID_CHARTDATADESCR SCHATTR_DATADESCR_DESCR +#endif + +#include "globfunc.hxx" // for GlobalGenerate3DAttrDefaultItem +#include "unonames.hxx" +namespace binfilter { + + +extern SchUnoPropertyMapProvider aSchMapProvider; + +using namespace ::com::sun::star; + +ChXDataPoint::ChXDataPoint( sal_Int32 _Col, sal_Int32 _Row, ChartModel* _Model ) : + maPropSet( aSchMapProvider.GetMap( _Model? CHMAP_DATAPOINT: CHMAP_NONE, _Model )), + mpModel( _Model ), + mnCol( _Col ), + mnRow( _Row ) +{} + +ChXDataPoint::~ChXDataPoint() +{} + + +// generate a uniqueId +const uno::Sequence< sal_Int8 > & ChXDataPoint::getUnoTunnelId() throw() +{ + static uno::Sequence< sal_Int8 > * pSeq = 0; + if( !pSeq ) + { + osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); + if( !pSeq ) + { + static uno::Sequence< sal_Int8 > aSeq( 16 ); + rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True ); + pSeq = &aSeq; + } + } + return *pSeq; +} + +// XTypeProvider +uno::Sequence< sal_Int8 > SAL_CALL ChXDataPoint::getImplementationId() + throw( uno::RuntimeException ) +{ + static uno::Sequence< sal_Int8 > aId; + if( aId.getLength() == 0 ) + { + aId.realloc( 16 ); + rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True ); + } + return aId; +} + +// XPropertySet +uno::Reference< beans::XPropertySetInfo > SAL_CALL ChXDataPoint::getPropertySetInfo() throw( uno::RuntimeException ) +{ + SolarMutexGuard aGuard; + return maPropSet.getPropertySetInfo(); +} + +void ChXDataPoint::AddDataPointAttr( SfxItemSet& rOutAttributes ) +{ + if( mpModel->IsPieChart()) + rOutAttributes.Put( mpModel->GetFullDataPointAttr( mnCol, 0 )); + else + rOutAttributes.Put( mpModel->GetDataPointAttr( mnCol, mnRow )); +} + +void SAL_CALL ChXDataPoint::setPropertyValue( const ::rtl::OUString& aPropertyName, const uno::Any& aValue ) + throw( beans::UnknownPropertyException, + beans::PropertyVetoException, + lang::IllegalArgumentException, + lang::WrappedTargetException, + uno::RuntimeException ) +{ + SolarMutexGuard aGuard; + sal_Bool bPropertyUnknown = sal_False; + + if( mpModel ) + { + const SfxItemPropertyMap* pMap = maPropSet.getPropertyMapEntry( aPropertyName ); + + if( pMap && pMap->nWID ) + { + if( pMap->nFlags & beans::PropertyAttribute::READONLY ) + throw beans::PropertyVetoException(); + + USHORT nWID = pMap->nWID; + SfxItemSet* pSet; + + if( nWID == SCHATTR_DATADESCR_DESCR || nWID == SCHATTR_DATADESCR_SHOW_SYM ) + { + pSet = new SfxItemSet( mpModel->GetItemPool(), + SCHATTR_DATADESCR_DESCR, SCHATTR_DATADESCR_DESCR, + SCHATTR_DATADESCR_SHOW_SYM, SCHATTR_DATADESCR_SHOW_SYM, 0 ); + } + else if( nWID == CHATTR_PIE_SEGMENT_OFFSET ) // member of ChartModel rather than property + { + sal_Int32 nVal; + aValue >>= nVal; + short nValToSet = (short)(abs( nVal ) % 101); // cast long->short is ok (range 0..100) + + mpModel->SetPieSegOfs( mnCol, nValToSet ); + SvxChartStyle& rStyle = mpModel->ChartStyle(); + if( rStyle == CHSTYLE_2D_PIE_SEGOF1 || + rStyle == CHSTYLE_2D_PIE_SEGOFALL ) + rStyle = CHSTYLE_2D_PIE; + + mpModel->BuildChart( FALSE ); + return; // RETURN + } + else if( nWID == OWN_ATTR_FILLBMP_MODE ) + { + SfxItemSet aSet( mpModel->GetItemPool(), + XATTR_FILLBMP_STRETCH, XATTR_FILLBMP_STRETCH, + XATTR_FILLBMP_TILE, XATTR_FILLBMP_TILE, 0 ); + + do + { + drawing::BitmapMode eMode; + if(!(aValue >>= eMode) ) + { + sal_Int32 nMode; + if(!(aValue >>= nMode)) + break; + + eMode = (drawing::BitmapMode)nMode; + } + aSet.Put( XFillBmpStretchItem( eMode == drawing::BitmapMode_STRETCH ) ); + aSet.Put( XFillBmpTileItem( eMode == drawing::BitmapMode_REPEAT ) ); + } + while(0); + mpModel->PutDataPointAttr( mnCol, mnRow, aSet ); + mpModel->BuildChart( FALSE ); + + return; + } + else if( nWID == SCHATTR_SYMBOL_BRUSH ) + pSet = new SfxItemSet( mpModel->GetItemPool(), nWID, nWID, + SCHATTR_STYLE_SYMBOL, SCHATTR_STYLE_SYMBOL, 0 ); + else + { + pSet = new SfxItemSet( mpModel->GetItemPool(), nWID, nWID ); + } + + pSet->Put( mpModel->GetFullDataPointAttr( mnCol, mnRow )); + + if( ! pSet->Count() ) + { + // get default from ItemPool + if( mpModel->GetItemPool().IsWhich( nWID )) + { + if( ! ( OWN_ATTR_VALUE_START <= nWID && nWID <= OWN_ATTR_VALUE_END )) + { + pSet->Put( mpModel->GetItemPool().GetDefaultItem( nWID )); + } + } + else + { +#ifdef DBG_UTIL + String aTmpString( aPropertyName ); + ByteString aProp( aTmpString, RTL_TEXTENCODING_ASCII_US ); + DBG_ERROR2( "Diagram: Property %s has an invalid ID (%d)", aProp.GetBuffer(), nWID ); +#endif + } + } + + if( pSet->Count() ) + { + sal_Int32 nVal; + switch( nWID ) + { + case SCHATTR_STAT_KIND_ERROR: + case SCHATTR_STAT_INDICATE: + case SCHATTR_STAT_REGRESSTYPE: + // property is enum, but item is INT32 + aValue >>= nVal; + pSet->Put( SfxInt32Item( nWID, nVal ) ); + break; + // BM: theese two SCHATTRs are merged into one INT32, so extract them from aValue + case SCHATTR_DATADESCR_DESCR: + case SCHATTR_DATADESCR_SHOW_SYM: + { + // symbol + aValue >>= nVal; + pSet->Put( SfxBoolItem( SCHATTR_DATADESCR_SHOW_SYM, + ((nVal & chart::ChartDataCaption::SYMBOL) != 0))); + + // display text, percent or both or value + SvxChartDataDescr eDescr = CHDESCR_NONE; + if( nVal & chart::ChartDataCaption::TEXT ) + { + if( nVal & chart::ChartDataCaption::PERCENT ) + eDescr = CHDESCR_TEXTANDPERCENT; + else if( (nVal & chart::ChartDataCaption::VALUE) ) + eDescr = CHDESCR_TEXTANDVALUE; + else + eDescr = CHDESCR_TEXT; + } + else if( (nVal & chart::ChartDataCaption::VALUE) ) + { + eDescr = CHDESCR_VALUE; + } + else + { + if( (nVal & chart::ChartDataCaption::PERCENT) ) + eDescr = CHDESCR_PERCENT; + } + + // chart::ChartDataCaption::FORMAT (missing) + + pSet->Put( SvxChartDataDescrItem( eDescr ) ); + } + break; + case SCHATTR_SYMBOL_BRUSH: + { + ::rtl::OUString aURL; + aValue >>= aURL; + BfGraphicObject aGraphObj = CreateGraphicObjectFromURL( aURL ); + SvxBrushItem aItem( SCHATTR_SYMBOL_BRUSH ); + aItem.SetGraphic( aGraphObj.GetGraphic() ); + pSet->Put( aItem ); + } + break; + + case XATTR_FILLBITMAP: + case XATTR_FILLGRADIENT: + case XATTR_FILLHATCH: + case XATTR_FILLFLOATTRANSPARENCE: + case XATTR_LINEEND: + case XATTR_LINESTART: + case XATTR_LINEDASH: + if( pMap->nMemberId == MID_NAME ) + { + ::rtl::OUString aStr; + if( aValue >>= aStr ) + SvxShape::SetFillAttribute( nWID, aStr, *pSet, mpModel ); + break; + } + // note: this fall-through is intended + + default: + // CL: convert special character properties + if( ! SvxUnoTextRangeBase::SetPropertyValueHelper( *pSet, pMap, aValue, *pSet )) + maPropSet.setPropertyValue( pMap, aValue, *pSet ); + break; + } + mpModel->PutDataPointAttr( mnCol, mnRow, *pSet ); + + mpModel->BuildChart( FALSE ); + } + else + { + bPropertyUnknown = sal_True; + } + if( pSet ) + delete pSet; + } + else + { + bPropertyUnknown = sal_True; + } + } + else + { + DBG_WARNING( "No Model" ); + } + + if( bPropertyUnknown ) + { + ::rtl::OUString aMessage( RTL_CONSTASCII_USTRINGPARAM( "Data Point: Unknown Property " )); + aMessage += aPropertyName; + beans::UnknownPropertyException aExcpt( aMessage, (::cppu::OWeakObject*)this ); + throw aExcpt; + } +} + +uno::Any SAL_CALL ChXDataPoint::getPropertyValue( const ::rtl::OUString& PropertyName ) + throw( beans::UnknownPropertyException, + lang::WrappedTargetException, + uno::RuntimeException ) +{ + SolarMutexGuard aGuard; + + uno::Any aAny; + + if( mpModel ) + { + const SfxItemPropertyMap* pMap = maPropSet.getPropertyMapEntry( PropertyName ); + + if( pMap && pMap->nWID ) + { + SfxItemSet* pSet; + USHORT nWID = pMap->nWID; + + if( nWID == SCHATTR_STYLE_SHAPE && + ! mpModel->IsReal3D()) + return aAny; + + if( nWID == SCHATTR_DATADESCR_DESCR || nWID == SCHATTR_DATADESCR_SHOW_SYM ) + { + pSet = new SfxItemSet( mpModel->GetItemPool(), + SCHATTR_DATADESCR_DESCR, SCHATTR_DATADESCR_DESCR, + SCHATTR_DATADESCR_SHOW_SYM, SCHATTR_DATADESCR_SHOW_SYM, 0 ); + } + else if( nWID == CHATTR_PIE_SEGMENT_OFFSET ) + { + sal_Int32 nVal = mpModel->PieSegOfs( mnCol ); + aAny <<= nVal; + return aAny; // RETURN + } + else if( nWID == OWN_ATTR_FILLBMP_MODE ) + { + SfxItemSet aSet( mpModel->GetItemPool(), + XATTR_FILLBMP_STRETCH, XATTR_FILLBMP_STRETCH, + XATTR_FILLBMP_TILE, XATTR_FILLBMP_TILE, 0 ); + + aSet.Put( mpModel->GetFullDataPointAttr( mnCol, mnRow )); + + XFillBmpStretchItem* pStretchItem = (XFillBmpStretchItem*)&aSet.Get( XATTR_FILLBMP_STRETCH ); + XFillBmpTileItem* pTileItem = (XFillBmpTileItem*)&aSet.Get( XATTR_FILLBMP_TILE ); + + if( pTileItem && pTileItem->GetValue() ) + { + aAny <<= drawing::BitmapMode_REPEAT; + } + else if( pStretchItem && pStretchItem->GetValue() ) + { + aAny <<= drawing::BitmapMode_STRETCH; + } + else + { + aAny <<= drawing::BitmapMode_NO_REPEAT; + } + return aAny; + } + else + { + pSet = new SfxItemSet( mpModel->GetItemPool(), nWID, nWID ); + } + pSet->Put( mpModel->GetFullDataPointAttr( mnCol, mnRow )); + + if( ! pSet->Count() ) + { + // get default from pool + if( mpModel->GetItemPool().IsWhich( nWID )) + { + if( OWN_ATTR_VALUE_START > nWID || nWID > OWN_ATTR_VALUE_END ) + { + pSet->Put( mpModel->GetItemPool().GetDefaultItem( nWID ) ); + } + } + else + { +#ifdef DBG_UTIL + String aTmpString( PropertyName ); + ByteString aProp( aTmpString, RTL_TEXTENCODING_ASCII_US ); + DBG_ERROR2( "Diagram: Property %s has an invalid ID (%d)", aProp.GetBuffer(), nWID ); +#endif + } + } + + if( pSet->Count() ) + { + // get value from ItemSet + + // theese two SCHATTRs have to be merged into one INT32 in aAny + if( nWID == SCHATTR_DATADESCR_DESCR || nWID == SCHATTR_DATADESCR_SHOW_SYM ) + { + BOOL bShowSymbol = ((const SfxBoolItem&) + (pSet->Get(SCHATTR_DATADESCR_SHOW_SYM))).GetValue(); + SvxChartDataDescr eDescr = ((const SvxChartDataDescrItem&) + (pSet->Get(SCHATTR_DATADESCR_DESCR))).GetValue(); + + sal_Int32 nVal = 0; + switch( eDescr ) + { + case CHDESCR_NONE: + nVal = chart::ChartDataCaption::NONE; + break; + case CHDESCR_VALUE: + nVal = chart::ChartDataCaption::VALUE; + break; + case CHDESCR_PERCENT: + nVal = chart::ChartDataCaption::PERCENT; + break; + case CHDESCR_TEXT: + nVal = chart::ChartDataCaption::TEXT; + break; + case CHDESCR_TEXTANDPERCENT: + nVal = chart::ChartDataCaption::PERCENT | chart::ChartDataCaption::TEXT; + break; + case CHDESCR_TEXTANDVALUE: + nVal = chart::ChartDataCaption::VALUE | chart::ChartDataCaption::TEXT; + // chart::ChartDataCaption::FORMAT (missing) + } + if( bShowSymbol ) nVal |= chart::ChartDataCaption::SYMBOL; + + aAny <<= nVal; + } + else if( nWID == SCHATTR_SYMBOL_BRUSH ) + { + ::rtl::OUString aURL; + const BfGraphicObject* pGraphObj = + ((const SvxBrushItem &)(pSet->Get( nWID ))).GetGraphicObject(); + if( pGraphObj ) + { + aURL = ::rtl::OUString::createFromAscii( UNO_NAME_GRAPHOBJ_URLPREFIX ); + aURL += ::rtl::OUString::createFromAscii( pGraphObj->GetUniqueID().GetBuffer()); + } + aAny <<= aURL; + } + else + { + aAny = maPropSet.getPropertyValue( pMap, *pSet ); + if( *pMap->pType != aAny.getValueType() ) + { + // since the sfx uint16 item now exports a sal_Int32, we may have to fix this here + if( ( *pMap->pType == ::getCppuType((const sal_Int16*)0)) && aAny.getValueType() == ::getCppuType((const sal_Int32*)0) ) + { + sal_Int32 nValue; + aAny >>= nValue; + aAny <<= static_cast< sal_Int16 >( nValue ); + } + else + { + DBG_ERROR( "getPropertyValue(): wrong Type!" ); + } + } + } + } + else + { + throw beans::UnknownPropertyException(); + } + if( pSet ) + delete pSet; + } + else + { + throw beans::UnknownPropertyException(); + } + } + + return aAny; +} + +void SAL_CALL ChXDataPoint::addPropertyChangeListener( const ::rtl::OUString& aPropertyName, + const uno::Reference< beans::XPropertyChangeListener >& xListener ) + throw( beans::UnknownPropertyException, + lang::WrappedTargetException, + uno::RuntimeException ) +{} + +void SAL_CALL ChXDataPoint::removePropertyChangeListener( const ::rtl::OUString& aPropertyName, + const uno::Reference< beans::XPropertyChangeListener >& aListener ) + throw( beans::UnknownPropertyException, + lang::WrappedTargetException, + uno::RuntimeException ) +{} + +void SAL_CALL ChXDataPoint::addVetoableChangeListener( const ::rtl::OUString& PropertyName, + const uno::Reference< beans::XVetoableChangeListener >& aListener ) + throw( beans::UnknownPropertyException, + lang::WrappedTargetException, + uno::RuntimeException ) +{} + +void SAL_CALL ChXDataPoint::removeVetoableChangeListener( const ::rtl::OUString& PropertyName, + const uno::Reference< beans::XVetoableChangeListener >& aListener ) + throw( beans::UnknownPropertyException, + lang::WrappedTargetException, + uno::RuntimeException ) +{} + +// XPropertyState +beans::PropertyState SAL_CALL ChXDataPoint::getPropertyState( const ::rtl::OUString& PropertyName ) + throw( beans::UnknownPropertyException, uno::RuntimeException ) +{ + SolarMutexGuard aGuard; + + const SfxItemPropertyMap* pMap = maPropSet.getPropertyMapEntry( PropertyName ); + + if( mpModel && + pMap && pMap->nWID ) + { + if( pMap->nWID == CHATTR_PIE_SEGMENT_OFFSET ) + { + sal_Int32 nOffset; + uno::Any aAny = getPropertyValue( PropertyName ); + aAny >>= nOffset; + if( nOffset ) + return beans::PropertyState_DIRECT_VALUE; + else + return beans::PropertyState_DEFAULT_VALUE; + } + else if( pMap->nWID == SCHATTR_DATADESCR_DESCR ) + { + SfxItemSet aSet( mpModel->GetItemPool(), + SCHATTR_DATADESCR_DESCR, SCHATTR_DATADESCR_DESCR, + SCHATTR_DATADESCR_SHOW_SYM, SCHATTR_DATADESCR_SHOW_SYM, 0 ); + AddDataPointAttr( aSet ); + + SfxItemState eState1 = aSet.GetItemState( SCHATTR_DATADESCR_DESCR ); + SfxItemState eState2 = aSet.GetItemState( SCHATTR_DATADESCR_SHOW_SYM ); + if( eState1 == SFX_ITEM_DEFAULT && + eState2 == SFX_ITEM_DEFAULT ) + return beans::PropertyState_DEFAULT_VALUE; + else if( eState1 < SFX_ITEM_DEFAULT && + eState2 < SFX_ITEM_DEFAULT ) + return beans::PropertyState_AMBIGUOUS_VALUE; + else + return beans::PropertyState_DIRECT_VALUE; + } + else if( pMap->nWID == OWN_ATTR_FILLBMP_MODE ) + { + SfxItemSet aSet( mpModel->GetItemPool(), + XATTR_FILLBMP_STRETCH, XATTR_FILLBMP_STRETCH, + XATTR_FILLBMP_TILE, XATTR_FILLBMP_TILE, 0 ); + AddDataPointAttr( aSet ); + + if( aSet.GetItemState( XATTR_FILLBMP_STRETCH, false ) == SFX_ITEM_SET || + aSet.GetItemState( XATTR_FILLBMP_TILE, false ) == SFX_ITEM_SET ) + return beans::PropertyState_DIRECT_VALUE; + else + return beans::PropertyState_DEFAULT_VALUE; + } + else + { + SfxItemSet aSet( mpModel->GetItemPool(), pMap->nWID, pMap->nWID ); + AddDataPointAttr( aSet ); + + SfxItemState eState = aSet.GetItemState( pMap->nWID ); + if( eState == SFX_ITEM_DEFAULT ) + return beans::PropertyState_DEFAULT_VALUE; + else if( eState < SFX_ITEM_DEFAULT ) + return beans::PropertyState_AMBIGUOUS_VALUE; + else + return beans::PropertyState_DIRECT_VALUE; + } + } + + return beans::PropertyState_DIRECT_VALUE; +} + +/* +uno::Sequence< beans::PropertyState > SAL_CALL ChXDataPoint::getPropertyStates( + const uno::Sequence< ::rtl::OUString >& aPropertyName ) + throw( beans::UnknownPropertyException, + uno::RuntimeException ) +{ + SolarMutexGuard aGuard; + + const sal_Int32 nCount = aPropertyName.getLength(); + const ::rtl::OUString* pNames = aPropertyName.getConstArray(); + + uno::Sequence< beans::PropertyState > aRet( nCount ); + beans::PropertyState* pState = aRet.getArray(); + + for( sal_Int32 nIdx = 0; nIdx < nCount; nIdx++ ) + pState[ nIdx ] = getPropertyState( pNames[ nIdx ] ); + + return aRet; +} +*/ + +uno::Sequence< beans::PropertyState > SAL_CALL + ChXDataPoint::getPropertyStates ( + const uno::Sequence< ::rtl::OUString > & aPropertyName) + throw (beans::UnknownPropertyException, + uno::RuntimeException) +{ + SolarMutexGuard aGuard; + + const sal_Int32 nCount = aPropertyName.getLength(); + const ::rtl::OUString* pNames = aPropertyName.getConstArray(); + + uno::Sequence<beans::PropertyState> aResult (nCount); + beans::PropertyState * pStateArray = aResult.getArray(); + + // for pie charts data point attributes are stored in data rows + // which are returned by GetDataPointAttr() if no explicit + // arguments exist + if (mpModel->IsDataPointAttrSet (mnCol, mnRow) || + (mpModel->IsPieChart())) + { + uno::Any aAny; + SfxAllItemSet aSet( mpModel->GetItemPool() ); + SfxItemState eState1,eState2; + const SfxItemPropertyMap * pMap; + + AddDataPointAttr( aSet ); + + for (sal_Int32 nIndex=0; nIndex<nCount; nIndex++) + { + pMap = maPropSet.getPropertyMapEntry (pNames[nIndex]); + + if (mpModel && pMap && pMap->nWID) + { + switch (pMap->nWID) + { + case CHATTR_PIE_SEGMENT_OFFSET: + if( mpModel->IsPieChart() ) + { + pStateArray[nIndex] = (mpModel->PieSegOfs (mnCol) != 0) + ? beans::PropertyState_DIRECT_VALUE + : beans::PropertyState_DEFAULT_VALUE; + } + else + { + pStateArray[nIndex] = beans::PropertyState_DEFAULT_VALUE; + } + break; + + case SCHATTR_DATADESCR_DESCR: + eState1 = aSet.GetItemState (SCHATTR_DATADESCR_DESCR); + eState2 = aSet.GetItemState (SCHATTR_DATADESCR_SHOW_SYM); + if (eState1 == SFX_ITEM_DEFAULT && eState2 == SFX_ITEM_DEFAULT) + pStateArray[nIndex] = beans::PropertyState_DEFAULT_VALUE; + else if (eState1 < SFX_ITEM_DEFAULT && eState2 < SFX_ITEM_DEFAULT) + pStateArray[nIndex] = beans::PropertyState_AMBIGUOUS_VALUE; + else + pStateArray[nIndex] = beans::PropertyState_DIRECT_VALUE; + break; + + case OWN_ATTR_FILLBMP_MODE: + eState1 = aSet.GetItemState( XATTR_FILLBMP_STRETCH, false ); + eState2 = aSet.GetItemState( XATTR_FILLBMP_TILE, false ); + if (eState1 == SFX_ITEM_SET || eState2 == SFX_ITEM_SET) + pStateArray[nIndex] = beans::PropertyState_DIRECT_VALUE; + else + pStateArray[nIndex] = beans::PropertyState_DEFAULT_VALUE; + break; + + default: + switch (aSet.GetItemState (pMap->nWID)) + { + case SFX_ITEM_DEFAULT: // 0x0020 + pStateArray[nIndex] = beans::PropertyState_DEFAULT_VALUE; + break; + + case SFX_ITEM_UNKNOWN: // 0x0000 + case SFX_ITEM_DISABLED: // 0x0001 + case SFX_ITEM_READONLY: // 0x0002 + case SFX_ITEM_DONTCARE: // 0x0010 + pStateArray[nIndex] = beans::PropertyState_AMBIGUOUS_VALUE; + break; + + default: + // SFX_ITEM_SET 0x0030 + pStateArray[nIndex] = beans::PropertyState_DIRECT_VALUE; + } + } + } + else + pStateArray[nIndex] = beans::PropertyState_DEFAULT_VALUE; +// pStateArray[nIndex] = beans::PropertyState_DIRECT_VALUE; + } + } + else + for (sal_Int32 nIndex=0; nIndex<nCount; nIndex++) + pStateArray[nIndex] = beans::PropertyState_DEFAULT_VALUE; + + return aResult; +} + + + + +void SAL_CALL ChXDataPoint::setPropertyToDefault( const ::rtl::OUString& PropertyName ) + throw( beans::UnknownPropertyException, + uno::RuntimeException ) +{ + SolarMutexGuard aGuard; + + const SfxItemPropertyMap* pMap = maPropSet.getPropertyMapEntry( PropertyName ); + + if( mpModel && pMap && pMap->nWID ) + { + if( pMap->nWID == CHATTR_PIE_SEGMENT_OFFSET ) + { + mpModel->SetPieSegOfs( mnCol, 0 ); + } + else if( pMap->nWID == SCHATTR_DATADESCR_DESCR ) + { + SfxItemSet aSet( mpModel->GetItemPool(), + SCHATTR_DATADESCR_DESCR, SCHATTR_DATADESCR_DESCR, + SCHATTR_DATADESCR_SHOW_SYM, SCHATTR_DATADESCR_SHOW_SYM, 0 ); + + aSet.ClearItem( SCHATTR_DATADESCR_DESCR ); + aSet.ClearItem( SCHATTR_DATADESCR_SHOW_SYM ); + mpModel->PutDataPointAttr( mnCol, mnRow, aSet ); + } + else + { + SfxItemSet aSet( mpModel->GetItemPool(), pMap->nWID, pMap->nWID ); + + aSet.ClearItem( pMap->nWID ); + mpModel->PutDataPointAttr( mnCol, mnRow, aSet ); + } + } +} + +uno::Any SAL_CALL ChXDataPoint::getPropertyDefault( const ::rtl::OUString& aPropertyName ) + throw( beans::UnknownPropertyException, + lang::WrappedTargetException, + uno::RuntimeException ) +{ + uno::Any aAny; + const SfxItemPropertyMap* pMap = maPropSet.getPropertyMapEntry( aPropertyName ); + + if( mpModel && ! mpModel->GetItemPool().IsWhich( pMap->nWID )) + throw beans::UnknownPropertyException(); + + if( mpModel && pMap && pMap->nWID ) + { + if( pMap->nWID == CHATTR_PIE_SEGMENT_OFFSET ) + { + aAny <<= (sal_Int32)0; + } + else if( pMap->nWID == SCHATTR_DATADESCR_DESCR ) + { + SfxItemSet aSet( mpModel->GetItemPool(), + SCHATTR_DATADESCR_DESCR, SCHATTR_DATADESCR_DESCR, + SCHATTR_DATADESCR_SHOW_SYM, SCHATTR_DATADESCR_SHOW_SYM, 0 ); + + aSet.Put( mpModel->GetItemPool().GetDefaultItem( SCHATTR_DATADESCR_DESCR )); + aSet.Put( mpModel->GetItemPool().GetDefaultItem( SCHATTR_DATADESCR_SHOW_SYM )); + aAny = maPropSet.getPropertyValue( pMap, aSet ); + } + else + { + SfxItemSet aSet( mpModel->GetItemPool(), pMap->nWID, pMap->nWID ); + aSet.Put( mpModel->GetItemPool().GetDefaultItem( pMap->nWID )); + aAny = maPropSet.getPropertyValue( pMap, aSet ); + } + + if( *pMap->pType != aAny.getValueType() ) + { + // since the sfx uint16 item now exports a sal_Int32, we may have to fix this here + if( ( *pMap->pType == ::getCppuType((const sal_Int16*)0)) && aAny.getValueType() == ::getCppuType((const sal_Int32*)0) ) + { + sal_Int32 nValue; + aAny >>= nValue; + aAny <<= static_cast< sal_Int16 >( nValue ); + } + else + { + DBG_ERROR( "getPropertyDefault(): wrong Type!" ); + } + } + } + + return aAny; +} + + +// XShapeDescriptor ( ::XShape ::XDiagram ) +::rtl::OUString SAL_CALL ChXDataPoint::getShapeType() throw( uno::RuntimeException ) +{ + return SCH_ASCII_TO_OU( "com.sun.star.chart.ChartDataPoint" ); +} + + +// XServiceInfo +::rtl::OUString SAL_CALL ChXDataPoint::getImplementationName() throw( uno::RuntimeException ) +{ + return SCH_ASCII_TO_OU( "ChXDataPoint" ); +} + +sal_Bool SAL_CALL ChXDataPoint::supportsService( const ::rtl::OUString& ServiceName ) throw( uno::RuntimeException ) +{ + return SvxServiceInfoHelper::supportsService( ServiceName, getSupportedServiceNames() ); +} + +uno::Sequence< ::rtl::OUString > SAL_CALL ChXDataPoint::getSupportedServiceNames() throw( uno::RuntimeException ) +{ + uno::Sequence< ::rtl::OUString > aSeq; + SvxServiceInfoHelper::addToSequence( + aSeq, 5, + "com.sun.star.chart.ChartDataPointProperties", + "com.sun.star.drawing.LineProperties", + "com.sun.star.drawing.FillProperties", + "com.sun.star.style.CharacterProperties", + "com.sun.star.xml.UserDefinedAttributeSupplier" ); + + if( mpModel ) + { + long nType = mpModel->GetBaseType(); + if( mpModel->Is3DChart() && (nType == CHTYPE_BAR || nType == CHTYPE_COLUMN) ) + SvxServiceInfoHelper::addToSequence( aSeq, 1, "com.sun.star.chart.Chart3DBarProperties" ); + else if( ! mpModel->Is3DChart() && nType == CHTYPE_CIRCLE ) + SvxServiceInfoHelper::addToSequence( aSeq, 1, "com.sun.star.chart.ChartPieSegmentProperties" ); + } + + return aSeq; +} + +// XUnoTunnel +sal_Int64 SAL_CALL ChXDataPoint::getSomething( const uno::Sequence< sal_Int8 >& aIdentifier ) + throw( uno::RuntimeException ) +{ + if( aIdentifier.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), + aIdentifier.getConstArray(), 16 ) ) + { + return (sal_Int64)this; + } + return 0; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/unoidl/sch_ChXDataRow.cxx b/binfilter/bf_sch/source/ui/unoidl/sch_ChXDataRow.cxx new file mode 100644 index 000000000000..42a1632edf86 --- /dev/null +++ b/binfilter/bf_sch/source/ui/unoidl/sch_ChXDataRow.cxx @@ -0,0 +1,809 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 "ChXDataRow.hxx" +#include "mapprov.hxx" +#include "ChartLine.hxx" + +// header for SvxServiceInfoHelper +// header for class OGuard +// header for class Application +#include <vcl/svapp.hxx> +// header for SvxUnoTextRangeBase +// for OWN_ATTR_... +#include <bf_svx/unoshprp.hxx> +// for SID_ATTR_... +#include <bf_svx/svxids.hrc> +#include <bf_svx/unoshape.hxx> +#include <rtl/uuid.h> +#include <rtl/memory.h> + +#include "schattr.hxx" + +#ifndef _SVX_BRSHITEM_HXX +#define ITEMID_BRUSH SCHATTR_SYMBOL_BRUSH +#include <bf_svx/brshitem.hxx> +#endif +// header for SVX_SYMBOLTYPE_BRUSHITEM +#include <bf_svx/tabline.hxx> +#include <bf_svx/unoapi.hxx> + +#include <com/sun/star/chart/ChartDataCaption.hpp> +#include <com/sun/star/chart/ChartAxisAssign.hpp> +#include <comphelper/extract.hxx> + +#include <bf_svx/xflbstit.hxx> +#include <bf_svx/xflbmtit.hxx> + +// header for SvxChartDataDescrItem +#ifndef _SVX_CHRTITEM_HXX +#define ITEMID_CHARTDATADESCR SCHATTR_DATADESCR_DESCR +#endif + +#include "globfunc.hxx" // for GlobalGenerate3DAttrDefaultItem +#include "unonames.hxx" +namespace binfilter { + +extern SchUnoPropertyMapProvider aSchMapProvider; + +using namespace ::com::sun::star; + +ChXDataRow::ChXDataRow( sal_Int32 _Row, ChartModel* _Model ) : + maPropSet( aSchMapProvider.GetMap( _Model? CHMAP_DATAROW: CHMAP_NONE, _Model )), + mpModel( _Model ), + mnRow( _Row ) +{} + +ChXDataRow::~ChXDataRow() +{} + +// generate a uniqueId +const uno::Sequence< sal_Int8 > & ChXDataRow::getUnoTunnelId() throw() +{ + static uno::Sequence< sal_Int8 > * pSeq = 0; + if( !pSeq ) + { + osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); + if( !pSeq ) + { + static uno::Sequence< sal_Int8 > aSeq( 16 ); + rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True ); + pSeq = &aSeq; + } + } + return *pSeq; +} + +uno::Reference< beans::XPropertySet > ChXDataRow::getStatisticsProperties( sal_Int32 nId ) const +{ + SolarMutexGuard aGuard; + + if( mpModel ) + { + beans::XPropertySet* pObj = new ChartLine( mpModel, nId, mnRow ); + uno::Reference< beans::XPropertySet > xObj( pObj ); + if( xObj.is() ) + return xObj; + } + else + { + DBG_ERROR( "No Model" ); + } + + return uno::Reference< beans::XPropertySet >(); +} + + +// XPropertySet +uno::Reference< beans::XPropertySetInfo > SAL_CALL ChXDataRow::getPropertySetInfo() throw( uno::RuntimeException ) +{ + SolarMutexGuard aGuard; + return maPropSet.getPropertySetInfo(); +} + +void SAL_CALL ChXDataRow::setPropertyValue( const ::rtl::OUString& aPropertyName, const uno::Any& aValue ) + throw( beans::UnknownPropertyException, + beans::PropertyVetoException, + lang::IllegalArgumentException, + lang::WrappedTargetException, + uno::RuntimeException ) +{ + SolarMutexGuard aGuard; + sal_Bool bPropertyUnknown = sal_False; + + if( mpModel ) + { + const SfxItemPropertyMap* pMap = maPropSet.getPropertyMapEntry( aPropertyName ); + + if( pMap && pMap->nWID ) + { + if( pMap->nFlags & beans::PropertyAttribute::READONLY ) + throw beans::PropertyVetoException(); + + USHORT nWID = pMap->nWID; + SfxItemSet* pSet; + + if( nWID == SCHATTR_DATADESCR_DESCR || nWID == SCHATTR_DATADESCR_SHOW_SYM ) + { + pSet = new SfxItemSet( mpModel->GetItemPool(), + SCHATTR_DATADESCR_DESCR, SCHATTR_DATADESCR_DESCR, + SCHATTR_DATADESCR_SHOW_SYM, SCHATTR_DATADESCR_SHOW_SYM, 0 ); + } + else if( nWID == CHATTR_PIE_SEGMENT_OFFSET ) // member of ChartModel rather than property + { + // (not fully supported yet. problem: getPropertyValue) + sal_Int32 nVal; + aValue >>= nVal; + short nValToSet = (short)(abs( nVal ) % 101); // cast long->short is ok (range 0..100) + + if( mnRow == 0 ) // must be first row + { + long nCount = mpModel->GetColCount(), i; + for( i=0; i<nCount; i++ ) + mpModel->SetPieSegOfs( i, nValToSet ); + } + SvxChartStyle& rStyle = mpModel->ChartStyle(); + if( rStyle == CHSTYLE_2D_PIE_SEGOF1 || + rStyle == CHSTYLE_2D_PIE_SEGOFALL ) + rStyle = CHSTYLE_2D_PIE; + + mpModel->BuildChart( FALSE ); + return; // RETURN + } + else if( nWID == OWN_ATTR_FILLBMP_MODE ) + { + SfxItemSet aSet( mpModel->GetItemPool(), + XATTR_FILLBMP_STRETCH, XATTR_FILLBMP_STRETCH, + XATTR_FILLBMP_TILE, XATTR_FILLBMP_TILE, 0 ); + + do + { + drawing::BitmapMode eMode; + if(!(aValue >>= eMode) ) + { + sal_Int32 nMode; + if(!(aValue >>= nMode)) + break; + + eMode = (drawing::BitmapMode)nMode; + } + aSet.Put( XFillBmpStretchItem( eMode == drawing::BitmapMode_STRETCH ) ); + aSet.Put( XFillBmpTileItem( eMode == drawing::BitmapMode_REPEAT ) ); + } + while(0); + mpModel->PutDataRowAttr( mnRow, aSet ); + mpModel->BuildChart( FALSE ); + + return; + } + else if( nWID == SCHATTR_SYMBOL_BRUSH ) + pSet = new SfxItemSet( mpModel->GetItemPool(), nWID, nWID, + SCHATTR_STYLE_SYMBOL, SCHATTR_STYLE_SYMBOL, 0 ); + else + { + pSet = new SfxItemSet( mpModel->GetItemPool(), nWID, nWID ); + } + DBG_ASSERT( pSet, "Itemset is invalid!" ); + + pSet->Put( mpModel->GetDataRowAttr( mnRow )); + + if( ! pSet->Count() ) + { + // get default from ItemPool + if( mpModel->GetItemPool().IsWhich( nWID )) + { + if( ! ( OWN_ATTR_VALUE_START <= nWID && nWID <= OWN_ATTR_VALUE_END )) + { + pSet->Put( mpModel->GetItemPool().GetDefaultItem( nWID )); + } + } + else + { +#ifdef DBG_UTIL + String aTmpString( aPropertyName ); + ByteString aProp( aTmpString, RTL_TEXTENCODING_ASCII_US ); + DBG_ERROR2( "Diagram: Property %s has an invalid ID (%d)", aProp.GetBuffer(), nWID ); +#endif + } + } + + if( pSet->Count() ) + { + sal_Int32 nVal; + switch( nWID ) + { + case SCHATTR_STAT_KIND_ERROR: + case SCHATTR_STAT_INDICATE: + case SCHATTR_STAT_REGRESSTYPE: + // property is enum, but item is INT32 + cppu::enum2int( nVal, aValue ); + pSet->Put( SfxInt32Item( nWID, nVal ) ); + break; + // BM: theese two SCHATTRs are merged into one INT32, so extract them from aValue + case SCHATTR_DATADESCR_DESCR: + case SCHATTR_DATADESCR_SHOW_SYM: + { + // symbol + aValue >>= nVal; + pSet->Put( SfxBoolItem( SCHATTR_DATADESCR_SHOW_SYM, + ((nVal & chart::ChartDataCaption::SYMBOL) != 0 ))); + + // display text, percent or both or value + SvxChartDataDescr eDescr = CHDESCR_NONE; + if( nVal & chart::ChartDataCaption::TEXT ) + { + if( nVal & chart::ChartDataCaption::PERCENT ) + eDescr = CHDESCR_TEXTANDPERCENT; + else if( (nVal & chart::ChartDataCaption::VALUE) ) + eDescr = CHDESCR_TEXTANDVALUE; + else + eDescr = CHDESCR_TEXT; + } + else if( (nVal & chart::ChartDataCaption::VALUE) ) + { + eDescr = CHDESCR_VALUE; + } + else + { + if( (nVal & chart::ChartDataCaption::PERCENT) ) + eDescr = CHDESCR_PERCENT; + } + + // chart::ChartDataCaption::FORMAT (missing) + + pSet->Put( SvxChartDataDescrItem( eDescr ) ); + } + break; + case SCHATTR_SYMBOL_BRUSH: + { + ::rtl::OUString aURL; + aValue >>= aURL; + BfGraphicObject aGraphObj = CreateGraphicObjectFromURL( aURL ); + SvxBrushItem aItem( SCHATTR_SYMBOL_BRUSH ); + aItem.SetGraphic( aGraphObj.GetGraphic() ); + pSet->Put( aItem ); + } + break; + + case XATTR_FILLBITMAP: + case XATTR_FILLGRADIENT: + case XATTR_FILLHATCH: + case XATTR_FILLFLOATTRANSPARENCE: + case XATTR_LINEEND: + case XATTR_LINESTART: + case XATTR_LINEDASH: + if( pMap->nMemberId == MID_NAME ) + { + ::rtl::OUString aStr; + if( aValue >>= aStr ) + SvxShape::SetFillAttribute( nWID, aStr, *pSet, mpModel ); + break; + } + maPropSet.setPropertyValue( pMap, aValue, *pSet ); + break; + + case SCHATTR_AXIS: + aValue >>= nVal; + if( nVal != chart::ChartAxisAssign::PRIMARY_Y && + nVal != chart::ChartAxisAssign::SECONDARY_Y ) + { + throw lang::IllegalArgumentException(); + } + maPropSet.setPropertyValue( pMap, aValue, *pSet ); + break; + + default: + // CL: convert special character properties + if( ! SvxUnoTextRangeBase::SetPropertyValueHelper( *pSet, pMap, aValue, *pSet )) + maPropSet.setPropertyValue( pMap, aValue, *pSet ); + break; + } + + mpModel->PutDataRowAttr( mnRow, *pSet ); + + if( SCHATTR_DATADESCR_START <= nWID && nWID <= SCHATTR_DATADESCR_END ) + { + SfxItemSet rAttr( mpModel->GetDataRowAttr( mnRow )); + SvxChartDataDescr eNewDataDescr; + BOOL bNewShowSym; + const SfxPoolItem *pPoolItem; + + if( rAttr.GetItemState( SCHATTR_DATADESCR_DESCR, TRUE, &pPoolItem ) == SFX_ITEM_SET ) + eNewDataDescr = ((const SvxChartDataDescrItem*)pPoolItem)->GetValue(); + + if( rAttr.GetItemState( SCHATTR_DATADESCR_SHOW_SYM, TRUE, &pPoolItem ) == SFX_ITEM_SET ) + bNewShowSym = ((const SfxBoolItem*)pPoolItem)->GetValue(); + + mpModel->ChangeDataDescr( eNewDataDescr, bNewShowSym, mnRow, FALSE ); + } + + mpModel->BuildChart( FALSE ); + } + else + { + bPropertyUnknown = sal_True; + } + if( pSet ) + delete pSet; + } + else + { + bPropertyUnknown = sal_True; + } + } + else + { + DBG_WARNING( "No Model" ); + } + + if( bPropertyUnknown ) + { + ::rtl::OUString aMessage( RTL_CONSTASCII_USTRINGPARAM( "Data Row: Unknown Property " )); + aMessage += aPropertyName; + beans::UnknownPropertyException aExcpt( aMessage, (::cppu::OWeakObject*)this ); + throw aExcpt; + } +} + +uno::Any SAL_CALL ChXDataRow::getPropertyValue( const ::rtl::OUString& PropertyName ) + throw( beans::UnknownPropertyException, + lang::WrappedTargetException, + uno::RuntimeException ) +{ + SolarMutexGuard aGuard; + + uno::Any aAny; + + if( mpModel ) + { + const SfxItemPropertyMap* pMap = maPropSet.getPropertyMapEntry( PropertyName ); + + if( pMap && pMap->nWID ) + { + SfxItemSet* pSet; + USHORT nWID = pMap->nWID; + + if( nWID == SCHATTR_STYLE_SHAPE && + ! mpModel->IsReal3D()) + return aAny; + + if( nWID == SCHATTR_DATADESCR_DESCR || nWID == SCHATTR_DATADESCR_SHOW_SYM ) + { + pSet = new SfxItemSet( mpModel->GetItemPool(), + SCHATTR_DATADESCR_DESCR, SCHATTR_DATADESCR_DESCR, + SCHATTR_DATADESCR_SHOW_SYM, SCHATTR_DATADESCR_SHOW_SYM, 0 ); + } + else if( nWID == OWN_ATTR_FILLBMP_MODE ) + { + SfxItemSet aSet( mpModel->GetItemPool(), + XATTR_FILLBMP_STRETCH, XATTR_FILLBMP_STRETCH, + XATTR_FILLBMP_TILE, XATTR_FILLBMP_TILE, 0 ); + + aSet.Put( mpModel->GetDataRowAttr( mnRow )); + + XFillBmpStretchItem* pStretchItem = (XFillBmpStretchItem*)&aSet.Get( XATTR_FILLBMP_STRETCH ); + XFillBmpTileItem* pTileItem = (XFillBmpTileItem*)&aSet.Get( XATTR_FILLBMP_TILE ); + + if( pTileItem && pTileItem->GetValue() ) + { + aAny <<= drawing::BitmapMode_REPEAT; + } + else if( pStretchItem && pStretchItem->GetValue() ) + { + aAny <<= drawing::BitmapMode_STRETCH; + } + else + { + aAny <<= drawing::BitmapMode_NO_REPEAT; + } + return aAny; + } + else + { + pSet = new SfxItemSet( mpModel->GetItemPool(), nWID, nWID ); + } + + switch( nWID ) + { + case CHATTR_REGRESSION_PROPS: + { + uno::Reference< beans::XPropertySet > xProps = getStatisticsProperties( CHOBJID_DIAGRAM_REGRESSION ); + aAny <<= xProps; + return aAny; // RETURN + } + + case CHATTR_ERROR_PROPS: + { + uno::Reference< beans::XPropertySet > xProps = getStatisticsProperties( CHOBJID_DIAGRAM_ERROR ); + aAny <<= xProps; + return aAny; // RETURN + } + + case CHATTR_AVERAGE_PROPS: + { + uno::Reference< beans::XPropertySet > xProps = getStatisticsProperties( CHOBJID_DIAGRAM_AVERAGEVALUE ); + aAny <<= xProps; + return aAny; // RETURN + } + + default: + pSet->Put( mpModel->GetDataRowAttr( mnRow )); + } + + if( ! pSet->Count() ) + { + // Default aus ItemPool holen + if( mpModel->GetItemPool().IsWhich( nWID )) + { + if( OWN_ATTR_VALUE_START > nWID || nWID > OWN_ATTR_VALUE_END ) + { + pSet->Put( mpModel->GetItemPool().GetDefaultItem( nWID ) ); + } + } + else + { +#ifdef DBG_UTIL + String aTmpString( PropertyName ); + ByteString aProp( aTmpString, RTL_TEXTENCODING_ASCII_US ); + DBG_ERROR2( "Diagram: Property %s has an invalid ID (%d)", aProp.GetBuffer(), nWID ); +#endif + } + } + + if( pSet->Count() ) + { + // get value from ItemSet + + // theese two SCHATTRs have to be merged into one INT32 in aAny + if( nWID == SCHATTR_DATADESCR_DESCR || nWID == SCHATTR_DATADESCR_SHOW_SYM ) + { + BOOL bShowSymbol = ((const SfxBoolItem&) + (pSet->Get(SCHATTR_DATADESCR_SHOW_SYM))).GetValue(); + SvxChartDataDescr eDescr = ((const SvxChartDataDescrItem&) + (pSet->Get(SCHATTR_DATADESCR_DESCR))).GetValue(); + + sal_Int32 nVal = 0; + switch( eDescr ) + { + case CHDESCR_NONE: + nVal = chart::ChartDataCaption::NONE; + break; + case CHDESCR_VALUE: + nVal = chart::ChartDataCaption::VALUE; + break; + case CHDESCR_PERCENT: + nVal = chart::ChartDataCaption::PERCENT; + break; + case CHDESCR_TEXT: + nVal = chart::ChartDataCaption::TEXT; + break; + case CHDESCR_TEXTANDPERCENT: + nVal = chart::ChartDataCaption::PERCENT | chart::ChartDataCaption::TEXT; + break; + case CHDESCR_TEXTANDVALUE: + nVal = chart::ChartDataCaption::VALUE | chart::ChartDataCaption::TEXT; + // chart::ChartDataCaption::FORMAT (missing) + } + if( bShowSymbol ) nVal |= chart::ChartDataCaption::SYMBOL; + + aAny <<= nVal; + } + else if( nWID == SCHATTR_SYMBOL_BRUSH ) + { + ::rtl::OUString aURL; + const BfGraphicObject* pGraphObj = + ((const SvxBrushItem &)(pSet->Get( nWID ))).GetGraphicObject(); + if( pGraphObj ) + { + aURL = ::rtl::OUString::createFromAscii( UNO_NAME_GRAPHOBJ_URLPREFIX ); + aURL += ::rtl::OUString::createFromAscii( pGraphObj->GetUniqueID().GetBuffer()); + } + aAny <<= aURL; + } + else + { + aAny = maPropSet.getPropertyValue( pMap, *pSet ); + if( *pMap->pType != aAny.getValueType() ) + { + // since the sfx uint16 item now exports a sal_Int32, we may have to fix this here + if( ( *pMap->pType == ::getCppuType((const sal_Int16*)0)) && aAny.getValueType() == ::getCppuType((const sal_Int32*)0) ) + { + sal_Int32 nValue; + aAny >>= nValue; + aAny <<= static_cast< sal_Int16 >( nValue ); + } + else + { + DBG_ERROR( "getPropertyValue(): wrong Type!" ); + } + } + } + } + else + { + throw beans::UnknownPropertyException(); + } + if( pSet ) + delete pSet; + } + else + { + throw beans::UnknownPropertyException(); + } + } + + return aAny; +} + +void SAL_CALL ChXDataRow::addPropertyChangeListener( const ::rtl::OUString& aPropertyName, + const uno::Reference< beans::XPropertyChangeListener >& xListener ) + throw( beans::UnknownPropertyException, + lang::WrappedTargetException, + uno::RuntimeException ) +{} + +void SAL_CALL ChXDataRow::removePropertyChangeListener( const ::rtl::OUString& aPropertyName, + const uno::Reference< beans::XPropertyChangeListener >& aListener ) + throw( beans::UnknownPropertyException, + lang::WrappedTargetException, + uno::RuntimeException ) +{} + +void SAL_CALL ChXDataRow::addVetoableChangeListener( const ::rtl::OUString& PropertyName, + const uno::Reference< beans::XVetoableChangeListener >& aListener ) + throw( beans::UnknownPropertyException, + lang::WrappedTargetException, + uno::RuntimeException ) +{} + +void SAL_CALL ChXDataRow::removeVetoableChangeListener( const ::rtl::OUString& PropertyName, + const uno::Reference< beans::XVetoableChangeListener >& aListener ) + throw( beans::UnknownPropertyException, + lang::WrappedTargetException, + uno::RuntimeException ) +{} + +// XPropertyState +beans::PropertyState SAL_CALL ChXDataRow::getPropertyState( const ::rtl::OUString& PropertyName ) + throw( beans::UnknownPropertyException, uno::RuntimeException ) +{ + SolarMutexGuard aGuard; + + const SfxItemPropertyMap* pMap = maPropSet.getPropertyMapEntry( PropertyName ); + + if( mpModel && + pMap && pMap->nWID ) + { + if( pMap->nWID == SCHATTR_DATADESCR_DESCR ) + { + SfxItemSet aSet( mpModel->GetItemPool(), + SCHATTR_DATADESCR_DESCR, SCHATTR_DATADESCR_DESCR, + SCHATTR_DATADESCR_SHOW_SYM, SCHATTR_DATADESCR_SHOW_SYM, 0 ); + aSet.Put( mpModel->GetDataRowAttr( mnRow )); + + SfxItemState eState1 = aSet.GetItemState( SCHATTR_DATADESCR_DESCR ); + SfxItemState eState2 = aSet.GetItemState( SCHATTR_DATADESCR_SHOW_SYM ); + if( eState1 == SFX_ITEM_DEFAULT && + eState2 == SFX_ITEM_DEFAULT ) + return beans::PropertyState_DEFAULT_VALUE; + else if( eState1 < SFX_ITEM_DEFAULT && + eState2 < SFX_ITEM_DEFAULT ) + return beans::PropertyState_AMBIGUOUS_VALUE; + else + return beans::PropertyState_DIRECT_VALUE; + } + else if( pMap->nWID == OWN_ATTR_FILLBMP_MODE ) + { + SfxItemSet aSet( mpModel->GetItemPool(), + XATTR_FILLBMP_STRETCH, XATTR_FILLBMP_STRETCH, + XATTR_FILLBMP_TILE, XATTR_FILLBMP_TILE, 0 ); + aSet.Put( mpModel->GetDataRowAttr( mnRow )); + + if( aSet.GetItemState( XATTR_FILLBMP_STRETCH, false ) == SFX_ITEM_SET || + aSet.GetItemState( XATTR_FILLBMP_TILE, false ) == SFX_ITEM_SET ) + return beans::PropertyState_DIRECT_VALUE; + else + return beans::PropertyState_DEFAULT_VALUE; + } + else + { + SfxItemSet aSet( mpModel->GetItemPool(), pMap->nWID, pMap->nWID ); + aSet.Put( mpModel->GetDataRowAttr( mnRow )); + + SfxItemState eState = aSet.GetItemState( pMap->nWID ); + if( eState == SFX_ITEM_DEFAULT ) + return beans::PropertyState_DEFAULT_VALUE; + else if( eState < SFX_ITEM_DEFAULT ) + return beans::PropertyState_AMBIGUOUS_VALUE; + else + return beans::PropertyState_DIRECT_VALUE; + } + } + + return beans::PropertyState_DIRECT_VALUE; +} + +uno::Sequence< beans::PropertyState > SAL_CALL ChXDataRow::getPropertyStates( + const uno::Sequence< ::rtl::OUString >& aPropertyName ) + throw( beans::UnknownPropertyException, + uno::RuntimeException ) +{ + SolarMutexGuard aGuard; + + const sal_Int32 nCount = aPropertyName.getLength(); + const ::rtl::OUString* pNames = aPropertyName.getConstArray(); + + uno::Sequence< beans::PropertyState > aRet( nCount ); + beans::PropertyState* pState = aRet.getArray(); + + for( sal_Int32 nIdx = 0; nIdx < nCount; nIdx++ ) + pState[ nIdx ] = getPropertyState( pNames[ nIdx ] ); + + return aRet; +} + +void SAL_CALL ChXDataRow::setPropertyToDefault( const ::rtl::OUString& PropertyName ) + throw( beans::UnknownPropertyException, + uno::RuntimeException ) +{ + SolarMutexGuard aGuard; + + const SfxItemPropertyMap* pMap = maPropSet.getPropertyMapEntry( PropertyName ); + + if( mpModel && pMap && pMap->nWID ) + { + if( pMap->nWID == SCHATTR_DATADESCR_DESCR ) + { + SfxItemSet aSet( mpModel->GetItemPool(), + SCHATTR_DATADESCR_DESCR, SCHATTR_DATADESCR_DESCR, + SCHATTR_DATADESCR_SHOW_SYM, SCHATTR_DATADESCR_SHOW_SYM, 0 ); + + aSet.ClearItem( SCHATTR_DATADESCR_DESCR ); + aSet.ClearItem( SCHATTR_DATADESCR_SHOW_SYM ); + mpModel->PutDataRowAttr( mnRow, aSet ); + } + else + { + SfxItemSet aSet( mpModel->GetItemPool(), pMap->nWID, pMap->nWID ); + + aSet.ClearItem( pMap->nWID ); + mpModel->PutDataRowAttr( mnRow, aSet ); + } + } +} + +uno::Any SAL_CALL ChXDataRow::getPropertyDefault( const ::rtl::OUString& aPropertyName ) + throw( beans::UnknownPropertyException, + lang::WrappedTargetException, + uno::RuntimeException ) +{ + uno::Any aAny; + const SfxItemPropertyMap* pMap = maPropSet.getPropertyMapEntry( aPropertyName ); + + if( mpModel && ! mpModel->GetItemPool().IsWhich( pMap->nWID )) + throw beans::UnknownPropertyException(); + + if( mpModel && pMap && pMap->nWID ) + { + if( pMap->nWID == CHATTR_PIE_SEGMENT_OFFSET ) + { + aAny <<= (sal_Int32)0; + } + else if( pMap->nWID == SCHATTR_DATADESCR_DESCR ) + { + SfxItemSet aSet( mpModel->GetItemPool(), + SCHATTR_DATADESCR_DESCR, SCHATTR_DATADESCR_DESCR, + SCHATTR_DATADESCR_SHOW_SYM, SCHATTR_DATADESCR_SHOW_SYM, 0 ); + + aSet.Put( mpModel->GetItemPool().GetDefaultItem( SCHATTR_DATADESCR_DESCR )); + aSet.Put( mpModel->GetItemPool().GetDefaultItem( SCHATTR_DATADESCR_SHOW_SYM )); + aAny = maPropSet.getPropertyValue( pMap, aSet ); + } + else + { + SfxItemSet aSet( mpModel->GetItemPool(), pMap->nWID, pMap->nWID ); + aSet.Put( mpModel->GetItemPool().GetDefaultItem( pMap->nWID )); + aAny = maPropSet.getPropertyValue( pMap, aSet ); + } + + if( *pMap->pType != aAny.getValueType() ) + { + // since the sfx uint16 item now exports a sal_Int32, we may have to fix this here + if( ( *pMap->pType == ::getCppuType((const sal_Int16*)0)) && aAny.getValueType() == ::getCppuType((const sal_Int32*)0) ) + { + sal_Int32 nValue; + aAny >>= nValue; + aAny <<= static_cast< sal_Int16 >( nValue ); + } + else + { + DBG_ERROR( "getPropertyDefault(): wrong Type!" ); + } + } + } + + return aAny; +} + +// XShapeDescriptor +::rtl::OUString SAL_CALL ChXDataRow::getShapeType() throw( uno::RuntimeException ) +{ + return SCH_ASCII_TO_OU( "com.sun.star.chart.ChartDataRow" ); +} + +// XServiceInfo +::rtl::OUString SAL_CALL ChXDataRow::getImplementationName() throw( uno::RuntimeException ) +{ + return SCH_ASCII_TO_OU( "ChXDataRow" ); +} + +sal_Bool SAL_CALL ChXDataRow::supportsService( const ::rtl::OUString& ServiceName ) + throw( uno::RuntimeException ) +{ + return SvxServiceInfoHelper::supportsService( ServiceName, getSupportedServiceNames() ); +} + +uno::Sequence< ::rtl::OUString > SAL_CALL ChXDataRow::getSupportedServiceNames() + throw( uno::RuntimeException ) +{ + uno::Sequence< ::rtl::OUString > aSeq; + SvxServiceInfoHelper::addToSequence( + aSeq, 7, + "com.sun.star.chart.ChartDataPointProperties", + "com.sun.star.chart.ChartDataRowProperties", + "com.sun.star.chart.ChartStatistics", + "com.sun.star.drawing.LineProperties", + "com.sun.star.drawing.FillProperties", + "com.sun.star.style.CharacterProperties", + "com.sun.star.xml.UserDefinedAttributeSupplier" ); + + if( mpModel && mpModel->Is3DChart() ) + { + long nType = mpModel->GetBaseType(); + if( nType == CHTYPE_BAR || nType == CHTYPE_COLUMN ) + SvxServiceInfoHelper::addToSequence( aSeq, 1, "com.sun.star.chart.Chart3DBarProperties" ); + } + + return aSeq; +} + +// XUnoTunnel +sal_Int64 SAL_CALL ChXDataRow::getSomething( const uno::Sequence< sal_Int8 >& aIdentifier ) + throw( uno::RuntimeException ) +{ + if( aIdentifier.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), + aIdentifier.getConstArray(), 16 ) ) + { + return (sal_Int64)this; + } + return 0; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/unoidl/sch_ChXDiagram.cxx b/binfilter/bf_sch/source/ui/unoidl/sch_ChXDiagram.cxx new file mode 100644 index 000000000000..946386e66436 --- /dev/null +++ b/binfilter/bf_sch/source/ui/unoidl/sch_ChXDiagram.cxx @@ -0,0 +1,2145 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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. + * + ************************************************************************/ + +// header for class OGuard +// header for class Application +#include <vcl/svapp.hxx> + +#include "schattr.hxx" +#ifndef _SVX_BRSHITEM_HXX +#define ITEMID_BRUSH SCHATTR_SYMBOL_BRUSH +#include <bf_svx/brshitem.hxx> +#endif +// header for CreateGraphicObjectFromURL +#include <bf_svx/unoapi.hxx> +// header for SvxChartDataDescrItem +#ifndef _SVX_CHRTITEM_HXX +#define ITEMID_CHARTDATADESCR SCHATTR_DATADESCR_DESCR + +#include <bf_svtools/eitem.hxx> + +#endif + +#include "ChXDiagram.hxx" +#include "ChXChartAxis.hxx" +#include "ChXDataRow.hxx" +#include "ChXDataPoint.hxx" +#include "ChartTitle.hxx" +#include "ChartLine.hxx" +#include "ChartArea.hxx" +#include "ChartGrid.hxx" + +#include "mapprov.hxx" + +#include "schattr.hxx" +#include "charttyp.hxx" +#include "chtscene.hxx" +#include "docshell.hxx" + +#include <bf_svx/unoshape.hxx> +// for OWN_ATTR_... +#include <bf_svx/unoshprp.hxx> +// for SID_ATTR_... +#include <bf_svx/svxids.hrc> +#include <rtl/uuid.h> +#include <rtl/memory.h> +// header for any2enum +#include <comphelper/extract.hxx> + +#include <com/sun/star/chart/ChartDataRowSource.hpp> +#include <com/sun/star/chart/ChartErrorCategory.hpp> +#include <com/sun/star/chart/ChartErrorIndicatorType.hpp> +#include <com/sun/star/chart/ChartRegressionCurveType.hpp> +#include <com/sun/star/chart/ChartDataCaption.hpp> + +#include <rtl/logfile.hxx> + +#include "pairs.hxx" +#include "unonames.hxx" + +namespace +{ +::binfilter::ChartScene * lcl_GetScene( ::binfilter::ChartModel * pModel ) +{ + ::binfilter::ChartScene * pScene = NULL; + + if( pModel && pModel->IsReal3D() ) + { + if( ! pModel->IsInitialized()) + pModel->Initialize(); + pScene = pModel->GetScene(); + } + + return pScene; +} +} // anonymous namespace + + +namespace binfilter { + +using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::beans; + +using rtl::OUString; + +extern SchUnoPropertyMapProvider aSchMapProvider; + +#if defined(MACOSX) && ( __GNUC__ < 3 ) +static cppu::ClassData14 cppu::ImplHelper14::s_aCD; +static cppu::ClassData14 cppu::WeakImplHelper14::s_aCD; +#endif + +#define MATRIX4D_TO_HOMOGEN_MATRIX( m, h ) \ + h.Line1.Column1 = m[0][0]; \ + h.Line1.Column2 = m[0][1]; \ + h.Line1.Column3 = m[0][2]; \ + h.Line1.Column4 = m[0][3]; \ + h.Line2.Column1 = m[1][0]; \ + h.Line2.Column2 = m[1][1]; \ + h.Line2.Column3 = m[1][2]; \ + h.Line2.Column4 = m[1][3]; \ + h.Line3.Column1 = m[2][0]; \ + h.Line3.Column2 = m[2][1]; \ + h.Line3.Column3 = m[2][2]; \ + h.Line3.Column4 = m[2][3]; \ + h.Line4.Column1 = m[3][0]; \ + h.Line4.Column2 = m[3][1]; \ + h.Line4.Column3 = m[3][2]; \ + h.Line4.Column4 = m[3][3] + +#define HOMOGEN_MATRIX_TO_MATRIX4D( h, m ) \ + m[0][0] = h.Line1.Column1; \ + m[0][1] = h.Line1.Column2; \ + m[0][2] = h.Line1.Column3; \ + m[0][3] = h.Line1.Column4; \ + m[1][0] = h.Line2.Column1; \ + m[1][1] = h.Line2.Column2; \ + m[1][2] = h.Line2.Column3; \ + m[1][3] = h.Line2.Column4; \ + m[2][0] = h.Line3.Column1; \ + m[2][1] = h.Line3.Column2; \ + m[2][2] = h.Line3.Column3; \ + m[2][3] = h.Line3.Column4; \ + m[3][0] = h.Line4.Column1; \ + m[3][1] = h.Line4.Column2; \ + m[3][2] = h.Line4.Column3; \ + m[3][3] = h.Line4.Column4 + +#define CALL(object,interface,method) {uno::Reference<interface>x(object,uno::UNO_QUERY); if(x.is())x.method();} +#define CALL1(object,interface,method,arg1) {uno::Reference<interface>x(object,uno::UNO_QUERY); if(x.is())x.method(arg1);} + +inline void add_listener (uno::Reference<uno::XInterface> xObject, ChXDiagram * p) +{ + if ( ! xObject.is()) + return; + uno::Reference<lang::XComponent> xComponent (xObject, uno::UNO_QUERY); + if (xComponent.is()) + xComponent->addEventListener (p); +} + +ChXDiagram::ChXDiagram( SchChartDocShell* pDocShell, sal_Bool bPreInit ) : + mpModel( NULL ), + maPropSet( aSchMapProvider.GetMap( CHMAP_CHART, NULL )), + mnBaseType( -1 ), + maListenerList (maMutex) +{ + if( bPreInit ) + { + DBG_ASSERT( pDocShell, "Cannot do PreInit when using invalid DocShell." ); + SetDocShell( pDocShell ); + } +} + +ChXDiagram::~ChXDiagram() {} + +// bKeepModel = sal_True => try to keep model. If model is invalid take the one from DocShell +sal_Bool ChXDiagram::SetDocShell( SchChartDocShell* pDocShell, sal_Bool bKeepModel ) throw() +{ + SolarMutexGuard aGuard; + sal_Bool bModelKept = sal_False; + + if( pDocShell ) + { + if( bKeepModel && mpModel ) + { + // copy current model + ChartModel* pModel = SAL_STATIC_CAST( ChartModel*, mpModel->AllocModel()); + if( pModel ) + { + pDocShell->SetModelPtr( pModel ); + if( ! pModel->SetObjectShell( pDocShell )) + { + DBG_ERROR( "Couldn't set docshell" ); + } + + delete mpModel; + mpModel = pModel; + bModelKept = sal_True; + } + } + else + { + // use model of new DocShell + mpModel = pDocShell->GetModelPtr(); + if( ! bKeepModel && mpModel ) + { + maPropSet = SvxItemPropertySet( aSchMapProvider.GetMap( CHMAP_CHART, mpModel )); + maServiceName = getDiagramType(); + } + } + } + else + mpModel = NULL; + + return bModelKept; +} + +// generate a uniqueId +const uno::Sequence< sal_Int8 > & ChXDiagram::getUnoTunnelId() throw() +{ + static uno::Sequence< sal_Int8 > * pSeq = 0; + if( !pSeq ) + { + osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); + if( !pSeq ) + { + static uno::Sequence< sal_Int8 > aSeq( 16 ); + rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True ); + pSeq = &aSeq; + } + } + return *pSeq; +} + +ChXDiagram* ChXDiagram::getImplementation( uno::Reference< uno::XInterface > xData ) throw() +{ + uno::Reference< lang::XUnoTunnel > xUT( xData, uno::UNO_QUERY ); + if( xUT.is() ) + return (ChXDiagram*)xUT->getSomething( ChXDiagram::getUnoTunnelId() ); + else + return NULL; +} + +uno::Any ChXDiagram::GetAnyByItem( SfxItemSet& aSet, const SfxItemPropertyMap* pMap ) +{ + DBG_ASSERT( pMap, "GetAnyByItem: invalid Map!" ); + DBG_ASSERT( mpModel, "GetAnyByItem: invalid Model!" ); + + uno::Any aAny; + + switch( pMap->nWID ) + { + case CHATTR_DATA_SWITCH: // BM: SwitchData is enum now + { + sal_Bool bIsOn = SAL_STATIC_CAST( const SfxBoolItem&, aSet.Get( CHATTR_DATA_SWITCH ) ).GetValue(); + chart::ChartDataRowSource eRowSource = + bIsOn ? chart::ChartDataRowSource_COLUMNS : chart::ChartDataRowSource_ROWS; + aAny <<= eRowSource; + } + break; + + case SCHATTR_STYLE_SHAPE: + aAny <<= SAL_STATIC_CAST( sal_Int32, mpModel->GetChartShapeType() ); + break; + + case SCHATTR_DATADESCR_DESCR: + { + BOOL bShowSymbol = ((const SfxBoolItem&) + (aSet.Get(SCHATTR_DATADESCR_SHOW_SYM))).GetValue(); + SvxChartDataDescr eDescr = ((const SvxChartDataDescrItem&) + (aSet.Get(SCHATTR_DATADESCR_DESCR))).GetValue(); + + sal_Int32 nVal = 0; + switch( eDescr ) + { + case CHDESCR_NONE: + nVal = chart::ChartDataCaption::NONE; + break; + case CHDESCR_VALUE: + nVal = chart::ChartDataCaption::VALUE; + break; + case CHDESCR_PERCENT: + nVal = chart::ChartDataCaption::PERCENT; + break; + case CHDESCR_TEXT: + nVal = chart::ChartDataCaption::TEXT; + break; + case CHDESCR_TEXTANDPERCENT: + nVal = chart::ChartDataCaption::PERCENT | chart::ChartDataCaption::TEXT; + break; + case CHDESCR_TEXTANDVALUE: + nVal = chart::ChartDataCaption::VALUE | chart::ChartDataCaption::TEXT; + } + if( bShowSymbol ) nVal |= chart::ChartDataCaption::SYMBOL; + + aAny <<= nVal; + } + break; + + case SCHATTR_SYMBOL_BRUSH: + { + ::rtl::OUString aURL; + const BfGraphicObject* pGraphObj = + ((const SvxBrushItem &)(aSet.Get( SCHATTR_SYMBOL_BRUSH ))).GetGraphicObject(); + if( pGraphObj ) + { + aURL = ::rtl::OUString::createFromAscii( UNO_NAME_GRAPHOBJ_URLPREFIX ); + aURL += ::rtl::OUString::createFromAscii( pGraphObj->GetUniqueID().GetBuffer()); + } + aAny <<= aURL; + } + break; + + default: + aAny = maPropSet.getPropertyValue( pMap, aSet ); + + if( *pMap->pType != aAny.getValueType() ) + { + // since the sfx uint16 item now exports a sal_Int32, we may have to fix this here + if( ( *pMap->pType == ::getCppuType((const sal_Int16*)0)) && aAny.getValueType() == ::getCppuType((const sal_Int32*)0) ) + { + sal_Int32 nValue; + aAny >>= nValue; + aAny <<= static_cast< sal_Int16 >( nValue ); + } + else if( ( *pMap->pType == ::getCppuType((const sal_uInt16*)0)) && aAny.getValueType() == ::getCppuType((const sal_Int32*)0) ) + { + sal_Int32 nValue; + aAny >>= nValue; + aAny <<= static_cast< sal_uInt16 >( nValue ); + } + else + { + OSL_TRACE( "GetAnyByItem(): wrong Type!" ); + DBG_ERROR( "GetAnyByItem(): wrong Type!" ); + } + } + } + return aAny; +} + +// XDiagram +::rtl::OUString SAL_CALL ChXDiagram::getDiagramType() throw( uno::RuntimeException ) +{ + if( maServiceName.getLength() && + mpModel && + mnBaseType == mpModel->GetBaseType() ) + { + return maServiceName; + } + + SolarMutexGuard aGuard; + + if( mpModel ) + { + mnBaseType = mpModel->GetBaseType(); + switch( mnBaseType ) + { + case CHTYPE_LINE: + maServiceName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SCH_X_STR_CHTYPE_NAMESPACE SCH_X_STR_CHTYPE_LINE )); + break; + case CHTYPE_AREA: + maServiceName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SCH_X_STR_CHTYPE_NAMESPACE SCH_X_STR_CHTYPE_AREA )); + break; + case CHTYPE_DONUT : + maServiceName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SCH_X_STR_CHTYPE_NAMESPACE SCH_X_STR_CHTYPE_DONUT )); + break; + case CHTYPE_COLUMN: // is also treated as (vertical) bar chart + case CHTYPE_BAR : + maServiceName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SCH_X_STR_CHTYPE_NAMESPACE SCH_X_STR_CHTYPE_BAR )); + break; + case CHTYPE_CIRCLE : + maServiceName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SCH_X_STR_CHTYPE_NAMESPACE SCH_X_STR_CHTYPE_PIE )); + break; + case CHTYPE_XY : + maServiceName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SCH_X_STR_CHTYPE_NAMESPACE SCH_X_STR_CHTYPE_XY )); + break; + case CHTYPE_NET : + maServiceName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SCH_X_STR_CHTYPE_NAMESPACE SCH_X_STR_CHTYPE_NET )); + break; + case CHTYPE_STOCK : + maServiceName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SCH_X_STR_CHTYPE_NAMESPACE SCH_X_STR_CHTYPE_STOCK )); + break; + case CHTYPE_ADDIN : + // when we get here we know that maServiceName.getLength() == 0 + DBG_ERROR( "Addin with empty name !" ); + break; + } + return maServiceName; + } + else + { + DBG_ERROR( "No Model" ); + } + return SCH_ASCII_TO_OU( "UnknownChartType" ); +} + +uno::Reference< beans::XPropertySet > SAL_CALL ChXDiagram::getDataRowProperties( sal_Int32 Row ) + throw( uno::RuntimeException, lang::IndexOutOfBoundsException ) +{ + SolarMutexGuard aGuard; + + if( mpModel ) + { + if( Row >= 0 && + Row < mpModel->GetRowCount() ) + { + ChXDataRow* pRet = new ChXDataRow( Row, mpModel ); + return uno::Reference< beans::XPropertySet >( SAL_STATIC_CAST( beans::XPropertySet*, pRet )); + } + else + { + ::rtl::OUString aMessage( RTL_CONSTASCII_USTRINGPARAM( "DataRowProperties: Invalid Index " )); + aMessage += ::rtl::OUString::valueOf( Row ); + lang::IndexOutOfBoundsException aEx( aMessage, (::cppu::OWeakObject*)this ); + throw aEx; + } + } + else + { + DBG_ERROR( "No Model" ); + } + + return uno::Reference< beans::XPropertySet >(); +} + +uno::Reference< beans::XPropertySet > SAL_CALL ChXDiagram::getDataPointProperties( sal_Int32 Column, sal_Int32 Row ) + throw( uno::RuntimeException, lang::IndexOutOfBoundsException ) +{ + SolarMutexGuard aGuard; + + if( mpModel ) + { + if( Row >= 0 && Column >= 0 && + (Row < mpModel->GetRowCount()) && + (Column < mpModel->GetColCount()) ) + { + ChXDataPoint* pRet = new ChXDataPoint( Column, Row, mpModel ); + return uno::Reference< beans::XPropertySet >( SAL_STATIC_CAST( beans::XPropertySet*, pRet )); + } + else + { + ::rtl::OUString aMessage( RTL_CONSTASCII_USTRINGPARAM( "DataPointProperties: Invalid Index (col, row): " )); + aMessage += ::rtl::OUString::valueOf( Column ); + aMessage += ::rtl::OUString::createFromAscii( ", " ); + aMessage += ::rtl::OUString::valueOf( Row ); + lang::IndexOutOfBoundsException aEx( aMessage, (::cppu::OWeakObject*)this ); + throw aEx; + } + } + else + { + DBG_ERROR( "No Model" ); + } + + return uno::Reference< beans::XPropertySet >(); +} + +// XShape ( ::XDiagram) +awt::Size SAL_CALL ChXDiagram::getSize() throw( uno::RuntimeException ) +{ + SolarMutexGuard aGuard; + + if( mpModel ) + { + Size aSize = mpModel->GetChartRect().GetSize(); + return awt::Size( aSize.Width(), aSize.Height() ); + } + else + return awt::Size( 0, 0 ); +} + +void SAL_CALL ChXDiagram::setSize( const awt::Size& aSize ) + throw( uno::RuntimeException, + beans::PropertyVetoException ) +{ + SolarMutexGuard aGuard; + if( mpModel ) + { + Rectangle aRect = mpModel->GetChartRect(); + Size aOldSize = aRect.GetSize(); + if( aOldSize.Width() != aSize.Width || + aOldSize.Height() != aSize.Height ) + { + mpModel->SetUseRelativePositions( TRUE ); + mpModel->SetDiagramHasBeenMovedOrResized( TRUE ); + aRect.SetSize( Size( aSize.Width, aSize.Height ) ); + mpModel->SetChartRect( aRect ); + mpModel->BuildChart( FALSE ); + } + } + else + { + DBG_ERROR( "No Model" ); + } +} + +awt::Point SAL_CALL ChXDiagram::getPosition() throw( uno::RuntimeException ) +{ + SolarMutexGuard aGuard; + if( mpModel ) + { + Point aPoint = mpModel->GetChartRect().TopLeft(); + return awt::Point( aPoint.X(), aPoint.Y() ); + } + else + { + DBG_ERROR( "No Model" ); + } + return awt::Point( 0, 0 ); +} + +void SAL_CALL ChXDiagram::setPosition( const awt::Point& aPosition ) throw( uno::RuntimeException ) +{ + SolarMutexGuard aGuard; + + if( mpModel ) + { + Rectangle aRect=mpModel->GetChartRect(); + Point aUpperLeft = aRect.TopLeft(); + if( aUpperLeft.X() != aPosition.X || + aUpperLeft.Y() != aPosition.Y ) + { + mpModel->SetUseRelativePositions( TRUE ); + mpModel->SetDiagramHasBeenMovedOrResized( TRUE ); + aRect.SetPos( Point( aPosition.X, aPosition.Y ) ); + mpModel->SetChartRect( aRect ); + mpModel->BuildChart( FALSE ); + } + } + else + { + DBG_ERROR( "No Model" ); + } +} + +// XShapeDescriptor ( ::XShape ::XDiagram ) +::rtl::OUString SAL_CALL ChXDiagram::getShapeType() throw( uno::RuntimeException ) +{ + return SCH_ASCII_TO_OU( "com.sun.star.chart.Diagram" ); +} + +// XAxisXSupplier, XAxisYSupplier, XAxisZSupplier, +// XTwoAxisXSupplier, XTwoAxisYSupplier +uno::Reference< drawing::XShape > SAL_CALL ChXDiagram::getXAxisTitle() + throw( uno::RuntimeException ) +{ + if( ! mxXAxisTitle.is()) + { + mxXAxisTitle = new ChartTitle( mpModel, CHOBJID_DIAGRAM_TITLE_X_AXIS ); + add_listener (mxXAxisTitle, this); + } + + return mxXAxisTitle; +} + +uno::Reference< drawing::XShape > SAL_CALL ChXDiagram::getYAxisTitle() + throw( uno::RuntimeException ) +{ + if( ! mxYAxisTitle.is()) + { + mxYAxisTitle = new ChartTitle( mpModel, CHOBJID_DIAGRAM_TITLE_Y_AXIS ); + add_listener (mxYAxisTitle, this); + } + + return mxYAxisTitle; +} + +uno::Reference< drawing::XShape > SAL_CALL ChXDiagram::getZAxisTitle() + throw( uno::RuntimeException ) +{ + if( ! mxZAxisTitle.is()) + { + mxZAxisTitle = new ChartTitle( mpModel, CHOBJID_DIAGRAM_TITLE_Z_AXIS ); + add_listener (mxZAxisTitle, this); + } + + return mxZAxisTitle; +} + +uno::Reference< beans::XPropertySet > SAL_CALL ChXDiagram::getXAxis() throw( ::com::sun::star::uno::RuntimeException ) +{ + if( ! mxXAxis.is()) + { + mxXAxis = new ChXChartAxis( mpModel, CHOBJID_DIAGRAM_X_AXIS ); + add_listener (mxXAxis, this); + } + + return mxXAxis; +} +uno::Reference< beans::XPropertySet > SAL_CALL ChXDiagram::getYAxis() throw( ::com::sun::star::uno::RuntimeException ) +{ + if( ! mxYAxis.is()) + { + mxYAxis = new ChXChartAxis( mpModel, CHOBJID_DIAGRAM_Y_AXIS ); + add_listener (mxYAxis, this); + } + + return mxYAxis; +} +uno::Reference< beans::XPropertySet > SAL_CALL ChXDiagram::getZAxis() throw( ::com::sun::star::uno::RuntimeException ) +{ + if( ! mxZAxis.is()) + { + mxZAxis = new ChXChartAxis( mpModel, CHOBJID_DIAGRAM_Z_AXIS ); + add_listener (mxZAxis, this); + } + + return mxZAxis; +} +uno::Reference< beans::XPropertySet > SAL_CALL ChXDiagram::getSecondaryXAxis() throw( ::com::sun::star::uno::RuntimeException ) +{ + if( ! mxSecXAxis.is()) + { + mxSecXAxis = new ChXChartAxis( mpModel, CHOBJID_DIAGRAM_A_AXIS ); + add_listener (mxSecXAxis, this); + } + + return mxSecXAxis; +} +uno::Reference< beans::XPropertySet > SAL_CALL ChXDiagram::getSecondaryYAxis() throw( ::com::sun::star::uno::RuntimeException ) +{ + if( ! mxSecYAxis.is()) + { + mxSecYAxis = new ChXChartAxis( mpModel, CHOBJID_DIAGRAM_B_AXIS ); + add_listener (mxSecYAxis, this); + } + + return mxSecYAxis; +} +uno::Reference< beans::XPropertySet > SAL_CALL ChXDiagram::getXMainGrid() throw( ::com::sun::star::uno::RuntimeException ) +{ + // attention: x and y grids are interchanged + if( ! mxMajorGridX.is()) + { + mxMajorGridX = new ChartGrid( mpModel, CHOBJID_DIAGRAM_Y_GRID_MAIN_GROUP ); + add_listener (mxMajorGridX, this); + } + + return mxMajorGridX; +} +uno::Reference< beans::XPropertySet > SAL_CALL ChXDiagram::getYMainGrid() throw( ::com::sun::star::uno::RuntimeException ) +{ + // attention: x and y grids are interchanged + if( ! mxMajorGridY.is()) + { + mxMajorGridY = new ChartGrid( mpModel, CHOBJID_DIAGRAM_X_GRID_MAIN_GROUP ); + add_listener (mxMajorGridY, this); + } + + return mxMajorGridY; +} +uno::Reference< beans::XPropertySet > SAL_CALL ChXDiagram::getZMainGrid() throw( ::com::sun::star::uno::RuntimeException ) +{ + if( ! mxMajorGridZ.is()) + { + mxMajorGridZ = new ChartGrid( mpModel, CHOBJID_DIAGRAM_Z_GRID_MAIN_GROUP ); + add_listener (mxMajorGridZ, this); + } + + return mxMajorGridZ; +} +uno::Reference< beans::XPropertySet > SAL_CALL ChXDiagram::getXHelpGrid() throw( ::com::sun::star::uno::RuntimeException ) +{ + // attention: x and y grids are interchanged + if( ! mxMinorGridX.is()) + { + mxMinorGridX = new ChartGrid( mpModel, CHOBJID_DIAGRAM_Y_GRID_HELP_GROUP ); + add_listener (mxMinorGridX, this); + } + + return mxMinorGridX; +} +uno::Reference< beans::XPropertySet > SAL_CALL ChXDiagram::getYHelpGrid() throw( ::com::sun::star::uno::RuntimeException ) +{ + // attention: x and y grids are interchanged + if( ! mxMinorGridY.is()) + { + mxMinorGridY = new ChartGrid( mpModel, CHOBJID_DIAGRAM_X_GRID_HELP_GROUP ); + add_listener (mxMinorGridY, this); + } + + return mxMinorGridY; +} +uno::Reference< beans::XPropertySet > SAL_CALL ChXDiagram::getZHelpGrid() throw( ::com::sun::star::uno::RuntimeException ) +{ + if( ! mxMinorGridZ.is()) + { + mxMinorGridZ = new ChartGrid( mpModel, CHOBJID_DIAGRAM_Z_GRID_HELP_GROUP ); + add_listener (mxMinorGridZ, this); + } + + return mxMinorGridZ; +} + +// XStatisticDisplay +uno::Reference< beans::XPropertySet > SAL_CALL ChXDiagram::getMinMaxLine() throw( ::com::sun::star::uno::RuntimeException ) +{ + if( ! mxMinMaxLine.is()) + { + mxMinMaxLine = new ChartLine( mpModel, CHOBJID_DIAGRAM_STOCKLINE_GROUP ); + add_listener (mxMinMaxLine, this); + } + + return mxMinMaxLine; +} +uno::Reference< beans::XPropertySet > SAL_CALL ChXDiagram::getUpBar() throw( ::com::sun::star::uno::RuntimeException ) +{ + if( ! mxUpBar.is()) + { + mxUpBar = new ChartArea( mpModel, CHOBJID_DIAGRAM_STOCKPLUS_GROUP ); + add_listener (mxUpBar, this); + } + + return mxUpBar; +} +uno::Reference< beans::XPropertySet > SAL_CALL ChXDiagram::getDownBar() throw( ::com::sun::star::uno::RuntimeException ) +{ + if( ! mxDownBar.is()) + { + mxDownBar = new ChartArea( mpModel, CHOBJID_DIAGRAM_STOCKLOSS_GROUP ); + add_listener (mxDownBar, this); + } + + return mxDownBar; +} + +// X3DDisplay +uno::Reference< beans::XPropertySet > SAL_CALL ChXDiagram::getFloor() throw( ::com::sun::star::uno::RuntimeException ) +{ + if( ! mxFloor.is()) + { + mxFloor = new ChartArea( mpModel, CHOBJID_DIAGRAM_FLOOR ); + add_listener (mxFloor, this); + } + + return mxFloor; +} +// note: this method is also valid for 2d charts +uno::Reference< beans::XPropertySet > SAL_CALL ChXDiagram::getWall() throw( ::com::sun::star::uno::RuntimeException ) +{ + if( ! mxWall.is()) + { + mxWall = new ChartArea( mpModel, CHOBJID_DIAGRAM_WALL ); + add_listener (mxWall, this); + } + + return mxWall; +} + + +// XPropertySet +uno::Reference< beans::XPropertySetInfo > SAL_CALL ChXDiagram::getPropertySetInfo() throw( uno::RuntimeException ) +{ + SolarMutexGuard aGuard; + return maPropSet.getPropertySetInfo(); +} + +// needed for camera geometry +struct ImpRememberTransAndRect +{ + Matrix4D maMat; + Rectangle maRect; +}; + +void SAL_CALL ChXDiagram::setPropertyValue( const ::rtl::OUString& aPropertyName, const uno::Any& aValue ) + throw( beans::UnknownPropertyException, + beans::PropertyVetoException, + lang::IllegalArgumentException, + lang::WrappedTargetException, + uno::RuntimeException ) +{ + SolarMutexGuard aGuard; + + if( mpModel ) + { + const SfxItemPropertyMap* pMap = maPropSet.getPropertyMapEntry( aPropertyName ); + + if( pMap && pMap->nWID ) + { + if( pMap->nFlags & PropertyAttribute::READONLY ) + throw PropertyVetoException(); + + USHORT nWID = pMap->nWID; + sal_Int32 nVal; + + SfxItemSet* pSet; + switch( nWID ) + { + case SCHATTR_DATADESCR_DESCR: + case SCHATTR_DATADESCR_SHOW_SYM: + // the Property DataCaption needs two Which Ids + pSet = new SfxItemSet( mpModel->GetItemPool(), + SCHATTR_DATADESCR_DESCR, SCHATTR_DATADESCR_DESCR, + SCHATTR_DATADESCR_SHOW_SYM, SCHATTR_DATADESCR_SHOW_SYM, 0 ); + break; + + case CHATTR_NUM_OF_LINES_FOR_BAR: + { + aValue >>= nVal; + if( mpModel->GetBaseType() == CHTYPE_COLUMN ) + mpModel->SetNumLinesColChart( nVal, TRUE ); + mpModel->BuildChart( FALSE ); + return; // RETURN + } + + case CHATTR_SPLINE_ORDER: + { + aValue >>= nVal; + // for some reason the value internally is one more + // ie order 1 is linear but is stores as 2 in the core + ++nVal; + mpModel->SplineDepth() = nVal; + if( mpModel->IsSplineChart()) + mpModel->BuildChart( FALSE ); + return; // RETURN + } + + case CHATTR_SPLINE_RESOLUTION: + { + aValue >>= nVal; + mpModel->Granularity() = nVal; + if( mpModel->IsSplineChart()) + mpModel->BuildChart( FALSE ); + return; // RETURN + } + + case SCHATTR_STYLE_STACKED: + case SCHATTR_STYLE_PERCENT: + pSet = new SfxItemSet( mpModel->GetItemPool(), + SCHATTR_STYLE_STACKED, SCHATTR_STYLE_STACKED, + SCHATTR_STYLE_PERCENT, SCHATTR_STYLE_PERCENT, 0 ); + break; + + case SCHATTR_STYLE_DEEP: + // deep implies 3d + pSet = new SfxItemSet( mpModel->GetItemPool(), + SCHATTR_STYLE_DEEP, SCHATTR_STYLE_DEEP, + SCHATTR_STYLE_3D, SCHATTR_STYLE_3D, 0 ); + break; + + case OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX: + { + E3dObject* pScene = lcl_GetScene( mpModel ); + + if( pScene ) + { + drawing::HomogenMatrix xHomMatrix; + aValue >>= xHomMatrix; + Matrix4D aMtx; + HOMOGEN_MATRIX_TO_MATRIX4D( xHomMatrix, aMtx ); + pScene->SetTransform( aMtx ); + } + return; // RETURN + } + + case OWN_ATTR_3D_VALUE_CAMERA_GEOMETRY: + { + E3dScene* pScene = lcl_GetScene( mpModel ); + + if( pScene ) + { + drawing::CameraGeometry aCamGeo; + + if(aValue >>= aCamGeo) + { + Vector3D aVRP(aCamGeo.vrp.PositionX, aCamGeo.vrp.PositionY, aCamGeo.vrp.PositionZ); + Vector3D aVPN(aCamGeo.vpn.DirectionX, aCamGeo.vpn.DirectionY, aCamGeo.vpn.DirectionZ); + Vector3D aVUP(aCamGeo.vup.DirectionX, aCamGeo.vup.DirectionY, aCamGeo.vup.DirectionZ); + + // rescue scene transformation + ImpRememberTransAndRect aSceneTAR; + aSceneTAR.maMat = pScene->GetTransform(); + aSceneTAR.maRect = pScene->GetSnapRect(); + +// // rescue object transformations +// SdrObjListIter aIter(*pScene->GetSubList(), IM_DEEPWITHGROUPS); +// List aObjTrans; +// while(aIter.IsMore()) +// { +// E3dObject* p3DObj = (E3dObject*)aIter.Next(); +// Matrix4D* pNew = new Matrix4D; +// *pNew = p3DObj->GetTransform(); +// aObjTrans.Insert(pNew, LIST_APPEND); +// } + + // reset object transformations +// aIter.Reset(); +// while(aIter.IsMore()) +// { +// E3dObject* p3DObj = (E3dObject*)aIter.Next(); +// p3DObj->NbcResetTransform(); +// } + + // reset scene transformation and make a complete recalc +// pScene->NbcResetTransform(); + + // fill old camera from new parameters + Camera3D aCam(pScene->GetCamera()); + const Volume3D& rVolume = pScene->GetBoundVolume(); + double fW = rVolume.GetWidth(); + double fH = rVolume.GetHeight(); + double fCamPosZ = + (double)((const SfxUInt32Item&)pScene->GetItem(SDRATTR_3DSCENE_DISTANCE)).GetValue(); + double fCamFocal = + (double)((const SfxUInt32Item&)pScene->GetItem(SDRATTR_3DSCENE_FOCAL_LENGTH)).GetValue(); + + aCam.SetAutoAdjustProjection(FALSE); + aCam.SetViewWindow(- fW / 2, - fH / 2, fW, fH); + Vector3D aLookAt; + Vector3D aCamPos(0.0, 0.0, fCamPosZ); + aCam.SetPosAndLookAt(aCamPos, aLookAt); + aCam.SetFocalLength(fCamFocal / 100.0); + aCam.SetDefaults(Vector3D(0.0, 0.0, fCamPosZ), aLookAt, fCamFocal / 100.0); + aCam.SetDeviceWindow(Rectangle(0, 0, (long)fW, (long)fH)); + + // set at scene + pScene->SetCamera(aCam); + + // set object transformations again at objects +// aIter.Reset(); +// sal_uInt32 nIndex(0L); +// while(aIter.IsMore()) +// { +// E3dObject* p3DObj = (E3dObject*)aIter.Next(); +// Matrix4D* pMat = (Matrix4D*)aObjTrans.GetObject(nIndex++); +// p3DObj->NbcSetTransform(*pMat); +// delete pMat; +// } + + // set scene transformation again at scene + pScene->NbcSetTransform(aSceneTAR.maMat); + pScene->FitSnapRectToBoundVol(); + pScene->NbcSetSnapRect(aSceneTAR.maRect); + } + } + return; // RETURN + } + + default: + pSet = new SfxItemSet( mpModel->GetPool(), nWID, nWID ); + } + + // fill item: (should be optimized) + ChartType aType( mpModel ); + aType.GetAttrSet( pSet ); + mpModel->GetAttr( *pSet ); + + if( !pSet->Count() ) + { + // get default from ItemPool + if( mpModel->GetItemPool().IsWhich( nWID ) ) + { + pSet->Put( mpModel->GetItemPool().GetDefaultItem( pMap->nWID ) ); + } + else + { +#ifdef DBG_UTIL + String aTmpString( aPropertyName ); + ByteString aProp( aTmpString, RTL_TEXTENCODING_ASCII_US ); + DBG_ERROR2( "Diagram: Property %s has an invalid ID (%d)", aProp.GetBuffer(), nWID ); +#endif + } + } + + if( pSet->Count() ) + { + switch( nWID ) + { + case SCHATTR_STAT_KIND_ERROR: + { + chart::ChartErrorCategory eCat; + cppu::any2enum< chart::ChartErrorCategory >( eCat, aValue ); + pSet->Put( SfxInt32Item( nWID, SAL_STATIC_CAST( sal_Int32, eCat ))); + break; + } + case SCHATTR_STAT_INDICATE: + { + chart::ChartErrorIndicatorType eInd; + cppu::any2enum< chart::ChartErrorIndicatorType >( eInd, aValue ); + pSet->Put( SfxInt32Item( nWID, SAL_STATIC_CAST( sal_Int32, eInd ))); + break; + } + case SCHATTR_STAT_REGRESSTYPE: + { + chart::ChartRegressionCurveType eRegType; + cppu::any2enum< chart::ChartRegressionCurveType >( eRegType, aValue ); + pSet->Put( SfxInt32Item( nWID, SAL_STATIC_CAST( sal_Int32, eRegType ))); + break; + } + case CHATTR_DATA_SWITCH: + { + chart::ChartDataRowSource eRowSource; + cppu::any2enum< chart::ChartDataRowSource >( eRowSource, aValue ); + mpModel->ChangeSwitchData( (chart::ChartDataRowSource_COLUMNS == eRowSource) ); + return; + } + case SCHATTR_DATADESCR_DESCR: + { + // symbol + sal_Int32 nVal; + aValue >>= nVal; + pSet->Put( SfxBoolItem( SCHATTR_DATADESCR_SHOW_SYM, + ((nVal & chart::ChartDataCaption::SYMBOL) != 0)) ); + + // display text, percent or both or value + SvxChartDataDescr eDescr = CHDESCR_NONE; + if( nVal & chart::ChartDataCaption::TEXT ) + { + if( nVal & chart::ChartDataCaption::PERCENT ) + eDescr = CHDESCR_TEXTANDPERCENT; + else if( (nVal & chart::ChartDataCaption::VALUE) ) + eDescr = CHDESCR_TEXTANDVALUE; + else + eDescr = CHDESCR_TEXT; + } + else if( (nVal & chart::ChartDataCaption::VALUE) ) + { + eDescr = CHDESCR_VALUE; + } + else + { + if( (nVal & chart::ChartDataCaption::PERCENT) ) + eDescr = CHDESCR_PERCENT; + } + + // chart::ChartDataCaption::FORMAT (missing) + + pSet->Put( SvxChartDataDescrItem( eDescr ) ); + } + break; + + case XATTR_FILLBITMAP: + case XATTR_FILLGRADIENT: + case XATTR_FILLHATCH: + case XATTR_FILLFLOATTRANSPARENCE: + case XATTR_LINEEND: + case XATTR_LINESTART: + case XATTR_LINEDASH: + if( pMap->nMemberId == MID_NAME ) + { + ::rtl::OUString aStr; + if( aValue >>= aStr ) + SvxShape::SetFillAttribute( nWID, aStr, *pSet, mpModel ); + } + else + maPropSet.setPropertyValue( pMap, aValue, *pSet ); + break; + + case SCHATTR_STYLE_STACKED: + case SCHATTR_STYLE_PERCENT: + { + sal_Bool bSet; + aValue >>= bSet; + if( bSet ) + { + // setting of these two items is exclusive + BOOL bStacked = ( nWID == SCHATTR_STYLE_STACKED ); + + pSet->Put( SfxBoolItem( SCHATTR_STYLE_STACKED, bStacked )); + pSet->Put( SfxBoolItem( SCHATTR_STYLE_PERCENT, ! bStacked )); + } + else + { + // setting either of both properties to FALSE + // sets both to FALSE + pSet->Put( SfxBoolItem( SCHATTR_STYLE_STACKED, FALSE )); + pSet->Put( SfxBoolItem( SCHATTR_STYLE_PERCENT, FALSE )); + } + } + break; + + case SCHATTR_STYLE_DEEP: + { + sal_Bool bSet; + aValue >>= bSet; + + // if deep is turned on, 3d must also be set + if( bSet ) + { + pSet->Put( SfxBoolItem( SCHATTR_STYLE_3D, TRUE )); + } + pSet->Put( SfxBoolItem( SCHATTR_STYLE_DEEP, bSet )); + } + break; + + case SCHATTR_SYMBOL_BRUSH: + { + ::rtl::OUString aURL; + aValue >>= aURL; + BfGraphicObject aGraphObj = CreateGraphicObjectFromURL( aURL ); + SvxBrushItem aItem( SCHATTR_SYMBOL_BRUSH ); + aItem.SetGraphic( aGraphObj.GetGraphic() ); + pSet->Put( aItem ); + } + break; + + default: + maPropSet.setPropertyValue( pMap, aValue, *pSet ); + break; + } + aType.SetType( pSet ); + mpModel->PutAttr( *pSet ); + if( nWID == SCHATTR_SYMBOL_SIZE ) + { + mpModel->PutDataRowAttrAll( *pSet ); + } + + if( mpModel->ChangeChart( aType.GetChartStyle(), false )) + { + mpModel->BuildChart( FALSE ); + } + else if( ! mpModel->ChangeStatistics ( *pSet ) ) + { + mpModel->BuildChart( FALSE ); + } + } + else + { + throw beans::UnknownPropertyException(); + } + delete pSet; + } + else + { + throw beans::UnknownPropertyException(); + } + } + else + { + DBG_WARNING( "No Model" ); + } +} + +uno::Any SAL_CALL ChXDiagram::getPropertyValue( const ::rtl::OUString& PropertyName ) + throw( beans::UnknownPropertyException, + lang::WrappedTargetException, + uno::RuntimeException ) +{ + RTL_LOGFILE_CONTEXT (context, "sch (af119097) ::ChXDiagram::getPropertyValue"); + SolarMutexGuard aGuard; + + uno::Any aAny; + + if( mpModel ) + { + const SfxItemPropertyMap* pMap = maPropSet.getPropertyMapEntry( PropertyName ); + + if( pMap && pMap->nWID ) + { + USHORT nWID = pMap->nWID; + SfxItemSet* pSet; + + if( nWID == SCHATTR_STYLE_SHAPE && + ! mpModel->IsReal3D()) + return aAny; + + switch( nWID ) + { + case CHATTR_NUM_OF_LINES_FOR_BAR: + aAny <<= SAL_STATIC_CAST( sal_Int32, mpModel->GetNumLinesColChart() ); + return aAny; // RETURN + + case SCHATTR_DATADESCR_DESCR: + pSet = new SfxItemSet( mpModel->GetItemPool(), + SCHATTR_DATADESCR_DESCR, SCHATTR_DATADESCR_DESCR, + SCHATTR_DATADESCR_SHOW_SYM, SCHATTR_DATADESCR_SHOW_SYM, 0 ); + break; + + case CHATTR_SPLINE_ORDER: + // for some reason the value internally is one more + // ie order 1 is linear but is stores as 2 in the core + aAny <<= static_cast< sal_Int32 >( mpModel->SplineDepth() - 1 ); + return aAny; + + case CHATTR_SPLINE_RESOLUTION: + aAny <<= static_cast< sal_Int32 >( mpModel->Granularity() ); + return aAny; + + case CHATTR_ATTRIBUTED_DATA_POINTS: + aAny <<= mpModel->GetSetDataPointList(); + return aAny; + + default: + pSet = new SfxItemSet( mpModel->GetItemPool(), nWID, nWID ); + } + + // set attributes + if( nWID == SCHATTR_SYMBOL_BRUSH || + nWID == SCHATTR_SYMBOL_SIZE ) + { + mpModel->GetDataRowAttrAll( *pSet ); + } + else + { + ChartType aType( mpModel ); + aType.GetAttrSet( pSet ); + mpModel->GetAttr( *pSet ); // copy SHOW_HIDE_PROPERTIES into ItemSet + } + + if( ! pSet->Count() ) + { + // get default from ItemPool + if( mpModel->GetItemPool().IsWhich( nWID ) ) + { + if( ! ( OWN_ATTR_VALUE_START <= nWID && nWID <= OWN_ATTR_VALUE_END )) // properties from SvxShape + { + pSet->Put( mpModel->GetItemPool().GetDefaultItem( nWID ) ); + } + // 3d properties that have no corresponding item but come from drawing layer + else + { + //E3dPolyScene* mpModel->GetScene(); + E3dObject* pScene = lcl_GetScene( mpModel ); + if( pScene ) + { + if( nWID == OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX ) + { + const Matrix4D& aMtx = pScene->GetFullTransform(); + drawing::HomogenMatrix xHomMatrix; + MATRIX4D_TO_HOMOGEN_MATRIX( aMtx, xHomMatrix ); + aAny <<= xHomMatrix; + + return aAny; // RETURN + } + else if( nWID == OWN_ATTR_3D_VALUE_CAMERA_GEOMETRY ) + { + // get CameraGeometry from scene + E3dScene* pE3dScene = mpModel->GetScene(); + drawing::CameraGeometry aCamGeo; + + // fill Vectors from scene camera + B3dCamera& aCameraSet = pE3dScene->GetCameraSet(); + Vector3D aVRP = aCameraSet.GetVRP(); + Vector3D aVPN = aCameraSet.GetVPN(); + Vector3D aVUP = aCameraSet.GetVUV(); + + // transfer to structure + aCamGeo.vrp.PositionX = aVRP.X(); + aCamGeo.vrp.PositionY = aVRP.Y(); + aCamGeo.vrp.PositionZ = aVRP.Z(); + aCamGeo.vpn.DirectionX = aVPN.X(); + aCamGeo.vpn.DirectionY = aVPN.Y(); + aCamGeo.vpn.DirectionZ = aVPN.Z(); + aCamGeo.vup.DirectionX = aVUP.X(); + aCamGeo.vup.DirectionY = aVUP.Y(); + aCamGeo.vup.DirectionZ = aVUP.Z(); + + return uno::Any(&aCamGeo, ::getCppuType((const drawing::CameraGeometry*)0) ); + } + } + } + } + else + { +#ifdef DBG_UTIL + String aTmpString( PropertyName ); + ByteString aProp( aTmpString, RTL_TEXTENCODING_ASCII_US ); + DBG_ERROR2( "Diagram: Property %s has an invalid ID (%d)", aProp.GetBuffer(), nWID ); +#endif + } + } + + if( pSet->Count() ) + { + aAny = GetAnyByItem( *pSet, pMap ); + } + else + throw beans::UnknownPropertyException(); + + delete pSet; + } + else + throw beans::UnknownPropertyException(); + } + else + { + DBG_ERROR( "No Model" ); + } + return aAny; +} + +void SAL_CALL ChXDiagram::addPropertyChangeListener( const ::rtl::OUString& aPropertyName, + const uno::Reference< beans::XPropertyChangeListener >& xListener ) + throw( beans::UnknownPropertyException, + lang::WrappedTargetException, + uno::RuntimeException ) +{} + +void SAL_CALL ChXDiagram::removePropertyChangeListener( const ::rtl::OUString& aPropertyName, + const uno::Reference< beans::XPropertyChangeListener >& aListener ) + throw( beans::UnknownPropertyException, + lang::WrappedTargetException, + uno::RuntimeException ) +{} + +void SAL_CALL ChXDiagram::addVetoableChangeListener( const ::rtl::OUString& PropertyName, + const uno::Reference< beans::XVetoableChangeListener >& aListener ) + throw( beans::UnknownPropertyException, + lang::WrappedTargetException, + uno::RuntimeException ) +{} + +void SAL_CALL ChXDiagram::removeVetoableChangeListener( const ::rtl::OUString& PropertyName, + const uno::Reference< beans::XVetoableChangeListener >& aListener ) + throw( beans::UnknownPropertyException, + lang::WrappedTargetException, + uno::RuntimeException ) +{} + + +//===== XMultiPropertySet =================================================== + +void SAL_CALL ChXDiagram::setPropertyValues ( + const Sequence< ::rtl::OUString >& aPropertyNames, + const Sequence<Any >& aValues) + throw (beans::PropertyVetoException, + lang::IllegalArgumentException, + lang::WrappedTargetException, + uno::RuntimeException) +{ + RTL_LOGFILE_CONTEXT (context2, "sch (af119097) ::ChXDiagram::setPropertyValues"); +#if 1 + for (sal_Int32 i=0; i<aPropertyNames.getLength(); i++) + setPropertyValue (aPropertyNames[i], aValues[i]); +#endif +} + + +Sequence<Any> SAL_CALL ChXDiagram::getPropertyValues ( + const Sequence<OUString>& aPropertyNames) + throw (RuntimeException) +{ + RTL_LOGFILE_CONTEXT (context, "sch (af119097) ::ChXDiagram::getPropertyValues"); +#if 0 + uno::Sequence<uno::Any> aResult (aPropertyNames.getLength()); + + for (sal_Int32 i=0; i<aPropertyNames.getLength(); i++) + aResult[i] = getPropertyValue (aPropertyNames[i]); + + return aResult; +#else + SolarMutexGuard aGuard; + + // This sequence is filled with the requested values for the given property names. + Sequence<Any> aResult (aPropertyNames.getLength()); + + // Get pointers to first elements of lists. + const SfxItemPropertyMap * pProperty = maPropSet.getPropertyMap (); + const OUString * pPropertyName = aPropertyNames.getConstArray (); + Any * pPropertyValue = aResult.getArray (); + + // Check preconditions. + if (mpModel == NULL) + throw UnknownPropertyException (OUString ( + RTL_CONSTASCII_USTRINGPARAM ("No model in ::ChXDiagram::getPropertyValues")), + static_cast< ::cppu::OWeakObject*>(this)); + + // Get the models attributes. + SfxItemSet aAttributes (mpModel->GetItemPool(), + CHART_ROW_WHICHPAIRS, + OWN_ATTR_VALUE_START, OWN_ATTR_VALUE_END, + OWN_ATTR_FILLBMP_MODE, OWN_ATTR_FILLBMP_MODE, + SCHATTR_STOCK_VOLUME, SCHATTR_STOCK_UPDOWN, + CHATTR_START, CHATTR_END, + CHATTR_TMP_START, CHATTR_TMP_END, + 0); + + // if( nWID == SCHATTR_SYMBOL_BRUSH ) + mpModel->GetDataRowAttrAll (aAttributes); + // else + ChartType aType (mpModel); + aType.GetAttrSet (&aAttributes); + mpModel->GetAttr (aAttributes); + + // Used in the loop below. + USHORT nWID; + E3dObject* pScene = NULL; + BOOL bTryAgain; + OUString sMessage; + + // Iterate over all given property names. + sal_Int32 nCounter = aPropertyNames.getLength(); + while (nCounter-- > 0) + { + AdvanceToName (pProperty, pPropertyName); + + nWID = pProperty->nWID; + bTryAgain = TRUE; + + // Handling each property is divided into three steps: + // 1. Handle special cases that do not depend on items. + // 2. If the required item is not set, then try to get a + // default value. Handle 3D properties here. + // 3. Try again if the item is now set in the hope that its + // status has been changed in step 2. + + // Step 1 + if (nWID == SCHATTR_STYLE_SHAPE && ! mpModel->IsReal3D()) + { + // Leave the property value unchanged. + bTryAgain = FALSE; + } + else if (nWID == CHATTR_NUM_OF_LINES_FOR_BAR) + { + *pPropertyValue <<= static_cast<sal_Int32>(mpModel->GetNumLinesColChart()); + bTryAgain = FALSE; + } + else if( nWID == CHATTR_SPLINE_ORDER ) + { + // for some reason the value internally is one more + // ie order 1 is linear but is stores as 2 in the core + *pPropertyValue <<= static_cast< sal_Int32 >( mpModel->SplineDepth() - 1 ); + bTryAgain = FALSE; + } + else if( nWID == CHATTR_SPLINE_RESOLUTION ) + { + *pPropertyValue <<= static_cast< sal_Int32 >( mpModel->Granularity() ); + bTryAgain = FALSE; + } + + // Step 2 + else if (aAttributes.GetItemState (nWID, sal_False) != SFX_ITEM_SET) + { + bTryAgain = FALSE; + if ( ! mpModel->GetItemPool().IsWhich(nWID)) + { + } + else if (nWID < OWN_ATTR_VALUE_START || nWID > OWN_ATTR_VALUE_END) + { + // properties from SvxShape + aAttributes.Put (mpModel->GetItemPool().GetDefaultItem (nWID)); + // Set the flag to try again to read the item. + bTryAgain = TRUE; + } + else + { + if (pScene == NULL) + { + RTL_LOGFILE_CONTEXT_TRACE (context, "getting 3D scene"); + pScene = lcl_GetScene( mpModel ); + } + if (pScene != NULL) + if (nWID == OWN_ATTR_3D_VALUE_TRANSFORM_MATRIX) + { + const Matrix4D& aMtx = pScene->GetFullTransform(); + drawing::HomogenMatrix xHomMatrix; + MATRIX4D_TO_HOMOGEN_MATRIX (aMtx, xHomMatrix); + *pPropertyValue <<= xHomMatrix; + } + else if (nWID == OWN_ATTR_3D_VALUE_CAMERA_GEOMETRY) + { + // get CameraGeometry from scene + E3dScene* pE3dScene = mpModel->GetScene(); + + // fill Vectors from scene camera + B3dCamera& aCameraSet = pE3dScene->GetCameraSet(); + Vector3D aVRP = aCameraSet.GetVRP(); + Vector3D aVPN = aCameraSet.GetVPN(); + Vector3D aVUP = aCameraSet.GetVUV(); + + // transfer to structure + drawing::CameraGeometry aCamGeo; + aCamGeo.vrp.PositionX = aVRP.X(); + aCamGeo.vrp.PositionY = aVRP.Y(); + aCamGeo.vrp.PositionZ = aVRP.Z(); + aCamGeo.vpn.DirectionX = aVPN.X(); + aCamGeo.vpn.DirectionY = aVPN.Y(); + aCamGeo.vpn.DirectionZ = aVPN.Z(); + aCamGeo.vup.DirectionX = aVUP.X(); + aCamGeo.vup.DirectionY = aVUP.Y(); + aCamGeo.vup.DirectionZ = aVUP.Z(); + + *pPropertyValue = + Any (&aCamGeo, ::getCppuType((const drawing::CameraGeometry*)0)); + } + else + bTryAgain = TRUE; + } + } + + // Step3 + if (bTryAgain) + if (aAttributes.GetItemState (nWID, sal_False) == SFX_ITEM_SET) + { + *pPropertyValue = GetAnyByItem (aAttributes, pProperty); + } + else + { + // Construct a message for an exception but wait with throwing + // it until all known properies have been set. + if (sMessage.getLength() == 0) + { + sMessage = OUString (RTL_CONSTASCII_USTRINGPARAM ("Property ")); + sMessage += *pPropertyName; + sMessage += OUString ( + RTL_CONSTASCII_USTRINGPARAM (" is not known in :ChXDiagram::getPropertyValues")); + } +#ifdef DBG_UTIL + ByteString sName = ByteString(String(*pPropertyName), RTL_TEXTENCODING_ASCII_US); + DBG_ERROR2 ("Diagram: Property %s has an invalid ID (%d)", + sName.GetBuffer(), nWID); +#endif + } + +#if 0 + // Compare to result of original getPropertyValue. + // Used only for debugging. + if (*pPropertyValue != getPropertyValue (*pPropertyName)) + { + DBG_ERROR1 ("ChXDiagram::getPropertyValues : values differ for nWID %d", + nWID); + } +#endif + + // Advance to the next property, property name and value. + pPropertyName++; + pPropertyValue++; + } + + // Throw an exception if one of the properties was unknown. + if (sMessage.getLength() > 0) + throw UnknownPropertyException (sMessage, + static_cast< ::cppu::OWeakObject*>(this)); + + return aResult; +#endif +} + + +void SAL_CALL ChXDiagram::addPropertiesChangeListener ( + const Sequence<OUString >& aPropertyNames, + const Reference<beans::XPropertiesChangeListener >& xListener) + throw (RuntimeException) +{ + // Not implemented. +} + +void SAL_CALL ChXDiagram::removePropertiesChangeListener ( + const Reference<beans::XPropertiesChangeListener>& xListener) + throw (RuntimeException) +{ + // Not implemented. +} + + +void SAL_CALL ChXDiagram::firePropertiesChangeEvent ( + const Sequence<OUString >& aPropertyNames, + const Reference<beans::XPropertiesChangeListener >& xListener) + throw (RuntimeException) +{ + // Not implemented. +} + + + + +//===== XPropertyState ====================================================== + +beans::PropertyState SAL_CALL ChXDiagram::getPropertyState( const ::rtl::OUString& PropertyName ) + throw( beans::UnknownPropertyException, uno::RuntimeException ) +{ + if( mpModel ) + { + const SfxItemPropertyMap* pMap = maPropSet.getPropertyMapEntry( PropertyName ); + + if( pMap && pMap->nWID ) + { + switch( pMap->nWID ) + { + case SCHATTR_STYLE_PERCENT: + { + ChartType aType( mpModel ); + return ( aType.IsPercent() + ? beans::PropertyState_DIRECT_VALUE + : beans::PropertyState_DEFAULT_VALUE ); + } + break; + case SCHATTR_STYLE_STACKED: + { + ChartType aType( mpModel ); + return ( ( ! aType.IsPercent() && + aType.IsStacked()) + ? beans::PropertyState_DIRECT_VALUE + : beans::PropertyState_DEFAULT_VALUE ); + } + break; + + case CHATTR_SPLINE_ORDER: + case CHATTR_SPLINE_RESOLUTION: + { + ChartType aType( mpModel ); + return ( ( aType.HasSplines() ) + ? beans::PropertyState_DIRECT_VALUE + : beans::PropertyState_DEFAULT_VALUE ); + } + + case CHATTR_NUM_OF_LINES_FOR_BAR: + case SCHATTR_STYLE_SHAPE: + case SCHATTR_DATADESCR_DESCR: + break; + + default: + { + SolarMutexGuard aGuard; + + SfxItemSet aSet( mpModel->GetItemPool(), pMap->nWID, pMap->nWID ); + ChartType aType( mpModel ); + aType.GetAttrSet( &aSet ); + mpModel->GetAttr( aSet ); + + SfxItemState eState = aSet.GetItemState( pMap->nWID ); + if( eState == SFX_ITEM_DEFAULT ) + return beans::PropertyState_DEFAULT_VALUE; + else if( eState < SFX_ITEM_DEFAULT ) + return beans::PropertyState_AMBIGUOUS_VALUE; + else + return beans::PropertyState_DIRECT_VALUE; + } + } + } + } + + return beans::PropertyState_DIRECT_VALUE; +} + + +void SAL_CALL ChXDiagram::setPropertyToDefault( const ::rtl::OUString& PropertyName ) + throw( beans::UnknownPropertyException, + uno::RuntimeException ) +{ + SolarMutexGuard aGuard; + + const SfxItemPropertyMap* pMap = maPropSet.getPropertyMapEntry( PropertyName ); + + if( pMap && pMap->nWID && + ( pMap->nWID == CHATTR_NUM_OF_LINES_FOR_BAR || + pMap->nWID == CHATTR_SPLINE_ORDER || + pMap->nWID == CHATTR_SPLINE_RESOLUTION || + pMap->nWID == SCHATTR_STYLE_SHAPE || + pMap->nWID == SCHATTR_DATADESCR_DESCR )) + { + return; + } + + if( mpModel ) + { + SfxItemSet aSet( mpModel->GetItemPool(), pMap->nWID, pMap->nWID ); + ChartType aType( mpModel ); + aType.GetAttrSet( &aSet ); + mpModel->GetAttr( aSet ); + + aSet.ClearItem( pMap->nWID ); + + aType.SetType( &aSet ); + mpModel->PutAttr( aSet ); + + if( mpModel->ChangeChart( aType.GetChartStyle(), false )) + { + mpModel->BuildChart( FALSE ); + } + else if( ! mpModel->ChangeStatistics ( aSet ) ) + { + mpModel->BuildChart( FALSE ); + } + } +} + +uno::Any SAL_CALL ChXDiagram::getPropertyDefault( const ::rtl::OUString& aPropertyName ) + throw( beans::UnknownPropertyException, + lang::WrappedTargetException, + uno::RuntimeException ) +{ + const SfxItemPropertyMap* pMap = maPropSet.getPropertyMapEntry( aPropertyName ); + + if( pMap && pMap->nWID && + ( pMap->nWID == CHATTR_NUM_OF_LINES_FOR_BAR || + pMap->nWID == CHATTR_SPLINE_ORDER || + pMap->nWID == CHATTR_SPLINE_RESOLUTION || + pMap->nWID == SCHATTR_STYLE_SHAPE || + pMap->nWID == SCHATTR_DATADESCR_DESCR )) + { + return getPropertyValue( aPropertyName ); + } + + if( ! mpModel->GetItemPool().IsWhich( pMap->nWID )) + throw beans::UnknownPropertyException(); + + SfxItemSet aSet( mpModel->GetItemPool(), pMap->nWID, pMap->nWID ); + aSet.Put( mpModel->GetItemPool().GetDefaultItem( pMap->nWID )); + + return GetAnyByItem( aSet, pMap ); +} + + + + +//==== XMultiPropertyStates ================================================= + +Sequence<PropertyState> SAL_CALL ChXDiagram::getPropertyStates ( + const Sequence<OUString >& aPropertyName) + throw (beans::UnknownPropertyException, + uno::RuntimeException) +{ + SolarMutexGuard aGuard; + +#if 0 + // Old implementation. + + const sal_Int32 nCount = aPropertyName.getLength(); + const ::rtl::OUString* pNames = aPropertyName.getConstArray(); + + uno::Sequence< beans::PropertyState > aRet( nCount ); + beans::PropertyState* pState = aRet.getArray(); + + for( sal_Int32 nIdx = 0; nIdx < nCount; nIdx++ ) + pState[ nIdx ] = getPropertyState( pNames[ nIdx ] ); + + return aRet; + +#else + + // New implementation. + + // Setup arrays of property names and states for easier iteration. + sal_Int32 nPropertyCount = aPropertyName.getLength(); + const OUString* pPropertyName = aPropertyName.getConstArray(); + Sequence<PropertyState> aPropertyStates (nPropertyCount); + PropertyState* pPropertyState = aPropertyStates.getArray(); + const SfxItemPropertyMap * pProperty = maPropSet.getPropertyMap (); + + // Check preconditions. + if (mpModel == NULL) + return aPropertyStates; + + // Get the models attributes. + ChartType aType (mpModel); +// SfxItemSet aAttributes (mpModel->GetItemPool(), +// mpModel->GetAttr (mnWhichId, mnIndex).GetRanges()); + // This needs still a bit of work. What is the best set of which id ranges? + SfxItemSet aAttributes (mpModel->GetItemPool(), + CHART_ROW_WHICHPAIRS, + OWN_ATTR_FILLBMP_MODE, OWN_ATTR_FILLBMP_MODE, // 3945 bf_svx/unoshprp.hxx + 30689,30689, // RID_SCH_START + 177 ? + 30720,30720, // RID_SCH_START + 208 ? + SCHATTR_STOCK_VOLUME, SCHATTR_STOCK_UPDOWN, + 0); + aType.GetAttrSet (&aAttributes); + mpModel->GetAttr (aAttributes); + + // Variable used in the loop below. + USHORT nWID; + // Setting this error message to a non empty string results throwing an exception + // after the main loop has finished. + OUString sErrorMessage; + + // Iterate over all given property names. + while (nPropertyCount-- > 0) + { + AdvanceToName (pProperty, pPropertyName); + + switch (nWID = pProperty->nWID) + { + case SCHATTR_STYLE_PERCENT: + if (aType.IsPercent()) + *pPropertyState = PropertyState_DIRECT_VALUE; + else + *pPropertyState = PropertyState_DEFAULT_VALUE; + break; + + case SCHATTR_STYLE_STACKED: + if (aType.IsStacked() && ! aType.IsPercent()) + *pPropertyState = PropertyState_DIRECT_VALUE; + else + *pPropertyState = PropertyState_DEFAULT_VALUE; + break; + + case CHATTR_SPLINE_ORDER: + case CHATTR_SPLINE_RESOLUTION: + if( aType.HasSplines()) + *pPropertyState = PropertyState_DIRECT_VALUE; + else + *pPropertyState = PropertyState_DEFAULT_VALUE; + break; + + case CHATTR_NUM_OF_LINES_FOR_BAR: + case SCHATTR_STYLE_SHAPE: + case SCHATTR_DATADESCR_DESCR: + *pPropertyState = PropertyState_DIRECT_VALUE; + break; + + default: + switch (aAttributes.GetItemState (nWID, sal_False)) + { + case SFX_ITEM_DONTCARE: + case SFX_ITEM_DISABLED: + *pPropertyState = PropertyState_AMBIGUOUS_VALUE; + break; + + case SFX_ITEM_READONLY: + case SFX_ITEM_SET: + *pPropertyState = PropertyState_DIRECT_VALUE; + break; + + case SFX_ITEM_DEFAULT: + *pPropertyState = PropertyState_DEFAULT_VALUE; + break; + + case SFX_ITEM_UNKNOWN: + default: + // Set the error message so that it can be used + // to create an exception object after the loop + // has finished. + // The exception is not thrown here in order + // to first process as many properties as possible. + // All unknown properties following the first one + // are ignored. + DBG_ERROR1 ("nWID %d not in property set", nWID); + if (sErrorMessage.getLength() == 0) + { + sErrorMessage = OUString ( + RTL_CONSTASCII_USTRINGPARAM ("Chart Object: Unknown Property ")); + sErrorMessage += *pPropertyName; + } + } + } + pPropertyName ++; + pPropertyState ++; + } + + // Now throw an exception if there has been an unknown property. + if (sErrorMessage.getLength() > 0) + throw UnknownPropertyException (sErrorMessage, + static_cast< ::cppu::OWeakObject*>(this)); + + return aPropertyStates; +#endif +} + + +void SAL_CALL ChXDiagram::setAllPropertiesToDefault (void) + throw (RuntimeException) +{ + DBG_ERROR ("ChXChartObject::setAllPropertiesToDefault"); +} + + +void SAL_CALL ChXDiagram::setPropertiesToDefault ( + const Sequence<OUString >& aPropertyNames) + throw (beans::UnknownPropertyException, + RuntimeException) +{ + for (sal_Int32 i=0; i<aPropertyNames.getLength(); i++) + { + setPropertyToDefault (aPropertyNames[i]); + } +} + + +Sequence<Any> SAL_CALL ChXDiagram::getPropertyDefaults ( + const Sequence<OUString>& aPropertyNames) + throw (beans::UnknownPropertyException, + lang::WrappedTargetException, + RuntimeException) +{ + Sequence<Any> aResult (aPropertyNames.getLength()); + + for (sal_Int32 i=0; i<aPropertyNames.getLength(); i++) + { + aResult[i] = getPropertyDefault (aPropertyNames[i]); + } + + return aResult; +} + + + +//===== XServiceInfo ======================================================== +::rtl::OUString SAL_CALL ChXDiagram::getImplementationName() throw( uno::RuntimeException ) +{ + return SCH_ASCII_TO_OU( "ChXDiagram" ); +} + +sal_Bool SAL_CALL ChXDiagram::supportsService( const ::rtl::OUString& ServiceName ) + throw( uno::RuntimeException ) +{ + return SvxServiceInfoHelper::supportsService( ServiceName, getSupportedServiceNames() ); +} + +uno::Sequence< ::rtl::OUString > SAL_CALL ChXDiagram::getSupportedServiceNames() throw( uno::RuntimeException ) +{ + uno::Sequence< ::rtl::OUString > aSeq; + SvxServiceInfoHelper::addToSequence( + aSeq, 2, + "com.sun.star.chart.Diagram", + "com.sun.star.xml.UserDefinedAttributeSupplier" ); + if( mpModel ) + { + long nType = mpModel->GetBaseType(); + switch( nType ) + { + case CHTYPE_LINE: + SvxServiceInfoHelper::addToSequence( + aSeq, 9, + "com.sun.star.chart.LineDiagram", + "com.sun.star.chart.ChartStatistics", + "com.sun.star.chart.ChartAxisXSupplier", + "com.sun.star.chart.ChartTwoAxisXSupplier", + "com.sun.star.chart.ChartAxisYSupplier", + "com.sun.star.chart.ChartTwoAxisYSupplier", + "com.sun.star.chart.StackableDiagram", + "com.sun.star.chart.Dim3DDiagram", + "com.sun.star.chart.ChartAxisZSupplier" ); + // Note: the required properties and interfaces and therefore the + // service itself is always available +// if( mpModel->Is3DChart() ) +// SvxServiceInfoHelper::addToSequence( aSeq, 1, "com.sun.star.chart.ChartAxisZSupplier" ); + break; + case CHTYPE_AREA: + SvxServiceInfoHelper::addToSequence( + aSeq, 9, + "com.sun.star.chart.AreaDiagram", + "com.sun.star.chart.ChartStatistics", + "com.sun.star.chart.ChartAxisXSupplier", + "com.sun.star.chart.ChartTwoAxisXSupplier", + "com.sun.star.chart.ChartAxisYSupplier", + "com.sun.star.chart.ChartTwoAxisYSupplier", + "com.sun.star.chart.StackableDiagram", + "com.sun.star.chart.Dim3DDiagram", + "com.sun.star.chart.ChartAxisZSupplier" ); + // Note: the required properties and interfaces and therefore the + // service itself is always available +// if( mpModel->Is3DChart() ) +// SvxServiceInfoHelper::addToSequence( aSeq, 1, "com.sun.star.chart.ChartAxisZSupplier" ); + break; + case CHTYPE_DONUT : + SvxServiceInfoHelper::addToSequence( aSeq, 1, "com.sun.star.chart.DonutDiagram" ); + break; + case CHTYPE_COLUMN : // also treated as bar chart + case CHTYPE_BAR : + SvxServiceInfoHelper::addToSequence( + aSeq, 9, + "com.sun.star.chart.BarDiagram", + "com.sun.star.chart.ChartStatistics", + "com.sun.star.chart.ChartAxisXSupplier", + "com.sun.star.chart.ChartTwoAxisXSupplier", + "com.sun.star.chart.ChartAxisYSupplier", + "com.sun.star.chart.ChartTwoAxisYSupplier", + "com.sun.star.chart.StackableDiagram", + "com.sun.star.chart.Dim3DDiagram", + "com.sun.star.chart.ChartAxisZSupplier" ); + // Note: the required properties and interfaces and therefore the + // service itself is always available +// if( mpModel->Is3DChart() ) +// SvxServiceInfoHelper::addToSequence(aSeq, 1, "com.sun.star.chart.ChartAxisZSupplier" ); + break; + case CHTYPE_CIRCLE : + SvxServiceInfoHelper::addToSequence( + aSeq, 2, + "com.sun.star.chart.PieDiagram", + "com.sun.star.chart.Dim3DDiagram"); + break; + case CHTYPE_XY : + SvxServiceInfoHelper::addToSequence( + aSeq, 7, + "com.sun.star.chart.XYDiagram", + "com.sun.star.chart.LineDiagram", + "com.sun.star.chart.ChartStatistics", + "com.sun.star.chart.ChartAxisXSupplier", + "com.sun.star.chart.ChartTwoAxisXSupplier", + "com.sun.star.chart.ChartAxisYSupplier", + "com.sun.star.chart.ChartTwoAxisYSupplier" ); + break; + case CHTYPE_NET : + SvxServiceInfoHelper::addToSequence( + aSeq, 3, + "com.sun.star.chart.NetDiagram", + "com.sun.star.chart.StackableDiagram", + "com.sun.star.chart.ChartAxisYSupplier" ); + break; + case CHTYPE_STOCK : + SvxServiceInfoHelper::addToSequence( + aSeq, 6, + "com.sun.star.chart.StockDiagram", + "com.sun.star.chart.ChartStatistics", + "com.sun.star.chart.ChartAxisXSupplier", + "com.sun.star.chart.ChartTwoAxisXSupplier", + "com.sun.star.chart.ChartAxisYSupplier", + "com.sun.star.chart.ChartTwoAxisYSupplier" ); + break; + } + } + else + { + DBG_ERROR( "No Model" ); + } + + return aSeq; +} + +// XUnoTunnel +sal_Int64 SAL_CALL ChXDiagram::getSomething( const uno::Sequence< sal_Int8 >& aIdentifier ) + throw( uno::RuntimeException ) +{ + if( aIdentifier.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), + aIdentifier.getConstArray(), 16 ) ) + { + return (sal_Int64)this; + } + return 0; +} + +// XComponent +void SAL_CALL ChXDiagram::dispose() throw( uno::RuntimeException ) +{ + SolarMutexGuard aGuard; + + const int nMemberListSize = 19; + const uno::Reference<uno::XInterface> xMemberList[nMemberListSize] = { + mxXAxisTitle, mxYAxisTitle, mxZAxisTitle, + mxXAxis, mxYAxis, mxZAxis, mxSecXAxis, mxSecYAxis, + mxMajorGridX, mxMajorGridY, mxMajorGridZ, + mxMinorGridX, mxMinorGridY, mxMinorGridZ, + mxMinMaxLine, mxUpBar, mxDownBar, + mxWall, mxFloor}; + for (int i=0; i<nMemberListSize; i++) + if (xMemberList[i].is()) + { + uno::Reference<lang::XComponent> xComponent (xMemberList[i], uno::UNO_QUERY); + if (xComponent.is()) + { + xComponent->dispose(); + xComponent->removeEventListener (this); + } + } + + ::com::sun::star::lang::EventObject aEvent (*this); + maListenerList.disposeAndClear (aEvent); +} + +void SAL_CALL ChXDiagram::addEventListener( const uno::Reference< lang::XEventListener >& xListener ) + throw( uno::RuntimeException ) +{ + maListenerList.addInterface (xListener); +} + +void SAL_CALL ChXDiagram::removeEventListener( const uno::Reference< lang::XEventListener >& xListener ) + throw( uno::RuntimeException ) +{ + maListenerList.removeInterface (xListener); +} + + + + +// XEventListener +void SAL_CALL ChXDiagram::disposing (const ::com::sun::star::lang::EventObject & Source) + throw (uno::RuntimeException) +{ + if (Source.Source == mxXAxisTitle) + mxXAxisTitle = NULL; + else if (Source.Source == mxYAxisTitle) + mxYAxisTitle = NULL; + else if (Source.Source == mxZAxisTitle) + mxZAxisTitle = NULL; + else if (Source.Source == mxXAxis) + mxXAxis = NULL; + else if (Source.Source == mxYAxis) + mxYAxis = NULL; + else if (Source.Source == mxZAxis) + mxZAxis = NULL; + else if (Source.Source == mxSecXAxis) + mxSecXAxis = NULL; + else if (Source.Source == mxSecYAxis) + mxSecYAxis = NULL; + else if (Source.Source == mxMajorGridX) + mxMajorGridX = NULL; + else if (Source.Source == mxMajorGridY) + mxMajorGridY = NULL; + else if (Source.Source == mxMajorGridZ) + mxMajorGridZ = NULL; + else if (Source.Source == mxMinorGridX) + mxMinorGridX = NULL; + else if (Source.Source == mxMinorGridY) + mxMinorGridY = NULL; + else if (Source.Source == mxMinorGridZ) + mxMinorGridZ = NULL; + else if (Source.Source == mxMinMaxLine) + mxMinMaxLine = NULL; + else if (Source.Source == mxUpBar) + mxUpBar = NULL; + else if (Source.Source == mxDownBar) + mxDownBar = NULL; + else if (Source.Source == mxWall) + mxWall = NULL; + else if (Source.Source == mxFloor) + mxFloor = NULL; +} + + + +//===== protected methods ======================================================================= + +void ChXDiagram::AdvanceToName (const SfxItemPropertyMap *& pProperty, + const OUString * pPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException) +{ + sal_Int32 nComparisonResult; + + // Advance over the property list to the property with the current name. + while ((nComparisonResult=pPropertyName->compareToAscii (pProperty->pName)) > 0) + { + pProperty++; + if (pProperty->pName == NULL) + { + // We reached the end of the property list. Therefore all remaining given + // property names can not be found. + OUString sMessage = OUString ( + RTL_CONSTASCII_USTRINGPARAM ("ChXChartObject::setPropertyValues: unknown property ")); + sMessage += *pPropertyName; + throw UnknownPropertyException (sMessage, (::cppu::OWeakObject*)this); + } + } + if (nComparisonResult < 0) + { + // All remaining given property names can not match any of the remaining properties + // because they lie alphabetically before them => Error + OUString sMessage = OUString ( + RTL_CONSTASCII_USTRINGPARAM ("ChXChartObject::setPropertyValues: unknown property ")); + sMessage += *pPropertyName; + throw UnknownPropertyException (sMessage, (::cppu::OWeakObject*)this); + } + + // If we reach this line then we have found the property with the name pPropertyName. +} + + +} //namespace binfilter + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/unoidl/sch_ChartArea.cxx b/binfilter/bf_sch/source/ui/unoidl/sch_ChartArea.cxx new file mode 100644 index 000000000000..9ac4e6674b05 --- /dev/null +++ b/binfilter/bf_sch/source/ui/unoidl/sch_ChartArea.cxx @@ -0,0 +1,121 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 "ChartArea.hxx" + +#include "mapprov.hxx" + +// header for class OGuard +#include <osl/mutex.hxx> +// header for class Application +#include <vcl/svapp.hxx> +#include <rtl/uuid.h> +namespace binfilter { + +using namespace ::com::sun::star; + +ChartArea::ChartArea( ChartModel* pModel, sal_Int32 nObjectId ) : + ChXChartObject( CHMAP_AREA, pModel, nObjectId ) +{ +} + +ChartArea::~ChartArea() +{} + +// XServiceInfo +::rtl::OUString SAL_CALL ChartArea::getImplementationName() + throw( uno::RuntimeException ) +{ + return ::rtl::OUString::createFromAscii( "ChartArea" ); +} + +uno::Sequence< ::rtl::OUString > SAL_CALL ChartArea::getSupportedServiceNames() + throw( uno::RuntimeException ) +{ + SolarMutexGuard aGuard; + + uno::Sequence< ::rtl::OUString > aSeq( 4 ); + aSeq[ 0 ] = ::rtl::OUString::createFromAscii( "com.sun.star.chart.ChartArea" ); + aSeq[ 1 ] = ::rtl::OUString::createFromAscii( "com.sun.star.drawing.LineProperties" ); + aSeq[ 2 ] = ::rtl::OUString::createFromAscii( "com.sun.star.drawing.FillProperties" ); + aSeq[ 3 ] = ::rtl::OUString::createFromAscii( "com.sun.star.xml.UserDefinedAttributeSupplier" ); + + return aSeq; +} + +// XTypeProvider +uno::Sequence< sal_Int8 > SAL_CALL ChartArea::getImplementationId() + throw( uno::RuntimeException ) +{ + static uno::Sequence< sal_Int8 > aId; + if( aId.getLength() == 0 ) + { + aId.realloc( 16 ); + rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True ); + } + return aId; +} + +// XShapeDescriptor +::rtl::OUString SAL_CALL ChartArea::getShapeType() + throw( uno::RuntimeException ) +{ + return ::rtl::OUString::createFromAscii( "com.sun.star.chart.ChartArea" ); +} + +// XUnoTunnel +sal_Int64 SAL_CALL ChartArea::getSomething( const uno::Sequence< sal_Int8 >& aIdentifier ) + throw( uno::RuntimeException ) +{ + if( aIdentifier.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), + aIdentifier.getConstArray(), 16 ) ) + { + return (sal_Int64)this; + } + return ChXChartObject::getSomething( aIdentifier ); +} + +// helpers for XUnoTunnel +const uno::Sequence< sal_Int8 > & ChartArea::getUnoTunnelId() throw() +{ + static uno::Sequence< sal_Int8 > * pSeq = 0; + if( !pSeq ) + { + osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); + if( !pSeq ) + { + static uno::Sequence< sal_Int8 > aSeq( 16 ); + rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True ); + pSeq = &aSeq; + } + } + return *pSeq; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/unoidl/sch_ChartGrid.cxx b/binfilter/bf_sch/source/ui/unoidl/sch_ChartGrid.cxx new file mode 100644 index 000000000000..48b86498f4dc --- /dev/null +++ b/binfilter/bf_sch/source/ui/unoidl/sch_ChartGrid.cxx @@ -0,0 +1,120 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 "ChartGrid.hxx" + +#include "mapprov.hxx" + +// header for class OGuard +#include <osl/mutex.hxx> +// header for class Application +#include <vcl/svapp.hxx> +#include <rtl/uuid.h> +namespace binfilter { + +using namespace ::com::sun::star; + +ChartGrid::ChartGrid( ChartModel* pModel, sal_Int32 nObjectId ) : + ChXChartObject( CHMAP_LINE, pModel, nObjectId ) +{ +} + +ChartGrid::~ChartGrid() +{} + +// XServiceInfo +::rtl::OUString SAL_CALL ChartGrid::getImplementationName() + throw( uno::RuntimeException ) +{ + return ::rtl::OUString::createFromAscii( "ChartGrid" ); +} + +uno::Sequence< ::rtl::OUString > SAL_CALL ChartGrid::getSupportedServiceNames() + throw( uno::RuntimeException ) +{ + SolarMutexGuard aGuard; + + uno::Sequence< ::rtl::OUString > aSeq( 3 ); + aSeq[ 0 ] = ::rtl::OUString::createFromAscii( "com.sun.star.chart.ChartGrid" ); + aSeq[ 1 ] = ::rtl::OUString::createFromAscii( "com.sun.star.drawing.LineProperties" ); + aSeq[ 2 ] = ::rtl::OUString::createFromAscii( "com.sun.star.xml.UserDefinedAttributeSupplier" ); + + return aSeq; +} + +// XTypeProvider +uno::Sequence< sal_Int8 > SAL_CALL ChartGrid::getImplementationId() + throw( uno::RuntimeException ) +{ + static uno::Sequence< sal_Int8 > aId; + if( aId.getLength() == 0 ) + { + aId.realloc( 16 ); + rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True ); + } + return aId; +} + +// XShapeDescriptor +::rtl::OUString SAL_CALL ChartGrid::getShapeType() + throw( uno::RuntimeException ) +{ + return ::rtl::OUString::createFromAscii( "com.sun.star.chart.ChartGrid" ); +} + +// XUnoTunnel +sal_Int64 SAL_CALL ChartGrid::getSomething( const uno::Sequence< sal_Int8 >& aIdentifier ) + throw( uno::RuntimeException ) +{ + if( aIdentifier.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), + aIdentifier.getConstArray(), 16 ) ) + { + return (sal_Int64)this; + } + return ChXChartObject::getSomething( aIdentifier ); +} + +// helpers for XUnoTunnel +const uno::Sequence< sal_Int8 > & ChartGrid::getUnoTunnelId() throw() +{ + static uno::Sequence< sal_Int8 > * pSeq = 0; + if( !pSeq ) + { + osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); + if( !pSeq ) + { + static uno::Sequence< sal_Int8 > aSeq( 16 ); + rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True ); + pSeq = &aSeq; + } + } + return *pSeq; +} + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/unoidl/sch_ChartLegend.cxx b/binfilter/bf_sch/source/ui/unoidl/sch_ChartLegend.cxx new file mode 100644 index 000000000000..a0ab36e0ed6e --- /dev/null +++ b/binfilter/bf_sch/source/ui/unoidl/sch_ChartLegend.cxx @@ -0,0 +1,122 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 "ChartLegend.hxx" +#include "mapprov.hxx" +#include "defines.hxx" + +// header for class OGuard +#include <osl/mutex.hxx> +// header for class Application +#include <vcl/svapp.hxx> +#include <rtl/uuid.h> +namespace binfilter { + +using namespace ::com::sun::star; + +ChartLegend::ChartLegend( ChartModel* pModel ) : + ChXChartObject( CHMAP_LEGEND, pModel, CHOBJID_LEGEND ) +{ +} + +ChartLegend::~ChartLegend() +{} + +// XServiceInfo +::rtl::OUString SAL_CALL ChartLegend::getImplementationName() + throw( uno::RuntimeException ) +{ + return ::rtl::OUString::createFromAscii( "ChartLegend" ); +} + +uno::Sequence< ::rtl::OUString > SAL_CALL ChartLegend::getSupportedServiceNames() + throw( uno::RuntimeException ) +{ + SolarMutexGuard aGuard; + + uno::Sequence< ::rtl::OUString > aSeq( 6 ); + aSeq[ 0 ] = ::rtl::OUString::createFromAscii( "com.sun.star.chart.ChartLegend" ); + aSeq[ 1 ] = ::rtl::OUString::createFromAscii( "com.sun.star.style.CharacterProperties" ); + aSeq[ 2 ] = ::rtl::OUString::createFromAscii( "com.sun.star.drawing.FillProperties" ); + aSeq[ 3 ] = ::rtl::OUString::createFromAscii( "com.sun.star.drawing.LineProperties" ); + aSeq[ 4 ] = ::rtl::OUString::createFromAscii( "com.sun.star.drawing.Shape" ); + aSeq[ 5 ] = ::rtl::OUString::createFromAscii( "com.sun.star.xml.UserDefinedAttributeSupplier" ); + + return aSeq; +} + +// XTypeProvider +uno::Sequence< sal_Int8 > SAL_CALL ChartLegend::getImplementationId() + throw( uno::RuntimeException ) +{ + static uno::Sequence< sal_Int8 > aId; + if( aId.getLength() == 0 ) + { + aId.realloc( 16 ); + rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True ); + } + return aId; +} + +// XShapeDescriptor +::rtl::OUString SAL_CALL ChartLegend::getShapeType() + throw( uno::RuntimeException ) +{ + return ::rtl::OUString::createFromAscii( "com.sun.star.chart.ChartLegend" ); +} + +// XUnoTunnel +sal_Int64 SAL_CALL ChartLegend::getSomething( const uno::Sequence< sal_Int8 >& aIdentifier ) + throw( uno::RuntimeException ) +{ + if( aIdentifier.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), + aIdentifier.getConstArray(), 16 ) ) + { + return (sal_Int64)this; + } + return ChXChartObject::getSomething( aIdentifier ); +} + +// helpers for XUnoTunnel +const uno::Sequence< sal_Int8 > & ChartLegend::getUnoTunnelId() throw() +{ + static uno::Sequence< sal_Int8 > * pSeq = 0; + if( !pSeq ) + { + osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); + if( !pSeq ) + { + static uno::Sequence< sal_Int8 > aSeq( 16 ); + rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True ); + pSeq = &aSeq; + } + } + return *pSeq; +} +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/unoidl/sch_ChartLine.cxx b/binfilter/bf_sch/source/ui/unoidl/sch_ChartLine.cxx new file mode 100644 index 000000000000..27eb421097a1 --- /dev/null +++ b/binfilter/bf_sch/source/ui/unoidl/sch_ChartLine.cxx @@ -0,0 +1,119 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 "ChartLine.hxx" + +#include "mapprov.hxx" + +// header for class OGuard +#include <osl/mutex.hxx> +// header for class Application +#include <vcl/svapp.hxx> +#include <rtl/uuid.h> +namespace binfilter { + +using namespace ::com::sun::star; + +ChartLine::ChartLine( ChartModel* pModel, sal_Int32 nObjectId, sal_Int32 nIndex ) : + ChXChartObject( CHMAP_LINE, pModel, nObjectId, nIndex ) +{ +} + +ChartLine::~ChartLine() +{} + +// XServiceInfo +::rtl::OUString SAL_CALL ChartLine::getImplementationName() + throw( uno::RuntimeException ) +{ + return ::rtl::OUString::createFromAscii( "ChartLine" ); +} + +uno::Sequence< ::rtl::OUString > SAL_CALL ChartLine::getSupportedServiceNames() + throw( uno::RuntimeException ) +{ + SolarMutexGuard aGuard; + + uno::Sequence< ::rtl::OUString > aSeq( 3 ); + aSeq[ 0 ] = ::rtl::OUString::createFromAscii( "com.sun.star.chart.ChartLine" ); + aSeq[ 1 ] = ::rtl::OUString::createFromAscii( "com.sun.star.drawing.LineProperties" ); + aSeq[ 2 ] = ::rtl::OUString::createFromAscii( "com.sun.star.xml.UserDefinedAttributeSupplier" ); + + return aSeq; +} + +// XTypeProvider +uno::Sequence< sal_Int8 > SAL_CALL ChartLine::getImplementationId() + throw( uno::RuntimeException ) +{ + static uno::Sequence< sal_Int8 > aId; + if( aId.getLength() == 0 ) + { + aId.realloc( 16 ); + rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True ); + } + return aId; +} + +// XShapeDescriptor +::rtl::OUString SAL_CALL ChartLine::getShapeType() + throw( uno::RuntimeException ) +{ + return ::rtl::OUString::createFromAscii( "com.sun.star.chart.ChartLine" ); +} + +// XUnoTunnel +sal_Int64 SAL_CALL ChartLine::getSomething( const uno::Sequence< sal_Int8 >& aIdentifier ) + throw( uno::RuntimeException ) +{ + if( aIdentifier.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), + aIdentifier.getConstArray(), 16 ) ) + { + return (sal_Int64)this; + } + return ChXChartObject::getSomething( aIdentifier ); +} + +// helpers for XUnoTunnel +const uno::Sequence< sal_Int8 > & ChartLine::getUnoTunnelId() throw() +{ + static uno::Sequence< sal_Int8 > * pSeq = 0; + if( !pSeq ) + { + osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); + if( !pSeq ) + { + static uno::Sequence< sal_Int8 > aSeq( 16 ); + rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True ); + pSeq = &aSeq; + } + } + return *pSeq; +} +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/unoidl/sch_ChartTitle.cxx b/binfilter/bf_sch/source/ui/unoidl/sch_ChartTitle.cxx new file mode 100644 index 000000000000..fe5760b68013 --- /dev/null +++ b/binfilter/bf_sch/source/ui/unoidl/sch_ChartTitle.cxx @@ -0,0 +1,184 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 "ChartTitle.hxx" + +#include "mapprov.hxx" + +// header for class OGuard +// header for class Application +#include <vcl/svapp.hxx> +#include <rtl/uuid.h> + +#include "schattr.hxx" +#ifndef _SVX_CHRTITEM_HXX //autogen +#define ITEMID_CHARTTEXTORIENT SCHATTR_TEXT_ORIENT + +#include <bf_svtools/eitem.hxx> + +#endif +#include "globfunc.hxx" +namespace binfilter { + +using namespace ::com::sun::star; + +ChartTitle::ChartTitle( ChartModel* pModel, sal_Int32 nObjectId ) : + ChXChartObject( CHMAP_TITLE, pModel, nObjectId ) +{ +} + +ChartTitle::~ChartTitle() +{} + +// XServiceInfo +::rtl::OUString SAL_CALL ChartTitle::getImplementationName() + throw( uno::RuntimeException ) +{ + return ::rtl::OUString::createFromAscii( "ChartTitle" ); +} + +uno::Sequence< ::rtl::OUString > SAL_CALL ChartTitle::getSupportedServiceNames() + throw( uno::RuntimeException ) +{ + SolarMutexGuard aGuard; + + uno::Sequence< ::rtl::OUString > aSeq( 4 ); + aSeq[ 0 ] = ::rtl::OUString::createFromAscii( "com.sun.star.chart.ChartTitle" ); + aSeq[ 1 ] = ::rtl::OUString::createFromAscii( "com.sun.star.drawing.Shape" ); + aSeq[ 2 ] = ::rtl::OUString::createFromAscii( "com.sun.star.style.CharacterProperties" ); + aSeq[ 3 ] = ::rtl::OUString::createFromAscii( "com.sun.star.xml.UserDefinedAttributeSupplier" ); + + return aSeq; +} + +// XTypeProvider +uno::Sequence< sal_Int8 > SAL_CALL ChartTitle::getImplementationId() + throw( uno::RuntimeException ) +{ + static uno::Sequence< sal_Int8 > aId; + if( aId.getLength() == 0 ) + { + aId.realloc( 16 ); + rtl_createUuid( (sal_uInt8 *)aId.getArray(), 0, sal_True ); + } + return aId; +} + +// XShapeDescriptor +::rtl::OUString SAL_CALL ChartTitle::getShapeType() + throw( uno::RuntimeException ) +{ + return ::rtl::OUString::createFromAscii( "com.sun.star.chart.ChartTitle" ); +} + +// XUnoTunnel +sal_Int64 SAL_CALL ChartTitle::getSomething( const uno::Sequence< sal_Int8 >& aIdentifier ) + throw( uno::RuntimeException ) +{ + if( aIdentifier.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), + aIdentifier.getConstArray(), 16 ) ) + { + return (sal_Int64)this; + } + return ChXChartObject::getSomething( aIdentifier ); +} + +// helpers for XUnoTunnel +const uno::Sequence< sal_Int8 > & ChartTitle::getUnoTunnelId() throw() +{ + static uno::Sequence< sal_Int8 > * pSeq = 0; + if( !pSeq ) + { + osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); + if( !pSeq ) + { + static uno::Sequence< sal_Int8 > aSeq( 16 ); + rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True ); + pSeq = &aSeq; + } + } + return *pSeq; +} + +void ChartTitle::GetPropertyValue( const SfxItemPropertyMap & rProperty, + ::com::sun::star::uno::Any & rValue, + SfxItemSet & rAttributes ) +{ + switch( rProperty.nWID ) + { + // Axis title rotation angle. + case SCHATTR_TEXT_DEGREES: + { + // Automatic text orientation is changed into corresponding + // rotation angle. + SvxChartTextOrient eOrientation = + ((const SvxChartTextOrientItem&)rAttributes.Get( + SCHATTR_TEXT_ORIENT)).GetValue(); + if (eOrientation == CHTXTORIENT_AUTOMATIC) + { + switch (mnWhichId) + { + case CHOBJID_DIAGRAM_TITLE_X_AXIS: + if (mpModel->IsXVertikal()) + eOrientation = CHTXTORIENT_BOTTOMTOP; + else + eOrientation = CHTXTORIENT_AUTOMATIC; + break; + + case CHOBJID_DIAGRAM_TITLE_Y_AXIS: + if (mpModel->IsXVertikal()) + eOrientation = CHTXTORIENT_AUTOMATIC; + else + eOrientation = CHTXTORIENT_BOTTOMTOP; + break; + + case CHOBJID_DIAGRAM_TITLE_Z_AXIS: + if (mpModel->IsXVertikal()) + eOrientation = CHTXTORIENT_TOPBOTTOM; + else + eOrientation = CHTXTORIENT_AUTOMATIC; + break; + + default: + eOrientation = CHTXTORIENT_AUTOMATIC; + break; + } + } + // GetTextRotation is in globfunc and returns the value of the + // rotation item (SCHATTR_TEXT_DEGREES) if set, otherwise + // defaults according to the orientation + rValue <<= static_cast< sal_Int32 >( GetTextRotation (rAttributes, eOrientation) ); + } + break; + + default: + ChXChartObject::GetPropertyValue( rProperty, rValue, rAttributes ); + } +} +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/unoidl/sch_mapprov.cxx b/binfilter/bf_sch/source/ui/unoidl/sch_mapprov.cxx new file mode 100644 index 000000000000..13eecce74107 --- /dev/null +++ b/binfilter/bf_sch/source/ui/unoidl/sch_mapprov.cxx @@ -0,0 +1,415 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 "mapprov.hxx" +#include "schattr.hxx" + +#include "app.hrc" // for SID_TEXTBREAK +#include <bf_svx/svxids.hrc> // for SID_ATTR_NUMBERFORMAT_SOURCE + +// for SdrObject +// for SdrObjList +// for SdrObjListIter +// header for E3dExtrudeObj +// for SVX_UNOEDIT_CHAR_PROPERTIES, SVX_UNOEDIT_FONT_PROPERTIES +#include <bf_svx/unoshprp.hxx> + +#include <com/sun/star/chart/ChartLegendPosition.hpp> +#include <com/sun/star/chart/ChartErrorIndicatorType.hpp> +#include <com/sun/star/chart/ChartErrorCategory.hpp> +#include <com/sun/star/chart/ChartRegressionCurveType.hpp> +#include <com/sun/star/chart/ChartDataRowSource.hpp> +#include <com/sun/star/chart/ChartAxisArrangeOrderType.hpp> +#include <com/sun/star/chart/ChartSeriesAddress.hpp> + +#include <com/sun/star/drawing/XShapes.hpp> +#include "unonames.hxx" +namespace binfilter { + +using namespace ::com::sun::star; + +// ---------------------------------- +// create one global instance for use +// from all uno implemetations +// ---------------------------------- +SchUnoPropertyMapProvider aSchMapProvider; + + +// ---------------------- +// shared property ranges +// ---------------------- + +#define SCH_DATA_DESCR_PROPERTIES \ + { MAP_CHAR_LEN( UNONAME_DATACAPTION ), SCHATTR_DATADESCR_DESCR, &::getCppuType( (sal_Int32*)0 ), 0, 0 } + +// attention: x and y grids are interchanged +#define SCH_SHOW_HIDE_PROPERTIES \ + { MAP_CHAR_LEN( UNONAME_AXISGRID_SHOW_2X_AXIS ), CHATTR_AXISGRID_SHOW_2X_AXIS, &::getBooleanCppuType(), 0, 0 },\ + { MAP_CHAR_LEN( UNONAME_AXISGRID_SHOW_2X_DESCR ), CHATTR_AXISGRID_SHOW_2X_DESCR, &::getBooleanCppuType(), 0, 0 },\ + { MAP_CHAR_LEN( UNONAME_AXISGRID_SHOW_2Y_AXIS ), CHATTR_AXISGRID_SHOW_2Y_AXIS, &::getBooleanCppuType(), 0, 0 },\ + { MAP_CHAR_LEN( UNONAME_AXISGRID_SHOW_2Y_DESCR ), CHATTR_AXISGRID_SHOW_2Y_DESCR, &::getBooleanCppuType(), 0, 0 },\ + { MAP_CHAR_LEN( UNONAME_AXISGRID_SHOW_X_AXIS ), CHATTR_AXISGRID_SHOW_X_AXIS, &::getBooleanCppuType(), 0, 0 },\ + { MAP_CHAR_LEN( UNONAME_AXISGRID_SHOW_X_DESCR ), CHATTR_AXISGRID_SHOW_X_DESCR, &::getBooleanCppuType(), 0, 0 },\ + { MAP_CHAR_LEN( UNONAME_AXISGRID_SHOW_X_HELP ), CHATTR_AXISGRID_SHOW_Y_HELP, &::getBooleanCppuType(), 0, 0 },\ + { MAP_CHAR_LEN( UNONAME_AXISGRID_SHOW_X_MAIN ), CHATTR_AXISGRID_SHOW_Y_MAIN, &::getBooleanCppuType(), 0, 0 },\ + { MAP_CHAR_LEN( UNONAME_AXISGRID_SHOW_Y_AXIS ), CHATTR_AXISGRID_SHOW_Y_AXIS, &::getBooleanCppuType(), 0, 0 },\ + { MAP_CHAR_LEN( UNONAME_AXISGRID_SHOW_Y_DESCR ), CHATTR_AXISGRID_SHOW_Y_DESCR, &::getBooleanCppuType(), 0, 0 },\ + { MAP_CHAR_LEN( UNONAME_AXISGRID_SHOW_Y_HELP ), CHATTR_AXISGRID_SHOW_X_HELP, &::getBooleanCppuType(), 0, 0 },\ + { MAP_CHAR_LEN( UNONAME_AXISGRID_SHOW_Y_MAIN ), CHATTR_AXISGRID_SHOW_X_MAIN, &::getBooleanCppuType(), 0, 0 },\ + { MAP_CHAR_LEN( UNONAME_AXISGRID_SHOW_Z_AXIS ), CHATTR_AXISGRID_SHOW_Z_AXIS, &::getBooleanCppuType(), 0, 0 },\ + { MAP_CHAR_LEN( UNONAME_AXISGRID_SHOW_Z_DESCR ), CHATTR_AXISGRID_SHOW_Z_DESCR, &::getBooleanCppuType(), 0, 0 },\ + { MAP_CHAR_LEN( UNONAME_AXISGRID_SHOW_Z_HELP ), CHATTR_AXISGRID_SHOW_Z_HELP, &::getBooleanCppuType(), 0, 0 },\ + { MAP_CHAR_LEN( UNONAME_AXISGRID_SHOW_Z_MAIN ), CHATTR_AXISGRID_SHOW_Z_MAIN, &::getBooleanCppuType(), 0, 0 },\ + { MAP_CHAR_LEN( UNONAME_TITLE_SHOW_X_AXIS ), CHATTR_TITLE_SHOW_X_AXIS, &::getBooleanCppuType(), 0, 0 },\ + { MAP_CHAR_LEN( UNONAME_TITLE_SHOW_Y_AXIS ), CHATTR_TITLE_SHOW_Y_AXIS, &::getBooleanCppuType(), 0, 0 },\ + { MAP_CHAR_LEN( UNONAME_TITLE_SHOW_Z_AXIS ), CHATTR_TITLE_SHOW_Z_AXIS, &::getBooleanCppuType(), 0, 0 } + +#define SCH_STAT_PROPERTIES \ + { MAP_CHAR_LEN( UNONAME_STAT_AVERAGE ), SCHATTR_STAT_AVERAGE, &::getBooleanCppuType(), 0, 0 },\ + { MAP_CHAR_LEN( UNONAME_STAT_BIGERROR ), SCHATTR_STAT_BIGERROR, &::getCppuType((const double*)0), 0, 0 },\ + { MAP_CHAR_LEN( UNONAME_STAT_CONSTMINUS ), SCHATTR_STAT_CONSTMINUS, &::getCppuType((const double*)0), 0, 0 },\ + { MAP_CHAR_LEN( UNONAME_STAT_CONSTPLUS ), SCHATTR_STAT_CONSTPLUS, &::getCppuType((const double*)0), 0, 0 },\ + { MAP_CHAR_LEN( UNONAME_STAT_INDICATE ), SCHATTR_STAT_INDICATE, &::getCppuType((const chart::ChartErrorIndicatorType*)0), 0, 0 },\ + { MAP_CHAR_LEN( UNONAME_STAT_KIND_ERROR ), SCHATTR_STAT_KIND_ERROR, &::getCppuType((const chart::ChartErrorCategory*)0), 0, 0 },\ + { MAP_CHAR_LEN( UNONAME_STAT_PERCENT ), SCHATTR_STAT_PERCENT, &::getCppuType((const double*)0), 0, 0 },\ + { MAP_CHAR_LEN( UNONAME_STAT_REGRESSTYPE ), SCHATTR_STAT_REGRESSTYPE, &::getCppuType((const chart::ChartRegressionCurveType*)0), 0, 0 } + +#define SCH_SUBTYPE_PROPERTIES \ + { MAP_CHAR_LEN( UNONAME_NUM_OF_LINES_FOR_BAR ), CHATTR_NUM_OF_LINES_FOR_BAR, &::getCppuType((const sal_Int32*)0), 0, 0 },\ + { MAP_CHAR_LEN( UNONAME_STOCK_UPDOWN ), SCHATTR_STOCK_UPDOWN, &::getBooleanCppuType(), 0, 0 },\ + { MAP_CHAR_LEN( UNONAME_STOCK_VOLUME ), SCHATTR_STOCK_VOLUME, &::getBooleanCppuType(), 0, 0 },\ + { MAP_CHAR_LEN( UNONAME_STYLE_3D ), SCHATTR_STYLE_3D, &::getBooleanCppuType(), 0, 0 },\ + { MAP_CHAR_LEN( UNONAME_STYLE_DEEP ), SCHATTR_STYLE_DEEP, &::getBooleanCppuType() , 0, 0 },\ + { MAP_CHAR_LEN( UNONAME_STYLE_LINES ), SCHATTR_STYLE_LINES, &::getBooleanCppuType(), 0, 0 },\ + { MAP_CHAR_LEN( UNONAME_STYLE_PERCENT ), SCHATTR_STYLE_PERCENT, &::getBooleanCppuType() , 0, 0 },\ + { MAP_CHAR_LEN( UNONAME_STYLE_SHAPE ), SCHATTR_STYLE_SHAPE, &::getCppuType((const sal_Int32*)0), 0, 0 },\ + { MAP_CHAR_LEN( UNONAME_STYLE_SPLINES ), SCHATTR_STYLE_SPLINES, &::getCppuType((const sal_Int32*)0), 0, 0 },\ + { MAP_CHAR_LEN( UNONAME_STYLE_STACKED ), SCHATTR_STYLE_STACKED, &::getBooleanCppuType() , 0, 0 },\ + { MAP_CHAR_LEN( UNONAME_STYLE_SYMBOL ), SCHATTR_STYLE_SYMBOL, &::getCppuType((const sal_Int32*)0), 0, 0 },\ + { MAP_CHAR_LEN( UNONAME_SYMBOL_BITMAP_URL ), SCHATTR_SYMBOL_BRUSH, &::getCppuType((const ::rtl::OUString*)0), 0, 0 },\ + { MAP_CHAR_LEN( UNONAME_SYMBOL_SIZE ), SCHATTR_SYMBOL_SIZE, &::getCppuType((const awt::Size*)0), 0, 0 },\ + { MAP_CHAR_LEN( UNONAME_STYLE_VERTICAL ), SCHATTR_STYLE_VERTICAL, &::getBooleanCppuType(), 0, 0 },\ + { MAP_CHAR_LEN( UNONAME_SPLINE_ORDER ), CHATTR_SPLINE_ORDER, &::getCppuType((const sal_Int32*)0), 0, 0 },\ + { MAP_CHAR_LEN( UNONAME_SPLINE_RESOLUTION ), CHATTR_SPLINE_RESOLUTION, &::getCppuType((const sal_Int32*)0), 0, 0 } + + +#define SCH_TEXT2_PROPERTIES \ + { MAP_CHAR_LEN( UNONAME_TEXT_DEGREES ), SCHATTR_TEXT_DEGREES, &::getCppuType((const sal_Int32*)0), 0, 0 },\ + { MAP_CHAR_LEN( UNONAME_TEXT_OVERLAP ), SCHATTR_TEXT_OVERLAP, &::getBooleanCppuType(), 0, 0 } + + +#define SCH_GFX_PROPERTIES \ + { MAP_CHAR_LEN( UNONAME_STYLE_SHAPE ), SCHATTR_STYLE_SHAPE, &::getCppuType((const sal_Int32*)0), 0, 0 },\ + { MAP_CHAR_LEN( UNONAME_STYLE_SYMBOL ), SCHATTR_STYLE_SYMBOL, &::getCppuType((const sal_Int32*)0), 0, 0 },\ + { MAP_CHAR_LEN( UNONAME_SYMBOL_BITMAP_URL ),SCHATTR_SYMBOL_BRUSH, &::getCppuType((const ::rtl::OUString*)0), 0, 0 },\ + { MAP_CHAR_LEN( UNONAME_SYMBOL_SIZE ), SCHATTR_SYMBOL_SIZE, &::getCppuType((const awt::Size*)0), 0, 0 } + +#define SCH_ALIEN_PROPERTIES \ + { MAP_CHAR_LEN( UNONAME_USER_DEF_ATTR ), SCHATTR_USER_DEFINED_ATTR, &::getCppuType((uno::Reference< container::XNameContainer >*)0), 0, 0 } + +#define SCH_MAP_END { 0,0,0,0,0 } + +// --------------- +// map definitions +// --------------- + +// see SchUnoPropertyMapProvider::GetMap() + +// ------------------------------------------------------------ +// +// Implementation for SchUnoPropertyMapProvider +// +// ------------------------------------------------------------ + +SchUnoPropertyMapProvider::SchUnoPropertyMapProvider() +{ + for( long i = 0; i < CHMAP_END; i++ ) + pMapArr[i] = 0; +} + +SchUnoPropertyMapProvider::~SchUnoPropertyMapProvider() +{ + for( long i = 0; i < CHMAP_END; i++ ) + if( pMapArr[i] ) + delete pMapArr[i]; +} + +// -------------- copied from SwUnoPropertyMapProvider -------------- +EXTERN_C +#ifdef WNT +int _cdecl +#else +int +#endif +Sch_CompareMap( const void* pSmaller, const void* pBigger ) +{ + int nDiff = strcmp( ((const SfxItemPropertyMap*)pSmaller)->pName, + ((const SfxItemPropertyMap*)pBigger)->pName ); + return nDiff; +} + +void SchUnoPropertyMapProvider::Sort(short nId) +{ + SfxItemPropertyMap* pTemp = pMapArr[ nId ]; + short i = 0; + while( pTemp[i].pName ) + i++; + + qsort( pMapArr[ nId ], i, sizeof(SfxItemPropertyMap), Sch_CompareMap ); +} + +SfxItemPropertyMap* SchUnoPropertyMapProvider::CopyMap( const SfxItemPropertyMap* pMap1 ) +{ + long nCnt = 0; + + while( pMap1[ nCnt ].pName ) + nCnt++; + + nCnt++; + + SfxItemPropertyMap* pNewMap = new SfxItemPropertyMap[ nCnt ]; + memcpy( pNewMap, pMap1, sizeof(SfxItemPropertyMap) * nCnt ); + return pNewMap; +} + +SfxItemPropertyMap* SchUnoPropertyMapProvider::GetMap( short nPropertyId, ChartModel *pModel ) +{ + // --------------- + // map definitions + // --------------- + + static SfxItemPropertyMap aEmptyMap[] = { SCH_MAP_END }; + + // ChXChartDocument + static SfxItemPropertyMap aChartDocumentPropertyMap_Impl[] = + { + { MAP_CHAR_LEN( UNONAME_HASLEGEND ), CHATTR_DIAGRAM_START, &::getBooleanCppuType(), 0, 0 }, + { MAP_CHAR_LEN( UNONAME_TITLE_SHOW_MAIN ), CHATTR_TITLE_SHOW_MAIN, &::getBooleanCppuType(), 0, 0 }, + { MAP_CHAR_LEN( UNONAME_TITLE_SHOW_SUB ), CHATTR_TITLE_SHOW_SUB, &::getBooleanCppuType(), 0, 0 }, + { MAP_CHAR_LEN( UNONAME_CATEGORIES_RANGE_ADDRESS ), CHATTR_ADDR_CATEGORIES, &::getCppuType((const ::rtl::OUString*)0), 0, 0 }, + { MAP_CHAR_LEN( UNONAME_SERIES_ADDRESSES ), CHATTR_ADDR_SERIES, &::getCppuType(( uno::Sequence< chart::ChartSeriesAddress >*)0), 0, 0 }, + { MAP_CHAR_LEN( UNONAME_CHART_RANGE_ADDRESS ), CHATTR_ADDR_CHART, &::getCppuType((const ::rtl::OUString*)0), 0, 0 }, + { MAP_CHAR_LEN( UNONAME_TABLE_NUMBER_LIST ), CHATTR_TABLE_NUMBER_LIST, &::getCppuType((const ::rtl::OUString*)0), 0, 0 }, + { MAP_CHAR_LEN( UNONAME_EXPORT_DATA ), CHATTR_EXPORT_TABLE, &::getBooleanCppuType(), 0, 0 }, + { MAP_CHAR_LEN( UNONAME_FIRST_COL_LABELS ), CHATTR_FIRST_COL_LABELS,&::getBooleanCppuType(), 0, 0 }, + { MAP_CHAR_LEN( UNONAME_FIRST_ROW_LABELS ), CHATTR_FIRST_ROW_LABELS,&::getBooleanCppuType(), 0, 0 }, +// { MAP_CHAR_LEN( UNONAME_MAINTITLE_ADDRESS ), CHATTR_ADDR_MAIN_TITLE, &::getCppuType((const ::rtl::OUString*)0), 0, 0 }, +// { MAP_CHAR_LEN( UNONAME_SUBTITLE_ADDRESS ), CHATTR_ADDR_SUB_TITLE, &::getCppuType((const ::rtl::OUString*)0), 0, 0 }, + { MAP_CHAR_LEN( UNONAME_ADDITIONAL_SHAPES ), CHATTR_ADDITIONAL_SHAPES, &::getCppuType((const uno::Reference< drawing::XShapes >*)0), 0, 0 }, + { MAP_CHAR_LEN( UNONAME_HAS_TRANSLATED_COLS ), CHATTR_HAS_TRANSLATED_COLS, &::getBooleanCppuType(), beans::PropertyAttribute::READONLY, 0}, + { MAP_CHAR_LEN( UNONAME_HAS_TRANSLATED_ROWS ), CHATTR_HAS_TRANSLATED_ROWS, &::getBooleanCppuType(), beans::PropertyAttribute::READONLY, 0}, + { MAP_CHAR_LEN( UNONAME_TRANSLATED_COLS ), CHATTR_TRANSLATED_COLS, &::getCppuType(( uno::Sequence< sal_Int32 >*)0), 0, 0 }, + { MAP_CHAR_LEN( UNONAME_TRANSLATED_ROWS ), CHATTR_TRANSLATED_ROWS, &::getCppuType(( uno::Sequence< sal_Int32 >*)0), 0, 0 }, + SCH_ALIEN_PROPERTIES, + SCH_MAP_END + }; + + static SfxItemPropertyMap aChartTitleShapePropertyMap_Impl[] = + { + SVX_UNOEDIT_CHAR_PROPERTIES, + { MAP_CHAR_LEN( UNONAME_TEXT_DEGREES ), SCHATTR_TEXT_DEGREES, &::getCppuType((const sal_Int32*)0), 0, 0 }, + { MAP_CHAR_LEN( UNONAME_TEXT_STRING ), CHATTR_TITLE_MAIN, &::getCppuType((const ::rtl::OUString*)0), 0, 0 }, // CHATTR_TEXT_TITLE_MAIN is just a 'placeholder' to select the uno property 'String' from the which id + { MAP_CHAR_LEN( UNONAME_STACKED_TEXT ), SCHATTR_TEXT_ORIENT, &::getBooleanCppuType(), 0, 0 }, + SCH_ALIEN_PROPERTIES, + FILL_PROPERTIES + LINE_PROPERTIES + LINE_PROPERTIES_START_END + SCH_MAP_END + }; + + static SfxItemPropertyMap aChartLegendPropertyMap_Impl[] = + { + SVX_UNOEDIT_CHAR_PROPERTIES, + { MAP_CHAR_LEN( UNONAME_CHARTLEGENDALIGN ), SCHATTR_LEGEND_POS, &::getCppuType((const chart::ChartLegendPosition*)0), 0, 0 }, + SCH_ALIEN_PROPERTIES, + FILL_PROPERTIES + LINE_PROPERTIES + LINE_PROPERTIES_START_END + SCH_MAP_END + }; + + // ChXDiagram + static SfxItemPropertyMap aChartPropertyMap_Impl[] = + { + SCH_STAT_PROPERTIES, + SCH_SHOW_HIDE_PROPERTIES, + SCH_SUBTYPE_PROPERTIES, + SCH_DATA_DESCR_PROPERTIES, + { MAP_CHAR_LEN( UNONAME_DATAROWSOURCE ), CHATTR_DATA_SWITCH, &::getCppuType((const chart::ChartDataRowSource*)0), 0, 0 }, + { MAP_CHAR_LEN( UNONAME_STACKCONNECTORS ), CHATTR_BARCONNECT, &::getBooleanCppuType(), 0, 0 }, + { MAP_CHAR_LEN( UNONAME_ATTRIBUTED_DATA_POINTS ),CHATTR_ATTRIBUTED_DATA_POINTS, &::getCppuType(( uno::Sequence< uno::Sequence< sal_Int32 > >*)0), beans::PropertyAttribute::READONLY, 0}, + SCH_ALIEN_PROPERTIES, + FILL_PROPERTIES + LINE_PROPERTIES + LINE_PROPERTIES_START_END + SPECIAL_3DSCENEOBJECT_PROPERTIES + SCH_MAP_END + }; + + static SfxItemPropertyMap aChartAxisStylePropertyMap_Impl[] = + { + SCH_TEXT2_PROPERTIES, + SVX_UNOEDIT_CHAR_PROPERTIES, + LINE_PROPERTIES + LINE_PROPERTIES_START_END + { MAP_CHAR_LEN( UNONAME_AXIS_AUTO_MAX ), SCHATTR_AXIS_AUTO_MAX, &::getBooleanCppuType(), 0, 0 }, + { MAP_CHAR_LEN( UNONAME_AXIS_AUTO_MIN ), SCHATTR_AXIS_AUTO_MIN, &::getBooleanCppuType(), 0, 0 }, + { MAP_CHAR_LEN( UNONAME_AXIS_AUTO_ORIGIN ), SCHATTR_AXIS_AUTO_ORIGIN, &::getBooleanCppuType(), 0, 0 }, + { MAP_CHAR_LEN( UNONAME_AXIS_AUTO_STEP_HELP ), SCHATTR_AXIS_AUTO_STEP_HELP, &::getBooleanCppuType(), 0, 0 }, + { MAP_CHAR_LEN( UNONAME_AXIS_AUTO_STEP_MAIN ), SCHATTR_AXIS_AUTO_STEP_MAIN, &::getBooleanCppuType(), 0, 0 }, + { MAP_CHAR_LEN( UNONAME_AXIS_HELPTICKS ), SCHATTR_AXIS_HELPTICKS, &::getCppuType((const sal_Int32*)0), 0, 0 }, + { MAP_CHAR_LEN( UNONAME_AXIS_LOGARITHM ), SCHATTR_AXIS_LOGARITHM, &::getBooleanCppuType(), 0, 0 }, + { MAP_CHAR_LEN( UNONAME_AXIS_MAX ), SCHATTR_AXIS_MAX, &::getCppuType((const double*)0), 0, 0 }, + { MAP_CHAR_LEN( UNONAME_AXIS_MIN ), SCHATTR_AXIS_MIN, &::getCppuType((const double*)0), 0, 0 }, + { MAP_CHAR_LEN( UNONAME_AXIS_ORIGIN ), SCHATTR_AXIS_ORIGIN, &::getCppuType((const double*)0), 0, 0 }, + { MAP_CHAR_LEN( UNONAME_AXIS_STEP_HELP ), SCHATTR_AXIS_STEP_HELP, &::getCppuType((const double*)0), 0, 0 }, + { MAP_CHAR_LEN( UNONAME_AXIS_STEP_MAIN ), SCHATTR_AXIS_STEP_MAIN, &::getCppuType((const double*)0), 0, 0 }, + { MAP_CHAR_LEN( UNONAME_AXIS_TICKS ), SCHATTR_AXIS_TICKS, &::getCppuType((const sal_Int32*)0), 0, 0 }, + { MAP_CHAR_LEN( UNONAME_DIAGRAM_GAPWIDTH ), SCHATTR_BAR_GAPWIDTH, &::getCppuType((const sal_Int32*)0), 0, 0 }, + { MAP_CHAR_LEN( UNONAME_DIAGRAM_OVERLAP ), SCHATTR_BAR_OVERLAP, &::getCppuType((const sal_Int32*)0), 0, 0 }, + { MAP_CHAR_LEN( UNONAME_NUMBERFORMAT ), SCHATTR_AXIS_NUMFMT, &::getCppuType((const sal_Int32*)0), 0, 0 }, + { MAP_CHAR_LEN( UNONAME_TEXTBREAK ), SID_TEXTBREAK, &::getBooleanCppuType(), 0, 0 }, + { MAP_CHAR_LEN( UNONAME_TEXT_ORDER ), SCHATTR_TEXT_ORDER, &::getCppuType((const chart::ChartAxisArrangeOrderType*)0), 0, 0 }, + { MAP_CHAR_LEN( UNONAME_DISPLAY_LABELS ), SCHATTR_AXIS_SHOWDESCR, &::getBooleanCppuType(), 0, 0 }, + { MAP_CHAR_LEN( UNONAME_VISIBLE ), SCHATTR_AXIS_SHOWAXIS, &::getBooleanCppuType(), 0, 0 }, + { MAP_CHAR_LEN( UNONAME_LINK_NUMFMT ), SID_ATTR_NUMBERFORMAT_SOURCE, &::getBooleanCppuType(), 0, 0 }, + { MAP_CHAR_LEN( UNONAME_STACKED_TEXT ), SCHATTR_TEXT_ORIENT, &::getBooleanCppuType(), 0, 0 }, + SCH_ALIEN_PROPERTIES, + SCH_MAP_END + }; + + static SfxItemPropertyMap aChartDataRowPropertyMap_Impl[] = + { + SCH_GFX_PROPERTIES, + SCH_DATA_DESCR_PROPERTIES, + SCH_STAT_PROPERTIES, + SVX_UNOEDIT_CHAR_PROPERTIES, + { MAP_CHAR_LEN( UNONAME_AXIS ), SCHATTR_AXIS, &::getCppuType((const sal_Int32*)0), 0, 0 }, + { MAP_CHAR_LEN( UNONAME_REGRESSION_PROPS ), CHATTR_REGRESSION_PROPS, &::getCppuType((const uno::Reference< beans::XPropertySet >*)0), beans::PropertyAttribute::READONLY, 0}, + { MAP_CHAR_LEN( UNONAME_ERROR_PROPS ), CHATTR_ERROR_PROPS, &::getCppuType((const uno::Reference< beans::XPropertySet >*)0), beans::PropertyAttribute::READONLY, 0}, + { MAP_CHAR_LEN( UNONAME_AVERAGE_PROPS ), CHATTR_AVERAGE_PROPS, &::getCppuType((const uno::Reference< beans::XPropertySet >*)0), beans::PropertyAttribute::READONLY, 0}, + SCH_ALIEN_PROPERTIES, + FILL_PROPERTIES + LINE_PROPERTIES + LINE_PROPERTIES_START_END + MISC_3D_OBJ_PROPERTIES + SPECIAL_3DEXTRUDEOBJECT_PROPERTIES + SPECIAL_3DLATHEOBJECT_PROPERTIES + SPECIAL_3DPOLYGONOBJECT_PROPERTIES + SPECIAL_3DBACKSCALE_PROPERTIES + SCH_MAP_END + }; + + static SfxItemPropertyMap aChartDataPointPropertyMap_Impl[] = + { + SCH_GFX_PROPERTIES, + SCH_DATA_DESCR_PROPERTIES, + SVX_UNOEDIT_CHAR_PROPERTIES, + { MAP_CHAR_LEN( UNONAME_PIE_SEGMENT_OFFSET ), CHATTR_PIE_SEGMENT_OFFSET, &::getCppuType((const sal_Int32*)0), 0, 0 }, + SCH_ALIEN_PROPERTIES, + FILL_PROPERTIES + LINE_PROPERTIES + LINE_PROPERTIES_START_END + MISC_3D_OBJ_PROPERTIES + SPECIAL_3DEXTRUDEOBJECT_PROPERTIES + SPECIAL_3DLATHEOBJECT_PROPERTIES + SPECIAL_3DPOLYGONOBJECT_PROPERTIES + SPECIAL_3DBACKSCALE_PROPERTIES + SCH_MAP_END + }; + + static SfxItemPropertyMap aFilledShapePropertyMap_Impl[] = + { + FILL_PROPERTIES + LINE_PROPERTIES + LINE_PROPERTIES_START_END + SCH_ALIEN_PROPERTIES, + SCH_MAP_END + }; + + static SfxItemPropertyMap aLineShapePropertyMap_Impl[] = + { + LINE_PROPERTIES + LINE_PROPERTIES_START_END + SCH_ALIEN_PROPERTIES, + SCH_MAP_END + }; + + // ------------ + // program code + // ------------ + + if( nPropertyId >= CHMAP_END ) + DBG_ERROR2( "Invalid Id %d (>=%d)", nPropertyId, CHMAP_END ); + + if( ! pMapArr[ nPropertyId ] ) + { + SfxItemPropertyMap** pNewMap = &(pMapArr[ nPropertyId ]); + switch( nPropertyId ) + { + case CHMAP_CHART: + *pNewMap = CopyMap( aChartPropertyMap_Impl ); + break; + case CHMAP_AREA: + *pNewMap = CopyMap( aFilledShapePropertyMap_Impl ); + break; + case CHMAP_LINE: + *pNewMap = CopyMap( aLineShapePropertyMap_Impl ); + break; + case CHMAP_DOC: + *pNewMap = CopyMap( aChartDocumentPropertyMap_Impl ); + break; + case CHMAP_AXIS: + *pNewMap = CopyMap( aChartAxisStylePropertyMap_Impl ); + break; + case CHMAP_LEGEND: + *pNewMap = CopyMap( aChartLegendPropertyMap_Impl ); + break; + case CHMAP_TITLE: + *pNewMap = CopyMap( aChartTitleShapePropertyMap_Impl ); + break; + case CHMAP_DATAROW: + *pNewMap = CopyMap( aChartDataRowPropertyMap_Impl ); + break; + case CHMAP_DATAPOINT: + *pNewMap = CopyMap( aChartDataPointPropertyMap_Impl ); + break; + case CHMAP_NONE: + default: + *pNewMap = CopyMap( aEmptyMap ); + DBG_WARNING( "Using empty PropertyMap!" ); + break; + } + Sort( nPropertyId ); + } + + return pMapArr[ nPropertyId ]; +} +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/unoidl/sch_register.cxx b/binfilter/bf_sch/source/ui/unoidl/sch_register.cxx new file mode 100644 index 000000000000..774a46e11a46 --- /dev/null +++ b/binfilter/bf_sch/source/ui/unoidl/sch_register.cxx @@ -0,0 +1,107 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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 <bf_sfx2/sfxuno.hxx> + +#include "schdll.hxx" +namespace binfilter { + +using namespace ::com::sun::star; + +//StarChart document +extern uno::Sequence< ::rtl::OUString > SAL_CALL SchDocument_getSupportedServiceNames() throw(); +extern ::rtl::OUString SAL_CALL SchDocument_getImplementationName() throw(); +extern uno::Reference< uno::XInterface > SAL_CALL SchDocument_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception ); + +extern "C" { + +void SAL_CALL component_getImplementationEnvironment( const sal_Char** ppEnvironmentTypeName , + uno_Environment** ppEnvironment ) +{ + *ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ; +} + +sal_Bool SAL_CALL component_writeInfo( void* pServiceManager , + void* pRegistryKey ) +{ + uno::Reference< registry::XRegistryKey > + xKey( reinterpret_cast< registry::XRegistryKey* >( pRegistryKey ) ) ; + + sal_Int32 i; + uno::Reference< registry::XRegistryKey > xNewKey; + + xNewKey = xKey->createKey(::rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("/") ) + SchDocument_getImplementationName() + + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ) ); + + uno::Sequence< ::rtl::OUString > rServices = SchDocument_getSupportedServiceNames(); + for(i = 0; i < rServices.getLength(); i++ ) + xNewKey->createKey( rServices.getConstArray()[i]); + + return sal_True; +} + +void* SAL_CALL component_getFactory( const sal_Char* pImplementationName , + void* pServiceManager , + void* pRegistryKey ) +{ + void* pReturn = NULL ; + + if ( ( pImplementationName != NULL ) && ( pServiceManager != NULL ) ) + { + uno::Reference< lang::XSingleServiceFactory > xFactory; + uno::Reference< lang::XMultiServiceFactory > xServiceManager( + reinterpret_cast< lang::XMultiServiceFactory* >( pServiceManager ) ); + + if( SchDocument_getImplementationName().equalsAsciiL( + pImplementationName, strlen(pImplementationName)) ) + { + xFactory = ::cppu::createSingleFactory( xServiceManager, + SchDocument_getImplementationName(), + SchDocument_createInstance, + SchDocument_getSupportedServiceNames() ); + } + + + if ( xFactory.is() ) + { + xFactory->acquire(); + pReturn = xFactory.get(); + } + } + + return pReturn ; +} +} // extern "C" + + + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/binfilter/bf_sch/source/ui/unoidl/sch_unodoc.cxx b/binfilter/bf_sch/source/ui/unoidl/sch_unodoc.cxx new file mode 100644 index 000000000000..238d6fdf59a8 --- /dev/null +++ b/binfilter/bf_sch/source/ui/unoidl/sch_unodoc.cxx @@ -0,0 +1,83 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * 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. + * + ************************************************************************/ + +// System - Includes ----------------------------------------------------- + +#include <bf_sfx2/docfac.hxx> + + +#include "schmod.hxx" + +#include <osl/mutex.hxx> +#include <vcl/svapp.hxx> +namespace binfilter { + +using namespace ::com::sun::star; + +::rtl::OUString SAL_CALL SchDocument_getImplementationName() throw() +{ + return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Chart.ChartDocument" ) ); +} + +uno::Sequence< ::rtl::OUString > SAL_CALL SchDocument_getSupportedServiceNames() throw() +{ + uno::Sequence< ::rtl::OUString > aSeq( 3 ); + aSeq[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.chart.ChartDocument" ) ); + aSeq[1] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.chart.ChartTableAddressSupplier" ) ); + aSeq[2] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.xml.UserDefinedAttributeSupplier" ) ); + + return aSeq; +} + +uno::Reference< uno::XInterface > SAL_CALL SchDocument_createInstance( + const uno::Reference< lang::XMultiServiceFactory > & rSMgr ) throw( uno::Exception ) +{ + SolarMutexGuard aGuard; + + // to create the service the SW_MOD should be already initialized + DBG_ASSERT( SCH_MOD1(), "No StarChart module!" ); + + if ( SCH_MOD1() ) + { + ::rtl::OUString aFactoryURL( RTL_CONSTASCII_USTRINGPARAM ( "private:factory/schart" ) ); + const SfxObjectFactory* pFactory = SfxObjectFactory::GetFactory( aFactoryURL ); + if ( pFactory ) + { + SfxObjectShell* pShell = pFactory->CreateObject(); + if( pShell ) + return uno::Reference< uno::XInterface >( pShell->GetModel() ); + } + } + + return uno::Reference< uno::XInterface >(); +} + + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |