diff options
Diffstat (limited to 'sc')
295 files changed, 4099 insertions, 3202 deletions
diff --git a/sc/CppunitTest_sc_annotationshapeobj.mk b/sc/CppunitTest_sc_annotationshapeobj.mk index 9522e2779ea4..841b34a450a9 100644 --- a/sc/CppunitTest_sc_annotationshapeobj.mk +++ b/sc/CppunitTest_sc_annotationshapeobj.mk @@ -103,7 +103,8 @@ $(eval $(call gb_CppunitTest_use_components,sc_annonationshapeobj,\ sc/util/sc \ sc/util/scd \ sc/util/scfilt \ - sc/util/vbaobj \ + $(if $(filter TRUE,$(DISABLE_SCRIPTING)),, \ + sc/util/vbaobj) \ scripting/source/basprov/basprov \ scripting/util/scriptframe \ sfx2/util/sfx \ diff --git a/sc/CppunitTest_sc_cellrangeobj.mk b/sc/CppunitTest_sc_cellrangeobj.mk index 814e9cbbc1a1..b0a63217668a 100644 --- a/sc/CppunitTest_sc_cellrangeobj.mk +++ b/sc/CppunitTest_sc_cellrangeobj.mk @@ -104,7 +104,8 @@ $(eval $(call gb_CppunitTest_use_components,sc_cellrangesbase,\ sc/util/sc \ sc/util/scd \ sc/util/scfilt \ - sc/util/vbaobj \ + $(if $(filter TRUE,$(DISABLE_SCRIPTING)),, \ + sc/util/vbaobj) \ scripting/source/basprov/basprov \ scripting/util/scriptframe \ sfx2/util/sfx \ diff --git a/sc/CppunitTest_sc_chart_regression_test.mk b/sc/CppunitTest_sc_chart_regression_test.mk index 1ca505b5b1d7..c45aa69857b4 100644 --- a/sc/CppunitTest_sc_chart_regression_test.mk +++ b/sc/CppunitTest_sc_chart_regression_test.mk @@ -104,7 +104,8 @@ $(eval $(call gb_CppunitTest_use_components,sc_chart_regression_test,\ sc/util/sc \ sc/util/scd \ sc/util/scfilt \ - sc/util/vbaobj \ + $(if $(filter TRUE,$(DISABLE_SCRIPTING)),, \ + sc/util/vbaobj) \ scaddins/source/analysis/analysis \ scaddins/source/datefunc/date \ scripting/source/basprov/basprov \ diff --git a/sc/CppunitTest_sc_datapilotfieldobj.mk b/sc/CppunitTest_sc_datapilotfieldobj.mk index d221fe5c4bd2..7d86cb573941 100644 --- a/sc/CppunitTest_sc_datapilotfieldobj.mk +++ b/sc/CppunitTest_sc_datapilotfieldobj.mk @@ -103,7 +103,8 @@ $(eval $(call gb_CppunitTest_use_components,sc_datapilotfieldobj,\ sc/util/sc \ sc/util/scd \ sc/util/scfilt \ - sc/util/vbaobj \ + $(if $(filter TRUE,$(DISABLE_SCRIPTING)),, \ + sc/util/vbaobj) \ scripting/source/basprov/basprov \ scripting/util/scriptframe \ sfx2/util/sfx \ diff --git a/sc/CppunitTest_sc_datapilottableobj.mk b/sc/CppunitTest_sc_datapilottableobj.mk index 77f2b0be4e28..33207173b07a 100644 --- a/sc/CppunitTest_sc_datapilottableobj.mk +++ b/sc/CppunitTest_sc_datapilottableobj.mk @@ -103,7 +103,8 @@ $(eval $(call gb_CppunitTest_use_components,sc_datapilottableobj,\ sc/util/sc \ sc/util/scd \ sc/util/scfilt \ - sc/util/vbaobj \ + $(if $(filter TRUE,$(DISABLE_SCRIPTING)),, \ + sc/util/vbaobj) \ scripting/source/basprov/basprov \ scripting/util/scriptframe \ sfx2/util/sfx \ diff --git a/sc/CppunitTest_sc_editfieldobj_cell.mk b/sc/CppunitTest_sc_editfieldobj_cell.mk index 3f75acb58ba3..b4f80621f9f6 100644 --- a/sc/CppunitTest_sc_editfieldobj_cell.mk +++ b/sc/CppunitTest_sc_editfieldobj_cell.mk @@ -103,7 +103,8 @@ $(eval $(call gb_CppunitTest_use_components,sc_editfieldobj_cell,\ sc/util/sc \ sc/util/scd \ sc/util/scfilt \ - sc/util/vbaobj \ + $(if $(filter TRUE,$(DISABLE_SCRIPTING)),, \ + sc/util/vbaobj) \ scripting/source/basprov/basprov \ scripting/util/scriptframe \ sfx2/util/sfx \ diff --git a/sc/CppunitTest_sc_editfieldobj_header.mk b/sc/CppunitTest_sc_editfieldobj_header.mk index 32ac4577c5e8..ba55b6515208 100644 --- a/sc/CppunitTest_sc_editfieldobj_header.mk +++ b/sc/CppunitTest_sc_editfieldobj_header.mk @@ -103,7 +103,8 @@ $(eval $(call gb_CppunitTest_use_components,sc_editfieldobj_header,\ sc/util/sc \ sc/util/scd \ sc/util/scfilt \ - sc/util/vbaobj \ + $(if $(filter TRUE,$(DISABLE_SCRIPTING)),, \ + sc/util/vbaobj) \ scripting/source/basprov/basprov \ scripting/util/scriptframe \ sfx2/util/sfx \ diff --git a/sc/CppunitTest_sc_macros_test.mk b/sc/CppunitTest_sc_macros_test.mk index c74f49433687..fca4947cef41 100644 --- a/sc/CppunitTest_sc_macros_test.mk +++ b/sc/CppunitTest_sc_macros_test.mk @@ -100,7 +100,8 @@ $(eval $(call gb_CppunitTest_use_components,sc_macros_test,\ sc/util/sc \ sc/util/scd \ sc/util/scfilt \ - sc/util/vbaobj \ + $(if $(filter TRUE,$(DISABLE_SCRIPTING)),, \ + sc/util/vbaobj) \ scripting/source/basprov/basprov \ scripting/util/scriptframe \ sfx2/util/sfx \ diff --git a/sc/CppunitTest_sc_modelobj.mk b/sc/CppunitTest_sc_modelobj.mk index 4548f4bc37f4..de62eb6475d4 100644 --- a/sc/CppunitTest_sc_modelobj.mk +++ b/sc/CppunitTest_sc_modelobj.mk @@ -103,7 +103,8 @@ $(eval $(call gb_CppunitTest_use_components,sc_modelobj,\ sc/util/sc \ sc/util/scd \ sc/util/scfilt \ - sc/util/vbaobj \ + $(if $(filter TRUE,$(DISABLE_SCRIPTING)),, \ + sc/util/vbaobj) \ scripting/source/basprov/basprov \ scripting/util/scriptframe \ sfx2/util/sfx \ diff --git a/sc/CppunitTest_sc_namedrangeobj.mk b/sc/CppunitTest_sc_namedrangeobj.mk index ffca9b399833..c2f1d438dd09 100644 --- a/sc/CppunitTest_sc_namedrangeobj.mk +++ b/sc/CppunitTest_sc_namedrangeobj.mk @@ -103,7 +103,8 @@ $(eval $(call gb_CppunitTest_use_components,sc_namedrangeobj,\ sc/util/sc \ sc/util/scd \ sc/util/scfilt \ - sc/util/vbaobj \ + $(if $(filter TRUE,$(DISABLE_SCRIPTING)),, \ + sc/util/vbaobj) \ scripting/source/basprov/basprov \ scripting/util/scriptframe \ sfx2/util/sfx \ diff --git a/sc/CppunitTest_sc_namedrangesobj.mk b/sc/CppunitTest_sc_namedrangesobj.mk index 49a87b49acf4..84d7f371c5a3 100644 --- a/sc/CppunitTest_sc_namedrangesobj.mk +++ b/sc/CppunitTest_sc_namedrangesobj.mk @@ -103,7 +103,8 @@ $(eval $(call gb_CppunitTest_use_components,sc_namedrangesobj,\ sc/util/sc \ sc/util/scd \ sc/util/scfilt \ - sc/util/vbaobj \ + $(if $(filter TRUE,$(DISABLE_SCRIPTING)),, \ + sc/util/vbaobj) \ scripting/source/basprov/basprov \ scripting/util/scriptframe \ sfx2/util/sfx \ diff --git a/sc/CppunitTest_sc_rangelst_test.mk b/sc/CppunitTest_sc_rangelst_test.mk index a97a4b1e258c..44c6b5266696 100644 --- a/sc/CppunitTest_sc_rangelst_test.mk +++ b/sc/CppunitTest_sc_rangelst_test.mk @@ -104,7 +104,8 @@ $(eval $(call gb_CppunitTest_use_components,sc_rangelst_test,\ sc/util/sc \ sc/util/scd \ sc/util/scfilt \ - sc/util/vbaobj \ + $(if $(filter TRUE,$(DISABLE_SCRIPTING)),, \ + sc/util/vbaobj) \ scaddins/source/analysis/analysis \ scaddins/source/datefunc/date \ scripting/source/basprov/basprov \ diff --git a/sc/CppunitTest_sc_tableautoformatfield.mk b/sc/CppunitTest_sc_tableautoformatfield.mk index 23cab33b98cc..94b311049ed4 100644 --- a/sc/CppunitTest_sc_tableautoformatfield.mk +++ b/sc/CppunitTest_sc_tableautoformatfield.mk @@ -103,7 +103,8 @@ $(eval $(call gb_CppunitTest_use_components,sc_tableautoformatfield,\ sc/util/sc \ sc/util/scd \ sc/util/scfilt \ - sc/util/vbaobj \ + $(if $(filter TRUE,$(DISABLE_SCRIPTING)),, \ + sc/util/vbaobj) \ scripting/source/basprov/basprov \ scripting/util/scriptframe \ sfx2/util/sfx \ diff --git a/sc/CppunitTest_sc_tablesheetobj.mk b/sc/CppunitTest_sc_tablesheetobj.mk index 1bf3bd956973..067ed9eea0ef 100644 --- a/sc/CppunitTest_sc_tablesheetobj.mk +++ b/sc/CppunitTest_sc_tablesheetobj.mk @@ -104,7 +104,8 @@ $(eval $(call gb_CppunitTest_use_components,sc_spreadsheetobj,\ sc/util/sc \ sc/util/scd \ sc/util/scfilt \ - sc/util/vbaobj \ + $(if $(filter TRUE,$(DISABLE_SCRIPTING)),, \ + sc/util/vbaobj) \ scripting/source/basprov/basprov \ scripting/util/scriptframe \ sfx2/util/sfx \ diff --git a/sc/CppunitTest_sc_tablesheetsobj.mk b/sc/CppunitTest_sc_tablesheetsobj.mk index 478dcb090552..e950830fdde0 100644 --- a/sc/CppunitTest_sc_tablesheetsobj.mk +++ b/sc/CppunitTest_sc_tablesheetsobj.mk @@ -103,7 +103,8 @@ $(eval $(call gb_CppunitTest_use_components,sc_spreadsheetsobj,\ sc/util/sc \ sc/util/scd \ sc/util/scfilt \ - sc/util/vbaobj \ + $(if $(filter TRUE,$(DISABLE_SCRIPTING)),, \ + sc/util/vbaobj) \ scripting/source/basprov/basprov \ scripting/util/scriptframe \ sfx2/util/sfx \ diff --git a/sc/CppunitTest_sc_ucalc.mk b/sc/CppunitTest_sc_ucalc.mk index 4f761856a68a..3151f14ed5de 100644 --- a/sc/CppunitTest_sc_ucalc.mk +++ b/sc/CppunitTest_sc_ucalc.mk @@ -101,6 +101,7 @@ $(eval $(call gb_CppunitTest_use_components,sc_ucalc,\ ucb/source/core/ucb1 \ ucb/source/ucp/file/ucpfile1 \ unoxml/source/service/unoxml \ + uui/util/uui \ )) $(eval $(call gb_CppunitTest_use_configuration,sc_ucalc)) diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk index 9bc420fdbde0..f4cdafa8dbb7 100644 --- a/sc/Library_sc.mk +++ b/sc/Library_sc.mk @@ -329,6 +329,10 @@ $(eval $(call gb_Library_add_exception_objects,sc,\ sc/source/ui/cctrl/popmenu \ sc/source/ui/cctrl/tbinsert \ sc/source/ui/cctrl/tbzoomsliderctrl \ + sc/source/ui/condformat/condformatdlg \ + sc/source/ui/condformat/condformatdlgentry \ + sc/source/ui/condformat/condformathelper \ + sc/source/ui/condformat/colorformat \ sc/source/ui/dbgui/asciiopt \ sc/source/ui/dbgui/consdlg \ sc/source/ui/dbgui/csvcontrol \ diff --git a/sc/Library_scui.mk b/sc/Library_scui.mk index 0cc40992aa37..b1eb7720f247 100644 --- a/sc/Library_scui.mk +++ b/sc/Library_scui.mk @@ -38,6 +38,7 @@ $(eval $(call gb_Library_use_external,scui,mdds_headers)) $(eval $(call gb_Library_use_libraries,scui,\ comphelper \ cppu \ + cppuhelper \ editeng \ for \ forui \ @@ -62,9 +63,6 @@ $(eval $(call gb_Library_add_exception_objects,scui,\ sc/source/ui/attrdlg/scuiexp \ sc/source/ui/attrdlg/tabpages \ sc/source/ui/cctrl/editfield \ - sc/source/ui/condformat/colorformat \ - sc/source/ui/condformat/condformatdlg \ - sc/source/ui/condformat/condformathelper \ sc/source/ui/condformat/condformatmgr \ sc/source/ui/dbgui/dapidata \ sc/source/ui/dbgui/dapitype \ diff --git a/sc/inc/attarray.hxx b/sc/inc/attarray.hxx index 1f8d9f21e49f..6598341123ca 100644 --- a/sc/inc/attarray.hxx +++ b/sc/inc/attarray.hxx @@ -96,7 +96,7 @@ friend class ScDocument; // for FillInfo friend class ScDocumentIterator; friend class ScAttrIterator; friend class ScHorizontalAttrIterator; -friend void lcl_IterGetNumberFormat( sal_uLong& nFormat, +friend void ScAttrArray_IterGetNumberFormat( sal_uLong& nFormat, const ScAttrArray*& rpArr, SCROW& nAttrEndRow, const ScAttrArray* pNewArr, SCROW nRow, ScDocument* pDoc ); @@ -138,6 +138,9 @@ public: void ApplyLineStyleArea( SCROW nStartRow, SCROW nEndRow, const ::editeng::SvxBorderLine* pLine, bool bColorOnly ); + void AddCondFormat( SCROW nStartRow, SCROW nEndRow, sal_uInt32 nIndex ); + void RemoveCondFormat( SCROW nStartRow, SCROW nEndRow, sal_uInt32 nIndex ); + void ClearItems( SCROW nStartRow, SCROW nEndRow, const sal_uInt16* pWhich ); void ChangeIndent( SCROW nStartRow, SCROW nEndRow, bool bIncrement ); diff --git a/sc/inc/attrib.hxx b/sc/inc/attrib.hxx index 0418d78723ed..eb051fd8e1ac 100644 --- a/sc/inc/attrib.hxx +++ b/sc/inc/attrib.hxx @@ -393,6 +393,30 @@ private: sal_uInt16 mnHeight; }; +class ScCondFormatItem : public SfxPoolItem +{ +public: + TYPEINFO(); + + explicit ScCondFormatItem(); + explicit ScCondFormatItem(sal_uInt32 nIndex); + explicit ScCondFormatItem(const std::vector<sal_uInt32>& nIndex); + + virtual ~ScCondFormatItem(); + + virtual int operator==(const SfxPoolItem& rCmp ) const; + virtual ScCondFormatItem* Clone( SfxItemPool* = 0 ) const; + + const std::vector<sal_uInt32>& GetCondFormatData() const; + void AddCondFormatData( sal_uInt32 nIndex ); + void SetCondFormatData( const std::vector<sal_uInt32>& aIndex ); + void RemoveCondFormatData( sal_uInt32 nIndex ); + +private: + + std::vector<sal_uInt32> maIndex; +}; + // ============================================================================ #endif diff --git a/sc/inc/colorscale.hxx b/sc/inc/colorscale.hxx index df3e17a66507..92f88f3359b4 100644 --- a/sc/inc/colorscale.hxx +++ b/sc/inc/colorscale.hxx @@ -45,16 +45,18 @@ class ScFormulaCell; class ScTokenArray; struct ScDataBarInfo; +// don't change the order +// they are also used in the dialog to determine the position +// in the list box enum ScColorScaleEntryType { - COLORSCALE_VALUE, + COLORSCALE_AUTO, COLORSCALE_MIN, COLORSCALE_MAX, - COLORSCALE_PERCENT, COLORSCALE_PERCENTILE, + COLORSCALE_VALUE, + COLORSCALE_PERCENT, COLORSCALE_FORMULA, - COLORSCALE_AUTOMIN, - COLORSCALE_AUTOMAX }; class SC_DLLPUBLIC ScColorScaleEntry @@ -189,10 +191,24 @@ public: virtual void DataChanged(const ScRange& rRange) = 0; virtual void SetParent(ScConditionalFormat* pParent); + virtual void startRendering(); + virtual void endRendering(); + protected: - void getValues( std::vector<double>& rValues ) const; + std::vector<double>& getValues() const; + + double getMinValue() const; + double getMaxValue() const; ScConditionalFormat* mpParent; + +private: + + struct ScColorFormatCache + { + std::vector<double> maValues; + }; + mutable boost::scoped_ptr<ScColorFormatCache> mpCache; }; class SC_DLLPUBLIC ScColorScaleFormat : public ScColorFormat diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index 34e05cbc6368..3206637e7cfe 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -317,6 +317,8 @@ public: void ApplySelectionStyle(const ScStyleSheet& rStyle, const ScMarkData& rMark); void ApplySelectionLineStyle( const ScMarkData& rMark, const ::editeng::SvxBorderLine* pLine, bool bColorOnly ); + void AddCondFormat(SCROW nStartRow, SCROW nEndRow, sal_uInt32 nIndex ); + void RemoveCondFormat(SCROW nStartRow, SCROW nEndRow, sal_uInt32 nIndex ); const ScStyleSheet* GetStyle( SCROW nRow ) const; const ScStyleSheet* GetSelectionStyle( const ScMarkData& rMark, bool& rFound ) const; diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx index 32a54f8202f7..86e46c5723ce 100644 --- a/sc/inc/compiler.hxx +++ b/sc/inc/compiler.hxx @@ -130,7 +130,7 @@ struct ScRawToken: private ScRawTokenBase // Friends that use a temporary ScRawToken on the stack (and therefor need // the private dtor) and know what they're doing.. friend class ScTokenArray; - friend sal_uInt16 lcl_ScRawTokenOffset(); + static sal_uInt16 sbyteOffset(); public: union { double nValue; diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index da7b57521025..390002e98664 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -358,9 +358,6 @@ private: bool bIsEmbedded; // display/adjust Embedded area? - // no SetDirty for ScFormulaCell::CompileTokenArray but at the end of - // ScDocument::CompileAll[WithFormats], CopyScenario, CopyBlockFromClip - bool bNoSetDirty; // no broadcast, construct no listener during insert from a different // Doc (per filter or the like ), not until CompileAll / CalcAfterLoad bool bInsertingFromOtherDoc; @@ -1155,6 +1152,8 @@ public: SC_DLLPUBLIC const ScPatternAttr* GetMostUsedPattern( SCCOL nCol, SCROW nStartRow, SCROW nEndRow, SCTAB nTab ) const; const ScPatternAttr* GetSelectionPattern( const ScMarkData& rMark, bool bDeep = true ); ScPatternAttr* CreateSelectionPattern( const ScMarkData& rMark, bool bDeep = true ); + SC_DLLPUBLIC void AddCondFormatData( const ScRangeList& rRange, SCTAB nTab, sal_uInt32 nIndex ); + void RemoveCondFormatData( const ScRangeList& rRange, SCTAB nTab, sal_uInt32 nIndex ); SC_DLLPUBLIC ScConditionalFormat* GetCondFormat( SCCOL nCol, SCROW nRow, SCTAB nTab ) const; SC_DLLPUBLIC const SfxItemSet* GetCondResult( SCCOL nCol, SCROW nRow, SCTAB nTab ) const; @@ -1189,7 +1188,6 @@ public: SC_DLLPUBLIC sal_uLong AddCondFormat( ScConditionalFormat* pNew, SCTAB nTab ); void DeleteConditionalFormat( sal_uLong nIndex, SCTAB nTab ); - SC_DLLPUBLIC void FindConditionalFormat( sal_uLong nKey, ScRangeList& rRanges, SCTAB nTab ); void ConditionalChanged( sal_uLong nKey, SCTAB nTab ); void SetCondFormList( ScConditionalFormatList* pList, SCTAB nTab ); @@ -1549,8 +1547,6 @@ public: SC_DLLPUBLIC sal_uInt32 GetRangeOverflowType() const { return nRangeOverflowType; } // for broadcasting/listening - void SetNoSetDirty( bool bVal ) { bNoSetDirty = bVal; } - bool GetNoSetDirty() const { return bNoSetDirty; } void SetInsertingFromOtherDoc( bool bVal ) { bInsertingFromOtherDoc = bVal; } bool IsInsertingFromOtherDoc() const { return bInsertingFromOtherDoc; } void SetLoadingMedium( bool bVal ); diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index 51cebf39f182..efec7ab11b6a 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -250,7 +250,9 @@ #define SID_OPENDLG_OPTSOLVER (SC_MESSAGE_START + 60) #define SID_VALIDITY_REFERENCE (SC_MESSAGE_START + 61) #define SID_OPENDLG_CONDFRMT_MANAGER (SC_MESSAGE_START + 62) -#define SC_HINT_NAVIGATOR_UPDATEALL (SC_MESSAGE_START + 65) +#define SC_HINT_NAVIGATOR_UPDATEALL (SC_MESSAGE_START + 65) +#define SID_OPENDLG_COLORSCALE (SC_MESSAGE_START + 66) +#define SID_OPENDLG_DATABAR (SC_MESSAGE_START + 67) // functions @@ -527,6 +529,9 @@ #define SID_NEW_SLOTS (SID_KEYFUNC_END) #define SID_NEW_TABLENAME (SID_NEW_SLOTS+1) + +#define SID_EXPORT_AS_GRAPHIC (SID_NEW_SLOTS+2) + #define FID_MERGE_TOGGLE (SID_NEW_SLOTS+10) #define SID_ATTR_ROWHEADERS (SID_NEW_SLOTS+11) #define SID_ATTR_COLHEADERS (SID_NEW_SLOTS+12) @@ -1124,4 +1129,3 @@ #define RID_SCPAGE_DEFAULTS (SC_OOO_BUILD_START + 10) #endif - diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx index 7081ddb5b4b0..d09027cad4cf 100644 --- a/sc/inc/scabstdlg.hxx +++ b/sc/inc/scabstdlg.hxx @@ -84,20 +84,12 @@ public: virtual sal_Bool IsRow() = 0; }; -class AbstractScCondFormatDlg : public VclAbstractDialog -{ -public: - virtual ScConditionalFormat* GetConditionalFormat() = 0; -}; - class AbstractScCondFormatManagerDlg : public VclAbstractDialog { public: virtual ScConditionalFormatList* GetConditionalFormatList() = 0; -}; -class AbstractScDataBarSettingsDlg : public VclAbstractDialog -{ + virtual bool CondFormatsChanged() = 0; }; class AbstractScDataPilotDatabaseDlg :public VclAbstractDialog //add for ScDataPilotDatabaseDlg @@ -363,14 +355,9 @@ public: sal_Bool bColDefault = sal_True ) = 0; virtual VclAbstractDialog * CreateScSortWarningDlg ( Window* pParent, const String& rExtendText, const String& rCurrentText, int nId ) = 0; //add for ScSortWarningDlg - virtual AbstractScCondFormatDlg* CreateScCondFormatDlg (Window* pParent, ScDocument* pDoc, const ScConditionalFormat* pFormat, - const ScRangeList& rList, const ScAddress& rPos, int nId ) = 0; //add for ScCondFormatDlg - virtual AbstractScCondFormatManagerDlg* CreateScCondFormatMgrDlg(Window* pParent, ScDocument* pDoc, const ScConditionalFormatList* pFormatList, const ScAddress& rPos, int nId ) = 0; - virtual AbstractScDataBarSettingsDlg* CreateScDataBarSetttingsDlg (Window* pParent, ScDocument* pDoc, int nId ) = 0; //add for ScDataBarSettingsDlg - virtual AbstractScDataPilotDatabaseDlg * CreateScDataPilotDatabaseDlg (Window* pParent ,int nId ) = 0; //add for ScDataPilotDatabaseDlg virtual AbstractScDataPilotSourceTypeDlg * CreateScDataPilotSourceTypeDlg ( Window* pParent, sal_Bool bEnableExternal, int nId ) = 0; //add for ScDataPilotSourceTypeDlg diff --git a/sc/inc/scitems.hxx b/sc/inc/scitems.hxx index 57073f34e36a..e644854373f0 100644 --- a/sc/inc/scitems.hxx +++ b/sc/inc/scitems.hxx @@ -117,53 +117,52 @@ #define ATTR_SHADOW 152 #define ATTR_VALIDDATA 153 #define ATTR_CONDITIONAL 154 -#define ATTR_COLORSCALE 155 -#define ATTR_PATTERN_END 155 // end cell-attribute-pattern +#define ATTR_PATTERN_END 154 // end cell-attribute-pattern -#define ATTR_PATTERN 156 +#define ATTR_PATTERN 155 // page attributes -#define ATTR_LRSPACE 157 // editor: PageDesc-TabPage -#define ATTR_ULSPACE 158 -#define ATTR_PAGE 159 -#define ATTR_PAGE_PAPERTRAY 160 -#define ATTR_PAGE_PAPERBIN 161 -#define ATTR_PAGE_SIZE 162 -#define ATTR_PAGE_MAXSIZE 163 -#define ATTR_PAGE_HORCENTER 164 -#define ATTR_PAGE_VERCENTER 165 - -#define ATTR_PAGE_ON 166 // editor: header/footer-page -#define ATTR_PAGE_DYNAMIC 167 -#define ATTR_PAGE_SHARED 168 - -#define ATTR_PAGE_NOTES 169 // editor: table -#define ATTR_PAGE_GRID 170 -#define ATTR_PAGE_HEADERS 171 -#define ATTR_PAGE_CHARTS 172 -#define ATTR_PAGE_OBJECTS 173 -#define ATTR_PAGE_DRAWINGS 174 -#define ATTR_PAGE_TOPDOWN 175 -#define ATTR_PAGE_SCALE 176 -#define ATTR_PAGE_SCALETOPAGES 177 -#define ATTR_PAGE_FIRSTPAGENO 178 - -#define ATTR_PAGE_PRINTAREA 179 // editor: print areas -#define ATTR_PAGE_REPEATROW 180 -#define ATTR_PAGE_REPEATCOL 181 -#define ATTR_PAGE_PRINTTABLES 182 - -#define ATTR_PAGE_HEADERLEFT 183 // contents of header/ -#define ATTR_PAGE_FOOTERLEFT 184 // footer (left) -#define ATTR_PAGE_HEADERRIGHT 185 // contents of header/ -#define ATTR_PAGE_FOOTERRIGHT 186 // footer (right) -#define ATTR_PAGE_HEADERSET 187 // the corresponding sets -#define ATTR_PAGE_FOOTERSET 188 - -#define ATTR_PAGE_FORMULAS 189 -#define ATTR_PAGE_NULLVALS 190 - -#define ATTR_PAGE_SCALETO 191 // #i8868# scale printout to width/height +#define ATTR_LRSPACE 156 // editor: PageDesc-TabPage +#define ATTR_ULSPACE 157 +#define ATTR_PAGE 158 +#define ATTR_PAGE_PAPERTRAY 159 +#define ATTR_PAGE_PAPERBIN 160 +#define ATTR_PAGE_SIZE 161 +#define ATTR_PAGE_MAXSIZE 162 +#define ATTR_PAGE_HORCENTER 163 +#define ATTR_PAGE_VERCENTER 164 + +#define ATTR_PAGE_ON 165 // editor: header/footer-page +#define ATTR_PAGE_DYNAMIC 166 +#define ATTR_PAGE_SHARED 167 + +#define ATTR_PAGE_NOTES 168 // editor: table +#define ATTR_PAGE_GRID 169 +#define ATTR_PAGE_HEADERS 170 +#define ATTR_PAGE_CHARTS 171 +#define ATTR_PAGE_OBJECTS 172 +#define ATTR_PAGE_DRAWINGS 173 +#define ATTR_PAGE_TOPDOWN 174 +#define ATTR_PAGE_SCALE 175 +#define ATTR_PAGE_SCALETOPAGES 176 +#define ATTR_PAGE_FIRSTPAGENO 177 + +#define ATTR_PAGE_PRINTAREA 178 // editor: print areas +#define ATTR_PAGE_REPEATROW 179 +#define ATTR_PAGE_REPEATCOL 180 +#define ATTR_PAGE_PRINTTABLES 181 + +#define ATTR_PAGE_HEADERLEFT 182 // contents of header/ +#define ATTR_PAGE_FOOTERLEFT 183 // footer (left) +#define ATTR_PAGE_HEADERRIGHT 184 // contents of header/ +#define ATTR_PAGE_FOOTERRIGHT 185 // footer (right) +#define ATTR_PAGE_HEADERSET 186 // the corresponding sets +#define ATTR_PAGE_FOOTERSET 187 + +#define ATTR_PAGE_FORMULAS 188 +#define ATTR_PAGE_NULLVALS 189 + +#define ATTR_PAGE_SCALETO 190 // #i8868# scale printout to width/height #define ATTR_ENDINDEX ATTR_PAGE_SCALETO // end of pool-range diff --git a/sc/inc/shapeuno.hxx b/sc/inc/shapeuno.hxx index 3c1c0e76b6ed..c376f14e2f53 100644 --- a/sc/inc/shapeuno.hxx +++ b/sc/inc/shapeuno.hxx @@ -72,7 +72,7 @@ class ScShapeObj :public ScShapeObj_Base ,public ScShapeObj_TextBase { private: -friend ScMacroInfo* lcl_getShapeHyperMacroInfo( ScShapeObj* pShape, sal_Bool bCreate ); + friend ScMacroInfo* ScShapeObj_getShapeHyperMacroInfo( ScShapeObj* pShape, sal_Bool bCreate ); ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation > mxShapeAgg; // cached pointers to avoid repeated queryAggregation calls: ::com::sun::star::beans::XPropertySet* pShapePropertySet; diff --git a/sc/inc/stlsheet.hxx b/sc/inc/stlsheet.hxx index 2e5c13072869..c66d53642b4e 100644 --- a/sc/inc/stlsheet.hxx +++ b/sc/inc/stlsheet.hxx @@ -51,17 +51,17 @@ public: ScStyleSheet( const ScStyleSheet& rStyle ); - virtual sal_Bool SetParent ( const String& rParentName ); + virtual bool SetParent ( const String& rParentName ); virtual SfxItemSet& GetItemSet (); - virtual sal_Bool IsUsed () const; - virtual sal_Bool HasFollowSupport () const; - virtual sal_Bool HasParentSupport () const; + virtual bool IsUsed () const; + virtual bool HasFollowSupport () const; + virtual bool HasParentSupport () const; virtual const String& GetName() const; virtual const String& GetParent() const; virtual const String& GetFollow() const; - virtual sal_Bool SetName( const String& ); + virtual bool SetName( const String& ); void SetUsage( ScStyleSheet::Usage eUse ) const { eUsage = eUse; } diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index 2b205e5c3042..c630cb743574 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -543,6 +543,8 @@ public: void SetPattern( SCCOL nCol, SCROW nRow, const ScPatternAttr& rAttr, bool bPutToPool = false ); void ApplyPatternIfNumberformatIncompatible( const ScRange& rRange, const ScPatternAttr& rPattern, short nNewType ); + void AddCondFormatData( const ScRangeList& rRange, sal_uInt32 nIndex ); + void RemoveCondFormatData( const ScRangeList& rRange, sal_uInt32 nIndex ); void ApplyStyle( SCCOL nCol, SCROW nRow, const ScStyleSheet& rStyle ); void ApplyStyleArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, const ScStyleSheet& rStyle ); @@ -777,8 +779,6 @@ public: SCCOL nCol, SCROW nRowStart, SCROW nRowEnd ) const; - void FindConditionalFormat( sal_uLong nKey, ScRangeList& rRanges ) const; - void IncRecalcLevel(); void DecRecalcLevel( bool bUpdateNoteCaptionPos = true ); diff --git a/sc/inc/xmlwrap.hxx b/sc/inc/xmlwrap.hxx index e30df936708e..2e378a4a1d09 100644 --- a/sc/inc/xmlwrap.hxx +++ b/sc/inc/xmlwrap.hxx @@ -38,7 +38,7 @@ namespace com { namespace sun { namespace star { namespace uno { class XInterface; } namespace embed { class XStorage; } namespace xml { - namespace sax { struct InputSource; } } + namespace sax { struct InputSource; class XParser; } } } } } class ScXMLImportWrapper @@ -51,7 +51,7 @@ class ScXMLImportWrapper sal_uInt32 ImportFromComponent(com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory>& xServiceFactory, com::sun::star::uno::Reference<com::sun::star::frame::XModel>& xModel, - com::sun::star::uno::Reference<com::sun::star::uno::XInterface>& xXMLParser, + com::sun::star::uno::Reference<com::sun::star::xml::sax::XParser>& xParser, com::sun::star::xml::sax::InputSource& aParserInput, const rtl::OUString& sComponentName, const rtl::OUString& sDocName, const rtl::OUString& sOldDocName, com::sun::star::uno::Sequence<com::sun::star::uno::Any>& aArgs, diff --git a/sc/qa/unit/rangelst_test.cxx b/sc/qa/unit/rangelst_test.cxx index 2c618a5ebcd8..b5381eceeee3 100644 --- a/sc/qa/unit/rangelst_test.cxx +++ b/sc/qa/unit/rangelst_test.cxx @@ -36,6 +36,8 @@ public: void testDeleteArea_2Ranges_Case8(); void testDeleteArea_1Range(); void testDeleteArea_0Ranges(); + void testJoin_Case1(); + void testJoin_Case2(); void testUpdateReference_DeleteRow(); void testUpdateReference_DeleteCol(); @@ -57,6 +59,8 @@ public: CPPUNIT_TEST(testDeleteArea_2Ranges_Case8); CPPUNIT_TEST(testDeleteArea_1Range); CPPUNIT_TEST(testDeleteArea_0Ranges); + CPPUNIT_TEST(testJoin_Case1); + CPPUNIT_TEST(testJoin_Case2); CPPUNIT_TEST(testUpdateReference_DeleteRow); CPPUNIT_TEST(testUpdateReference_DeleteCol); CPPUNIT_TEST_SUITE_END(); @@ -384,6 +388,29 @@ void Test::testDeleteArea_0Ranges() CPPUNIT_ASSERT(aList.empty()); } +void Test::testJoin_Case1() +{ + ScRangeList aList; + aList.push_back(new ScRange(1,1,0,3,3,0)); + aList.Join(ScRange(4,1,0,6,3,0)); + + CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aList.size()); + CPPUNIT_ASSERT( ScRange(1,1,0,6,3,0) == *aList[0]); +} + +void Test::testJoin_Case2() +{ + ScRangeList aList; + aList.push_back(new ScRange(1,1,0,3,3,0)); + aList.push_back(new ScRange(4,1,0,6,3,0)); + aList.push_back(new ScRange(7,1,0,9,3,0)); + + aList.Join(*aList[2], true); + + CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), aList.size()); + CPPUNIT_ASSERT(ScRange(1,1,0,9,3,0) == *aList[0]); +} + void Test::testUpdateReference_DeleteRow() { ScRangeList aList(ScRange(1,1,0,4,4,0)); diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 1bcd5a83ae9a..8eef4104ec99 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -224,6 +224,7 @@ public: void testFindAreaPosRowDown(); void testFindAreaPosColRight(); void testSort(); + void testSortWithFormulaRefs(); CPPUNIT_TEST_SUITE(Test); CPPUNIT_TEST(testCollator); @@ -273,6 +274,7 @@ public: CPPUNIT_TEST(testFindAreaPosRowDown); CPPUNIT_TEST(testFindAreaPosColRight); CPPUNIT_TEST(testSort); + CPPUNIT_TEST(testSortWithFormulaRefs); CPPUNIT_TEST_SUITE_END(); private: @@ -4920,6 +4922,71 @@ void Test::testFindAreaPosColRight() pDoc->DeleteTab(0); } +// regression test fo fdo#53814, sorting doens't work as expected +// if cells in the sort are referenced by formulas +void Test::testSortWithFormulaRefs() +{ + ScDocument* pDoc = m_xDocShRef->GetDocument(); + rtl::OUString aTabName1("List1"); + rtl::OUString aTabName2("List2"); + pDoc->InsertTab(0, aTabName1); + pDoc->InsertTab(1, aTabName2); + + const char* aFormulaData[6] = { + "=IF($List1.A2<>\"\",$List1.A2,\"\")", + "=IF($List1.A3<>\"\",$List1.A3,\"\")", + "=IF($List1.A4<>\"\",$List1.A4,\"\")", + "=IF($List1.A5<>\"\",$List1.A5,\"\")", + "=IF($List1.A6<>\"\",$List1.A6,\"\")", + "=IF($List1.A7<>\"\",$List1.A7,\"\")", + }; + + const char* aTextData[4] = { + "bob", + "tim", + "brian", + "larry", + }; + + const char* aResults[ 6 ] = { + "bob", + "brian", + "larry", + "tim", + "", + "", + }; + // insert data to sort + SCROW nStart = 1, nEnd = 4; + for ( SCROW i = nStart; i <= nEnd; ++i ) + pDoc->SetString( 0, i, 0, rtl::OUString::createFromAscii(aTextData[i-1]) ); + // insert forumulas + nStart = 0; + nEnd = SAL_N_ELEMENTS(aFormulaData); + for ( SCROW i = nStart; i < nEnd; ++i ) + pDoc->SetString( 0, i, 1, rtl::OUString::createFromAscii(aFormulaData[i]) ); + + ScSortParam aSortData; + aSortData.nCol1 = 0; + aSortData.nCol2 = 0; + aSortData.nRow1 = 1; + aSortData.nRow2 = 7; + aSortData.maKeyState[0].bDoSort = true; + aSortData.maKeyState[0].nField = 0; + + pDoc->Sort(0, aSortData, false, NULL); + + nEnd = SAL_N_ELEMENTS( aResults ); + for ( SCROW i = nStart; i < nEnd; ++i ) + { + rtl::OUString sResult; + pDoc->GetString( 0, i + 1, 0, sResult ); + CPPUNIT_ASSERT_EQUAL( rtl::OUString::createFromAscii( aResults[ i ] ), sResult ); + } + pDoc->DeleteTab(0); + pDoc->DeleteTab(1); +} + void Test::testSort() { ScDocument* pDoc = m_xDocShRef->GetDocument(); diff --git a/sc/sdi/cellsh.sdi b/sc/sdi/cellsh.sdi index 77eea5c9fb78..1086fd547e6a 100644 --- a/sc/sdi/cellsh.sdi +++ b/sc/sdi/cellsh.sdi @@ -188,7 +188,9 @@ interface CellSelection FID_USE_NAME [ ExecMethod = ExecuteEdit; StateMethod = GetState; ] SID_CANCEL [ ExecMethod = Execute; ] SID_TOGGLE_REL [ ExecMethod = ExecuteEdit; StateMethod = GetState; ] - SID_OPENDLG_CONDFRMT [ ExecMethod = ExecuteEdit; ] + SID_OPENDLG_CONDFRMT [ ExecMethod = ExecuteEdit; StateMethod = GetState; ] + SID_OPENDLG_COLORSCALE [ ExecMethod = ExecuteEdit; ] + SID_OPENDLG_DATABAR [ ExecMethod = ExecuteEdit; ] SID_OPENDLG_CONDFRMT_MANAGER [ ExecMethod = ExecuteEdit; ] SID_COLORSCALE [ ExecMethod = ExecuteEdit; ] SID_DATABAR [ ExecMethod = ExecuteEdit; ] diff --git a/sc/sdi/chartsh.sdi b/sc/sdi/chartsh.sdi index c050a7c59b82..ce000437afa4 100644 --- a/sc/sdi/chartsh.sdi +++ b/sc/sdi/chartsh.sdi @@ -16,7 +16,16 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ - // =========================================================================== +interface ChartSelection +{ + SID_EXPORT_AS_GRAPHIC + [ + ExecMethod = ExecuteExportAsGraphic; + StateMethod = GetExportAsGraphicState; + ] +} + shell ScChartShell : ScDrawShell { + import ChartSelection; } diff --git a/sc/sdi/graphsh.sdi b/sc/sdi/graphsh.sdi index 6eb051bc5eaf..6c9ae7a0d440 100644 --- a/sc/sdi/graphsh.sdi +++ b/sc/sdi/graphsh.sdi @@ -140,6 +140,12 @@ interface GraphSelection ExecMethod = ExecuteExternalEdit; StateMethod = GetExternalEditState; ] + + SID_COMPRESS_GRAPHIC + [ + ExecMethod = ExecuteCompressGraphic; + StateMethod = GetCompressGraphicState; + ] } // =========================================================================== diff --git a/sc/sdi/scalc.sdi b/sc/sdi/scalc.sdi index f9d70578e9bf..8e0cf31d6b4a 100644 --- a/sc/sdi/scalc.sdi +++ b/sc/sdi/scalc.sdi @@ -24,7 +24,7 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -//-------------------------------------------------------------------------- + SfxVoidItem AcceptChanges FID_CHG_ACCEPT () [ @@ -1094,6 +1094,56 @@ SfxVoidItem ConditionalFormatDialog SID_OPENDLG_CONDFRMT ] //-------------------------------------------------------------------------- +SfxVoidItem ColorScaleFormatDialog SID_OPENDLG_COLORSCALE +() +[ + /* flags: */ + AutoUpdate = FALSE, + Cachable = Cachable, + FastCall = FALSE, + HasCoreId = FALSE, + HasDialog = TRUE, + ReadOnlyDoc = TRUE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + /* config: */ + AccelConfig = TRUE, + MenuConfig = TRUE, + StatusBarConfig = FALSE, + ToolBoxConfig = TRUE, + GroupId = GID_FORMAT; +] + +//-------------------------------------------------------------------------- +SfxVoidItem DataBarFormatDialog SID_OPENDLG_DATABAR +() +[ + /* flags: */ + AutoUpdate = FALSE, + Cachable = Cachable, + FastCall = FALSE, + HasCoreId = FALSE, + HasDialog = TRUE, + ReadOnlyDoc = TRUE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + /* config: */ + AccelConfig = TRUE, + MenuConfig = TRUE, + StatusBarConfig = FALSE, + ToolBoxConfig = TRUE, + GroupId = GID_FORMAT; +] + +//-------------------------------------------------------------------------- SfxVoidItem ConditionalFormatManagerDialog SID_OPENDLG_CONDFRMT_MANAGER () [ @@ -2869,10 +2919,10 @@ SfxVoidItem SolverDialog SID_OPENDLG_OPTSOLVER Synchron; /* config: */ - AccelConfig = FALSE, - MenuConfig = FALSE, - StatusBarConfig = FALSE, - ToolBoxConfig = FALSE, + AccelConfig = FALSE, + MenuConfig = FALSE, + StatusBarConfig = FALSE, + ToolBoxConfig = FALSE, GroupId = GID_OPTIONS; ] @@ -8292,3 +8342,27 @@ SfxVoidItem EnterString SID_ENTER_STRING ToolBoxConfig = FALSE, GroupId = GID_INTERN; ] + +SfxVoidItem ExportAsGraphic SID_EXPORT_AS_GRAPHIC +() +[ + /* flags: */ + AutoUpdate = FALSE, + Cachable = Cachable, + FastCall = FALSE, + HasCoreId = FALSE, + HasDialog = FALSE, + ReadOnlyDoc = TRUE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + /* config: */ + AccelConfig = TRUE, + MenuConfig = TRUE, + StatusBarConfig = FALSE, + ToolBoxConfig = TRUE, + GroupId = GID_CHART; +] diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx index bcba4dee6bec..39658902fd5c 100644 --- a/sc/source/core/data/attarray.cxx +++ b/sc/source/core/data/attarray.cxx @@ -273,6 +273,106 @@ const ScPatternAttr* ScAttrArray::GetPatternRange( SCROW& rStartRow, return NULL; } +void ScAttrArray::AddCondFormat( SCROW nStartRow, SCROW nEndRow, sal_uInt32 nIndex ) +{ + if(!VALIDROW(nStartRow) || !VALIDROW(nEndRow)) + return; + + if(nEndRow < nStartRow) + return; + + SCROW nTempStartRow = nStartRow; + SCROW nTempEndRow = nEndRow; + + do + { + const ScPatternAttr* pPattern = GetPattern(nTempStartRow); + + ScPatternAttr aPattern( pDocument->GetPool() ); + if(pPattern) + { + SCROW nPatternStartRow; + SCROW nPatternEndRow; + GetPatternRange( nPatternStartRow, nPatternEndRow, nTempStartRow ); + + nTempEndRow = std::min<SCROW>( nPatternEndRow, nEndRow ); + const SfxPoolItem* pItem = NULL; + pPattern->GetItemSet().GetItemState( ATTR_CONDITIONAL, true, &pItem ); + std::vector< sal_uInt32 > aCondFormatData; + if(pItem) + aCondFormatData = static_cast<const ScCondFormatItem*>(pItem)->GetCondFormatData(); + aCondFormatData.push_back(nIndex); + + ScCondFormatItem aItem; + aItem.SetCondFormatData( aCondFormatData ); + aPattern.GetItemSet().Put( aItem ); + } + else + { + ScCondFormatItem aItem; + aItem.AddCondFormatData(nIndex); + aPattern.GetItemSet().Put( aItem ); + nTempEndRow = nEndRow; + } + + SetPatternArea( nTempStartRow, nTempEndRow, &aPattern, true ); + nTempStartRow = nTempEndRow + 1; + } + while(nTempEndRow < nEndRow); + +} + +void ScAttrArray::RemoveCondFormat( SCROW nStartRow, SCROW nEndRow, sal_uInt32 nIndex ) +{ + if(!VALIDROW(nStartRow) || !VALIDROW(nEndRow)) + return; + + if(nEndRow < nStartRow) + return; + + SCROW nTempStartRow = nStartRow; + SCROW nTempEndRow = nEndRow; + + do + { + const ScPatternAttr* pPattern = GetPattern(nTempStartRow); + + ScPatternAttr aPattern( pDocument->GetPool() ); + if(pPattern) + { + SCROW nPatternStartRow; + SCROW nPatternEndRow; + GetPatternRange( nPatternStartRow, nPatternEndRow, nTempStartRow ); + + nTempEndRow = std::min<SCROW>( nPatternEndRow, nEndRow ); + const SfxPoolItem* pItem = NULL; + pPattern->GetItemSet().GetItemState( ATTR_CONDITIONAL, true, &pItem ); + if(pItem) + { + std::vector< sal_uInt32 > aCondFormatData = static_cast<const ScCondFormatItem*>(pItem)->GetCondFormatData(); + std::vector<sal_uInt32>::iterator itr = std::find(aCondFormatData.begin(), aCondFormatData.end(), nIndex); + if(itr != aCondFormatData.end()) + { + ScCondFormatItem aItem; + aCondFormatData.erase(itr); + aItem.SetCondFormatData( aCondFormatData ); + aPattern.GetItemSet().Put( aItem ); + SetPatternArea( nTempStartRow, nTempEndRow, &aPattern, true ); + } + + } + } + else + { + return; + } + + nTempStartRow = nTempEndRow + 1; + } + while(nTempEndRow < nEndRow); + +} + //------------------------------------------------------------------------ void ScAttrArray::SetPattern( SCROW nRow, const ScPatternAttr* pPattern, bool bPutToPool ) @@ -799,7 +899,7 @@ bool ScAttrArray::SetAttrEntries(ScAttrEntry* pNewData, SCSIZE nSize) return true; } -void lcl_MergeDeep( SfxItemSet& rMergeSet, const SfxItemSet& rSource ) +static void lcl_MergeDeep( SfxItemSet& rMergeSet, const SfxItemSet& rSource ) { const SfxPoolItem* pNewItem; const SfxPoolItem* pOldItem; @@ -886,7 +986,7 @@ void ScAttrArray::MergePatternArea( SCROW nStartRow, SCROW nEndRow, // assemble border -bool lcl_TestAttr( const SvxBorderLine* pOldLine, const SvxBorderLine* pNewLine, +static bool lcl_TestAttr( const SvxBorderLine* pOldLine, const SvxBorderLine* pNewLine, sal_uInt8& rModified, const SvxBorderLine*& rpNew ) { if (rModified == SC_LINE_DONTCARE) @@ -918,7 +1018,7 @@ bool lcl_TestAttr( const SvxBorderLine* pOldLine, const SvxBorderLine* pNewLine, } -void lcl_MergeToFrame( SvxBoxItem* pLineOuter, SvxBoxInfoItem* pLineInner, +static void lcl_MergeToFrame( SvxBoxItem* pLineOuter, SvxBoxInfoItem* pLineInner, ScLineFlags& rFlags, const ScPatternAttr* pPattern, bool bLeft, SCCOL nDistRight, bool bTop, SCROW nDistBottom ) { @@ -1108,31 +1208,6 @@ void ScAttrArray::ApplyBlockFrame( const SvxBoxItem* pLineOuter, const SvxBoxInf } } - -long lcl_LineSize( const SvxBorderLine& rLine ) -{ - // only one line -> half width, min. 20 - // double line -> half line spacing + (per min. 20) - - long nTotal = 0; - sal_uInt16 nWidth = Max( rLine.GetOutWidth(), rLine.GetInWidth() ); - sal_uInt16 nDist = rLine.GetDistance(); - if (nDist) - { - OSL_ENSURE( rLine.GetOutWidth() && rLine.GetInWidth(), - "Line has a distance, but only a width?" ); - - nTotal += ( nDist > 20 ) ? nDist : 20; - nTotal += ( nWidth > 20 ) ? nWidth : 20; - } - else if (nWidth) - nTotal += ( nWidth > 20 ) ? nWidth : 20; - - // also halved ? - - return nTotal; -} - // Test if field contains specific attribute bool ScAttrArray::HasAttrib( SCROW nRow1, SCROW nRow2, sal_uInt16 nMask ) const @@ -1180,9 +1255,9 @@ bool ScAttrArray::HasAttrib( SCROW nRow1, SCROW nRow2, sal_uInt16 nMask ) const } if ( nMask & HASATTR_CONDITIONAL ) { - const SfxUInt32Item* pConditional = - (const SfxUInt32Item*) &pPattern->GetItem( ATTR_CONDITIONAL ); - if ( pConditional->GetValue() != 0 ) + bool bContainsCondFormat = + !static_cast<const ScCondFormatItem&>(pPattern->GetItem( ATTR_CONDITIONAL )).GetCondFormatData().empty(); + if ( bContainsCondFormat ) bFound = true; } if ( nMask & HASATTR_PROTECTED ) @@ -1193,9 +1268,9 @@ bool ScAttrArray::HasAttrib( SCROW nRow1, SCROW nRow2, sal_uInt16 nMask ) const if ( pProtect->GetProtection() || pProtect->GetHideCell() ) bFoundTemp = true; - const SfxUInt32Item* pConditional = - (const SfxUInt32Item*) &pPattern->GetItem( ATTR_CONDITIONAL ); - if ( pConditional->GetValue() != 0 ) + bool bContainsCondFormat = + !static_cast<const ScCondFormatItem&>(pPattern->GetItem( ATTR_CONDITIONAL )).GetCondFormatData().empty(); + if ( bContainsCondFormat ) { SCROW nRowStartCond = std::max<SCROW>( nRow1, i ? pData[i-1].nRow + 1: 0 ); SCROW nRowEndCond = std::min<SCROW>( nRow2, pData[i].nRow ); diff --git a/sc/source/core/data/attrib.cxx b/sc/source/core/data/attrib.cxx index e2f2c55ba5e1..6a29e52e6af8 100644 --- a/sc/source/core/data/attrib.cxx +++ b/sc/source/core/data/attrib.cxx @@ -60,6 +60,7 @@ TYPEINIT1(ScPageHFItem, SfxPoolItem); TYPEINIT1(ScViewObjectModeItem, SfxEnumItem); TYPEINIT1(ScDoubleItem, SfxPoolItem); TYPEINIT1(ScPageScaleToItem, SfxPoolItem); +TYPEINIT1(ScCondFormatItem, SfxPoolItem); //------------------------------------------------------------------------ @@ -742,7 +743,7 @@ SfxPoolItem* ScPageHFItem::Clone( SfxItemPool* ) const //------------------------------------------------------------------------ -void lcl_SetSpace( String& rStr, const ESelection& rSel ) +static void lcl_SetSpace( String& rStr, const ESelection& rSel ) { // Text durch ein Leerzeichen ersetzen, damit Positionen stimmen: @@ -751,7 +752,7 @@ void lcl_SetSpace( String& rStr, const ESelection& rSel ) rStr.SetChar( rSel.nStartPos, ' ' ); } -bool lcl_ConvertFields(EditEngine& rEng, const String* pCommands) +static bool lcl_ConvertFields(EditEngine& rEng, const String* pCommands) { bool bChange = false; sal_uInt16 nParCnt = rEng.GetParagraphCount(); @@ -1222,5 +1223,51 @@ bool ScPageScaleToItem::PutValue( const uno::Any& rAny, sal_uInt8 nMemberId ) // ============================================================================ +ScCondFormatItem::ScCondFormatItem(): + SfxPoolItem( ATTR_CONDITIONAL ) +{ +} + +ScCondFormatItem::ScCondFormatItem( sal_uInt32 nIndex ): + SfxPoolItem( ATTR_CONDITIONAL ) +{ + maIndex.push_back(nIndex); +} + +ScCondFormatItem::ScCondFormatItem( const std::vector<sal_uInt32>& rIndex ): + SfxPoolItem( ATTR_CONDITIONAL ), + maIndex( rIndex ) +{ +} + +ScCondFormatItem::~ScCondFormatItem() +{ +} + +int ScCondFormatItem::operator==( const SfxPoolItem& rCmp ) const +{ + return maIndex == static_cast<const ScCondFormatItem&>(rCmp).maIndex; +} + +ScCondFormatItem* ScCondFormatItem::Clone(SfxItemPool*) const +{ + return new ScCondFormatItem(maIndex); +} + +const std::vector<sal_uInt32>& ScCondFormatItem::GetCondFormatData() const +{ + return maIndex; +} + +void ScCondFormatItem::AddCondFormatData( sal_uInt32 nIndex ) +{ + maIndex.push_back(nIndex); +} + +void ScCondFormatItem::SetCondFormatData( const std::vector<sal_uInt32>& rIndex ) +{ + maIndex = rIndex; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx index c4ddb68c86ac..e27339e963cf 100644 --- a/sc/source/core/data/cell.cxx +++ b/sc/source/core/data/cell.cxx @@ -1986,7 +1986,7 @@ ScDetectiveRefIter::ScDetectiveRefIter( ScFormulaCell* pCell ) aPos = pCell->aPos; } -bool lcl_ScDetectiveRefIter_SkipRef( ScToken* p ) +static bool lcl_ScDetectiveRefIter_SkipRef( ScToken* p ) { ScSingleRefData& rRef1 = p->GetSingleRef(); if ( rRef1.IsColDeleted() || rRef1.IsRowDeleted() || rRef1.IsTabDeleted() diff --git a/sc/source/core/data/cell2.cxx b/sc/source/core/data/cell2.cxx index 16088a6c83d7..809e2ed86266 100644 --- a/sc/source/core/data/cell2.cxx +++ b/sc/source/core/data/cell2.cxx @@ -1522,7 +1522,7 @@ void ScFormulaCell::UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY StartListeningTo( pDocument ); // Listener wie vorher } -void lcl_FindRangeNamesInUse(std::set<sal_uInt16>& rIndexes, ScTokenArray* pCode, ScRangeName* pNames) +static void lcl_FindRangeNamesInUse(std::set<sal_uInt16>& rIndexes, ScTokenArray* pCode, ScRangeName* pNames) { for (FormulaToken* p = pCode->First(); p; p = pCode->Next()) { diff --git a/sc/source/core/data/colorscale.cxx b/sc/source/core/data/colorscale.cxx index b224b51f12ff..1f6779f7b0ea 100644 --- a/sc/source/core/data/colorscale.cxx +++ b/sc/source/core/data/colorscale.cxx @@ -34,6 +34,8 @@ #include <iostream> #endif +#include <algorithm> + ScColorScaleEntry::ScColorScaleEntry(): mnVal(0), mpCell(NULL), @@ -239,103 +241,6 @@ ScColorScaleEntryType ScColorScaleEntry::GetType() const return meType; } -namespace { - -double getMinValue(const ScRange& rRange, ScDocument* pDoc) -{ - double aMinValue = std::numeric_limits<double>::max(); - //iterate through columns - SCTAB nTab = rRange.aStart.Tab(); - for(SCCOL nCol = rRange.aStart.Col(); nCol <= rRange.aEnd.Col(); ++nCol) - { - for(SCROW nRow = rRange.aStart.Row(); nRow <= rRange.aEnd.Row(); ++nRow) - { - ScAddress aAddr(nCol, nRow, rRange.aStart.Tab()); - CellType eType = pDoc->GetCellType(aAddr); - if(eType == CELLTYPE_VALUE) - { - double aVal = pDoc->GetValue(nCol, nRow, nTab); - if( aVal < aMinValue ) - aMinValue = aVal; - } - else if(eType == CELLTYPE_FORMULA) - { - if(static_cast<ScFormulaCell*>(pDoc->GetCell(aAddr))->IsValue()) - { - double aVal = pDoc->GetValue(nCol, nRow, nTab); - if( aVal < aMinValue ) - aMinValue = aVal; - } - } - } - } - return aMinValue; -} - -double getMaxValue(const ScRange& rRange, ScDocument* pDoc) -{ - double aMaxValue = std::numeric_limits<double>::min(); - //iterate through columns - SCTAB nTab = rRange.aStart.Tab(); - for(SCCOL nCol = rRange.aStart.Col(); nCol <= rRange.aEnd.Col(); ++nCol) - { - for(SCROW nRow = rRange.aStart.Row(); nRow <= rRange.aEnd.Row(); ++nRow) - { - ScAddress aAddr(nCol, nRow, rRange.aStart.Tab()); - CellType eType = pDoc->GetCellType(aAddr); - if(eType == CELLTYPE_VALUE) - { - double aVal = pDoc->GetValue(nCol, nRow, nTab); - if( aVal > aMaxValue ) - aMaxValue = aVal; - } - else if(eType == CELLTYPE_FORMULA) - { - if(static_cast<ScFormulaCell*>(pDoc->GetCell(aAddr))->IsValue()) - { - double aVal = pDoc->GetValue(nCol, nRow, nTab); - if( aVal > aMaxValue ) - aMaxValue = aVal; - } - } - } - } - return aMaxValue; -} - -double getMinValue(const ScRangeList& rList, ScDocument* pDoc) -{ - double aMinValue = std::numeric_limits<double>::max(); - - size_t n = rList.size(); - for(size_t i = 0; i < n; ++i) - { - const ScRange* pRange = rList[i]; - double aVal = getMinValue(*pRange, pDoc); - if( aVal < aMinValue ) - aMinValue = aVal; - } - return aMinValue; -} - -double getMaxValue(const ScRangeList& rList, ScDocument* pDoc) -{ - double aMaxVal = std::numeric_limits<double>::min(); - - size_t n = rList.size(); - for(size_t i = 0; i < n; ++i) - { - const ScRange* pRange = rList[i]; - double aVal = getMaxValue(*pRange, pDoc); - if( aVal > aMaxVal ) - aMaxVal = aVal; - } - - return aMaxVal; -} - -} - double ScColorScaleFormat::GetMinValue() const { const_iterator itr = maColorScales.begin(); @@ -344,7 +249,7 @@ double ScColorScaleFormat::GetMinValue() const return itr->GetValue(); else { - return getMinValue(GetRange(), mpDoc); + return getMinValue(); } } @@ -356,7 +261,7 @@ double ScColorScaleFormat::GetMaxValue() const return itr->GetValue(); else { - return getMaxValue(GetRange(), mpDoc); + return getMaxValue(); } } @@ -371,36 +276,72 @@ const ScRangeList& ScColorFormat::GetRange() const return mpParent->GetRange(); } -void ScColorFormat::getValues(std::vector<double>& rValues) const +std::vector<double>& ScColorFormat::getValues() const { - size_t n = GetRange().size(); - const ScRangeList& aRanges = GetRange(); - for(size_t i = 0; i < n; ++i) + if(!mpCache) { - const ScRange* pRange = aRanges[i]; - SCTAB nTab = pRange->aStart.Tab(); - for(SCCOL nCol = pRange->aStart.Col(); nCol <= pRange->aEnd.Col(); ++nCol) + mpCache.reset(new ScColorFormatCache); + std::vector<double>& rValues = mpCache->maValues; + + size_t n = GetRange().size(); + const ScRangeList& aRanges = GetRange(); + for(size_t i = 0; i < n; ++i) { - for(SCCOL nRow = pRange->aStart.Row(); nRow <= pRange->aEnd.Row(); ++nRow) + const ScRange* pRange = aRanges[i]; + SCTAB nTab = pRange->aStart.Tab(); + for(SCCOL nCol = pRange->aStart.Col(); nCol <= pRange->aEnd.Col(); ++nCol) { - ScAddress aAddr(nCol, nRow, nTab); - CellType eType = mpDoc->GetCellType(aAddr); - if(eType == CELLTYPE_VALUE) - { - double aVal = mpDoc->GetValue(nCol, nRow, nTab); - rValues.push_back(aVal); - } - else if(eType == CELLTYPE_FORMULA) + for(SCCOL nRow = pRange->aStart.Row(); nRow <= pRange->aEnd.Row(); ++nRow) { - if(static_cast<ScFormulaCell*>(mpDoc->GetCell(aAddr))->IsValue()) + ScAddress aAddr(nCol, nRow, nTab); + CellType eType = mpDoc->GetCellType(aAddr); + if(eType == CELLTYPE_VALUE) { double aVal = mpDoc->GetValue(nCol, nRow, nTab); rValues.push_back(aVal); } + else if(eType == CELLTYPE_FORMULA) + { + if(static_cast<ScFormulaCell*>(mpDoc->GetCell(aAddr))->IsValue()) + { + double aVal = mpDoc->GetValue(nCol, nRow, nTab); + rValues.push_back(aVal); + } + } } } } + + std::sort(rValues.begin(), rValues.end()); } + + return mpCache->maValues; +} + +double ScColorFormat::getMinValue() const +{ + std::vector<double>& rValues = getValues(); + if(rValues.empty()) + return 0; + return rValues[0]; +} + +double ScColorFormat::getMaxValue() const +{ + std::vector<double>& rValues = getValues(); + if(rValues.empty()) + return 0; + return rValues[rValues.size()-1]; +} + +void ScColorFormat::startRendering() +{ + mpCache.reset(); +} + +void ScColorFormat::endRendering() +{ + mpCache.reset(); } namespace { @@ -426,20 +367,22 @@ Color CalcColor( double nVal, double nVal1, const Color& rCol1, double nVal2, co return Color(nColRed, nColGreen, nColBlue); } -double GetPercentile( std::vector<double>& rArray, double fPercentile ) +/** + * @param rVector sorted vector of the array + * @param fPercentile percentile + */ +double GetPercentile( const std::vector<double>& rArray, double fPercentile ) { size_t nSize = rArray.size(); size_t nIndex = (size_t)::rtl::math::approxFloor( fPercentile * (nSize-1)); double fDiff = fPercentile * (nSize-1) - ::rtl::math::approxFloor( fPercentile * (nSize-1)); - std::vector<double>::iterator iter = rArray.begin() + nIndex; - ::std::nth_element( rArray.begin(), iter, rArray.end()); + std::vector<double>::const_iterator iter = rArray.begin() + nIndex; if (fDiff == 0.0) return *iter; else { double fVal = *iter; iter = rArray.begin() + nIndex+1; - ::std::nth_element( rArray.begin(), iter, rArray.end()); return fVal + fDiff * (*iter - fVal); } } @@ -454,22 +397,17 @@ double ScColorScaleFormat::CalcValue(double nMin, double nMax, ScColorScaleForma return nMin + (nMax-nMin)*(itr->GetValue()/100); case COLORSCALE_MIN: return nMin; - case COLORSCALE_AUTOMIN: - return std::min<double>(0, nMin); case COLORSCALE_MAX: return nMax; - case COLORSCALE_AUTOMAX: - return std::max<double>(0, nMax); case COLORSCALE_PERCENTILE: { - std::vector<double> aValues; - getValues(aValues); - if(aValues.size() == 1) - return aValues[0]; + std::vector<double>& rValues = getValues(); + if(rValues.size() == 1) + return rValues[0]; else { double fPercentile = itr->GetValue()/100.0; - return GetPercentile(aValues, fPercentile); + return GetPercentile(rValues, fPercentile); } } @@ -584,8 +522,6 @@ bool ScColorScaleFormat::CheckEntriesForRel(const ScRange& rRange) const { case COLORSCALE_MIN: case COLORSCALE_MAX: - case COLORSCALE_AUTOMIN: - case COLORSCALE_AUTOMAX: bNeedUpdate = true; break; case COLORSCALE_FORMULA: @@ -692,8 +628,7 @@ bool NeedUpdate(ScColorScaleEntry* pEntry) case COLORSCALE_MIN: case COLORSCALE_MAX: case COLORSCALE_FORMULA: - case COLORSCALE_AUTOMIN: - case COLORSCALE_AUTOMAX: + case COLORSCALE_AUTO: return true; default: return false; @@ -736,7 +671,7 @@ double ScDataBarFormat::getMin(double nMin, double nMax) const case COLORSCALE_MIN: return nMin; - case COLORSCALE_AUTOMIN: + case COLORSCALE_AUTO: return std::min<double>(0, nMin); case COLORSCALE_PERCENT: @@ -745,9 +680,8 @@ double ScDataBarFormat::getMin(double nMin, double nMax) const case COLORSCALE_PERCENTILE: { double fPercentile = mpFormatData->mpLowerLimit->GetValue()/100.0; - std::vector<double> aValues; - getValues(aValues); - return GetPercentile(aValues, fPercentile); + std::vector<double>& rValues = getValues(); + return GetPercentile(rValues, fPercentile); } default: @@ -763,16 +697,15 @@ double ScDataBarFormat::getMax(double nMin, double nMax) const { case COLORSCALE_MAX: return nMax; - case COLORSCALE_AUTOMAX: + case COLORSCALE_AUTO: return std::max<double>(0, nMax); case COLORSCALE_PERCENT: return nMin + (nMax-nMin)/100*mpFormatData->mpUpperLimit->GetValue(); case COLORSCALE_PERCENTILE: { double fPercentile = mpFormatData->mpUpperLimit->GetValue()/100.0; - std::vector<double> aValues; - getValues(aValues); - return GetPercentile(aValues, fPercentile); + std::vector<double>& rValues = getValues(); + return GetPercentile(rValues, fPercentile); } default: @@ -796,8 +729,8 @@ ScDataBarInfo* ScDataBarFormat::GetDataBarInfo(const ScAddress& rAddr) const // now we have for sure a value // - double nValMin = getMinValue(GetRange(), mpDoc); - double nValMax = getMaxValue(GetRange(), mpDoc); + double nValMin = getMinValue(); + double nValMax = getMaxValue(); double nMin = getMin(nValMin, nValMax); double nMax = getMax(nValMin, nValMax); diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index db994622f3cb..683f99dbc549 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -498,6 +498,16 @@ void ScColumn::ApplyPatternIfNumberformatIncompatible( const ScRange& rRange, } } +void ScColumn::AddCondFormat( SCROW nStartRow, SCROW nEndRow, sal_uInt32 nIndex ) +{ + pAttrArray->AddCondFormat( nStartRow, nEndRow, nIndex ); +} + +void ScColumn::RemoveCondFormat( SCROW nStartRow, SCROW nEndRow, sal_uInt32 nIndex ) +{ + pAttrArray->RemoveCondFormat( nStartRow, nEndRow, nIndex ); +} + void ScColumn::ApplyStyle( SCROW nRow, const ScStyleSheet& rStyle ) { diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index 435e8b82e99e..964f1d4fbe75 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -126,9 +126,7 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev, } // bedingte Formatierung - const SfxItemSet* pCondSet = NULL; - if ( ((const SfxUInt32Item&)pPattern->GetItem(ATTR_CONDITIONAL)).GetValue() ) - pCondSet = pDocument->GetCondResult( nCol, nRow, nTab ); + const SfxItemSet* pCondSet = pDocument->GetCondResult( nCol, nRow, nTab ); // Zeilenumbruch? @@ -637,7 +635,7 @@ sal_uInt16 ScColumn::GetOptimalColWidth( OutputDevice* pDev, double nPPTX, doubl return nOldWidth; } -sal_uInt16 lcl_GetAttribHeight( const ScPatternAttr& rPattern, sal_uInt16 nFontHeightId ) +static sal_uInt16 lcl_GetAttribHeight( const ScPatternAttr& rPattern, sal_uInt16 nFontHeightId ) { sal_uInt16 nHeight = (sal_uInt16) ((const SvxFontHeightItem&) rPattern.GetItem(nFontHeightId)).GetHeight(); const SvxMarginItem* pMargin = (const SvxMarginItem*) &rPattern.GetItem(ATTR_MARGIN); @@ -1635,7 +1633,7 @@ void ScColumn::CompileColRowNameFormula() } } -void lcl_UpdateSubTotal( ScFunctionData& rData, ScBaseCell* pCell ) +static void lcl_UpdateSubTotal( ScFunctionData& rData, ScBaseCell* pCell ) { double nValue = 0.0; bool bVal = false; diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index c853c16ee78c..dff64c1f191f 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -882,7 +882,7 @@ void ScColumn::MixMarked( const ScMarkData& rMark, sal_uInt16 nFunction, // Ergebnis in rVal1 -sal_Bool lcl_DoFunction( double& rVal1, double nVal2, sal_uInt16 nFunction ) +static sal_Bool lcl_DoFunction( double& rVal1, double nVal2, sal_uInt16 nFunction ) { sal_Bool bOk = false; switch (nFunction) @@ -905,7 +905,7 @@ sal_Bool lcl_DoFunction( double& rVal1, double nVal2, sal_uInt16 nFunction ) } -void lcl_AddCode( ScTokenArray& rArr, ScFormulaCell* pCell ) +static void lcl_AddCode( ScTokenArray& rArr, ScFormulaCell* pCell ) { rArr.AddOpCode(ocOpen); diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx index f7b6b86a5939..e72556f693bf 100644 --- a/sc/source/core/data/conditio.cxx +++ b/sc/source/core/data/conditio.cxx @@ -80,7 +80,7 @@ void ScFormatEntry::endRendering() { } -bool lcl_HasRelRef( ScDocument* pDoc, ScTokenArray* pFormula, sal_uInt16 nRecursion = 0 ) +static bool lcl_HasRelRef( ScDocument* pDoc, ScTokenArray* pFormula, sal_uInt16 nRecursion = 0 ) { if (pFormula) { @@ -499,7 +499,7 @@ void ScConditionEntry::SetFormula2( const ScTokenArray& rArray ) } } -void lcl_CondUpdateInsertTab( ScTokenArray& rCode, SCTAB nInsTab, SCTAB nPosTab, bool& rChanged, SCTAB nTabs ) +static void lcl_CondUpdateInsertTab( ScTokenArray& rCode, SCTAB nInsTab, SCTAB nPosTab, bool& rChanged, SCTAB nTabs ) { // Insert table: only update absolute table references. // (Similar to ScCompiler::UpdateInsertTab with bIsName=true, result is the same as for named ranges) @@ -595,7 +595,7 @@ void ScConditionEntry::UpdateMoveTab( SCTAB nOldPos, SCTAB nNewPos ) //! als Vergleichsoperator ans TokenArray ??? -bool lcl_IsEqual( const ScTokenArray* pArr1, const ScTokenArray* pArr2 ) +static bool lcl_IsEqual( const ScTokenArray* pArr1, const ScTokenArray* pArr2 ) { // verglichen wird nur das nicht-UPN Array diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx index 2d8808e4b0cb..a71fbad443ad 100644 --- a/sc/source/core/data/dociter.cxx +++ b/sc/source/core/data/dociter.cxx @@ -225,7 +225,7 @@ void ScDocumentIterator::GetPos( SCCOL& rCol, SCROW& rRow, SCTAB& rTab ) //------------------------------------------------------------------------ //------------------------------------------------------------------------ -void lcl_IterGetNumberFormat( sal_uLong& nFormat, const ScAttrArray*& rpArr, +void ScAttrArray_IterGetNumberFormat( sal_uLong& nFormat, const ScAttrArray*& rpArr, SCROW& nAttrEndRow, const ScAttrArray* pNewArr, SCROW nRow, ScDocument* pDoc ) { @@ -332,7 +332,7 @@ bool ScValueIterator::GetThis(double& rValue, sal_uInt16& rErr) --nRow; if ( bCalcAsShown ) { - lcl_IterGetNumberFormat( nNumFormat, pAttrArray, + ScAttrArray_IterGetNumberFormat( nNumFormat, pAttrArray, nAttrEndRow, pCol->pAttrArray, nRow, pDoc ); rValue = pDoc->RoundValueAsShown( rValue, nNumFormat ); } @@ -350,7 +350,7 @@ bool ScValueIterator::GetThis(double& rValue, sal_uInt16& rErr) bNextValid = true; if ( bCalcAsShown ) { - lcl_IterGetNumberFormat( nNumFormat, pAttrArray, + ScAttrArray_IterGetNumberFormat( nNumFormat, pAttrArray, nAttrEndRow, pCol->pAttrArray, nNextRow, pDoc ); fNextValue = pDoc->RoundValueAsShown( fNextValue, nNumFormat ); } @@ -594,7 +594,7 @@ bool ScDBQueryDataIterator::DataAccessInternal::getCurrent(Value& rValue) { const ScAttrArray* pNewAttrArray = ScDBQueryDataIterator::GetAttrArrayByCol(*mpDoc, nTab, nCol); - lcl_IterGetNumberFormat( nNumFormat, pAttrArray, + ScAttrArray_IterGetNumberFormat( nNumFormat, pAttrArray, nAttrEndRow, pNewAttrArray, nRow, mpDoc ); rValue.mfValue = mpDoc->RoundValueAsShown( rValue.mfValue, nNumFormat ); } @@ -1868,7 +1868,7 @@ bool ScHorizontalValueIterator::GetNext( double& rValue, sal_uInt16& rErr ) if ( bCalcAsShown ) { ScColumn* pCol = &pDoc->maTabs[nCurTab]->aCol[nCurCol]; - lcl_IterGetNumberFormat( nNumFormat, pAttrArray, + ScAttrArray_IterGetNumberFormat( nNumFormat, pAttrArray, nAttrEndRow, pCol->pAttrArray, nCurRow, pDoc ); rValue = pDoc->RoundValueAsShown( rValue, nNumFormat ); } diff --git a/sc/source/core/data/docpool.cxx b/sc/source/core/data/docpool.cxx index f2c9661a85e2..3fe7aecd3581 100644 --- a/sc/source/core/data/docpool.cxx +++ b/sc/source/core/data/docpool.cxx @@ -150,7 +150,6 @@ static SfxItemInfo const aItemInfos[] = { SID_ATTR_BORDER_SHADOW, SFX_ITEM_POOLABLE }, // ATTR_SHADOW { 0, SFX_ITEM_POOLABLE }, // ATTR_VALIDDATA { 0, SFX_ITEM_POOLABLE }, // ATTR_CONDITIONAL - { 0, SFX_ITEM_POOLABLE }, // ATTR_COLORSCALE { 0, SFX_ITEM_POOLABLE }, // ATTR_PATTERN { SID_ATTR_LRSPACE, SFX_ITEM_POOLABLE }, // ATTR_LRSPACE { SID_ATTR_ULSPACE, SFX_ITEM_POOLABLE }, // ATTR_ULSPACE @@ -288,8 +287,7 @@ ScDocumentPool::ScDocumentPool( SfxItemPool* pSecPool, sal_Bool bLoadRefCounts ) ppPoolDefaults[ ATTR_BORDER_INNER - ATTR_STARTINDEX ] = pGlobalBorderInnerAttr; ppPoolDefaults[ ATTR_SHADOW - ATTR_STARTINDEX ] = new SvxShadowItem( ATTR_SHADOW ); ppPoolDefaults[ ATTR_VALIDDATA - ATTR_STARTINDEX ] = new SfxUInt32Item( ATTR_VALIDDATA, 0 ); - ppPoolDefaults[ ATTR_CONDITIONAL - ATTR_STARTINDEX ] = new SfxUInt32Item( ATTR_CONDITIONAL, 0 ); - ppPoolDefaults[ ATTR_COLORSCALE - ATTR_STARTINDEX ] = new SfxUInt32Item( ATTR_COLORSCALE, 0 ); + ppPoolDefaults[ ATTR_CONDITIONAL - ATTR_STARTINDEX ] = new ScCondFormatItem; // GetRscString funktioniert erst nach ScGlobal::Init, zu erkennen am EmptyBrushItem //! zusaetzliche Methode ScGlobal::IsInit() oder so... @@ -681,7 +679,7 @@ SfxItemPool* ScDocumentPool::Clone() const return new SfxItemPool (*this, sal_True); } -SfxItemPresentation lcl_HFPresentation +static SfxItemPresentation lcl_HFPresentation ( const SfxPoolItem& rItem, SfxItemPresentation ePresentation, diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx index 526655b52a79..c0e94665a3fa 100644 --- a/sc/source/core/data/documen2.cxx +++ b/sc/source/core/data/documen2.cxx @@ -184,7 +184,6 @@ ScDocument::ScDocument( ScDocumentMode eMode, bIsUndo( eMode == SCDOCMODE_UNDO ), bIsVisible( false ), bIsEmbedded( false ), - bNoSetDirty( false ), bInsertingFromOtherDoc( false ), bLoadingMedium( false ), bImportingXML( false ), diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx index 209ba19b3914..54ce14f3a329 100644 --- a/sc/source/core/data/documen3.cxx +++ b/sc/source/core/data/documen3.cxx @@ -1654,7 +1654,7 @@ void ScDocument::ResetEmbedded() while result is less than nStopTwips. @return true if advanced at least one row. */ -bool lcl_AddTwipsWhile( long & rTwips, long nStopTwips, SCROW & rPosY, SCROW nEndRow, const ScTable * pTable ) +static bool lcl_AddTwipsWhile( long & rTwips, long nStopTwips, SCROW & rPosY, SCROW nEndRow, const ScTable * pTable ) { SCROW nRow = rPosY; bool bAdded = false; @@ -1779,7 +1779,7 @@ void ScDocument::SetEmbedded( const Rectangle& rRect ) // aus VisArea ( // VisArea auf Zellgrenzen anpassen -void lcl_SnapHor( ScTable* pTable, long& rVal, SCCOL& rStartCol ) +static void lcl_SnapHor( ScTable* pTable, long& rVal, SCCOL& rStartCol ) { SCCOL nCol = 0; long nTwips = (long) (rVal / HMM_PER_TWIPS); @@ -1799,7 +1799,7 @@ void lcl_SnapHor( ScTable* pTable, long& rVal, SCCOL& rStartCol ) rStartCol = nCol; } -void lcl_SnapVer( ScTable* pTable, long& rVal, SCROW& rStartRow ) +static void lcl_SnapVer( ScTable* pTable, long& rVal, SCROW& rStartRow ) { SCROW nRow = 0; long nTwips = (long) (rVal / HMM_PER_TWIPS); diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx index 52fe982bcbf7..3295106f40d1 100644 --- a/sc/source/core/data/documen4.cxx +++ b/sc/source/core/data/documen4.cxx @@ -49,6 +49,7 @@ #include "compiler.hxx" #include "externalrefmgr.hxx" #include "colorscale.hxx" +#include "attrib.hxx" using namespace formula; @@ -639,22 +640,26 @@ const SfxPoolItem* ScDocument::GetEffItem( const SfxPoolItem* pItem; if ( rSet.GetItemState( ATTR_CONDITIONAL, true, &pItem ) == SFX_ITEM_SET ) { - sal_uLong nIndex = ((const SfxUInt32Item*)pItem)->GetValue(); + const std::vector<sal_uInt32>& rIndex = static_cast<const ScCondFormatItem&>(pPattern->GetItem(ATTR_CONDITIONAL)).GetCondFormatData(); ScConditionalFormatList* pCondFormList = GetCondFormList( nTab ); - if (nIndex && pCondFormList) + if (!rIndex.empty() && pCondFormList) { - const ScConditionalFormat* pForm = pCondFormList->GetFormat( nIndex ); - if ( pForm ) + for(std::vector<sal_uInt32>::const_iterator itr = rIndex.begin(), itrEnd = rIndex.end(); + itr != itrEnd; ++itr) { - ScBaseCell* pCell = ((ScDocument*)this)->GetCell(ScAddress(nCol,nRow,nTab)); - rtl::OUString aStyle = pForm->GetCellStyle( pCell, ScAddress(nCol, nRow, nTab) ); - if (!aStyle.isEmpty()) + const ScConditionalFormat* pForm = pCondFormList->GetFormat( *itr ); + if ( pForm ) { - SfxStyleSheetBase* pStyleSheet = xPoolHelper->GetStylePool()->Find( - aStyle, SFX_STYLE_FAMILY_PARA ); - if ( pStyleSheet && pStyleSheet->GetItemSet().GetItemState( - nWhich, true, &pItem ) == SFX_ITEM_SET ) - return pItem; + ScBaseCell* pCell = ((ScDocument*)this)->GetCell(ScAddress(nCol,nRow,nTab)); + rtl::OUString aStyle = pForm->GetCellStyle( pCell, ScAddress(nCol, nRow, nTab) ); + if (!aStyle.isEmpty()) + { + SfxStyleSheetBase* pStyleSheet = xPoolHelper->GetStylePool()->Find( + aStyle, SFX_STYLE_FAMILY_PARA ); + if ( pStyleSheet && pStyleSheet->GetItemSet().GetItemState( + nWhich, true, &pItem ) == SFX_ITEM_SET ) + return pItem; + } } } } @@ -667,9 +672,16 @@ const SfxPoolItem* ScDocument::GetEffItem( const SfxItemSet* ScDocument::GetCondResult( SCCOL nCol, SCROW nRow, SCTAB nTab ) const { - const ScConditionalFormat* pForm = GetCondFormat( nCol, nRow, nTab ); - if ( pForm ) + const ScPatternAttr* pPattern = GetPattern( nCol, nRow, nTab ); + const std::vector<sal_uInt32>& rIndex = static_cast<const ScCondFormatItem&>(pPattern->GetItem(ATTR_CONDITIONAL)).GetCondFormatData(); + ScConditionalFormatList* pFormatList = GetCondFormList(nTab); + for(std::vector<sal_uInt32>::const_iterator itr = rIndex.begin(), itrEnd = rIndex.end(); + itr != itrEnd; ++itr) { + ScConditionalFormat* pForm = pFormatList->GetFormat(*itr); + if(!pForm) + continue; + ScBaseCell* pCell = ((ScDocument*)this)->GetCell(ScAddress(nCol,nRow,nTab)); rtl::OUString aStyle = pForm->GetCellStyle( pCell, ScAddress(nCol, nRow, nTab) ); if (!aStyle.isEmpty()) @@ -679,7 +691,9 @@ const SfxItemSet* ScDocument::GetCondResult( SCCOL nCol, SCROW nRow, SCTAB nTab return &pStyleSheet->GetItemSet(); // if style is not there, treat like no condition } + } + return NULL; } @@ -724,12 +738,6 @@ const ScValidationData* ScDocument::GetValidationEntry( sal_uLong nIndex ) const return NULL; } -void ScDocument::FindConditionalFormat( sal_uLong nKey, ScRangeList& rRanges, SCTAB nTab ) -{ - if(VALIDTAB(nTab) && nTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab]) - maTabs[nTab]->FindConditionalFormat( nKey, rRanges ); -} - void ScDocument::DeleteConditionalFormat(sal_uLong nOldIndex, SCTAB nTab) { if(VALIDTAB(nTab) && nTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab]) diff --git a/sc/source/core/data/documen5.cxx b/sc/source/core/data/documen5.cxx index 9950a42bb2f2..9f5408a97f30 100644 --- a/sc/source/core/data/documen5.cxx +++ b/sc/source/core/data/documen5.cxx @@ -63,7 +63,7 @@ using namespace ::com::sun::star; // ----------------------------------------------------------------------- -void lcl_GetChartParameters( const uno::Reference< chart2::XChartDocument >& xChartDoc, +static void lcl_GetChartParameters( const uno::Reference< chart2::XChartDocument >& xChartDoc, rtl::OUString& rRanges, chart::ChartDataRowSource& rDataRowSource, bool& rHasCategories, bool& rFirstCellAsLabel ) { @@ -97,7 +97,7 @@ void lcl_GetChartParameters( const uno::Reference< chart2::XChartDocument >& xCh } } -void lcl_SetChartParameters( const uno::Reference< chart2::data::XDataReceiver >& xReceiver, +static void lcl_SetChartParameters( const uno::Reference< chart2::data::XDataReceiver >& xReceiver, const rtl::OUString& rRanges, chart::ChartDataRowSource eDataRowSource, bool bHasCategories, bool bFirstCellAsLabel ) { diff --git a/sc/source/core/data/documen6.cxx b/sc/source/core/data/documen6.cxx index 4acd9eaa1299..544950fd7181 100644 --- a/sc/source/core/data/documen6.cxx +++ b/sc/source/core/data/documen6.cxx @@ -39,6 +39,7 @@ #include "patattr.hxx" #include "scrdata.hxx" #include "poolhelp.hxx" +#include "attrib.hxx" using namespace com::sun::star; @@ -168,7 +169,7 @@ sal_uInt8 ScDocument::GetScriptType( SCCOL nCol, SCROW nRow, SCTAB nTab, ScBaseC const ScPatternAttr* pPattern = GetPattern( nCol, nRow, nTab ); if (!pPattern) return 0; const SfxItemSet* pCondSet = NULL; - if ( ((const SfxUInt32Item&)pPattern->GetItem(ATTR_CONDITIONAL)).GetValue() ) + if ( !((const ScCondFormatItem&)pPattern->GetItem(ATTR_CONDITIONAL)).GetCondFormatData().empty() ) pCondSet = GetCondResult( nCol, nRow, nTab ); sal_uLong nFormat = pPattern->GetNumberFormat( xPoolHelper->GetFormTable(), pCondSet ); diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index ade6c8e9b051..3715f45a3a0c 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -1035,7 +1035,7 @@ void ScDocument::LimitChartIfAll( ScRangeListRef& rRangeList ) } -void lcl_GetFirstTabRange( SCTAB& rTabRangeStart, SCTAB& rTabRangeEnd, const ScMarkData* pTabMark, SCTAB aMaxTab ) +static void lcl_GetFirstTabRange( SCTAB& rTabRangeStart, SCTAB& rTabRangeEnd, const ScMarkData* pTabMark, SCTAB aMaxTab ) { // without ScMarkData, leave start/end unchanged if ( pTabMark ) @@ -1053,7 +1053,7 @@ void lcl_GetFirstTabRange( SCTAB& rTabRangeStart, SCTAB& rTabRangeEnd, const ScM } } -bool lcl_GetNextTabRange( SCTAB& rTabRangeStart, SCTAB& rTabRangeEnd, const ScMarkData* pTabMark, SCTAB aMaxTab ) +static bool lcl_GetNextTabRange( SCTAB& rTabRangeStart, SCTAB& rTabRangeEnd, const ScMarkData* pTabMark, SCTAB aMaxTab ) { if ( pTabMark ) { @@ -1477,7 +1477,7 @@ void ScDocument::DeleteCol( const ScRange& rRange, ScDocument* pRefUndoDoc, bool // (ohne Paint) -void lcl_GetInsDelRanges( const ScRange& rOld, const ScRange& rNew, +static void lcl_GetInsDelRanges( const ScRange& rOld, const ScRange& rNew, ScRange& rColRange, bool& rInsCol, bool& rDelCol, ScRange& rRowRange, bool& rInsRow, bool& rDelRow ) { @@ -4211,6 +4211,28 @@ void ScDocument::ApplyPatternIfNumberformatIncompatible( const ScRange& rRange, maTabs[*itr]->ApplyPatternIfNumberformatIncompatible( rRange, rPattern, nNewType ); } +void ScDocument::AddCondFormatData( const ScRangeList& rRange, SCTAB nTab, sal_uInt32 nIndex ) +{ + if(!(static_cast<size_t>(nTab) < maTabs.size())) + return; + + if(!maTabs[nTab]) + return; + + maTabs[nTab]->AddCondFormatData(rRange, nIndex); +} + +void ScDocument::RemoveCondFormatData( const ScRangeList& rRange, SCTAB nTab, sal_uInt32 nIndex ) +{ + if(!(static_cast<size_t>(nTab) < maTabs.size())) + return; + + if(!maTabs[nTab]) + return; + + maTabs[nTab]->RemoveCondFormatData(rRange, nIndex); +} + void ScDocument::ApplyStyle( SCCOL nCol, SCROW nRow, SCTAB nTab, const ScStyleSheet& rStyle) { diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index 8c5e0c4a0274..81888fdfe6dc 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -66,6 +66,7 @@ #include <com/sun/star/sheet/DataPilotTablePositionData.hpp> #include <com/sun/star/sheet/DataPilotTablePositionType.hpp> #include <com/sun/star/sheet/DimensionFlags.hpp> +#include <com/sun/star/task/InteractionHandler.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/lang/XSingleServiceFactory.hpp> #include <com/sun/star/lang/XSingleComponentFactory.hpp> @@ -102,7 +103,6 @@ using ::com::sun::star::beans::XPropertySet; using ::rtl::OUString; #define SC_SERVICE_ROWSET "com.sun.star.sdb.RowSet" -#define SC_SERVICE_INTHANDLER "com.sun.star.task.InteractionHandler" #define SC_DBPROP_DATASOURCENAME "DataSourceName" #define SC_DBPROP_COMMAND "Command" @@ -265,7 +265,7 @@ void DBConnector::getValue(long nCol, ScDPItemData &rData, short& rNumType) cons } -sal_uInt16 lcl_GetDataGetOrientation( const uno::Reference<sheet::XDimensionsSupplier>& xSource ) +static sal_uInt16 lcl_GetDataGetOrientation( const uno::Reference<sheet::XDimensionsSupplier>& xSource ) { long nRet = sheet::DataPilotFieldOrientation_HIDDEN; if ( xSource.is() ) @@ -809,7 +809,7 @@ const ScRange ScDPObject::GetOutputRangeByType( sal_Int32 nType ) return pOutput->GetOutputRange(nType); } -sal_Bool lcl_HasButton( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab ) +static sal_Bool lcl_HasButton( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab ) { return ((const ScMergeFlagAttr*)pDoc->GetAttr( nCol, nRow, nTab, ATTR_MERGE_FLAG ))->HasButton(); } @@ -1324,7 +1324,7 @@ void ScDPObject::GetMemberResultNames(ScDPUniqueStringSet& rNames, long nDimensi pOutput->GetMemberResultNames(rNames, nDimension); // used only with table data -> level not needed } -bool lcl_Dequote( const String& rSource, xub_StrLen nStartPos, xub_StrLen& rEndPos, String& rResult ) +static bool lcl_Dequote( const String& rSource, xub_StrLen nStartPos, xub_StrLen& rEndPos, String& rResult ) { // nStartPos has to point to opening quote @@ -1373,7 +1373,7 @@ struct ScGetPivotDataFunctionEntry sheet::GeneralFunction eFunc; }; -bool lcl_ParseFunction( const String& rList, xub_StrLen nStartPos, xub_StrLen& rEndPos, sheet::GeneralFunction& rFunc ) +static bool lcl_ParseFunction( const String& rList, xub_StrLen nStartPos, xub_StrLen& rEndPos, sheet::GeneralFunction& rFunc ) { static const ScGetPivotDataFunctionEntry aFunctions[] = { @@ -1437,7 +1437,7 @@ bool lcl_ParseFunction( const String& rList, xub_StrLen nStartPos, xub_StrLen& r return bFound; } -bool lcl_IsAtStart( const String& rList, const String& rSearch, sal_Int32& rMatched, +static bool lcl_IsAtStart( const String& rList, const String& rSearch, sal_Int32& rMatched, bool bAllowBracket, sheet::GeneralFunction* pFunc ) { sal_Int32 nMatchList = 0; @@ -1870,21 +1870,7 @@ void ScDPObject::ToggleDetails(const DataPilotTableHeaderData& rElemDesc, ScDPOb } } -long lcl_FindName( const rtl::OUString& rString, const uno::Reference<container::XNameAccess>& xCollection ) -{ - if ( xCollection.is() ) - { - uno::Sequence<rtl::OUString> aSeq = xCollection->getElementNames(); - long nCount = aSeq.getLength(); - const rtl::OUString* pArr = aSeq.getConstArray(); - for (long nPos=0; nPos<nCount; nPos++) - if ( pArr[nPos] == rString ) - return nPos; - } - return -1; // not found -} - -sal_uInt16 lcl_FirstSubTotal( const uno::Reference<beans::XPropertySet>& xDimProp ) // PIVOT_FUNC mask +static sal_uInt16 lcl_FirstSubTotal( const uno::Reference<beans::XPropertySet>& xDimProp ) // PIVOT_FUNC mask { uno::Reference<sheet::XHierarchiesSupplier> xDimSupp( xDimProp, uno::UNO_QUERY ); if ( xDimProp.is() && xDimSupp.is() ) @@ -1933,21 +1919,6 @@ sal_uInt16 lcl_FirstSubTotal( const uno::Reference<beans::XPropertySet>& xDimPro return 0; } -sal_uInt16 lcl_CountBits( sal_uInt16 nBits ) -{ - if (!nBits) return 0; - - sal_uInt16 nCount = 0; - sal_uInt16 nMask = 1; - for (sal_uInt16 i=0; i<16; i++) - { - if ( nBits & nMask ) - ++nCount; - nMask <<= 1; - } - return nCount; -} - namespace { class FindByColumn : public std::unary_function<PivotField, bool> @@ -1964,7 +1935,7 @@ public: } -void lcl_FillOldFields( +static void lcl_FillOldFields( vector<PivotField>& rFields, const uno::Reference<sheet::XDimensionsSupplier>& xSource, sal_uInt16 nOrient, bool bAddData ) @@ -2151,7 +2122,7 @@ bool ScDPObject::FillOldParam(ScPivotParam& rParam) const return true; } -void lcl_FillLabelData( ScDPLabelData& rData, const uno::Reference< beans::XPropertySet >& xDimProp ) +static void lcl_FillLabelData( ScDPLabelData& rData, const uno::Reference< beans::XPropertySet >& xDimProp ) { uno::Reference<sheet::XHierarchiesSupplier> xDimSupp( xDimProp, uno::UNO_QUERY ); if (!xDimProp.is() || !xDimSupp.is()) @@ -3058,9 +3029,8 @@ uno::Reference<sdbc::XRowSet> ScDPCollection::DBCaches::createRowSet( if ( xExecute.is() ) { uno::Reference<task::XInteractionHandler> xHandler( - comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_SERVICE_INTHANDLER )) ), - uno::UNO_QUERY); + task::InteractionHandler::createWithParent(comphelper::getProcessComponentContext(), 0), + uno::UNO_QUERY_THROW); xExecute->executeWithCompletion( xHandler ); } else diff --git a/sc/source/core/data/dpoutput.cxx b/sc/source/core/data/dpoutput.cxx index 7bf593661610..2abe79f7861a 100644 --- a/sc/source/core/data/dpoutput.cxx +++ b/sc/source/core/data/dpoutput.cxx @@ -844,7 +844,7 @@ void ScDPOutput::FieldCell( lcl_SetStyleById( pDoc,nTab, nCol,nRow, nCol,nRow, STR_PIVOT_STYLE_FIELDNAME ); } -void lcl_DoFilterButton( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab ) +static void lcl_DoFilterButton( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab ) { pDoc->SetString( nCol, nRow, nTab, ScGlobal::GetRscString(STR_CELL_FILTER) ); pDoc->ApplyFlagsTab(nCol, nRow, nCol, nRow, nTab, SC_MF_BUTTON); diff --git a/sc/source/core/data/dpsave.cxx b/sc/source/core/data/dpsave.cxx index 5feec0612cb6..d5fca515c92f 100644 --- a/sc/source/core/data/dpsave.cxx +++ b/sc/source/core/data/dpsave.cxx @@ -71,7 +71,7 @@ using ::std::auto_ptr; #define SC_DPSAVEMODE_YES 1 #define SC_DPSAVEMODE_DONTKNOW 2 -void lcl_SetBoolProperty( const uno::Reference<beans::XPropertySet>& xProp, +static void lcl_SetBoolProperty( const uno::Reference<beans::XPropertySet>& xProp, const rtl::OUString& rName, sal_Bool bValue ) { //! move to ScUnoHelpFunctions? @@ -1067,7 +1067,7 @@ void ScDPSaveData::SetDrillDown(bool bSet) bDrillDown = bSet; } -void lcl_ResetOrient( const uno::Reference<sheet::XDimensionsSupplier>& xSource ) +static void lcl_ResetOrient( const uno::Reference<sheet::XDimensionsSupplier>& xSource ) { sheet::DataPilotFieldOrientation eOrient = sheet::DataPilotFieldOrientation_HIDDEN; diff --git a/sc/source/core/data/dptabres.cxx b/sc/source/core/data/dptabres.cxx index 4a4a2020d201..3b34126107a6 100644 --- a/sc/source/core/data/dptabres.cxx +++ b/sc/source/core/data/dptabres.cxx @@ -276,7 +276,7 @@ void ScDPInitState::RemoveMember() // ----------------------------------------------------------------------- -void lcl_DumpRow( const String& rType, const String& rName, const ScDPAggData* pAggData, +static void lcl_DumpRow( const String& rType, const String& rName, const ScDPAggData* pAggData, ScDocument* pDoc, ScAddress& rPos ) { SCCOL nCol = rPos.Col(); @@ -292,7 +292,7 @@ void lcl_DumpRow( const String& rType, const String& rName, const ScDPAggData* p rPos.SetRow( nRow + 1 ); } -void lcl_Indent( ScDocument* pDoc, SCROW nStartRow, const ScAddress& rPos ) +static void lcl_Indent( ScDocument* pDoc, SCROW nStartRow, const ScAddress& rPos ) { SCCOL nCol = rPos.Col(); SCTAB nTab = rPos.Tab(); @@ -675,7 +675,7 @@ ScDPRowTotals::~ScDPRowTotals() { } -ScDPAggData* lcl_GetChildTotal( ScDPAggData* pFirst, long nMeasure ) +static ScDPAggData* lcl_GetChildTotal( ScDPAggData* pFirst, long nMeasure ) { OSL_ENSURE( nMeasure >= 0, "GetColTotal: no measure" ); @@ -1859,7 +1859,7 @@ void ScDPDataMember::InitFrom( const ScDPResultDimension* pDim ) const long SC_SUBTOTALPOS_AUTO = -1; // default const long SC_SUBTOTALPOS_SKIP = -2; // don't use -long lcl_GetSubTotalPos( const ScDPSubTotalState& rSubState ) +static long lcl_GetSubTotalPos( const ScDPSubTotalState& rSubState ) { if ( rSubState.nColSubTotalFunc >= 0 && rSubState.nRowSubTotalFunc >= 0 && rSubState.nColSubTotalFunc != rSubState.nRowSubTotalFunc ) diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx index 542d9911871f..c3c12149d19e 100644 --- a/sc/source/core/data/dptabsrc.cxx +++ b/sc/source/core/data/dptabsrc.cxx @@ -101,14 +101,14 @@ SC_SIMPLE_SERVICE_INFO( ScDPMember, "ScDPMember", "com.sun.star.sheet. // ----------------------------------------------------------------------- //! move to a header? -sal_Bool lcl_GetBoolFromAny( const uno::Any& aAny ) +static sal_Bool lcl_GetBoolFromAny( const uno::Any& aAny ) { if ( aAny.getValueTypeClass() == uno::TypeClass_BOOLEAN ) return *(sal_Bool*)aAny.getValue(); return false; } -void lcl_SetBoolInAny( uno::Any& rAny, sal_Bool bValue ) +static void lcl_SetBoolInAny( uno::Any& rAny, sal_Bool bValue ) { rAny.setValue( &bValue, getBooleanCppuType() ); } @@ -218,7 +218,7 @@ long ScDPSource::GetPosition(long nColumn) return 0; } -sal_Bool lcl_TestSubTotal( sal_Bool& rAllowed, long nColumn, long* pArray, long nCount, ScDPSource* pSource ) +static sal_Bool lcl_TestSubTotal( sal_Bool& rAllowed, long nColumn, long* pArray, long nCount, ScDPSource* pSource ) { for (long i=0; i<nCount; i++) if (pArray[i] == nColumn) @@ -252,7 +252,7 @@ sal_Bool ScDPSource::SubTotalAllowed(long nColumn) return bAllowed; } -void lcl_RemoveDim( long nRemove, long* pDims, long& rCount ) +static void lcl_RemoveDim( long nRemove, long* pDims, long& rCount ) { for (long i=0; i<rCount; i++) if ( pDims[i] == nRemove ) @@ -531,7 +531,7 @@ void ScDPSource::disposeData() bResultOverflow = false; } -long lcl_CountMinMembers(const vector<ScDPDimension*>& ppDim, const vector<ScDPLevel*>& ppLevel, long nLevels ) +static long lcl_CountMinMembers(const vector<ScDPDimension*>& ppDim, const vector<ScDPLevel*>& ppLevel, long nLevels ) { // Calculate the product of the member count for those consecutive levels that // have the "show all" flag, one following level, and the data layout dimension. @@ -592,7 +592,7 @@ long lcl_CountMinMembers(const vector<ScDPDimension*>& ppDim, const vector<ScDPL return nTotal; } -long lcl_GetIndexFromName( const rtl::OUString rName, const uno::Sequence<rtl::OUString>& rElements ) +static long lcl_GetIndexFromName( const rtl::OUString rName, const uno::Sequence<rtl::OUString>& rElements ) { long nCount = rElements.getLength(); const rtl::OUString* pArray = rElements.getConstArray(); diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx index 6ec0795ddf69..61db8dbce155 100644 --- a/sc/source/core/data/drwlayer.cxx +++ b/sc/source/core/data/drwlayer.cxx @@ -186,13 +186,7 @@ inline void ReverseTwipsToMM( long& nVal ) nVal = HmmToTwips (nVal); } -void lcl_ReverseTwipsToMM( Point& rPoint ) -{ - ReverseTwipsToMM( rPoint.X() ); - ReverseTwipsToMM( rPoint.Y() ); -} - -void lcl_ReverseTwipsToMM( Rectangle& rRect ) +static void lcl_ReverseTwipsToMM( Rectangle& rRect ) { ReverseTwipsToMM( rRect.Left() ); ReverseTwipsToMM( rRect.Right() ); @@ -1281,7 +1275,7 @@ void ScDrawLayer::CopyToClip( ScDocument* pClipDoc, SCTAB nTab, const Rectangle& } } -sal_Bool lcl_IsAllInRange( const ::std::vector< ScRangeList >& rRangesVector, const ScRange& rClipRange ) +static sal_Bool lcl_IsAllInRange( const ::std::vector< ScRangeList >& rRangesVector, const ScRange& rClipRange ) { // check if every range of rRangesVector is completely in rClipRange @@ -1302,7 +1296,7 @@ sal_Bool lcl_IsAllInRange( const ::std::vector< ScRangeList >& rRangesVector, co return sal_True; // everything is fine } -sal_Bool lcl_MoveRanges( ::std::vector< ScRangeList >& rRangesVector, const ScRange& rSourceRange, const ScAddress& rDestPos ) +static sal_Bool lcl_MoveRanges( ::std::vector< ScRangeList >& rRangesVector, const ScRange& rSourceRange, const ScAddress& rDestPos ) { sal_Bool bChanged = false; diff --git a/sc/source/core/data/fillinfo.cxx b/sc/source/core/data/fillinfo.cxx index 29fee726655a..a7c681e65d94 100644 --- a/sc/source/core/data/fillinfo.cxx +++ b/sc/source/core/data/fillinfo.cxx @@ -1,4 +1,5 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ + /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -81,7 +82,7 @@ inline const ::editeng::SvxBorderLine* GetNullOrLine( const SvxBoxItem* pBox, Fi // aehnlich wie in output.cxx -void lcl_GetMergeRange( SCsCOL nX, SCsROW nY, SCSIZE nArrY, +static void lcl_GetMergeRange( SCsCOL nX, SCsROW nY, SCSIZE nArrY, ScDocument* pDoc, RowInfo* pRowInfo, SCCOL nX1, SCROW nY1, SCCOL /* nX2 */, SCROW /* nY2 */, SCTAB nTab, SCsCOL& rStartX, SCsROW& rStartY, SCsCOL& rEndX, SCsROW& rEndY ) @@ -477,12 +478,8 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX else bHidden = bHideFormula = false; - sal_uLong nConditional = ((const SfxUInt32Item&)pPattern-> - GetItem(ATTR_CONDITIONAL)).GetValue(); - - const ScConditionalFormat* pCondForm = NULL; - if ( nConditional && pCondFormList ) - pCondForm = pCondFormList->GetFormat( nConditional ); + const std::vector<sal_uInt32>& rCondFormats = static_cast<const ScCondFormatItem&>(pPattern->GetItem(ATTR_CONDITIONAL)).GetCondFormatData(); + bool bContainsCondFormat = !rCondFormats.empty(); do { @@ -493,7 +490,7 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX RowInfo* pThisRowInfo = &pRowInfo[nArrY]; if (pBackground != pDefBackground) // Spalten-HG == Standard ? pThisRowInfo->bEmptyBack = false; - if (pCondForm) + if (bContainsCondFormat) pThisRowInfo->bEmptyBack = false; if (bAutoFilter) pThisRowInfo->bAutoFilter = true; @@ -529,41 +526,50 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX pThisRowInfo->bEmptyBack = false; } - if ( pCondForm ) + if ( bContainsCondFormat ) { - ScCondFormatData aData = pCondForm->GetData( pInfo->pCell, - ScAddress( nX, nCurRow, nTab ) ); - if (!aData.aStyleName.isEmpty()) + bool bFound = false; + for(std::vector<sal_uInt32>::const_iterator itr = rCondFormats.begin(); + itr != rCondFormats.end() && !bFound; ++itr) { - SfxStyleSheetBase* pStyleSheet = - pStlPool->Find( aData.aStyleName, SFX_STYLE_FAMILY_PARA ); - if ( pStyleSheet ) + ScConditionalFormat* pCondForm = pCondFormList->GetFormat(*itr); + ScCondFormatData aData = pCondForm->GetData( pInfo->pCell, + ScAddress( nX, nCurRow, nTab ) ); + if (!aData.aStyleName.isEmpty()) { - //! Style-Sets cachen !!! - pInfo->pConditionSet = &pStyleSheet->GetItemSet(); - bAnyCondition = true; - - // we need to check already here for protected cells - const SfxPoolItem* pItem; - if ( bTabProtect && pInfo->pConditionSet->GetItemState( ATTR_PROTECTION, true, &pItem ) == SFX_ITEM_SET ) + SfxStyleSheetBase* pStyleSheet = + pStlPool->Find( aData.aStyleName, SFX_STYLE_FAMILY_PARA ); + if ( pStyleSheet ) { - const ScProtectionAttr* pProtAttr = static_cast<const ScProtectionAttr*>(pItem); - bHidden = pProtAttr->GetHideCell(); - bHideFormula = pProtAttr->GetHideFormula(); + //! Style-Sets cachen !!! + pInfo->pConditionSet = &pStyleSheet->GetItemSet(); + bAnyCondition = true; - } + // we need to check already here for protected cells + const SfxPoolItem* pItem; + if ( bTabProtect && pInfo->pConditionSet->GetItemState( ATTR_PROTECTION, true, &pItem ) == SFX_ITEM_SET ) + { + const ScProtectionAttr* pProtAttr = static_cast<const ScProtectionAttr*>(pItem); + bHidden = pProtAttr->GetHideCell(); + bHideFormula = pProtAttr->GetHideFormula(); + } + bFound = true; + + } + // if style is not there, treat like no condition + } + if(aData.pColorScale) + { + pInfo->pColorScale = aData.pColorScale; + bFound = true; } - // if style is not there, treat like no condition - } - if(aData.pColorScale) - { - pInfo->pColorScale = aData.pColorScale; - } - if(aData.pDataBar) - { - pInfo->pDataBar = aData.pDataBar; + if(aData.pDataBar) + { + pInfo->pDataBar = aData.pDataBar; + bFound = true; + } } } diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx index 399da0a8b326..207295f29c7c 100644 --- a/sc/source/core/data/patattr.cxx +++ b/sc/source/core/data/patattr.cxx @@ -929,7 +929,7 @@ void ScPatternAttr::ClearItems( const sal_uInt16* pWhich ) rSet.ClearItem(pWhich[i]); } -SfxStyleSheetBase* lcl_CopyStyleToPool +static SfxStyleSheetBase* lcl_CopyStyleToPool ( SfxStyleSheetBase* pSrcStyle, SfxStyleSheetBasePool* pSrcPool, diff --git a/sc/source/core/data/stlpool.cxx b/sc/source/core/data/stlpool.cxx index 66eef1d3abfc..020967f57451 100644 --- a/sc/source/core/data/stlpool.cxx +++ b/sc/source/core/data/stlpool.cxx @@ -229,7 +229,7 @@ void ScStyleSheetPool::CopyStdStylesFrom( ScStyleSheetPool* pSrcPool ) //------------------------------------------------------------------------ -void lcl_CheckFont( SfxItemSet& rSet, LanguageType eLang, sal_uInt16 nFontType, sal_uInt16 nItemId ) +static void lcl_CheckFont( SfxItemSet& rSet, LanguageType eLang, sal_uInt16 nFontType, sal_uInt16 nItemId ) { if ( eLang != LANGUAGE_NONE && eLang != LANGUAGE_DONTKNOW && eLang != LANGUAGE_SYSTEM ) { diff --git a/sc/source/core/data/stlsheet.cxx b/sc/source/core/data/stlsheet.cxx index 0b5fd7212454..abb8c3d5dd32 100644 --- a/sc/source/core/data/stlsheet.cxx +++ b/sc/source/core/data/stlsheet.cxx @@ -85,20 +85,20 @@ ScStyleSheet::~ScStyleSheet() //------------------------------------------------------------------------ -sal_Bool ScStyleSheet::HasFollowSupport() const +bool ScStyleSheet::HasFollowSupport() const { return false; } //------------------------------------------------------------------------ -sal_Bool ScStyleSheet::HasParentSupport () const +bool ScStyleSheet::HasParentSupport () const { - sal_Bool bHasParentSupport = false; + bool bHasParentSupport = false; switch ( GetFamily() ) { - case SFX_STYLE_FAMILY_PARA: bHasParentSupport = sal_True; break; + case SFX_STYLE_FAMILY_PARA: bHasParentSupport = true; break; case SFX_STYLE_FAMILY_PAGE: bHasParentSupport = false; break; default: { @@ -111,9 +111,9 @@ sal_Bool ScStyleSheet::HasParentSupport () const //------------------------------------------------------------------------ -sal_Bool ScStyleSheet::SetParent( const String& rParentName ) +bool ScStyleSheet::SetParent( const String& rParentName ) { - sal_Bool bResult = false; + bool bResult = false; String aEffName = rParentName; SfxStyleSheetBase* pStyle = pPool->Find( aEffName, nFamily ); if (!pStyle) @@ -263,7 +263,7 @@ SfxItemSet& ScStyleSheet::GetItemSet() //------------------------------------------------------------------------ -sal_Bool ScStyleSheet::IsUsed() const +bool ScStyleSheet::IsUsed() const { if ( GetFamily() == SFX_STYLE_FAMILY_PARA ) { @@ -277,7 +277,7 @@ sal_Bool ScStyleSheet::IsUsed() const return eUsage == USED; } else - return sal_True; + return true; } //------------------------------------------------------------------------ @@ -332,7 +332,7 @@ const String& ScStyleSheet::GetFollow() const //! Flag gesetzt und abgefragt werden. //! Die ganze Abfrage muss raus, wenn fuer eine neue Datei-Version die Namens-Umsetzung wegfaellt. -sal_Bool ScStyleSheet::SetName( const String& rNew ) +bool ScStyleSheet::SetName( const String& rNew ) { String aFileStdName = rtl::OUString(STRING_STANDARD); if ( rNew == aFileStdName && aFileStdName != ScGlobal::GetRscString(STR_STYLENAME_STANDARD) ) diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index 2e1dfbdd595d..6d61bd7b4b23 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -1790,9 +1790,7 @@ void ScTable::MaybeAddExtraColumn(SCCOL& rCol, SCROW nRow, OutputDevice* pDev, d // look at alignment const ScPatternAttr* pPattern = GetPattern( rCol, nRow ); - const SfxItemSet* pCondSet = NULL; - if ( ((const SfxUInt32Item&)pPattern->GetItem(ATTR_CONDITIONAL)).GetValue() ) - pCondSet = pDocument->GetCondResult( rCol, nRow, nTab ); + const SfxItemSet* pCondSet = pDocument->GetCondResult( rCol, nRow, nTab ); SvxCellHorJustify eHorJust = (SvxCellHorJustify)((const SvxHorJustifyItem&) pPattern->GetItem( ATTR_HOR_JUSTIFY, pCondSet )).GetValue(); diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index eb22ac694d6f..d016c6b41764 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -264,8 +264,13 @@ void ScTable::DeleteRow( SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCSIZE if (nRow >= nStartRow) { - aNotes.insert(nCol, nRow - nSize, pPostIt); - maNotes.ReleaseNote(nCol, nRow); + if(nRow - nStartRow > static_cast<SCROW>(nSize)) + { + aNotes.insert(nCol, nRow - nSize, pPostIt); + maNotes.ReleaseNote(nCol, nRow); + } + else + maNotes.erase(nCol, nRow); } } @@ -372,7 +377,7 @@ void ScTable::InsertCol( SCCOL nStartCol, SCROW nStartRow, SCROW nEndRow, SCSIZE ScPostIt* pPostIt = itr->second; ++itr; - if (nCol >= nStartCol) + if (nCol - nStartCol >= nStartCol) { aNotes.insert(nCol + nSize, nRow, pPostIt); maNotes.ReleaseNote(nCol, nRow); @@ -483,8 +488,13 @@ void ScTable::DeleteCol( SCCOL nStartCol, SCROW nStartRow, SCROW nEndRow, SCSIZE if (nCol >= nStartCol) { - aNotes.insert(nCol - nSize, nRow, pPostIt); - maNotes.ReleaseNote(nCol, nRow); + if(nCol > static_cast<SCCOL>(nSize)) + { + aNotes.insert(nCol - nSize, nRow, pPostIt); + maNotes.ReleaseNote(nCol, nRow); + } + else + maNotes.erase(nCol, nRow); } } @@ -664,12 +674,13 @@ void ScTable::CopyConditionalFormat( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCRO ScAttrIterator* pIter = pTable->aCol[i-nDx].CreateAttrIterator( nRow1-nDy, nRow2-nDy ); SCROW nStartRow = 0, nEndRow = 0; const ScPatternAttr* pPattern = pIter->Next( nStartRow, nEndRow ); - sal_uInt32 nId = ((SfxUInt32Item&)pPattern->GetItem(ATTR_CONDITIONAL)).GetValue(); - if ( nId != 0) + const std::vector<sal_uInt32>& rCondFormatData = static_cast<const ScCondFormatItem&>(pPattern->GetItem(ATTR_CONDITIONAL)).GetCondFormatData(); + for(std::vector<sal_uInt32>::const_iterator itr = rCondFormatData.begin(), itrEnd = rCondFormatData.end(); + itr != itrEnd; ++itr) { - if (aOldIdToNewId.find(nId) == aOldIdToNewId.end()) + if (aOldIdToNewId.find(*itr) == aOldIdToNewId.end()) { - ScConditionalFormat* pFormat = pOldCondFormatList->GetFormat(nId); + ScConditionalFormat* pFormat = pOldCondFormatList->GetFormat(*itr); if(!pFormat) { // may happen in some strange circumstances where cell storage and @@ -680,20 +691,20 @@ void ScTable::CopyConditionalFormat( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCRO pNewFormat->SetKey(0); //not in list => create entries in both maps and new format sal_uLong nMax = 0; - for(ScConditionalFormatList::const_iterator itr = mpCondFormatList->begin(); - itr != mpCondFormatList->end(); ++itr) + for(ScConditionalFormatList::const_iterator itrCond = mpCondFormatList->begin(); + itrCond != mpCondFormatList->end(); ++itrCond) { - if(itr->GetKey() > nMax) - nMax = itr->GetKey(); + if(itrCond->GetKey() > nMax) + nMax = itrCond->GetKey(); } pNewFormat->SetKey(nMax + 1); mpCondFormatList->InsertNew(pNewFormat); sal_Int32 nNewId = pNewFormat->GetKey(); - aOldIdToNewId.insert( std::pair<sal_Int32, sal_Int32>( nId, nNewId ) ); - aIdToRange.insert( std::pair<sal_Int32, ScRangeList>( nId, ScRangeList() ) ); + aOldIdToNewId.insert( std::pair<sal_Int32, sal_Int32>( *itr, nNewId ) ); + aIdToRange.insert( std::pair<sal_Int32, ScRangeList>( *itr, ScRangeList() ) ); } - aIdToRange.find(nId)->second.Join( ScRange( i, nStartRow + nDy, nTab, i, nEndRow + nDy, nTab ) ); + aIdToRange.find(*itr)->second.Join( ScRange( i, nStartRow + nDy, nTab, i, nEndRow + nDy, nTab ) ); } } @@ -709,11 +720,7 @@ void ScTable::CopyConditionalFormat( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCRO nDx, nDy, pTable->nTab - nTab); pFormat->AddRange(itr->second); - ScPatternAttr aPattern( pDocument->GetPool() ); - aPattern.GetItemSet().Put( SfxUInt32Item( ATTR_CONDITIONAL, nNewKey ) ); - ScMarkData aMarkData; - aMarkData.MarkFromRangeList(itr->second, true); - pDocument->ApplySelectionPattern( aPattern, aMarkData ); + pDocument->AddCondFormatData( itr->second, nTab, nNewKey ); } } @@ -1762,31 +1769,35 @@ void ScTable::FindMaxRotCol( RowInfo* pRowInfo, SCSIZE nArrCount, SCCOL nX1, SCC // alle Formate durchgehen, damit die Zellen nicht einzeln // angeschaut werden muessen - sal_uLong nIndex = ((const SfxUInt32Item*)pCondItem)->GetValue(); + const std::vector<sal_uInt32>& rCondFormatData = static_cast<const ScCondFormatItem*>(pCondItem)->GetCondFormatData(); ScStyleSheetPool* pStylePool = pDocument->GetStyleSheetPool(); - if (mpCondFormatList && pStylePool && nIndex) + if (mpCondFormatList && pStylePool && !rCondFormatData.empty()) { - const ScConditionalFormat* pFormat = mpCondFormatList->GetFormat(nIndex); - if ( pFormat ) + for(std::vector<sal_uInt32>::const_iterator itr = rCondFormatData.begin(), itrEnd = rCondFormatData.end(); + itr != itrEnd; ++itr) { - size_t nEntryCount = pFormat->size(); - for (size_t nEntry=0; nEntry<nEntryCount; nEntry++) + const ScConditionalFormat* pFormat = mpCondFormatList->GetFormat(*itr); + if ( pFormat ) { - const ScFormatEntry* pEntry = pFormat->GetEntry(nEntry); - if(pEntry->GetType() != condformat::CONDITION) - continue; - - String aStyleName = static_cast<const ScCondFormatEntry*>(pEntry)->GetStyle(); - if (aStyleName.Len()) + size_t nEntryCount = pFormat->size(); + for (size_t nEntry=0; nEntry<nEntryCount; nEntry++) { - SfxStyleSheetBase* pStyleSheet = - pStylePool->Find( aStyleName, SFX_STYLE_FAMILY_PARA ); - if ( pStyleSheet ) + const ScFormatEntry* pEntry = pFormat->GetEntry(nEntry); + if(pEntry->GetType() != condformat::CONDITION) + continue; + + String aStyleName = static_cast<const ScCondFormatEntry*>(pEntry)->GetStyle(); + if (aStyleName.Len()) { - FillMaxRot( pRowInfo, nArrCount, nX1, nX2, + SfxStyleSheetBase* pStyleSheet = + pStylePool->Find( aStyleName, SFX_STYLE_FAMILY_PARA ); + if ( pStyleSheet ) + { + FillMaxRot( pRowInfo, nArrCount, nX1, nX2, nCol, nAttrRow1, nAttrRow2, nArrY, pPattern, &pStyleSheet->GetItemSet() ); - // nArrY nicht veraendern + // nArrY nicht veraendern + } } } } @@ -2146,6 +2157,40 @@ void ScTable::ApplyPatternIfNumberformatIncompatible( const ScRange& rRange, } } +void ScTable::AddCondFormatData( const ScRangeList& rRange, sal_uInt32 nIndex ) +{ + size_t n = rRange.size(); + for(size_t i = 0; i < n; ++i) + { + const ScRange* pRange = rRange[i]; + SCCOL nColStart = pRange->aStart.Col(); + SCCOL nColEnd = pRange->aEnd.Col(); + SCROW nRowStart = pRange->aStart.Row(); + SCROW nRowEnd = pRange->aEnd.Row(); + for(SCCOL nCol = nColStart; nCol <= nColEnd; ++nCol) + { + aCol[nCol].AddCondFormat(nRowStart, nRowEnd, nIndex); + } + } +} + +void ScTable::RemoveCondFormatData( const ScRangeList& rRange, sal_uInt32 nIndex ) +{ + size_t n = rRange.size(); + for(size_t i = 0; i < n; ++i) + { + const ScRange* pRange = rRange[i]; + SCCOL nColStart = pRange->aStart.Col(); + SCCOL nColEnd = pRange->aEnd.Col(); + SCROW nRowStart = pRange->aStart.Row(); + SCROW nRowEnd = pRange->aEnd.Row(); + for(SCCOL nCol = nColStart; nCol <= nColEnd; ++nCol) + { + aCol[nCol].RemoveCondFormat(nRowStart, nRowEnd, nIndex); + } + } +} + void ScTable::ApplyStyle( SCCOL nCol, SCROW nRow, const ScStyleSheet& rStyle ) diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx index 7688b4e4f825..8058e0a8d3c9 100644 --- a/sc/source/core/data/table3.cxx +++ b/sc/source/core/data/table3.cxx @@ -387,10 +387,14 @@ short ScTable::CompareCell( sal_uInt16 nSort, if (pCell1) { eType1 = pCell1->GetCellType(); + if (eType1 == CELLTYPE_NOTE) + pCell1 = NULL; } if (pCell2) { eType2 = pCell2->GetCellType(); + if (eType2 == CELLTYPE_NOTE) + pCell2 = NULL; } if (pCell1) @@ -863,7 +867,7 @@ void ScTable::RemoveSubTotals( ScSubTotalParam& rParam ) // harte Zahlenformate loeschen (fuer Ergebnisformeln) -void lcl_RemoveNumberFormat( ScTable* pTab, SCCOL nCol, SCROW nRow ) +static void lcl_RemoveNumberFormat( ScTable* pTab, SCCOL nCol, SCROW nRow ) { const ScPatternAttr* pPattern = pTab->GetPattern( nCol, nRow ); if ( pPattern->GetItemSet().GetItemState( ATTR_VALUE_FORMAT, false ) @@ -2302,23 +2306,6 @@ void ScTable::UpdateSelectionFunction( ScFunctionData& rData, aCol[nCol].UpdateAreaFunction( rData, *mpHiddenRows, nStartRow, nEndRow ); } -void ScTable::FindConditionalFormat( sal_uLong nKey, ScRangeList& rList ) const -{ - SCROW nStartRow = 0, nEndRow = 0; - for (SCCOL nCol=0; nCol<=MAXCOL; nCol++) - { - ScAttrIterator* pIter = aCol[nCol].CreateAttrIterator( 0, MAXROW ); - const ScPatternAttr* pPattern = pIter->Next( nStartRow, nEndRow ); - while (pPattern) - { - if (((SfxUInt32Item&)pPattern->GetItem(ATTR_CONDITIONAL)).GetValue() == nKey) - rList.Join( ScRange(nCol,nStartRow,nTab, nCol,nEndRow,nTab) ); - pPattern = pIter->Next( nStartRow, nEndRow ); - } - delete pIter; - } -} - void ScTable::IncRecalcLevel() { ++nRecalcLvl; diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx index 525970de237d..b1f86e02fb38 100644 --- a/sc/source/core/data/table4.cxx +++ b/sc/source/core/data/table4.cxx @@ -82,7 +82,7 @@ extern sal_uInt16 nScFillModeMouseModifier; // global.cxx // ----------------------------------------------------------------------- -short lcl_DecompValueString( String& aValue, sal_Int32& nVal, sal_uInt16* pMinDigits = NULL ) +static short lcl_DecompValueString( String& aValue, sal_Int32& nVal, sal_uInt16* pMinDigits = NULL ) { if ( !aValue.Len() ) { @@ -137,7 +137,7 @@ short lcl_DecompValueString( String& aValue, sal_Int32& nVal, sal_uInt16* pMinDi return 0; } -String lcl_ValueString( sal_Int32 nValue, sal_uInt16 nMinDigits ) +static String lcl_ValueString( sal_Int32 nValue, sal_uInt16 nMinDigits ) { if ( nMinDigits <= 1 ) return String::CreateFromInt32( nValue ); // simple case... diff --git a/sc/source/core/inc/adiasync.hxx b/sc/source/core/inc/adiasync.hxx index e9f0198afa51..3a479ce29aa5 100644 --- a/sc/source/core/inc/adiasync.hxx +++ b/sc/source/core/inc/adiasync.hxx @@ -52,7 +52,7 @@ private: String* pStr; }; ScAddInDocs* pDocs; // List of using documents - FuncData* mpFuncData; // Pointer to files in collection + FuncData* mpFuncData; // Pointer to data in collection sal_uLong nHandle; // is casted from double to sal_uLong ParamType meType; // result of type PTR_DOUBLE or PTR_STRING bool bValid; // is value valid? diff --git a/sc/source/core/tool/addincol.cxx b/sc/source/core/tool/addincol.cxx index ac3b81272a76..6736d74d4591 100644 --- a/sc/source/core/tool/addincol.cxx +++ b/sc/source/core/tool/addincol.cxx @@ -343,7 +343,7 @@ void ScUnoAddInCollection::Initialize() } // ----------------------------------------------------------------------------- -sal_uInt16 lcl_GetCategory( const ::rtl::OUString& rName ) +static sal_uInt16 lcl_GetCategory( const ::rtl::OUString& rName ) { static const sal_Char* aFuncNames[SC_FUNCGROUP_COUNT] = { @@ -689,7 +689,7 @@ inline sal_Bool IsTypeName( const rtl::OUString& rName, const uno::Type& rType ) return rName == rType.getTypeName(); } -sal_Bool lcl_ValidReturnType( const uno::Reference<reflection::XIdlClass>& xClass ) +static sal_Bool lcl_ValidReturnType( const uno::Reference<reflection::XIdlClass>& xClass ) { // this must match with ScUnoAddInCall::SetResult @@ -737,7 +737,7 @@ sal_Bool lcl_ValidReturnType( const uno::Reference<reflection::XIdlClass>& xClas } } -ScAddInArgumentType lcl_GetArgType( const uno::Reference<reflection::XIdlClass>& xClass ) +static ScAddInArgumentType lcl_GetArgType( const uno::Reference<reflection::XIdlClass>& xClass ) { if (!xClass.is()) return SC_ADDINARG_NONE; @@ -1019,7 +1019,7 @@ void ScUnoAddInCollection::ReadFromAddIn( const uno::Reference<uno::XInterface>& } } -void lcl_UpdateFunctionList( ScFunctionList& rFunctionList, const ScUnoAddInFuncData& rFuncData ) +static void lcl_UpdateFunctionList( ScFunctionList& rFunctionList, const ScUnoAddInFuncData& rFuncData ) { ::rtl::OUString aCompare = rFuncData.GetUpperLocal(); // as used in FillFunctionDescFromData @@ -1035,7 +1035,7 @@ void lcl_UpdateFunctionList( ScFunctionList& rFunctionList, const ScUnoAddInFunc } } -const ScAddInArgDesc* lcl_FindArgDesc( const ScUnoAddInFuncData& rFuncData, const ::rtl::OUString& rArgIntName ) +static const ScAddInArgDesc* lcl_FindArgDesc( const ScUnoAddInFuncData& rFuncData, const ::rtl::OUString& rArgIntName ) { long nArgCount = rFuncData.GetArgumentCount(); const ScAddInArgDesc* pArguments = rFuncData.GetArguments(); diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx index 5850e0197979..f4905c8d9046 100644 --- a/sc/source/core/tool/address.cxx +++ b/sc/source/core/tool/address.cxx @@ -134,7 +134,7 @@ sal_Unicode_strtol ( const sal_Unicode* p, return is_neg ? -accum : accum; } -const sal_Unicode* lcl_eatWhiteSpace( const sal_Unicode* p ) +static const sal_Unicode* lcl_eatWhiteSpace( const sal_Unicode* p ) { if ( p ) { @@ -339,7 +339,7 @@ lcl_XL_ParseSheetRef( const sal_Unicode* start, TRUE in all other cases, also when there is no index sequence or the input name is not numeric. */ -bool lcl_XL_getExternalDoc( const sal_Unicode** ppErrRet, String& rExternDocName, +static bool lcl_XL_getExternalDoc( const sal_Unicode** ppErrRet, String& rExternDocName, const uno::Sequence< const sheet::ExternalLinkInfo > * pExternalLinks) { // 1-based, sequence starts with an empty element. diff --git a/sc/source/core/tool/appoptio.cxx b/sc/source/core/tool/appoptio.cxx index 8f61428b03f0..c8ec1be7be23 100644 --- a/sc/source/core/tool/appoptio.cxx +++ b/sc/source/core/tool/appoptio.cxx @@ -152,7 +152,7 @@ void ScAppOptions::SetLRUFuncList( const sal_uInt16* pList, const sal_uInt16 nCo // Config Item containing app options //================================================================== -void lcl_SetLastFunctions( ScAppOptions& rOpt, const Any& rValue ) +static void lcl_SetLastFunctions( ScAppOptions& rOpt, const Any& rValue ) { Sequence<sal_Int32> aSeq; if ( rValue >>= aSeq ) @@ -172,7 +172,7 @@ void lcl_SetLastFunctions( ScAppOptions& rOpt, const Any& rValue ) } } -void lcl_GetLastFunctions( Any& rDest, const ScAppOptions& rOpt ) +static void lcl_GetLastFunctions( Any& rDest, const ScAppOptions& rOpt ) { long nCount = rOpt.GetLRUFuncListCount(); sal_uInt16* pUShorts = rOpt.GetLRUFuncList(); @@ -188,7 +188,7 @@ void lcl_GetLastFunctions( Any& rDest, const ScAppOptions& rOpt ) rDest <<= Sequence<sal_Int32>(0); // empty } -void lcl_SetSortList( const Any& rValue ) +static void lcl_SetSortList( const Any& rValue ) { Sequence<OUString> aSeq; if ( rValue >>= aSeq ) @@ -217,7 +217,7 @@ void lcl_SetSortList( const Any& rValue ) } } -void lcl_GetSortList( Any& rDest ) +static void lcl_GetSortList( Any& rDest ) { const ScUserList* pUserList = ScGlobal::GetUserList(); if (pUserList) diff --git a/sc/source/core/tool/callform.cxx b/sc/source/core/tool/callform.cxx index 5d20ad29c2f2..8ba120bf861b 100644 --- a/sc/source/core/tool/callform.cxx +++ b/sc/source/core/tool/callform.cxx @@ -89,7 +89,14 @@ friend class ModuleCollection; osl::Module* pInstance; public: ModuleData(const rtl::OUString& rStr, osl::Module* pInst) : aName(rStr), pInstance(pInst) {} - ModuleData(const ModuleData& rData) : aName(rData.aName) {pInstance = new osl::Module(aName);} + ModuleData(const ModuleData& rData) : aName(rData.aName) + { +#ifndef DISABLE_DYNLOADING + pInstance = new osl::Module(aName); +#else + pInstance = NULL; +#endif + } ~ModuleData() { delete pInstance; } const rtl::OUString& GetName() const { return aName; } @@ -174,6 +181,10 @@ ModuleCollection aModuleCollection; bool InitExternalFunc(const rtl::OUString& rModuleName) { +#ifdef DISABLE_DYNLOADING + (void) rModuleName; + return false; +#else // Module already loaded? const ModuleData* pTemp = aModuleCollection.findByName(rModuleName); if (pTemp) @@ -252,6 +263,7 @@ bool InitExternalFunc(const rtl::OUString& rModuleName) else delete pLib; return bRet; +#endif } //------------------------------------------------------------------------ @@ -265,6 +277,10 @@ void ExitExternalFunc() bool FuncData::Call(void** ppParam) const { +#ifdef DISABLE_DYNLOADING + (void) ppParam; + return false; +#else bool bRet = false; osl::Module* pLib = pModuleData->GetInstance(); FARPROC fProc = (FARPROC)pLib->getFunctionSymbol(aFuncName); @@ -354,12 +370,17 @@ bool FuncData::Call(void** ppParam) const } } return bRet; +#endif } //------------------------------------------------------------------------ bool FuncData::Unadvice( double nHandle ) { +#ifdef DISABLE_DYNLOADING + (void) nHandle; + return false; +#else bool bRet = false; osl::Module* pLib = pModuleData->GetInstance(); FARPROC fProc = (FARPROC)pLib->getFunctionSymbol(UNADVICE); @@ -369,6 +390,7 @@ bool FuncData::Unadvice( double nHandle ) bRet = true; } return bRet; +#endif } //------------------------------------------------------------------------ diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx index 31449a74f3c2..65cd99d920ec 100644 --- a/sc/source/core/tool/chgtrack.cxx +++ b/sc/source/core/tool/chgtrack.cxx @@ -1973,7 +1973,7 @@ void ScChangeActionContent::PutValueToDoc( } -void lcl_InvalidateReference( ScToken& rTok, const ScBigAddress& rPos ) +static void lcl_InvalidateReference( ScToken& rTok, const ScBigAddress& rPos ) { ScSingleRefData& rRef1 = rTok.GetSingleRef(); if ( rPos.Col() < 0 || MAXCOL < rPos.Col() ) diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 5a39f76a446b..c8e317c6a5e7 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -1803,7 +1803,7 @@ void ScCompiler::SetError(sal_uInt16 nError) } -sal_Unicode* lcl_UnicodeStrNCpy( sal_Unicode* pDst, const sal_Unicode* pSrc, xub_StrLen nMax ) +static sal_Unicode* lcl_UnicodeStrNCpy( sal_Unicode* pDst, const sal_Unicode* pSrc, xub_StrLen nMax ) { const sal_Unicode* const pStop = pDst + nMax; while ( *pSrc && pDst < pStop ) @@ -3522,7 +3522,7 @@ void ScCompiler::AutoCorrectParsedSymbol() } } -inline bool lcl_UpperAsciiOrI18n( String& rUpper, const String& rOrg, FormulaGrammar::Grammar eGrammar ) +static inline bool lcl_UpperAsciiOrI18n( String& rUpper, const String& rOrg, FormulaGrammar::Grammar eGrammar ) { if (FormulaGrammar::isODFF( eGrammar )) { @@ -4145,7 +4145,7 @@ bool ScCompiler::HasModifiedRange() //--------------------------------------------------------------------------- template< typename T, typename S > -S lcl_adjval( S& n, T pos, T max, bool bRel ) +static S lcl_adjval( S& n, T pos, T max, bool bRel ) { max++; if( bRel ) diff --git a/sc/source/core/tool/consoli.cxx b/sc/source/core/tool/consoli.cxx index f475d5df6071..2ad21525fd10 100644 --- a/sc/source/core/tool/consoli.cxx +++ b/sc/source/core/tool/consoli.cxx @@ -81,7 +81,7 @@ void ScReferenceList::AddEntry( SCCOL nCol, SCROW nRow, SCTAB nTab ) } template< typename T > -void lcl_AddString( String**& pData, T& nCount, const String& rInsert ) +static void lcl_AddString( String**& pData, T& nCount, const String& rInsert ) { String** pOldData = pData; pData = new String*[ nCount+1 ]; @@ -342,7 +342,7 @@ void ScConsData::AddName( const String& rName ) // rCount < 0 <=> Fehler aufgetreten -void lcl_UpdateArray( ScSubTotalFunc eFunc, +static void lcl_UpdateArray( ScSubTotalFunc eFunc, double& rCount, double& rSum, double& rSumSqr, double nVal ) { if (rCount < 0.0) @@ -396,7 +396,7 @@ void lcl_UpdateArray( ScSubTotalFunc eFunc, } } -void lcl_InitArray( ScSubTotalFunc eFunc, +static void lcl_InitArray( ScSubTotalFunc eFunc, double& rCount, double& rSum, double& rSumSqr, double nVal ) { rCount = 1.0; @@ -427,7 +427,7 @@ void lcl_InitArray( ScSubTotalFunc eFunc, } } -double lcl_CalcData( ScSubTotalFunc eFunc, +static double lcl_CalcData( ScSubTotalFunc eFunc, double fCount, double fSum, double fSumSqr) { if (fCount < 0.0) diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx index 3e6664dbdbb3..7b142cc2c87d 100644 --- a/sc/source/core/tool/dbdata.cxx +++ b/sc/source/core/tool/dbdata.cxx @@ -455,7 +455,9 @@ bool ScDBData::HasQueryParam() const bool ScDBData::HasSortParam() const { - return mpSortParam && mpSortParam->maKeyState[0].bDoSort; + return mpSortParam && + !mpSortParam->maKeyState.empty() && + mpSortParam->maKeyState[0].bDoSort; } bool ScDBData::HasSubTotalParam() const diff --git a/sc/source/core/tool/detfunc.cxx b/sc/source/core/tool/detfunc.cxx index 6d73495924ce..a0c9066c802d 100644 --- a/sc/source/core/tool/detfunc.cxx +++ b/sc/source/core/tool/detfunc.cxx @@ -141,7 +141,7 @@ sal_Bool ScDetectiveFunc::bColorsInitialized = false; //------------------------------------------------------------------------ -sal_Bool lcl_HasThickLine( SdrObject& rObj ) +static sal_Bool lcl_HasThickLine( SdrObject& rObj ) { // thin lines get width 0 -> everything greater 0 is a thick line @@ -386,7 +386,7 @@ Rectangle ScDetectiveFunc::GetDrawRect( SCCOL nCol, SCROW nRow ) const return GetDrawRect( nCol, nRow, nCol, nRow ); } -sal_Bool lcl_IsOtherTab( const basegfx::B2DPolyPolygon& rPolyPolygon ) +static sal_Bool lcl_IsOtherTab( const basegfx::B2DPolyPolygon& rPolyPolygon ) { // test if rPolygon is the line end for "other table" (rectangle) if(1L == rPolyPolygon.count()) diff --git a/sc/source/core/tool/docoptio.cxx b/sc/source/core/tool/docoptio.cxx index 6edad4e3620e..76f83170ee3f 100644 --- a/sc/source/core/tool/docoptio.cxx +++ b/sc/source/core/tool/docoptio.cxx @@ -59,7 +59,7 @@ using sc::TwipsToEvenHMM; //------------------------------------------------------------------------ -sal_uInt16 lcl_GetDefaultTabDist() +static sal_uInt16 lcl_GetDefaultTabDist() { if ( ScOptionsUtil::IsMetricSystem() ) return 709; // 1,25 cm diff --git a/sc/source/core/tool/editutil.cxx b/sc/source/core/tool/editutil.cxx index be6525300d5a..870d8211b011 100644 --- a/sc/source/core/tool/editutil.cxx +++ b/sc/source/core/tool/editutil.cxx @@ -569,7 +569,7 @@ void ScTabEditEngine::Init( const ScPatternAttr& rPattern ) // Zahlen aus \sw\source\core\doc\numbers.cxx // -String lcl_GetCharStr( sal_Int32 nNo ) +static String lcl_GetCharStr( sal_Int32 nNo ) { OSL_ENSURE( nNo, "0 ist eine ungueltige Nummer !!" ); String aStr; @@ -589,7 +589,7 @@ String lcl_GetCharStr( sal_Int32 nNo ) return aStr; } -String lcl_GetNumStr( sal_Int32 nNo, SvxNumType eType ) +static String lcl_GetNumStr( sal_Int32 nNo, SvxNumType eType ) { String aTmpStr(rtl::OUString('0')); if( nNo ) diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index dfbf8da01dbe..3809aa4fee0a 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -346,7 +346,7 @@ void ScInterpreter::ScChoseJump() aCode.Jump( pJump[ nJumpCount ], pJump[ nJumpCount ] ); } -void lcl_AdjustJumpMatrix( ScJumpMatrix* pJumpM, ScMatrixRef& pResMat, SCSIZE nParmCols, SCSIZE nParmRows ) +static void lcl_AdjustJumpMatrix( ScJumpMatrix* pJumpM, ScMatrixRef& pResMat, SCSIZE nParmCols, SCSIZE nParmRows ) { SCSIZE nJumpCols, nJumpRows; SCSIZE nResCols, nResRows; @@ -2146,13 +2146,13 @@ void ScInterpreter::ScType() } -inline bool lcl_FormatHasNegColor( const SvNumberformat* pFormat ) +static inline bool lcl_FormatHasNegColor( const SvNumberformat* pFormat ) { return pFormat && pFormat->GetColor( 1 ); } -inline bool lcl_FormatHasOpenPar( const SvNumberformat* pFormat ) +static inline bool lcl_FormatHasOpenPar( const SvNumberformat* pFormat ) { return pFormat && (pFormat->GetFormatstring().indexOf('(') != -1); } @@ -3184,7 +3184,7 @@ void ScInterpreter::ScValue() //2do: this should be a proper unicode string method -inline bool lcl_ScInterpreter_IsPrintable( sal_Unicode c ) +static inline bool lcl_ScInterpreter_IsPrintable( sal_Unicode c ) { return 0x20 <= c && c != 0x7f; } @@ -7639,8 +7639,7 @@ void ScInterpreter::ScCurrency() ScGlobal::eLnge); if ( (sal_uInt16) fDec != pFormatter->GetFormatPrecision( nIndex ) ) { - String sFormatString; - pFormatter->GenerateFormat(sFormatString, + String sFormatString = pFormatter->GenerateFormat( nIndex, ScGlobal::eLnge, true, // mit Tausenderpunkt @@ -7728,13 +7727,12 @@ void ScInterpreter::ScFixed() else fVal = floor(fVal*fFac+0.5)/fFac; Color* pColor = NULL; - String sFormatString; if (fDec < 0.0) fDec = 0.0; sal_uLong nIndex = pFormatter->GetStandardFormat( NUMBERFORMAT_NUMBER, ScGlobal::eLnge); - pFormatter->GenerateFormat(sFormatString, + String sFormatString = pFormatter->GenerateFormat( nIndex, ScGlobal::eLnge, bThousand, // mit Tausenderpunkt diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx index e359a3de0fab..fc899502d7d4 100644 --- a/sc/source/core/tool/interpr2.cxx +++ b/sc/source/core/tool/interpr2.cxx @@ -2227,7 +2227,7 @@ void ScInterpreter::ScStyle() PushIllegalParameter(); } -ScDdeLink* lcl_GetDdeLink( sfx2::LinkManager* pLinkMgr, +static ScDdeLink* lcl_GetDdeLink( sfx2::LinkManager* pLinkMgr, const String& rA, const String& rT, const String& rI, sal_uInt8 nM ) { sal_uInt16 nCount = pLinkMgr->GetLinks().size(); @@ -2615,7 +2615,7 @@ void ScInterpreter::ScRoman() } -bool lcl_GetArabicValue( sal_Unicode cChar, sal_uInt16& rnValue, bool& rbIsDec ) +static bool lcl_GetArabicValue( sal_Unicode cChar, sal_uInt16& rnValue, bool& rbIsDec ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScBase" ); switch( cChar ) diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx index 933775c90452..c576e32ef772 100644 --- a/sc/source/core/tool/interpr3.cxx +++ b/sc/source/core/tool/interpr3.cxx @@ -71,12 +71,12 @@ protected: //template< class T > double lcl_IterateInverse( const T& rFunction, double x0, double x1, bool& rConvError ) /** u*w<0.0 fails for values near zero */ -inline bool lcl_HasChangeOfSign( double u, double w ) +static inline bool lcl_HasChangeOfSign( double u, double w ) { return (u < 0.0 && w > 0.0) || (u > 0.0 && w < 0.0); } -double lcl_IterateInverse( const ScDistFunc& rFunction, double fAx, double fBx, bool& rConvError ) +static double lcl_IterateInverse( const ScDistFunc& rFunction, double fAx, double fBx, bool& rConvError ) { rConvError = false; const double fYEps = 1.0E-307; @@ -492,7 +492,7 @@ double ScInterpreter::BinomKoeff(double n, double k) // in math library from http://www.boost.org /** you must ensure fZ>0 Uses a variant of the Lanczos sum with a rational function. */ -double lcl_getLanczosSum(double fZ) +static double lcl_getLanczosSum(double fZ) { const double fNum[13] ={ 23531376880.41075968857200767445163675473, @@ -560,7 +560,7 @@ double lcl_getLanczosSum(double fZ) // The algorithm is based on tgamma in gamma.hpp // in math library from http://www.boost.org /** You must ensure fZ>0; fZ>171.624376956302 will overflow. */ -double lcl_GetGammaHelper(double fZ) +static double lcl_GetGammaHelper(double fZ) { double fGamma = lcl_getLanczosSum(fZ); const double fg = 6.024680040776729583740234375; @@ -578,7 +578,7 @@ double lcl_GetGammaHelper(double fZ) // The algorithm is based on tgamma in gamma.hpp // in math library from http://www.boost.org /** You must ensure fZ>0 */ -double lcl_GetLogGammaHelper(double fZ) +static double lcl_GetLogGammaHelper(double fZ) { const double fg = 6.024680040776729583740234375; double fZgHelp = fZ + fg - 0.5; @@ -907,7 +907,7 @@ double ScInterpreter::GetBetaDistPDF(double fX, double fA, double fB) I_x(a,b) = ---------------- * result of ContFrac a * Beta(a,b) */ -double lcl_GetBetaHelperContFrac(double fX, double fA, double fB) +static double lcl_GetBetaHelperContFrac(double fX, double fA, double fB) { // like old version double a1, b1, a2, b2, fnorm, apl2m, d2m, d2m1, cfnew, cf; a1 = 1.0; b1 = 1.0; @@ -1676,7 +1676,7 @@ void ScInterpreter::ScPoissonDist() /** Local function used in the calculation of the hypergeometric distribution. */ -void lcl_PutFactorialElements( ::std::vector< double >& cn, double fLower, double fUpper, double fBase ) +static void lcl_PutFactorialElements( ::std::vector< double >& cn, double fLower, double fUpper, double fBase ) { for ( double i = fLower; i <= fUpper; ++i ) { diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index c35cdfd0f836..4eb288cbefd7 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -3077,7 +3077,7 @@ void ScInterpreter::ScMissing() #ifndef DISABLE_SCRIPTING -uno::Any lcl_getSheetModule( const uno::Reference<table::XCellRange>& xCellRange, ScDocument* pDok ) +static uno::Any lcl_getSheetModule( const uno::Reference<table::XCellRange>& xCellRange, ScDocument* pDok ) { uno::Reference< sheet::XSheetCellRange > xSheetRange( xCellRange, uno::UNO_QUERY_THROW ); uno::Reference< beans::XPropertySet > xProps( xSheetRange->getSpreadsheet(), uno::UNO_QUERY_THROW ); @@ -3107,7 +3107,7 @@ uno::Any lcl_getSheetModule( const uno::Reference<table::XCellRange>& xCellRange return uno::makeAny( xIf ); } -bool +static bool lcl_setVBARange( ScRange& aRange, ScDocument* pDok, SbxVariable* pPar ) { bool bOk = false; diff --git a/sc/source/core/tool/interpr5.cxx b/sc/source/core/tool/interpr5.cxx index 0b9eb3bd258f..46fd6fc1649b 100644 --- a/sc/source/core/tool/interpr5.cxx +++ b/sc/source/core/tool/interpr5.cxx @@ -1135,7 +1135,7 @@ void ScInterpreter::ScMatTrans() For a row or column vector to be replicated the larger matrix dimension is returned, else the smaller dimension. */ -inline SCSIZE lcl_GetMinExtent( SCSIZE n1, SCSIZE n2 ) +static inline SCSIZE lcl_GetMinExtent( SCSIZE n1, SCSIZE n2 ) { if (n1 == 1) return n2; @@ -1148,7 +1148,7 @@ inline SCSIZE lcl_GetMinExtent( SCSIZE n1, SCSIZE n2 ) } template<class _Function> -ScMatrixRef lcl_MatrixCalculation( +static ScMatrixRef lcl_MatrixCalculation( const ScMatrix& rMat1, const ScMatrix& rMat2, ScInterpreter* pInterpreter) { static _Function Op; @@ -1216,7 +1216,7 @@ ScMatrixRef ScInterpreter::MatConcat(const ScMatrixRef& pMat1, const ScMatrixRef // for DATE, TIME, DATETIME -void lcl_GetDiffDateTimeFmtType( short& nFuncFmt, short nFmt1, short nFmt2 ) +static void lcl_GetDiffDateTimeFmtType( short& nFuncFmt, short nFmt1, short nFmt2 ) { if ( nFmt1 != NUMBERFORMAT_UNDEFINED || nFmt2 != NUMBERFORMAT_UNDEFINED ) { diff --git a/sc/source/core/tool/progress.cxx b/sc/source/core/tool/progress.cxx index b5d9846c80a8..597dcc04e017 100644 --- a/sc/source/core/tool/progress.cxx +++ b/sc/source/core/tool/progress.cxx @@ -56,7 +56,7 @@ ScDocument* ScProgress::pInterpretDoc; sal_Bool ScProgress::bIdleWasDisabled = false; -sal_Bool lcl_IsHiddenDocument( SfxObjectShell* pObjSh ) +static sal_Bool lcl_IsHiddenDocument( SfxObjectShell* pObjSh ) { if (pObjSh) { @@ -73,7 +73,7 @@ sal_Bool lcl_IsHiddenDocument( SfxObjectShell* pObjSh ) return false; } -bool lcl_HasControllersLocked( SfxObjectShell& rObjSh ) +static bool lcl_HasControllersLocked( SfxObjectShell& rObjSh ) { uno::Reference<frame::XModel> xModel( rObjSh.GetBaseModel() ); if (xModel.is()) diff --git a/sc/source/core/tool/rangelst.cxx b/sc/source/core/tool/rangelst.cxx index b7347f62dcbd..e4b38679311d 100644 --- a/sc/source/core/tool/rangelst.cxx +++ b/sc/source/core/tool/rangelst.cxx @@ -465,8 +465,7 @@ bool ScRangeList::UpdateReference( if( nDx < 0 || nDy < 0 ) { size_t n = maRanges.size(); - for(size_t i = n-1; i > 0; --i) - Join(*maRanges[i], true); + Join(*maRanges[n-1], true); } } diff --git a/sc/source/core/tool/rangeseq.cxx b/sc/source/core/tool/rangeseq.cxx index ff350188fab6..6c8e7ca28bf5 100644 --- a/sc/source/core/tool/rangeseq.cxx +++ b/sc/source/core/tool/rangeseq.cxx @@ -42,7 +42,7 @@ using namespace com::sun::star; //------------------------------------------------------------------------ -bool lcl_HasErrors( ScDocument* pDoc, const ScRange& rRange ) +static bool lcl_HasErrors( ScDocument* pDoc, const ScRange& rRange ) { // no need to look at empty cells - just use ScCellIterator ScCellIterator aIter( pDoc, rRange ); @@ -56,7 +56,7 @@ bool lcl_HasErrors( ScDocument* pDoc, const ScRange& rRange ) return false; // no error found } -long lcl_DoubleToLong( double fVal ) +static long lcl_DoubleToLong( double fVal ) { double fInt = (fVal >= 0.0) ? ::rtl::math::approxFloor( fVal ) : ::rtl::math::approxCeil( fVal ); @@ -252,7 +252,7 @@ sal_Bool ScRangeToSequence::FillStringArray( uno::Any& rAny, const ScMatrix* pMa //------------------------------------------------------------------------ -double lcl_GetValueFromCell( ScBaseCell& rCell ) +static double lcl_GetValueFromCell( ScBaseCell& rCell ) { //! ScBaseCell member function? diff --git a/sc/source/core/tool/reffind.cxx b/sc/source/core/tool/reffind.cxx index 8593dde47a5f..58a47b9e35d1 100644 --- a/sc/source/core/tool/reffind.cxx +++ b/sc/source/core/tool/reffind.cxx @@ -218,7 +218,7 @@ ScRefFinder::~ScRefFinder() { } -sal_uInt16 lcl_NextFlags( sal_uInt16 nOld ) +static sal_uInt16 lcl_NextFlags( sal_uInt16 nOld ) { sal_uInt16 nNew = nOld & 7; // die drei Abs-Flags nNew = ( nNew - 1 ) & 7; // weiterzaehlen diff --git a/sc/source/core/tool/refupdat.cxx b/sc/source/core/tool/refupdat.cxx index 38fe766f0bb2..c5487b6485e5 100644 --- a/sc/source/core/tool/refupdat.cxx +++ b/sc/source/core/tool/refupdat.cxx @@ -35,7 +35,7 @@ //------------------------------------------------------------------------ template< typename R, typename S, typename U > -bool lcl_MoveStart( R& rRef, U nStart, S nDelta, U nMask ) +static bool lcl_MoveStart( R& rRef, U nStart, S nDelta, U nMask ) { bool bCut = false; if ( rRef >= nStart ) @@ -56,7 +56,7 @@ bool lcl_MoveStart( R& rRef, U nStart, S nDelta, U nMask ) } template< typename R, typename S, typename U > -bool lcl_MoveEnd( R& rRef, U nStart, S nDelta, U nMask ) +static bool lcl_MoveEnd( R& rRef, U nStart, S nDelta, U nMask ) { bool bCut = false; if ( rRef >= nStart ) @@ -77,7 +77,7 @@ bool lcl_MoveEnd( R& rRef, U nStart, S nDelta, U nMask ) } template< typename R, typename S, typename U > -bool lcl_MoveReorder( R& rRef, U nStart, U nEnd, S nDelta ) +static bool lcl_MoveReorder( R& rRef, U nStart, U nEnd, S nDelta ) { if ( rRef >= nStart && rRef <= nEnd ) { @@ -112,7 +112,7 @@ bool lcl_MoveReorder( R& rRef, U nStart, U nEnd, S nDelta ) } template< typename R, typename S, typename U > -bool lcl_MoveItCut( R& rRef, S nDelta, U nMask ) +static bool lcl_MoveItCut( R& rRef, S nDelta, U nMask ) { bool bCut = false; rRef = sal::static_int_cast<R>( rRef + nDelta ); @@ -130,7 +130,7 @@ bool lcl_MoveItCut( R& rRef, S nDelta, U nMask ) } template< typename R, typename S, typename U > -void lcl_MoveItWrap( R& rRef, S nDelta, U nMask ) +static void lcl_MoveItWrap( R& rRef, S nDelta, U nMask ) { rRef = sal::static_int_cast<R>( rRef + nDelta ); if ( rRef < 0 ) @@ -140,7 +140,7 @@ void lcl_MoveItWrap( R& rRef, S nDelta, U nMask ) } template< typename R, typename S, typename U > -bool lcl_MoveRefPart( R& rRef1Val, bool& rRef1Del, bool bDo1, +static bool lcl_MoveRefPart( R& rRef1Val, bool& rRef1Del, bool bDo1, R& rRef2Val, bool& rRef2Del, bool bDo2, U nStart, U nEnd, S nDelta, U nMask ) { @@ -223,7 +223,7 @@ void Expand( R& n1, R& n2, U nStart, S nD ) } -bool lcl_IsWrapBig( sal_Int32 nRef, sal_Int32 nDelta ) +static bool lcl_IsWrapBig( sal_Int32 nRef, sal_Int32 nDelta ) { if ( nRef > 0 && nDelta > 0 ) return nRef + nDelta <= 0; @@ -233,7 +233,7 @@ bool lcl_IsWrapBig( sal_Int32 nRef, sal_Int32 nDelta ) } -bool lcl_MoveBig( sal_Int32& rRef, sal_Int32 nStart, sal_Int32 nDelta ) +static bool lcl_MoveBig( sal_Int32& rRef, sal_Int32 nStart, sal_Int32 nDelta ) { bool bCut = false; if ( rRef >= nStart ) @@ -248,7 +248,7 @@ bool lcl_MoveBig( sal_Int32& rRef, sal_Int32 nStart, sal_Int32 nDelta ) return bCut; } -bool lcl_MoveItCutBig( sal_Int32& rRef, sal_Int32 nDelta ) +static bool lcl_MoveItCutBig( sal_Int32& rRef, sal_Int32 nDelta ) { bool bCut = lcl_IsWrapBig( rRef, nDelta ); rRef += nDelta; diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index c7e936753aad..3035954d3a2e 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -298,7 +298,7 @@ bool ScRawToken::IsValidReference() const } -sal_uInt16 lcl_ScRawTokenOffset() +sal_uInt16 ScRawToken::sbyteOffset() { // offset of sbyte in ScRawToken // offsetof(ScRawToken, sbyte) gives a warning with gcc, because ScRawToken is no POD @@ -319,7 +319,7 @@ ScRawToken* ScRawToken::Clone() const } else { - static sal_uInt16 nOffset = lcl_ScRawTokenOffset(); // offset of sbyte + static sal_uInt16 nOffset = sbyteOffset(); // offset of sbyte sal_uInt16 n = nOffset; switch( eType ) @@ -448,14 +448,14 @@ void ScRawToken::Delete() // --- class ScToken -------------------------------------------------------- -ScSingleRefData lcl_ScToken_InitSingleRef() +static ScSingleRefData lcl_ScToken_InitSingleRef() { ScSingleRefData aRef; aRef.InitAddress( ScAddress() ); return aRef; } -ScComplexRefData lcl_ScToken_InitDoubleRef() +static ScComplexRefData lcl_ScToken_InitDoubleRef() { ScComplexRefData aRef; aRef.Ref1 = lcl_ScToken_InitSingleRef(); diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx index 3ea56ebae788..50a7870822e3 100644 --- a/sc/source/filter/excel/excimp8.cxx +++ b/sc/source/filter/excel/excimp8.cxx @@ -199,9 +199,6 @@ public: } }; -// defined in docfunc.cxx ( really this needs a new name ) -script::ModuleInfo lcl_InitModuleInfo( SfxObjectShell& rDocSh, String& sModule ); - ImportExcel8::ImportExcel8( XclImpRootData& rImpData, SvStream& rStrm ) : ImportExcel( rImpData, rStrm ) { @@ -343,7 +340,7 @@ void ImportExcel8::ReadBasic( void ) SvStorageStreamRef xXCB = xRootStrg->OpenSotStream( String( RTL_CONSTASCII_USTRINGPARAM( "XCB" ) ), STREAM_STD_READ | STREAM_NOCREATE ); if ( xXCB.Is()|| SVSTREAM_OK == xXCB->GetError() ) { - CTBWrapper wrapper; + ScCTBWrapper wrapper; if ( wrapper.Read( *xXCB ) ) { #if OSL_DEBUG_LEVEL > 1 @@ -360,10 +357,10 @@ void ImportExcel8::ReadBasic( void ) SfxMedium& rMedium = GetMedium(); uno::Reference< io::XInputStream > xIn = rMedium.GetInputStream(); oox::ole::OleStorage root( aCtx, xIn, false ); - oox::StorageRef vbaStg = root.openSubStorage( CREATE_OUSTRING( "_VBA_PROJECT_CUR" ), false ); + oox::StorageRef vbaStg = root.openSubStorage( "_VBA_PROJECT_CUR", false ); if ( vbaStg.get() ) { - oox::ole::VbaProject aVbaPrj( aCtx, pShell->GetModel(), CREATE_OUSTRING( "Calc") ); + oox::ole::VbaProject aVbaPrj( aCtx, pShell->GetModel(), "Calc" ); // collect names of embedded form controls, as specified in the VBA project uno::Reference< container::XNameContainer > xOleNameOverrideSink( new OleNameOverrideContainer ); aVbaPrj.setOleOverridesSink( xOleNameOverrideSink ); diff --git a/sc/source/filter/excel/impop.cxx b/sc/source/filter/excel/impop.cxx index 8c7a48bcbd9b..c79b47489c80 100644 --- a/sc/source/filter/excel/impop.cxx +++ b/sc/source/filter/excel/impop.cxx @@ -1245,7 +1245,7 @@ void ImportExcel::PostDocLoad( void ) // open forms in alive mode (has no effect, if no controls in document) if( ScModelObj* pDocObj = GetDocModelObj() ) - pDocObj->setPropertyValue( CREATE_OUSTRING( SC_UNO_APPLYFMDES ), uno::Any( false ) ); + pDocObj->setPropertyValue( SC_UNO_APPLYFMDES, uno::Any( false ) ); // enables extended options to be set to the view after import GetExtDocOptions().SetChanged( true ); diff --git a/sc/source/filter/excel/xechart.cxx b/sc/source/filter/excel/xechart.cxx index 9888f5af4b14..5d0bee7385d1 100644 --- a/sc/source/filter/excel/xechart.cxx +++ b/sc/source/filter/excel/xechart.cxx @@ -1947,8 +1947,8 @@ bool XclExpChSeries::ConvertDataSeries( Reference< XColorScheme > xColorScheme = xDiagram->getDefaultColorScheme(); if( xColorScheme.is() ) { - const OUString aFillStyleName = CREATE_OUSTRING( "FillStyle" ); - const OUString aColorName = CREATE_OUSTRING( "Color" ); + const OUString aFillStyleName = "FillStyle"; + const OUString aColorName = "Color"; namespace cssd = ::com::sun::star::drawing; for( sal_Int32 nPointIdx = 0; nPointIdx < nMaxPointCount; ++nPointIdx ) { diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx index abca86f96d68..c73155be6518 100644 --- a/sc/source/filter/excel/xecontent.cxx +++ b/sc/source/filter/excel/xecontent.cxx @@ -885,17 +885,18 @@ void XclExpCF::SaveXml( XclExpXmlStream& rStrm ) mxImpl->SaveXml( rStrm ); } -XclExpCfvo::XclExpCfvo(const XclExpRoot& rRoot, const ScColorScaleEntry& rEntry, const ScAddress& rAddr): +XclExpCfvo::XclExpCfvo(const XclExpRoot& rRoot, const ScColorScaleEntry& rEntry, const ScAddress& rAddr, bool bFirst): XclExpRecord(), XclExpRoot( rRoot ), mrEntry(rEntry), - maSrcPos(rAddr) + maSrcPos(rAddr), + mbFirst(bFirst) { } namespace { -rtl::OString getColorScaleType( const ScColorScaleEntry& rEntry ) +rtl::OString getColorScaleType( const ScColorScaleEntry& rEntry, bool bFirst ) { switch(rEntry.GetType()) { @@ -907,10 +908,11 @@ rtl::OString getColorScaleType( const ScColorScaleEntry& rEntry ) return "percent"; case COLORSCALE_FORMULA: return "formula"; - case COLORSCALE_AUTOMIN: - return "min"; - case COLORSCALE_AUTOMAX: - return "max"; + case COLORSCALE_AUTO: + if(bFirst) + return "min"; + else + return "max"; case COLORSCALE_PERCENTILE: return "percentile"; default: @@ -938,7 +940,7 @@ void XclExpCfvo::SaveXml( XclExpXmlStream& rStrm ) } rWorksheet->startElement( XML_cfvo, - XML_type, getColorScaleType(mrEntry).getStr(), + XML_type, getColorScaleType(mrEntry, mbFirst).getStr(), XML_val, aValue.getStr(), FSEND ); @@ -973,8 +975,7 @@ XclExpCondfmt::XclExpCondfmt( const XclExpRoot& rRoot, const ScConditionalFormat XclExpRecord( EXC_ID_CONDFMT ), XclExpRoot( rRoot ) { - ScRangeList aScRanges; - GetDoc().FindConditionalFormat( rCondFormat.GetKey(), aScRanges, GetCurrScTab() ); + ScRangeList aScRanges = rCondFormat.GetRange(); GetAddressConverter().ConvertRangeList( maXclRanges, aScRanges, true ); if( !maXclRanges.empty() ) { @@ -1116,8 +1117,8 @@ XclExpDataBar::XclExpDataBar( const XclExpRoot& rRoot, const ScDataBarFormat& rF const ScRange* pRange = rFormat.GetRange().front(); ScAddress aAddr = pRange->aStart; // exact position is not important, we allow only absolute refs - mpCfvoLowerLimit.reset( new XclExpCfvo( GetRoot(), *mrFormat.GetDataBarData()->mpLowerLimit.get(), aAddr ) ); - mpCfvoUpperLimit.reset( new XclExpCfvo( GetRoot(), *mrFormat.GetDataBarData()->mpUpperLimit.get(), aAddr ) ); + mpCfvoLowerLimit.reset( new XclExpCfvo( GetRoot(), *mrFormat.GetDataBarData()->mpLowerLimit.get(), aAddr, true ) ); + mpCfvoUpperLimit.reset( new XclExpCfvo( GetRoot(), *mrFormat.GetDataBarData()->mpUpperLimit.get(), aAddr, false ) ); mpCol.reset( new XclExpColScaleCol( GetRoot(), mrFormat.GetDataBarData()->maPositiveColor ) ); if(xExtLst.get()) @@ -1693,7 +1694,7 @@ XclExpWebQueryBuffer::XclExpWebQueryBuffer( const XclExpRoot& rRoot ) if( !aModelProp.Is() ) return; Reference< XAreaLinks > xAreaLinks; - aModelProp.GetProperty( xAreaLinks, CREATE_OUSTRING( SC_UNO_AREALINKS ) ); + aModelProp.GetProperty( xAreaLinks, SC_UNO_AREALINKS ); Reference< XIndexAccess > xLinksIA( xAreaLinks, UNO_QUERY ); if( !xLinksIA.is() ) return; @@ -1707,16 +1708,16 @@ XclExpWebQueryBuffer::XclExpWebQueryBuffer( const XclExpRoot& rRoot ) { ScfPropertySet aLinkProp( xAreaLink ); OUString aFilter; - if( aLinkProp.GetProperty( aFilter, CREATE_OUSTRING( SC_UNONAME_FILTER ) ) && - (aFilter == CREATE_OUSTRING( EXC_WEBQRY_FILTER )) ) + if( aLinkProp.GetProperty( aFilter, SC_UNONAME_FILTER ) && + (aFilter == EXC_WEBQRY_FILTER) ) { // get properties OUString /*aFilterOpt,*/ aUrl; sal_Int32 nRefresh = 0; -// aLinkProp.GetProperty( aFilterOpt, CREATE_OUSTRING( SC_UNONAME_FILTOPT ) ); - aLinkProp.GetProperty( aUrl, CREATE_OUSTRING( SC_UNONAME_LINKURL ) ); - aLinkProp.GetProperty( nRefresh, CREATE_OUSTRING( SC_UNONAME_REFDELAY ) ); +// aLinkProp.GetProperty( aFilterOpt, SC_UNONAME_FILTOPT ); + aLinkProp.GetProperty( aUrl, SC_UNONAME_LINKURL ); + aLinkProp.GetProperty( nRefresh, SC_UNONAME_REFDELAY ); String aAbsDoc( ScGlobal::GetAbsDocName( aUrl, pShell ) ); INetURLObject aUrlObj( aAbsDoc ); diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx index bf71424d9d3c..74bc82d532b9 100644 --- a/sc/source/filter/excel/xeescher.cxx +++ b/sc/source/filter/excel/xeescher.cxx @@ -461,11 +461,11 @@ void XclExpControlHelper::ConvertSheetLinks( Reference< XShape > xShape ) if( xBindable.is() ) { Reference< XServiceInfo > xServInfo( xBindable->getValueBinding(), UNO_QUERY ); - if( xServInfo.is() && xServInfo->supportsService( CREATE_OUSTRING( SC_SERVICENAME_VALBIND ) ) ) + if( xServInfo.is() && xServInfo->supportsService( SC_SERVICENAME_VALBIND ) ) { ScfPropertySet aBindProp( xServInfo ); CellAddress aApiAddress; - if( aBindProp.GetProperty( aApiAddress, CREATE_OUSTRING( SC_UNONAME_BOUNDCELL ) ) ) + if( aBindProp.GetProperty( aApiAddress, SC_UNONAME_BOUNDCELL ) ) { ScAddress aCellLink; ScUnoConversion::FillScAddress( aCellLink, aApiAddress ); @@ -481,11 +481,11 @@ void XclExpControlHelper::ConvertSheetLinks( Reference< XShape > xShape ) if( xEntrySink.is() ) { Reference< XServiceInfo > xServInfo( xEntrySink->getListEntrySource(), UNO_QUERY ); - if( xServInfo.is() && xServInfo->supportsService( CREATE_OUSTRING( SC_SERVICENAME_LISTSOURCE ) ) ) + if( xServInfo.is() && xServInfo->supportsService( SC_SERVICENAME_LISTSOURCE ) ) { ScfPropertySet aSinkProp( xServInfo ); CellRangeAddress aApiRange; - if( aSinkProp.GetProperty( aApiRange, CREATE_OUSTRING( SC_UNONAME_CELLRANGE ) ) ) + if( aSinkProp.GetProperty( aApiRange, SC_UNONAME_CELLRANGE ) ) { ScRange aSrcRange; ScUnoConversion::FillScRange( aSrcRange, aApiRange ); @@ -529,7 +529,7 @@ XclExpOcxControlObj::XclExpOcxControlObj( XclExpObjectManager& rObjMgr, Referenc // OBJ record flags SetLocked( sal_True ); - SetPrintable( aCtrlProp.GetBoolProperty( CREATE_OUSTRING( "Printable" ) ) ); + SetPrintable( aCtrlProp.GetBoolProperty( "Printable" ) ); SetAutoFill( false ); SetAutoLine( false ); @@ -544,7 +544,7 @@ XclExpOcxControlObj::XclExpOcxControlObj( XclExpObjectManager& rObjMgr, Referenc // #i51348# name of the control, may overwrite shape name OUString aCtrlName; - if( aCtrlProp.GetProperty( aCtrlName, CREATE_OUSTRING( "Name" ) ) && !aCtrlName.isEmpty() ) + if( aCtrlProp.GetProperty( aCtrlName, "Name" ) && !aCtrlName.isEmpty() ) aPropOpt.AddOpt( ESCHER_Prop_wzName, aCtrlName ); // meta file @@ -653,7 +653,7 @@ XclExpTbxControlObj::XclExpTbxControlObj( XclExpObjectManager& rRoot, Reference< // control type sal_Int16 nClassId = 0; - if( aCtrlProp.GetProperty( nClassId, CREATE_OUSTRING( "ClassId" ) ) ) + if( aCtrlProp.GetProperty( nClassId, "ClassId" ) ) { switch( nClassId ) { @@ -673,7 +673,7 @@ XclExpTbxControlObj::XclExpTbxControlObj( XclExpObjectManager& rRoot, Reference< // OBJ record flags SetLocked( sal_True ); - SetPrintable( aCtrlProp.GetBoolProperty( CREATE_OUSTRING( "Printable" ) ) ); + SetPrintable( aCtrlProp.GetBoolProperty( "Printable" ) ); SetAutoFill( false ); SetAutoLine( false ); @@ -681,7 +681,7 @@ XclExpTbxControlObj::XclExpTbxControlObj( XclExpObjectManager& rRoot, Reference< mrEscherEx.OpenContainer( ESCHER_SpContainer ); mrEscherEx.AddShape( ESCHER_ShpInst_HostControl, SHAPEFLAG_HAVEANCHOR | SHAPEFLAG_HAVESPT ); EscherPropertyContainer aPropOpt; - bool bVisible = aCtrlProp.GetBoolProperty( CREATE_OUSTRING( "EnableVisible" ) ); + bool bVisible = aCtrlProp.GetBoolProperty( "EnableVisible" ); aPropOpt.AddOpt( ESCHER_Prop_fPrint, bVisible ? 0x00080000 : 0x00080002 ); // visible flag aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x01000100 ); // bool field @@ -693,7 +693,7 @@ XclExpTbxControlObj::XclExpTbxControlObj( XclExpObjectManager& rRoot, Reference< // #i51348# name of the control, may overwrite shape name OUString aCtrlName; - if( aCtrlProp.GetProperty( aCtrlName, CREATE_OUSTRING( "Name" ) ) && !aCtrlName.isEmpty() ) + if( aCtrlProp.GetProperty( aCtrlName, "Name" ) && !aCtrlName.isEmpty() ) aPropOpt.AddOpt( ESCHER_Prop_wzName, aCtrlName ); // write DFF property set to stream @@ -707,7 +707,7 @@ XclExpTbxControlObj::XclExpTbxControlObj( XclExpObjectManager& rRoot, Reference< // control label OUString aString; - if( aCtrlProp.GetProperty( aString, CREATE_OUSTRING( "Label" ) ) ) + if( aCtrlProp.GetProperty( aString, "Label" ) ) { /* Be sure to construct the MSODRAWING record containing the ClientTextbox atom after the base OBJ's MSODRAWING record data is @@ -733,7 +733,7 @@ XclExpTbxControlObj::XclExpTbxControlObj( XclExpObjectManager& rRoot, Reference< mrEscherEx.CloseContainer(); // ESCHER_SpContainer // other properties - aCtrlProp.GetProperty( mnLineCount, CREATE_OUSTRING( "LineCount" ) ); + aCtrlProp.GetProperty( mnLineCount, "LineCount" ); // border style sal_Int16 nApiButton = AwtVisualEffect::LOOK3D; @@ -742,11 +742,11 @@ XclExpTbxControlObj::XclExpTbxControlObj( XclExpObjectManager& rRoot, Reference< { case FormCompType::LISTBOX: case FormCompType::COMBOBOX: - aCtrlProp.GetProperty( nApiBorder, CREATE_OUSTRING( "Border" ) ); + aCtrlProp.GetProperty( nApiBorder, "Border" ); break; case FormCompType::CHECKBOX: case FormCompType::RADIOBUTTON: - aCtrlProp.GetProperty( nApiButton, CREATE_OUSTRING( "VisualEffect" ) ); + aCtrlProp.GetProperty( nApiButton, "VisualEffect" ); nApiBorder = AwtVisualEffect::NONE; break; // Push button cannot be set to flat in Excel @@ -774,7 +774,7 @@ XclExpTbxControlObj::XclExpTbxControlObj( XclExpObjectManager& rRoot, Reference< // control state sal_Int16 nApiState = 0; - if( aCtrlProp.GetProperty( nApiState, CREATE_OUSTRING( "State" ) ) ) + if( aCtrlProp.GetProperty( nApiState, "State" ) ) { switch( nApiState ) { @@ -789,9 +789,9 @@ XclExpTbxControlObj::XclExpTbxControlObj( XclExpObjectManager& rRoot, Reference< { case FormCompType::LISTBOX: { - mbMultiSel = aCtrlProp.GetBoolProperty( CREATE_OUSTRING( "MultiSelection" ) ); + mbMultiSel = aCtrlProp.GetBoolProperty( "MultiSelection" ); Sequence< sal_Int16 > aSelection; - if( aCtrlProp.GetProperty( aSelection, CREATE_OUSTRING( "SelectedItems" ) ) ) + if( aCtrlProp.GetProperty( aSelection, "SelectedItems" ) ) { sal_Int32 nLen = aSelection.getLength(); if( nLen > 0 ) @@ -804,7 +804,7 @@ XclExpTbxControlObj::XclExpTbxControlObj( XclExpObjectManager& rRoot, Reference< } // convert listbox with dropdown button to Excel dropdown - if( aCtrlProp.GetBoolProperty( CREATE_OUSTRING( "Dropdown" ) ) ) + if( aCtrlProp.GetBoolProperty( "Dropdown" ) ) mnObjType = EXC_OBJTYPE_DROPDOWN; } break; @@ -813,8 +813,8 @@ XclExpTbxControlObj::XclExpTbxControlObj( XclExpObjectManager& rRoot, Reference< { Sequence< OUString > aStringList; OUString aDefText; - if( aCtrlProp.GetProperty( aStringList, CREATE_OUSTRING( "StringItemList" ) ) && - aCtrlProp.GetProperty( aDefText, CREATE_OUSTRING( "Text" ) ) && + if( aCtrlProp.GetProperty( aStringList, "StringItemList" ) && + aCtrlProp.GetProperty( aDefText, "Text" ) && aStringList.getLength() && !aDefText.isEmpty() ) { const OUString* pBegin = aStringList.getConstArray(); @@ -827,7 +827,7 @@ XclExpTbxControlObj::XclExpTbxControlObj( XclExpObjectManager& rRoot, Reference< } // convert combobox without dropdown button to Excel listbox - if( !aCtrlProp.GetBoolProperty( CREATE_OUSTRING( "Dropdown" ) ) ) + if( !aCtrlProp.GetBoolProperty( "Dropdown" ) ) mnObjType = EXC_OBJTYPE_LISTBOX; } break; @@ -835,17 +835,17 @@ XclExpTbxControlObj::XclExpTbxControlObj( XclExpObjectManager& rRoot, Reference< case FormCompType::SCROLLBAR: { sal_Int32 nApiValue = 0; - if( aCtrlProp.GetProperty( nApiValue, CREATE_OUSTRING( "ScrollValueMin" ) ) ) + if( aCtrlProp.GetProperty( nApiValue, "ScrollValueMin" ) ) mnScrollMin = limit_cast< sal_uInt16 >( nApiValue, EXC_OBJ_SCROLLBAR_MIN, EXC_OBJ_SCROLLBAR_MAX ); - if( aCtrlProp.GetProperty( nApiValue, CREATE_OUSTRING( "ScrollValueMax" ) ) ) + if( aCtrlProp.GetProperty( nApiValue, "ScrollValueMax" ) ) mnScrollMax = limit_cast< sal_uInt16 >( nApiValue, mnScrollMin, EXC_OBJ_SCROLLBAR_MIN ); - if( aCtrlProp.GetProperty( nApiValue, CREATE_OUSTRING( "ScrollValue" ) ) ) + if( aCtrlProp.GetProperty( nApiValue, "ScrollValue" ) ) mnScrollValue = limit_cast< sal_uInt16 >( nApiValue, mnScrollMin, mnScrollMax ); - if( aCtrlProp.GetProperty( nApiValue, CREATE_OUSTRING( "LineIncrement" ) ) ) + if( aCtrlProp.GetProperty( nApiValue, "LineIncrement" ) ) mnScrollStep = limit_cast< sal_uInt16 >( nApiValue, EXC_OBJ_SCROLLBAR_MIN, EXC_OBJ_SCROLLBAR_MAX ); - if( aCtrlProp.GetProperty( nApiValue, CREATE_OUSTRING( "BlockIncrement" ) ) ) + if( aCtrlProp.GetProperty( nApiValue, "BlockIncrement" ) ) mnScrollPage = limit_cast< sal_uInt16 >( nApiValue, EXC_OBJ_SCROLLBAR_MIN, EXC_OBJ_SCROLLBAR_MAX ); - if( aCtrlProp.GetProperty( nApiValue, CREATE_OUSTRING( "Orientation" ) ) ) + if( aCtrlProp.GetProperty( nApiValue, "Orientation" ) ) mbScrollHor = nApiValue == AwtScrollOrient::HORIZONTAL; } break; @@ -853,15 +853,15 @@ XclExpTbxControlObj::XclExpTbxControlObj( XclExpObjectManager& rRoot, Reference< case FormCompType::SPINBUTTON: { sal_Int32 nApiValue = 0; - if( aCtrlProp.GetProperty( nApiValue, CREATE_OUSTRING( "SpinValueMin" ) ) ) + if( aCtrlProp.GetProperty( nApiValue, "SpinValueMin" ) ) mnScrollMin = limit_cast< sal_uInt16 >( nApiValue, EXC_OBJ_SCROLLBAR_MIN, EXC_OBJ_SCROLLBAR_MAX ); - if( aCtrlProp.GetProperty( nApiValue, CREATE_OUSTRING( "SpinValueMax" ) ) ) + if( aCtrlProp.GetProperty( nApiValue, "SpinValueMax" ) ) mnScrollMax = limit_cast< sal_uInt16 >( nApiValue, mnScrollMin, EXC_OBJ_SCROLLBAR_MAX ); - if( aCtrlProp.GetProperty( nApiValue, CREATE_OUSTRING( "SpinValue" ) ) ) + if( aCtrlProp.GetProperty( nApiValue, "SpinValue" ) ) mnScrollValue = limit_cast< sal_uInt16 >( nApiValue, mnScrollMin, mnScrollMax ); - if( aCtrlProp.GetProperty( nApiValue, CREATE_OUSTRING( "SpinIncrement" ) ) ) + if( aCtrlProp.GetProperty( nApiValue, "SpinIncrement" ) ) mnScrollStep = limit_cast< sal_uInt16 >( nApiValue, EXC_OBJ_SCROLLBAR_MIN, EXC_OBJ_SCROLLBAR_MAX ); - if( aCtrlProp.GetProperty( nApiValue, CREATE_OUSTRING( "Orientation" ) ) ) + if( aCtrlProp.GetProperty( nApiValue, "Orientation" ) ) mbScrollHor = nApiValue == AwtScrollOrient::HORIZONTAL; } break; @@ -1077,10 +1077,10 @@ XclExpChartObj::XclExpChartObj( XclExpObjectManager& rObjMgr, Reference< XShape // create the chart substream object ScfPropertySet aShapeProp( xShape ); Reference< XModel > xModel; - aShapeProp.GetProperty( xModel, CREATE_OUSTRING( "Model" ) ); + aShapeProp.GetProperty( xModel, "Model" ); mxChartDoc.set( xModel,UNO_QUERY ); ::com::sun::star::awt::Rectangle aBoundRect; - aShapeProp.GetProperty( aBoundRect, CREATE_OUSTRING( "BoundRect" ) ); + aShapeProp.GetProperty( aBoundRect, "BoundRect" ); Rectangle aChartRect( Point( aBoundRect.X, aBoundRect.Y ), Size( aBoundRect.Width, aBoundRect.Height ) ); mxChart.reset( new XclExpChart( GetRoot(), xModel, aChartRect ) ); } @@ -1132,7 +1132,7 @@ void XclExpChartObj::WriteChartObj( sax_fastparser::FSHelperPtr pDrawing, XclExp pDrawing->startElement( FSNS( XML_xdr, XML_nvGraphicFramePr ), FSEND ); // TODO: get the correct chart name chart id - OUString sName = CREATE_OUSTRING("Object 1"); + OUString sName = "Object 1"; Reference< XNamed > xNamed( mxShape, UNO_QUERY ); if (xNamed.is()) { diff --git a/sc/source/filter/excel/xeextlst.cxx b/sc/source/filter/excel/xeextlst.cxx index 32041c52b000..53ab66ba2ec5 100644 --- a/sc/source/filter/excel/xeextlst.cxx +++ b/sc/source/filter/excel/xeextlst.cxx @@ -51,9 +51,10 @@ void XclExpExtAxisColor::SaveXml( XclExpXmlStream& rStrm ) FSEND ); } -XclExpExtCfvo::XclExpExtCfvo( const XclExpRoot& rRoot, const ScColorScaleEntry& rEntry, const ScAddress& rSrcPos ): +XclExpExtCfvo::XclExpExtCfvo( const XclExpRoot& rRoot, const ScColorScaleEntry& rEntry, const ScAddress& rSrcPos, bool bFirst ): XclExpRoot(rRoot), - meType(rEntry.GetType()) + meType(rEntry.GetType()), + mbFirst(bFirst) { if( rEntry.GetType() == COLORSCALE_FORMULA ) { @@ -66,7 +67,7 @@ XclExpExtCfvo::XclExpExtCfvo( const XclExpRoot& rRoot, const ScColorScaleEntry& namespace { -const char* getColorScaleType( ScColorScaleEntryType eType ) +const char* getColorScaleType( ScColorScaleEntryType eType, bool bFirst ) { switch(eType) { @@ -78,10 +79,11 @@ const char* getColorScaleType( ScColorScaleEntryType eType ) return "percent"; case COLORSCALE_FORMULA: return "formula"; - case COLORSCALE_AUTOMIN: - return "autoMin"; - case COLORSCALE_AUTOMAX: - return "autoMax"; + case COLORSCALE_AUTO: + if(bFirst) + return "autoMin"; + else + return "autoMax"; case COLORSCALE_PERCENTILE: return "percentile"; default: @@ -96,7 +98,7 @@ void XclExpExtCfvo::SaveXml( XclExpXmlStream& rStrm ) { sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream(); rWorksheet->singleElementNS( XML_x14, XML_cfvo, - XML_type, getColorScaleType(meType), + XML_type, getColorScaleType(meType, mbFirst), XML_value, maValue.getStr(), FSEND ); } @@ -105,8 +107,8 @@ XclExpExtDataBar::XclExpExtDataBar( const XclExpRoot& rRoot, const ScDataBarForm XclExpRoot(rRoot) { const ScDataBarFormatData& rFormatData = *rFormat.GetDataBarData(); - mpLowerLimit.reset( new XclExpExtCfvo( *this, *rFormatData.mpLowerLimit.get(), rPos ) ); - mpUpperLimit.reset( new XclExpExtCfvo( *this, *rFormatData.mpUpperLimit.get(), rPos ) ); + mpLowerLimit.reset( new XclExpExtCfvo( *this, *rFormatData.mpLowerLimit.get(), rPos, true ) ); + mpUpperLimit.reset( new XclExpExtCfvo( *this, *rFormatData.mpUpperLimit.get(), rPos, false ) ); if(rFormatData.mpNegativeColor.get()) mpNegativeColor.reset( new XclExpExtNegativeColor( *rFormatData.mpNegativeColor.get() ) ); else diff --git a/sc/source/filter/excel/xeformula.cxx b/sc/source/filter/excel/xeformula.cxx index a9640408accc..8dea2c4c8266 100644 --- a/sc/source/filter/excel/xeformula.cxx +++ b/sc/source/filter/excel/xeformula.cxx @@ -27,13 +27,6 @@ ************************************************************************/ -// XXX xelink.hxx MUST be included before xeformula.hxx because of the -// redifinition of the CREATE_OUSTRING() macro, which is in oox/helper.hxx -// (indirectly included via xelink.hxx) and ../inc/ftools.hxx (indirectly -// included via xeformula.hxx) that does an undef first. Ugly. -#include "xelink.hxx" -#include "xeformula.hxx" - #include <list> #include <map> #include <memory> @@ -44,7 +37,9 @@ #include "rangelst.hxx" #include "token.hxx" #include "tokenarray.hxx" +#include "xeformula.hxx" #include "xehelper.hxx" +#include "xelink.hxx" #include "xename.hxx" #include "xestream.hxx" diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx index fe96d7554043..5a9d19a32cce 100644 --- a/sc/source/filter/excel/xestream.cxx +++ b/sc/source/filter/excel/xestream.cxx @@ -1130,7 +1130,7 @@ bool XclExpXmlStream::exportDocument() throw() if( pShell->GetViewData() ) pShell->GetViewData()->WriteExtOptions( mpRoot->GetExtDocOptions() ); - OUString const workbook = CREATE_OUSTRING( "xl/workbook.xml" ); + OUString const workbook = "xl/workbook.xml"; PushStream( CreateOutputStream( workbook, workbook, Reference <XOutputStream>(), "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml", @@ -1165,7 +1165,7 @@ OUString XlsxExport_getImplementationName() OUString XclExpXmlStream::implGetImplementationName() const { - return CREATE_OUSTRING( "TODO" ); + return OUString( "TODO" ); } diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx index 89d4e01e7276..bebb239e9289 100644 --- a/sc/source/filter/excel/xetable.cxx +++ b/sc/source/filter/excel/xetable.cxx @@ -1484,6 +1484,7 @@ XclExpColinfo::XclExpColinfo( const XclExpRoot& rRoot, XclExpRecord( EXC_ID_COLINFO, 12 ), XclExpRoot( rRoot ), mnWidth( 0 ), + mnScWidth( 0 ), mnFlags( 0 ), mnFirstXclCol( static_cast< sal_uInt16 >( nScCol ) ), mnLastXclCol( static_cast< sal_uInt16 >( nScCol ) ) @@ -1498,7 +1499,7 @@ XclExpColinfo::XclExpColinfo( const XclExpRoot& rRoot, // column width sal_uInt16 nScWidth = rDoc.GetColWidth( nScCol, nScTab ); mnWidth = XclTools::GetXclColumnWidth( nScWidth, GetCharWidth() ); - + mnScWidth = sc::TwipsToHMM( nScWidth ); // column flags ::set_flag( mnFlags, EXC_COLINFO_HIDDEN, rDoc.ColHidden(nScCol, nScTab) ); @@ -1564,7 +1565,7 @@ void XclExpColinfo::SaveXml( XclExpXmlStream& rStrm ) // OOXTODO: XML_outlineLevel, // OOXTODO: XML_phonetic, XML_style, lcl_GetStyleId( rStrm, maXFId.mnXFIndex ).getStr(), - XML_width, OString::valueOf( (double) (mnWidth / 255.0) ).getStr(), + XML_width, OString::valueOf( (double) (mnScWidth / (double)sc::TwipsToHMM( GetCharWidth() )) ).getStr(), FSEND ); } @@ -2449,6 +2450,13 @@ void XclExpCellTable::Save( XclExpStream& rStrm ) void XclExpCellTable::SaveXml( XclExpXmlStream& rStrm ) { + // DEFAULT row height + XclExpDefaultRowData& rDefData = mxDefrowheight->GetDefaultData(); + sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream(); + rWorksheet->startElement( XML_sheetFormatPr, + XML_defaultRowHeight, OString::valueOf( (double) rDefData.mnHeight / 20.0 ).getStr(), FSEND ); + rWorksheet->endElement( XML_sheetFormatPr ); + maColInfoBfr.SaveXml( rStrm ); maRowBfr.SaveXml( rStrm ); mxExtLst->SaveXml( rStrm ); diff --git a/sc/source/filter/excel/xeview.cxx b/sc/source/filter/excel/xeview.cxx index 4a891e73c835..56ea86291426 100644 --- a/sc/source/filter/excel/xeview.cxx +++ b/sc/source/filter/excel/xeview.cxx @@ -422,7 +422,7 @@ static void lcl_WriteSelection( XclExpXmlStream& rStrm, const XclTabViewData& rD XclExpSelection( rData, nPane ).SaveXml( rStrm ); } -OString lcl_GetZoom( sal_uInt16 nZoom ) +static OString lcl_GetZoom( sal_uInt16 nZoom ) { if( nZoom ) return OString::valueOf( (sal_Int32)nZoom ); diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx index 01384ad3e387..6c7ad2ba6287 100644 --- a/sc/source/filter/excel/xichart.cxx +++ b/sc/source/filter/excel/xichart.cxx @@ -832,7 +832,7 @@ void XclImpChSourceLink::ConvertNumFmt( ScfPropertySet& rPropSet, bool bPercent { bool bLinkToSource = ::get_flag( maData.mnFlags, EXC_CHSRCLINK_NUMFMT ); sal_uInt32 nScNumFmt = bLinkToSource ? GetNumFmtBuffer().GetScFormat( maData.mnNumFmtIdx ) : NUMBERFORMAT_ENTRY_NOT_FOUND; - OUString aPropName = bPercent ? EXC_CHPROP_PERCENTAGENUMFMT : EXC_CHPROP_NUMBERFORMAT; + OUString aPropName = bPercent ? OUString( EXC_CHPROP_PERCENTAGENUMFMT ) : OUString( EXC_CHPROP_NUMBERFORMAT ); if( nScNumFmt != NUMBERFORMAT_ENTRY_NOT_FOUND ) rPropSet.SetProperty( aPropName, static_cast< sal_Int32 >( nScNumFmt ) ); else @@ -1551,7 +1551,7 @@ void XclImpChDataFormat::Convert( ScfPropertySet& rPropSet, const XclChExtTypeIn #if EXC_CHART2_3DBAR_HAIRLINES_ONLY // #i83151# only hair lines in 3D charts with filled data points if( rTypeInfo.mb3dChart && rTypeInfo.IsSeriesFrameFormat() && mxLineFmt && mxLineFmt->HasLine() ) - rPropSet.SetProperty< sal_Int32 >( CREATE_OUSTRING( "BorderWidth" ), 0 ); + rPropSet.SetProperty< sal_Int32 >( "BorderWidth", 0 ); #endif // other formatting @@ -3076,7 +3076,7 @@ void XclImpChValueRange::Convert( ScaleData& rScaleData, bool bMirrorOrient ) co { // scaling algorithm bool bLogScale = ::get_flag( maData.mnFlags, EXC_CHVALUERANGE_LOGSCALE ); - OUString aScalingService = bLogScale ? SERVICE_CHART2_LOGSCALING : SERVICE_CHART2_LINEARSCALING; + OUString aScalingService = bLogScale ? OUString( SERVICE_CHART2_LOGSCALING ) : OUString( SERVICE_CHART2_LINEARSCALING ); rScaleData.Scaling.set( ScfApiHelper::CreateInstance( aScalingService ), UNO_QUERY ); // min/max diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx index 0d4319ae7226..c5f6dad50a6a 100644 --- a/sc/source/filter/excel/xicontent.cxx +++ b/sc/source/filter/excel/xicontent.cxx @@ -650,19 +650,10 @@ void XclImpCondFormat::Apply() { ScDocument& rDoc = GetDoc(); - sal_uLong nKey = rDoc.AddCondFormat( mxScCondFmt->Clone(), maRanges.front()->aStart.Tab() ); - ScPatternAttr aPattern( rDoc.GetPool() ); - aPattern.GetItemSet().Put( SfxUInt32Item( ATTR_CONDITIONAL, nKey ) ); + SCTAB nTab = maRanges.front()->aStart.Tab(); + sal_uLong nKey = rDoc.AddCondFormat( mxScCondFmt->Clone(), nTab ); - // maRanges contains only valid cell ranges - for ( size_t i = 0, nRanges = maRanges.size(); i < nRanges; ++i ) - { - const ScRange* pScRange = maRanges[ i ]; - rDoc.ApplyPatternAreaTab( - pScRange->aStart.Col(), pScRange->aStart.Row(), - pScRange->aEnd.Col(), pScRange->aEnd.Row(), - pScRange->aStart.Tab(), aPattern ); - } + rDoc.AddCondFormatData( maRanges, nTab, nKey ); } } diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx index 37077e36b5ab..d76b379050a1 100644 --- a/sc/source/filter/excel/xiescher.cxx +++ b/sc/source/filter/excel/xiescher.cxx @@ -1382,7 +1382,7 @@ SdrObject* XclImpTextObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const Re { TSdrObjectPtr< SdrObjCustomShape > xSdrObj( new SdrObjCustomShape ); xSdrObj->NbcSetSnapRect( rAnchorRect ); - OUString aRectType = CREATE_OUSTRING( "rectangle" ); + OUString aRectType = "rectangle"; xSdrObj->MergeDefaultAttributes( &aRectType ); ConvertRectStyle( *xSdrObj ); sal_Bool bAutoSize = ::get_flag( maTextData.maData.mnFlags, EXC_OBJ_TEXT_AUTOSIZE ); @@ -1796,7 +1796,7 @@ void XclImpControlHelper::ApplySheetLinkProps() const ScUnoConversion::FillApiAddress( aApiAddress, *mxCellLink ); NamedValue aValue; - aValue.Name = CREATE_OUSTRING( SC_UNONAME_BOUNDCELL ); + aValue.Name = SC_UNONAME_BOUNDCELL; aValue.Value <<= aApiAddress; Sequence< Any > aArgs( 1 ); @@ -1806,8 +1806,8 @@ void XclImpControlHelper::ApplySheetLinkProps() const OUString aServiceName; switch( meBindMode ) { - case EXC_CTRL_BINDCONTENT: aServiceName = CREATE_OUSTRING( SC_SERVICENAME_VALBIND ); break; - case EXC_CTRL_BINDPOSITION: aServiceName = CREATE_OUSTRING( SC_SERVICENAME_LISTCELLBIND ); break; + case EXC_CTRL_BINDCONTENT: aServiceName = SC_SERVICENAME_VALBIND; break; + case EXC_CTRL_BINDPOSITION: aServiceName = SC_SERVICENAME_LISTCELLBIND; break; } Reference< XValueBinding > xBinding( xFactory->createInstanceWithArguments( aServiceName, aArgs ), UNO_QUERY_THROW ); @@ -1827,7 +1827,7 @@ void XclImpControlHelper::ApplySheetLinkProps() const ScUnoConversion::FillApiRange( aApiRange, *mxSrcRange ); NamedValue aValue; - aValue.Name = CREATE_OUSTRING( SC_UNONAME_CELLRANGE ); + aValue.Name = SC_UNONAME_CELLRANGE; aValue.Value <<= aApiRange; Sequence< Any > aArgs( 1 ); @@ -1835,7 +1835,7 @@ void XclImpControlHelper::ApplySheetLinkProps() const // create the EntrySource instance and set at the control model Reference< XListEntrySource > xEntrySource( xFactory->createInstanceWithArguments( - CREATE_OUSTRING( SC_SERVICENAME_LISTSOURCE ), aArgs ), UNO_QUERY_THROW ); + SC_SERVICENAME_LISTSOURCE, aArgs ), UNO_QUERY_THROW ); xEntrySink->setListEntrySource( xEntrySource ); } catch( const Exception& ) @@ -1856,11 +1856,11 @@ void XclImpControlHelper::ProcessControl( const XclImpDrawObjBase& rDrawObj ) co ScfPropertySet aPropSet( xCtrlModel ); // #i51348# set object name at control model - aPropSet.SetStringProperty( CREATE_OUSTRING( "Name" ), rDrawObj.GetObjName() ); + aPropSet.SetStringProperty( "Name", rDrawObj.GetObjName() ); // control visible and printable? - aPropSet.SetBoolProperty( CREATE_OUSTRING( "EnableVisible" ), rDrawObj.IsVisible() ); - aPropSet.SetBoolProperty( CREATE_OUSTRING( "Printable" ), rDrawObj.IsPrintable() ); + aPropSet.SetBoolProperty( "EnableVisible", rDrawObj.IsVisible() ); + aPropSet.SetBoolProperty( "Printable", rDrawObj.IsPrintable() ); // virtual call for type specific processing @@ -1988,7 +1988,7 @@ void XclImpTbxObjBase::ConvertLabel( ScfPropertySet& rPropSet ) const if( nPos != STRING_NOTFOUND ) aLabel.Insert( '~', nPos ); } - rPropSet.SetStringProperty( CREATE_OUSTRING( "Label" ), aLabel ); + rPropSet.SetStringProperty( "Label", aLabel ); } ConvertFont( rPropSet ); } @@ -2027,7 +2027,7 @@ void XclImpButtonObj::DoProcessControl( ScfPropertySet& rPropSet ) const case EXC_OBJ_HOR_CENTER: nHorAlign = 1; break; case EXC_OBJ_HOR_RIGHT: nHorAlign = 2; break; } - rPropSet.SetProperty( CREATE_OUSTRING( "Align" ), nHorAlign ); + rPropSet.SetProperty( "Align", nHorAlign ); // vertical text alignment namespace csss = ::com::sun::star::style; @@ -2038,14 +2038,14 @@ void XclImpButtonObj::DoProcessControl( ScfPropertySet& rPropSet ) const case EXC_OBJ_VER_CENTER: eVerAlign = csss::VerticalAlignment_MIDDLE; break; case EXC_OBJ_VER_BOTTOM: eVerAlign = csss::VerticalAlignment_BOTTOM; break; } - rPropSet.SetProperty( CREATE_OUSTRING( "VerticalAlign" ), eVerAlign ); + rPropSet.SetProperty( "VerticalAlign", eVerAlign ); // always wrap text automatically - rPropSet.SetBoolProperty( CREATE_OUSTRING( "MultiLine" ), true ); + rPropSet.SetBoolProperty( "MultiLine", true ); // default button bool bDefButton = ::get_flag( maTextData.maData.mnButtonFlags, EXC_OBJ_BUTTON_DEFAULT ); - rPropSet.SetBoolProperty( CREATE_OUSTRING( "DefaultButton" ), bDefButton ); + rPropSet.SetBoolProperty( "DefaultButton", bDefButton ); // button type (flags cannot be combined in OOo) namespace cssa = ::com::sun::star::awt; @@ -2057,12 +2057,12 @@ void XclImpButtonObj::DoProcessControl( ScfPropertySet& rPropSet ) const else if( ::get_flag( maTextData.maData.mnButtonFlags, EXC_OBJ_BUTTON_HELP ) ) eButtonType = cssa::PushButtonType_HELP; // property type is short, not enum - rPropSet.SetProperty( CREATE_OUSTRING( "PushButtonType" ), sal_Int16( eButtonType ) ); + rPropSet.SetProperty( "PushButtonType", sal_Int16( eButtonType ) ); } OUString XclImpButtonObj::DoGetServiceName() const { - return CREATE_OUSTRING( "com.sun.star.form.component.CommandButton" ); + return OUString( "com.sun.star.form.component.CommandButton" ); } XclTbxEventType XclImpButtonObj::DoGetEventType() const @@ -2126,32 +2126,32 @@ void XclImpCheckBoxObj::DoProcessControl( ScfPropertySet& rPropSet ) const case EXC_OBJ_CHECKBOX_TRISTATE: nApiState = bSupportsTristate ? 2 : 1; break; } if( bSupportsTristate ) - rPropSet.SetBoolProperty( CREATE_OUSTRING( "TriState" ), nApiState == 2 ); - rPropSet.SetProperty( CREATE_OUSTRING( "DefaultState" ), nApiState ); + rPropSet.SetBoolProperty( "TriState", nApiState == 2 ); + rPropSet.SetProperty( "DefaultState", nApiState ); // box style namespace AwtVisualEffect = ::com::sun::star::awt::VisualEffect; sal_Int16 nEffect = ::get_flagvalue( mnCheckBoxFlags, EXC_OBJ_CHECKBOX_FLAT, AwtVisualEffect::FLAT, AwtVisualEffect::LOOK3D ); - rPropSet.SetProperty( CREATE_OUSTRING( "VisualEffect" ), nEffect ); + rPropSet.SetProperty( "VisualEffect", nEffect ); // do not wrap text automatically - rPropSet.SetBoolProperty( CREATE_OUSTRING( "MultiLine" ), false ); + rPropSet.SetBoolProperty( "MultiLine", false ); // #i40279# always centered vertically namespace csss = ::com::sun::star::style; - rPropSet.SetProperty( CREATE_OUSTRING( "VerticalAlign" ), csss::VerticalAlignment_MIDDLE ); + rPropSet.SetProperty( "VerticalAlign", csss::VerticalAlignment_MIDDLE ); // background color if( maFillData.IsFilled() ) { sal_Int32 nColor = static_cast< sal_Int32 >( GetSolidFillColor( maFillData ).GetColor() ); - rPropSet.SetProperty( CREATE_OUSTRING( "BackgroundColor" ), nColor ); + rPropSet.SetProperty( "BackgroundColor", nColor ); } } OUString XclImpCheckBoxObj::DoGetServiceName() const { - return CREATE_OUSTRING( "com.sun.star.form.component.CheckBox" ); + return OUString( "com.sun.star.form.component.CheckBox" ); } XclTbxEventType XclImpCheckBoxObj::DoGetEventType() const @@ -2220,8 +2220,8 @@ void XclImpOptionButtonObj::DoProcessControl( ScfPropertySet& rPropSet ) const ScfPropertySet aProps( xCtrlModel ); rtl::OUString sGroupName = rtl::OUString::valueOf( static_cast< sal_Int32 >( pLeader->GetDffShapeId() ) ); - aProps.SetStringProperty( CREATE_OUSTRING( "GroupName" ), sGroupName ); - aProps.SetStringProperty( CREATE_OUSTRING( "RefValue" ), rtl::OUString::valueOf( nRefVal++ ) ); + aProps.SetStringProperty( "GroupName", sGroupName ); + aProps.SetStringProperty( "RefValue", rtl::OUString::valueOf( nRefVal++ ) ); if ( pLeader->HasCellLink() && !pTbxObj->HasCellLink() ) { // propagate cell link info @@ -2242,7 +2242,7 @@ void XclImpOptionButtonObj::DoProcessControl( ScfPropertySet& rPropSet ) const OUString XclImpOptionButtonObj::DoGetServiceName() const { - return CREATE_OUSTRING( "com.sun.star.form.component.RadioButton" ); + return OUString( "com.sun.star.form.component.RadioButton" ); } XclTbxEventType XclImpOptionButtonObj::DoGetEventType() const @@ -2263,17 +2263,17 @@ void XclImpLabelObj::DoProcessControl( ScfPropertySet& rPropSet ) const ConvertLabel( rPropSet ); // text alignment (always top/left aligned) - rPropSet.SetProperty( CREATE_OUSTRING( "Align" ), sal_Int16( 0 ) ); + rPropSet.SetProperty( "Align", sal_Int16( 0 ) ); namespace csss = ::com::sun::star::style; - rPropSet.SetProperty( CREATE_OUSTRING( "VerticalAlign" ), csss::VerticalAlignment_TOP ); + rPropSet.SetProperty( "VerticalAlign", csss::VerticalAlignment_TOP ); // always wrap text automatically - rPropSet.SetBoolProperty( CREATE_OUSTRING( "MultiLine" ), true ); + rPropSet.SetBoolProperty( "MultiLine", true ); } OUString XclImpLabelObj::DoGetServiceName() const { - return CREATE_OUSTRING( "com.sun.star.form.component.FixedText" ); + return OUString( "com.sun.star.form.component.FixedText" ); } XclTbxEventType XclImpLabelObj::DoGetEventType() const @@ -2322,7 +2322,7 @@ void XclImpGroupBoxObj::DoProcessControl( ScfPropertySet& rPropSet ) const OUString XclImpGroupBoxObj::DoGetServiceName() const { - return CREATE_OUSTRING( "com.sun.star.form.component.GroupBox" ); + return OUString( "com.sun.star.form.component.GroupBox" ); } XclTbxEventType XclImpGroupBoxObj::DoGetEventType() const @@ -2346,7 +2346,7 @@ void XclImpDialogObj::DoProcessControl( ScfPropertySet& rPropSet ) const OUString XclImpDialogObj::DoGetServiceName() const { // dialog frame faked by a groupbox - return CREATE_OUSTRING( "com.sun.star.form.component.GroupBox" ); + return OUString( "com.sun.star.form.component.GroupBox" ); } XclTbxEventType XclImpDialogObj::DoGetEventType() const @@ -2403,14 +2403,14 @@ void XclImpEditObj::DoProcessControl( ScfPropertySet& rPropSet ) const if( IsNumeric() ) { // TODO: OUString::toDouble() does not handle local decimal separator - rPropSet.SetProperty( CREATE_OUSTRING( "DefaultValue" ), aText.toDouble() ); - rPropSet.SetBoolProperty( CREATE_OUSTRING( "Spin" ), mnScrollBar != 0 ); + rPropSet.SetProperty( "DefaultValue", aText.toDouble() ); + rPropSet.SetBoolProperty( "Spin", mnScrollBar != 0 ); } else { - rPropSet.SetProperty( CREATE_OUSTRING( "DefaultText" ), aText ); - rPropSet.SetBoolProperty( CREATE_OUSTRING( "MultiLine" ), mnMultiLine != 0 ); - rPropSet.SetBoolProperty( CREATE_OUSTRING( "VScroll" ), mnScrollBar != 0 ); + rPropSet.SetProperty( "DefaultText", aText ); + rPropSet.SetBoolProperty( "MultiLine", mnMultiLine != 0 ); + rPropSet.SetBoolProperty( "VScroll", mnScrollBar != 0 ); } } ConvertFont( rPropSet ); @@ -2419,8 +2419,8 @@ void XclImpEditObj::DoProcessControl( ScfPropertySet& rPropSet ) const OUString XclImpEditObj::DoGetServiceName() const { return IsNumeric() ? - CREATE_OUSTRING( "com.sun.star.form.component.NumericField" ) : - CREATE_OUSTRING( "com.sun.star.form.component.TextField" ); + OUString( "com.sun.star.form.component.NumericField" ) : + OUString( "com.sun.star.form.component.TextField" ); } XclTbxEventType XclImpEditObj::DoGetEventType() const @@ -2483,19 +2483,19 @@ void XclImpSpinButtonObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, void XclImpSpinButtonObj::DoProcessControl( ScfPropertySet& rPropSet ) const { // Calc's "Border" property is not the 3D/flat style effect in Excel (#i34712#) - rPropSet.SetProperty( CREATE_OUSTRING( "Border" ), ::com::sun::star::awt::VisualEffect::NONE ); - rPropSet.SetProperty< sal_Int32 >( CREATE_OUSTRING( "DefaultSpinValue" ), mnValue ); - rPropSet.SetProperty< sal_Int32 >( CREATE_OUSTRING( "SpinValueMin" ), mnMin ); - rPropSet.SetProperty< sal_Int32 >( CREATE_OUSTRING( "SpinValueMax" ), mnMax ); - rPropSet.SetProperty< sal_Int32 >( CREATE_OUSTRING( "SpinIncrement" ), mnStep ); + rPropSet.SetProperty( "Border", ::com::sun::star::awt::VisualEffect::NONE ); + rPropSet.SetProperty< sal_Int32 >( "DefaultSpinValue", mnValue ); + rPropSet.SetProperty< sal_Int32 >( "SpinValueMin", mnMin ); + rPropSet.SetProperty< sal_Int32 >( "SpinValueMax", mnMax ); + rPropSet.SetProperty< sal_Int32 >( "SpinIncrement", mnStep ); // Excel spin buttons always vertical - rPropSet.SetProperty( CREATE_OUSTRING( "Orientation" ), ::com::sun::star::awt::ScrollBarOrientation::VERTICAL ); + rPropSet.SetProperty( "Orientation", ::com::sun::star::awt::ScrollBarOrientation::VERTICAL ); } OUString XclImpSpinButtonObj::DoGetServiceName() const { - return CREATE_OUSTRING( "com.sun.star.form.component.SpinButton" ); + return OUString( "com.sun.star.form.component.SpinButton" ); } XclTbxEventType XclImpSpinButtonObj::DoGetEventType() const @@ -2522,22 +2522,22 @@ void XclImpScrollBarObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, s void XclImpScrollBarObj::DoProcessControl( ScfPropertySet& rPropSet ) const { // Calc's "Border" property is not the 3D/flat style effect in Excel (#i34712#) - rPropSet.SetProperty( CREATE_OUSTRING( "Border" ), ::com::sun::star::awt::VisualEffect::NONE ); - rPropSet.SetProperty< sal_Int32 >( CREATE_OUSTRING( "DefaultScrollValue" ), mnValue ); - rPropSet.SetProperty< sal_Int32 >( CREATE_OUSTRING( "ScrollValueMin" ), mnMin ); - rPropSet.SetProperty< sal_Int32 >( CREATE_OUSTRING( "ScrollValueMax" ), mnMax ); - rPropSet.SetProperty< sal_Int32 >( CREATE_OUSTRING( "LineIncrement" ), mnStep ); - rPropSet.SetProperty< sal_Int32 >( CREATE_OUSTRING( "BlockIncrement" ), mnPageStep ); - rPropSet.SetProperty( CREATE_OUSTRING( "VisibleSize" ), ::std::min< sal_Int32 >( mnPageStep, 1 ) ); + rPropSet.SetProperty( "Border", ::com::sun::star::awt::VisualEffect::NONE ); + rPropSet.SetProperty< sal_Int32 >( "DefaultScrollValue", mnValue ); + rPropSet.SetProperty< sal_Int32 >( "ScrollValueMin", mnMin ); + rPropSet.SetProperty< sal_Int32 >( "ScrollValueMax", mnMax ); + rPropSet.SetProperty< sal_Int32 >( "LineIncrement", mnStep ); + rPropSet.SetProperty< sal_Int32 >( "BlockIncrement", mnPageStep ); + rPropSet.SetProperty( "VisibleSize", ::std::min< sal_Int32 >( mnPageStep, 1 ) ); namespace AwtScrollOrient = ::com::sun::star::awt::ScrollBarOrientation; sal_Int32 nApiOrient = ::get_flagvalue( mnOrient, EXC_OBJ_SCROLLBAR_HOR, AwtScrollOrient::HORIZONTAL, AwtScrollOrient::VERTICAL ); - rPropSet.SetProperty( CREATE_OUSTRING( "Orientation" ), nApiOrient ); + rPropSet.SetProperty( "Orientation", nApiOrient ); } OUString XclImpScrollBarObj::DoGetServiceName() const { - return CREATE_OUSTRING( "com.sun.star.form.component.ScrollBar" ); + return OUString( "com.sun.star.form.component.ScrollBar" ); } XclTbxEventType XclImpScrollBarObj::DoGetEventType() const @@ -2568,7 +2568,7 @@ void XclImpTbxObjListBase::SetBoxFormatting( ScfPropertySet& rPropSet ) const // border style namespace AwtVisualEffect = ::com::sun::star::awt::VisualEffect; sal_Int16 nApiBorder = ::get_flagvalue( mnListFlags, EXC_OBJ_LISTBOX_FLAT, AwtVisualEffect::FLAT, AwtVisualEffect::LOOK3D ); - rPropSet.SetProperty( CREATE_OUSTRING( "Border" ), nApiBorder ); + rPropSet.SetProperty( "Border", nApiBorder ); // font formatting if( mbHasDefFontIdx ) @@ -2628,7 +2628,7 @@ void XclImpListBoxObj::DoProcessControl( ScfPropertySet& rPropSet ) const // selection type sal_uInt8 nSelType = ::extract_value< sal_uInt8 >( mnListFlags, 4, 2 ); bool bMultiSel = nSelType != EXC_OBJ_LISTBOX_SINGLE; - rPropSet.SetBoolProperty( CREATE_OUSTRING( "MultiSelection" ), bMultiSel ); + rPropSet.SetBoolProperty( "MultiSelection", bMultiSel ); // selection (do not set, if listbox is linked to a cell) if( !HasCellLink() ) @@ -2649,14 +2649,14 @@ void XclImpListBoxObj::DoProcessControl( ScfPropertySet& rPropSet ) const if( !aSelVec.empty() ) { Sequence< sal_Int16 > aSelSeq( &aSelVec.front(), static_cast< sal_Int32 >( aSelVec.size() ) ); - rPropSet.SetProperty( CREATE_OUSTRING( "DefaultSelection" ), aSelSeq ); + rPropSet.SetProperty( "DefaultSelection", aSelSeq ); } } } OUString XclImpListBoxObj::DoGetServiceName() const { - return CREATE_OUSTRING( "com.sun.star.form.component.ListBox" ); + return OUString( "com.sun.star.form.component.ListBox" ); } XclTbxEventType XclImpListBoxObj::DoGetEventType() const @@ -2726,15 +2726,15 @@ void XclImpDropDownObj::DoProcessControl( ScfPropertySet& rPropSet ) const // dropdown listbox formatting SetBoxFormatting( rPropSet ); // enable dropdown button - rPropSet.SetBoolProperty( CREATE_OUSTRING( "Dropdown" ), true ); + rPropSet.SetBoolProperty( "Dropdown", true ); // dropdown line count - rPropSet.SetProperty( CREATE_OUSTRING( "LineCount" ), mnLineCount ); + rPropSet.SetProperty( "LineCount", mnLineCount ); if( GetDropDownType() == EXC_OBJ_DROPDOWN_COMBOBOX ) { // text of editable combobox if( maTextData.mxString ) - rPropSet.SetStringProperty( CREATE_OUSTRING( "DefaultText" ), maTextData.mxString->GetText() ); + rPropSet.SetStringProperty( "DefaultText", maTextData.mxString->GetText() ); } else { @@ -2743,7 +2743,7 @@ void XclImpDropDownObj::DoProcessControl( ScfPropertySet& rPropSet ) const { Sequence< sal_Int16 > aSelSeq( 1 ); aSelSeq[ 0 ] = mnSelEntry - 1; - rPropSet.SetProperty( CREATE_OUSTRING( "DefaultSelection" ), aSelSeq ); + rPropSet.SetProperty( "DefaultSelection", aSelSeq ); } } } @@ -2751,8 +2751,8 @@ void XclImpDropDownObj::DoProcessControl( ScfPropertySet& rPropSet ) const OUString XclImpDropDownObj::DoGetServiceName() const { return (GetDropDownType() == EXC_OBJ_DROPDOWN_COMBOBOX) ? - CREATE_OUSTRING( "com.sun.star.form.component.ComboBox" ) : - CREATE_OUSTRING( "com.sun.star.form.component.ListBox" ); + OUString( "com.sun.star.form.component.ComboBox" ) : + OUString( "com.sun.star.form.component.ListBox" ); } XclTbxEventType XclImpDropDownObj::DoGetEventType() const @@ -3172,7 +3172,7 @@ XclImpDffConverter::XclImpDffConvData::XclImpDffConvData( XclImpDffConverter::XclImpDffConverter( const XclImpRoot& rRoot, SvStream& rDffStrm ) : XclImpSimpleDffConverter( rRoot, rDffStrm ), oox::ole::MSConvertOCXControls( rRoot.GetDocShell()->GetModel() ), - maStdFormName( CREATE_OUSTRING( "Standard" ) ), + maStdFormName( "Standard" ), mnOleImpFlags( 0 ) { const SvtFilterOptions& rFilterOpt = SvtFilterOptions::Get(); @@ -3200,7 +3200,7 @@ String XclImpObjectManager::GetOleNameOverride( SCTAB nTab, sal_uInt16 nObjId ) rtl::OUString sOleName; String sCodeName = GetExtDocOptions().GetCodeName( nTab ); - if ( mxOleCtrlNameOverride->hasByName( sCodeName ) ) + if (mxOleCtrlNameOverride.is() && mxOleCtrlNameOverride->hasByName(sCodeName)) { Reference< XIndexContainer > xIdToOleName; mxOleCtrlNameOverride->getByName( sCodeName ) >>= xIdToOleName; @@ -3343,7 +3343,7 @@ SdrObject* XclImpDffConverter::CreateSdrObject( const XclImpPictureObj& rPicObj, if ( xFComp.is() ) { ScfPropertySet aPropSet( xFComp ); - aPropSet.SetStringProperty( CREATE_OUSTRING( "Name" ), rPicObj.GetObjName() ); + aPropSet.SetStringProperty( "Name", rPicObj.GetObjName() ); InsertControl( xFComp, aSz,&xShape,true); xSdrObj.reset( rPicObj.CreateSdrObjectFromShape( xShape, rAnchorRect ) ); } @@ -3526,7 +3526,7 @@ sal_Bool XclImpDffConverter::InsertControl( const Reference< XFormComponent >& r Reference< XControlModel > xCtrlModel( rxFormComp, UNO_QUERY_THROW ); // create the control shape - Reference< XShape > xShape( ScfApiHelper::CreateInstance( GetDocShell(), CREATE_OUSTRING( "com.sun.star.drawing.ControlShape" ) ), UNO_QUERY_THROW ); + Reference< XShape > xShape( ScfApiHelper::CreateInstance( GetDocShell(), "com.sun.star.drawing.ControlShape" ), UNO_QUERY_THROW ); Reference< XControlShape > xCtrlShape( xShape, UNO_QUERY_THROW ); // insert the new control into the form @@ -3708,7 +3708,7 @@ void XclImpDffConverter::InitControlForm() } else if( SfxObjectShell* pDocShell = GetDocShell() ) { - rConvData.mxCtrlForm.set( ScfApiHelper::CreateInstance( pDocShell, CREATE_OUSTRING( "com.sun.star.form.component.Form" ) ), UNO_QUERY_THROW ); + rConvData.mxCtrlForm.set( ScfApiHelper::CreateInstance( pDocShell, "com.sun.star.form.component.Form" ), UNO_QUERY_THROW ); xFormsNC->insertByName( maStdFormName, Any( rConvData.mxCtrlForm ) ); } } diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx index b6ecf6d1e873..760cf4ad878b 100644 --- a/sc/source/filter/excel/xistyle.cxx +++ b/sc/source/filter/excel/xistyle.cxx @@ -127,7 +127,7 @@ XclImpPalette::ExportPalette() if ( xProps.is() ) { uno::Reference< container::XIndexAccess > xIndex( new PaletteIndex( aColors ) ); - xProps->setPropertyValue( CREATE_OUSTRING("ColorPalette"), uno::makeAny( xIndex ) ); + xProps->setPropertyValue( "ColorPalette", uno::makeAny( xIndex ) ); } } diff --git a/sc/source/filter/excel/xlchart.cxx b/sc/source/filter/excel/xlchart.cxx index 53f1136c04bd..c233f51aa169 100644 --- a/sc/source/filter/excel/xlchart.cxx +++ b/sc/source/filter/excel/xlchart.cxx @@ -466,10 +466,10 @@ OUString XclChartHelper::GetErrorBarValuesRole( sal_uInt8 nBarType ) { switch( nBarType ) { - case EXC_CHSERERR_XPLUS: return EXC_CHPROP_ROLE_ERRORBARS_POSX; - case EXC_CHSERERR_XMINUS: return EXC_CHPROP_ROLE_ERRORBARS_NEGX; - case EXC_CHSERERR_YPLUS: return EXC_CHPROP_ROLE_ERRORBARS_POSY; - case EXC_CHSERERR_YMINUS: return EXC_CHPROP_ROLE_ERRORBARS_NEGY; + case EXC_CHSERERR_XPLUS: return OUString( EXC_CHPROP_ROLE_ERRORBARS_POSX ); + case EXC_CHSERERR_XMINUS: return OUString( EXC_CHPROP_ROLE_ERRORBARS_NEGX ); + case EXC_CHSERERR_YPLUS: return OUString( EXC_CHPROP_ROLE_ERRORBARS_POSY ); + case EXC_CHSERERR_YMINUS: return OUString( EXC_CHPROP_ROLE_ERRORBARS_NEGY ); default: OSL_FAIL( "XclChartHelper::GetErrorBarValuesRole - unknown bar type" ); } return OUString(); @@ -1253,7 +1253,7 @@ namespace { using the specified interface function. Checks a boolean property first. */ #define EXC_FRAGMENT_GETTITLESHAPE( shape_supplier, supplier_func, property_name ) \ ScfPropertySet aPropSet( shape_supplier ); \ - if( shape_supplier.is() && aPropSet.GetBoolProperty( CREATE_OUSTRING( #property_name ) ) ) \ + if( shape_supplier.is() && aPropSet.GetBoolProperty( #property_name ) ) \ return shape_supplier->supplier_func(); \ return Reference< XShape >(); \ @@ -1322,13 +1322,13 @@ void XclChRootData::InitConversion( const XclRoot& rRoot, const Reference< XChar // create object tables Reference< XMultiServiceFactory > xFactory( mxChartDoc, UNO_QUERY ); mxLineDashTable.reset( new XclChObjectTable( - xFactory, SERVICE_DRAWING_DASHTABLE, CREATE_OUSTRING( "Excel line dash " ) ) ); + xFactory, SERVICE_DRAWING_DASHTABLE, "Excel line dash " ) ); mxGradientTable.reset( new XclChObjectTable( - xFactory, SERVICE_DRAWING_GRADIENTTABLE, CREATE_OUSTRING( "Excel gradient " ) ) ); + xFactory, SERVICE_DRAWING_GRADIENTTABLE, "Excel gradient " ) ); mxHatchTable.reset( new XclChObjectTable( - xFactory, SERVICE_DRAWING_HATCHTABLE, CREATE_OUSTRING( "Excel hatch " ) ) ); + xFactory, SERVICE_DRAWING_HATCHTABLE, "Excel hatch " ) ); mxBitmapTable.reset( new XclChObjectTable( - xFactory, SERVICE_DRAWING_BITMAPTABLE, CREATE_OUSTRING( "Excel bitmap " ) ) ); + xFactory, SERVICE_DRAWING_BITMAPTABLE, "Excel bitmap " ) ); } void XclChRootData::FinishConversion() diff --git a/sc/source/filter/excel/xlescher.cxx b/sc/source/filter/excel/xlescher.cxx index ba76e58a61e3..a1e5bc70e832 100644 --- a/sc/source/filter/excel/xlescher.cxx +++ b/sc/source/filter/excel/xlescher.cxx @@ -334,7 +334,7 @@ bool XclControlHelper::FillMacroDescriptor( ScriptEventDescriptor& rDescriptor, { rDescriptor.ListenerType = OUString::createFromAscii( spTbxListenerData[ eEventType ].mpcListenerType ); rDescriptor.EventMethod = OUString::createFromAscii( spTbxListenerData[ eEventType ].mpcEventMethod ); - rDescriptor.ScriptType = CREATE_OUSTRING( "Script" ); + rDescriptor.ScriptType = "Script"; rDescriptor.ScriptCode = XclTools::GetSbMacroUrl( rXclMacroName, pDocShell ); return true; } diff --git a/sc/source/filter/excel/xlroot.cxx b/sc/source/filter/excel/xlroot.cxx index 66b5e33993b2..d5c9d7147aba 100644 --- a/sc/source/filter/excel/xlroot.cxx +++ b/sc/source/filter/excel/xlroot.cxx @@ -151,7 +151,7 @@ XclRootData::XclRootData( XclBiff eBiff, SfxMedium& rMedium, try { Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory(), UNO_SET_THROW ); - Reference< XFramesSupplier > xFramesSupp( xFactory->createInstance( CREATE_OUSTRING( "com.sun.star.frame.Desktop" ) ), UNO_QUERY_THROW ); + Reference< XFramesSupplier > xFramesSupp( xFactory->createInstance( "com.sun.star.frame.Desktop" ), UNO_QUERY_THROW ); Reference< XFrame > xFrame( xFramesSupp->getActiveFrame(), UNO_SET_THROW ); Reference< XDevice > xDevice( xFrame->getContainerWindow(), UNO_QUERY_THROW ); DeviceInfo aDeviceInfo = xDevice->getInfo(); @@ -182,7 +182,6 @@ XclRoot::XclRoot( XclRootData& rRootData ) : #endif // filter tracer - // do not use CREATE_OUSTRING for conditional expression mrData.mxTracer.reset( new XclTracer( GetDocUrl() ) ); } diff --git a/sc/source/filter/excel/xltoolbar.cxx b/sc/source/filter/excel/xltoolbar.cxx index b8fd7539aa79..f582ab89a300 100644 --- a/sc/source/filter/excel/xltoolbar.cxx +++ b/sc/source/filter/excel/xltoolbar.cxx @@ -94,17 +94,17 @@ CTBS::CTBS() : bSignature(0), bVersion(0), reserved1(0), reserved2(0), reserved3 { } -CTB::CTB() : nViews( 0 ), ectbid(0) +ScCTB::ScCTB() : nViews( 0 ), ectbid(0) { } -CTB::CTB(sal_uInt16 nNum ) : nViews( nNum ), ectbid(0) +ScCTB::ScCTB(sal_uInt16 nNum ) : nViews( nNum ), ectbid(0) { } -bool CTB::Read( SvStream &rS ) +bool ScCTB::Read( SvStream &rS ) { - OSL_TRACE("CTB::Read() stream pos 0x%x", rS.Tell() ); + OSL_TRACE("ScCTB::Read() stream pos 0x%x", rS.Tell() ); nOffSet = rS.Tell(); tb.Read( rS ); for ( sal_uInt16 index = 0; index < nViews; ++index ) @@ -117,17 +117,17 @@ bool CTB::Read( SvStream &rS ) for ( sal_Int16 index = 0; index < tb.getcCL(); ++index ) { - TBC aTBC; + ScTBC aTBC; aTBC.Read( rS ); rTBC.push_back( aTBC ); } return true; } -void CTB::Print( FILE* fp ) +void ScCTB::Print( FILE* fp ) { Indent a; - indent_printf( fp, "[ 0x%x ] CTB -- dump\n", nOffSet ); + indent_printf( fp, "[ 0x%x ] ScCTB -- dump\n", nOffSet ); indent_printf( fp, " nViews 0x%x\n", nViews); tb.Print( fp ); @@ -141,25 +141,25 @@ void CTB::Print( FILE* fp ) it->Print( fp ); } indent_printf( fp, " ectbid 0x%x\n", ectbid); - std::vector<TBC>::iterator it_end = rTBC.end(); + std::vector<ScTBC>::iterator it_end = rTBC.end(); counter = 0; - for ( std::vector<TBC>::iterator it = rTBC.begin(); it != it_end; ++it ) + for ( std::vector<ScTBC>::iterator it = rTBC.begin(); it != it_end; ++it ) { - indent_printf( fp, " TBC [%d]\n", counter++); + indent_printf( fp, " ScTBC [%d]\n", counter++); Indent c; it->Print( fp ); } } -bool CTB::IsMenuToolbar() +bool ScCTB::IsMenuToolbar() { return tb.IsMenuToolbar(); } -bool CTB::ImportMenuTB( CTBWrapper& rWrapper, const css::uno::Reference< css::container::XIndexContainer >& xMenuDesc, CustomToolBarImportHelper& helper ) +bool ScCTB::ImportMenuTB( ScCTBWrapper& rWrapper, const css::uno::Reference< css::container::XIndexContainer >& xMenuDesc, CustomToolBarImportHelper& helper ) { sal_Int32 index = 0; - for ( std::vector< TBC >::iterator it = rTBC.begin(); it != rTBC.end(); ++it, ++index ) + for ( std::vector< ScTBC >::iterator it = rTBC.begin(); it != rTBC.end(); ++it, ++index ) { if ( !it->ImportToolBarControl( rWrapper, xMenuDesc, helper, IsMenuToolbar() ) ) return false; @@ -167,7 +167,7 @@ bool CTB::ImportMenuTB( CTBWrapper& rWrapper, const css::uno::Reference< css::co return true; } -bool CTB::ImportCustomToolBar( CTBWrapper& rWrapper, CustomToolBarImportHelper& helper ) +bool ScCTB::ImportCustomToolBar( ScCTBWrapper& rWrapper, CustomToolBarImportHelper& helper ) { static rtl::OUString sToolbarPrefix( RTL_CONSTASCII_USTRINGPARAM( "private:resource/toolbar/custom_" ) ); @@ -186,7 +186,7 @@ bool CTB::ImportCustomToolBar( CTBWrapper& rWrapper, CustomToolBarImportHelper& xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("UIName") ), uno::makeAny( name.getString() ) ); rtl::OUString sToolBarName = sToolbarPrefix.concat( name.getString() ); - for ( std::vector< TBC >::iterator it = rTBC.begin(); it != rTBC.end(); ++it ) + for ( std::vector< ScTBC >::iterator it = rTBC.begin(); it != rTBC.end(); ++it ) { if ( !it->ImportToolBarControl( rWrapper, xIndexContainer, helper, IsMenuToolbar() ) ) return false; @@ -236,14 +236,14 @@ void CTBS::Print( FILE* fp ) indent_printf( fp, " ictbView 0x%x\n", ictbView ); } -TBC::TBC() +ScTBC::ScTBC() { } bool -TBC::Read(SvStream &rS) +ScTBC::Read(SvStream &rS) { - OSL_TRACE("TBC::Read() stream pos 0x%x", rS.Tell() ); + OSL_TRACE("ScTBC::Read() stream pos 0x%x", rS.Tell() ); nOffSet = rS.Tell(); if ( !tbch.Read( rS ) ) return false; @@ -266,10 +266,10 @@ TBC::Read(SvStream &rS) void -TBC::Print(FILE* fp) +ScTBC::Print(FILE* fp) { Indent a; - indent_printf( fp, "[ 0x%x ] TBC -- dump\n", nOffSet ); + indent_printf( fp, "[ 0x%x ] ScTBC -- dump\n", nOffSet ); tbch.Print( fp ); if ( tbcCmd.get() ) tbcCmd->Print( fp ); @@ -277,7 +277,7 @@ TBC::Print(FILE* fp) tbcd->Print( fp ); } -bool TBC::ImportToolBarControl( CTBWrapper& rWrapper, const css::uno::Reference< css::container::XIndexContainer >& toolbarcontainer, CustomToolBarImportHelper& helper, bool bIsMenuToolbar ) +bool ScTBC::ImportToolBarControl( ScCTBWrapper& rWrapper, const css::uno::Reference< css::container::XIndexContainer >& toolbarcontainer, CustomToolBarImportHelper& helper, bool bIsMenuToolbar ) { // how to identify built-in-command ? // bool bBuiltin = false; @@ -290,11 +290,11 @@ bool TBC::ImportToolBarControl( CTBWrapper& rWrapper, const css::uno::Reference< TBCMenuSpecific* pMenu = tbcd->getMenuSpecific(); if ( pMenu ) { - // search for CTB with the appropriate name ( it contains the + // search for ScCTB with the appropriate name ( it contains the // menu items, although we cannot import ( or create ) a menu on // a custom toolbar we can import the menu items in a separate // toolbar ( better than nothing ) - CTB* pCustTB = rWrapper.GetCustomizationData( pMenu->Name() ); + ScCTB* pCustTB = rWrapper.GetCustomizationData( pMenu->Name() ); if ( pCustTB ) { uno::Reference< container::XIndexContainer > xMenuDesc; @@ -365,24 +365,24 @@ bool TBCCmd::Read( SvStream &rS ) return true; } -CTBWrapper::CTBWrapper() +ScCTBWrapper::ScCTBWrapper() { } -CTBWrapper::~CTBWrapper() +ScCTBWrapper::~ScCTBWrapper() { } bool -CTBWrapper::Read( SvStream &rS) +ScCTBWrapper::Read( SvStream &rS) { - OSL_TRACE("CTBWrapper::Read() stream pos 0x%x", rS.Tell() ); + OSL_TRACE("ScCTBWrapper::Read() stream pos 0x%x", rS.Tell() ); nOffSet = rS.Tell(); if ( !ctbSet.Read( rS ) ) return false; for ( sal_uInt16 index = 0; index < ctbSet.ctb; ++index ) { - CTB aCTB( ctbSet.ctbViews ); + ScCTB aCTB( ctbSet.ctbViews ); if ( !aCTB.Read( rS ) ) return false; rCTB.push_back( aCTB ); @@ -391,23 +391,23 @@ CTBWrapper::Read( SvStream &rS) } void -CTBWrapper::Print( FILE* fp ) +ScCTBWrapper::Print( FILE* fp ) { Indent a; - indent_printf( fp, "[ 0x%x ] CTBWrapper -- dump\n", nOffSet ); + indent_printf( fp, "[ 0x%x ] ScCTBWrapper -- dump\n", nOffSet ); ctbSet.Print( fp ); - std::vector<CTB>::iterator it_end = rCTB.end(); - for ( std::vector<CTB>::iterator it = rCTB.begin(); it != it_end; ++it ) + std::vector<ScCTB>::iterator it_end = rCTB.end(); + for ( std::vector<ScCTB>::iterator it = rCTB.begin(); it != it_end; ++it ) { Indent b; it->Print( fp ); } } -CTB* CTBWrapper::GetCustomizationData( const rtl::OUString& sTBName ) +ScCTB* ScCTBWrapper::GetCustomizationData( const rtl::OUString& sTBName ) { - CTB* pCTB = NULL; - for ( std::vector< CTB >::iterator it = rCTB.begin(); it != rCTB.end(); ++it ) + ScCTB* pCTB = NULL; + for ( std::vector< ScCTB >::iterator it = rCTB.begin(); it != rCTB.end(); ++it ) { if ( it->GetName().equals( sTBName ) ) { @@ -418,7 +418,7 @@ CTB* CTBWrapper::GetCustomizationData( const rtl::OUString& sTBName ) return pCTB; } -bool CTBWrapper::ImportCustomToolBar( SfxObjectShell& rDocSh ) +bool ScCTBWrapper::ImportCustomToolBar( SfxObjectShell& rDocSh ) { if(rCTB.empty()) return true; @@ -426,8 +426,8 @@ bool CTBWrapper::ImportCustomToolBar( SfxObjectShell& rDocSh ) uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); uno::Reference< ui::XModuleUIConfigurationManagerSupplier > xAppCfgSupp( ui::ModuleUIConfigurationManagerSupplier::create(xContext) ); - std::vector<CTB>::iterator it_end = rCTB.end(); - for ( std::vector<CTB>::iterator it = rCTB.begin(); it != it_end; ++it ) + std::vector<ScCTB>::iterator it_end = rCTB.end(); + for ( std::vector<ScCTB>::iterator it = rCTB.begin(); it != it_end; ++it ) { // for each customtoolbar CustomToolBarImportHelper helper( rDocSh, xAppCfgSupp->getUIConfigurationManager( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.SpreadsheetDocument" ) ) ) ); diff --git a/sc/source/filter/excel/xltoolbar.hxx b/sc/source/filter/excel/xltoolbar.hxx index f6e1cc6bb516..cc9794331bd9 100644 --- a/sc/source/filter/excel/xltoolbar.hxx +++ b/sc/source/filter/excel/xltoolbar.hxx @@ -35,7 +35,7 @@ namespace css = ::com::sun::star; -class CTBWrapper; +class ScCTBWrapper; // hmm I don't normally use these packed structures // but.. hey always good to do something different class TBCCmd : public TBBase @@ -52,36 +52,36 @@ public: void Print(FILE* fp); }; -class TBC : public TBBase +class ScTBC : public TBBase { TBCHeader tbch; boost::shared_ptr<TBCCmd> tbcCmd; // optional boost::shared_ptr<TBCData> tbcd; public: - TBC(); - ~TBC(){} + ScTBC(); + ~ScTBC(){} void Print( FILE* ); bool Read(SvStream &rS); - bool ImportToolBarControl( CTBWrapper&, const com::sun::star::uno::Reference< com::sun::star::container::XIndexContainer >& toolbarcontainer, CustomToolBarImportHelper& helper, bool bIsMenuBar ); + bool ImportToolBarControl( ScCTBWrapper&, const com::sun::star::uno::Reference< com::sun::star::container::XIndexContainer >& toolbarcontainer, CustomToolBarImportHelper& helper, bool bIsMenuBar ); }; -class CTB : public TBBase +class ScCTB : public TBBase { sal_uInt16 nViews; TB tb; std::vector<TBVisualData> rVisualData; sal_uInt32 ectbid; - std::vector< TBC > rTBC; - bool ImportCustomToolBar_Impl( CTBWrapper&, CustomToolBarImportHelper& ); + std::vector< ScTBC > rTBC; + bool ImportCustomToolBar_Impl( ScCTBWrapper&, CustomToolBarImportHelper& ); public: - CTB(); - CTB(sal_uInt16); - ~CTB(){} + ScCTB(); + ScCTB(sal_uInt16); + ~ScCTB(){} void Print( FILE* ); bool Read(SvStream &rS); bool IsMenuToolbar(); - bool ImportCustomToolBar( CTBWrapper&, CustomToolBarImportHelper& ); - bool ImportMenuTB( CTBWrapper&, const css::uno::Reference< css::container::XIndexContainer >&, CustomToolBarImportHelper& ); + bool ImportCustomToolBar( ScCTBWrapper&, CustomToolBarImportHelper& ); + bool ImportMenuTB( ScCTBWrapper&, const css::uno::Reference< css::container::XIndexContainer >&, CustomToolBarImportHelper& ); rtl::OUString GetName() { return tb.getName().getString(); } @@ -106,19 +106,19 @@ public: bool Read(SvStream &rS); }; -class CTBWrapper : public TBBase +class ScCTBWrapper : public TBBase { CTBS ctbSet; - std::vector< CTB > rCTB; + std::vector< ScCTB > rCTB; public: - CTBWrapper(); - ~CTBWrapper(); + ScCTBWrapper(); + ~ScCTBWrapper(); bool Read(SvStream &rS); void Print( FILE* ); bool ImportCustomToolBar( SfxObjectShell& rDocSh ); - CTB* GetCustomizationData( const rtl::OUString& name ); + ScCTB* GetCustomizationData( const rtl::OUString& name ); }; diff --git a/sc/source/filter/excel/xltracer.cxx b/sc/source/filter/excel/xltracer.cxx index a80360314d95..c46a72b49b07 100644 --- a/sc/source/filter/excel/xltracer.cxx +++ b/sc/source/filter/excel/xltracer.cxx @@ -39,7 +39,7 @@ XclTracer::XclTracer( const String& rDocUrl ) , maFirstTimes(eTraceLength,true) { Sequence< PropertyValue > aConfigData( 1 ); - aConfigData[ 0 ].Name = CREATE_OUSTRING( "DocumentURL" ); + aConfigData[ 0 ].Name = "DocumentURL"; aConfigData[ 0 ].Value <<= OUString( rDocUrl ); } diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx index 41eef6610442..7b412f3ddb21 100644 --- a/sc/source/filter/html/htmlpars.cxx +++ b/sc/source/filter/html/htmlpars.cxx @@ -971,7 +971,7 @@ IMPL_LINK( ScHTMLLayoutParser, HTMLImportHdl, ImportInfo*, pInfo ) // Groesster Gemeinsamer Teiler nach Euklid (Kettendivision) // Sonderfall: 0 und irgendwas geben 1 -SCROW lcl_GGT( SCROW a, SCROW b ) +static SCROW lcl_GGT( SCROW a, SCROW b ) { if ( !a || !b ) return 1; @@ -987,7 +987,7 @@ SCROW lcl_GGT( SCROW a, SCROW b ) // Kleinstes Gemeinsames Vielfaches: a * b / GGT(a,b) -SCROW lcl_KGV( SCROW a, SCROW b ) +static SCROW lcl_KGV( SCROW a, SCROW b ) { if ( a > b ) // Ueberlauf unwahrscheinlicher machen return (a / lcl_GGT(a,b)) * b; diff --git a/sc/source/filter/inc/ftools.hxx b/sc/source/filter/inc/ftools.hxx index 323586f652cc..ace84e12d606 100644 --- a/sc/source/filter/inc/ftools.hxx +++ b/sc/source/filter/inc/ftools.hxx @@ -35,7 +35,6 @@ #include <memory> #include <tools/string.hxx> #include <sal/macros.h> -#include <oox/helper/helper.hxx> #include <boost/noncopyable.hpp> #include <boost/shared_ptr.hpp> #include "filter.hxx" diff --git a/sc/source/filter/inc/xecontent.hxx b/sc/source/filter/inc/xecontent.hxx index 23ca6e40750b..9417ab28b66b 100644 --- a/sc/source/filter/inc/xecontent.hxx +++ b/sc/source/filter/inc/xecontent.hxx @@ -194,13 +194,14 @@ private: class XclExpCfvo : public XclExpRecord, protected XclExpRoot { public: - explicit XclExpCfvo( const XclExpRoot& rRoot, const ScColorScaleEntry& rFormatEntry, const ScAddress& rPos); + explicit XclExpCfvo( const XclExpRoot& rRoot, const ScColorScaleEntry& rFormatEntry, const ScAddress& rPos, bool bFirst = true); virtual ~XclExpCfvo() {} virtual void SaveXml( XclExpXmlStream& rStrm ); private: const ScColorScaleEntry& mrEntry; ScAddress maSrcPos; + bool mbFirst; }; class XclExpColScaleCol : public XclExpRecord, protected XclExpRoot diff --git a/sc/source/filter/inc/xeextlst.hxx b/sc/source/filter/inc/xeextlst.hxx index 6ce7b703187e..466811174c51 100644 --- a/sc/source/filter/inc/xeextlst.hxx +++ b/sc/source/filter/inc/xeextlst.hxx @@ -40,12 +40,13 @@ protected: class XclExpExtCfvo : public XclExpRecordBase, protected XclExpRoot { public: - XclExpExtCfvo( const XclExpRoot& rRoot, const ScColorScaleEntry& rEntry, const ScAddress& rPos ); + XclExpExtCfvo( const XclExpRoot& rRoot, const ScColorScaleEntry& rEntry, const ScAddress& rPos, bool bFirst ); virtual void SaveXml( XclExpXmlStream& rStrm ); private: ScColorScaleEntryType meType; rtl::OString maValue; + bool mbFirst; }; class XclExpExtNegativeColor diff --git a/sc/source/filter/inc/xetable.hxx b/sc/source/filter/inc/xetable.hxx index 598dcde8fc2f..6fff7ddcc589 100644 --- a/sc/source/filter/inc/xetable.hxx +++ b/sc/source/filter/inc/xetable.hxx @@ -783,6 +783,7 @@ private: private: XclExpXFId maXFId; /// The XF identifier for column default format. sal_uInt16 mnWidth; /// Excel width of the column. + sal_uInt16 mnScWidth; /// Calc width of the column. sal_uInt16 mnFlags; /// Additional column flags. sal_uInt16 mnFirstXclCol; /// Index to first column. sal_uInt16 mnLastXclCol; /// Index to last column. @@ -851,7 +852,7 @@ public: /** Sets the passed default data as current record contents. */ void SetDefaultData( const XclExpDefaultRowData& rDefData ); - + XclExpDefaultRowData& GetDefaultData() { return maDefData; } private: /** Writes the contents of the record. */ virtual void WriteBody( XclExpStream& rStrm ); diff --git a/sc/source/filter/inc/xlchart.hxx b/sc/source/filter/inc/xlchart.hxx index 14fbb1f98421..0fa1d8bf5784 100644 --- a/sc/source/filter/inc/xlchart.hxx +++ b/sc/source/filter/inc/xlchart.hxx @@ -52,116 +52,116 @@ class XclRoot; // Property names ============================================================= // service names -#define SERVICE_DRAWING_BITMAPTABLE CREATE_OUSTRING( "com.sun.star.drawing.BitmapTable" ) -#define SERVICE_DRAWING_DASHTABLE CREATE_OUSTRING( "com.sun.star.drawing.DashTable" ) -#define SERVICE_DRAWING_GRADIENTTABLE CREATE_OUSTRING( "com.sun.star.drawing.GradientTable" ) -#define SERVICE_DRAWING_HATCHTABLE CREATE_OUSTRING( "com.sun.star.drawing.HatchTable" ) - -#define SERVICE_CHART2_AXIS CREATE_OUSTRING( "com.sun.star.chart2.Axis" ) -#define SERVICE_CHART2_CARTESIANCOORDSYS2D CREATE_OUSTRING( "com.sun.star.chart2.CartesianCoordinateSystem2d" ) -#define SERVICE_CHART2_CARTESIANCOORDSYS3D CREATE_OUSTRING( "com.sun.star.chart2.CartesianCoordinateSystem3d" ) -#define SERVICE_CHART2_DATAPROVIDER CREATE_OUSTRING( "com.sun.star.chart2.data.DataProvider" ) -#define SERVICE_CHART2_DATASERIES CREATE_OUSTRING( "com.sun.star.chart2.DataSeries" ) -#define SERVICE_CHART2_DIAGRAM CREATE_OUSTRING( "com.sun.star.chart2.Diagram" ) -#define SERVICE_CHART2_ERRORBAR CREATE_OUSTRING( "com.sun.star.chart2.ErrorBar" ) -#define SERVICE_CHART2_EXPREGCURVE CREATE_OUSTRING( "com.sun.star.chart2.ExponentialRegressionCurve" ) -#define SERVICE_CHART2_FORMATTEDSTRING CREATE_OUSTRING( "com.sun.star.chart2.FormattedString" ) -#define SERVICE_CHART2_LABELEDDATASEQ CREATE_OUSTRING( "com.sun.star.chart2.data.LabeledDataSequence" ) -#define SERVICE_CHART2_LEGEND CREATE_OUSTRING( "com.sun.star.chart2.Legend" ) -#define SERVICE_CHART2_LINEARREGCURVE CREATE_OUSTRING( "com.sun.star.chart2.LinearRegressionCurve" ) -#define SERVICE_CHART2_LINEARSCALING CREATE_OUSTRING( "com.sun.star.chart2.LinearScaling" ) -#define SERVICE_CHART2_LOGREGCURVE CREATE_OUSTRING( "com.sun.star.chart2.LogarithmicRegressionCurve" ) -#define SERVICE_CHART2_LOGSCALING CREATE_OUSTRING( "com.sun.star.chart2.LogarithmicScaling" ) -#define SERVICE_CHART2_POLARCOORDSYS2D CREATE_OUSTRING( "com.sun.star.chart2.PolarCoordinateSystem2d" ) -#define SERVICE_CHART2_POLARCOORDSYS3D CREATE_OUSTRING( "com.sun.star.chart2.PolarCoordinateSystem3d" ) -#define SERVICE_CHART2_POTREGCURVE CREATE_OUSTRING( "com.sun.star.chart2.PotentialRegressionCurve" ) -#define SERVICE_CHART2_TITLE CREATE_OUSTRING( "com.sun.star.chart2.Title" ) +#define SERVICE_DRAWING_BITMAPTABLE "com.sun.star.drawing.BitmapTable" +#define SERVICE_DRAWING_DASHTABLE "com.sun.star.drawing.DashTable" +#define SERVICE_DRAWING_GRADIENTTABLE "com.sun.star.drawing.GradientTable" +#define SERVICE_DRAWING_HATCHTABLE "com.sun.star.drawing.HatchTable" + +#define SERVICE_CHART2_AXIS "com.sun.star.chart2.Axis" +#define SERVICE_CHART2_CARTESIANCOORDSYS2D "com.sun.star.chart2.CartesianCoordinateSystem2d" +#define SERVICE_CHART2_CARTESIANCOORDSYS3D "com.sun.star.chart2.CartesianCoordinateSystem3d" +#define SERVICE_CHART2_DATAPROVIDER "com.sun.star.chart2.data.DataProvider" +#define SERVICE_CHART2_DATASERIES "com.sun.star.chart2.DataSeries" +#define SERVICE_CHART2_DIAGRAM "com.sun.star.chart2.Diagram" +#define SERVICE_CHART2_ERRORBAR "com.sun.star.chart2.ErrorBar" +#define SERVICE_CHART2_EXPREGCURVE "com.sun.star.chart2.ExponentialRegressionCurve" +#define SERVICE_CHART2_FORMATTEDSTRING "com.sun.star.chart2.FormattedString" +#define SERVICE_CHART2_LABELEDDATASEQ "com.sun.star.chart2.data.LabeledDataSequence" +#define SERVICE_CHART2_LEGEND "com.sun.star.chart2.Legend" +#define SERVICE_CHART2_LINEARREGCURVE "com.sun.star.chart2.LinearRegressionCurve" +#define SERVICE_CHART2_LINEARSCALING "com.sun.star.chart2.LinearScaling" +#define SERVICE_CHART2_LOGREGCURVE "com.sun.star.chart2.LogarithmicRegressionCurve" +#define SERVICE_CHART2_LOGSCALING "com.sun.star.chart2.LogarithmicScaling" +#define SERVICE_CHART2_POLARCOORDSYS2D "com.sun.star.chart2.PolarCoordinateSystem2d" +#define SERVICE_CHART2_POLARCOORDSYS3D "com.sun.star.chart2.PolarCoordinateSystem3d" +#define SERVICE_CHART2_POTREGCURVE "com.sun.star.chart2.PotentialRegressionCurve" +#define SERVICE_CHART2_TITLE "com.sun.star.chart2.Title" // property names -#define EXC_CHPROP_ADDITIONALSHAPES CREATE_OUSTRING( "AdditionalShapes" ) -#define EXC_CHPROP_ANCHORPOSITION CREATE_OUSTRING( "AnchorPosition" ) -#define EXC_CHPROP_ARRANGEORDER CREATE_OUSTRING( "ArrangeOrder" ) -#define EXC_CHPROP_ATTAXISINDEX CREATE_OUSTRING( "AttachedAxisIndex" ) -#define EXC_CHPROP_ATTRIBDATAPOINTS CREATE_OUSTRING( "AttributedDataPoints" ) -#define EXC_CHPROP_BLACKDAY CREATE_OUSTRING( "BlackDay" ) -#define EXC_CHPROP_COLOR CREATE_OUSTRING( "Color" ) -#define EXC_CHPROP_CONNECTBARS CREATE_OUSTRING( "ConnectBars" ) -#define EXC_CHPROP_CROSSOVERPOSITION CREATE_OUSTRING( "CrossoverPosition" ) -#define EXC_CHPROP_CROSSOVERVALUE CREATE_OUSTRING( "CrossoverValue" ) -#define EXC_CHPROP_CURVESTYLE CREATE_OUSTRING( "CurveStyle" ) -#define EXC_CHPROP_D3DSCENEAMBIENTCOLOR CREATE_OUSTRING( "D3DSceneAmbientColor" ) -#define EXC_CHPROP_D3DSCENELIGHTON1 CREATE_OUSTRING( "D3DSceneLightOn1" ) -#define EXC_CHPROP_D3DSCENELIGHTCOLOR2 CREATE_OUSTRING( "D3DSceneLightColor2" ) -#define EXC_CHPROP_D3DSCENELIGHTDIR2 CREATE_OUSTRING( "D3DSceneLightDirection2" ) -#define EXC_CHPROP_D3DSCENELIGHTON2 CREATE_OUSTRING( "D3DSceneLightOn2" ) -#define EXC_CHPROP_D3DSCENEPERSPECTIVE CREATE_OUSTRING( "D3DScenePerspective" ) -#define EXC_CHPROP_D3DSCENESHADEMODE CREATE_OUSTRING( "D3DSceneShadeMode" ) -#define EXC_CHPROP_DISPLAYLABELS CREATE_OUSTRING( "DisplayLabels" ) -#define EXC_CHPROP_ERRORBARSTYLE CREATE_OUSTRING( "ErrorBarStyle" ) -#define EXC_CHPROP_ERRORBARX CREATE_OUSTRING( "ErrorBarX" ) -#define EXC_CHPROP_ERRORBARY CREATE_OUSTRING( "ErrorBarY" ) -#define EXC_CHPROP_EXPANSION CREATE_OUSTRING( "Expansion" ) -#define EXC_CHPROP_EXPTIMEINCREMENT CREATE_OUSTRING( "ExplicitTimeIncrement" ) -#define EXC_CHPROP_GAPWIDTHSEQ CREATE_OUSTRING( "GapwidthSequence" ) -#define EXC_CHPROP_GEOMETRY3D CREATE_OUSTRING( "Geometry3D" ) -#define EXC_CHPROP_INCLUDEHIDDENCELLS CREATE_OUSTRING( "IncludeHiddenCells" ) -#define EXC_CHPROP_JAPANESE CREATE_OUSTRING( "Japanese" ) -#define EXC_CHPROP_LABEL CREATE_OUSTRING( "Label" ) -#define EXC_CHPROP_LABELPLACEMENT CREATE_OUSTRING( "LabelPlacement" ) -#define EXC_CHPROP_LABELPOSITION CREATE_OUSTRING( "LabelPosition" ) -#define EXC_CHPROP_LABELSEPARATOR CREATE_OUSTRING( "LabelSeparator" ) -#define EXC_CHPROP_MAJORTICKS CREATE_OUSTRING( "MajorTickmarks" ) -#define EXC_CHPROP_MARKPOSITION CREATE_OUSTRING( "MarkPosition" ) -#define EXC_CHPROP_MINORTICKS CREATE_OUSTRING( "MinorTickmarks" ) -#define EXC_CHPROP_MISSINGVALUETREATMENT CREATE_OUSTRING( "MissingValueTreatment" ) -#define EXC_CHPROP_NEGATIVEERROR CREATE_OUSTRING( "NegativeError" ) -#define EXC_CHPROP_NUMBERFORMAT CREATE_OUSTRING( "NumberFormat" ) -#define EXC_CHPROP_OFFSET CREATE_OUSTRING( "Offset" ) -#define EXC_CHPROP_OVERLAPSEQ CREATE_OUSTRING( "OverlapSequence" ) -#define EXC_CHPROP_PERCENTAGENUMFMT CREATE_OUSTRING( "PercentageNumberFormat" ) -#define EXC_CHPROP_PERCENTDIAGONAL CREATE_OUSTRING( "PercentDiagonal" ) -#define EXC_CHPROP_PERSPECTIVE CREATE_OUSTRING( "Perspective" ) -#define EXC_CHPROP_POSITIVEERROR CREATE_OUSTRING( "PositiveError" ) -#define EXC_CHPROP_RELATIVEPOSITION CREATE_OUSTRING( "RelativePosition" ) -#define EXC_CHPROP_RELATIVESIZE CREATE_OUSTRING( "RelativeSize" ) -#define EXC_CHPROP_RIGHTANGLEDAXES CREATE_OUSTRING( "RightAngledAxes" ) -#define EXC_CHPROP_ROLE CREATE_OUSTRING( "Role" ) -#define EXC_CHPROP_ROTATIONHORIZONTAL CREATE_OUSTRING( "RotationHorizontal" ) -#define EXC_CHPROP_ROTATIONVERTICAL CREATE_OUSTRING( "RotationVertical" ) -#define EXC_CHPROP_SHOW CREATE_OUSTRING( "Show" ) -#define EXC_CHPROP_SHOWCORRELATION CREATE_OUSTRING( "ShowCorrelationCoefficient" ) -#define EXC_CHPROP_SHOWEQUATION CREATE_OUSTRING( "ShowEquation" ) -#define EXC_CHPROP_SHOWFIRST CREATE_OUSTRING( "ShowFirst" ) -#define EXC_CHPROP_SHOWHIGHLOW CREATE_OUSTRING( "ShowHighLow" ) -#define EXC_CHPROP_SHOWNEGATIVEERROR CREATE_OUSTRING( "ShowNegativeError" ) -#define EXC_CHPROP_SHOWPOSITIVEERROR CREATE_OUSTRING( "ShowPositiveError" ) -#define EXC_CHPROP_STACKCHARACTERS CREATE_OUSTRING( "StackCharacters" ) -#define EXC_CHPROP_STACKINGDIR CREATE_OUSTRING( "StackingDirection" ) -#define EXC_CHPROP_STARTINGANGLE CREATE_OUSTRING( "StartingAngle" ) -#define EXC_CHPROP_SWAPXANDYAXIS CREATE_OUSTRING( "SwapXAndYAxis" ) -#define EXC_CHPROP_SYMBOL CREATE_OUSTRING( "Symbol" ) -#define EXC_CHPROP_TEXTBREAK CREATE_OUSTRING( "TextBreak" ) -#define EXC_CHPROP_TEXTOVERLAP CREATE_OUSTRING( "TextOverlap" ) -#define EXC_CHPROP_TEXTROTATION CREATE_OUSTRING( "TextRotation" ) -#define EXC_CHPROP_USERINGS CREATE_OUSTRING( "UseRings" ) -#define EXC_CHPROP_VARYCOLORSBY CREATE_OUSTRING( "VaryColorsByPoint" ) -#define EXC_CHPROP_WEIGHT CREATE_OUSTRING( "Weight" ) -#define EXC_CHPROP_WHITEDAY CREATE_OUSTRING( "WhiteDay" ) +#define EXC_CHPROP_ADDITIONALSHAPES "AdditionalShapes" +#define EXC_CHPROP_ANCHORPOSITION "AnchorPosition" +#define EXC_CHPROP_ARRANGEORDER "ArrangeOrder" +#define EXC_CHPROP_ATTAXISINDEX "AttachedAxisIndex" +#define EXC_CHPROP_ATTRIBDATAPOINTS "AttributedDataPoints" +#define EXC_CHPROP_BLACKDAY "BlackDay" +#define EXC_CHPROP_COLOR "Color" +#define EXC_CHPROP_CONNECTBARS "ConnectBars" +#define EXC_CHPROP_CROSSOVERPOSITION "CrossoverPosition" +#define EXC_CHPROP_CROSSOVERVALUE "CrossoverValue" +#define EXC_CHPROP_CURVESTYLE "CurveStyle" +#define EXC_CHPROP_D3DSCENEAMBIENTCOLOR "D3DSceneAmbientColor" +#define EXC_CHPROP_D3DSCENELIGHTON1 "D3DSceneLightOn1" +#define EXC_CHPROP_D3DSCENELIGHTCOLOR2 "D3DSceneLightColor2" +#define EXC_CHPROP_D3DSCENELIGHTDIR2 "D3DSceneLightDirection2" +#define EXC_CHPROP_D3DSCENELIGHTON2 "D3DSceneLightOn2" +#define EXC_CHPROP_D3DSCENEPERSPECTIVE "D3DScenePerspective" +#define EXC_CHPROP_D3DSCENESHADEMODE "D3DSceneShadeMode" +#define EXC_CHPROP_DISPLAYLABELS "DisplayLabels" +#define EXC_CHPROP_ERRORBARSTYLE "ErrorBarStyle" +#define EXC_CHPROP_ERRORBARX "ErrorBarX" +#define EXC_CHPROP_ERRORBARY "ErrorBarY" +#define EXC_CHPROP_EXPANSION "Expansion" +#define EXC_CHPROP_EXPTIMEINCREMENT "ExplicitTimeIncrement" +#define EXC_CHPROP_GAPWIDTHSEQ "GapwidthSequence" +#define EXC_CHPROP_GEOMETRY3D "Geometry3D" +#define EXC_CHPROP_INCLUDEHIDDENCELLS "IncludeHiddenCells" +#define EXC_CHPROP_JAPANESE "Japanese" +#define EXC_CHPROP_LABEL "Label" +#define EXC_CHPROP_LABELPLACEMENT "LabelPlacement" +#define EXC_CHPROP_LABELPOSITION "LabelPosition" +#define EXC_CHPROP_LABELSEPARATOR "LabelSeparator" +#define EXC_CHPROP_MAJORTICKS "MajorTickmarks" +#define EXC_CHPROP_MARKPOSITION "MarkPosition" +#define EXC_CHPROP_MINORTICKS "MinorTickmarks" +#define EXC_CHPROP_MISSINGVALUETREATMENT "MissingValueTreatment" +#define EXC_CHPROP_NEGATIVEERROR "NegativeError" +#define EXC_CHPROP_NUMBERFORMAT "NumberFormat" +#define EXC_CHPROP_OFFSET "Offset" +#define EXC_CHPROP_OVERLAPSEQ "OverlapSequence" +#define EXC_CHPROP_PERCENTAGENUMFMT "PercentageNumberFormat" +#define EXC_CHPROP_PERCENTDIAGONAL "PercentDiagonal" +#define EXC_CHPROP_PERSPECTIVE "Perspective" +#define EXC_CHPROP_POSITIVEERROR "PositiveError" +#define EXC_CHPROP_RELATIVEPOSITION "RelativePosition" +#define EXC_CHPROP_RELATIVESIZE "RelativeSize" +#define EXC_CHPROP_RIGHTANGLEDAXES "RightAngledAxes" +#define EXC_CHPROP_ROLE "Role" +#define EXC_CHPROP_ROTATIONHORIZONTAL "RotationHorizontal" +#define EXC_CHPROP_ROTATIONVERTICAL "RotationVertical" +#define EXC_CHPROP_SHOW "Show" +#define EXC_CHPROP_SHOWCORRELATION "ShowCorrelationCoefficient" +#define EXC_CHPROP_SHOWEQUATION "ShowEquation" +#define EXC_CHPROP_SHOWFIRST "ShowFirst" +#define EXC_CHPROP_SHOWHIGHLOW "ShowHighLow" +#define EXC_CHPROP_SHOWNEGATIVEERROR "ShowNegativeError" +#define EXC_CHPROP_SHOWPOSITIVEERROR "ShowPositiveError" +#define EXC_CHPROP_STACKCHARACTERS "StackCharacters" +#define EXC_CHPROP_STACKINGDIR "StackingDirection" +#define EXC_CHPROP_STARTINGANGLE "StartingAngle" +#define EXC_CHPROP_SWAPXANDYAXIS "SwapXAndYAxis" +#define EXC_CHPROP_SYMBOL "Symbol" +#define EXC_CHPROP_TEXTBREAK "TextBreak" +#define EXC_CHPROP_TEXTOVERLAP "TextOverlap" +#define EXC_CHPROP_TEXTROTATION "TextRotation" +#define EXC_CHPROP_USERINGS "UseRings" +#define EXC_CHPROP_VARYCOLORSBY "VaryColorsByPoint" +#define EXC_CHPROP_WEIGHT "Weight" +#define EXC_CHPROP_WHITEDAY "WhiteDay" // data series roles -#define EXC_CHPROP_ROLE_CATEG CREATE_OUSTRING( "categories" ) -#define EXC_CHPROP_ROLE_ERRORBARS_NEGX CREATE_OUSTRING( "error-bars-x-negative" ) -#define EXC_CHPROP_ROLE_ERRORBARS_NEGY CREATE_OUSTRING( "error-bars-y-negative" ) -#define EXC_CHPROP_ROLE_ERRORBARS_POSX CREATE_OUSTRING( "error-bars-x-positive" ) -#define EXC_CHPROP_ROLE_ERRORBARS_POSY CREATE_OUSTRING( "error-bars-y-positive" ) -#define EXC_CHPROP_ROLE_LABEL CREATE_OUSTRING( "label" ) -#define EXC_CHPROP_ROLE_XVALUES CREATE_OUSTRING( "values-x" ) -#define EXC_CHPROP_ROLE_YVALUES CREATE_OUSTRING( "values-y" ) -#define EXC_CHPROP_ROLE_OPENVALUES CREATE_OUSTRING( "values-first" ) -#define EXC_CHPROP_ROLE_CLOSEVALUES CREATE_OUSTRING( "values-last" ) -#define EXC_CHPROP_ROLE_LOWVALUES CREATE_OUSTRING( "values-min" ) -#define EXC_CHPROP_ROLE_HIGHVALUES CREATE_OUSTRING( "values-max" ) -#define EXC_CHPROP_ROLE_SIZEVALUES CREATE_OUSTRING( "values-size" ) +#define EXC_CHPROP_ROLE_CATEG "categories" +#define EXC_CHPROP_ROLE_ERRORBARS_NEGX "error-bars-x-negative" +#define EXC_CHPROP_ROLE_ERRORBARS_NEGY "error-bars-y-negative" +#define EXC_CHPROP_ROLE_ERRORBARS_POSX "error-bars-x-positive" +#define EXC_CHPROP_ROLE_ERRORBARS_POSY "error-bars-y-positive" +#define EXC_CHPROP_ROLE_LABEL "label" +#define EXC_CHPROP_ROLE_XVALUES "values-x" +#define EXC_CHPROP_ROLE_YVALUES "values-y" +#define EXC_CHPROP_ROLE_OPENVALUES "values-first" +#define EXC_CHPROP_ROLE_CLOSEVALUES "values-last" +#define EXC_CHPROP_ROLE_LOWVALUES "values-min" +#define EXC_CHPROP_ROLE_HIGHVALUES "values-max" +#define EXC_CHPROP_ROLE_SIZEVALUES "values-size" // Constants and Enumerations ================================================= diff --git a/sc/source/filter/lotus/tool.cxx b/sc/source/filter/lotus/tool.cxx index 44bf49140a86..b1b3b2da5b89 100644 --- a/sc/source/filter/lotus/tool.cxx +++ b/sc/source/filter/lotus/tool.cxx @@ -209,8 +209,6 @@ SfxUInt32Item* FormCache::NewAttr( sal_uInt8 nFormat, sal_uInt8 nSt ) sal_uInt32 nHandle; NfIndexTableOffset eIndexTableOffset = NF_NUMERIC_START; sal_Bool bDefault = false; - //void GenerateFormat( aFormString, eType, COUNTRY_SYSTEM, LANGUAGE_SYSTEM, - // sal_Bool bThousand, sal_Bool IsRed, sal_uInt16 nPrecision, sal_uInt16 nAnzLeading ); if( nForm == 0xFF ) // Default-Format? nForm = nDefaultFormat; @@ -226,50 +224,50 @@ SfxUInt32Item* FormCache::NewAttr( sal_uInt8 nFormat, sal_uInt8 nSt ) //fStandard;nL; nIndex1 = pFormTable->GetStandardFormat( NUMBERFORMAT_NUMBER, eLanguage ); - pFormTable->GenerateFormat( aFormString, nIndex1, - eLanguage, false, false, nL, 1 ); + aFormString = pFormTable->GenerateFormat(nIndex1, + eLanguage, false, false, nL, 1); break; case 0x01: // Exponentdarstellung (scientific notation) //fExponent;nL; nIndex1 = pFormTable->GetStandardFormat( NUMBERFORMAT_SCIENTIFIC, eLanguage ); - pFormTable->GenerateFormat( aFormString, nIndex1, - eLanguage, false, false, nL, 1 ); + aFormString = pFormTable->GenerateFormat(nIndex1, + eLanguage, false, false, nL, 1); break; case 0x02: // Waehrungsdarstellung (currency) //fMoney;nL; nIndex1 = pFormTable->GetStandardFormat( NUMBERFORMAT_CURRENCY, eLanguage ); - pFormTable->GenerateFormat( aFormString, nIndex1, - eLanguage, false, false, nL, 1 ); + aFormString = pFormTable->GenerateFormat(nIndex1, + eLanguage, false, false, nL, 1); break; case 0x03: // Prozent //fPercent;nL; nIndex1 = pFormTable->GetStandardFormat( NUMBERFORMAT_PERCENT, eLanguage ); - pFormTable->GenerateFormat( aFormString, nIndex1, - eLanguage, false, false, nL, 1 ); + aFormString = pFormTable->GenerateFormat(nIndex1, + eLanguage, false, false, nL, 1); break; case 0x04: // Komma //fStandard;nL; nIndex1 = pFormTable->GetStandardFormat( NUMBERFORMAT_NUMBER, eLanguage ); - pFormTable->GenerateFormat( aFormString, nIndex1, - eLanguage, sal_True, false, nL, 1 ); + aFormString = pFormTable->GenerateFormat(nIndex1, + eLanguage, sal_True, false, nL, 1); break; case 0x05: // frei //fStandard;nL; nIndex1 = pFormTable->GetStandardFormat( NUMBERFORMAT_NUMBER, eLanguage ); - pFormTable->GenerateFormat( aFormString, nIndex1, - eLanguage, false, false, nL, 1 ); + aFormString = pFormTable->GenerateFormat(nIndex1, + eLanguage, false, false, nL, 1); break; case 0x06: // frei //fStandard;nL; nIndex1 = pFormTable->GetStandardFormat( NUMBERFORMAT_NUMBER, eLanguage ); - pFormTable->GenerateFormat( aFormString, nIndex1, - eLanguage, false, false, nL, 1 ); + aFormString = pFormTable->GenerateFormat(nIndex1, + eLanguage, false, false, nL, 1); nIndex1 = 0; break; case 0x07: // Spezialformat @@ -279,15 +277,15 @@ SfxUInt32Item* FormCache::NewAttr( sal_uInt8 nFormat, sal_uInt8 nSt ) //fStandard;nSt; nIndex1 = pFormTable->GetStandardFormat( NUMBERFORMAT_NUMBER, eLanguage ); - pFormTable->GenerateFormat( aFormString, nIndex1, - eLanguage, false, sal_True, nSt, 1 ); + aFormString = pFormTable->GenerateFormat(nIndex1, + eLanguage, false, sal_True, nSt, 1); break; case 0x01: // generelles Format //fStandard;nSt; nIndex1 = pFormTable->GetStandardFormat( NUMBERFORMAT_NUMBER, eLanguage ); - pFormTable->GenerateFormat( aFormString, nIndex1, - eLanguage, false, false, nSt, 1 ); + aFormString = pFormTable->GenerateFormat(nIndex1, + eLanguage, false, false, nSt, 1); break; case 0x02: // Datum: Tag, Monat, Jahr //fDate;dfDayMonthYearLong; @@ -362,8 +360,8 @@ SfxUInt32Item* FormCache::NewAttr( sal_uInt8 nFormat, sal_uInt8 nSt ) //fStandard;nL; nIndex1 = pFormTable->GetStandardFormat( NUMBERFORMAT_NUMBER, eLanguage ); - pFormTable->GenerateFormat( aFormString, nIndex1, - eLanguage, false, false, nL, 1 ); + aFormString = pFormTable->GenerateFormat(nIndex1, + eLanguage, false, false, nL, 1); nIndex1 = 0; break; } diff --git a/sc/source/filter/oox/addressconverter.cxx b/sc/source/filter/oox/addressconverter.cxx index 52e74ebbcecc..1da39663255f 100644 --- a/sc/source/filter/oox/addressconverter.cxx +++ b/sc/source/filter/oox/addressconverter.cxx @@ -57,7 +57,7 @@ using ::rtl::OUStringToOString; namespace { //! TODO: this limit may change, is there a way to obtain it via API? -const sal_Int16 API_MAXTAB = 255; +const sal_Int16 API_MAXTAB = MAXTAB; const sal_Int32 OOX_MAXCOL = static_cast< sal_Int32 >( (1 << 14) - 1 ); const sal_Int32 OOX_MAXROW = static_cast< sal_Int32 >( (1 << 20) - 1 ); diff --git a/sc/source/filter/oox/condformatbuffer.cxx b/sc/source/filter/oox/condformatbuffer.cxx index 7df532120e31..75fc18aa62fc 100644 --- a/sc/source/filter/oox/condformatbuffer.cxx +++ b/sc/source/filter/oox/condformatbuffer.cxx @@ -58,9 +58,6 @@ #include "document.hxx" #include "convuno.hxx" #include "docfunc.hxx" -#include "markdata.hxx" -#include "docpool.hxx" -#include "scitems.hxx" #include "tokenarray.hxx" #include "tokenuno.hxx" @@ -646,86 +643,86 @@ void CondFormatRule::finalizeImport() break; case XML_duplicateValues: eOperator = CondFormatBuffer::convertToApiOperator( XML_duplicateValues ); - aReplaceFormula = CREATE_OUSTRING( " " ); + aReplaceFormula = " "; break; case XML_expression: eOperator = ::com::sun::star::sheet::ConditionOperator2::FORMULA; break; case XML_containsText: OSL_ENSURE( maModel.mnOperator == XML_containsText, "CondFormatRule::finalizeImport - unexpected operator" ); - aReplaceFormula = CREATE_OUSTRING( "NOT(ISERROR(SEARCH(#T,#B)))" ); + aReplaceFormula = "NOT(ISERROR(SEARCH(#T,#B)))"; break; case XML_notContainsText: // note: type XML_notContainsText vs. operator XML_notContains OSL_ENSURE( maModel.mnOperator == XML_notContains, "CondFormatRule::finalizeImport - unexpected operator" ); - aReplaceFormula = CREATE_OUSTRING( "ISERROR(SEARCH(#T,#B))" ); + aReplaceFormula = "ISERROR(SEARCH(#T,#B))"; break; case XML_beginsWith: OSL_ENSURE( maModel.mnOperator == XML_beginsWith, "CondFormatRule::finalizeImport - unexpected operator" ); - aReplaceFormula = CREATE_OUSTRING( "LEFT(#B,#L)=#T" ); + aReplaceFormula = "LEFT(#B,#L)=#T"; break; case XML_endsWith: OSL_ENSURE( maModel.mnOperator == XML_endsWith, "CondFormatRule::finalizeImport - unexpected operator" ); - aReplaceFormula = CREATE_OUSTRING( "RIGHT(#B,#L)=#T" ); + aReplaceFormula = "RIGHT(#B,#L)=#T"; break; case XML_timePeriod: switch( maModel.mnTimePeriod ) { case XML_yesterday: - aReplaceFormula = CREATE_OUSTRING( "FLOOR(#B,1)=TODAY()-1" ); + aReplaceFormula = "FLOOR(#B,1)=TODAY()-1"; break; case XML_today: - aReplaceFormula = CREATE_OUSTRING( "FLOOR(#B,1)=TODAY()" ); + aReplaceFormula = "FLOOR(#B,1)=TODAY()"; break; case XML_tomorrow: - aReplaceFormula = CREATE_OUSTRING( "FLOOR(#B,1)=TODAY()+1" ); + aReplaceFormula = "FLOOR(#B,1)=TODAY()+1"; break; case XML_last7Days: - aReplaceFormula = CREATE_OUSTRING( "AND(TODAY()-7<FLOOR(#B,1),FLOOR(#B,1)<=TODAY())" ); + aReplaceFormula = "AND(TODAY()-7<FLOOR(#B,1),FLOOR(#B,1)<=TODAY())"; break; case XML_lastWeek: - aReplaceFormula = CREATE_OUSTRING( "AND(TODAY()-WEEKDAY(TODAY())-7<FLOOR(#B,1),FLOOR(#B,1)<=TODAY()-WEEKDAY(TODAY()))" ); + aReplaceFormula = "AND(TODAY()-WEEKDAY(TODAY())-7<FLOOR(#B,1),FLOOR(#B,1)<=TODAY()-WEEKDAY(TODAY()))"; break; case XML_thisWeek: - aReplaceFormula = CREATE_OUSTRING( "AND(TODAY()-WEEKDAY(TODAY())<FLOOR(#B,1),FLOOR(#B,1)<=TODAY()-WEEKDAY(TODAY())+7)" ); + aReplaceFormula = "AND(TODAY()-WEEKDAY(TODAY())<FLOOR(#B,1),FLOOR(#B,1)<=TODAY()-WEEKDAY(TODAY())+7)"; break; case XML_nextWeek: - aReplaceFormula = CREATE_OUSTRING( "AND(TODAY()-WEEKDAY(TODAY())+7<FLOOR(#B,1),FLOOR(#B,1)<=TODAY()-WEEKDAY(TODAY())+14)" ); + aReplaceFormula = "AND(TODAY()-WEEKDAY(TODAY())+7<FLOOR(#B,1),FLOOR(#B,1)<=TODAY()-WEEKDAY(TODAY())+14)"; break; case XML_lastMonth: - aReplaceFormula = CREATE_OUSTRING( "OR(AND(MONTH(#B)=MONTH(TODAY())-1,YEAR(#B)=YEAR(TODAY())),AND(MONTH(#B)=12,MONTH(TODAY())=1,YEAR(#B)=YEAR(TODAY())-1))" ); + aReplaceFormula = "OR(AND(MONTH(#B)=MONTH(TODAY())-1,YEAR(#B)=YEAR(TODAY())),AND(MONTH(#B)=12,MONTH(TODAY())=1,YEAR(#B)=YEAR(TODAY())-1))"; break; case XML_thisMonth: - aReplaceFormula = CREATE_OUSTRING( "AND(MONTH(#B)=MONTH(TODAY()),YEAR(#B)=YEAR(TODAY()))" ); + aReplaceFormula = "AND(MONTH(#B)=MONTH(TODAY()),YEAR(#B)=YEAR(TODAY()))"; break; case XML_nextMonth: - aReplaceFormula = CREATE_OUSTRING( "OR(AND(MONTH(#B)=MONTH(TODAY())+1,YEAR(#B)=YEAR(TODAY())),AND(MONTH(#B)=1,MONTH(TODAY())=12,YEAR(#B)=YEAR(TODAY())+1))" ); + aReplaceFormula = "OR(AND(MONTH(#B)=MONTH(TODAY())+1,YEAR(#B)=YEAR(TODAY())),AND(MONTH(#B)=1,MONTH(TODAY())=12,YEAR(#B)=YEAR(TODAY())+1))"; break; default: OSL_FAIL( "CondFormatRule::finalizeImport - unknown time period type" ); } break; case XML_containsBlanks: - aReplaceFormula = CREATE_OUSTRING( "LEN(TRIM(#B))=0" ); + aReplaceFormula = "LEN(TRIM(#B))=0"; break; case XML_notContainsBlanks: - aReplaceFormula = CREATE_OUSTRING( "LEN(TRIM(#B))>0" ); + aReplaceFormula = "LEN(TRIM(#B))>0"; break; case XML_containsErrors: - aReplaceFormula = CREATE_OUSTRING( "ISERROR(#B)" ); + aReplaceFormula = "ISERROR(#B)"; break; case XML_notContainsErrors: - aReplaceFormula = CREATE_OUSTRING( "NOT(ISERROR(#B))" ); + aReplaceFormula = "NOT(ISERROR(#B))"; break; case XML_top10: if( maModel.mbPercent ) - aReplaceFormula = CREATE_OUSTRING( "RANK(#B,#R,#M)/COUNT(#R)<=#K%" ); + aReplaceFormula = "RANK(#B,#R,#M)/COUNT(#R)<=#K%"; else - aReplaceFormula = CREATE_OUSTRING( "RANK(#B,#R,#M)<=#K" ); + aReplaceFormula = "RANK(#B,#R,#M)<=#K"; break; case XML_aboveAverage: if( maModel.mnStdDev == 0 ) - aReplaceFormula = CREATE_OUSTRING( "#B#CAVERAGE(#R)" ); + aReplaceFormula = "#B#CAVERAGE(#R)"; break; case XML_colorScale: break; @@ -770,8 +767,8 @@ void CondFormatRule::finalizeImport() case 'C': // average comparison operator if( aComp.isEmpty() ) aComp = maModel.mbAboveAverage ? - (maModel.mbEqualAverage ? CREATE_OUSTRING( ">=" ) : CREATE_OUSTRING( ">" )) : - (maModel.mbEqualAverage ? CREATE_OUSTRING( "<=" ) : CREATE_OUSTRING( "<" )); + (maModel.mbEqualAverage ? OUString( ">=" ) : OUString( ">" ) ) : + (maModel.mbEqualAverage ? OUString( "<=" ) : OUString( "<" ) ); aReplaceFormula = aReplaceFormula.replaceAt( nStrPos, 2, aComp ); break; default: @@ -892,21 +889,17 @@ void CondFormat::finalizeImport() { ScDocument& rDoc = getScDocument(); maRules.forEachMem( &CondFormatRule::finalizeImport ); - sal_Int32 nIndex = getScDocument().AddCondFormat(mpFormat, maModel.maRanges.getBaseAddress().Sheet); + SCTAB nTab = maModel.maRanges.getBaseAddress().Sheet; + sal_Int32 nIndex = getScDocument().AddCondFormat(mpFormat, nTab); ScRangeList aList; for( ApiCellRangeList::const_iterator itr = maModel.maRanges.begin(); itr != maModel.maRanges.end(); ++itr) { ScRange aRange; ScUnoConversion::FillScRange(aRange, *itr); - ScPatternAttr aPattern( rDoc.GetPool() ); - aPattern.GetItemSet().Put( SfxUInt32Item( ATTR_CONDITIONAL, nIndex ) ); - ScMarkData aMarkData; - aMarkData.SetMarkArea(aRange); - rDoc.ApplySelectionPattern( aPattern , aMarkData); - aList.Append(aRange); } + rDoc.AddCondFormatData( aList, nTab, nIndex ); mpFormat->AddRange(aList); } diff --git a/sc/source/filter/oox/drawingfragment.cxx b/sc/source/filter/oox/drawingfragment.cxx index 73e6b47eb7c1..afc0ca1ddad4 100644 --- a/sc/source/filter/oox/drawingfragment.cxx +++ b/sc/source/filter/oox/drawingfragment.cxx @@ -86,11 +86,11 @@ void ShapeMacroAttacher::attachMacro( const OUString& rMacroUrl ) Reference< XEventsSupplier > xSupplier( mxShape, UNO_QUERY_THROW ); Reference< XNameReplace > xEvents( xSupplier->getEvents(), UNO_SET_THROW ); Sequence< PropertyValue > aEventProps( 2 ); - aEventProps[ 0 ].Name = CREATE_OUSTRING( "EventType" ); - aEventProps[ 0 ].Value <<= CREATE_OUSTRING( "Script" ); - aEventProps[ 1 ].Name = CREATE_OUSTRING( "Script" ); + aEventProps[ 0 ].Name = "EventType"; + aEventProps[ 0 ].Value <<= OUString( "Script" ); + aEventProps[ 1 ].Name = "Script"; aEventProps[ 1 ].Value <<= rMacroUrl; - xEvents->replaceByName( CREATE_OUSTRING( "OnClick" ), Any( aEventProps ) ); + xEvents->replaceByName( "OnClick", Any( aEventProps ) ); } catch( Exception& ) { @@ -340,7 +340,7 @@ VmlControlMacroAttacher::VmlControlMacroAttacher( const OUString& rMacroName, void VmlControlMacroAttacher::attachMacro( const OUString& rMacroUrl ) { ScriptEventDescriptor aEventDesc; - aEventDesc.ScriptType = CREATE_OUSTRING( "Script" ); + aEventDesc.ScriptType = "Script"; aEventDesc.ScriptCode = rMacroUrl; // editable drop downs are treated like edit boxes @@ -352,28 +352,28 @@ void VmlControlMacroAttacher::attachMacro( const OUString& rMacroUrl ) case XML_Button: case XML_Checkbox: case XML_Radio: - aEventDesc.ListenerType = CREATE_OUSTRING( "XActionListener" ); - aEventDesc.EventMethod = CREATE_OUSTRING( "actionPerformed" ); + aEventDesc.ListenerType = "XActionListener"; + aEventDesc.EventMethod = "actionPerformed"; break; case XML_Label: case XML_GBox: case XML_Dialog: - aEventDesc.ListenerType = CREATE_OUSTRING( "XMouseListener" ); - aEventDesc.EventMethod = CREATE_OUSTRING( "mouseReleased" ); + aEventDesc.ListenerType = "XMouseListener"; + aEventDesc.EventMethod = "mouseReleased"; break; case XML_Edit: - aEventDesc.ListenerType = CREATE_OUSTRING( "XTextListener" ); - aEventDesc.EventMethod = CREATE_OUSTRING( "textChanged" ); + aEventDesc.ListenerType = "XTextListener"; + aEventDesc.EventMethod = "textChanged"; break; case XML_Spin: case XML_Scroll: - aEventDesc.ListenerType = CREATE_OUSTRING( "XAdjustmentListener" ); - aEventDesc.EventMethod = CREATE_OUSTRING( "adjustmentValueChanged" ); + aEventDesc.ListenerType = "XAdjustmentListener"; + aEventDesc.EventMethod = "adjustmentValueChanged"; break; case XML_List: case XML_Drop: - aEventDesc.ListenerType = CREATE_OUSTRING( "XChangeListener" ); - aEventDesc.EventMethod = CREATE_OUSTRING( "changed" ); + aEventDesc.ListenerType = "XChangeListener"; + aEventDesc.EventMethod = "changed"; break; default: OSL_ENSURE( false, "VmlControlMacroAttacher::attachMacro - unexpected object type" ); @@ -398,8 +398,8 @@ VmlDrawing::VmlDrawing( const WorksheetHelper& rHelper ) : maControlConv( rHelper.getBaseFilter().getModel(), rHelper.getBaseFilter().getGraphicHelper() ) { // default font for legacy listboxes and dropdowns: Tahoma, 8pt - maListBoxFont.moName = CREATE_OUSTRING( "Tahoma" ); - maListBoxFont.moColor = CREATE_OUSTRING( "auto" ); + maListBoxFont.moName = "Tahoma"; + maListBoxFont.moColor = "auto"; maListBoxFont.monSize = 160; } @@ -420,19 +420,19 @@ OUString VmlDrawing::getShapeBaseName( const ::oox::vml::ShapeBase& rShape ) con { switch( pClientData->mnObjType ) { - case XML_Button: return CREATE_OUSTRING( "Button" ); - case XML_Checkbox: return CREATE_OUSTRING( "Check Box" ); - case XML_Dialog: return CREATE_OUSTRING( "Dialog Frame" ); - case XML_Drop: return CREATE_OUSTRING( "Drop Down" ); - case XML_Edit: return CREATE_OUSTRING( "Edit Box" ); - case XML_GBox: return CREATE_OUSTRING( "Group Box" ); - case XML_Label: return CREATE_OUSTRING( "Label" ); - case XML_List: return CREATE_OUSTRING( "List Box" ); - case XML_Note: return CREATE_OUSTRING( "Comment" ); - case XML_Pict: return (pClientData->mbDde || getOleObjectInfo( rShape.getShapeId() )) ? CREATE_OUSTRING( "Object" ) : CREATE_OUSTRING( "Picture" ); - case XML_Radio: return CREATE_OUSTRING( "Option Button" ); - case XML_Scroll: return CREATE_OUSTRING( "Scroll Bar" ); - case XML_Spin: return CREATE_OUSTRING( "Spinner" ); + case XML_Button: return OUString( "Button" ); + case XML_Checkbox: return OUString( "Check Box" ); + case XML_Dialog: return OUString( "Dialog Frame" ); + case XML_Drop: return OUString( "Drop Down" ); + case XML_Edit: return OUString( "Edit Box" ); + case XML_GBox: return OUString( "Group Box" ); + case XML_Label: return OUString( "Label" ); + case XML_List: return OUString( "List Box" ); + case XML_Note: return OUString( "Comment" ); + case XML_Pict: return (pClientData->mbDde || getOleObjectInfo( rShape.getShapeId() )) ? OUString( "Object" ) : OUString( "Picture" ); + case XML_Radio: return OUString( "Option Button" ); + case XML_Scroll: return OUString( "Scroll Bar" ); + case XML_Spin: return OUString( "Spinner" ); } } return ::oox::vml::Drawing::getShapeBaseName( rShape ); diff --git a/sc/source/filter/oox/excelchartconverter.cxx b/sc/source/filter/oox/excelchartconverter.cxx index a6303b0362ea..69b317227415 100644 --- a/sc/source/filter/oox/excelchartconverter.cxx +++ b/sc/source/filter/oox/excelchartconverter.cxx @@ -69,7 +69,7 @@ void ExcelChartConverter::createDataProvider( const Reference< XChartDocument >& { Reference< XDataReceiver > xDataRec( rxChartDoc, UNO_QUERY_THROW ); Reference< XDataProvider > xDataProv( getBaseFilter().getModelFactory()->createInstance( - CREATE_OUSTRING( "com.sun.star.chart2.data.DataProvider" ) ), UNO_QUERY_THROW ); + "com.sun.star.chart2.data.DataProvider" ), UNO_QUERY_THROW ); xDataRec->attachDataProvider( xDataProv ); } catch( Exception& ) diff --git a/sc/source/filter/oox/excelfilter.cxx b/sc/source/filter/oox/excelfilter.cxx index 84f933135b99..8320780867ec 100644 --- a/sc/source/filter/oox/excelfilter.cxx +++ b/sc/source/filter/oox/excelfilter.cxx @@ -83,14 +83,14 @@ void ExcelFilterBase::unregisterWorkbookGlobals() OUString SAL_CALL ExcelFilter_getImplementationName() throw() { - return CREATE_OUSTRING( "com.sun.star.comp.oox.xls.ExcelFilter" ); + return OUString( "com.sun.star.comp.oox.xls.ExcelFilter" ); } Sequence< OUString > SAL_CALL ExcelFilter_getSupportedServiceNames() throw() { Sequence< OUString > aSeq( 2 ); - aSeq[ 0 ] = CREATE_OUSTRING( "com.sun.star.document.ImportFilter" ); - aSeq[ 1 ] = CREATE_OUSTRING( "com.sun.star.document.ExportFilter" ); + aSeq[ 0 ] = "com.sun.star.document.ImportFilter"; + aSeq[ 1 ] = "com.sun.star.document.ExportFilter"; return aSeq; } @@ -178,7 +178,7 @@ sal_Bool SAL_CALL ExcelFilter::filter( const ::com::sun::star::uno::Sequence< :: if ( isExportFilter() ) { - Reference< XExporter > xExporter( getServiceFactory()->createInstance( CREATE_OUSTRING( "com.sun.star.comp.oox.ExcelFilterExport" ) ), UNO_QUERY ); + Reference< XExporter > xExporter( getServiceFactory()->createInstance( "com.sun.star.comp.oox.ExcelFilterExport" ), UNO_QUERY ); if ( xExporter.is() ) { diff --git a/sc/source/filter/oox/excelvbaproject.cxx b/sc/source/filter/oox/excelvbaproject.cxx index ceb73ecf68f3..f91ae116b781 100644 --- a/sc/source/filter/oox/excelvbaproject.cxx +++ b/sc/source/filter/oox/excelvbaproject.cxx @@ -60,7 +60,7 @@ using ::rtl::OUStringBuffer; // ============================================================================ ExcelVbaProject::ExcelVbaProject( const Reference< XComponentContext >& rxContext, const Reference< XSpreadsheetDocument >& rxDocument ) : - ::oox::ole::VbaProject( rxContext, Reference< XModel >( rxDocument, UNO_QUERY ), CREATE_OUSTRING( "Calc" ) ), + ::oox::ole::VbaProject( rxContext, Reference< XModel >( rxDocument, UNO_QUERY ), "Calc" ), mxDocument( rxDocument ) { } @@ -111,7 +111,7 @@ void ExcelVbaProject::prepareImport() else { // TODO: once we have chart sheets we need a switch/case on sheet type ('SheetNNN' vs. 'ChartNNN') - aCodeNameInfos.push_back( SheetCodeNameInfo( aSheetProp, CREATE_OUSTRING( "Sheet" ) ) ); + aCodeNameInfos.push_back( SheetCodeNameInfo( aSheetProp, "Sheet" ) ); } } catch( Exception& ) diff --git a/sc/source/filter/oox/extlstcontext.cxx b/sc/source/filter/oox/extlstcontext.cxx index 78fd832fc540..43a3859ddaa8 100644 --- a/sc/source/filter/oox/extlstcontext.cxx +++ b/sc/source/filter/oox/extlstcontext.cxx @@ -131,9 +131,9 @@ void ExtCfRuleContext::importCfvo( const AttributeList& rAttribs ) else if (aColorScaleType == "max") pEntry->SetType(COLORSCALE_MAX); else if (aColorScaleType == "autoMin") - pEntry->SetType(COLORSCALE_AUTOMIN); + pEntry->SetType(COLORSCALE_AUTO); else if (aColorScaleType == "autoMax") - pEntry->SetType(COLORSCALE_AUTOMAX); + pEntry->SetType(COLORSCALE_AUTO); else if (aColorScaleType == "percentile") pEntry->SetType(COLORSCALE_PERCENTILE); else if (aColorScaleType == "percent") diff --git a/sc/source/filter/oox/formulabase.cxx b/sc/source/filter/oox/formulabase.cxx index b80dbfaaf7b2..db0c40300532 100644 --- a/sc/source/filter/oox/formulabase.cxx +++ b/sc/source/filter/oox/formulabase.cxx @@ -894,12 +894,12 @@ void FunctionProviderImpl::initFunc( const FunctionData& rFuncData, sal_uInt8 nM { OSL_ENSURE( !xFuncInfo->maOoxFuncName.isEmpty(), "FunctionProviderImpl::initFunc - missing OOXML function name" ); OSL_ENSURE( !getFlag( rFuncData.mnFlags, FUNCFLAG_MACROCALLODF ), "FunctionProviderImpl::initFunc - unexpected flag FUNCFLAG_MACROCALLODF" ); - xFuncInfo->maBiffMacroName = CREATE_OUSTRING( "_xlfn." ) + xFuncInfo->maOoxFuncName; + xFuncInfo->maBiffMacroName = "_xlfn." + xFuncInfo->maOoxFuncName; } else if( getFlag( rFuncData.mnFlags, FUNCFLAG_MACROCALLODF ) ) { OSL_ENSURE( !xFuncInfo->maOdfFuncName.isEmpty(), "FunctionProviderImpl::initFunc - missing ODF function name" ); - xFuncInfo->maBiffMacroName = CREATE_OUSTRING( "_xlfnodf." ) + xFuncInfo->maOdfFuncName; + xFuncInfo->maBiffMacroName = "_xlfnodf." + xFuncInfo->maOdfFuncName; } xFuncInfo->meFuncLibType = FUNCFLAGS_TO_FUNCLIB( rFuncData.mnFlags ); @@ -1030,7 +1030,7 @@ OpCodeProviderImpl::OpCodeProviderImpl( const FunctionInfoVector& rFuncInfos, if( rxModelFactory.is() ) try { Reference< XFormulaOpCodeMapper > xMapper( rxModelFactory->createInstance( - CREATE_OUSTRING( "com.sun.star.sheet.FormulaOpCodeMapper" ) ), UNO_QUERY_THROW ); + "com.sun.star.sheet.FormulaOpCodeMapper" ), UNO_QUERY_THROW ); // op-codes provided as attributes OPCODE_UNKNOWN = xMapper->getOpCodeUnknown(); @@ -1316,7 +1316,7 @@ ApiParserWrapper::ApiParserWrapper( { if( rxModelFactory.is() ) try { - mxParser.set( rxModelFactory->createInstance( CREATE_OUSTRING( "com.sun.star.sheet.FormulaParser" ) ), UNO_QUERY_THROW ); + mxParser.set( rxModelFactory->createInstance( "com.sun.star.sheet.FormulaParser" ), UNO_QUERY_THROW ); } catch( Exception& ) { @@ -1477,7 +1477,7 @@ OUString FormulaProcessorBase::generateApiString( const OUString& rString ) OUString aRetString = rString; sal_Int32 nQuotePos = aRetString.getLength(); while( (nQuotePos = aRetString.lastIndexOf( '"', nQuotePos )) >= 0 ) - aRetString = aRetString.replaceAt( nQuotePos, 1, CREATE_OUSTRING( "\"\"" ) ); + aRetString = aRetString.replaceAt( nQuotePos, 1, OUString( "\"\"" ) ); return OUStringBuffer().append( sal_Unicode( '"' ) ).append( aRetString ).append( sal_Unicode( '"' ) ).makeStringAndClear(); } diff --git a/sc/source/filter/oox/numberformatsbuffer.cxx b/sc/source/filter/oox/numberformatsbuffer.cxx index 72bc935fb223..dc7162f50f41 100644 --- a/sc/source/filter/oox/numberformatsbuffer.cxx +++ b/sc/source/filter/oox/numberformatsbuffer.cxx @@ -1857,7 +1857,7 @@ sal_Int32 lclCreateFormat( const Reference< XNumberFormats >& rxNumFmts, catch( Exception& ) { // BIFF2-BIFF4 stores standard format explicitly in stream - static const OUString saGeneral = CREATE_OUSTRING( "general" ); + static const OUString saGeneral = "general"; if( rFmtCode.equalsIgnoreAsciiCase( saGeneral ) ) { nIndex = lclCreatePredefinedFormat( rxNumFmts, 0, rToLocale ); @@ -1891,7 +1891,7 @@ private: }; NumberFormatFinalizer::NumberFormatFinalizer( const WorkbookHelper& rHelper ) : - maEnUsLocale( CREATE_OUSTRING( "en" ), CREATE_OUSTRING( "US" ), OUString() ) + maEnUsLocale( "en", "US", OUString() ) { try { @@ -2046,7 +2046,7 @@ void NumberFormatsBuffer::insertBuiltinFormats() append( "' not supported (#i29949#)" ).getStr() ); // start with default table, if no table has been found if( aMIt == aMEnd ) - aMIt = aBuiltinMap.find( CREATE_OUSTRING( "*" ) ); + aMIt = aBuiltinMap.find( "*" ); OSL_ENSURE( aMIt != aMEnd, "NumberFormatsBuffer::insertBuiltinFormats - default map not found" ); // insert all tables into the vector for( ; aMIt != aMEnd; aMIt = aBuiltinMap.find( OUString::createFromAscii( aMIt->second->mpcParent ) ) ) diff --git a/sc/source/filter/oox/pagesettings.cxx b/sc/source/filter/oox/pagesettings.cxx index 122120d4fd83..5a8a09a64266 100644 --- a/sc/source/filter/oox/pagesettings.cxx +++ b/sc/source/filter/oox/pagesettings.cxx @@ -335,7 +335,7 @@ void PageSettings::setFitToPagesMode( bool bFitToPages ) void PageSettings::finalizeImport() { - OUStringBuffer aStyleNameBuffer( CREATE_OUSTRING( "PageStyle_" ) ); + OUStringBuffer aStyleNameBuffer( "PageStyle_" ); Reference< XNamed > xSheetName( getSheet(), UNO_QUERY ); if( xSheetName.is() ) aStyleNameBuffer.append( xSheetName->getName() ); @@ -499,11 +499,11 @@ static const sal_Char* const sppcItalicNames[] = HeaderFooterParser::HeaderFooterParser( const WorkbookHelper& rHelper ) : WorkbookHelper( rHelper ), - maPageNumberService( CREATE_OUSTRING( "com.sun.star.text.TextField.PageNumber" ) ), - maPageCountService( CREATE_OUSTRING( "com.sun.star.text.TextField.PageCount" ) ), - maSheetNameService( CREATE_OUSTRING( "com.sun.star.text.TextField.SheetName" ) ), - maFileNameService( CREATE_OUSTRING( "com.sun.star.text.TextField.FileName" ) ), - maDateTimeService( CREATE_OUSTRING( "com.sun.star.text.TextField.DateTime" ) ), + maPageNumberService( "com.sun.star.text.TextField.PageNumber" ), + maPageCountService( "com.sun.star.text.TextField.PageCount" ), + maSheetNameService( "com.sun.star.text.TextField.SheetName" ), + maFileNameService( "com.sun.star.text.TextField.FileName" ), + maDateTimeService( "com.sun.star.text.TextField.DateTime" ), maBoldNames( sppcBoldNames, STATIC_ARRAY_END( sppcBoldNames ) ), maItalicNames( sppcItalicNames, STATIC_ARRAY_END( sppcItalicNames ) ), maPortions( static_cast< size_t >( HF_COUNT ) ), diff --git a/sc/source/filter/oox/pivotcachebuffer.cxx b/sc/source/filter/oox/pivotcachebuffer.cxx index 650c2a18c15c..6a79caf1f1c6 100644 --- a/sc/source/filter/oox/pivotcachebuffer.cxx +++ b/sc/source/filter/oox/pivotcachebuffer.cxx @@ -1182,7 +1182,7 @@ void PivotCache::importPCDSheetSource( SequenceInputStream& rStrm, const Relatio { rStrm >> maSheetSrcModel.maDefName; if( nIsBuiltinName != 0 ) - maSheetSrcModel.maDefName = CREATE_OUSTRING( "_xlnm." ) + maSheetSrcModel.maDefName; + maSheetSrcModel.maDefName = "_xlnm." + maSheetSrcModel.maDefName; } // resolve URL of external document @@ -1397,7 +1397,7 @@ void PivotCache::prepareSourceDataSheet() if( getAddressConverter().checkCellRange( rRange, false, true ) ) { maColSpans.insert( ValueRange( rRange.StartColumn, rRange.EndColumn ) ); - OUString aSheetName = CREATE_OUSTRING( "DPCache_" ) + maSheetSrcModel.maSheet; + OUString aSheetName = "DPCache_" + maSheetSrcModel.maSheet; rRange.Sheet = getWorksheets().insertEmptySheet( aSheetName, false ); mbValidSource = mbDummySheet = rRange.Sheet >= 0; } diff --git a/sc/source/filter/oox/querytablebuffer.cxx b/sc/source/filter/oox/querytablebuffer.cxx index 697ccc889cc3..c303dfedc058 100644 --- a/sc/source/filter/oox/querytablebuffer.cxx +++ b/sc/source/filter/oox/querytablebuffer.cxx @@ -123,7 +123,7 @@ void lclAppendWebQueryTableIndex( OUStringBuffer& rTables, sal_Int32 nTableIndex OUString lclBuildWebQueryTables( const WebPrModel::TablesVector& rTables ) { if( rTables.empty() ) - return CREATE_OUSTRING( "HTML_tables" ); + return OUString( "HTML_tables" ); OUStringBuffer aTables; for( WebPrModel::TablesVector::const_iterator aIt = rTables.begin(), aEnd = rTables.end(); aIt != aEnd; ++aIt ) @@ -276,12 +276,12 @@ void QueryTable::finalizeImport() { CellAddress aDestPos( aDestRange.Sheet, aDestRange.StartColumn, aDestRange.StartRow ); // find tables mode: entire document, all tables, or specific tables - OUString aTables = pWebPr->mbHtmlTables ? lclBuildWebQueryTables( pWebPr->maTables ) : CREATE_OUSTRING( "HTML_all" ); + OUString aTables = pWebPr->mbHtmlTables ? lclBuildWebQueryTables( pWebPr->maTables ) : "HTML_all"; if( !aTables.isEmpty() ) try { PropertySet aDocProps( getDocument() ); Reference< XAreaLinks > xAreaLinks( aDocProps.getAnyProperty( PROP_AreaLinks ), UNO_QUERY_THROW ); - OUString aFilterName = CREATE_OUSTRING( "calc_HTML_WebQuery" ); + OUString aFilterName = "calc_HTML_WebQuery"; OUString aFilterOptions; xAreaLinks->insertAtPosition( aDestPos, aFileUrl, aTables, aFilterName, aFilterOptions ); // set refresh interval (convert minutes to seconds) diff --git a/sc/source/filter/oox/stylesbuffer.cxx b/sc/source/filter/oox/stylesbuffer.cxx index f9b9779d32ff..fbb63b076399 100644 --- a/sc/source/filter/oox/stylesbuffer.cxx +++ b/sc/source/filter/oox/stylesbuffer.cxx @@ -676,7 +676,7 @@ ApiScriptFontName::ApiScriptFontName() : ApiFontData::ApiFontData() : maDesc( - CREATE_OUSTRING( "Calibri" ), + "Calibri", 220, // height 11 points 0, OUString(), @@ -2849,9 +2849,9 @@ void CellStyleBuffer::finalizeImport() if (mxDefStyle) { Reference<XNameAccess> xNA(getStyleFamily(false), UNO_QUERY_THROW); - if (xNA->hasByName(CREATE_OUSTRING("Default"))) + if (xNA->hasByName("Default")) { - PropertySet aPropSet(xNA->getByName(CREATE_OUSTRING("Default"))); + PropertySet aPropSet(xNA->getByName("Default")); getStyles().writeStyleXfToPropertySet(aPropSet, mxDefStyle->getModel().mnXfId); } } @@ -3172,7 +3172,7 @@ OUString StylesBuffer::createDxfStyle( sal_Int32 nDxfId ) const { if( Dxf* pDxf = maDxfs.get( nDxfId ).get() ) { - rStyleName = OUStringBuffer( CREATE_OUSTRING( "ConditionalStyle_" ) ).append( nDxfId + 1 ).makeStringAndClear(); + rStyleName = OUStringBuffer( "ConditionalStyle_" ).append( nDxfId + 1 ).makeStringAndClear(); // create the style sheet (this may change rStyleName if such a style already exists) Reference< XStyle > xStyle = createStyleObject( rStyleName, false ); // write style formatting properties diff --git a/sc/source/filter/oox/themebuffer.cxx b/sc/source/filter/oox/themebuffer.cxx index 2d3682e4c1a5..d7b7edde6015 100644 --- a/sc/source/filter/oox/themebuffer.cxx +++ b/sc/source/filter/oox/themebuffer.cxx @@ -96,12 +96,12 @@ ThemeBuffer::ThemeBuffer( const WorkbookHelper& rHelper ) : { case FILTER_OOXML: //! TODO: locale dependent font name - mxDefFontModel->maName = CREATE_OUSTRING( "Cambria" ); + mxDefFontModel->maName = "Cambria"; mxDefFontModel->mfHeight = 11.0; break; case FILTER_BIFF: //! TODO: BIFF dependent font name - mxDefFontModel->maName = CREATE_OUSTRING( "Arial" ); + mxDefFontModel->maName = "Arial"; mxDefFontModel->mfHeight = 10.0; break; case FILTER_UNKNOWN: break; diff --git a/sc/source/filter/oox/unitconverter.cxx b/sc/source/filter/oox/unitconverter.cxx index e2feb875882e..5b0c52829d5f 100644 --- a/sc/source/filter/oox/unitconverter.cxx +++ b/sc/source/filter/oox/unitconverter.cxx @@ -124,13 +124,13 @@ UnitConverter::UnitConverter( const WorkbookHelper& rHelper ) : maCoeffs[ UNIT_SPACE ] = 100.0; // default 1 space = 1 mm // error code maps - addErrorCode( BIFF_ERR_NULL, CREATE_OUSTRING( "#NULL!" ) ); - addErrorCode( BIFF_ERR_DIV0, CREATE_OUSTRING( "#DIV/0!" ) ); - addErrorCode( BIFF_ERR_VALUE, CREATE_OUSTRING( "#VALUE!" ) ); - addErrorCode( BIFF_ERR_REF, CREATE_OUSTRING( "#REF!" ) ); - addErrorCode( BIFF_ERR_NAME, CREATE_OUSTRING( "#NAME?" ) ); - addErrorCode( BIFF_ERR_NUM, CREATE_OUSTRING( "#NUM!" ) ); - addErrorCode( BIFF_ERR_NA, CREATE_OUSTRING( "#NA" ) ); + addErrorCode( BIFF_ERR_NULL, "#NULL!" ); + addErrorCode( BIFF_ERR_DIV0, "#DIV/0!" ); + addErrorCode( BIFF_ERR_VALUE, "#VALUE!" ); + addErrorCode( BIFF_ERR_REF, "#REF!" ); + addErrorCode( BIFF_ERR_NAME, "#NAME?" ); + addErrorCode( BIFF_ERR_NUM, "#NUM!" ); + addErrorCode( BIFF_ERR_NA, "#NA" ); } void UnitConverter::finalizeImport() @@ -149,18 +149,17 @@ void UnitConverter::finalizeImport() { // XDevice expects pixels in font descriptor, but font contains twips FontDescriptor aDesc = pDefFont->getFontDescriptor(); - aDesc.Height = static_cast< sal_Int16 >( scaleValue( aDesc.Height, UNIT_TWIP, UNIT_REFDEVX ) + 0.5 ); Reference< XFont > xFont = xDevice->getFont( aDesc ); if( xFont.is() ) { // get maximum width of all digits sal_Int32 nDigitWidth = 0; for( sal_Unicode cChar = '0'; cChar <= '9'; ++cChar ) - nDigitWidth = ::std::max( nDigitWidth, scaleToMm100( xFont->getCharWidth( cChar ), UNIT_REFDEVX ) ); + nDigitWidth = ::std::max( nDigitWidth, scaleToMm100( xFont->getCharWidth( cChar ), UNIT_TWIP ) ); if( nDigitWidth > 0 ) maCoeffs[ UNIT_DIGIT ] = nDigitWidth; // get width of space character - sal_Int32 nSpaceWidth = scaleToMm100( xFont->getCharWidth( ' ' ), UNIT_REFDEVX ); + sal_Int32 nSpaceWidth = scaleToMm100( xFont->getCharWidth( ' ' ), UNIT_TWIP ); if( nSpaceWidth > 0 ) maCoeffs[ UNIT_SPACE ] = nSpaceWidth; } diff --git a/sc/source/filter/oox/viewsettings.cxx b/sc/source/filter/oox/viewsettings.cxx index 3503011df51c..16353bbefcf4 100644 --- a/sc/source/filter/oox/viewsettings.cxx +++ b/sc/source/filter/oox/viewsettings.cxx @@ -652,7 +652,7 @@ void ViewSettings::finalizeImport() aWinExtent[ 1 ] = aPos.Y; aWinExtent[ 2 ] = aPos.X + aSize.Width; aWinExtent[ 3 ] = aPos.Y + aSize.Height; - getBaseFilter().getMediaDescriptor()[ CREATE_OUSTRING( "WinExtent" ) ] <<= aWinExtent; + getBaseFilter().getMediaDescriptor()[ "WinExtent" ] <<= aWinExtent; } } } diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx index d0394987e561..b9dabe67289f 100644 --- a/sc/source/filter/oox/workbookhelper.cxx +++ b/sc/source/filter/oox/workbookhelper.cxx @@ -511,10 +511,10 @@ Reference< XStyle > WorkbookGlobals::createStyleObject( OUString& orStyleName, b void WorkbookGlobals::initialize( bool bWorkbookFile ) { - maCellStyles = CREATE_OUSTRING( "CellStyles" ); - maPageStyles = CREATE_OUSTRING( "PageStyles" ); - maCellStyleServ = CREATE_OUSTRING( "com.sun.star.style.CellStyle" ); - maPageStyleServ = CREATE_OUSTRING( "com.sun.star.style.PageStyle" ); + maCellStyles = "CellStyles"; + maPageStyles = "PageStyles"; + maCellStyleServ = "com.sun.star.style.CellStyle"; + maPageStyleServ = "com.sun.star.style.PageStyle"; mnCurrSheet = -1; mbWorkbook = bWorkbookFile; meTextEnc = osl_getThreadTextEncoding(); @@ -562,7 +562,7 @@ void WorkbookGlobals::initialize( bool bWorkbookFile ) xLockable->addActionLock(); //! TODO: localize progress bar text - mxProgressBar.reset( new SegmentProgressBar( mrBaseFilter.getStatusIndicator(), CREATE_OUSTRING( "Loading..." ) ) ); + mxProgressBar.reset( new SegmentProgressBar( mrBaseFilter.getStatusIndicator(), "Loading..." ) ); mxFmlaParser.reset( new FormulaParser( *this ) ); //prevent unnecessary broadcasts and "half way listeners" as @@ -572,7 +572,7 @@ void WorkbookGlobals::initialize( bool bWorkbookFile ) else if( mrBaseFilter.isExportFilter() ) { //! TODO: localize progress bar text - mxProgressBar.reset( new SegmentProgressBar( mrBaseFilter.getStatusIndicator(), CREATE_OUSTRING( "Saving..." ) ) ); + mxProgressBar.reset( new SegmentProgressBar( mrBaseFilter.getStatusIndicator(), "Saving..." ) ); } // filter specific switch( getFilterType() ) @@ -692,7 +692,7 @@ void WorkbookHelper::finalizeWorkbookImport() number 1). Otherwise hidden sheets (e.g. for scenarios) which have 'Default' page style will break automatic page numbering for following sheets. Automatic numbering is set by passing the value 0. */ - PropertySet aDefPageStyle( getStyleObject( CREATE_OUSTRING( "Default" ), true ) ); + PropertySet aDefPageStyle( getStyleObject( "Default", true ) ); aDefPageStyle.setProperty< sal_Int16 >( PROP_FirstPageNumber, 0 ); /* Import the VBA project (after finalizing workbook settings which diff --git a/sc/source/filter/oox/workbooksettings.cxx b/sc/source/filter/oox/workbooksettings.cxx index b98cb7d1ff10..e03858d62fe4 100644 --- a/sc/source/filter/oox/workbooksettings.cxx +++ b/sc/source/filter/oox/workbooksettings.cxx @@ -209,10 +209,10 @@ void WorkbookSettings::finalizeImport() // write protection if( maFileSharing.mbRecommendReadOnly || (maFileSharing.mnPasswordHash != 0) ) try { - getBaseFilter().getMediaDescriptor()[ CREATE_OUSTRING( "ReadOnly" ) ] <<= true; + getBaseFilter().getMediaDescriptor()[ "ReadOnly" ] <<= true; Reference< XPropertySet > xDocumentSettings( getBaseFilter().getModelFactory()->createInstance( - CREATE_OUSTRING( "com.sun.star.document.Settings" ) ), UNO_QUERY_THROW ); + "com.sun.star.document.Settings" ), UNO_QUERY_THROW ); PropertySet aSettingsProp( xDocumentSettings ); if( maFileSharing.mbRecommendReadOnly ) aSettingsProp.setProperty( PROP_LoadReadonly, true ); diff --git a/sc/source/filter/oox/worksheetbuffer.cxx b/sc/source/filter/oox/worksheetbuffer.cxx index 8e092ac74e5e..9d49f9c1ee40 100644 --- a/sc/source/filter/oox/worksheetbuffer.cxx +++ b/sc/source/filter/oox/worksheetbuffer.cxx @@ -168,7 +168,7 @@ WorksheetBuffer::IndexNamePair WorksheetBuffer::createSheet( const OUString& rPr Reference< XIndexAccess > xSheetsIA( xSheets, UNO_QUERY_THROW ); Reference< XNameAccess > xSheetsNA( xSheets, UNO_QUERY_THROW ); sal_Int16 nCalcSheet = -1; - OUString aSheetName = rPreferredName.isEmpty() ? CREATE_OUSTRING( "Sheet" ) : rPreferredName; + OUString aSheetName = rPreferredName.isEmpty() ? "Sheet" : rPreferredName; PropertySet aPropSet; if( nSheetPos < xSheetsIA->getCount() ) { diff --git a/sc/source/filter/oox/worksheethelper.cxx b/sc/source/filter/oox/worksheethelper.cxx index 8094e0e517bf..32da418570c6 100644 --- a/sc/source/filter/oox/worksheethelper.cxx +++ b/sc/source/filter/oox/worksheethelper.cxx @@ -426,8 +426,8 @@ private: WorksheetGlobals::WorksheetGlobals( const WorkbookHelper& rHelper, const ISegmentProgressBarRef& rxProgressBar, WorksheetType eSheetType, sal_Int16 nSheet ) : WorkbookHelper( rHelper ), - maSheetCellRanges( CREATE_OUSTRING( "com.sun.star.sheet.SheetCellRanges" ) ), - maUrlTextField( CREATE_OUSTRING( "com.sun.star.text.TextField.URL" ) ), + maSheetCellRanges( "com.sun.star.sheet.SheetCellRanges" ), + maUrlTextField( "com.sun.star.text.TextField.URL" ), mrMaxApiPos( rHelper.getAddressConverter().getMaxApiAddress() ), maUsedArea( nSheet, SAL_MAX_INT32, SAL_MAX_INT32, -1, -1 ), maSheetData( *this ), diff --git a/sc/source/filter/starcalc/collect.cxx b/sc/source/filter/starcalc/collect.cxx index 28d8d8750704..b56faec22dc0 100644 --- a/sc/source/filter/starcalc/collect.cxx +++ b/sc/source/filter/starcalc/collect.cxx @@ -43,7 +43,7 @@ ScDataObject::~ScDataObject() // Collection //------------------------------------------------------------------------ -void lcl_DeleteScDataObjects( ScDataObject** p, sal_uInt16 nCount ) +static void lcl_DeleteScDataObjects( ScDataObject** p, sal_uInt16 nCount ) { if ( p ) { diff --git a/sc/source/filter/starcalc/scflt.cxx b/sc/source/filter/starcalc/scflt.cxx index ad95f71e492b..02d3e2c3a32e 100644 --- a/sc/source/filter/starcalc/scflt.cxx +++ b/sc/source/filter/starcalc/scflt.cxx @@ -338,7 +338,7 @@ static void lcl_ReadChartTypeData(SvStream& rStream, Sc10ChartTypeData& rTypeDat rStream.Read(&rTypeData.Reserved, sizeof(rTypeData.Reserved)); } -double lcl_PascalToDouble(sal_Char* tp6) +static double lcl_PascalToDouble(sal_Char* tp6) { sal_uInt8* pnUnsigned = reinterpret_cast< sal_uInt8* >( tp6 ); // biased exponent @@ -386,7 +386,7 @@ static void lcl_ChangeColor( sal_uInt16 nIndex, Color& rColor ) rColor.SetColor( aCol ); } -String lcl_MakeOldPageStyleFormatName( sal_uInt16 i ) +static String lcl_MakeOldPageStyleFormatName( sal_uInt16 i ) { String aName = ScGlobal::GetRscString( STR_PAGESTYLE ); aName.AppendAscii( " " ); diff --git a/sc/source/filter/xcl97/XclExpChangeTrack.cxx b/sc/source/filter/xcl97/XclExpChangeTrack.cxx index 66359f2ddc3a..042fafb96d5e 100644 --- a/sc/source/filter/xcl97/XclExpChangeTrack.cxx +++ b/sc/source/filter/xcl97/XclExpChangeTrack.cxx @@ -69,7 +69,7 @@ static OString lcl_DateTimeToOString( const DateTime& rDateTime ) //___________________________________________________________________ // local functions -void lcl_WriteDateTime( XclExpStream& rStrm, const DateTime& rDateTime ) +static void lcl_WriteDateTime( XclExpStream& rStrm, const DateTime& rDateTime ) { rStrm.SetSliceSize( 7 ); rStrm << (sal_uInt16) rDateTime.GetYear() @@ -83,7 +83,7 @@ void lcl_WriteDateTime( XclExpStream& rStrm, const DateTime& rDateTime ) // write string and fill rest of <nLength> with zero bytes // <nLength> is without string header -void lcl_WriteFixedString( XclExpStream& rStrm, const XclExpString& rString, sal_Size nLength ) +static void lcl_WriteFixedString( XclExpStream& rStrm, const XclExpString& rString, sal_Size nLength ) { sal_Size nStrBytes = rString.GetBufferSize(); OSL_ENSURE( nLength >= nStrBytes, "lcl_WriteFixedString - String too long" ); @@ -93,13 +93,13 @@ void lcl_WriteFixedString( XclExpStream& rStrm, const XclExpString& rString, sal rStrm.WriteZeroBytes( nLength - nStrBytes ); } -inline void lcl_GenerateGUID( sal_uInt8* pGUID, sal_Bool& rValidGUID ) +static inline void lcl_GenerateGUID( sal_uInt8* pGUID, sal_Bool& rValidGUID ) { rtl_createUuid( pGUID, rValidGUID ? pGUID : NULL, false ); rValidGUID = sal_True; } -inline void lcl_WriteGUID( XclExpStream& rStrm, const sal_uInt8* pGUID ) +static inline void lcl_WriteGUID( XclExpStream& rStrm, const sal_uInt8* pGUID ) { rStrm.SetSliceSize( 16 ); for( sal_Size nIndex = 0; nIndex < 16; nIndex++ ) diff --git a/sc/source/filter/xcl97/xcl97esc.cxx b/sc/source/filter/xcl97/xcl97esc.cxx index eea131ac0f15..51ff702d92db 100644 --- a/sc/source/filter/xcl97/xcl97esc.cxx +++ b/sc/source/filter/xcl97/xcl97esc.cxx @@ -183,7 +183,7 @@ bool lcl_IsFontwork( const SdrObject* pObj ) bool bIsFontwork = false; if( pObj->GetObjIdentifier() == OBJ_CUSTOMSHAPE ) { - const OUString aTextPath = CREATE_OUSTRING( "TextPath" ); + const OUString aTextPath = "TextPath"; SdrCustomShapeGeometryItem& rGeometryItem = (SdrCustomShapeGeometryItem&) pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ); if( Any* pAny = rGeometryItem.GetPropertyValueByName( aTextPath, aTextPath ) ) diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx index 6b886bfd6602..53be1208c89a 100644 --- a/sc/source/filter/xcl97/xcl97rec.cxx +++ b/sc/source/filter/xcl97/xcl97rec.cxx @@ -678,7 +678,7 @@ void XclObjDropDown::WriteSubRecs( XclExpStream& rStrm ) // --- class XclTxo -------------------------------------------------- -sal_uInt8 lcl_GetHorAlignFromItemSet( const SfxItemSet& rItemSet ) +static sal_uInt8 lcl_GetHorAlignFromItemSet( const SfxItemSet& rItemSet ) { sal_uInt8 nHorAlign = EXC_OBJ_HOR_LEFT; @@ -693,7 +693,7 @@ sal_uInt8 lcl_GetHorAlignFromItemSet( const SfxItemSet& rItemSet ) return nHorAlign; } -sal_uInt8 lcl_GetVerAlignFromItemSet( const SfxItemSet& rItemSet ) +static sal_uInt8 lcl_GetVerAlignFromItemSet( const SfxItemSet& rItemSet ) { sal_uInt8 nVerAlign = EXC_OBJ_VER_TOP; diff --git a/sc/source/filter/xml/XMLTableShapeImportHelper.cxx b/sc/source/filter/xml/XMLTableShapeImportHelper.cxx index 36ff2df44125..6e90d3a1c878 100644 --- a/sc/source/filter/xml/XMLTableShapeImportHelper.cxx +++ b/sc/source/filter/xml/XMLTableShapeImportHelper.cxx @@ -78,7 +78,7 @@ void XMLTableShapeImportHelper::SetLayer(uno::Reference<drawing::XShape>& rShape // Attempt to find the topmost parent of the group, this is the one we apply // offsets to -uno::Reference< drawing::XShape > lcl_getTopLevelParent( const uno::Reference< drawing::XShape >& rShape ) +static uno::Reference< drawing::XShape > lcl_getTopLevelParent( const uno::Reference< drawing::XShape >& rShape ) { uno::Reference< container::XChild > xChild( rShape, uno::UNO_QUERY ); uno::Reference< drawing::XShape > xParent( xChild->getParent(), uno::UNO_QUERY ); diff --git a/sc/source/filter/xml/sheetdata.cxx b/sc/source/filter/xml/sheetdata.cxx index 184bd067c91a..6961f37d4f61 100644 --- a/sc/source/filter/xml/sheetdata.cxx +++ b/sc/source/filter/xml/sheetdata.cxx @@ -210,7 +210,7 @@ void ScSheetSaveData::StoreLoadedNamespaces( const SvXMLNamespaceMap& rNamespace } } -bool lcl_NameInHash( const NameSpaceHash& rNameHash, const rtl::OUString& rName ) +static bool lcl_NameInHash( const NameSpaceHash& rNameHash, const rtl::OUString& rName ) { NameSpaceHash::const_iterator aIter = rNameHash.begin(), aEnd = rNameHash.end(); while (aIter != aEnd) diff --git a/sc/source/filter/xml/xmlcondformat.cxx b/sc/source/filter/xml/xmlcondformat.cxx index c53e77fffcb6..9733bd28e9a1 100644 --- a/sc/source/filter/xml/xmlcondformat.cxx +++ b/sc/source/filter/xml/xmlcondformat.cxx @@ -36,11 +36,6 @@ #include "rangelst.hxx" #include "rangeutl.hxx" #include "docfunc.hxx" -#include "markdata.hxx" -#include "docpool.hxx" -#include "scitems.hxx" -#include "patattr.hxx" -#include "svl/intitem.hxx" #include "XMLConverter.hxx" @@ -137,14 +132,11 @@ void ScXMLConditionalFormatContext::EndElement() { ScDocument* pDoc = GetScImport().GetDocument(); - sal_uLong nIndex = pDoc->AddCondFormat(mpFormat, GetScImport().GetTables().GetCurrentSheet()); + SCTAB nTab = GetScImport().GetTables().GetCurrentSheet(); + sal_uLong nIndex = pDoc->AddCondFormat(mpFormat, nTab); mpFormat->SetKey(nIndex); - ScPatternAttr aPattern( pDoc->GetPool() ); - aPattern.GetItemSet().Put( SfxUInt32Item( ATTR_CONDITIONAL, nIndex ) ); - ScMarkData aMarkData; - aMarkData.MarkFromRangeList(mpFormat->GetRange(), true); - pDoc->ApplySelectionPattern( aPattern , aMarkData); + pDoc->AddCondFormatData( mpFormat->GetRange(), nTab, nIndex); } ScXMLColorScaleFormatContext::ScXMLColorScaleFormatContext( ScXMLImport& rImport, sal_uInt16 nPrfx, @@ -444,11 +436,9 @@ void setColorEntryType(const rtl::OUString& rType, ScColorScaleEntry* pEntry, co pEntry->SetFormula(rFormula, rImport.GetDocument(), ScAddress(0,0,rImport.GetTables().GetCurrentSheet()), formula::FormulaGrammar::GRAM_ODFF); } else if(rType == "auto-minimum") - pEntry->SetType(COLORSCALE_AUTOMIN); + pEntry->SetType(COLORSCALE_AUTO); else if(rType == "auto-maximum") - pEntry->SetType(COLORSCALE_AUTOMAX); - - //TODO: add formulas + pEntry->SetType(COLORSCALE_AUTO); } } diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index a9eaf1b30960..46d35bf8c35c 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -2021,7 +2021,7 @@ void ScXMLExport::AddStyleFromRow(const uno::Reference<beans::XPropertySet>& xRo } } -uno::Any lcl_GetEnumerated( uno::Reference<container::XEnumerationAccess> xEnumAccess, sal_Int32 nIndex ) +static uno::Any lcl_GetEnumerated( uno::Reference<container::XEnumerationAccess> xEnumAccess, sal_Int32 nIndex ) { uno::Any aRet; uno::Reference<container::XEnumeration> xEnum( xEnumAccess->createEnumeration() ); @@ -3784,7 +3784,7 @@ void ScXMLExport::WriteNamedRange(ScRangeName* pRangeName) namespace { -rtl::OUString getCondFormatEntryType(const ScColorScaleEntry& rEntry) +rtl::OUString getCondFormatEntryType(const ScColorScaleEntry& rEntry, bool bFirst = true) { switch(rEntry.GetType()) { @@ -3800,10 +3800,12 @@ rtl::OUString getCondFormatEntryType(const ScColorScaleEntry& rEntry) return rtl::OUString("formula"); case COLORSCALE_VALUE: return rtl::OUString("number"); - case COLORSCALE_AUTOMIN: - return rtl::OUString("auto-minimum"); - case COLORSCALE_AUTOMAX: - return rtl::OUString("auto-maximum"); + case COLORSCALE_AUTO: + // only important for data bars + if(bFirst) + return rtl::OUString("auto-minimum"); + else + return rtl::OUString("auto-maximum"); } return rtl::OUString(); } @@ -3977,7 +3979,7 @@ void ScXMLExport::ExportConditionalFormat(SCTAB nTab) } else AddAttribute(XML_NAMESPACE_CALC_EXT, XML_VALUE, rtl::OUString::valueOf(pFormatData->mpLowerLimit->GetValue())); - AddAttribute(XML_NAMESPACE_CALC_EXT, XML_TYPE, getCondFormatEntryType(*pFormatData->mpLowerLimit)); + AddAttribute(XML_NAMESPACE_CALC_EXT, XML_TYPE, getCondFormatEntryType(*pFormatData->mpLowerLimit, true)); SvXMLElementExport aElementDataBarEntryLower(*this, XML_NAMESPACE_CALC_EXT, XML_DATA_BAR_ENTRY, true, true); } @@ -3989,7 +3991,7 @@ void ScXMLExport::ExportConditionalFormat(SCTAB nTab) } else AddAttribute(XML_NAMESPACE_CALC_EXT, XML_VALUE, rtl::OUString::valueOf(pFormatData->mpUpperLimit->GetValue())); - AddAttribute(XML_NAMESPACE_CALC_EXT, XML_TYPE, getCondFormatEntryType(*pFormatData->mpUpperLimit)); + AddAttribute(XML_NAMESPACE_CALC_EXT, XML_TYPE, getCondFormatEntryType(*pFormatData->mpUpperLimit, false)); SvXMLElementExport aElementDataBarEntryUpper(*this, XML_NAMESPACE_CALC_EXT, XML_DATA_BAR_ENTRY, true, true); } } diff --git a/sc/source/filter/xml/xmlstyli.cxx b/sc/source/filter/xml/xmlstyli.cxx index 687c841b27b4..bb054377c104 100644 --- a/sc/source/filter/xml/xmlstyli.cxx +++ b/sc/source/filter/xml/xmlstyli.cxx @@ -454,28 +454,19 @@ void XMLTableStyleContext::ApplyCondFormat( uno::Sequence<table::CellRangeAddres rRangeList.Join(*pRange); } - ScPatternAttr aPattern( pDoc->GetPool() ); - aPattern.GetItemSet().Put( SfxUInt32Item( ATTR_CONDITIONAL, nCondId ) ); - ScMarkData aMarkData; - aMarkData.MarkFromRangeList(aRangeList, true); - pDoc->ApplySelectionPattern( aPattern , aMarkData); - - break; + pDoc->AddCondFormatData( aRangeList, nTab, nCondId ); + return; } } - if(mpCondFormat) + if(mpCondFormat && mbDeleteCondFormat) { - mbDeleteCondFormat = false; sal_uLong nIndex = pDoc->AddCondFormat(mpCondFormat, nTab ); mpCondFormat->SetKey(nIndex); mpCondFormat->AddRange(aRangeList); - ScPatternAttr aPattern( pDoc->GetPool() ); - aPattern.GetItemSet().Put( SfxUInt32Item( ATTR_CONDITIONAL, nIndex ) ); - ScMarkData aMarkData; - aMarkData.MarkFromRangeList(aRangeList, true); - pDoc->ApplySelectionPattern( aPattern , aMarkData); + pDoc->AddCondFormatData( aRangeList, nTab, nIndex ); + mbDeleteCondFormat = false; } diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx index acbc1fa4380d..4d513fe3ce83 100644 --- a/sc/source/filter/xml/xmlwrap.cxx +++ b/sc/source/filter/xml/xmlwrap.cxx @@ -44,7 +44,7 @@ #include <com/sun/star/xml/sax/XEntityResolver.hpp> #include <com/sun/star/xml/sax/InputSource.hpp> #include <com/sun/star/xml/sax/XDTDHandler.hpp> -#include <com/sun/star/xml/sax/XParser.hpp> +#include <com/sun/star/xml/sax/Parser.hpp> #include <com/sun/star/io/XActiveDataSource.hpp> #include <com/sun/star/io/XActiveDataControl.hpp> #include <com/sun/star/frame/XModel.hpp> @@ -110,7 +110,7 @@ uno::Reference <task::XStatusIndicator> ScXMLImportWrapper::GetStatusIndicator() } sal_uInt32 ScXMLImportWrapper::ImportFromComponent(uno::Reference<lang::XMultiServiceFactory>& xServiceFactory, - uno::Reference<frame::XModel>& xModel, uno::Reference<uno::XInterface>& xXMLParser, + uno::Reference<frame::XModel>& xModel, uno::Reference<xml::sax::XParser>& xParser, xml::sax::InputSource& aParserInput, const rtl::OUString& sComponentName, const rtl::OUString& sDocName, const rtl::OUString& sOldDocName, uno::Sequence<uno::Any>& aArgs, @@ -184,7 +184,6 @@ sal_uInt32 ScXMLImportWrapper::ImportFromComponent(uno::Reference<lang::XMultiSe xImporter->setTargetDocument( xComponent ); // connect parser and filter - uno::Reference<xml::sax::XParser> xParser( xXMLParser, uno::UNO_QUERY ); xParser->setDocumentHandler( xDocHandler ); try @@ -325,6 +324,7 @@ sal_Bool ScXMLImportWrapper::Import(sal_Bool bStylesOnly, ErrCode& nError) uno::Reference<lang::XMultiServiceFactory> xServiceFactory = comphelper::getProcessServiceFactory(); + uno::Reference<uno::XComponentContext> xContext = comphelper::getProcessComponentContext(); OSL_ENSURE( xServiceFactory.is(), "got no service manager" ); if( !xServiceFactory.is() ) return false; @@ -337,12 +337,7 @@ sal_Bool ScXMLImportWrapper::Import(sal_Bool bStylesOnly, ErrCode& nError) xStorage = pMedium->GetStorage(); // get parser - uno::Reference<uno::XInterface> xXMLParser( - xServiceFactory->createInstance( - OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.xml.sax.Parser" )) )); - OSL_ENSURE( xXMLParser.is(), "com.sun.star.xml.sax.Parser service missing" ); - if( !xXMLParser.is() ) - return false; + uno::Reference<xml::sax::XParser> xXMLParser = xml::sax::Parser::create(xContext); // get filter SfxObjectShell* pObjSh = rDoc.GetDocumentShell(); @@ -607,7 +602,7 @@ sal_Bool ScXMLImportWrapper::Import(sal_Bool bStylesOnly, ErrCode& nError) return false; } -bool lcl_HasValidStream(ScDocument& rDoc) +static bool lcl_HasValidStream(ScDocument& rDoc) { SfxObjectShell* pObjSh = rDoc.GetDocumentShell(); if ( pObjSh->IsDocShared() ) diff --git a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx index febd32795a25..ffc45d9f8034 100644 --- a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx +++ b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx @@ -80,8 +80,6 @@ const sal_uInt16 nRulerRole = AccessibleRole::TEXT; const sal_uInt16 nGridRole = AccessibleRole::TABLE; const sal_uInt16 nCellRole = AccessibleRole::TEXT; -#define CREATE_OUSTRING( name ) OUString( RTL_CONSTASCII_USTRINGPARAM( name ) ) - #define RULER_IMPL_NAME "ScAccessibleCsvRuler" #define GRID_IMPL_NAME "ScAccessibleCsvGrid" #define CELL_IMPL_NAME "ScAccessibleCsvCell" @@ -286,7 +284,7 @@ Point ScAccessibleCsvControl::implGetAbsPos( const Point& rPos ) const // Ruler ====================================================================== /** Converts a ruler cursor position to API text index. */ -sal_Int32 lcl_GetApiPos( sal_Int32 nRulerPos ) +static sal_Int32 lcl_GetApiPos( sal_Int32 nRulerPos ) { sal_Int32 nApiPos = nRulerPos; sal_Int32 nStart = (nRulerPos - 1) / 10; @@ -300,7 +298,7 @@ sal_Int32 lcl_GetApiPos( sal_Int32 nRulerPos ) } /** Converts an API text index to a ruler cursor position. */ -sal_Int32 lcl_GetRulerPos( sal_Int32 nApiPos ) +static sal_Int32 lcl_GetRulerPos( sal_Int32 nApiPos ) { sal_Int32 nDiv = 10; sal_Int32 nExp = 10; @@ -320,7 +318,7 @@ sal_Int32 lcl_GetRulerPos( sal_Int32 nApiPos ) } /** Expands the sequence's size and returns the base index of the new inserted elements. */ -inline sal_Int32 lcl_ExpandSequence( Sequence< PropertyValue >& rSeq, sal_Int32 nExp ) +static inline sal_Int32 lcl_ExpandSequence( Sequence< PropertyValue >& rSeq, sal_Int32 nExp ) { OSL_ENSURE( nExp > 0, "lcl_ExpandSequence - invalid value" ); rSeq.realloc( rSeq.getLength() + nExp ); @@ -328,27 +326,27 @@ inline sal_Int32 lcl_ExpandSequence( Sequence< PropertyValue >& rSeq, sal_Int32 } /** Fills the property value rVal with the specified name and value from the item. */ -inline void lcl_FillProperty( PropertyValue& rVal, const OUString& rPropName, const SfxPoolItem& rItem, sal_uInt8 nMID ) +static inline void lcl_FillProperty( PropertyValue& rVal, const OUString& rPropName, const SfxPoolItem& rItem, sal_uInt8 nMID ) { rVal.Name = rPropName; rItem.QueryValue( rVal.Value, nMID ); } /** Fills the sequence with all font attributes of rFont. */ -void lcl_FillFontAttributes( Sequence< PropertyValue >& rSeq, const Font& rFont ) +static void lcl_FillFontAttributes( Sequence< PropertyValue >& rSeq, const Font& rFont ) { SvxFontItem aFontItem( rFont.GetFamily(), rFont.GetName(), rFont.GetStyleName(), rFont.GetPitch(), rFont.GetCharSet(), ATTR_FONT ); SvxFontHeightItem aHeightItem( rFont.GetSize().Height(), 100, ATTR_FONT_HEIGHT ); SvxLanguageItem aLangItem( rFont.GetLanguage(), ATTR_FONT_LANGUAGE ); sal_Int32 nIndex = lcl_ExpandSequence( rSeq, 7 ); - lcl_FillProperty( rSeq[ nIndex++ ], CREATE_OUSTRING( "CharFontName" ), aFontItem, MID_FONT_FAMILY_NAME ); - lcl_FillProperty( rSeq[ nIndex++ ], CREATE_OUSTRING( "CharFontFamily" ), aFontItem, MID_FONT_FAMILY ); - lcl_FillProperty( rSeq[ nIndex++ ], CREATE_OUSTRING( "CharFontStyleName" ), aFontItem, MID_FONT_STYLE_NAME ); - lcl_FillProperty( rSeq[ nIndex++ ], CREATE_OUSTRING( "CharFontCharSet" ), aFontItem, MID_FONT_PITCH ); - lcl_FillProperty( rSeq[ nIndex++ ], CREATE_OUSTRING( "CharFontPitch" ), aFontItem, MID_FONT_CHAR_SET ); - lcl_FillProperty( rSeq[ nIndex++ ], CREATE_OUSTRING( "CharHeight" ), aHeightItem, MID_FONTHEIGHT ); - lcl_FillProperty( rSeq[ nIndex++ ], CREATE_OUSTRING( "CharLocale" ), aLangItem, MID_LANG_LOCALE ); + lcl_FillProperty( rSeq[ nIndex++ ], "CharFontName", aFontItem, MID_FONT_FAMILY_NAME ); + lcl_FillProperty( rSeq[ nIndex++ ], "CharFontFamily", aFontItem, MID_FONT_FAMILY ); + lcl_FillProperty( rSeq[ nIndex++ ], "CharFontStyleName", aFontItem, MID_FONT_STYLE_NAME ); + lcl_FillProperty( rSeq[ nIndex++ ], "CharFontCharSet", aFontItem, MID_FONT_PITCH ); + lcl_FillProperty( rSeq[ nIndex++ ], "CharFontPitch", aFontItem, MID_FONT_CHAR_SET ); + lcl_FillProperty( rSeq[ nIndex++ ], "CharHeight", aHeightItem, MID_FONTHEIGHT ); + lcl_FillProperty( rSeq[ nIndex++ ], "CharLocale", aLangItem, MID_LANG_LOCALE ); } @@ -757,7 +755,7 @@ void SAL_CALL ScAccessibleCsvRuler::release() throw () OUString SAL_CALL ScAccessibleCsvRuler::getImplementationName() throw( RuntimeException ) { - return CREATE_OUSTRING( RULER_IMPL_NAME ); + return OUString( RULER_IMPL_NAME ); } @@ -887,13 +885,13 @@ sal_Int32 ScAccessibleCsvRuler::implGetLastEqualFormatted( sal_Int32 nApiPos ) // Grid ======================================================================= /** Converts a grid columnm index to an API column index. */ -inline sal_Int32 lcl_GetApiColumn( sal_uInt32 nGridColumn ) +static inline sal_Int32 lcl_GetApiColumn( sal_uInt32 nGridColumn ) { return (nGridColumn != CSV_COLUMN_HEADER) ? static_cast< sal_Int32 >( nGridColumn + 1 ) : 0; } /** Converts an API columnm index to a ScCsvGrid column index. */ -inline sal_uInt32 lcl_GetGridColumn( sal_Int32 nApiColumn ) +static inline sal_uInt32 lcl_GetGridColumn( sal_Int32 nApiColumn ) { return (nApiColumn > 0) ? static_cast< sal_uInt32 >( nApiColumn - 1 ) : CSV_COLUMN_HEADER; } @@ -1267,7 +1265,7 @@ void SAL_CALL ScAccessibleCsvGrid::release() throw () OUString SAL_CALL ScAccessibleCsvGrid::getImplementationName() throw( RuntimeException ) { - return CREATE_OUSTRING( GRID_IMPL_NAME ); + return OUString( GRID_IMPL_NAME ); } @@ -1564,7 +1562,7 @@ IMPLEMENT_FORWARD_XTYPEPROVIDER2( ScAccessibleCsvCell, ScAccessibleCsvControl, A OUString SAL_CALL ScAccessibleCsvCell::getImplementationName() throw( RuntimeException ) { - return CREATE_OUSTRING( CELL_IMPL_NAME ); + return OUString( CELL_IMPL_NAME ); } // helpers -------------------------------------------------------------------- diff --git a/sc/source/ui/app/drwtrans.cxx b/sc/source/ui/app/drwtrans.cxx index a78afe7bd998..b8647d4cab1c 100644 --- a/sc/source/ui/app/drwtrans.cxx +++ b/sc/source/ui/app/drwtrans.cxx @@ -658,7 +658,7 @@ void ScDrawTransferObj::SetDrawPersist( const SfxObjectShellRef& rRef ) aDrawPersistRef = rRef; } -void lcl_InitMarks( SdrMarkView& rDest, const SdrMarkView& rSource, SCTAB nTab ) +static void lcl_InitMarks( SdrMarkView& rDest, const SdrMarkView& rSource, SCTAB nTab ) { rDest.ShowSdrPage(rDest.GetModel()->GetPage(nTab)); SdrPageView* pDestPV = rDest.GetSdrPageView(); diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 78fd03e5c3ea..9b92164efb95 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -308,7 +308,7 @@ handle_r1c1: } } -void lcl_Replace( EditView* pView, const String& rNewStr, const ESelection& rOldSel ) +static void lcl_Replace( EditView* pView, const String& rNewStr, const ESelection& rOldSel ) { if ( pView ) { @@ -394,12 +394,12 @@ inline String GetEditText(EditEngine* pEng) return ScEditUtil::GetSpaceDelimitedString(*pEng); } -void lcl_RemoveTabs(rtl::OUString& rStr) +static void lcl_RemoveTabs(rtl::OUString& rStr) { removeChars(rStr, sal_Unicode('\t')); } -void lcl_RemoveLineEnd(rtl::OUString& rStr) +static void lcl_RemoveLineEnd(rtl::OUString& rStr) { rStr = convertLineEnd(rStr, LINEEND_LF); removeChars(rStr, sal_Unicode('\n')); @@ -1237,7 +1237,7 @@ void ScInputHandler::NextFormulaEntry( bool bBack ) pActiveView->ShowCursor(); } -void lcl_CompleteFunction( EditView* pView, const String& rInsert, bool& rParInserted ) +static void lcl_CompleteFunction( EditView* pView, const String& rInsert, bool& rParInserted ) { if (pView) { @@ -1309,7 +1309,7 @@ void ScInputHandler::PasteFunctionData() // Selektion berechnen und als Tip-Hilfe anzeigen // -String lcl_Calculate( const String& rFormula, ScDocument* pDoc, const ScAddress &rPos ) +static String lcl_Calculate( const String& rFormula, ScDocument* pDoc, const ScAddress &rPos ) { //! mit ScFormulaDlg::CalcValue zusammenfassen und ans Dokument verschieben !!!! //! (Anfuehrungszeichen bei Strings werden nur hier eingefuegt) @@ -2098,7 +2098,7 @@ bool ScInputHandler::StartTable( sal_Unicode cTyped, bool bFromCommand, bool bIn return bNewTable; } -void lcl_SetTopSelection( EditView* pEditView, ESelection& rSel ) +static void lcl_SetTopSelection( EditView* pEditView, ESelection& rSel ) { OSL_ENSURE( rSel.nStartPara==0 && rSel.nEndPara==0, "SetTopSelection: Para != 0" ); @@ -2454,7 +2454,7 @@ void ScInputHandler::SetMode( ScInputMode eNewMode ) // lcl_IsNumber - true, wenn nur Ziffern (dann keine Autokorrektur) -bool lcl_IsNumber(const String& rString) +static bool lcl_IsNumber(const String& rString) { xub_StrLen nLen = rString.Len(); for (xub_StrLen i=0; i<nLen; i++) @@ -2466,7 +2466,7 @@ bool lcl_IsNumber(const String& rString) return true; } -void lcl_SelectionToEnd( EditView* pView ) +static void lcl_SelectionToEnd( EditView* pView ) { if ( pView ) { diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index 37346de866a7..ba20b96abab3 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -159,7 +159,7 @@ SfxChildWinInfo ScInputWindowWrapper::GetInfo() const //================================================================== #define IMAGE(id) pImgMgr->SeekImage(id) -bool lcl_isExperimentalMode() +static bool lcl_isExperimentalMode() { // make inputbar feature on by default, leave the switch for the // moment in case we need to back it out easily @@ -170,7 +170,7 @@ bool lcl_isExperimentalMode() // class ScInputWindow //================================================================== -ScTextWndBase* lcl_chooseRuntimeImpl( Window* pParent, SfxBindings* pBind ) +static ScTextWndBase* lcl_chooseRuntimeImpl( Window* pParent, SfxBindings* pBind ) { ScTabViewShell* pViewSh = NULL; SfxDispatcher* pDisp = pBind->GetDispatcher(); @@ -1291,7 +1291,7 @@ void ScMultiTextWnd::StartEditEngine() pViewFrm->GetBindings().Invalidate( SID_ATTR_INSERT ); } -void lcl_ExtendEditFontAttribs( SfxItemSet& rSet ) +static void lcl_ExtendEditFontAttribs( SfxItemSet& rSet ) { const SfxPoolItem& rFontItem = rSet.Get( EE_CHAR_FONTINFO ); rSet.Put( rFontItem, EE_CHAR_FONTINFO_CJK ); @@ -1310,7 +1310,7 @@ void lcl_ExtendEditFontAttribs( SfxItemSet& rSet ) rSet.Put( rLangItem, EE_CHAR_LANGUAGE_CTL ); } -void lcl_ModifyRTLDefaults( SfxItemSet& rSet ) +static void lcl_ModifyRTLDefaults( SfxItemSet& rSet ) { rSet.Put( SvxAdjustItem( SVX_ADJUST_RIGHT, EE_PARA_JUST ) ); @@ -1325,7 +1325,7 @@ void lcl_ModifyRTLDefaults( SfxItemSet& rSet ) rSet.Put( aItem ); } -void lcl_ModifyRTLVisArea( EditView* pEditView ) +static void lcl_ModifyRTLVisArea( EditView* pEditView ) { Rectangle aVisArea = pEditView->GetVisArea(); Size aPaper = pEditView->GetEditEngine()->GetPaperSize(); @@ -2231,7 +2231,7 @@ void ScPosWnd::HideTip() } } -ScNameInputType lcl_GetInputType( const String& rText ) +static ScNameInputType lcl_GetInputType( const String& rText ) { ScNameInputType eRet = SC_NAME_INPUT_BAD_NAME; // the more general error diff --git a/sc/source/ui/app/scdll.cxx b/sc/source/ui/app/scdll.cxx index 651b46a1bce9..6d567128a1ac 100644 --- a/sc/source/ui/app/scdll.cxx +++ b/sc/source/ui/app/scdll.cxx @@ -258,7 +258,10 @@ void ScDLL::Init() ScSolverDlgWrapper ::RegisterChildWindow(false, pMod); ScOptSolverDlgWrapper ::RegisterChildWindow(false, pMod); ScNameDlgWrapper ::RegisterChildWindow(false, pMod); - ScNameDefDlgWrapper ::RegisterChildWindow(false, pMod); + ScNameDefDlgWrapper ::RegisterChildWindow(false, pMod); + ScCondFormatConditionDlgWrapper ::RegisterChildWindow(false, pMod); + ScCondFormatColorScaleDlgWrapper ::RegisterChildWindow(false, pMod); + ScCondFormatDataBarDlgWrapper ::RegisterChildWindow(false, pMod); ScPivotLayoutWrapper ::RegisterChildWindow(false, pMod); ScTabOpDlgWrapper ::RegisterChildWindow(false, pMod); ScFilterDlgWrapper ::RegisterChildWindow(false, pMod); diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx index 294ac6e64565..2b74872eafb8 100644 --- a/sc/source/ui/app/scmod.cxx +++ b/sc/source/ui/app/scmod.cxx @@ -1615,7 +1615,7 @@ void ScModule::SetRefDialog( sal_uInt16 nId, sal_Bool bVis, SfxViewFrame* pViewF } } -SfxChildWindow* lcl_GetChildWinFromAnyView( sal_uInt16 nId ) +static SfxChildWindow* lcl_GetChildWinFromAnyView( sal_uInt16 nId ) { // first try the current view @@ -1747,7 +1747,7 @@ sal_Bool ScModule::IsFormulaMode() return bIsFormula; } -void lcl_MarkedTabs( const ScMarkData& rMark, SCTAB& rStartTab, SCTAB& rEndTab ) +static void lcl_MarkedTabs( const ScMarkData& rMark, SCTAB& rStartTab, SCTAB& rEndTab ) { if (rMark.GetSelectCount() > 1) { @@ -1862,7 +1862,7 @@ void ScModule::AnythingChanged() nIdleCount = 0; } -void lcl_CheckNeedsRepaint( ScDocShell* pDocShell ) +static void lcl_CheckNeedsRepaint( ScDocShell* pDocShell ) { SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDocShell ); while ( pFrame ) diff --git a/sc/source/ui/app/seltrans.cxx b/sc/source/ui/app/seltrans.cxx index c514d0f8e179..aefa0fc131a6 100644 --- a/sc/source/ui/app/seltrans.cxx +++ b/sc/source/ui/app/seltrans.cxx @@ -50,7 +50,7 @@ using namespace com::sun::star; // ----------------------------------------------------------------------- -sal_Bool lcl_IsURLButton( SdrObject* pObject ) +static sal_Bool lcl_IsURLButton( SdrObject* pObject ) { sal_Bool bRet = false; @@ -325,9 +325,6 @@ void ScSelectionTransferObj::CreateCellData() OSL_ENSURE( pCellData, "can't create CellData" ); } -//! make static member of ScDrawView -extern void lcl_CheckOle( const SdrMarkList& rMarkList, sal_Bool& rAnyOle, sal_Bool& rOneOle ); - void ScSelectionTransferObj::CreateDrawData() { OSL_ENSURE( !pDrawData, "CreateDrawData twice" ); @@ -340,7 +337,7 @@ void ScSelectionTransferObj::CreateDrawData() { sal_Bool bAnyOle, bOneOle; const SdrMarkList& rMarkList = pDrawView->GetMarkedObjectList(); - lcl_CheckOle( rMarkList, bAnyOle, bOneOle ); + ScDrawView::CheckOle( rMarkList, bAnyOle, bOneOle ); //--------------------------------------------------------- ScDocShellRef aDragShellRef; diff --git a/sc/source/ui/attrdlg/scabstdlg.cxx b/sc/source/ui/attrdlg/scabstdlg.cxx index 98b0efae6515..654fb76df9b4 100644 --- a/sc/source/ui/attrdlg/scabstdlg.cxx +++ b/sc/source/ui/attrdlg/scabstdlg.cxx @@ -36,10 +36,19 @@ using ::rtl::OUStringBuffer; typedef ScAbstractDialogFactory* (__LOADONCALLAPI *ScFuncPtrCreateDialogFactory)(); +#ifndef DISABLE_DYNLOADING + extern "C" { static void SAL_CALL thisModule() {} } +#else + +extern "C" ScAbstractDialogFactory* ScCreateDialogFactory(); + +#endif + ScAbstractDialogFactory* ScAbstractDialogFactory::Create() { +#ifndef DISABLE_DYNLOADING ScFuncPtrCreateDialogFactory fp = 0; static ::osl::Module aDialogLibrary; @@ -53,6 +62,9 @@ ScAbstractDialogFactory* ScAbstractDialogFactory::Create() if ( fp ) return fp(); return 0; +#else + return ScCreateDialogFactory(); +#endif } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx index 4dd4bc38352e..a23d0edf3f8f 100644 --- a/sc/source/ui/attrdlg/scdlgfact.cxx +++ b/sc/source/ui/attrdlg/scdlgfact.cxx @@ -86,13 +86,11 @@ // ause #include "editutil.hxx" -IMPL_ABSTDLG_BASE(VclAbstractDialog_Impl); +IMPL_ABSTDLG_BASE(ScVclAbstractDialog_Impl); IMPL_ABSTDLG_BASE(AbstractScImportAsciiDlg_Impl); IMPL_ABSTDLG_BASE(AbstractScAutoFormatDlg_Impl); IMPL_ABSTDLG_BASE(AbstractScColRowLabelDlg_Impl); -IMPL_ABSTDLG_BASE(AbstractScCondFormatDlg_Impl); IMPL_ABSTDLG_BASE(AbstractScCondFormatManagerDlg_Impl); -IMPL_ABSTDLG_BASE(AbstractScDataBarSettingsDlg_Impl); IMPL_ABSTDLG_BASE(AbstractScDataPilotDatabaseDlg_Impl); IMPL_ABSTDLG_BASE(AbstractScDataPilotSourceTypeDlg_Impl); IMPL_ABSTDLG_BASE(AbstractScDataPilotServiceDlg_Impl); @@ -123,34 +121,34 @@ IMPL_ABSTDLG_BASE(AbstractScStringInputDlg_Impl); IMPL_ABSTDLG_BASE(AbstractScTabBgColorDlg_Impl); IMPL_ABSTDLG_BASE(AbstractScImportOptionsDlg_Impl); IMPL_ABSTDLG_BASE(AbstractScTextImportOptionsDlg_Impl); -IMPL_ABSTDLG_BASE(AbstractTabDialog_Impl); +IMPL_ABSTDLG_BASE(ScAbstractTabDialog_Impl); -// AbstractTabDialog_Impl begin -void AbstractTabDialog_Impl::SetCurPageId( sal_uInt16 nId ) +// ScAbstractTabDialog_Impl begin +void ScAbstractTabDialog_Impl::SetCurPageId( sal_uInt16 nId ) { pDlg->SetCurPageId( nId ); } -const SfxItemSet* AbstractTabDialog_Impl::GetOutputItemSet() const +const SfxItemSet* ScAbstractTabDialog_Impl::GetOutputItemSet() const { return pDlg->GetOutputItemSet(); } -const sal_uInt16* AbstractTabDialog_Impl::GetInputRanges(const SfxItemPool& pItem ) +const sal_uInt16* ScAbstractTabDialog_Impl::GetInputRanges(const SfxItemPool& pItem ) { return pDlg->GetInputRanges( pItem ); } -void AbstractTabDialog_Impl::SetInputSet( const SfxItemSet* pInSet ) +void ScAbstractTabDialog_Impl::SetInputSet( const SfxItemSet* pInSet ) { pDlg->SetInputSet( pInSet ); } //From class Window. -void AbstractTabDialog_Impl::SetText( const XubString& rStr ) +void ScAbstractTabDialog_Impl::SetText( const XubString& rStr ) { pDlg->SetText( rStr ); } -String AbstractTabDialog_Impl::GetText() const +String ScAbstractTabDialog_Impl::GetText() const { return pDlg->GetText(); } @@ -452,14 +450,14 @@ sal_uLong AbstractScLinkedAreaDlg_Impl::GetRefresh() } -ScConditionalFormat* AbstractScCondFormatDlg_Impl::GetConditionalFormat() +ScConditionalFormatList* AbstractScCondFormatManagerDlg_Impl::GetConditionalFormatList() { - return pDlg->GetConditionalFormat(); + return pDlg->GetConditionalFormatList(); } -ScConditionalFormatList* AbstractScCondFormatManagerDlg_Impl::GetConditionalFormatList() +bool AbstractScCondFormatManagerDlg_Impl::CondFormatsChanged() { - return pDlg->GetConditionalFormatList(); + return pDlg->CondFormatsChanged(); } @@ -752,7 +750,7 @@ VclAbstractDialog * ScAbstractDialogFactory_Impl::CreateScColOrRowDlg(Window* } if ( pDlg ) - return new VclAbstractDialog_Impl( pDlg ); + return new ScVclAbstractDialog_Impl( pDlg ); return 0; } @@ -771,29 +769,11 @@ VclAbstractDialog * ScAbstractDialogFactory_Impl::CreateScSortWarningDlg( Window break; } if( pDlg ) - return new VclAbstractDialog_Impl( pDlg ); + return new ScVclAbstractDialog_Impl( pDlg ); return 0; } -AbstractScCondFormatDlg* ScAbstractDialogFactory_Impl::CreateScCondFormatDlg(Window* pParent, ScDocument* pDoc, const ScConditionalFormat* pFormat, - const ScRangeList& rRange, const ScAddress& rPos, int nId) -{ - ScCondFormatDlg* pDlg = NULL; - switch( nId ) - { - case RID_SCDLG_CONDFORMAT: - pDlg = new ScCondFormatDlg( pParent, pDoc, pFormat, rRange, rPos ); - break; - default: - break; - } - if(pDlg) - return new AbstractScCondFormatDlg_Impl( pDlg ); - - return NULL; -} - AbstractScCondFormatManagerDlg* ScAbstractDialogFactory_Impl::CreateScCondFormatMgrDlg(Window* pParent, ScDocument* pDoc, const ScConditionalFormatList* pFormatList, const ScAddress& rPos, int nId ) { @@ -812,24 +792,6 @@ AbstractScCondFormatManagerDlg* ScAbstractDialogFactory_Impl::CreateScCondFormat return NULL; } -AbstractScDataBarSettingsDlg* ScAbstractDialogFactory_Impl::CreateScDataBarSetttingsDlg(Window* pParent, ScDocument* pDoc, int nId) -{ - ScDataBarSettingsDlg* pDlg = NULL; - switch( nId ) - { - case RID_SCDLG_DATABAR: - pDlg = new ScDataBarSettingsDlg( pParent, pDoc ); - break; - default: - break; - } - if(pDlg) - return new AbstractScDataBarSettingsDlg_Impl( pDlg ); - - return NULL; -} - - AbstractScDataPilotDatabaseDlg * ScAbstractDialogFactory_Impl::CreateScDataPilotDatabaseDlg (Window* pParent , int nId ) { @@ -1442,13 +1404,13 @@ SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScAttrDlg( SfxViewFra } if ( pDlg ) - return new AbstractTabDialog_Impl( pDlg ); + return new ScAbstractTabDialog_Impl( pDlg ); return 0; } #undef SfxTabDialog -#undef AbstractTabDialog_Impl +#undef ScAbstractTabDialog_Impl SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScHFEditDlg( SfxViewFrame* pFrame, @@ -1469,7 +1431,7 @@ SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScHFEditDlg( SfxViewF } if ( pDlg ) - return new AbstractTabDialog_Impl( pDlg ); + return new ScAbstractTabDialog_Impl( pDlg ); return 0; } @@ -1492,7 +1454,7 @@ SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScStyleDlg( Window* } if ( pDlg ) - return new AbstractTabDialog_Impl( pDlg ); + return new ScAbstractTabDialog_Impl( pDlg ); return 0; } @@ -1513,7 +1475,7 @@ SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScSubTotalDlg( Window } if ( pDlg ) - return new AbstractTabDialog_Impl( pDlg ); + return new ScAbstractTabDialog_Impl( pDlg ); return 0; } @@ -1533,7 +1495,7 @@ SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScCharDlg( Window* pP } if ( pDlg ) - return new AbstractTabDialog_Impl( pDlg ); + return new ScAbstractTabDialog_Impl( pDlg ); return 0; } @@ -1553,7 +1515,7 @@ SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScParagraphDlg( Windo } if ( pDlg ) - return new AbstractTabDialog_Impl( pDlg ); + return new ScAbstractTabDialog_Impl( pDlg ); return 0; } @@ -1573,7 +1535,7 @@ SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScValidationDlg( Wind } if ( pDlg ) - return new AbstractTabDialog_Impl( pDlg ); + return new ScAbstractTabDialog_Impl( pDlg ); return 0; } @@ -1592,11 +1554,11 @@ SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScSortDlg( Window* } if ( pDlg ) - return new AbstractTabDialog_Impl( pDlg ); + return new ScAbstractTabDialog_Impl( pDlg ); return 0; } #undef SfxTabDialog -#undef AbstractTabDialog_Impl +#undef ScAbstractTabDialog_Impl //------------------ Factories for TabPages-------------------- diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx index b4c6ddcd0bca..dfbd7fd272c7 100644 --- a/sc/source/ui/attrdlg/scdlgfact.hxx +++ b/sc/source/ui/attrdlg/scdlgfact.hxx @@ -63,8 +63,6 @@ class ScTabBgColorDlg; class ScImportOptionsDlg; class SfxTabDialog; class ScTextImportOptionsDlg; -class ScDataBarSettingsDlg; -class ScCondFormatDlg; class ScCondFormatManagerDlg; #define DECL_ABSTDLG_BASE(Class,DialogClass) \ @@ -110,9 +108,9 @@ long Class::GetResult() \ return pDlg->GetResult(); \ } -class VclAbstractDialog_Impl : public VclAbstractDialog //add for ScColOrRowDlg +class ScVclAbstractDialog_Impl : public VclAbstractDialog //add for ScColOrRowDlg { - DECL_ABSTDLG_BASE(VclAbstractDialog_Impl,Dialog) + DECL_ABSTDLG_BASE(ScVclAbstractDialog_Impl,Dialog) }; class AbstractScImportAsciiDlg_Impl : public AbstractScImportAsciiDlg //add for ScImportAsciiDlg @@ -136,23 +134,13 @@ class AbstractScColRowLabelDlg_Impl : public AbstractScColRowLabelDlg //add for virtual sal_Bool IsRow(); }; -class AbstractScCondFormatDlg_Impl : public AbstractScCondFormatDlg -{ - DECL_ABSTDLG_BASE(AbstractScCondFormatDlg_Impl, ScCondFormatDlg) - - virtual ScConditionalFormat* GetConditionalFormat(); -}; - class AbstractScCondFormatManagerDlg_Impl : public AbstractScCondFormatManagerDlg { DECL_ABSTDLG_BASE(AbstractScCondFormatManagerDlg_Impl, ScCondFormatManagerDlg) virtual ScConditionalFormatList* GetConditionalFormatList(); -}; -class AbstractScDataBarSettingsDlg_Impl : public AbstractScDataBarSettingsDlg -{ - DECL_ABSTDLG_BASE(AbstractScDataBarSettingsDlg_Impl, ScDataBarSettingsDlg) + virtual bool CondFormatsChanged(); }; class AbstractScDataPilotDatabaseDlg_Impl :public AbstractScDataPilotDatabaseDlg //add for ScDataPilotDatabaseDlg @@ -390,9 +378,9 @@ class AbstractScTextImportOptionsDlg_Impl : public AbstractScTextImportOptionsDl }; //add for ScAttrDlg , ScHFEditDlg, ScStyleDlg, ScSubTotalDlg, ScCharDlg, ScParagraphDlg, ScValidationDlg, ScSortDlg -class AbstractTabDialog_Impl : public SfxAbstractTabDialog +class ScAbstractTabDialog_Impl : public SfxAbstractTabDialog { - DECL_ABSTDLG_BASE( AbstractTabDialog_Impl,SfxTabDialog ) + DECL_ABSTDLG_BASE( ScAbstractTabDialog_Impl,SfxTabDialog ) virtual void SetCurPageId( sal_uInt16 nId ); virtual const SfxItemSet* GetOutputItemSet() const; virtual const sal_uInt16* GetInputRanges( const SfxItemPool& pItem ); @@ -433,14 +421,9 @@ public: virtual VclAbstractDialog * CreateScSortWarningDlg( Window* pParent, const String& rExtendText, const String& rCurrentText, int nId ); - virtual AbstractScCondFormatDlg* CreateScCondFormatDlg(Window* pParent, ScDocument* pDoc, const ScConditionalFormat* pFormat, - const ScRangeList& rRange, const ScAddress& rPos, int nId ); //add for ScDataBarSettingsDlg - virtual AbstractScCondFormatManagerDlg* CreateScCondFormatMgrDlg(Window* pParent, ScDocument* pDoc, const ScConditionalFormatList* pFormatList, const ScAddress& rPos, int nId ); - virtual AbstractScDataBarSettingsDlg* CreateScDataBarSetttingsDlg (Window* pParent, ScDocument* pDoc, int nId ); //add for ScDataBarSettingsDlg - virtual AbstractScDataPilotDatabaseDlg * CreateScDataPilotDatabaseDlg (Window* pParent ,int nId ); //add for ScDataPilotDatabaseDlg virtual AbstractScDataPilotSourceTypeDlg * CreateScDataPilotSourceTypeDlg ( Window* pParent, sal_Bool bEnableExternal, int nId ) ; //add for ScDataPilotSourceTypeDlg diff --git a/sc/source/ui/attrdlg/scuiexp.cxx b/sc/source/ui/attrdlg/scuiexp.cxx index c2581ea7b578..77e5b2e9f2ea 100644 --- a/sc/source/ui/attrdlg/scuiexp.cxx +++ b/sc/source/ui/attrdlg/scuiexp.cxx @@ -36,6 +36,10 @@ namespace scui } } +#ifdef DISABLE_DYNLOADING +#define CreateDialogFactory ScCreateDialogFactory +#endif + extern "C" { SAL_DLLPUBLIC_EXPORT ScAbstractDialogFactory* CreateDialogFactory() diff --git a/sc/source/ui/condformat/colorformat.cxx b/sc/source/ui/condformat/colorformat.cxx index 77acc7df5d56..79835917816e 100644 --- a/sc/source/ui/condformat/colorformat.cxx +++ b/sc/source/ui/condformat/colorformat.cxx @@ -36,7 +36,7 @@ #include <svx/drawitem.hxx> #include <vcl/msgbox.hxx> -ScDataBarSettingsDlg::ScDataBarSettingsDlg(Window* pWindow, ScDocument* pDoc): +ScDataBarSettingsDlg::ScDataBarSettingsDlg(Window* pWindow, ScDocument* pDoc, const ScAddress& rPos): ModalDialog( pWindow, ScResId( RID_SCDLG_DATABAR ) ), maBtnOk( this, ScResId( BTN_OK ) ), maBtnCancel( this, ScResId( BTN_CANCEL ) ), @@ -57,84 +57,45 @@ ScDataBarSettingsDlg::ScDataBarSettingsDlg(Window* pWindow, ScDocument* pDoc): maLbAxisPos( this, ScResId( LB_AXIS_POSITION ) ), maEdMin( this, ScResId( ED_MIN ) ), maEdMax( this, ScResId( ED_MAX ) ), - mpNumberFormatter( pDoc->GetFormatTable() ) + mpNumberFormatter( pDoc->GetFormatTable() ), + mpDoc(pDoc), + maPos(rPos) { Init(); FreeResource(); maLbTypeMin.SelectEntryPos(0); - maLbTypeMax.SelectEntryPos(1); + maLbTypeMax.SelectEntryPos(0); maLbAxisPos.SelectEntryPos(0); } namespace { -void SetType(const ScColorScaleEntry* pEntry, ListBox& aLstBox) +void SetType(const ScColorScaleEntry* pEntry, ListBox& rLstBox) { - switch(pEntry->GetType()) - { - case COLORSCALE_MIN: - aLstBox.SelectEntryPos(0); - break; - case COLORSCALE_MAX: - aLstBox.SelectEntryPos(1); - break; - case COLORSCALE_PERCENTILE: - aLstBox.SelectEntryPos(2); - break; - case COLORSCALE_PERCENT: - aLstBox.SelectEntryPos(3); - break; - case COLORSCALE_FORMULA: - aLstBox.SelectEntryPos(5); - break; - case COLORSCALE_VALUE: - aLstBox.SelectEntryPos(4); - break; - case COLORSCALE_AUTOMIN: - aLstBox.SelectEntryPos(6); - break; - case COLORSCALE_AUTOMAX: - aLstBox.SelectEntryPos(7); - break; - } + rLstBox.SelectEntryPos(pEntry->GetType()); } -void GetType(const ListBox& rLstBox, const Edit& rEd, ScColorScaleEntry* pEntry, SvNumberFormatter* pNumberFormatter ) +void GetType(const ListBox& rLstBox, const Edit& rEd, ScColorScaleEntry* pEntry, SvNumberFormatter* pNumberFormatter, + ScDocument* pDoc, const ScAddress& rPos ) { double nVal = 0; sal_uInt32 nIndex = 0; + pEntry->SetType(static_cast<ScColorScaleEntryType>(rLstBox.GetSelectEntryPos())); switch(rLstBox.GetSelectEntryPos()) { - case 0: - pEntry->SetType(COLORSCALE_MIN); - break; - case 1: - pEntry->SetType(COLORSCALE_MAX); - break; - case 2: - pEntry->SetType(COLORSCALE_PERCENTILE); - pNumberFormatter->IsNumberFormat( rEd.GetText(), nIndex, nVal ); - pEntry->SetValue(nVal); - break; - case 3: - pEntry->SetType(COLORSCALE_PERCENT); - pNumberFormatter->IsNumberFormat( rEd.GetText(), nIndex, nVal ); - pEntry->SetValue(nVal); + case COLORSCALE_AUTO: + case COLORSCALE_MIN: + case COLORSCALE_MAX: break; - case 4: + case COLORSCALE_PERCENTILE: + case COLORSCALE_VALUE: + case COLORSCALE_PERCENT: pNumberFormatter->IsNumberFormat( rEd.GetText(), nIndex, nVal ); - pEntry->SetType(COLORSCALE_VALUE); pEntry->SetValue(nVal); break; - case 5: - //TODO: moggi - break; - case 6: - pEntry->SetType(COLORSCALE_AUTOMIN); - break; - case 7: - pEntry->SetType(COLORSCALE_AUTOMAX); + case COLORSCALE_FORMULA: + pEntry->SetFormula(rEd.GetText(), pDoc, rPos); break; } } @@ -151,7 +112,7 @@ void SetValue( ScColorScaleEntry* pEntry, Edit& aEdit) } -ScDataBarSettingsDlg::ScDataBarSettingsDlg(Window* pWindow, const ScDataBarFormatData& rData, ScDocument* pDoc): +ScDataBarSettingsDlg::ScDataBarSettingsDlg(Window* pWindow, const ScDataBarFormatData& rData, ScDocument* pDoc, const ScAddress& rPos): ModalDialog( pWindow, ScResId( RID_SCDLG_DATABAR ) ), maBtnOk( this, ScResId( BTN_OK ) ), maBtnCancel( this, ScResId( BTN_CANCEL ) ), @@ -173,7 +134,9 @@ ScDataBarSettingsDlg::ScDataBarSettingsDlg(Window* pWindow, const ScDataBarForma maEdMin( this, ScResId( ED_MIN ) ), maEdMax( this, ScResId( ED_MAX ) ), maStrWarnSameValue( SC_RESSTR( STR_WARN_SAME_VALUE ) ), - mpNumberFormatter( pDoc->GetFormatTable() ) + mpNumberFormatter( pDoc->GetFormatTable() ), + mpDoc(pDoc), + maPos(rPos) { Init(); FreeResource(); @@ -282,8 +245,8 @@ ScDataBarFormatData* ScDataBarSettingsDlg::GetData() pData->mpLowerLimit.reset(new ScColorScaleEntry()); pData->maAxisColor = maLbAxisCol.GetSelectEntryColor(); - ::GetType(maLbTypeMin, maEdMin, pData->mpLowerLimit.get(), mpNumberFormatter); - ::GetType(maLbTypeMax, maEdMax, pData->mpUpperLimit.get(), mpNumberFormatter); + ::GetType(maLbTypeMin, maEdMin, pData->mpLowerLimit.get(), mpNumberFormatter, mpDoc, maPos); + ::GetType(maLbTypeMax, maEdMax, pData->mpUpperLimit.get(), mpNumberFormatter, mpDoc, maPos); GetAxesPosition(pData, maLbAxisPos); return pData; @@ -294,15 +257,15 @@ IMPL_LINK_NOARG( ScDataBarSettingsDlg, OkBtnHdl ) //check that min < max bool bWarn = false; sal_Int32 nSelectMin = maLbTypeMin.GetSelectEntryPos(); - if( nSelectMin == 1 || nSelectMin == 7) + if( nSelectMin == COLORSCALE_MAX ) bWarn = true; sal_Int32 nSelectMax = maLbTypeMax.GetSelectEntryPos(); - if( nSelectMax == 0 || nSelectMax == 6 ) + if( nSelectMax == COLORSCALE_MIN ) bWarn = true; if(!bWarn && maLbTypeMin.GetSelectEntryPos() == maLbTypeMax.GetSelectEntryPos()) { - if(maLbTypeMax.GetSelectEntryPos() != 5) + if(maLbTypeMax.GetSelectEntryPos() != COLORSCALE_FORMULA) { rtl::OUString aMinString = maEdMin.GetText(); rtl::OUString aMaxString = maEdMax.GetText(); @@ -333,14 +296,14 @@ IMPL_LINK_NOARG( ScDataBarSettingsDlg, OkBtnHdl ) IMPL_LINK_NOARG( ScDataBarSettingsDlg, TypeSelectHdl ) { sal_Int32 nSelectMin = maLbTypeMin.GetSelectEntryPos(); - if( nSelectMin == 0 || nSelectMin == 1 || nSelectMin == 6 || nSelectMin == 7) + if( nSelectMin <= COLORSCALE_MAX) maEdMin.Disable(); else { maEdMin.Enable(); if(!maEdMin.GetText().Len()) { - if(nSelectMin == 2 || nSelectMin == 3) + if(nSelectMin == COLORSCALE_PERCENTILE || nSelectMin == COLORSCALE_PERCENT) maEdMin.SetText(rtl::OUString::valueOf(static_cast<sal_Int32>(50))); else maEdMin.SetText(rtl::OUString::valueOf(static_cast<sal_Int32>(0))); @@ -348,14 +311,14 @@ IMPL_LINK_NOARG( ScDataBarSettingsDlg, TypeSelectHdl ) } sal_Int32 nSelectMax = maLbTypeMax.GetSelectEntryPos(); - if(nSelectMax == 0 || nSelectMax == 1 || nSelectMax == 6 || nSelectMax == 7) + if(nSelectMax <= COLORSCALE_MAX) maEdMax.Disable(); else { maEdMax.Enable(); if(!maEdMax.GetText().Len()) { - if(nSelectMax == 2 || nSelectMax == 3) + if(nSelectMax == COLORSCALE_PERCENTILE || nSelectMax == COLORSCALE_PERCENT) maEdMax.SetText(rtl::OUString::valueOf(static_cast<sal_Int32>(50))); else maEdMax.SetText(rtl::OUString::valueOf(static_cast<sal_Int32>(0))); diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx index 51fc4856dfeb..bf4f8b20b762 100644 --- a/sc/source/ui/condformat/condformatdlg.cxx +++ b/sc/source/ui/condformat/condformatdlg.cxx @@ -46,1112 +46,461 @@ #include "conditio.hxx" #include "colorscale.hxx" #include "colorformat.hxx" +#include "reffact.hxx" +#include "docsh.hxx" +#include "docfunc.hxx" +#include "condformatdlgentry.hxx" #include "globstr.hrc" -#include <cassert> -#include <iostream> - -namespace { - -void SetColorScaleEntryTypes( const ScColorScaleEntry& rEntry, ListBox& rLbType, Edit& rEdit, ColorListBox& rLbCol ) -{ - switch(rEntry.GetType()) - { - case COLORSCALE_MIN: - rLbType.SelectEntryPos(0); - break; - case COLORSCALE_MAX: - rLbType.SelectEntryPos(1); - break; - case COLORSCALE_PERCENTILE: - rEdit.SetText(rtl::OUString::valueOf(rEntry.GetValue())); - rLbType.SelectEntryPos(2); - break; - case COLORSCALE_PERCENT: - rEdit.SetText(rtl::OUString::valueOf(rEntry.GetValue())); - rLbType.SelectEntryPos(4); - break; - case COLORSCALE_FORMULA: - rEdit.SetText(rEntry.GetFormula(formula::FormulaGrammar::GRAM_DEFAULT)); - rLbType.SelectEntryPos(5); - break; - case COLORSCALE_VALUE: - rEdit.SetText(rtl::OUString::valueOf(rEntry.GetValue())); - rLbType.SelectEntryPos(3); - break; - case COLORSCALE_AUTOMIN: - rLbType.SelectEntryPos(6); - break; - case COLORSCALE_AUTOMAX: - rLbType.SelectEntryPos(7); - break; - } - rLbCol.SelectEntry(rEntry.GetColor()); -} - -void SetDataBarEntryTypes( const ScColorScaleEntry& rEntry, ListBox& rLbType, Edit& rEdit ) -{ - switch(rEntry.GetType()) - { - case COLORSCALE_MIN: - rLbType.SelectEntryPos(0); - break; - case COLORSCALE_MAX: - rLbType.SelectEntryPos(1); - break; - case COLORSCALE_PERCENTILE: - rEdit.SetText(rtl::OUString::valueOf(rEntry.GetValue())); - rLbType.SelectEntryPos(2); - break; - case COLORSCALE_PERCENT: - rEdit.SetText(rtl::OUString::valueOf(rEntry.GetValue())); - rLbType.SelectEntryPos(4); - break; - case COLORSCALE_FORMULA: - rEdit.SetText(rEntry.GetFormula(formula::FormulaGrammar::GRAM_DEFAULT)); - rLbType.SelectEntryPos(5); - break; - case COLORSCALE_VALUE: - rEdit.SetText(rtl::OUString::valueOf(rEntry.GetValue())); - rLbType.SelectEntryPos(3); - break; - case COLORSCALE_AUTOMIN: - rLbType.SelectEntryPos(6); - break; - case COLORSCALE_AUTOMAX: - rLbType.SelectEntryPos(7); - break; - } -} - -} - -ScCondFrmtEntry::ScCondFrmtEntry(Window* pParent, ScDocument* pDoc, const ScAddress& rPos): - Control(pParent, ScResId( RID_COND_ENTRY ) ), - mbActive(false), - meType(CONDITION), - maLbType( this, ScResId( LB_TYPE ) ), - maFtCondNr( this, ScResId( FT_COND_NR ) ), - maFtCondition( this, ScResId( FT_CONDITION ) ), - maLbCondType( this, ScResId( LB_CELLIS_TYPE ) ), - maEdVal1( this, ScResId( ED_VAL1 ) ), - maEdVal2( this, ScResId( ED_VAL2 ) ), - maFtStyle( this, ScResId( FT_STYLE ) ), - maLbStyle( this, ScResId( LB_STYLE ) ), - maWdPreview( this, ScResId( WD_PREVIEW ) ), - maLbColorFormat( this, ScResId( LB_COLOR_FORMAT ) ), - maLbColScale2( this, ScResId( LB_COL_SCALE2 ) ), - maLbColScale3( this, ScResId( LB_COL_SCALE3 ) ), - maLbEntryTypeMin( this, ScResId( LB_TYPE_COL_SCALE ) ), - maLbEntryTypeMiddle( this, ScResId( LB_TYPE_COL_SCALE ) ), - maLbEntryTypeMax( this, ScResId( LB_TYPE_COL_SCALE ) ), - maEdMin( this, ScResId( ED_COL_SCALE ) ), - maEdMiddle( this, ScResId( ED_COL_SCALE ) ), - maEdMax( this, ScResId( ED_COL_SCALE ) ), - maLbColMin( this, ScResId( LB_COL) ), - maLbColMiddle( this, ScResId( LB_COL) ), - maLbColMax( this, ScResId( LB_COL) ), - maLbDataBarMinType( this, ScResId( LB_TYPE_COL_SCALE ) ), - maLbDataBarMaxType( this, ScResId( LB_TYPE_COL_SCALE ) ), - maEdDataBarMin( this, ScResId( ED_COL_SCALE ) ), - maEdDataBarMax( this, ScResId( ED_COL_SCALE ) ), - maBtOptions( this, ScResId( BTN_OPTIONS ) ), +ScCondFormatList::ScCondFormatList(Window* pParent, const ResId& rResId, ScDocument* pDoc, const ScConditionalFormat* pFormat, + const ScRangeList& rRanges, const ScAddress& rPos, condformat::dialog::ScCondFormatDialogType eType): + Control(pParent, rResId), + mbHasScrollBar(false), + mpScrollBar(new ScrollBar(this, WB_VERT )), mpDoc(pDoc), maPos(rPos), - mnIndex(0), - maStrCondition(ScResId( STR_CONDITION ).toString()) -{ - SetControlBackground(GetSettings().GetStyleSettings().GetDialogColor()); - FreeResource(); - - maLbType.SelectEntryPos(1); - maLbCondType.SelectEntryPos(0); - maEdVal2.Hide(); - - maLbStyle.SetSeparatorPos(0); - - //disable entries for color formats - maLbColorFormat.SelectEntryPos(0); - maLbEntryTypeMin.SelectEntryPos(0); - maLbEntryTypeMiddle.SelectEntryPos(2); - maLbEntryTypeMax.SelectEntryPos(1); - maLbDataBarMinType.SelectEntryPos(0); - maLbDataBarMaxType.SelectEntryPos(1); - maEdMiddle.SetText(rtl::OUString::valueOf(static_cast<sal_Int32>(50))); - maEdDataBarMin.Disable(); - maEdDataBarMax.Disable(); - - Init(); - maLbStyle.SelectEntryPos(1); - maClickHdl = LINK( pParent, ScCondFormatList, EntrySelectHdl ); - SwitchToType(COLLAPSED); - SetHeight(); - SetCondType(); - - EntryTypeHdl(&maLbEntryTypeMin); - EntryTypeHdl(&maLbEntryTypeMiddle); - EntryTypeHdl(&maLbEntryTypeMax); -} - -ScCondFrmtEntry::ScCondFrmtEntry(Window* pParent, ScDocument* pDoc, const ScFormatEntry* pFormatEntry, const ScAddress& rPos): - Control(pParent, ScResId( RID_COND_ENTRY ) ), - mbActive(false), - meType(CONDITION), - maLbType( this, ScResId( LB_TYPE ) ), - maFtCondNr( this, ScResId( FT_COND_NR ) ), - maFtCondition( this, ScResId( FT_CONDITION ) ), - maLbCondType( this, ScResId( LB_CELLIS_TYPE ) ), - maEdVal1( this, ScResId( ED_VAL1 ) ), - maEdVal2( this, ScResId( ED_VAL2 ) ), - maFtStyle( this, ScResId( FT_STYLE ) ), - maLbStyle( this, ScResId( LB_STYLE ) ), - maWdPreview( this, ScResId( WD_PREVIEW ) ), - maLbColorFormat( this, ScResId( LB_COLOR_FORMAT ) ), - maLbColScale2( this, ScResId( LB_COL_SCALE2 ) ), - maLbColScale3( this, ScResId( LB_COL_SCALE3 ) ), - maLbEntryTypeMin( this, ScResId( LB_TYPE_COL_SCALE ) ), - maLbEntryTypeMiddle( this, ScResId( LB_TYPE_COL_SCALE ) ), - maLbEntryTypeMax( this, ScResId( LB_TYPE_COL_SCALE ) ), - maEdMin( this, ScResId( ED_COL_SCALE ) ), - maEdMiddle( this, ScResId( ED_COL_SCALE ) ), - maEdMax( this, ScResId( ED_COL_SCALE ) ), - maLbColMin( this, ScResId( LB_COL) ), - maLbColMiddle( this, ScResId( LB_COL) ), - maLbColMax( this, ScResId( LB_COL) ), - maLbDataBarMinType( this, ScResId( LB_TYPE_COL_SCALE ) ), - maLbDataBarMaxType( this, ScResId( LB_TYPE_COL_SCALE ) ), - maEdDataBarMin( this, ScResId( ED_COL_SCALE ) ), - maEdDataBarMax( this, ScResId( ED_COL_SCALE ) ), - maBtOptions( this, ScResId( BTN_OPTIONS ) ), - mpDoc(pDoc), - maPos(rPos) + maRanges(rRanges) { - SetControlBackground(GetSettings().GetStyleSettings().GetDialogColor()); - FreeResource(); - Init(); + mpScrollBar->SetScrollHdl( LINK( this, ScCondFormatList, ScrollHdl ) ); + mpScrollBar->EnableDrag(); - if(pFormatEntry && pFormatEntry->GetType() == condformat::CONDITION) - { - const ScCondFormatEntry* pEntry = static_cast<const ScCondFormatEntry*>(pFormatEntry); - rtl::OUString aStyleName = pEntry->GetStyle(); - maLbStyle.SelectEntry(aStyleName); - StyleSelectHdl(NULL); - ScConditionMode eMode = pEntry->GetOperation(); - maLbType.SelectEntryPos(1); - maEdVal1.SetText(pEntry->GetExpression(maPos, 0)); - SetCondType(); - switch(eMode) - { - case SC_COND_EQUAL: - maLbCondType.SelectEntryPos(0); - break; - case SC_COND_LESS: - maLbCondType.SelectEntryPos(1); - break; - case SC_COND_GREATER: - maLbCondType.SelectEntryPos(2); - break; - case SC_COND_EQLESS: - maLbCondType.SelectEntryPos(3); - break; - case SC_COND_EQGREATER: - maLbCondType.SelectEntryPos(4); - break; - case SC_COND_NOTEQUAL: - maLbCondType.SelectEntryPos(5); - break; - case SC_COND_BETWEEN: - maEdVal2.SetText(pEntry->GetExpression(maPos, 1)); - maLbCondType.SelectEntryPos(6); - break; - case SC_COND_NOTBETWEEN: - maEdVal2.SetText(pEntry->GetExpression(maPos, 1)); - maLbCondType.SelectEntryPos(7); - break; - case SC_COND_DUPLICATE: - maLbCondType.SelectEntryPos(8); - break; - case SC_COND_NOTDUPLICATE: - maLbCondType.SelectEntryPos(9); - break; - case SC_COND_DIRECT: - maLbType.SelectEntryPos(2); - SwitchToType(FORMULA); - break; - case SC_COND_NONE: - break; - } - } - else if( pFormatEntry && pFormatEntry->GetType() == condformat::COLORSCALE ) + if(pFormat) { - const ScColorScaleFormat* pEntry = static_cast<const ScColorScaleFormat*>(pFormatEntry); - maLbType.SelectEntryPos(0); - if(pEntry->size() == 2) - maLbColorFormat.SelectEntryPos(0); - else - maLbColorFormat.SelectEntryPos(1); - SetColorScaleType(); - ScColorScaleFormat::const_iterator itr = pEntry->begin(); - SetColorScaleEntryTypes(*itr, maLbEntryTypeMin, maEdMin, maLbColMin); - if(pEntry->size() == 3) + size_t nCount = pFormat->size(); + for (size_t nIndex = 0; nIndex < nCount; ++nIndex) { - ++itr; - SetColorScaleEntryTypes(*itr, maLbEntryTypeMiddle, maEdMiddle, maLbColMiddle); + const ScFormatEntry* pEntry = pFormat->GetEntry(nIndex); + switch(pEntry->GetType()) + { + case condformat::CONDITION: + maEntries.push_back(new ScConditionFrmtEntry( this, mpDoc, maPos, static_cast<const ScCondFormatEntry*>( pEntry ) ) ); + break; + case condformat::COLORSCALE: + maEntries.push_back(new ScColorScale3FrmtEntry( this, mpDoc, maPos, static_cast<const ScColorScaleFormat*>( pEntry ) ) ); + break; + case condformat::DATABAR: + maEntries.push_back(new ScDataBarFrmtEntry( this, mpDoc, maPos, static_cast<const ScDataBarFormat*>( pEntry ) ) ); + break; + } } - ++itr; - SetColorScaleEntryTypes(*itr, maLbEntryTypeMax, maEdMax, maLbColMax); - } - else if( pFormatEntry && pFormatEntry->GetType() == condformat::DATABAR ) - { - const ScDataBarFormat* pEntry = static_cast<const ScDataBarFormat*>(pFormatEntry); - mpDataBarData.reset(new ScDataBarFormatData(*pEntry->GetDataBarData())); - maLbType.SelectEntryPos(0); - maLbColorFormat.SelectEntryPos(2); - SetDataBarEntryTypes(*mpDataBarData->mpLowerLimit, maLbDataBarMinType, maEdDataBarMin); - SetDataBarEntryTypes(*mpDataBarData->mpUpperLimit, maLbDataBarMaxType, maEdDataBarMax); - DataBarTypeSelectHdl(NULL); - SetDataBarType(); - } - - maClickHdl = LINK( pParent, ScCondFormatList, EntrySelectHdl ); - SwitchToType(COLLAPSED); - SetHeight(); - - EntryTypeHdl(&maLbEntryTypeMin); - EntryTypeHdl(&maLbEntryTypeMiddle); - EntryTypeHdl(&maLbEntryTypeMax); -} - -ScCondFrmtEntry::~ScCondFrmtEntry() -{ -} - -void ScCondFrmtEntry::Init() -{ - maLbType.SetSelectHdl( LINK( this, ScCondFrmtEntry, TypeListHdl ) ); - maLbColorFormat.SetSelectHdl( LINK( this, ScCondFrmtEntry, ColFormatTypeHdl ) ); - maLbEntryTypeMin.SetSelectHdl( LINK( this, ScCondFrmtEntry, EntryTypeHdl ) ); - maLbEntryTypeMax.SetSelectHdl( LINK( this, ScCondFrmtEntry, EntryTypeHdl ) ); - maLbEntryTypeMiddle.SetSelectHdl( LINK( this, ScCondFrmtEntry, EntryTypeHdl ) ); - maEdVal1.SetStyle( maEdVal1.GetStyle() | WB_FORCECTRLBACKGROUND ); - maEdVal2.SetStyle( maEdVal2.GetStyle() | WB_FORCECTRLBACKGROUND ); - - maEdVal1.SetModifyHdl( LINK( this, ScCondFrmtEntry, EdModifyHdl ) ); - maEdVal2.SetModifyHdl( LINK( this, ScCondFrmtEntry, EdModifyHdl ) ); - - SfxStyleSheetIterator aStyleIter( mpDoc->GetStyleSheetPool(), SFX_STYLE_FAMILY_PARA ); - for ( SfxStyleSheetBase* pStyle = aStyleIter.First(); pStyle; pStyle = aStyleIter.Next() ) - { - rtl::OUString aName = pStyle->GetName(); - maLbStyle.InsertEntry( aName ); - } - maLbStyle.SetSelectHdl( LINK( this, ScCondFrmtEntry, StyleSelectHdl ) ); - - Point aPointLb = maLbEntryTypeMiddle.GetPosPixel(); - Point aPointEd = maEdMiddle.GetPosPixel(); - Point aPointCol = maLbColMiddle.GetPosPixel(); - Point aPointEdDataBar = maEdDataBarMin.GetPosPixel(); - Point aPointLbDataBar = maLbDataBarMaxType.GetPosPixel(); - const long nMovePos = maLbEntryTypeMiddle.GetSizePixel().Width() * 1.2; - aPointLb.X() += nMovePos; - aPointEd.X() += nMovePos; - aPointCol.X() += nMovePos; - aPointEdDataBar.X() += 2*nMovePos; - aPointLbDataBar.X() += 2*nMovePos; - maLbEntryTypeMiddle.SetPosPixel(aPointLb); - maEdMiddle.SetPosPixel(aPointEd); - maLbColMiddle.SetPosPixel(aPointCol); - maEdDataBarMax.SetPosPixel(aPointEdDataBar); - maLbDataBarMaxType.SetPosPixel(aPointLbDataBar); - aPointLb.X() += nMovePos; - aPointEd.X() += nMovePos; - aPointCol.X() += nMovePos; - maLbEntryTypeMax.SetPosPixel(aPointLb); - maEdMax.SetPosPixel(aPointEd); - maLbColMax.SetPosPixel(aPointCol); - - SfxObjectShell* pDocSh = SfxObjectShell::Current(); - const SfxPoolItem* pItem = NULL; - XColorListRef pColorTable; - - DBG_ASSERT( pDocSh, "DocShell not found!" ); - - if ( pDocSh ) - { - pItem = pDocSh->GetItem( SID_COLOR_TABLE ); - if ( pItem != NULL ) - pColorTable = ( (SvxColorListItem*)pItem )->GetColorList(); } - if ( pColorTable.is() ) + else { - // filling the line color box - maLbColMin.SetUpdateMode( false ); - maLbColMiddle.SetUpdateMode( false ); - maLbColMax.SetUpdateMode( false ); - - for ( long i = 0; i < pColorTable->Count(); ++i ) + switch(eType) { - XColorEntry* pEntry = pColorTable->GetColor(i); - maLbColMin.InsertEntry( pEntry->GetColor(), pEntry->GetName() ); - maLbColMiddle.InsertEntry( pEntry->GetColor(), pEntry->GetName() ); - maLbColMax.InsertEntry( pEntry->GetColor(), pEntry->GetName() ); - - if(pEntry->GetColor() == Color(COL_LIGHTRED)) - maLbColMin.SelectEntryPos(i); - if(pEntry->GetColor() == Color(COL_GREEN)) - maLbColMiddle.SelectEntryPos(i); - if(pEntry->GetColor() == Color(COL_LIGHTBLUE)) - maLbColMax.SelectEntryPos(i); + case condformat::dialog::CONDITION: + maEntries.push_back(new ScConditionFrmtEntry( this, mpDoc, maPos )); + break; + case condformat::dialog::COLORSCALE: + maEntries.push_back(new ScColorScale3FrmtEntry( this, mpDoc, maPos )); + break; + case condformat::dialog::DATABAR: + maEntries.push_back(new ScDataBarFrmtEntry( this, mpDoc, maPos )); + break; + default: + break; } - maLbColMin.SetUpdateMode( sal_True ); - maLbColMiddle.SetUpdateMode( sal_True ); - maLbColMax.SetUpdateMode( sal_True ); } + if (!maEntries.empty()) + maEntries.begin()->SetActive(); - maBtOptions.SetClickHdl( LINK( this, ScCondFrmtEntry, OptionBtnHdl ) ); - maLbDataBarMinType.SetSelectHdl( LINK( this, ScCondFrmtEntry, DataBarTypeSelectHdl ) ); - maLbDataBarMaxType.SetSelectHdl( LINK( this, ScCondFrmtEntry, DataBarTypeSelectHdl ) ); - maLbCondType.SetSelectHdl( LINK( this, ScCondFrmtEntry, ConditionTypeSelectHdl ) ); - - mpDataBarData.reset(new ScDataBarFormatData()); - mpDataBarData->mpUpperLimit.reset(new ScColorScaleEntry()); - mpDataBarData->mpLowerLimit.reset(new ScColorScaleEntry()); - mpDataBarData->mpLowerLimit->SetType(COLORSCALE_MIN); - mpDataBarData->mpUpperLimit->SetType(COLORSCALE_MAX); - mpDataBarData->maPositiveColor = COL_LIGHTBLUE; + RecalcAll(); + FreeResource(); } -long ScCondFrmtEntry::Notify( NotifyEvent& rNEvt ) +ScConditionalFormat* ScCondFormatList::GetConditionalFormat() const { - if( rNEvt.GetType() == EVENT_MOUSEBUTTONDOWN ) - { - ImplCallEventListenersAndHandler( VCLEVENT_WINDOW_MOUSEBUTTONDOWN, maClickHdl, this ); - } - return Control::Notify(rNEvt); -} + if(maEntries.empty()) + return NULL; -void ScCondFrmtEntry::SwitchToType( ScCondFormatEntryType eType ) -{ - switch(eType) + ScConditionalFormat* pFormat = new ScConditionalFormat(0, mpDoc); + for(EntryContainer::const_iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr) { - case COLLAPSED: - { - maLbType.Hide(); - rtl::OUString maCondText = ScCondFormatHelper::GetExpression(meType, maLbCondType.GetSelectEntryPos()); - maFtCondition.SetText(maCondText); - maFtCondition.Show(); - maLbType.Hide(); - HideCondElements(); - HideColorScaleElements(); - HideDataBarElements(); - } - break; - default: - meType = eType; - maLbType.Show(); - maFtCondition.SetText(rtl::OUString("")); - maFtCondition.Hide(); - maLbType.Show(); - break; + ScFormatEntry* pEntry = itr->GetEntry(); + if(pEntry) + pFormat->AddEntry(pEntry); } -} - -void ScCondFrmtEntry::SetIndex(sal_Int32 nIndex) -{ - mnIndex = nIndex; - rtl::OUStringBuffer aBuffer(maStrCondition); - aBuffer.append(rtl::OUString::valueOf(nIndex)); - maFtCondNr.SetText(aBuffer.makeStringAndClear()); -} -void ScCondFrmtEntry::HideCondElements() -{ - maEdVal1.Hide(); - maEdVal2.Hide(); - maLbStyle.Hide(); - maFtStyle.Hide(); - maLbCondType.Hide(); - maWdPreview.Hide(); -} - -void ScCondFrmtEntry::SetCondType() -{ - maEdVal1.SetSizePixel(maEdVal2.GetSizePixel()); - Point aPoint(maLbCondType.GetPosPixel().X() + maLbCondType.GetSizePixel().Width() + LogicToPixel(Size(5,1), MapMode(MAP_APPFONT)).getWidth(), - maEdVal1.GetPosPixel().Y()); - maEdVal1.SetPosPixel(aPoint); - maEdVal1.Show(); - maEdVal2.Show(); - maLbStyle.Show(); - maLbCondType.Show(); - maFtStyle.Show(); - maWdPreview.Show(); - HideColorScaleElements(); - HideDataBarElements(); - SwitchToType(CONDITION); - ConditionTypeSelectHdl(NULL); -} + pFormat->AddRange(maRanges); -void ScCondFrmtEntry::HideColorScaleElements() -{ - maLbColorFormat.Hide(); - maLbColScale2.Hide(); - maLbColScale3.Hide(); - maLbEntryTypeMin.Hide(); - maLbEntryTypeMiddle.Hide(); - maLbEntryTypeMax.Hide(); - maEdMin.Hide(); - maEdMiddle.Hide(); - maEdMax.Hide(); - maLbColMin.Hide(); - maLbColMiddle.Hide(); - maLbColMax.Hide(); + return pFormat; } -void ScCondFrmtEntry::SetHeight() +void ScCondFormatList::RecalcAll() { - long nPad = LogicToPixel(Size(42,2), MapMode(MAP_APPFONT)).getHeight(); - - // Calculate maximum height we need from visible widgets - sal_uInt16 nChildren = GetChildCount(); - - long nMaxHeight = 0; - for(sal_uInt16 i = 0; i < nChildren; i++) - { - Window *pChild = GetChild(i); - if(!pChild || !pChild->IsVisible()) - continue; - Point aPos = pChild->GetPosPixel(); - Size aSize = pChild->GetSizePixel(); - nMaxHeight = std::max(aPos.Y() + aSize.Height(), nMaxHeight); - } - Size aSize = GetSizePixel(); - if(nMaxHeight > 0) + sal_Int32 nTotalHeight = 0; + sal_Int32 nIndex = 1; + for(EntryContainer::iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr) { - aSize.Height() = nMaxHeight + nPad; - SetSizePixel(aSize); + nTotalHeight += itr->GetSizePixel().Height(); + itr->SetIndex( nIndex ); + ++nIndex; } -} -void ScCondFrmtEntry::SetColorScaleType() -{ - HideCondElements(); - HideDataBarElements(); - maLbColorFormat.Show(); - if(maLbColorFormat.GetSelectEntryPos() == 0) + Size aCtrlSize = GetOutputSize(); + long nSrcBarSize = GetSettings().GetStyleSettings().GetScrollBarSize(); + if(nTotalHeight > GetSizePixel().Height()) { - maEdMiddle.Hide(); - maLbEntryTypeMiddle.Hide(); - // TODO: enale for 3.7 again with good presets - //maLbColScale2.Show(); - maLbColScale3.Hide(); - maLbColMiddle.Hide(); + mbHasScrollBar = true; + mpScrollBar->SetPosSizePixel(Point(aCtrlSize.Width() -nSrcBarSize, 0), + Size(nSrcBarSize, aCtrlSize.Height()) ); + mpScrollBar->SetRangeMax(nTotalHeight); + mpScrollBar->SetVisibleSize(aCtrlSize.Height()); + mpScrollBar->Show(); } else { - maEdMiddle.Show(); - maLbEntryTypeMiddle.Show(); - maLbColScale2.Hide(); - // TODO: enale for 3.7 again with good presets - // maLbColScale3.Show(); - maLbColMiddle.Show(); + mbHasScrollBar = false; + mpScrollBar->Hide(); } - maLbEntryTypeMin.Show(); - maLbEntryTypeMax.Show(); - maEdMin.Show(); - maEdMax.Show(); - maLbColMin.Show(); - maLbColMax.Show(); - SwitchToType(COLORSCALE); -} -void ScCondFrmtEntry::HideDataBarElements() -{ - maLbColorFormat.Hide(); - maLbDataBarMinType.Hide(); - maLbDataBarMaxType.Hide(); - maEdDataBarMin.Hide(); - maEdDataBarMax.Hide(); - maBtOptions.Hide(); -} - -void ScCondFrmtEntry::SetDataBarType() -{ - SwitchToType(DATABAR); - HideCondElements(); - HideColorScaleElements(); - maLbColorFormat.Show(); - maLbDataBarMinType.Show(); - maLbDataBarMaxType.Show(); - maEdDataBarMin.Show(); - maEdDataBarMax.Show(); - maBtOptions.Show(); -} - -void ScCondFrmtEntry::SetFormulaType() -{ - SwitchToType(FORMULA); - HideColorScaleElements(); - HideDataBarElements(); - maEdVal1.SetPosPixel(maLbCondType.GetPosPixel()); - Size aSize(maEdVal2.GetPosPixel().X() + maEdVal2.GetSizePixel().Width() - maLbCondType.GetPosPixel().X(), maEdVal1.GetSizePixel().Height()); - maEdVal1.SetPosPixel(maLbCondType.GetPosPixel()); - maEdVal1.SetSizePixel(aSize); - maEdVal1.Show(); - maEdVal2.Hide(); - maLbCondType.Hide(); - maLbStyle.Show(); - maFtCondition.Show(); - maWdPreview.Show(); - maFtStyle.Show(); -} - -void ScCondFrmtEntry::Select() -{ - SetControlForeground(Color(COL_RED)); - switch(meType) + Point aPoint(0,-1*mpScrollBar->GetThumbPos()); + for(EntryContainer::iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr) { - case CONDITION: - SetCondType(); - break; - case COLORSCALE: - SetColorScaleType(); - break; - case DATABAR: - SetDataBarType(); - break; - case FORMULA: - SetFormulaType(); - break; - default: - //should not happen - break; - } - SwitchToType(meType); - mbActive = true; - SetHeight(); -} + itr->SetPosPixel(aPoint); + Size aSize = itr->GetSizePixel(); + if(mbHasScrollBar) + aSize.Width() = aCtrlSize.Width() - nSrcBarSize; + else + aSize.Width() = aCtrlSize.Width(); + itr->SetSizePixel(aSize); -void ScCondFrmtEntry::Deselect() -{ - SetControlBackground(GetSettings().GetStyleSettings().GetDialogColor()); - SwitchToType(COLLAPSED); - mbActive = false; - SetHeight(); + aPoint.Y() += itr->GetSizePixel().Height(); + } } -bool ScCondFrmtEntry::IsSelected() const +void ScCondFormatList::DoScroll(long nDelta) { - return mbActive; + Point aNewPoint = mpScrollBar->GetPosPixel(); + Rectangle aRect(Point(), GetOutputSize()); + aRect.Right() -= mpScrollBar->GetSizePixel().Width(); + Scroll( 0, -nDelta, aRect ); + mpScrollBar->SetPosPixel(aNewPoint); } -ScFormatEntry* ScCondFrmtEntry::createConditionEntry() const +IMPL_LINK(ScCondFormatList, ColFormatTypeHdl, ListBox*, pBox) { - ScConditionMode eMode; - rtl::OUString aExpr2; - switch(maLbCondType.GetSelectEntryPos()) + EntryContainer::iterator itr = maEntries.begin(); + for(; itr != maEntries.end(); ++itr) { - case 0: - eMode = SC_COND_EQUAL; - break; - case 1: - eMode = SC_COND_LESS; - break; - case 2: - eMode = SC_COND_GREATER; - break; - case 3: - eMode = SC_COND_EQLESS; - break; - case 4: - eMode = SC_COND_EQGREATER; - break; - case 5: - eMode = SC_COND_NOTEQUAL; - break; - case 6: - aExpr2 = maEdVal2.GetText(); - eMode = SC_COND_BETWEEN; - if(aExpr2.isEmpty()) - return NULL; - break; - case 7: - eMode = SC_COND_NOTBETWEEN; - aExpr2 = maEdVal2.GetText(); - if(aExpr2.isEmpty()) - return NULL; - break; - case 8: - eMode = SC_COND_DUPLICATE; - break; - case 9: - eMode = SC_COND_NOTDUPLICATE; + if(itr->IsSelected()) break; - default: - assert(false); // this cannot happen - return NULL; } + if(itr == maEntries.end()) + return 0; - rtl::OUString aExpr1 = maEdVal1.GetText(); - - ScFormatEntry* pEntry = new ScCondFormatEntry(eMode, aExpr1, aExpr2, mpDoc, maPos, maLbStyle.GetSelectEntry()); - - return pEntry; -} - -namespace { - -void SetColorScaleEntry( ScColorScaleEntry* pEntry, const ListBox& rType, const Edit& rValue, ScDocument* pDoc, const ScAddress& rPos ) -{ - sal_uInt32 nIndex = 0; - double nVal = 0; - SvNumberFormatter* pNumberFormatter = pDoc->GetFormatTable(); - pNumberFormatter->IsNumberFormat(rValue.GetText(), nIndex, nVal); - switch(rType.GetSelectEntryPos()) + sal_Int32 nPos = pBox->GetSelectEntryPos(); + switch(nPos) { case 0: - pEntry->SetType(COLORSCALE_MIN); + if(itr->GetType() == condformat::entry::COLORSCALE2) + return 0; + + maEntries.replace( itr, new ScColorScale2FrmtEntry( this, mpDoc, maPos ) ); break; case 1: - pEntry->SetType(COLORSCALE_MAX); + if(itr->GetType() == condformat::entry::COLORSCALE3) + return 0; + + maEntries.replace( itr, new ScColorScale3FrmtEntry( this, mpDoc, maPos ) ); break; case 2: - pEntry->SetType(COLORSCALE_PERCENTILE); - pEntry->SetValue(nVal); - break; - case 3: - pEntry->SetType(COLORSCALE_VALUE); - pEntry->SetValue(nVal); - break; - case 4: - pEntry->SetType(COLORSCALE_PERCENT); - pEntry->SetValue(nVal); - break; - case 5: - pEntry->SetType(COLORSCALE_FORMULA); - pEntry->SetFormula(rValue.GetText(), pDoc, rPos); - break; - case 6: - pEntry->SetType(COLORSCALE_AUTOMIN); - break; - case 7: - pEntry->SetType(COLORSCALE_AUTOMAX); + if(itr->GetType() == condformat::entry::DATABAR) + return 0; + + maEntries.replace( itr, new ScDataBarFrmtEntry( this, mpDoc, maPos ) ); break; default: break; } + static_cast<ScCondFormatDlg*>(GetParent())->InvalidateRefData(); + itr->SetActive(); + RecalcAll(); + return 0; } -ScColorScaleEntry* createColorScaleEntry( const ListBox& rType, const ColorListBox& rColor, const Edit& rValue, ScDocument* pDoc, const ScAddress& rPos ) -{ - ScColorScaleEntry* pEntry = new ScColorScaleEntry(); - - SetColorScaleEntry( pEntry, rType, rValue, pDoc, rPos ); - Color aColor = rColor.GetSelectEntryColor(); - pEntry->SetColor(aColor); - return pEntry; -} - -} - -ScFormatEntry* ScCondFrmtEntry::createColorscaleEntry() const -{ - ScColorScaleFormat* pColorScale = new ScColorScaleFormat(mpDoc); - pColorScale->AddEntry(createColorScaleEntry(maLbEntryTypeMin, maLbColMin, maEdMin, mpDoc, maPos)); - if(maLbColorFormat.GetSelectEntryPos() == 1) - pColorScale->AddEntry(createColorScaleEntry(maLbEntryTypeMiddle, maLbColMiddle, maEdMiddle, mpDoc, maPos)); - pColorScale->AddEntry(createColorScaleEntry(maLbEntryTypeMax, maLbColMax, maEdMax, mpDoc, maPos)); - return pColorScale; -} - -ScFormatEntry* ScCondFrmtEntry::createDatabarEntry() const -{ - SetColorScaleEntry(mpDataBarData->mpLowerLimit.get(), maLbDataBarMinType, maEdDataBarMin, mpDoc, maPos); - SetColorScaleEntry(mpDataBarData->mpUpperLimit.get(), maLbDataBarMaxType, maEdDataBarMax, mpDoc, maPos); - ScDataBarFormat* pDataBar = new ScDataBarFormat(mpDoc); - pDataBar->SetDataBarData(new ScDataBarFormatData(*mpDataBarData.get())); - return pDataBar; -} - -ScFormatEntry* ScCondFrmtEntry::createFormulaEntry() const -{ - ScConditionMode eMode = SC_COND_DIRECT; - rtl::OUString aFormula = maEdVal1.GetText(); - if(aFormula.isEmpty()) - return NULL; - - rtl::OUString aExpr2; - ScFormatEntry* pEntry = new ScCondFormatEntry(eMode, aFormula, aExpr2, mpDoc, maPos, maLbStyle.GetSelectEntry()); - return pEntry; -} - -ScFormatEntry* ScCondFrmtEntry::GetEntry() const +IMPL_LINK(ScCondFormatList, TypeListHdl, ListBox*, pBox) { - switch(meType) + EntryContainer::iterator itr = maEntries.begin(); + for(; itr != maEntries.end(); ++itr) { - case CONDITION: - return createConditionEntry(); - break; - case COLORSCALE: - return createColorscaleEntry(); - break; - case DATABAR: - return createDatabarEntry(); - break; - case FORMULA: - return createFormulaEntry(); - break; - default: + if(itr->IsSelected()) break; } - return NULL; -} + if(itr == maEntries.end()) + return 0;; -IMPL_LINK_NOARG(ScCondFrmtEntry, TypeListHdl) -{ - sal_Int32 nPos = maLbType.GetSelectEntryPos(); + sal_Int32 nPos = pBox->GetSelectEntryPos(); switch(nPos) { - case 1: - SetCondType(); - break; case 0: - if(maLbColorFormat.GetSelectEntryPos() < 2) - SetColorScaleType(); - else - SetDataBarType(); + switch(itr->GetType()) + { + case condformat::entry::FORMULA: + case condformat::entry::CONDITION: + break; + case condformat::entry::COLORSCALE2: + case condformat::entry::COLORSCALE3: + case condformat::entry::DATABAR: + return 0; + } + maEntries.replace( itr, new ScColorScale3FrmtEntry(this, mpDoc, maPos)); + static_cast<ScCondFormatDlg*>(GetParent())->InvalidateRefData(); + itr->SetActive(); break; - case 2: - SetFormulaType(); + case 1: + if(itr->GetType() == condformat::entry::CONDITION) + return 0; + + maEntries.replace( itr, new ScConditionFrmtEntry(this, mpDoc, maPos)); + static_cast<ScCondFormatDlg*>(GetParent())->InvalidateRefData(); + itr->SetActive(); break; - default: + case 2: + if(itr->GetType() == condformat::entry::FORMULA) + return 0; + + maEntries.replace( itr, new ScFormulaFrmtEntry(this, mpDoc, maPos)); + static_cast<ScCondFormatDlg*>(GetParent())->InvalidateRefData(); + itr->SetActive(); break; } - SetHeight(); + RecalcAll(); return 0; } -IMPL_LINK(ScCondFrmtEntry, EdModifyHdl, Edit*, pEdit) +IMPL_LINK_NOARG( ScCondFormatList, AddBtnHdl ) { - rtl::OUString aFormula = pEdit->GetText(); - ScCompiler aComp( mpDoc, maPos ); - aComp.SetGrammar( mpDoc->GetGrammar() ); - boost::scoped_ptr<ScTokenArray> mpCode(aComp.CompileString(aFormula)); - if(mpCode->GetCodeError()) - { - pEdit->SetControlBackground(COL_LIGHTRED); - } - else + ScCondFrmtEntry* pNewEntry = new ScConditionFrmtEntry(this, mpDoc, maPos); + maEntries.push_back( pNewEntry ); + for(EntryContainer::iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr) { - pEdit->SetControlBackground(GetSettings().GetStyleSettings().GetWindowColor()); + itr->SetInactive(); } + static_cast<ScCondFormatDlg*>(GetParent())->InvalidateRefData(); + pNewEntry->SetActive(); + RecalcAll(); return 0; } -IMPL_LINK_NOARG(ScCondFrmtEntry, ColFormatTypeHdl) +IMPL_LINK_NOARG( ScCondFormatList, RemoveBtnHdl ) { - if(maLbColorFormat.GetSelectEntryPos() < 2) - { - SetColorScaleType(); - } - else + for(EntryContainer::iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr) { - SetDataBarType(); + if(itr->IsSelected()) + { + maEntries.erase(itr); + break; + } } - - SetHeight(); - + static_cast<ScCondFormatDlg*>(GetParent())->InvalidateRefData(); + RecalcAll(); return 0; } -IMPL_LINK( ScCondFrmtEntry, EntryTypeHdl, ListBox*, pBox ) +IMPL_LINK( ScCondFormatList, EntrySelectHdl, ScCondFrmtEntry*, pEntry ) { - bool bEnableEdit = true; - sal_Int32 nPos = pBox->GetSelectEntryPos(); - if(nPos == 0 || nPos == 1) + if(pEntry->IsSelected()) + return 0; + + for(EntryContainer::iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr) { - bEnableEdit = false; + itr->SetInactive(); } - - Edit* pEd = NULL; - if(pBox == &maLbEntryTypeMin) - pEd = &maEdMin; - else if(pBox == &maLbEntryTypeMiddle) - pEd = &maEdMiddle; - else if(pBox == &maLbEntryTypeMax) - pEd = &maEdMax; - - if(bEnableEdit) - pEd->Enable(); - else - pEd->Disable(); - + static_cast<ScCondFormatDlg*>(GetParent())->InvalidateRefData(); + pEntry->SetActive(); + RecalcAll(); return 0; } -IMPL_LINK_NOARG(ScCondFrmtEntry, StyleSelectHdl) +IMPL_LINK_NOARG( ScCondFormatList, ScrollHdl ) { - if(maLbStyle.GetSelectEntryPos() == 0) - { - // call new style dialog - SfxUInt16Item aFamilyItem( SID_STYLE_FAMILY, SFX_STYLE_FAMILY_PARA ); - SfxStringItem aRefItem( SID_STYLE_REFERENCE, ScGlobal::GetRscString(STR_STYLENAME_STANDARD) ); - - // unlock the dispatcher so SID_STYLE_NEW can be executed - // (SetDispatcherLock would affect all Calc documents) - ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); - SfxDispatcher* pDisp = pViewShell->GetDispatcher(); - sal_Bool bLocked = pDisp->IsLocked(); - if (bLocked) - pDisp->Lock(false); - - // Execute the "new style" slot, complete with undo and all necessary updates. - // The return value (SfxUInt16Item) is ignored, look for new styles instead. - pDisp->Execute( SID_STYLE_NEW, SFX_CALLMODE_SYNCHRON | SFX_CALLMODE_RECORD | SFX_CALLMODE_MODAL, - &aFamilyItem, - &aRefItem, - 0L ); - - if (bLocked) - pDisp->Lock(sal_True); - - // Find the new style and add it into the style list boxes - rtl::OUString aNewStyle; - SfxStyleSheetIterator aStyleIter( mpDoc->GetStyleSheetPool(), SFX_STYLE_FAMILY_PARA ); - for ( SfxStyleSheetBase* pStyle = aStyleIter.First(); pStyle; pStyle = aStyleIter.Next() ) - { - rtl::OUString aName = pStyle->GetName(); - if ( maLbStyle.GetEntryPos(aName) == LISTBOX_ENTRY_NOTFOUND ) // all lists contain the same entries - { - maLbStyle.InsertEntry(aName); - maLbStyle.SelectEntry(aName); - } - } - } - - rtl::OUString aStyleName = maLbStyle.GetSelectEntry(); - SfxStyleSheetBase* pStyleSheet = mpDoc->GetStyleSheetPool()->Find( aStyleName, SFX_STYLE_FAMILY_PARA ); - if(pStyleSheet) - { - const SfxItemSet& rSet = pStyleSheet->GetItemSet(); - maWdPreview.Init( rSet ); - } - + DoScroll(mpScrollBar->GetDelta()); return 0; } -IMPL_LINK_NOARG( ScCondFrmtEntry, DataBarTypeSelectHdl ) -{ - sal_Int32 nSelectPos = maLbDataBarMinType.GetSelectEntryPos(); - if(nSelectPos == 0 || nSelectPos == 1) - maEdDataBarMin.Disable(); - else - maEdDataBarMin.Enable(); +//--------------------------------------------------- +//ScCondFormatDlg +//--------------------------------------------------- - nSelectPos = maLbDataBarMaxType.GetSelectEntryPos(); - if(nSelectPos == 0 || nSelectPos == 1) - maEdDataBarMax.Disable(); - else - maEdDataBarMax.Enable(); +ScCondFormatDlg::ScCondFormatDlg(SfxBindings* pB, SfxChildWindow* pCW, Window* pParent, ScDocument* pDoc, const ScConditionalFormat* pFormat, const ScRangeList& rRange, + const ScAddress& rPos, condformat::dialog::ScCondFormatDialogType eType): + ScAnyRefDlg(pB, pCW, pParent, RID_SCDLG_CONDFORMAT ), + maBtnAdd( this, ScResId( BTN_ADD ) ), + maBtnRemove( this, ScResId( BTN_REMOVE ) ), + maBtnOk( this, ScResId( BTN_OK ) ), + maBtnCancel( this, ScResId( BTN_CANCEL ) ), + maFtRange( this, ScResId( FT_RANGE ) ), + maEdRange( this, this, ScResId( ED_RANGE ) ), + maRbRange( this, ScResId( RB_RANGE ), &maEdRange, this ), + maCondFormList( this, ScResId( CTRL_LIST ), pDoc, pFormat, rRange, rPos, eType ), + maPos(rPos), + mpDoc(pDoc), + mpFormat(pFormat), + mpLastEdit(NULL), + meType(eType) +{ + rtl::OUStringBuffer aTitle( GetText() ); + aTitle.append(rtl::OUString(" ")); + rtl::OUString aRangeString; + rRange.Format(aRangeString, SCA_VALID, pDoc, pDoc->GetAddressConvention()); + aTitle.append(aRangeString); + SetText(aTitle.makeStringAndClear()); + maBtnAdd.SetClickHdl( LINK( &maCondFormList, ScCondFormatList, AddBtnHdl ) ); + maBtnRemove.SetClickHdl( LINK( &maCondFormList, ScCondFormatList, RemoveBtnHdl ) ); + maEdRange.SetModifyHdl( LINK( this, ScCondFormatDlg, EdRangeModifyHdl ) ); + maBtnOk.SetClickHdl( LINK( this, ScCondFormatDlg, OkBtnHdl ) ); + maBtnCancel.SetClickHdl( LINK( this, ScCondFormatDlg, CancelBtnHdl ) ); + maEdRange.SetGetFocusHdl( LINK( this, ScCondFormatDlg, RangeGetFocusHdl ) ); + maEdRange.SetLoseFocusHdl( LINK( this, ScCondFormatDlg, RangeLoseFocusHdl ) ); + FreeResource(); - return 0; + maEdRange.SetText(aRangeString); } -IMPL_LINK_NOARG( ScCondFrmtEntry, OptionBtnHdl ) +ScCondFormatDlg::~ScCondFormatDlg() { - SetColorScaleEntry(mpDataBarData->mpLowerLimit.get(), maLbDataBarMinType, maEdDataBarMin, mpDoc, maPos); - SetColorScaleEntry(mpDataBarData->mpUpperLimit.get(), maLbDataBarMaxType, maEdDataBarMax, mpDoc, maPos); - ScDataBarSettingsDlg* pDlg = new ScDataBarSettingsDlg(this, *mpDataBarData, mpDoc); - if( pDlg->Execute() == RET_OK) - { - mpDataBarData.reset(pDlg->GetData()); - SetDataBarEntryTypes(*mpDataBarData->mpLowerLimit, maLbDataBarMinType, maEdDataBarMin); - SetDataBarEntryTypes(*mpDataBarData->mpUpperLimit, maLbDataBarMaxType, maEdDataBarMax); - DataBarTypeSelectHdl(NULL); - } - return 0; } -IMPL_LINK_NOARG( ScCondFrmtEntry, ConditionTypeSelectHdl ) +void ScCondFormatDlg::SetActive() { - if(maLbCondType.GetSelectEntryPos() == 6 || maLbCondType.GetSelectEntryPos() == 7) - { - maEdVal2.Show(); - } + if(mpLastEdit) + mpLastEdit->GrabFocus(); else - { - maEdVal2.Hide(); - } + maEdRange.GrabFocus(); - return 0; + RefInputDone(); } -ScCondFormatList::ScCondFormatList(Window* pParent, const ResId& rResId, ScDocument* pDoc, const ScConditionalFormat* pFormat, const ScRangeList& rRanges, const ScAddress& rPos): - Control(pParent, rResId), - mbHasScrollBar(false), - mpScrollBar(new ScrollBar(this, WB_VERT )), - mpDoc(pDoc), - maPos(rPos), - maRanges(rRanges) +void ScCondFormatDlg::RefInputDone( sal_Bool bForced ) { - mpScrollBar->SetScrollHdl( LINK( this, ScCondFormatList, ScrollHdl ) ); - mpScrollBar->EnableDrag(); - - if(pFormat) - { - size_t nCount = pFormat->size(); - for (size_t nIndex = 0; nIndex < nCount; ++nIndex) - { - maEntries.push_back(new ScCondFrmtEntry( this, mpDoc, pFormat->GetEntry(nIndex), maPos )); - } - if (nCount > 0) - maEntries.begin()->Select(); - } - - RecalcAll(); - FreeResource(); + ScAnyRefDlg::RefInputDone(bForced); } -ScConditionalFormat* ScCondFormatList::GetConditionalFormat() const +sal_Bool ScCondFormatDlg::IsTableLocked() const { - if(maEntries.empty()) - return NULL; + if(mpLastEdit && mpLastEdit != &maEdRange) + return sal_False; - ScConditionalFormat* pFormat = new ScConditionalFormat(0, mpDoc); - for(EntryContainer::const_iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr) - { - ScFormatEntry* pEntry = itr->GetEntry(); - if(pEntry) - pFormat->AddEntry(pEntry); - } - - pFormat->AddRange(maRanges); + return sal_True; +} - return pFormat; +sal_Bool ScCondFormatDlg::IsRefInputMode() const +{ + return maEdRange.IsEnabled(); } -void ScCondFormatList::RecalcAll() +#define ABS_SREF SCA_VALID \ + | SCA_COL_ABSOLUTE | SCA_ROW_ABSOLUTE | SCA_TAB_ABSOLUTE +#define ABS_DREF ABS_SREF \ + | SCA_COL2_ABSOLUTE | SCA_ROW2_ABSOLUTE | SCA_TAB2_ABSOLUTE +#define ABS_DREF3D ABS_DREF | SCA_TAB_3D + +void ScCondFormatDlg::SetReference(const ScRange& rRef, ScDocument*) { - sal_Int32 nTotalHeight = 0; - sal_Int32 nIndex = 1; - for(EntryContainer::iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr) - { - nTotalHeight += itr->GetSizePixel().Height(); - itr->SetIndex( nIndex ); - ++nIndex; - } + formula::RefEdit* pEdit = mpLastEdit; + if(!mpLastEdit) + pEdit = &maEdRange; - Size aCtrlSize = GetOutputSize(); - long nSrcBarSize = GetSettings().GetStyleSettings().GetScrollBarSize(); - if(nTotalHeight > GetSizePixel().Height()) + if( pEdit->IsEnabled() ) { - mbHasScrollBar = true; - mpScrollBar->SetPosSizePixel(Point(aCtrlSize.Width() -nSrcBarSize, 0), - Size(nSrcBarSize, aCtrlSize.Height()) ); - mpScrollBar->SetRangeMax(nTotalHeight); - mpScrollBar->SetVisibleSize(aCtrlSize.Height()); - mpScrollBar->Show(); - } - else - { - mbHasScrollBar = false; - mpScrollBar->Hide(); - } + if(rRef.aStart != rRef.aEnd) + RefInputStart(pEdit); - Point aPoint(0,-1*mpScrollBar->GetThumbPos()); - for(EntryContainer::iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr) - { - itr->SetPosPixel(aPoint); - Size aSize = itr->GetSizePixel(); - if(mbHasScrollBar) - aSize.Width() = aCtrlSize.Width() - nSrcBarSize; + rtl::OUString aRefStr; + sal_uInt16 n = 0; + if(mpLastEdit && mpLastEdit != &maEdRange) + n = ABS_DREF3D; else - aSize.Width() = aCtrlSize.Width(); - itr->SetSizePixel(aSize); + n = ABS_DREF; - aPoint.Y() += itr->GetSizePixel().Height(); + rRef.Format( aRefStr, n, mpDoc, ScAddress::Details(mpDoc->GetAddressConvention(), 0, 0) ); + pEdit->SetRefString( aRefStr ); } } -void ScCondFormatList::DoScroll(long nDelta) +ScConditionalFormat* ScCondFormatDlg::GetConditionalFormat() const { - Point aNewPoint = mpScrollBar->GetPosPixel(); - Rectangle aRect(Point(), GetOutputSize()); - aRect.Right() -= mpScrollBar->GetSizePixel().Width(); - Scroll( 0, -nDelta, aRect ); - mpScrollBar->SetPosPixel(aNewPoint); -} + rtl::OUString aRangeStr = maEdRange.GetText(); + ScRangeList aRange; + sal_uInt16 nFlags = aRange.Parse(aRangeStr, mpDoc, SCA_VALID, mpDoc->GetAddressConvention()); + ScConditionalFormat* pFormat = maCondFormList.GetConditionalFormat(); -ScCondFormatDlg::ScCondFormatDlg(Window* pParent, ScDocument* pDoc, const ScConditionalFormat* pFormat, const ScRangeList& rRange, const ScAddress& rPos): - ModalDialog(pParent, ScResId( RID_SCDLG_CONDFORMAT )), - maBtnAdd( this, ScResId( BTN_ADD ) ), - maBtnRemove( this, ScResId( BTN_REMOVE ) ), - maBtnOk( this, ScResId( BTN_OK ) ), - maBtnCancel( this, ScResId( BTN_CANCEL ) ), - maCondFormList( this, ScResId( CTRL_LIST ), pDoc, pFormat, rRange, rPos ), - maPos(rPos) -{ + if(nFlags & SCA_VALID && !aRange.empty() && pFormat) + pFormat->AddRange(aRange); - rtl::OUStringBuffer aTitle( GetText() ); - aTitle.append(rtl::OUString(" ")); - rtl::OUString aRangeString; - rRange.Format(aRangeString, SCA_VALID, pDoc, pDoc->GetAddressConvention()); - aTitle.append(aRangeString); - SetText(aTitle.makeStringAndClear()); - maBtnAdd.SetClickHdl( LINK( &maCondFormList, ScCondFormatList, AddBtnHdl ) ); - maBtnRemove.SetClickHdl( LINK( &maCondFormList, ScCondFormatList, RemoveBtnHdl ) ); - FreeResource(); + return pFormat; } -ScConditionalFormat* ScCondFormatDlg::GetConditionalFormat() const +void ScCondFormatDlg::InvalidateRefData() { - return maCondFormList.GetConditionalFormat(); + mpLastEdit = NULL; } -IMPL_LINK_NOARG( ScCondFormatList, AddBtnHdl ) +IMPL_LINK( ScCondFormatDlg, EdRangeModifyHdl, Edit*, pEdit ) { - ScCondFrmtEntry* pNewEntry = new ScCondFrmtEntry(this, mpDoc, maPos); - maEntries.push_back( pNewEntry ); - for(EntryContainer::iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr) - { - itr->Deselect(); - } - pNewEntry->Select(); - RecalcAll(); + rtl::OUString aRangeStr = pEdit->GetText(); + ScRangeList aRange; + sal_uInt16 nFlags = aRange.Parse(aRangeStr, mpDoc, SCA_VALID, mpDoc->GetAddressConvention()); + if(nFlags & SCA_VALID) + pEdit->SetControlBackground(GetSettings().GetStyleSettings().GetWindowColor()); + else + pEdit->SetControlBackground(COL_LIGHTRED); return 0; } -IMPL_LINK_NOARG( ScCondFormatList, RemoveBtnHdl ) +sal_Bool ScCondFormatDlg::Close() { - for(EntryContainer::iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr) + sal_uInt16 nId = 0; + switch(meType) { - if(itr->IsSelected()) - { - maEntries.erase(itr); + case condformat::dialog::NONE: + case condformat::dialog::CONDITION: + nId = ScCondFormatConditionDlgWrapper::GetChildWindowId(); + break; + case condformat::dialog::COLORSCALE: + nId = ScCondFormatColorScaleDlgWrapper::GetChildWindowId(); + break; + case condformat::dialog::DATABAR: + nId = ScCondFormatDataBarDlgWrapper::GetChildWindowId(); break; - } } - RecalcAll(); + + return DoClose(nId); +} + +IMPL_LINK_NOARG( ScCondFormatDlg, OkBtnHdl ) +{ + ScConditionalFormat* pFormat = GetConditionalFormat(); + SfxObjectShell* pObjectShell = mpDoc->GetDocumentShell(); + sal_Int32 nKey = 0; + if(mpFormat) + nKey = mpFormat->GetKey(); + + static_cast<ScDocShell*>(pObjectShell)->GetDocFunc().ReplaceConditionalFormat(nKey, pFormat, maPos.Tab(), pFormat->GetRange()); + + Close(); return 0; } -IMPL_LINK( ScCondFormatList, EntrySelectHdl, ScCondFrmtEntry*, pEntry ) +IMPL_LINK_NOARG( ScCondFormatDlg, CancelBtnHdl ) { - for(EntryContainer::iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr) - { - itr->Deselect(); - } - pEntry->Select(); - RecalcAll(); + Close(); + return 0; } -IMPL_LINK_NOARG( ScCondFormatList, ScrollHdl ) +IMPL_LINK( ScCondFormatDlg, RangeGetFocusHdl, formula::RefEdit*, pEdit ) { - DoScroll(mpScrollBar->GetDelta()); + mpLastEdit = pEdit; return 0; } +IMPL_LINK_NOARG( ScCondFormatDlg, RangeLoseFocusHdl ) +{ + //mpLastEdit = NULL; + return 0; +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx new file mode 100644 index 000000000000..58f59bb18940 --- /dev/null +++ b/sc/source/ui/condformat/condformatdlgentry.cxx @@ -0,0 +1,1080 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include "condformatdlg.hxx" +#include "condformatdlgentry.hxx" +#include "condformatdlg.hrc" +#include "conditio.hxx" + +#include "document.hxx" + +#include <vcl/vclevent.hxx> +#include <svl/style.hxx> +#include <sfx2/dispatch.hxx> +#include <svl/stritem.hxx> +#include <svl/intitem.hxx> +#include <svx/xtable.hxx> +#include <svx/drawitem.hxx> +#include <vcl/msgbox.hxx> +#include "stlpool.hxx" +#include "tabvwsh.hxx" + +#include "colorformat.hxx" + +#include "globstr.hrc" + +ScCondFrmtEntry::ScCondFrmtEntry(Window* pParent, ScDocument* pDoc, const ScAddress& rPos): + Control(pParent, ScResId( RID_COND_ENTRY ) ), + mbActive(false), + maFtCondNr( this, ScResId( FT_COND_NR ) ), + maFtCondition( this, ScResId( FT_CONDITION ) ), + mnIndex(0), + maStrCondition(ScResId( STR_CONDITION ).toString()), + maLbType( this, ScResId( LB_TYPE ) ), + mpDoc(pDoc), + maPos(rPos) +{ + SetControlBackground(GetSettings().GetStyleSettings().GetDialogColor()); + + maLbType.SetSelectHdl( LINK( pParent, ScCondFormatList, TypeListHdl ) ); + maClickHdl = LINK( pParent, ScCondFormatList, EntrySelectHdl ); +} + +ScCondFrmtEntry::~ScCondFrmtEntry() +{ +} + +long ScCondFrmtEntry::Notify( NotifyEvent& rNEvt ) +{ + if( rNEvt.GetType() == EVENT_MOUSEBUTTONDOWN ) + { + ImplCallEventListenersAndHandler( VCLEVENT_WINDOW_MOUSEBUTTONDOWN, maClickHdl, this ); + } + return Control::Notify(rNEvt); +} + +void ScCondFrmtEntry::SetIndex(sal_Int32 nIndex) +{ + mnIndex = nIndex; + rtl::OUStringBuffer aBuffer(maStrCondition); + aBuffer.append(rtl::OUString::valueOf(nIndex)); + maFtCondNr.SetText(aBuffer.makeStringAndClear()); +} + +void ScCondFrmtEntry::SetHeight() +{ + long nPad = LogicToPixel(Size(42,2), MapMode(MAP_APPFONT)).getHeight(); + + // Calculate maximum height we need from visible widgets + sal_uInt16 nChildren = GetChildCount(); + + long nMaxHeight = 0; + for(sal_uInt16 i = 0; i < nChildren; i++) + { + Window *pChild = GetChild(i); + if(!pChild || !pChild->IsVisible()) + continue; + Point aPos = pChild->GetPosPixel(); + Size aSize = pChild->GetSizePixel(); + nMaxHeight = std::max(aPos.Y() + aSize.Height(), nMaxHeight); + } + Size aSize = GetSizePixel(); + if(nMaxHeight > 0) + { + aSize.Height() = nMaxHeight + nPad; + SetSizePixel(aSize); + } +} + +void ScCondFrmtEntry::Select() +{ + maFtCondition.SetText(rtl::OUString()); + maFtCondition.Hide(); + maLbType.Show(); + mbActive = true; + SetHeight(); +} + +void ScCondFrmtEntry::Deselect() +{ + rtl::OUString maCondText = GetExpressionString(); + maFtCondition.SetText(maCondText); + maFtCondition.Show(); + maLbType.Hide(); + mbActive = false; + SetHeight(); +} + +bool ScCondFrmtEntry::IsSelected() const +{ + return mbActive; +} + +IMPL_LINK(ScCondFrmtEntry, EdModifyHdl, Edit*, pEdit) +{ + rtl::OUString aFormula = pEdit->GetText(); + ScCompiler aComp( mpDoc, maPos ); + aComp.SetGrammar( mpDoc->GetGrammar() ); + boost::scoped_ptr<ScTokenArray> mpCode(aComp.CompileString(aFormula)); + if(mpCode->GetCodeError()) + { + pEdit->SetControlBackground(COL_LIGHTRED); + } + else + { + pEdit->SetControlBackground(GetSettings().GetStyleSettings().GetWindowColor()); + } + return 0; +} + +// +//condition + +ScConditionFrmtEntry::ScConditionFrmtEntry( Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScCondFormatEntry* pFormatEntry ): + ScCondFrmtEntry( pParent, pDoc, rPos ), + maLbCondType( this, ScResId( LB_CELLIS_TYPE ) ), + maEdVal1( this, static_cast<ScAnyRefDlg*>(pParent->GetParent()), ScResId( ED_VAL1 ) ), + maEdVal2( this, static_cast<ScAnyRefDlg*>(pParent->GetParent()), ScResId( ED_VAL2 ) ), + maFtStyle( this, ScResId( FT_STYLE ) ), + maLbStyle( this, ScResId( LB_STYLE ) ), + maWdPreview( this, ScResId( WD_PREVIEW ) ) +{ + + FreeResource(); + maLbType.SelectEntryPos(1); + + Init(); + + if(pFormatEntry) + { + rtl::OUString aStyleName = pFormatEntry->GetStyle(); + maLbStyle.SelectEntry(aStyleName); + StyleSelectHdl(NULL); + ScConditionMode eMode = pFormatEntry->GetOperation(); + maEdVal1.SetText(pFormatEntry->GetExpression(maPos, 0)); + switch(eMode) + { + case SC_COND_EQUAL: + maLbCondType.SelectEntryPos(0); + break; + case SC_COND_LESS: + maLbCondType.SelectEntryPos(1); + break; + case SC_COND_GREATER: + maLbCondType.SelectEntryPos(2); + break; + case SC_COND_EQLESS: + maLbCondType.SelectEntryPos(3); + break; + case SC_COND_EQGREATER: + maLbCondType.SelectEntryPos(4); + break; + case SC_COND_NOTEQUAL: + maLbCondType.SelectEntryPos(5); + break; + case SC_COND_BETWEEN: + maEdVal2.SetText(pFormatEntry->GetExpression(maPos, 1)); + maLbCondType.SelectEntryPos(6); + break; + case SC_COND_NOTBETWEEN: + maEdVal2.SetText(pFormatEntry->GetExpression(maPos, 1)); + maLbCondType.SelectEntryPos(7); + break; + case SC_COND_DUPLICATE: + maLbCondType.SelectEntryPos(8); + break; + case SC_COND_NOTDUPLICATE: + maLbCondType.SelectEntryPos(9); + break; + case SC_COND_DIRECT: + //maLbType.SelectEntryPos(2); + break; + case SC_COND_NONE: + break; + } + } + else + { + maLbCondType.SelectEntryPos(0); + maEdVal2.Hide(); + maLbStyle.SelectEntryPos(1); + } + maLbType.SelectEntryPos(1); +} + +void ScConditionFrmtEntry::Init() +{ + maLbStyle.SetSeparatorPos(0); + maEdVal1.SetGetFocusHdl( LINK( GetParent()->GetParent(), ScCondFormatDlg, RangeGetFocusHdl ) ); + maEdVal2.SetGetFocusHdl( LINK( GetParent()->GetParent(), ScCondFormatDlg, RangeGetFocusHdl ) ); + maEdVal1.SetLoseFocusHdl( LINK( GetParent()->GetParent(), ScCondFormatDlg, RangeLoseFocusHdl ) ); + maEdVal2.SetLoseFocusHdl( LINK( GetParent()->GetParent(), ScCondFormatDlg, RangeLoseFocusHdl ) ); + + maEdVal1.SetStyle( maEdVal1.GetStyle() | WB_FORCECTRLBACKGROUND ); + maEdVal2.SetStyle( maEdVal2.GetStyle() | WB_FORCECTRLBACKGROUND ); + + maEdVal1.SetModifyHdl( LINK( this, ScCondFrmtEntry, EdModifyHdl ) ); + maEdVal2.SetModifyHdl( LINK( this, ScCondFrmtEntry, EdModifyHdl ) ); + + SfxStyleSheetIterator aStyleIter( mpDoc->GetStyleSheetPool(), SFX_STYLE_FAMILY_PARA ); + for ( SfxStyleSheetBase* pStyle = aStyleIter.First(); pStyle; pStyle = aStyleIter.Next() ) + { + rtl::OUString aName = pStyle->GetName(); + maLbStyle.InsertEntry( aName ); + } + maLbStyle.SetSelectHdl( LINK( this, ScConditionFrmtEntry, StyleSelectHdl ) ); + + maLbCondType.SetSelectHdl( LINK( this, ScConditionFrmtEntry, ConditionTypeSelectHdl ) ); +} + +ScFormatEntry* ScConditionFrmtEntry::createConditionEntry() const +{ + ScConditionMode eMode; + rtl::OUString aExpr2; + switch(maLbCondType.GetSelectEntryPos()) + { + case 0: + eMode = SC_COND_EQUAL; + break; + case 1: + eMode = SC_COND_LESS; + break; + case 2: + eMode = SC_COND_GREATER; + break; + case 3: + eMode = SC_COND_EQLESS; + break; + case 4: + eMode = SC_COND_EQGREATER; + break; + case 5: + eMode = SC_COND_NOTEQUAL; + break; + case 6: + aExpr2 = maEdVal2.GetText(); + eMode = SC_COND_BETWEEN; + if(aExpr2.isEmpty()) + return NULL; + break; + case 7: + eMode = SC_COND_NOTBETWEEN; + aExpr2 = maEdVal2.GetText(); + if(aExpr2.isEmpty()) + return NULL; + break; + case 8: + eMode = SC_COND_DUPLICATE; + break; + case 9: + eMode = SC_COND_NOTDUPLICATE; + break; + default: + assert(false); // this cannot happen + return NULL; + } + + rtl::OUString aExpr1 = maEdVal1.GetText(); + + ScFormatEntry* pEntry = new ScCondFormatEntry(eMode, aExpr1, aExpr2, mpDoc, maPos, maLbStyle.GetSelectEntry()); + + return pEntry; +} + +rtl::OUString ScConditionFrmtEntry::GetExpressionString() +{ + return ScCondFormatHelper::GetExpression(CONDITION, maLbCondType.GetSelectEntryPos(), maEdVal1.GetText(), maEdVal2.GetText()); +} + +ScFormatEntry* ScConditionFrmtEntry::GetEntry() const +{ + return createConditionEntry(); +} + +void ScConditionFrmtEntry::SetActive() +{ + maLbCondType.Show(); + maEdVal1.Show(); + if(maLbCondType.GetSelectEntryPos() == 6 || maLbCondType.GetSelectEntryPos() == 7) + maEdVal2.Show(); + maFtStyle.Show(); + maLbStyle.Show(); + maWdPreview.Show(); + + Select(); +} + +void ScConditionFrmtEntry::SetInactive() +{ + maLbCondType.Hide(); + maEdVal1.Hide(); + maEdVal2.Hide(); + maFtStyle.Hide(); + maLbStyle.Hide(); + maWdPreview.Hide(); + + Deselect(); +} + +IMPL_LINK_NOARG(ScConditionFrmtEntry, StyleSelectHdl) +{ + if(maLbStyle.GetSelectEntryPos() == 0) + { + // call new style dialog + SfxUInt16Item aFamilyItem( SID_STYLE_FAMILY, SFX_STYLE_FAMILY_PARA ); + SfxStringItem aRefItem( SID_STYLE_REFERENCE, ScGlobal::GetRscString(STR_STYLENAME_STANDARD) ); + + // unlock the dispatcher so SID_STYLE_NEW can be executed + // (SetDispatcherLock would affect all Calc documents) + ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); + SfxDispatcher* pDisp = pViewShell->GetDispatcher(); + sal_Bool bLocked = pDisp->IsLocked(); + if (bLocked) + pDisp->Lock(false); + + // Execute the "new style" slot, complete with undo and all necessary updates. + // The return value (SfxUInt16Item) is ignored, look for new styles instead. + pDisp->Execute( SID_STYLE_NEW, SFX_CALLMODE_SYNCHRON | SFX_CALLMODE_RECORD | SFX_CALLMODE_MODAL, + &aFamilyItem, + &aRefItem, + 0L ); + + if (bLocked) + pDisp->Lock(sal_True); + + // Find the new style and add it into the style list boxes + rtl::OUString aNewStyle; + SfxStyleSheetIterator aStyleIter( mpDoc->GetStyleSheetPool(), SFX_STYLE_FAMILY_PARA ); + for ( SfxStyleSheetBase* pStyle = aStyleIter.First(); pStyle; pStyle = aStyleIter.Next() ) + { + rtl::OUString aName = pStyle->GetName(); + if ( maLbStyle.GetEntryPos(aName) == LISTBOX_ENTRY_NOTFOUND ) // all lists contain the same entries + { + maLbStyle.InsertEntry(aName); + maLbStyle.SelectEntry(aName); + } + } + } + + rtl::OUString aStyleName = maLbStyle.GetSelectEntry(); + SfxStyleSheetBase* pStyleSheet = mpDoc->GetStyleSheetPool()->Find( aStyleName, SFX_STYLE_FAMILY_PARA ); + if(pStyleSheet) + { + const SfxItemSet& rSet = pStyleSheet->GetItemSet(); + maWdPreview.Init( rSet ); + } + + return 0; +} + +// formula + +ScFormulaFrmtEntry::ScFormulaFrmtEntry( Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScCondFormatEntry* pFormat ): + ScCondFrmtEntry( pParent, pDoc, rPos ), + maFtStyle( this, ScResId( FT_STYLE ) ), + maLbStyle( this, ScResId( LB_STYLE ) ), + maWdPreview( this, ScResId( WD_PREVIEW ) ), + maEdFormula( this, static_cast<ScAnyRefDlg*>(pParent->GetParent()), ScResId( ED_FORMULA ) ) +{ + Init(); + + FreeResource(); + maLbType.SelectEntryPos(2); + + if(pFormat) + { + maEdFormula.SetText(pFormat->GetExpression(rPos, 0, 0, pDoc->GetGrammar())); + maLbStyle.SelectEntry(pFormat->GetStyle()); + } + else + { + maLbStyle.SelectEntryPos(1); + } +} + +void ScFormulaFrmtEntry::Init() +{ + maLbStyle.SetSeparatorPos(0); + maEdFormula.SetGetFocusHdl( LINK( GetParent()->GetParent(), ScCondFormatDlg, RangeGetFocusHdl ) ); + maEdFormula.SetLoseFocusHdl( LINK( GetParent()->GetParent(), ScCondFormatDlg, RangeLoseFocusHdl ) ); + + SfxStyleSheetIterator aStyleIter( mpDoc->GetStyleSheetPool(), SFX_STYLE_FAMILY_PARA ); + for ( SfxStyleSheetBase* pStyle = aStyleIter.First(); pStyle; pStyle = aStyleIter.Next() ) + { + rtl::OUString aName = pStyle->GetName(); + maLbStyle.InsertEntry( aName ); + } + maLbStyle.SetSelectHdl( LINK( this, ScFormulaFrmtEntry, StyleSelectHdl ) ); +} + +IMPL_LINK_NOARG(ScFormulaFrmtEntry, StyleSelectHdl) +{ + if(maLbStyle.GetSelectEntryPos() == 0) + { + // call new style dialog + SfxUInt16Item aFamilyItem( SID_STYLE_FAMILY, SFX_STYLE_FAMILY_PARA ); + SfxStringItem aRefItem( SID_STYLE_REFERENCE, ScGlobal::GetRscString(STR_STYLENAME_STANDARD) ); + + // unlock the dispatcher so SID_STYLE_NEW can be executed + // (SetDispatcherLock would affect all Calc documents) + ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); + SfxDispatcher* pDisp = pViewShell->GetDispatcher(); + sal_Bool bLocked = pDisp->IsLocked(); + if (bLocked) + pDisp->Lock(false); + + // Execute the "new style" slot, complete with undo and all necessary updates. + // The return value (SfxUInt16Item) is ignored, look for new styles instead. + pDisp->Execute( SID_STYLE_NEW, SFX_CALLMODE_SYNCHRON | SFX_CALLMODE_RECORD | SFX_CALLMODE_MODAL, + &aFamilyItem, + &aRefItem, + 0L ); + + if (bLocked) + pDisp->Lock(sal_True); + + // Find the new style and add it into the style list boxes + rtl::OUString aNewStyle; + SfxStyleSheetIterator aStyleIter( mpDoc->GetStyleSheetPool(), SFX_STYLE_FAMILY_PARA ); + for ( SfxStyleSheetBase* pStyle = aStyleIter.First(); pStyle; pStyle = aStyleIter.Next() ) + { + rtl::OUString aName = pStyle->GetName(); + if ( maLbStyle.GetEntryPos(aName) == LISTBOX_ENTRY_NOTFOUND ) // all lists contain the same entries + { + maLbStyle.InsertEntry(aName); + maLbStyle.SelectEntry(aName); + } + } + } + + rtl::OUString aStyleName = maLbStyle.GetSelectEntry(); + SfxStyleSheetBase* pStyleSheet = mpDoc->GetStyleSheetPool()->Find( aStyleName, SFX_STYLE_FAMILY_PARA ); + if(pStyleSheet) + { + const SfxItemSet& rSet = pStyleSheet->GetItemSet(); + maWdPreview.Init( rSet ); + } + + return 0; +} + +ScFormatEntry* ScFormulaFrmtEntry::createFormulaEntry() const +{ + ScConditionMode eMode = SC_COND_DIRECT; + rtl::OUString aFormula = maEdFormula.GetText(); + if(aFormula.isEmpty()) + return NULL; + + rtl::OUString aExpr2; + ScFormatEntry* pEntry = new ScCondFormatEntry(eMode, aFormula, aExpr2, mpDoc, maPos, maLbStyle.GetSelectEntry()); + return pEntry; +} + +ScFormatEntry* ScFormulaFrmtEntry::GetEntry() const +{ + return createFormulaEntry(); +} + +rtl::OUString ScFormulaFrmtEntry::GetExpressionString() +{ + return ScCondFormatHelper::GetExpression(FORMULA, 0, maEdFormula.GetText()); +} + +void ScFormulaFrmtEntry::SetActive() +{ + maWdPreview.Show(); + maFtStyle.Show(); + maLbStyle.Show(); + maEdFormula.Show(); + + Select(); +} + +void ScFormulaFrmtEntry::SetInactive() +{ + maWdPreview.Hide(); + maFtStyle.Hide(); + maLbStyle.Hide(); + maEdFormula.Hide(); + + Deselect(); +} + +//color scale + +namespace { + +void SetColorScaleEntryTypes( const ScColorScaleEntry& rEntry, ListBox& rLbType, Edit& rEdit, ColorListBox& rLbCol ) +{ + rLbType.SelectEntryPos(rEntry.GetType()); + switch(rEntry.GetType()) + { + case COLORSCALE_MIN: + case COLORSCALE_MAX: + break; + case COLORSCALE_PERCENTILE: + case COLORSCALE_VALUE: + case COLORSCALE_PERCENT: + rEdit.SetText(rtl::OUString::valueOf(rEntry.GetValue())); + break; + case COLORSCALE_FORMULA: + rEdit.SetText(rEntry.GetFormula(formula::FormulaGrammar::GRAM_DEFAULT)); + break; + case COLORSCALE_AUTO: + abort(); + break; + } + rLbCol.SelectEntry(rEntry.GetColor()); +} + +void SetColorScaleEntry( ScColorScaleEntry* pEntry, const ListBox& rType, const Edit& rValue, ScDocument* pDoc, const ScAddress& rPos, bool bDataBar ) +{ + sal_uInt32 nIndex = 0; + double nVal = 0; + SvNumberFormatter* pNumberFormatter = pDoc->GetFormatTable(); + pNumberFormatter->IsNumberFormat(rValue.GetText(), nIndex, nVal); + + // color scale does not have the automatic entry + sal_Int32 nPos = rType.GetSelectEntryPos(); + if(!bDataBar) + ++nPos; + + pEntry->SetType(static_cast<ScColorScaleEntryType>(nPos)); + switch(nPos) + { + case COLORSCALE_AUTO: + case COLORSCALE_MIN: + case COLORSCALE_MAX: + break; + break; + break; + case COLORSCALE_PERCENTILE: + case COLORSCALE_VALUE: + case COLORSCALE_PERCENT: + pEntry->SetValue(nVal); + break; + case COLORSCALE_FORMULA: + pEntry->SetFormula(rValue.GetText(), pDoc, rPos); + break; + default: + break; + } +} + +ScColorScaleEntry* createColorScaleEntry( const ListBox& rType, const ColorListBox& rColor, const Edit& rValue, ScDocument* pDoc, const ScAddress& rPos ) +{ + ScColorScaleEntry* pEntry = new ScColorScaleEntry(); + + SetColorScaleEntry( pEntry, rType, rValue, pDoc, rPos, false ); + Color aColor = rColor.GetSelectEntryColor(); + pEntry->SetColor(aColor); + return pEntry; +} + +} + +ScColorScale2FrmtEntry::ScColorScale2FrmtEntry( Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScColorScaleFormat* pFormat ): + ScCondFrmtEntry( pParent, pDoc, rPos ), + maLbColorFormat( this, ScResId( LB_COLOR_FORMAT ) ), + maLbEntryTypeMin( this, ScResId( LB_TYPE_COL_SCALE_MIN ) ), + maLbEntryTypeMax( this, ScResId( LB_TYPE_COL_SCALE_MAX ) ), + maEdMin( this, ScResId( ED_COL_SCALE_MIN ) ), + maEdMax( this, ScResId( ED_COL_SCALE_MAX ) ), + maLbColMin( this, ScResId( LB_COL_MIN ) ), + maLbColMax( this, ScResId( LB_COL_MAX ) ) +{ + // remove the automatic entry from color scales + maLbEntryTypeMin.RemoveEntry(0); + maLbEntryTypeMax.RemoveEntry(0); + + maLbType.SelectEntryPos(0); + maLbColorFormat.SelectEntryPos(0); + if(pFormat) + { + ScColorScaleFormat::const_iterator itr = pFormat->begin(); + SetColorScaleEntryTypes(*itr, maLbEntryTypeMin, maEdMin, maLbColMin); + ++itr; + SetColorScaleEntryTypes(*itr, maLbEntryTypeMax, maEdMax, maLbColMax); + } + else + { + maLbEntryTypeMin.SelectEntryPos(0); + maLbEntryTypeMax.SelectEntryPos(1); + } + FreeResource(); + + maLbColorFormat.SetSelectHdl( LINK( pParent, ScCondFormatList, ColFormatTypeHdl ) ); + + Init(); +} + +void ScColorScale2FrmtEntry::Init() +{ + maLbEntryTypeMin.SetSelectHdl( LINK( this, ScColorScale2FrmtEntry, EntryTypeHdl ) ); + maLbEntryTypeMax.SetSelectHdl( LINK( this, ScColorScale2FrmtEntry, EntryTypeHdl ) ); + + SfxObjectShell* pDocSh = SfxObjectShell::Current(); + const SfxPoolItem* pItem = NULL; + XColorListRef pColorTable; + + DBG_ASSERT( pDocSh, "DocShell not found!" ); + + if ( pDocSh ) + { + pItem = pDocSh->GetItem( SID_COLOR_TABLE ); + if ( pItem != NULL ) + pColorTable = ( (SvxColorListItem*)pItem )->GetColorList(); + } + if ( pColorTable.is() ) + { + // filling the line color box + maLbColMin.SetUpdateMode( false ); + maLbColMax.SetUpdateMode( false ); + + for ( long i = 0; i < pColorTable->Count(); ++i ) + { + XColorEntry* pEntry = pColorTable->GetColor(i); + maLbColMin.InsertEntry( pEntry->GetColor(), pEntry->GetName() ); + maLbColMax.InsertEntry( pEntry->GetColor(), pEntry->GetName() ); + + if(pEntry->GetColor() == Color(COL_LIGHTRED)) + maLbColMin.SelectEntryPos(i); + if(pEntry->GetColor() == Color(COL_LIGHTBLUE)) + maLbColMax.SelectEntryPos(i); + } + maLbColMin.SetUpdateMode( sal_True ); + maLbColMax.SetUpdateMode( sal_True ); + } + + EntryTypeHdl(&maLbEntryTypeMin); + EntryTypeHdl(&maLbEntryTypeMax); +} + +ScFormatEntry* ScColorScale2FrmtEntry::createColorscaleEntry() const +{ + ScColorScaleFormat* pColorScale = new ScColorScaleFormat(mpDoc); + pColorScale->AddEntry(createColorScaleEntry(maLbEntryTypeMin, maLbColMin, maEdMin, mpDoc, maPos)); + pColorScale->AddEntry(createColorScaleEntry(maLbEntryTypeMax, maLbColMax, maEdMax, mpDoc, maPos)); + return pColorScale; +} + +rtl::OUString ScColorScale2FrmtEntry::GetExpressionString() +{ + return ScCondFormatHelper::GetExpression( COLORSCALE, 0 ); +} + +ScFormatEntry* ScColorScale2FrmtEntry::GetEntry() const +{ + return createColorscaleEntry(); +} + +void ScColorScale2FrmtEntry::SetActive() +{ + maLbColorFormat.Show(); + + maLbEntryTypeMin.Show(); + maLbEntryTypeMax.Show(); + + maEdMin.Show(); + maEdMax.Show(); + + maLbColMin.Show(); + maLbColMax.Show(); + + Select(); +} + +void ScColorScale2FrmtEntry::SetInactive() +{ + maLbColorFormat.Hide(); + + maLbEntryTypeMin.Hide(); + maLbEntryTypeMax.Hide(); + + maEdMin.Hide(); + maEdMax.Hide(); + + maLbColMin.Hide(); + maLbColMax.Hide(); + + Deselect(); +} + +IMPL_LINK( ScColorScale2FrmtEntry, EntryTypeHdl, ListBox*, pBox ) +{ + bool bEnableEdit = true; + sal_Int32 nPos = pBox->GetSelectEntryPos(); + if(nPos < 2) + { + bEnableEdit = false; + } + + Edit* pEd = NULL; + if(pBox == &maLbEntryTypeMin) + pEd = &maEdMin; + else if(pBox == &maLbEntryTypeMax) + pEd = &maEdMax; + + if(bEnableEdit) + pEd->Enable(); + else + pEd->Disable(); + + return 0; +} + +ScColorScale3FrmtEntry::ScColorScale3FrmtEntry( Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScColorScaleFormat* pFormat ): + ScCondFrmtEntry( pParent, pDoc, rPos ), + maLbColorFormat( this, ScResId( LB_COLOR_FORMAT ) ), + maLbEntryTypeMin( this, ScResId( LB_TYPE_COL_SCALE_MIN ) ), + maLbEntryTypeMiddle( this, ScResId( LB_TYPE_COL_SCALE_MIDDLE ) ), + maLbEntryTypeMax( this, ScResId( LB_TYPE_COL_SCALE_MAX ) ), + maEdMin( this, ScResId( ED_COL_SCALE_MIN ) ), + maEdMiddle( this, ScResId( ED_COL_SCALE_MIDDLE ) ), + maEdMax( this, ScResId( ED_COL_SCALE_MAX ) ), + maLbColMin( this, ScResId( LB_COL_MIN ) ), + maLbColMiddle( this, ScResId( LB_COL_MIDDLE ) ), + maLbColMax( this, ScResId( LB_COL_MAX ) ) +{ + // remove the automatic entry from color scales + maLbEntryTypeMin.RemoveEntry(0); + maLbEntryTypeMiddle.RemoveEntry(0); + maLbEntryTypeMax.RemoveEntry(0); + + maLbType.SelectEntryPos(0); + if(pFormat) + { + if(pFormat->size() == 2) + maLbColorFormat.SelectEntryPos(0); + else + maLbColorFormat.SelectEntryPos(1); + ScColorScaleFormat::const_iterator itr = pFormat->begin(); + SetColorScaleEntryTypes(*itr, maLbEntryTypeMin, maEdMin, maLbColMin); + if(pFormat->size() == 3) + { + ++itr; + SetColorScaleEntryTypes(*itr, maLbEntryTypeMiddle, maEdMiddle, maLbColMiddle); + } + ++itr; + SetColorScaleEntryTypes(*itr, maLbEntryTypeMax, maEdMax, maLbColMax); + } + else + { + maLbColorFormat.SelectEntryPos(1); + maLbEntryTypeMin.SelectEntryPos(0); + maLbEntryTypeMiddle.SelectEntryPos(2); + maLbEntryTypeMax.SelectEntryPos(1); + maEdMiddle.SetText(rtl::OUString::valueOf(static_cast<sal_Int32>(50))); + } + FreeResource(); + + maLbColorFormat.SetSelectHdl( LINK( pParent, ScCondFormatList, ColFormatTypeHdl ) ); + + Init(); +} + +void ScColorScale3FrmtEntry::Init() +{ + maLbEntryTypeMin.SetSelectHdl( LINK( this, ScColorScale3FrmtEntry, EntryTypeHdl ) ); + maLbEntryTypeMax.SetSelectHdl( LINK( this, ScColorScale3FrmtEntry, EntryTypeHdl ) ); + maLbEntryTypeMiddle.SetSelectHdl( LINK( this, ScColorScale3FrmtEntry, EntryTypeHdl ) ); + + SfxObjectShell* pDocSh = SfxObjectShell::Current(); + const SfxPoolItem* pItem = NULL; + XColorListRef pColorTable; + + DBG_ASSERT( pDocSh, "DocShell not found!" ); + + if ( pDocSh ) + { + pItem = pDocSh->GetItem( SID_COLOR_TABLE ); + if ( pItem != NULL ) + pColorTable = ( (SvxColorListItem*)pItem )->GetColorList(); + } + if ( pColorTable.is() ) + { + // filling the line color box + maLbColMin.SetUpdateMode( false ); + maLbColMiddle.SetUpdateMode( false ); + maLbColMax.SetUpdateMode( false ); + + for ( long i = 0; i < pColorTable->Count(); ++i ) + { + XColorEntry* pEntry = pColorTable->GetColor(i); + maLbColMin.InsertEntry( pEntry->GetColor(), pEntry->GetName() ); + maLbColMiddle.InsertEntry( pEntry->GetColor(), pEntry->GetName() ); + maLbColMax.InsertEntry( pEntry->GetColor(), pEntry->GetName() ); + + if(pEntry->GetColor() == Color(COL_LIGHTRED)) + maLbColMin.SelectEntryPos(i); + if(pEntry->GetColor() == Color(COL_GREEN)) + maLbColMiddle.SelectEntryPos(i); + if(pEntry->GetColor() == Color(COL_LIGHTBLUE)) + maLbColMax.SelectEntryPos(i); + } + maLbColMin.SetUpdateMode( sal_True ); + maLbColMiddle.SetUpdateMode( sal_True ); + maLbColMax.SetUpdateMode( sal_True ); + } + + EntryTypeHdl(&maLbEntryTypeMin); + EntryTypeHdl(&maLbEntryTypeMiddle); + EntryTypeHdl(&maLbEntryTypeMax); +} + +ScFormatEntry* ScColorScale3FrmtEntry::createColorscaleEntry() const +{ + ScColorScaleFormat* pColorScale = new ScColorScaleFormat(mpDoc); + pColorScale->AddEntry(createColorScaleEntry(maLbEntryTypeMin, maLbColMin, maEdMin, mpDoc, maPos)); + if(maLbColorFormat.GetSelectEntryPos() == 1) + pColorScale->AddEntry(createColorScaleEntry(maLbEntryTypeMiddle, maLbColMiddle, maEdMiddle, mpDoc, maPos)); + pColorScale->AddEntry(createColorScaleEntry(maLbEntryTypeMax, maLbColMax, maEdMax, mpDoc, maPos)); + return pColorScale; +} + +rtl::OUString ScColorScale3FrmtEntry::GetExpressionString() +{ + return ScCondFormatHelper::GetExpression( COLORSCALE, 0 ); +} + +ScFormatEntry* ScColorScale3FrmtEntry::GetEntry() const +{ + return createColorscaleEntry(); +} + +void ScColorScale3FrmtEntry::SetActive() +{ + maLbColorFormat.Show(); + maLbEntryTypeMin.Show(); + maLbEntryTypeMiddle.Show(); + maLbEntryTypeMax.Show(); + + maEdMin.Show(); + maEdMiddle.Show(); + maEdMax.Show(); + + maLbColMin.Show(); + maLbColMiddle.Show(); + maLbColMax.Show(); + + Select(); +} + +void ScColorScale3FrmtEntry::SetInactive() +{ + maLbColorFormat.Hide(); + + maLbEntryTypeMin.Hide(); + maLbEntryTypeMiddle.Hide(); + maLbEntryTypeMax.Hide(); + + maEdMin.Hide(); + maEdMiddle.Hide(); + maEdMax.Hide(); + + maLbColMin.Hide(); + maLbColMiddle.Hide(); + maLbColMax.Hide(); + + Deselect(); +} + +IMPL_LINK( ScColorScale3FrmtEntry, EntryTypeHdl, ListBox*, pBox ) +{ + bool bEnableEdit = true; + sal_Int32 nPos = pBox->GetSelectEntryPos(); + if(nPos < 2) + { + bEnableEdit = false; + } + + Edit* pEd = NULL; + if(pBox == &maLbEntryTypeMin) + pEd = &maEdMin; + else if(pBox == &maLbEntryTypeMiddle) + pEd = &maEdMiddle; + else if(pBox == &maLbEntryTypeMax) + pEd = &maEdMax; + + if(bEnableEdit) + pEd->Enable(); + else + pEd->Disable(); + + return 0; +} + +IMPL_LINK_NOARG( ScConditionFrmtEntry, ConditionTypeSelectHdl ) +{ + if(maLbCondType.GetSelectEntryPos() == 6 || maLbCondType.GetSelectEntryPos() == 7) + { + maEdVal2.Show(); + } + else + { + maEdVal2.Hide(); + } + + return 0; +} + +//databar + +namespace { + +void SetDataBarEntryTypes( const ScColorScaleEntry& rEntry, ListBox& rLbType, Edit& rEdit ) +{ + rLbType.SelectEntryPos(rEntry.GetType()); + switch(rEntry.GetType()) + { + case COLORSCALE_AUTO: + case COLORSCALE_MIN: + case COLORSCALE_MAX: + break; + case COLORSCALE_PERCENTILE: + rEdit.SetText(rtl::OUString::valueOf(rEntry.GetValue())); + break; + case COLORSCALE_PERCENT: + rEdit.SetText(rtl::OUString::valueOf(rEntry.GetValue())); + break; + case COLORSCALE_FORMULA: + rEdit.SetText(rEntry.GetFormula(formula::FormulaGrammar::GRAM_DEFAULT)); + break; + case COLORSCALE_VALUE: + rEdit.SetText(rtl::OUString::valueOf(rEntry.GetValue())); + break; + } +} + +} + +ScDataBarFrmtEntry::ScDataBarFrmtEntry( Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScDataBarFormat* pFormat ): + ScCondFrmtEntry( pParent, pDoc, rPos ), + maLbColorFormat( this, ScResId( LB_COLOR_FORMAT ) ), + maLbDataBarMinType( this, ScResId( LB_TYPE_COL_SCALE_MIN ) ), + maLbDataBarMaxType( this, ScResId( LB_TYPE_COL_SCALE_MAX ) ), + maEdDataBarMin( this, ScResId( ED_COL_SCALE_MIN ) ), + maEdDataBarMax( this, ScResId( ED_COL_SCALE_MAX ) ), + maBtOptions( this, ScResId( BTN_OPTIONS ) ) +{ + maLbColorFormat.SelectEntryPos(2); + maLbType.SelectEntryPos(0); + if(pFormat) + { + mpDataBarData.reset(new ScDataBarFormatData(*pFormat->GetDataBarData())); + SetDataBarEntryTypes(*mpDataBarData->mpLowerLimit, maLbDataBarMinType, maEdDataBarMin); + SetDataBarEntryTypes(*mpDataBarData->mpUpperLimit, maLbDataBarMaxType, maEdDataBarMax); + DataBarTypeSelectHdl(NULL); + } + else + { + maLbDataBarMinType.SelectEntryPos(0); + maLbDataBarMaxType.SelectEntryPos(0); + DataBarTypeSelectHdl(NULL); + } + Init(); + + maLbColorFormat.SetSelectHdl( LINK( pParent, ScCondFormatList, ColFormatTypeHdl ) ); + + FreeResource(); +} + +ScFormatEntry* ScDataBarFrmtEntry::GetEntry() const +{ + return createDatabarEntry(); +} + +void ScDataBarFrmtEntry::Init() +{ + maLbDataBarMinType.SetSelectHdl( LINK( this, ScDataBarFrmtEntry, DataBarTypeSelectHdl ) ); + maLbDataBarMaxType.SetSelectHdl( LINK( this, ScDataBarFrmtEntry, DataBarTypeSelectHdl ) ); + + maBtOptions.SetClickHdl( LINK( this, ScDataBarFrmtEntry, OptionBtnHdl ) ); + + mpDataBarData.reset(new ScDataBarFormatData()); + mpDataBarData->mpUpperLimit.reset(new ScColorScaleEntry()); + mpDataBarData->mpLowerLimit.reset(new ScColorScaleEntry()); + mpDataBarData->mpLowerLimit->SetType(COLORSCALE_AUTO); + mpDataBarData->mpUpperLimit->SetType(COLORSCALE_AUTO); + mpDataBarData->maPositiveColor = COL_LIGHTBLUE; +} + +ScFormatEntry* ScDataBarFrmtEntry::createDatabarEntry() const +{ + SetColorScaleEntry(mpDataBarData->mpLowerLimit.get(), maLbDataBarMinType, maEdDataBarMin, mpDoc, maPos, true); + SetColorScaleEntry(mpDataBarData->mpUpperLimit.get(), maLbDataBarMaxType, maEdDataBarMax, mpDoc, maPos, true); + ScDataBarFormat* pDataBar = new ScDataBarFormat(mpDoc); + pDataBar->SetDataBarData(new ScDataBarFormatData(*mpDataBarData.get())); + return pDataBar; +} + +rtl::OUString ScDataBarFrmtEntry::GetExpressionString() +{ + return ScCondFormatHelper::GetExpression( DATABAR, 0 ); +} + +void ScDataBarFrmtEntry::SetActive() +{ + maLbColorFormat.Show(); + + maLbDataBarMinType.Show(); + maLbDataBarMaxType.Show(); + maEdDataBarMin.Show(); + maEdDataBarMax.Show(); + maBtOptions.Show(); + + Select(); +} + +void ScDataBarFrmtEntry::SetInactive() +{ + maLbColorFormat.Hide(); + + maLbDataBarMinType.Hide(); + maLbDataBarMaxType.Hide(); + maEdDataBarMin.Hide(); + maEdDataBarMax.Hide(); + maBtOptions.Hide(); + + Deselect(); +} + +IMPL_LINK_NOARG( ScDataBarFrmtEntry, DataBarTypeSelectHdl ) +{ + sal_Int32 nSelectPos = maLbDataBarMinType.GetSelectEntryPos(); + if(nSelectPos <= COLORSCALE_MAX) + maEdDataBarMin.Disable(); + else + maEdDataBarMin.Enable(); + + nSelectPos = maLbDataBarMaxType.GetSelectEntryPos(); + if(nSelectPos <= COLORSCALE_MAX) + maEdDataBarMax.Disable(); + else + maEdDataBarMax.Enable(); + + return 0; +} + +IMPL_LINK_NOARG( ScDataBarFrmtEntry, OptionBtnHdl ) +{ + SetColorScaleEntry(mpDataBarData->mpLowerLimit.get(), maLbDataBarMinType, maEdDataBarMin, mpDoc, maPos, true); + SetColorScaleEntry(mpDataBarData->mpUpperLimit.get(), maLbDataBarMaxType, maEdDataBarMax, mpDoc, maPos, true); + ScDataBarSettingsDlg* pDlg = new ScDataBarSettingsDlg(this, *mpDataBarData, mpDoc, maPos); + if( pDlg->Execute() == RET_OK) + { + mpDataBarData.reset(pDlg->GetData()); + SetDataBarEntryTypes(*mpDataBarData->mpLowerLimit, maLbDataBarMinType, maEdDataBarMin); + SetDataBarEntryTypes(*mpDataBarData->mpUpperLimit, maLbDataBarMaxType, maEdDataBarMax); + DataBarTypeSelectHdl(NULL); + } + return 0; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/condformat/condformathelper.cxx b/sc/source/ui/condformat/condformathelper.cxx index 1ec8607759dc..1f658e326456 100644 --- a/sc/source/ui/condformat/condformathelper.cxx +++ b/sc/source/ui/condformat/condformathelper.cxx @@ -91,7 +91,7 @@ rtl::OUString ScCondFormatHelper::GetExpression(const ScConditionalFormat& rForm aBuffer.append(rtl::OUString(" and ")); aBuffer.append(pEntry->GetExpression(rPos, 1)); } - else + else if(eMode <= SC_COND_NOTEQUAL) { aBuffer.append(pEntry->GetExpression(rPos, 0)); } @@ -110,12 +110,27 @@ rtl::OUString ScCondFormatHelper::GetExpression(const ScConditionalFormat& rForm return aBuffer.makeStringAndClear(); } -rtl::OUString ScCondFormatHelper::GetExpression( ScCondFormatEntryType eType, sal_Int32 nIndex ) +rtl::OUString ScCondFormatHelper::GetExpression( ScCondFormatEntryType eType, sal_Int32 nIndex, + rtl::OUString aStr1, rtl::OUString aStr2 ) { rtl::OUStringBuffer aBuffer(getTextForType(eType)); aBuffer.append(rtl::OUString(" ")); if(eType == CONDITION) + { aBuffer.append(getExpression(nIndex)); + if(nIndex <= 7) + { + aBuffer.append(" ").append(aStr1); + if(nIndex == 6 || nIndex == 7) + { + aBuffer.append(" and ").append(aStr2); + } + } + } + else if(eType == FORMULA) + { + aBuffer.append(" ").append(aStr1); + } return aBuffer.makeStringAndClear(); } diff --git a/sc/source/ui/condformat/condformatmgr.cxx b/sc/source/ui/condformat/condformatmgr.cxx index 62b1fdc40be4..dc5bb8b3d6fe 100644 --- a/sc/source/ui/condformat/condformatmgr.cxx +++ b/sc/source/ui/condformat/condformatmgr.cxx @@ -174,14 +174,18 @@ ScCondFormatManagerDlg::ScCondFormatManagerDlg(Window* pParent, ScDocument* pDoc mpFormatList( pFormatList ? new ScConditionalFormatList(*pFormatList) : NULL), maCtrlManager(this, pDoc, mpFormatList, rPos), mpDoc(pDoc), - maPos(rPos) + maPos(rPos), + mbModified(false) { FreeResource(); maBtnRemove.SetClickHdl(LINK(this, ScCondFormatManagerDlg, RemoveBtnHdl)); maBtnEdit.SetClickHdl(LINK(this, ScCondFormatManagerDlg, EditBtnHdl)); + maBtnAdd.SetClickHdl(LINK(this, ScCondFormatManagerDlg, AddBtnHdl)); maCtrlManager.GetListControl().SetDoubleClickHdl(LINK(this, ScCondFormatManagerDlg, EditBtnHdl)); - maBtnAdd.Hide(); + + maBtnAdd.Disable(); + maBtnEdit.Disable(); } ScCondFormatManagerDlg::~ScCondFormatManagerDlg() @@ -196,9 +200,15 @@ ScConditionalFormatList* ScCondFormatManagerDlg::GetConditionalFormatList() return pList; } +bool ScCondFormatManagerDlg::CondFormatsChanged() +{ + return mbModified; +} + IMPL_LINK_NOARG(ScCondFormatManagerDlg, RemoveBtnHdl) { maCtrlManager.DeleteSelection(); + mbModified = true; return 0; } @@ -209,8 +219,8 @@ IMPL_LINK_NOARG(ScCondFormatManagerDlg, EditBtnHdl) if(!pFormat) return 0; - ScCondFormatDlg* pDlg = new ScCondFormatDlg(this, mpDoc, pFormat, pFormat->GetRange(), - pFormat->GetRange().GetTopLeftCorner()); + boost::scoped_ptr<ScCondFormatDlg> pDlg;//(new ScCondFormatDlg(this, mpDoc, pFormat, pFormat->GetRange(), + // pFormat->GetRange().GetTopLeftCorner(), condformat::dialog::NONE)); if(pDlg->Execute() == RET_OK) { sal_Int32 nKey = pFormat->GetKey(); @@ -220,9 +230,48 @@ IMPL_LINK_NOARG(ScCondFormatManagerDlg, EditBtnHdl) mpFormatList->InsertNew(pNewFormat); maCtrlManager.Update(); } - delete pDlg; + + mbModified = true; + + return 0; +} + +namespace { + +sal_uInt32 FindKey(ScConditionalFormatList* pFormatList) +{ + sal_uInt32 nKey = 0; + for(ScConditionalFormatList::const_iterator itr = pFormatList->begin(), itrEnd = pFormatList->end(); + itr != itrEnd; ++itr) + { + if(itr->GetKey() > nKey) + nKey = itr->GetKey(); + } + + return nKey + 1; +} + +} + +IMPL_LINK_NOARG(ScCondFormatManagerDlg, AddBtnHdl) +{ + boost::scoped_ptr<ScCondFormatDlg> pDlg;//(new ScCondFormatDlg(this, mpDoc, NULL, ScRangeList(), + // maPos, condformat::dialog::CONDITION)); + if(pDlg->Execute() == RET_OK) + { + ScConditionalFormat* pNewFormat = pDlg->GetConditionalFormat(); + if(!pNewFormat) + return 0; + + mpFormatList->InsertNew(pNewFormat); + pNewFormat->SetKey(FindKey(mpFormatList)); + maCtrlManager.Update(); + + mbModified = true; + } return 0; } + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/dbgui/csvgrid.cxx b/sc/source/ui/dbgui/csvgrid.cxx index fbcecb729a91..3ec7926c9840 100644 --- a/sc/source/ui/dbgui/csvgrid.cxx +++ b/sc/source/ui/dbgui/csvgrid.cxx @@ -516,7 +516,7 @@ const String& ScCsvGrid::GetColumnTypeName( sal_uInt32 nColIndex ) const return (nTypeIx < maTypeNames.size()) ? maTypeNames[ nTypeIx ] : EMPTY_STRING; } -sal_uInt8 lcl_GetExtColumnType( sal_Int32 nIntType ) +static sal_uInt8 lcl_GetExtColumnType( sal_Int32 nIntType ) { static sal_uInt8 pExtTypes[] = { SC_COL_STANDARD, SC_COL_TEXT, SC_COL_DMY, SC_COL_MDY, SC_COL_YMD, SC_COL_ENGLISH, SC_COL_SKIP }; diff --git a/sc/source/ui/dbgui/dapidata.cxx b/sc/source/ui/dbgui/dapidata.cxx index 862698318895..4213ede828b4 100644 --- a/sc/source/ui/dbgui/dapidata.cxx +++ b/sc/source/ui/dbgui/dapidata.cxx @@ -42,6 +42,7 @@ #include <com/sun/star/sdb/DatabaseContext.hpp> #include <com/sun/star/sdb/XQueriesSupplier.hpp> #include <com/sun/star/sdb/XCompletedConnection.hpp> +#include <com/sun/star/task/InteractionHandler.hpp> using namespace com::sun::star; @@ -54,7 +55,6 @@ using namespace com::sun::star; //------------------------------------------------------------------------- -#define SC_SERVICE_INTHANDLER "com.sun.star.task.InteractionHandler" // entries in the "type" ListBox #define DP_TYPELIST_TABLE 0 @@ -165,9 +165,8 @@ void ScDataPilotDatabaseDlg::FillObjects() if ( !xSource.is() ) return; uno::Reference<task::XInteractionHandler> xHandler( - comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_SERVICE_INTHANDLER )) ), - uno::UNO_QUERY); + task::InteractionHandler::createWithParent(comphelper::getProcessComponentContext(), 0), + uno::UNO_QUERY_THROW); uno::Reference<sdbc::XConnection> xConnection = xSource->connectWithCompletion( xHandler ); diff --git a/sc/source/ui/dbgui/pvlaydlg.cxx b/sc/source/ui/dbgui/pvlaydlg.cxx index 0a22a3fc9bc2..2ff4e10e57e5 100644 --- a/sc/source/ui/dbgui/pvlaydlg.cxx +++ b/sc/source/ui/dbgui/pvlaydlg.cxx @@ -105,7 +105,7 @@ ScDPLayoutDlg::ScDPLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pPar aFlAreas ( this, ScResId( FL_OUTPUT ) ), aFtInArea ( this, ScResId( FT_INAREA) ), - aEdInPos ( this, ScResId( ED_INAREA) ), + aEdInPos ( this, this, ScResId( ED_INAREA) ), aRbInPos ( this, ScResId( RB_INAREA ), &aEdInPos, this ), aLbOutPos ( this, ScResId( LB_OUTAREA ) ), @@ -1742,7 +1742,7 @@ void ScDPLayoutDlg::SetActive() if ( pEditActive == &aEdInPos ) EdInModifyHdl( NULL ); else if ( pEditActive == &aEdOutPos ) - EdModifyHdl( NULL ); + EdModifyHdl( NULL ); } else { diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx b/sc/source/ui/dbgui/scuiasciiopt.cxx index c3bfdbc98431..346999fde0c4 100644 --- a/sc/source/ui/dbgui/scuiasciiopt.cxx +++ b/sc/source/ui/dbgui/scuiasciiopt.cxx @@ -69,7 +69,7 @@ using ::rtl::OUString; // ============================================================================ -void lcl_FillCombo( ComboBox& rCombo, const String& rList, sal_Unicode cSelect ) +static void lcl_FillCombo( ComboBox& rCombo, const String& rList, sal_Unicode cSelect ) { xub_StrLen i; xub_StrLen nCount = comphelper::string::getTokenCount(rList, '\t'); @@ -89,7 +89,7 @@ void lcl_FillCombo( ComboBox& rCombo, const String& rList, sal_Unicode cSelect ) } } -sal_Unicode lcl_CharFromCombo( ComboBox& rCombo, const String& rList ) +static sal_Unicode lcl_CharFromCombo( ComboBox& rCombo, const String& rList ) { sal_Unicode c = 0; String aStr = rCombo.GetText(); diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx index d4f23032c388..84084d7e721d 100644 --- a/sc/source/ui/dbgui/tpsort.cxx +++ b/sc/source/ui/dbgui/tpsort.cxx @@ -96,7 +96,7 @@ ScTabPageSortFields::ScTabPageSortFields( Window* pParent, aStrRow ( SC_RESSTR( SCSTR_ROW ) ), // nWhichSort ( rArgSet.GetPool()->GetWhich( SID_SORT ) ), - pDlg ( (ScSortDlg*)(GetParent()->GetParent()) ), + pDlg ( (ScSortDlg*)(GetParentDialog()) ), pViewData ( NULL ), aSortData ( ((const ScSortItem&) rArgSet.Get( nWhichSort )). @@ -517,7 +517,7 @@ ScTabPageSortOptions::ScTabPageSortOptions( Window* pParent, rArgSet.Get( nWhichSort )).GetSortData() ), pViewData ( NULL ), pDoc ( NULL ), - pDlg ( (ScSortDlg*)(GetParent() ? GetParent()->GetParent() : 0 ) ), + pDlg ( (ScSortDlg*)(GetParentDialog()) ), pColRes ( NULL ), pColWrap ( NULL ) { diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx index 5fc701a72043..390ad1743e63 100644 --- a/sc/source/ui/dbgui/validate.cxx +++ b/sc/source/ui/dbgui/validate.cxx @@ -323,10 +323,10 @@ ScTPValidationValue::ScTPValidationValue( Window* pParent, const SfxItemSet& rAr maFtValue ( this, ScResId( FT_VALUE ) ), maLbValue ( this, ScResId( LB_VALUE ) ), maFtMin ( this, ScResId( FT_MIN ) ), - maEdMin ( this, ScResId( EDT_MIN ) ), + maEdMin ( this, NULL, ScResId( EDT_MIN ) ), maEdList ( this, ScResId( EDT_LIST ) ), maFtMax ( this, ScResId( FT_MAX ) ), - maEdMax ( this, ScResId( EDT_MAX ) ), + maEdMax ( this, NULL, ScResId( EDT_MAX ) ), maFtHint ( this, ScResId( FT_SOURCEHINT ) ), maStrMin ( ScResId( SCSTR_VALID_MINIMUM ) ), maStrMax ( ScResId( SCSTR_VALID_MAXIMUM ) ), diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx index b40eb3b59142..07049a009bd0 100644 --- a/sc/source/ui/docshell/dbdocfun.cxx +++ b/sc/source/ui/docshell/dbdocfun.cxx @@ -1184,7 +1184,7 @@ sal_Bool ScDBDocFunc::DoSubTotals( SCTAB nTab, const ScSubTotalParam& rParam, //================================================================== -sal_Bool lcl_EmptyExcept( ScDocument* pDoc, const ScRange& rRange, const ScRange& rExcept ) +static sal_Bool lcl_EmptyExcept( ScDocument* pDoc, const ScRange& rRange, const ScRange& rExcept ) { ScCellIterator aIter( pDoc, rRange ); ScBaseCell* pCell = aIter.GetFirst(); diff --git a/sc/source/ui/docshell/dbdocimp.cxx b/sc/source/ui/docshell/dbdocimp.cxx index 14da13deaeea..c3be6648b2e2 100644 --- a/sc/source/ui/docshell/dbdocimp.cxx +++ b/sc/source/ui/docshell/dbdocimp.cxx @@ -38,6 +38,7 @@ #include <com/sun/star/sdbc/XRowSet.hpp> #include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp> #include <com/sun/star/sdbcx/XRowLocate.hpp> +#include <com/sun/star/task/InteractionHandler.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> @@ -66,7 +67,6 @@ using namespace com::sun::star; #define SC_SERVICE_ROWSET "com.sun.star.sdb.RowSet" -#define SC_SERVICE_INTHANDLER "com.sun.star.task.InteractionHandler" //! move to a header file? #define SC_DBPROP_DATASOURCENAME "DataSourceName" @@ -252,9 +252,8 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam, if ( xExecute.is() ) { uno::Reference<task::XInteractionHandler> xHandler( - comphelper::getProcessServiceFactory()->createInstance( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SC_SERVICE_INTHANDLER )) ), - uno::UNO_QUERY); + task::InteractionHandler::createWithParent(comphelper::getProcessComponentContext(), 0), + uno::UNO_QUERY_THROW); xExecute->executeWithCompletion( xHandler ); } else diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index f44fcd5f76aa..188259354fb3 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -128,7 +128,7 @@ IMPL_LINK( ScDocFunc, NotifyDrawUndo, SdrUndoAction*, pUndoAction ) // Zeile ueber dem Range painten (fuer Linien nach AdjustRowHeight) -void lcl_PaintAbove( ScDocShell& rDocShell, const ScRange& rRange ) +static void lcl_PaintAbove( ScDocShell& rDocShell, const ScRange& rRange ) { SCROW nRow = rRange.aStart.Row(); if ( nRow > 0 ) @@ -1008,7 +1008,7 @@ sal_Bool ScDocFunc::PutData( const ScAddress& rPos, ScEditEngineDefaulter& rEngi } -ScTokenArray* lcl_ScDocFunc_CreateTokenArrayXML( const String& rText, const String& rFormulaNmsp, const formula::FormulaGrammar::Grammar eGrammar ) +static ScTokenArray* lcl_ScDocFunc_CreateTokenArrayXML( const String& rText, const String& rFormulaNmsp, const formula::FormulaGrammar::Grammar eGrammar ) { ScTokenArray* pCode = new ScTokenArray; pCode->AddStringXML( rText ); @@ -2626,7 +2626,7 @@ uno::Reference< uno::XInterface > GetDocModuleObject( SfxObjectShell& rDocSh, St } -script::ModuleInfo lcl_InitModuleInfo( SfxObjectShell& rDocSh, String& sModule ) +static script::ModuleInfo lcl_InitModuleInfo( SfxObjectShell& rDocSh, String& sModule ) { script::ModuleInfo sModuleInfo; sModuleInfo.ModuleType = script::ModuleType::DOCUMENT; @@ -3080,7 +3080,7 @@ bool ScDocFunc::SetTabBgColor( //! - Optimale Hoehe fuer Edit-Zellen ist unterschiedlich zwischen Drucker und Bildschirm //! - Optimale Breite braucht Selektion, um evtl. nur selektierte Zellen zu beruecksichtigen -sal_uInt16 lcl_GetOptimalColWidth( ScDocShell& rDocShell, SCCOL nCol, SCTAB nTab, sal_Bool bFormula ) +static sal_uInt16 lcl_GetOptimalColWidth( ScDocShell& rDocShell, SCCOL nCol, SCTAB nTab, sal_Bool bFormula ) { sal_uInt16 nTwips = 0; @@ -5059,6 +5059,21 @@ sal_Bool ScDocFunc::InsertAreaLink( const String& rFile, const String& rFilter, return sal_True; } +namespace { + +void RemoveCondFormatAttributes(ScDocument* pDoc, const ScConditionalFormat* pFormat, SCTAB nTab) +{ + const ScRangeList& rRangeList = pFormat->GetRange(); + pDoc->RemoveCondFormatData( rRangeList, nTab, pFormat->GetKey() ); +} + +void SetConditionalFormatAttributes(ScDocument* pDoc, const ScRangeList& rRanges, sal_uLong nIndex, SCTAB nTab) +{ + pDoc->AddCondFormatData( rRanges, nTab, nIndex ); +} + +} + void ScDocFunc::ReplaceConditionalFormat( sal_uLong nOldFormat, ScConditionalFormat* pFormat, SCTAB nTab, const ScRangeList& rRanges ) { ScDocShellModificator aModificator(rDocShell); @@ -5066,23 +5081,65 @@ void ScDocFunc::ReplaceConditionalFormat( sal_uLong nOldFormat, ScConditionalFor if(pDoc->IsTabProtected(nTab)) return; + boost::scoped_ptr<ScRange> pRepaintRange; if(nOldFormat) { + ScConditionalFormat* pOldFormat = pDoc->GetCondFormList(nTab)->GetFormat(nOldFormat); + pRepaintRange.reset(new ScRange( pOldFormat->GetRange().Combine() )); + if(pOldFormat) + { + RemoveCondFormatAttributes(pDoc, pOldFormat, nTab); + } + pDoc->DeleteConditionalFormat(nOldFormat, nTab); + pDoc->SetStreamValid(nTab, false); } if(pFormat) { + if(pRepaintRange) + pRepaintRange->ExtendTo(rRanges.Combine()); + else + pRepaintRange.reset(new ScRange(rRanges.Combine())); + sal_uLong nIndex = pDoc->AddCondFormat(pFormat, nTab); - ScPatternAttr aPattern( pDoc->GetPool() ); - aPattern.GetItemSet().Put( SfxUInt32Item( ATTR_CONDITIONAL, nIndex ) ); - ScMarkData aMarkData; - aMarkData.MarkFromRangeList(rRanges, true); - pDoc->ApplySelectionPattern( aPattern , aMarkData ); - size_t n = rRanges.size(); - for(size_t i = 0; i < n; ++i) - pFormat->DoRepaint(rRanges[i]); + SetConditionalFormatAttributes(pDoc, rRanges, nIndex, nTab); + pDoc->SetStreamValid(nTab, false); } + + if(pRepaintRange) + rDocShell.PostPaint(*pRepaintRange, PAINT_GRID); + + aModificator.SetDocumentModified(); + SFX_APP()->Broadcast(SfxSimpleHint(SC_HINT_AREAS_CHANGED)); +} + +void ScDocFunc::SetConditionalFormatList( ScConditionalFormatList* pList, SCTAB nTab ) +{ + ScDocShellModificator aModificator(rDocShell); + ScDocument* pDoc = rDocShell.GetDocument(); + if(pDoc->IsTabProtected(nTab)) + return; + + // first remove all old entries + ScConditionalFormatList* pOldList = pDoc->GetCondFormList(nTab); + for(ScConditionalFormatList::const_iterator itr = pOldList->begin(), itrEnd = pOldList->end(); itr != itrEnd; ++itr) + { + RemoveCondFormatAttributes(pDoc, &(*itr), nTab); + } + + // then set new entries + for(ScConditionalFormatList::iterator itr = pList->begin(); itr != pList->end(); ++itr) + { + sal_uLong nIndex = itr->GetKey(); + const ScRangeList& rRange = itr->GetRange(); + SetConditionalFormatAttributes(pDoc, rRange, nIndex, nTab); + } + + pDoc->SetCondFormList(pList, nTab); + rDocShell.PostPaintGridAll(); + + pDoc->SetStreamValid(nTab, false); aModificator.SetDocumentModified(); SFX_APP()->Broadcast(SfxSimpleHint(SC_HINT_AREAS_CHANGED)); } diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx index dfa01e1749a5..c75075cfff87 100644 --- a/sc/source/ui/docshell/docsh3.cxx +++ b/sc/source/ui/docshell/docsh3.cxx @@ -745,7 +745,7 @@ void ScDocShell::CompareDocument( ScDocument& rOtherDoc ) // //--------------------------------------------------------------------- -inline sal_Bool lcl_Equal( const ScChangeAction* pA, const ScChangeAction* pB, sal_Bool bIgnore100Sec ) +static inline sal_Bool lcl_Equal( const ScChangeAction* pA, const ScChangeAction* pB, sal_Bool bIgnore100Sec ) { return pA && pB && pA->GetActionNumber() == pB->GetActionNumber() && @@ -757,7 +757,7 @@ inline sal_Bool lcl_Equal( const ScChangeAction* pA, const ScChangeAction* pB, s // State nicht vergleichen, falls eine alte Aenderung akzeptiert wurde } -bool lcl_FindAction( ScDocument* pDoc, const ScChangeAction* pAction, ScDocument* pSearchDoc, const ScChangeAction* pFirstSearchAction, const ScChangeAction* pLastSearchAction, sal_Bool bIgnore100Sec ) +static bool lcl_FindAction( ScDocument* pDoc, const ScChangeAction* pAction, ScDocument* pSearchDoc, const ScChangeAction* pFirstSearchAction, const ScChangeAction* pLastSearchAction, sal_Bool bIgnore100Sec ) { if ( !pDoc || !pAction || !pSearchDoc || !pFirstSearchAction || !pLastSearchAction ) { diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx index 1804c40e53a5..5beb522aa033 100644 --- a/sc/source/ui/docshell/docsh5.cxx +++ b/sc/source/ui/docshell/docsh5.cxx @@ -467,7 +467,7 @@ void ScDocShell::RefreshPivotTables( const ScRange& rSource ) } } -rtl::OUString lcl_GetAreaName( ScDocument* pDoc, ScArea* pArea ) +static rtl::OUString lcl_GetAreaName( ScDocument* pDoc, ScArea* pArea ) { rtl::OUString aName; sal_Bool bOk = false; diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx index 94b978728ac7..47315b3aed52 100644 --- a/sc/source/ui/docshell/docsh6.cxx +++ b/sc/source/ui/docshell/docsh6.cxx @@ -88,7 +88,7 @@ void ScDocShell::SetVisArea( const Rectangle & rVisArea ) SetVisAreaOrSize( rVisArea, sal_True ); } -void lcl_SetTopRight( Rectangle& rRect, const Point& rPos ) +static void lcl_SetTopRight( Rectangle& rRect, const Point& rPos ) { Size aSize = rRect.GetSize(); rRect.Right() = rPos.X(); @@ -239,7 +239,7 @@ SfxStyleSheetBasePool* ScDocShell::GetStyleSheetPool() // muessen die SetItems (ATTR_PAGE_HEADERSET, ATTR_PAGE_FOOTERSET) auf den richtigen // Pool umgesetzt werden, bevor der Quell-Pool geloescht wird. -void lcl_AdjustPool( SfxStyleSheetBasePool* pStylePool ) +static void lcl_AdjustPool( SfxStyleSheetBasePool* pStylePool ) { pStylePool->SetSearchMask(SFX_STYLE_FAMILY_PAGE, 0xffff); SfxStyleSheetBase *pStyle = pStylePool->First(); diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx index 63330ba9e907..6453631f570a 100644 --- a/sc/source/ui/docshell/docsh8.cxx +++ b/sc/source/ui/docshell/docsh8.cxx @@ -282,8 +282,7 @@ static void lcl_setScalesToColumns(ScDocument& rDoc, const vector<long>& rScales pOldEntry->GetFormatSpecialInfo(bThousand, bNegRed, nPrecision, nLeading); nPrecision = static_cast<sal_uInt16>(rScales[i]); - String aNewPicture; - pFormatter->GenerateFormat(aNewPicture, nOldFormat, eLang, + String aNewPicture = pFormatter->GenerateFormat(nOldFormat, eLang, bThousand, bNegRed, nPrecision, nLeading); sal_uInt32 nNewFormat = pFormatter->GetEntryKey(aNewPicture, eLang); diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx index 02811e8a6638..c0134fd0fca9 100644 --- a/sc/source/ui/docshell/externalrefmgr.cxx +++ b/sc/source/ui/docshell/externalrefmgr.cxx @@ -2429,7 +2429,7 @@ const OUString* ScExternalRefManager::getRealRangeName(sal_uInt16 nFileId, const } template<typename MapContainer> -void lcl_removeByFileId(sal_uInt16 nFileId, MapContainer& rMap) +static void lcl_removeByFileId(sal_uInt16 nFileId, MapContainer& rMap) { typename MapContainer::iterator itr = rMap.find(nFileId); if (itr != rMap.end()) diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx index f2b36a474f9a..05521e20ecd8 100644 --- a/sc/source/ui/docshell/impex.cxx +++ b/sc/source/ui/docshell/impex.cxx @@ -720,7 +720,7 @@ static const sal_Unicode* lcl_ScanString( const sal_Unicode* p, String& rString, return p; } -void lcl_UnescapeSylk( String & rString, SylkVersion eVersion ) +static void lcl_UnescapeSylk( String & rString, SylkVersion eVersion ) { // Older versions didn't escape the semicolon. // Older versions quoted the string and doubled embedded quotes, but not @@ -863,7 +863,7 @@ static void lcl_WriteString( SvStream& rStrm, String& rString, sal_Unicode cQuot ScImportExport::WriteUnicodeOrByteString( rStrm, rString ); } -inline void lcl_WriteSimpleString( SvStream& rStrm, const String& rString ) +static inline void lcl_WriteSimpleString( SvStream& rStrm, const String& rString ) { ScImportExport::WriteUnicodeOrByteString( rStrm, rString ); } @@ -1218,7 +1218,7 @@ static bool lcl_PutString( } -String lcl_GetFixed( const rtl::OUString& rLine, sal_Int32 nStart, sal_Int32 nNext, +static String lcl_GetFixed( const rtl::OUString& rLine, sal_Int32 nStart, sal_Int32 nNext, bool& rbIsQuoted, bool& rbOverflowCell ) { sal_Int32 nLen = rLine.getLength(); @@ -2274,7 +2274,7 @@ ScFormatFilterPlugin &ScFormatFilter::Get() // Precondition: pStr is guaranteed to be non-NULL and points to a 0-terminated // array. -inline const sal_Unicode* lcl_UnicodeStrChr( const sal_Unicode* pStr, +static inline const sal_Unicode* lcl_UnicodeStrChr( const sal_Unicode* pStr, sal_Unicode c ) { while (*pStr) diff --git a/sc/source/ui/docshell/olinefun.cxx b/sc/source/ui/docshell/olinefun.cxx index 9d79456a4605..667daf3c14fc 100644 --- a/sc/source/ui/docshell/olinefun.cxx +++ b/sc/source/ui/docshell/olinefun.cxx @@ -39,7 +39,7 @@ //======================================================================== -void lcl_InvalidateOutliner( SfxBindings* pBindings ) +static void lcl_InvalidateOutliner( SfxBindings* pBindings ) { if ( pBindings ) { @@ -56,7 +56,7 @@ void lcl_InvalidateOutliner( SfxBindings* pBindings ) //! PaintWidthHeight zur DocShell verschieben? -void lcl_PaintWidthHeight( ScDocShell& rDocShell, SCTAB nTab, +static void lcl_PaintWidthHeight( ScDocShell& rDocShell, SCTAB nTab, sal_Bool bColumns, SCCOLROW nStart, SCCOLROW nEnd ) { ScDocument* pDoc = rDocShell.GetDocument(); diff --git a/sc/source/ui/docshell/servobj.cxx b/sc/source/ui/docshell/servobj.cxx index cbf81037cb10..2d6cadc5e863 100644 --- a/sc/source/ui/docshell/servobj.cxx +++ b/sc/source/ui/docshell/servobj.cxx @@ -40,7 +40,7 @@ using namespace formula; // ----------------------------------------------------------------------- -sal_Bool lcl_FillRangeFromName( ScRange& rRange, ScDocShell* pDocSh, const String& rName ) +static sal_Bool lcl_FillRangeFromName( ScRange& rRange, ScDocShell* pDocSh, const String& rName ) { if (pDocSh) { diff --git a/sc/source/ui/drawfunc/chartsh.cxx b/sc/source/ui/drawfunc/chartsh.cxx index 414063394aeb..251fa5d5b044 100644 --- a/sc/source/ui/drawfunc/chartsh.cxx +++ b/sc/source/ui/drawfunc/chartsh.cxx @@ -17,8 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <editeng/eeitem.hxx> -#include <svx/fontwork.hxx> +#include <svx/svdoole2.hxx> +#include <svx/svdobj.hxx> +#include <svx/graphichelper.hxx> + #include <svl/srchitem.hxx> #include <sfx2/app.hxx> #include <sfx2/objface.hxx> @@ -34,15 +36,13 @@ #include "docpool.hxx" #include "drawview.hxx" #include "scresid.hxx" -#include <svx/svdobj.hxx> #define ScChartShell #include "scslots.hxx" - SFX_IMPL_INTERFACE(ScChartShell, ScDrawShell, ScResId(SCSTR_CHARTSHELL) ) { - SFX_OBJECTBAR_REGISTRATION( SFX_OBJECTBAR_OBJECT|SFX_VISIBILITY_STANDARD|SFX_VISIBILITY_SERVER, + SFX_OBJECTBAR_REGISTRATION( SFX_OBJECTBAR_OBJECT | SFX_VISIBILITY_STANDARD | SFX_VISIBILITY_SERVER, ScResId(RID_DRAW_OBJECTBAR) ); SFX_POPUPMENU_REGISTRATION( ScResId(RID_POPUP_CHART) ); } @@ -52,14 +52,55 @@ TYPEINIT1( ScChartShell, ScDrawShell ); ScChartShell::ScChartShell(ScViewData* pData) : ScDrawShell(pData) { - SetHelpId(HID_SCSHELL_CHARTSH); - SetName(rtl::OUString("ChartObject")); + SetHelpId( HID_SCSHELL_CHARTSH ); + SetName( OUString("ChartObject") ); } ScChartShell::~ScChartShell() { } +void ScChartShell::GetExportAsGraphicState( SfxItemSet& rSet ) +{ + ScDrawView* pView = GetViewData()->GetScDrawView(); + const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); + bool bEnable = false; + if( rMarkList.GetMarkCount() == 1 ) + { + SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); + + if( pObj && pObj->ISA( SdrOle2Obj ) ) + bEnable = true; + } + + if( !bEnable ) + rSet.DisableItem( SID_EXPORT_AS_GRAPHIC ); +} + +void ScChartShell::ExecuteExportAsGraphic( SfxRequest& ) +{ + ScDrawView* pView = GetViewData()->GetScDrawView(); + const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); + + if( rMarkList.GetMarkCount() == 1 ) + { + SdrObject* pObject = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); + + if( pObject && pObject->ISA( SdrOle2Obj ) ) + { + SdrOle2Obj* aOle2Object = ((SdrOle2Obj*) pObject)->Clone(); + aOle2Object->NbcResize(Point(), Fraction(1,1), Fraction(1,1)); + Graphic* pGraphic = aOle2Object->GetGraphic(); + if( pGraphic != NULL ) + { + String sGrfNm, sFilterNm; + GraphicHelper::ExportGraphic( *pGraphic, String("") ); + } + } + } + + Invalidate(); +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx index e2d205802f6b..b726936385c9 100644 --- a/sc/source/ui/drawfunc/drawsh.cxx +++ b/sc/source/ui/drawfunc/drawsh.cxx @@ -93,7 +93,7 @@ void ScDrawShell::StateDisableItems( SfxItemSet &rSet ) } } -void lcl_setModified( SfxObjectShell* pShell ) +static void lcl_setModified( SfxObjectShell* pShell ) { if ( pShell ) { diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx index 170804cbb20a..2697d335de14 100644 --- a/sc/source/ui/drawfunc/drtxtob.cxx +++ b/sc/source/ui/drawfunc/drtxtob.cxx @@ -595,7 +595,7 @@ void ScDrawTextObjectBar::ExecuteToggle( SfxRequest &rReq ) pViewData->GetScDrawView()->InvalidateDrawTextAttrs(); } -void lcl_RemoveFields( OutlinerView& rOutView ) +static void lcl_RemoveFields( OutlinerView& rOutView ) { //! Outliner should have RemoveFields with a selection diff --git a/sc/source/ui/drawfunc/fudraw.cxx b/sc/source/ui/drawfunc/fudraw.cxx index 016f1cd4f1e6..86b7490eb556 100644 --- a/sc/source/ui/drawfunc/fudraw.cxx +++ b/sc/source/ui/drawfunc/fudraw.cxx @@ -189,7 +189,7 @@ sal_Bool FuDraw::MouseButtonUp(const MouseEvent& rMEvt) |* \************************************************************************/ -sal_Bool lcl_KeyEditMode( SdrObject* pObj, ScTabViewShell* pViewShell, const KeyEvent* pInitialKey ) +static sal_Bool lcl_KeyEditMode( SdrObject* pObj, ScTabViewShell* pViewShell, const KeyEvent* pInitialKey ) { sal_Bool bReturn = false; if ( pObj && pObj->ISA(SdrTextObj) && !pObj->ISA(SdrUnoObj) ) @@ -701,7 +701,7 @@ void FuDraw::Deactivate() |* \************************************************************************/ -sal_Bool lcl_UrlHit( SdrView* pView, const Point& rPosPixel, Window* pWindow ) +static sal_Bool lcl_UrlHit( SdrView* pView, const Point& rPosPixel, Window* pWindow ) { SdrViewEvent aVEvt; MouseEvent aMEvt( rPosPixel, 1, 0, MOUSE_LEFT ); diff --git a/sc/source/ui/drawfunc/fuins1.cxx b/sc/source/ui/drawfunc/fuins1.cxx index 22671a4b6b28..435dbafa0870 100644 --- a/sc/source/ui/drawfunc/fuins1.cxx +++ b/sc/source/ui/drawfunc/fuins1.cxx @@ -102,7 +102,7 @@ void SC_DLLPUBLIC ScLimitSizeOnDrawPage( Size& rSize, Point& rPos, const Size& r //------------------------------------------------------------------------ -void lcl_InsertGraphic( const Graphic& rGraphic, +static void lcl_InsertGraphic( const Graphic& rGraphic, const String& rFileName, const String& rFilterName, sal_Bool bAsLink, sal_Bool bApi, ScTabViewShell* pViewSh, Window* pWindow, SdrView* pView ) { @@ -160,7 +160,7 @@ void lcl_InsertGraphic( const Graphic& rGraphic, //------------------------------------------------------------------------ -void lcl_InsertMedia( const ::rtl::OUString& rMediaURL, bool bApi, +static void lcl_InsertMedia( const ::rtl::OUString& rMediaURL, bool bApi, ScTabViewShell* pViewSh, Window* pWindow, SdrView* pView, const Size& rPrefSize, bool const bLink ) { diff --git a/sc/source/ui/drawfunc/futext.cxx b/sc/source/ui/drawfunc/futext.cxx index 7a10f57a85ae..2505ada36399 100644 --- a/sc/source/ui/drawfunc/futext.cxx +++ b/sc/source/ui/drawfunc/futext.cxx @@ -57,7 +57,7 @@ //------------------------------------------------------------------ -void lcl_InvalidateAttribs( SfxBindings& rBindings ) +static void lcl_InvalidateAttribs( SfxBindings& rBindings ) { rBindings.Invalidate( SID_ATTR_CHAR_WEIGHT ); rBindings.Invalidate( SID_ATTR_CHAR_POSTURE ); @@ -91,7 +91,7 @@ void lcl_InvalidateAttribs( SfxBindings& rBindings ) rBindings.Invalidate( SID_ALIGN_ANY_JUSTIFIED ); } -void lcl_UpdateHyphenator( Outliner& rOutliner, SdrObject* pObj ) +static void lcl_UpdateHyphenator( Outliner& rOutliner, SdrObject* pObj ) { // use hyphenator only if hyphenation attribute is set if ( pObj && ((const SfxBoolItem&)pObj->GetMergedItem(EE_PARA_HYPHENATE)).GetValue() ) { diff --git a/sc/source/ui/drawfunc/graphsh.cxx b/sc/source/ui/drawfunc/graphsh.cxx index f2258e8d9750..8ecbd7d233d4 100644 --- a/sc/source/ui/drawfunc/graphsh.cxx +++ b/sc/source/ui/drawfunc/graphsh.cxx @@ -33,6 +33,8 @@ #include <svx/svdograf.hxx> #include <svx/grfflt.hxx> #include <svx/grafctrl.hxx> +#include <svx/compressgraphicdialog.hxx> +#include <vcl/msgbox.hxx> #include "graphsh.hxx" #include "sc.hrc" @@ -48,11 +50,11 @@ class ScExternalToolEdit : public ExternalToolEdit { - ScDrawView* m_pView; + FmFormView* m_pView; SdrObject* m_pObj; public: - ScExternalToolEdit ( ScDrawView* pView, SdrObject* pObj ) : + ScExternalToolEdit ( FmFormView* pView, SdrObject* pObj ) : m_pView (pView), m_pObj (pObj) {} @@ -204,4 +206,54 @@ void ScGraphicShell::ExecuteExternalEdit( SfxRequest& ) Invalidate(); } + +void ScGraphicShell::GetCompressGraphicState( SfxItemSet& rSet ) +{ + ScDrawView* pView = GetViewData()->GetScDrawView(); + const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); + bool bEnable = false; + if( rMarkList.GetMarkCount() == 1 ) + { + SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); + + if( pObj && pObj->ISA( SdrGrafObj ) && ( ( (SdrGrafObj*) pObj )->GetGraphicType() == GRAPHIC_BITMAP ) ) + bEnable = true; + } + + if( !bEnable ) + rSet.DisableItem( SID_COMPRESS_GRAPHIC ); +} + +void ScGraphicShell::ExecuteCompressGraphic( SfxRequest& ) +{ + ScDrawView* pView = GetViewData()->GetScDrawView(); + const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); + + if( rMarkList.GetMarkCount() == 1 ) + { + SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); + + if( pObj && pObj->ISA( SdrGrafObj ) && ( (SdrGrafObj*) pObj )->GetGraphicType() == GRAPHIC_BITMAP ) + { + GraphicObject aGraphicObject( ( (SdrGrafObj*) pObj )->GetGraphicObject() ); + CompressGraphicsDialog dialog( GetViewData()->GetDialogParent(), aGraphicObject.GetGraphic(), pObj->GetLogicRect().GetSize(), GetViewData()->GetBindings() ); + if ( dialog.Execute() == RET_OK ) + { + SdrGrafObj* pNewObject = (SdrGrafObj*) pObj->Clone(); + const Graphic aNewGraphic = dialog.GetCompressedGraphic(); + SdrPageView* pPageView = pView->GetSdrPageView(); + pNewObject->SetEmptyPresObj( sal_False ); + pNewObject->SetGraphic( aNewGraphic ); + String aUndoString( pView->GetDescriptionOfMarkedObjects() ); + aUndoString += (sal_Unicode) ' '; + aUndoString += String( "Compress" ); + pView->BegUndo( aUndoString ); + pView->ReplaceObjectAtView( pObj, *pPageView, pNewObject ); + pView->EndUndo(); + } + } + } + + Invalidate(); +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/drawfunc/objdraw.src b/sc/source/ui/drawfunc/objdraw.src index 02fc43505b1b..3263ec310525 100644 --- a/sc/source/ui/drawfunc/objdraw.src +++ b/sc/source/ui/drawfunc/objdraw.src @@ -527,6 +527,7 @@ Menu RID_POPUP_GRAPHIC MN_EDITLNK MN_DELLNK MenuItem { ITEM_OPEN_HYPERLINK }; + MenuItem { ITEM_COMPRESS_GRAPHIC }; MenuItem { ITEM_EXTERNAL_EDIT }; }; }; @@ -618,6 +619,12 @@ Menu RID_POPUP_CHART MenuItem { Separator = TRUE ; }; //------------------------------ ITEM_GROUP_MENU + MenuItem + { + Identifier = SID_EXPORT_AS_GRAPHIC ; + Command = ".uno:ExportAsGraphic" ; + Text [ en-US ] = "Export as graphic.." ; + }; }; }; diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx index e5cdf92bfb43..b96919261207 100644 --- a/sc/source/ui/formdlg/formula.cxx +++ b/sc/source/ui/formdlg/formula.cxx @@ -32,7 +32,7 @@ #include <sfx2/objsh.hxx> #include <svl/zforlist.hxx> #include <svl/stritem.hxx> -#include <svtools/svtreebx.hxx> +#include <svtools/treelistbox.hxx> #include <sfx2/viewfrm.hxx> #include <vcl/svapp.hxx> #include <vcl/mnemonic.hxx> diff --git a/sc/source/ui/inc/anyrefdg.hxx b/sc/source/ui/inc/anyrefdg.hxx index 7aa3207c5eb7..247edc018a24 100644 --- a/sc/source/ui/inc/anyrefdg.hxx +++ b/sc/source/ui/inc/anyrefdg.hxx @@ -70,6 +70,7 @@ class ScFormulaReferenceHelper Point aOldEditPos; // Original position of the input field Size aOldEditSize; // Original size of the input field Point aOldButtonPos; // Original position of the button + Window* mpOldEditParent; // Original parent of the edit field and the button sal_Bool bEnableColorRef; sal_Bool bHighLightRef; diff --git a/sc/source/ui/inc/chartsh.hxx b/sc/source/ui/inc/chartsh.hxx index 9de99ea28e8c..3e2eddfb787b 100644 --- a/sc/source/ui/inc/chartsh.hxx +++ b/sc/source/ui/inc/chartsh.hxx @@ -23,7 +23,6 @@ #include <sfx2/shell.hxx> #include "shellids.hxx" #include <sfx2/module.hxx> -#include <svx/svdmark.hxx> class ScViewData; @@ -39,6 +38,8 @@ public: ScChartShell(ScViewData* pData); virtual ~ScChartShell(); + void ExecuteExportAsGraphic(SfxRequest& rReq); + void GetExportAsGraphicState(SfxItemSet &rSet); }; #endif diff --git a/sc/source/ui/inc/colorformat.hxx b/sc/source/ui/inc/colorformat.hxx index 5f552d8c2834..3c58131a411d 100644 --- a/sc/source/ui/inc/colorformat.hxx +++ b/sc/source/ui/inc/colorformat.hxx @@ -34,6 +34,7 @@ #include "anyrefdg.hxx" struct ScDataBarFormatData; +class ScDocument; class ScDataBarSettingsDlg : public ModalDialog { @@ -65,14 +66,17 @@ private: rtl::OUString maStrWarnSameValue; SvNumberFormatter* mpNumberFormatter; + ScDocument* mpDoc; + ScAddress maPos; + DECL_LINK(OkBtnHdl, void*); DECL_LINK(TypeSelectHdl, void*); void Init(); public: - ScDataBarSettingsDlg(Window* pParent, ScDocument* pDoc); - ScDataBarSettingsDlg(Window* pParent, const ScDataBarFormatData& rData, ScDocument* pDoc); + ScDataBarSettingsDlg(Window* pParent, ScDocument* pDoc, const ScAddress& rPos); + ScDataBarSettingsDlg(Window* pParent, const ScDataBarFormatData& rData, ScDocument* pDoc, const ScAddress& rPos); ScDataBarFormatData* GetData(); }; diff --git a/sc/source/ui/inc/condformatdlg.hrc b/sc/source/ui/inc/condformatdlg.hrc index d92e7a7e774b..f631b53ac46b 100644 --- a/sc/source/ui/inc/condformatdlg.hrc +++ b/sc/source/ui/inc/condformatdlg.hrc @@ -46,13 +46,25 @@ #define FT_STYLE 21 #define LB_COLOR_FORMAT 22 -#define LB_COL_SCALE2 23 -#define LB_COL_SCALE3 24 -#define LB_TYPE_COL_SCALE 25 -#define ED_COL_SCALE 28 #define WD_PREVIEW 26 -#define LB_COL 27 #define BTN_OPTIONS 30 #define STR_CONDITION 31 +#define FT_RANGE 32 +#define ED_RANGE 33 +#define RB_RANGE 34 + +#define ED_FORMULA 35 + +#define ED_COL_SCALE_MIN 36 +#define ED_COL_SCALE_MIDDLE 37 +#define ED_COL_SCALE_MAX 38 + +#define LB_COL_MIN 39 +#define LB_COL_MIDDLE 40 +#define LB_COL_MAX 41 + +#define LB_TYPE_COL_SCALE_MIN 42 +#define LB_TYPE_COL_SCALE_MIDDLE 43 +#define LB_TYPE_COL_SCALE_MAX 44 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/condformatdlg.hxx b/sc/source/ui/inc/condformatdlg.hxx index c5ea01dff4ea..194d60caca6b 100644 --- a/sc/source/ui/inc/condformatdlg.hxx +++ b/sc/source/ui/inc/condformatdlg.hxx @@ -40,108 +40,30 @@ #include <boost/ptr_container/ptr_vector.hpp> #include <boost/scoped_ptr.hpp> +#include "anyrefdg.hxx" class ScDocument; class ScConditionalFormat; class ScFormatEntry; class ScConditionalFormat; struct ScDataBarFormatData; +class ScCondFrmtEntry; -class ScCondFrmtEntry : public Control -{ -private: - bool mbActive; - ScCondFormatEntryType meType; - - Link maClickHdl; - - //general ui elements - ListBox maLbType; - FixedText maFtCondNr; - FixedText maFtCondition; - - //cond format ui elements - ListBox maLbCondType; - Edit maEdVal1; - Edit maEdVal2; - FixedText maFtStyle; - ListBox maLbStyle; - SvxFontPrevWindow maWdPreview; - - //color format ui elements - ListBox maLbColorFormat; - //color scale ui elements - ListBox maLbColScale2; - ListBox maLbColScale3; - - ListBox maLbEntryTypeMin; - ListBox maLbEntryTypeMiddle; - ListBox maLbEntryTypeMax; - - Edit maEdMin; - Edit maEdMiddle; - Edit maEdMax; - - ColorListBox maLbColMin; - ColorListBox maLbColMiddle; - ColorListBox maLbColMax; - - //data bar ui elements - ListBox maLbDataBarMinType; - ListBox maLbDataBarMaxType; - Edit maEdDataBarMin; - Edit maEdDataBarMax; - PushButton maBtOptions; - - boost::scoped_ptr<ScDataBarFormatData> mpDataBarData; - - // - void SwitchToType(ScCondFormatEntryType eType); - void SetCondType(); - void SetColorScaleType(); - void SetDataBarType(); - void SetFormulaType(); - void HideCondElements(); - void HideColorScaleElements(); - void HideDataBarElements(); - - void SetHeight(); - void Init(); - - ScFormatEntry* createConditionEntry() const; - ScFormatEntry* createColorscaleEntry() const; - ScFormatEntry* createDatabarEntry() const; - ScFormatEntry* createFormulaEntry() const; - - ScDocument* mpDoc; - ScAddress maPos; - sal_Int32 mnIndex; - rtl::OUString maStrCondition; - - DECL_LINK( TypeListHdl, void*); - DECL_LINK( ColFormatTypeHdl, void*); - DECL_LINK( StyleSelectHdl, void* ); - DECL_LINK( OptionBtnHdl, void* ); - DECL_LINK( DataBarTypeSelectHdl, void* ); - DECL_LINK( ConditionTypeSelectHdl, void* ); - DECL_LINK( EntryTypeHdl, ListBox* ); - DECL_LINK( EdModifyHdl, Edit* ); - -public: - ScCondFrmtEntry( Window* pParent, ScDocument* pDoc, const ScAddress& rPos ); - ScCondFrmtEntry( Window* pParent, ScDocument* pDoc, const ScFormatEntry* pFormatEntry, const ScAddress& rPos ); - virtual ~ScCondFrmtEntry(); +namespace condformat { - virtual long Notify( NotifyEvent& rNEvt ); +namespace dialog { - void Select(); - void Deselect(); +enum ScCondFormatDialogType +{ + NONE, + CONDITION, + COLORSCALE, + DATABAR +}; - bool IsSelected() const; - void SetIndex(sal_Int32 nIndex); +} - ScFormatEntry* GetEntry() const; -}; +} class ScCondFormatList : public Control { @@ -158,8 +80,10 @@ private: void RecalcAll(); void DoScroll(long nDiff); + public: - ScCondFormatList( Window* pParent, const ResId& rResId, ScDocument* pDoc, const ScConditionalFormat* pFormat, const ScRangeList& rRanges, const ScAddress& rPos); + ScCondFormatList( Window* pParent, const ResId& rResId, ScDocument* pDoc, const ScConditionalFormat* pFormat, + const ScRangeList& rRanges, const ScAddress& rPos, condformat::dialog::ScCondFormatDialogType eType); ScConditionalFormat* GetConditionalFormat() const; @@ -168,24 +92,58 @@ public: DECL_LINK( ScrollHdl, void* ); DECL_LINK( EntrySelectHdl, ScCondFrmtEntry* ); + DECL_LINK( TypeListHdl, ListBox*); + DECL_LINK( ColFormatTypeHdl, ListBox*); }; -class ScCondFormatDlg : public ModalDialog +class ScCondFormatDlg : public ScAnyRefDlg { private: PushButton maBtnAdd; PushButton maBtnRemove; OKButton maBtnOk; CancelButton maBtnCancel; + FixedText maFtRange; + formula::RefEdit maEdRange; + formula::RefButton maRbRange; ScCondFormatList maCondFormList; ScAddress maPos; + ScDocument* mpDoc; + + const ScConditionalFormat* mpFormat; + + formula::RefEdit* mpLastEdit; + + condformat::dialog::ScCondFormatDialogType meType; + + DECL_LINK( EdRangeModifyHdl, Edit* ); + DECL_LINK( OkBtnHdl, void* ); + DECL_LINK( CancelBtnHdl, void* ); + + virtual sal_Bool Close(); +protected: + + virtual void RefInputDone( sal_Bool bForced = false ); + public: - ScCondFormatDlg(Window* pWindow, ScDocument* pDoc, const ScConditionalFormat* pFormat, const ScRangeList& rRange, const ScAddress& rPos); + ScCondFormatDlg(SfxBindings* pB, SfxChildWindow* pSW, Window* pWindow, ScDocument* pDoc, const ScConditionalFormat* pFormat, + const ScRangeList& rRange, const ScAddress& rPos, condformat::dialog::ScCondFormatDialogType eType); + virtual ~ScCondFormatDlg(); - ScConditionalFormat* GetConditionalFormat() const; + SC_DLLPUBLIC ScConditionalFormat* GetConditionalFormat() const; + + virtual void SetReference(const ScRange&, ScDocument*); + virtual sal_Bool IsRefInputMode() const; + virtual void SetActive(); + virtual sal_Bool IsTableLocked() const; + + void InvalidateRefData(); + + DECL_LINK( RangeGetFocusHdl, formula::RefEdit* ); + DECL_LINK( RangeLoseFocusHdl, void* ); }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/condformatdlgentry.hxx b/sc/source/ui/inc/condformatdlgentry.hxx new file mode 100644 index 000000000000..0abe83bcc428 --- /dev/null +++ b/sc/source/ui/inc/condformatdlgentry.hxx @@ -0,0 +1,219 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include "colorscale.hxx" +#include "conditio.hxx" +#include <formula/funcutl.hxx> + +namespace condformat { + +namespace entry { + +enum ScCondFrmtEntryType +{ + CONDITION, + FORMULA, + COLORSCALE2, + COLORSCALE3, + DATABAR +}; + +} + +} + +class ScCondFrmtEntry : public Control +{ +private: + bool mbActive; + + Link maClickHdl; + + //general ui elements + FixedText maFtCondNr; + FixedText maFtCondition; + + sal_Int32 mnIndex; + rtl::OUString maStrCondition; +protected: + ListBox maLbType; + + ScDocument* mpDoc; + ScAddress maPos; + + DECL_LINK( EdModifyHdl, Edit* ); + + void Select(); + void Deselect(); + + virtual rtl::OUString GetExpressionString() = 0; + +public: + ScCondFrmtEntry( Window* pParent, ScDocument* pDoc, const ScAddress& rPos ); + virtual ~ScCondFrmtEntry(); + + virtual long Notify( NotifyEvent& rNEvt ); + + bool IsSelected() const; + void SetIndex(sal_Int32 nIndex); + sal_Int32 GetIndex() const { return mnIndex; } + void SetHeight(); + + virtual ScFormatEntry* GetEntry() const = 0; + virtual void SetActive() = 0; + virtual void SetInactive() = 0; + + virtual condformat::entry::ScCondFrmtEntryType GetType() = 0; +}; + +class ScConditionFrmtEntry : public ScCondFrmtEntry +{ + + //cond format ui elements + ListBox maLbCondType; + formula::RefEdit maEdVal1; + formula::RefEdit maEdVal2; + FixedText maFtStyle; + ListBox maLbStyle; + SvxFontPrevWindow maWdPreview; + + ScFormatEntry* createConditionEntry() const; + + virtual rtl::OUString GetExpressionString(); + void Init(); + DECL_LINK( StyleSelectHdl, void* ); + DECL_LINK( ConditionTypeSelectHdl, void* ); + +public: + ScConditionFrmtEntry( Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScCondFormatEntry* pFormatEntry = NULL ); + + virtual ScFormatEntry* GetEntry() const; + virtual void SetActive(); + virtual void SetInactive(); + + virtual condformat::entry::ScCondFrmtEntryType GetType() { return condformat::entry::CONDITION; } +}; + +class ScFormulaFrmtEntry : public ScCondFrmtEntry +{ + FixedText maFtStyle; + ListBox maLbStyle; + SvxFontPrevWindow maWdPreview; + formula::RefEdit maEdFormula; + + ScFormatEntry* createFormulaEntry() const; + virtual rtl::OUString GetExpressionString(); + void Init(); + + DECL_LINK( StyleSelectHdl, void* ); + +public: + ScFormulaFrmtEntry( Window* pParent, ScDocument* PDoc, const ScAddress& rPos, const ScCondFormatEntry* pFormatEntry = NULL ); + + virtual ScFormatEntry* GetEntry() const; + virtual void SetActive(); + virtual void SetInactive(); + virtual condformat::entry::ScCondFrmtEntryType GetType() { return condformat::entry::FORMULA; } +}; + +class ScColorScale2FrmtEntry : public ScCondFrmtEntry +{ + + //color format ui elements + ListBox maLbColorFormat; + + //color scale ui elements + ListBox maLbEntryTypeMin; + ListBox maLbEntryTypeMax; + + Edit maEdMin; + Edit maEdMax; + + ColorListBox maLbColMin; + ColorListBox maLbColMax; + + ScFormatEntry* createColorscaleEntry() const; + + virtual rtl::OUString GetExpressionString(); + void Init(); + + DECL_LINK( EntryTypeHdl, ListBox* ); +public: + ScColorScale2FrmtEntry( Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScColorScaleFormat* pFormat = NULL ); + virtual ScFormatEntry* GetEntry() const; + virtual void SetActive(); + virtual void SetInactive(); + virtual condformat::entry::ScCondFrmtEntryType GetType() { return condformat::entry::COLORSCALE2; } +}; + +class ScColorScale3FrmtEntry : public ScCondFrmtEntry +{ + + //color format ui elements + ListBox maLbColorFormat; + + //color scale ui elements + ListBox maLbEntryTypeMin; + ListBox maLbEntryTypeMiddle; + ListBox maLbEntryTypeMax; + + Edit maEdMin; + Edit maEdMiddle; + Edit maEdMax; + + ColorListBox maLbColMin; + ColorListBox maLbColMiddle; + ColorListBox maLbColMax; + + ScFormatEntry* createColorscaleEntry() const; + + virtual rtl::OUString GetExpressionString(); + void Init(); + + DECL_LINK( EntryTypeHdl, ListBox* ); +public: + ScColorScale3FrmtEntry( Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScColorScaleFormat* pFormat = NULL ); + virtual ScFormatEntry* GetEntry() const; + virtual void SetActive(); + virtual void SetInactive(); + virtual condformat::entry::ScCondFrmtEntryType GetType() { return condformat::entry::COLORSCALE3; } +}; + +class ScDataBarFrmtEntry : public ScCondFrmtEntry +{ + //color format ui elements + ListBox maLbColorFormat; + + //data bar ui elements + ListBox maLbDataBarMinType; + ListBox maLbDataBarMaxType; + Edit maEdDataBarMin; + Edit maEdDataBarMax; + + PushButton maBtOptions; + + boost::scoped_ptr<ScDataBarFormatData> mpDataBarData; + + ScFormatEntry* createDatabarEntry() const; + + virtual rtl::OUString GetExpressionString(); + void Init(); + + DECL_LINK( OptionBtnHdl, void* ); + DECL_LINK( DataBarTypeSelectHdl, void* ); +public: + ScDataBarFrmtEntry( Window* pParemt, ScDocument* pDoc, const ScAddress& rPos, const ScDataBarFormat* pFormat = NULL ); + virtual ScFormatEntry* GetEntry() const; + virtual void SetActive(); + virtual void SetInactive(); + + virtual condformat::entry::ScCondFrmtEntryType GetType() { return condformat::entry::DATABAR; } +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/condformathelper.hxx b/sc/source/ui/inc/condformathelper.hxx index 99f5b59cdfb1..297d032d88ad 100644 --- a/sc/source/ui/inc/condformathelper.hxx +++ b/sc/source/ui/inc/condformathelper.hxx @@ -10,6 +10,8 @@ #include <rtl/ustring.hxx> #include "conditio.hxx" +#include "global.hxx" + enum ScCondFormatEntryType { CONDITION, @@ -22,9 +24,10 @@ enum ScCondFormatEntryType class ScCondFormatHelper { public: - static rtl::OUString GetExpression(const ScConditionalFormat& rFormat, const ScAddress& rPos); + static SC_DLLPUBLIC rtl::OUString GetExpression(const ScConditionalFormat& rFormat, const ScAddress& rPos); - static rtl::OUString GetExpression( ScCondFormatEntryType eType, sal_Int32 nIndex ); + static SC_DLLPUBLIC rtl::OUString GetExpression( ScCondFormatEntryType eType, sal_Int32 nIndex, + rtl::OUString aStr1 = rtl::OUString(), rtl::OUString aStr2 = rtl::OUString() ); }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/condformatmgr.hxx b/sc/source/ui/inc/condformatmgr.hxx index 3735e639b480..5b0d1e8a9f82 100644 --- a/sc/source/ui/inc/condformatmgr.hxx +++ b/sc/source/ui/inc/condformatmgr.hxx @@ -85,6 +85,8 @@ public: ScConditionalFormatList* GetConditionalFormatList(); + bool CondFormatsChanged(); + private: PushButton maBtnAdd; PushButton maBtnRemove; @@ -104,6 +106,9 @@ private: DECL_LINK(RemoveBtnHdl, void*); DECL_LINK(EditBtnHdl, void*); + DECL_LINK(AddBtnHdl, void*); + + bool mbModified; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/content.hxx b/sc/source/ui/inc/content.hxx index c0451d673d85..f6f757fc783f 100644 --- a/sc/source/ui/inc/content.hxx +++ b/sc/source/ui/inc/content.hxx @@ -29,7 +29,7 @@ #ifndef SC_CONTENT_HXX #define SC_CONTENT_HXX -#include <svtools/svtreebx.hxx> +#include <svtools/treelistbox.hxx> #include "global.hxx" #include "address.hxx" #include <tools/solar.h> diff --git a/sc/source/ui/inc/docfunc.hxx b/sc/source/ui/inc/docfunc.hxx index 8d87bd98e8b0..3c9d64d8a255 100644 --- a/sc/source/ui/inc/docfunc.hxx +++ b/sc/source/ui/inc/docfunc.hxx @@ -53,6 +53,7 @@ struct ScTabOpParam; class ScTableProtection; struct ScCellMergeOption; class ScConditionalFormat; +class ScConditionalFormatList; // --------------------------------------------------------------------------- @@ -212,6 +213,14 @@ public: * @param pFormat if NULL only delete an old format */ virtual void ReplaceConditionalFormat( sal_uLong nOldIndex, ScConditionalFormat* pFormat, SCTAB nTab, const ScRangeList& rRanges ); + + /** + * Sets or replaces the conditional format list of a table + * + * @param pList the new ScConditionalFormatList, method takes ownership + * @param nTab the tab to which the conditional format list belongs + */ + virtual void SetConditionalFormatList( ScConditionalFormatList* pList, SCTAB nTab ); }; class ScDocFuncDirect : public ScDocFunc diff --git a/sc/source/ui/inc/drawview.hxx b/sc/source/ui/inc/drawview.hxx index ca3eb42e208a..6574cac15d0b 100644 --- a/sc/source/ui/inc/drawview.hxx +++ b/sc/source/ui/inc/drawview.hxx @@ -137,6 +137,8 @@ public: SdrEndTextEditKind ScEndTextEdit(); // calls SetDrawTextUndo(0) ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > CopyToTransferable(); + + static void CheckOle( const SdrMarkList& rMarkList, sal_Bool& rAnyOle, sal_Bool& rOneOle ); }; diff --git a/sc/source/ui/inc/funcpage.hxx b/sc/source/ui/inc/funcpage.hxx index bcfa2dc068c9..f3e7c51a23d5 100644 --- a/sc/source/ui/inc/funcpage.hxx +++ b/sc/source/ui/inc/funcpage.hxx @@ -30,7 +30,7 @@ #include <vcl/tabctrl.hxx> #include "parawin.hxx" -#include <svtools/svtreebx.hxx> +#include <svtools/treelistbox.hxx> #include "compiler.hxx" #include "cell.hxx" diff --git a/sc/source/ui/inc/funcutl.hxx b/sc/source/ui/inc/funcutl.hxx deleted file mode 100644 index e3c995bbb21e..000000000000 --- a/sc/source/ui/inc/funcutl.hxx +++ /dev/null @@ -1,188 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef SC_FUNCUTL_HXX -#define SC_FUNCUTL_HXX - -#include <vcl/scrbar.hxx> -#include <vcl/fixed.hxx> -#include <svtools/svmedit.hxx> -#include "anyrefdg.hxx" // formula::RefButton - - -//============================================================================ -// class ValWnd - -class ValWnd : public Window -{ -public: - ValWnd( Window* pParent, const ResId& rId ); - - void SetValue( const String& rStrVal ); - -protected: - virtual void Paint( const Rectangle& rRect ); - -private: - String aStrValue; - Rectangle aRectOut; -}; - - -//============================================================================ -// class ScEditBox - -class ScEditBox : public Control -{ -private: - - MultiLineEdit* pMEdit; - Link aSelChangedLink; - Selection aOldSel; - sal_Bool bMouseFlag; - DECL_LINK( ChangedHdl, ScEditBox* ); - -protected: - - virtual long PreNotify( NotifyEvent& rNEvt ); - virtual void SelectionChanged(); - virtual void Resize(); - virtual void GetFocus(); - - -public: - ScEditBox( Window* pParent, const ResId& rResId ); - - ~ScEditBox(); - - MultiLineEdit* GetEdit() {return pMEdit;} - - void SetSelChangedHdl( const Link& rLink ) { aSelChangedLink = rLink; } - const Link& GetSelChangedHdl() const { return aSelChangedLink; } - - void UpdateOldSel(); -}; - - - -//============================================================================ -// class ArgEdit - -class ArgEdit : public formula::RefEdit -{ -public: - ArgEdit( Window* pParent, const ResId& rResId ); - - void Init( ArgEdit* pPrevEdit, ArgEdit* pNextEdit, - ScrollBar& rArgSlider, sal_uInt16 nArgCount ); - -protected: - virtual void KeyInput( const KeyEvent& rKEvt ); - -private: - ArgEdit* pEdPrev; - ArgEdit* pEdNext; - ScrollBar* pSlider; - sal_uInt16 nArgs; -}; - - -//============================================================================ -// class ArgInput - -class ArgInput -{ -private: - - Link aFxClickLink; - Link aRefClickLink; - Link aFxFocusLink; - Link aRefFocusLink; - Link aEdFocusLink; - Link aEdModifyLink; - - FixedText* pFtArg; - ImageButton* pBtnFx; - ArgEdit* pEdArg; - formula::RefButton* pRefBtn; - - DECL_LINK( FxBtnClickHdl, ImageButton* ); - DECL_LINK( RefBtnClickHdl,formula::RefButton* ); - DECL_LINK( FxBtnFocusHdl, ImageButton* ); - DECL_LINK( RefBtnFocusHdl,formula::RefButton* ); - DECL_LINK( EdFocusHdl, ArgEdit* ); - DECL_LINK( EdModifyHdl,ArgEdit* ); - -protected: - - virtual void FxClick(); - virtual void RefClick(); - virtual void FxFocus(); - virtual void RefFocus(); - virtual void EdFocus(); - virtual void EdModify(); - -public: - - ArgInput(); - - void InitArgInput ( FixedText* pftArg, - ImageButton* pbtnFx, - ArgEdit* pedArg, - formula::RefButton* prefBtn); - - void SetArgName(const String &aArg); - String GetArgName(); - void SetArgNameFont(const Font&); - - void SetArgVal(const String &aVal); - String GetArgVal(); - - void SetArgSelection (const Selection& rSel ); - - ArgEdit* GetArgEdPtr() {return pEdArg;} - - - void SetFxClickHdl( const Link& rLink ) { aFxClickLink = rLink; } - const Link& GetFxClickHdl() const { return aFxClickLink; } - - void SetRefClickHdl( const Link& rLink ) { aRefClickLink = rLink; } - const Link& GetRefClickHdl() const { return aRefClickLink; } - - void SetFxFocusHdl( const Link& rLink ) { aFxFocusLink = rLink; } - const Link& GetFxFocusHdl() const { return aFxFocusLink; } - - void SetRefFocusHdl( const Link& rLink ) { aRefFocusLink = rLink; } - const Link& GetRefFocusHdl() const { return aRefFocusLink; } - - void SetEdFocusHdl( const Link& rLink ) { aEdFocusLink = rLink; } - const Link& GetEdFocusHdl() const { return aEdFocusLink; } - - void SetEdModifyHdl( const Link& rLink ) { aEdModifyLink = rLink; } - const Link& GetEdModifyHdl() const { return aEdModifyLink; } - - void Hide(); - void Show(); - -}; - - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/graphsh.hxx b/sc/source/ui/inc/graphsh.hxx index 3c700c73ad12..31d2d35bcffe 100644 --- a/sc/source/ui/inc/graphsh.hxx +++ b/sc/source/ui/inc/graphsh.hxx @@ -47,6 +47,9 @@ public: void ExecuteExternalEdit(SfxRequest& rReq); void GetExternalEditState(SfxItemSet &rSet); + + void ExecuteCompressGraphic(SfxRequest& rReq); + void GetCompressGraphicState(SfxItemSet &rSet); }; #endif diff --git a/sc/source/ui/inc/parawin.hxx b/sc/source/ui/inc/parawin.hxx deleted file mode 100644 index 8179733dba08..000000000000 --- a/sc/source/ui/inc/parawin.hxx +++ /dev/null @@ -1,163 +0,0 @@ -/* -*- 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 SC_PARAWIN_HXX -#define SC_PARAWIN_HXX - -#include "funcutl.hxx" -#include "global.hxx" // ScAddress -#include <svtools/stdctrl.hxx> -#include <vcl/lstbox.hxx> -#include <vcl/group.hxx> -#include <svtools/svmedit.hxx> -#include <vcl/tabpage.hxx> -#include <vcl/tabctrl.hxx> - -#include <vector> - -class ScFuncDesc; - -//============================================================================ -#define NOT_FOUND 0xffff -//============================================================================ - -class ScParaWin : public TabPage -{ -private: - - Link aScrollLink; - Link aFxLink; - Link aArgModifiedLink; - - ::std::vector<sal_uInt16> aVisibleArgMapping; - const ScFuncDesc* pFuncDesc; - ScAnyRefDlg* pMyParent; - sal_uInt16 nArgs; // unsuppressed arguments - Font aFntBold; - Font aFntLight; - - FixedInfo aFtEditDesc; - FixedText aFtArgName; - FixedInfo aFtArgDesc; - - ImageButton aBtnFx1; - FixedText aFtArg1; - ArgEdit aEdArg1; - formula::RefButton aRefBtn1; - ImageButton aBtnFx2; - FixedText aFtArg2; - ArgEdit aEdArg2; - formula::RefButton aRefBtn2; - ImageButton aBtnFx3; - FixedText aFtArg3; - ArgEdit aEdArg3; - formula::RefButton aRefBtn3; - ImageButton aBtnFx4; - FixedText aFtArg4; - ArgEdit aEdArg4; - formula::RefButton aRefBtn4; - ScrollBar aSlider; - sal_Bool bRefMode; - - sal_uInt16 nEdFocus; - sal_uInt16 nActiveLine; - - ArgInput aArgInput[4]; - String aDefaultString; - DECL_LINK( ScrollHdl, ScrollBar* ); - DECL_LINK( ModifyHdl, ArgInput* ); - DECL_LINK( GetEdFocusHdl, ArgInput* ); - DECL_LINK( GetFxFocusHdl, ArgInput* ); - DECL_LINK( GetFxHdl, ArgInput* ); - -protected: - - virtual void SliderMoved(); - virtual void ArgumentModified(); - virtual void FxClick(); - - void InitArgInput( sal_uInt16 nPos, FixedText& rFtArg, ImageButton& rBtnFx, - ArgEdit& rEdArg, formula::RefButton& rRefBtn); - - void DelParaArray(); - void SetArgumentDesc(const String& aText); - void SetArgumentText(const String& aText); - - - void SetArgName (sal_uInt16 no,const String &aArg); - void SetArgNameFont (sal_uInt16 no,const Font&); - void SetArgVal (sal_uInt16 no,const String &aArg); - - void HideParaLine(sal_uInt16 no); - void ShowParaLine(sal_uInt16 no); - void UpdateArgDesc( sal_uInt16 nArg ); - void UpdateArgInput( sal_uInt16 nOffset, sal_uInt16 i ); - -public: - ScParaWin(ScAnyRefDlg* pParent,Point aPos); - ~ScParaWin(); - - void SetFunctionDesc(const ScFuncDesc* pFDesc); - void SetArgumentOffset(sal_uInt16 nOffset); - void SetEditDesc(const String& aText); - void UpdateParas(); - void ClearAll(); - - sal_Bool IsRefMode() {return bRefMode;} - void SetRefMode(sal_Bool bFlag) {bRefMode=bFlag;} - - sal_uInt16 GetActiveLine(); - void SetActiveLine(sal_uInt16 no); - formula::RefEdit* GetActiveEdit(); - String GetActiveArgName(); - - String GetArgument(sal_uInt16 no); - void SetArgument(sal_uInt16 no, const String& aString); - void SetArgumentFonts(const Font&aBoldFont,const Font&aLightFont); - - void SetEdFocus(sal_uInt16 nEditLine); // Visable edit lines - sal_uInt16 GetSliderPos(); - void SetSliderPos(sal_uInt16 nSliderPos); - - void SetScrollHdl( const Link& rLink ) { aScrollLink = rLink; } - const Link& GetScrollHdl() const { return aScrollLink; } - - void SetArgModifiedHdl( const Link& rLink ) { aArgModifiedLink = rLink; } - const Link& GetArgModifiedHdl() const { return aArgModifiedLink; } - - void SetFxHdl( const Link& rLink ) { aFxLink = rLink; } - const Link& GetFxHdl() const { return aFxLink; } -}; - - - - - -#endif // SC_PARAWIN_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/reffact.hxx b/sc/source/ui/inc/reffact.hxx index e7d728f5150d..e906e8c6cb4b 100644 --- a/sc/source/ui/inc/reffact.hxx +++ b/sc/source/ui/inc/reffact.hxx @@ -45,6 +45,9 @@ DECL_WRAPPER_WITHID(ScNameDlgWrapper) DECL_WRAPPER_WITHID(ScNameDefDlgWrapper) +DECL_WRAPPER_WITHID(ScCondFormatConditionDlgWrapper) +DECL_WRAPPER_WITHID(ScCondFormatColorScaleDlgWrapper) +DECL_WRAPPER_WITHID(ScCondFormatDataBarDlgWrapper) DECL_WRAPPER_WITHID(ScSolverDlgWrapper) DECL_WRAPPER_WITHID(ScOptSolverDlgWrapper) DECL_WRAPPER_WITHID(ScPivotLayoutWrapper) diff --git a/sc/source/ui/miscdlgs/anyrefdg.cxx b/sc/source/ui/miscdlgs/anyrefdg.cxx index 99136b9379be..8ebb1c3e21ca 100644 --- a/sc/source/ui/miscdlgs/anyrefdg.cxx +++ b/sc/source/ui/miscdlgs/anyrefdg.cxx @@ -60,6 +60,7 @@ ScFormulaReferenceHelper::ScFormulaReferenceHelper(IAnyRefDialog* _pDlg,SfxBindi , pAccel( NULL ) , pHiddenMarks(NULL) , nRefTab(0) + , mpOldEditParent( NULL ) , bHighLightRef( false ) , bAccInserted( false ) { @@ -365,6 +366,9 @@ void ScFormulaReferenceHelper::RefInputDone( sal_Bool bForced ) bAccInserted = false; } + // restore the parent of the edit field + pRefEdit->SetParent(mpOldEditParent); + // Fenstertitel anpassen m_pWindow->SetText(sOldDialogText); @@ -377,6 +381,7 @@ void ScFormulaReferenceHelper::RefInputDone( sal_Bool bForced ) // set button position and image if( pRefBtn ) { + pRefBtn->SetParent(m_pWindow); pRefBtn->SetPosPixel( aOldButtonPos ); pRefBtn->SetStartImage(); } @@ -408,6 +413,19 @@ void ScFormulaReferenceHelper::RefInputStart( formula::RefEdit* pEdit, formula:: sNewDialogText = sOldDialogText; sNewDialogText.AppendAscii(RTL_CONSTASCII_STRINGPARAM( ": " )); + mpOldEditParent = pRefEdit->GetParent(); + + // Alte Daten merken + aOldDialogSize = m_pWindow->GetOutputSizePixel(); + aOldEditPos = pRefEdit->GetPosPixel(); + aOldEditSize = pRefEdit->GetSizePixel(); + if (pRefBtn) + aOldButtonPos = pRefBtn->GetPosPixel(); + + pRefEdit->SetParent(m_pWindow); + if(pRefBtn) + pRefBtn->SetParent(m_pWindow); + // Alle Elemente ausser EditCell und Button verstecken sal_uInt16 nChildren = m_pWindow->GetChildCount(); pHiddenMarks = new sal_Bool [nChildren]; @@ -429,13 +447,6 @@ void ScFormulaReferenceHelper::RefInputStart( formula::RefEdit* pEdit, formula:: } } - // Alte Daten merken - aOldDialogSize = m_pWindow->GetOutputSizePixel(); - aOldEditPos = pRefEdit->GetPosPixel(); - aOldEditSize = pRefEdit->GetSizePixel(); - if (pRefBtn) - aOldButtonPos = pRefBtn->GetPosPixel(); - // Edit-Feld verschieben und anpassen Size aNewDlgSize(aOldDialogSize.Width(), aOldEditSize.Height()); Size aNewEditSize(aNewDlgSize); @@ -609,7 +620,7 @@ void ScFormulaReferenceHelper::EnableSpreadsheets(sal_Bool bFlag, sal_Bool bChil -void lcl_InvalidateWindows() +static void lcl_InvalidateWindows() { TypeId aType(TYPE(ScDocShell)); ScDocShell* pDocShell = (ScDocShell*)SfxObjectShell::GetFirst(&aType); @@ -642,7 +653,7 @@ void lcl_InvalidateWindows() } //---------------------------------------------------------------------------- -void lcl_HideAllReferences() +static void lcl_HideAllReferences() { TypeId aScType = TYPE(ScTabViewShell); SfxViewShell* pSh = SfxViewShell::GetFirst( &aScType ); diff --git a/sc/source/ui/miscdlgs/autofmt.cxx b/sc/source/ui/miscdlgs/autofmt.cxx index fc3c4c9a4a37..d6a3de22f855 100644 --- a/sc/source/ui/miscdlgs/autofmt.cxx +++ b/sc/source/ui/miscdlgs/autofmt.cxx @@ -98,7 +98,7 @@ ScAutoFmtPreview::~ScAutoFmtPreview() //------------------------------------------------------------------------ -void lcl_SetFontProperties( +static void lcl_SetFontProperties( Font& rFont, const SvxFontItem& rFontItem, const SvxWeightItem& rWeightItem, diff --git a/sc/source/ui/miscdlgs/conflictsdlg.cxx b/sc/source/ui/miscdlgs/conflictsdlg.cxx index 65423c296c1e..58d20e24611f 100644 --- a/sc/source/ui/miscdlgs/conflictsdlg.cxx +++ b/sc/source/ui/miscdlgs/conflictsdlg.cxx @@ -698,28 +698,28 @@ IMPL_LINK_NOARG(ScConflictsDlg, KeepAllOthersHandle) return 0; } -void lcl_MoveControlX( Window& rWindow, long nDelta ) +static void lcl_MoveControlX( Window& rWindow, long nDelta ) { Point aPos( rWindow.GetPosPixel() ); aPos.X() += nDelta; rWindow.SetPosPixel( aPos ); } -void lcl_MoveControlY( Window& rWindow, long nDelta ) +static void lcl_MoveControlY( Window& rWindow, long nDelta ) { Point aPos( rWindow.GetPosPixel() ); aPos.Y() += nDelta; rWindow.SetPosPixel( aPos ); } -void lcl_ChangeControlWidth( Window& rWindow, long nDelta ) +static void lcl_ChangeControlWidth( Window& rWindow, long nDelta ) { Size aSize( rWindow.GetSizePixel() ); aSize.Width() += nDelta; rWindow.SetSizePixel( aSize ); } -void lcl_ChangeControlHeight( Window& rWindow, long nDelta ) +static void lcl_ChangeControlHeight( Window& rWindow, long nDelta ) { Size aSize( rWindow.GetSizePixel() ); aSize.Height() += nDelta; diff --git a/sc/source/ui/miscdlgs/retypepassdlg.cxx b/sc/source/ui/miscdlgs/retypepassdlg.cxx index d12e5836c5db..9dc57a25d20b 100644 --- a/sc/source/ui/miscdlgs/retypepassdlg.cxx +++ b/sc/source/ui/miscdlgs/retypepassdlg.cxx @@ -292,7 +292,7 @@ void ScRetypePassDlg::ResetTableRows() SetTableData(i, static_cast< SCTAB >( i + nScrollPos )); } -bool lcl_IsInGoodStatus(ScPassHashProtectable* pProtected, ScPasswordHash eDesiredHash) +static bool lcl_IsInGoodStatus(ScPassHashProtectable* pProtected, ScPasswordHash eDesiredHash) { if (!pProtected || !pProtected->isProtected()) // Not protected. diff --git a/sc/source/ui/miscdlgs/solveroptions.cxx b/sc/source/ui/miscdlgs/solveroptions.cxx index 90f3e28e08b2..4465052cbb9f 100644 --- a/sc/source/ui/miscdlgs/solveroptions.cxx +++ b/sc/source/ui/miscdlgs/solveroptions.cxx @@ -85,10 +85,10 @@ public: void SetDoubleValue( double fNew ) { mbIsDouble = true; mfDoubleValue = fNew; } void SetIntValue( sal_Int32 nNew ) { mbIsDouble = false; mnIntValue = nNew; } - virtual void Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry ); + virtual void Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry ); }; -void ScSolverOptionsString::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16, SvLBoxEntry* /* pEntry */ ) +void ScSolverOptionsString::Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16, SvLBoxEntry* /* pEntry */ ) { //! move position? (SvxLinguTabPage: aPos.X() += 20) String aNormalStr( GetText() ); diff --git a/sc/source/ui/miscdlgs/solverutil.cxx b/sc/source/ui/miscdlgs/solverutil.cxx index 8ed768e1f760..b24bffd96e87 100644 --- a/sc/source/ui/miscdlgs/solverutil.cxx +++ b/sc/source/ui/miscdlgs/solverutil.cxx @@ -46,7 +46,7 @@ using namespace com::sun::star; #define SCSOLVER_SERVICE "com.sun.star.sheet.Solver" -uno::Reference<sheet::XSolver> lcl_CreateSolver( const uno::Reference<uno::XInterface>& xIntFac, +static uno::Reference<sheet::XSolver> lcl_CreateSolver( const uno::Reference<uno::XInterface>& xIntFac, const uno::Reference<uno::XComponentContext>& xCtx ) { uno::Reference<sheet::XSolver> xSolver; diff --git a/sc/source/ui/miscdlgs/tabopdlg.cxx b/sc/source/ui/miscdlgs/tabopdlg.cxx index 759af45e10c6..6d7a655217aa 100644 --- a/sc/source/ui/miscdlgs/tabopdlg.cxx +++ b/sc/source/ui/miscdlgs/tabopdlg.cxx @@ -230,7 +230,7 @@ void ScTabOpDlg::RaiseError( ScTabOpErr eError ) //---------------------------------------------------------------------------- -sal_Bool lcl_Parse( const String& rString, ScDocument* pDoc, SCTAB nCurTab, +static sal_Bool lcl_Parse( const String& rString, ScDocument* pDoc, SCTAB nCurTab, ScRefAddress& rStart, ScRefAddress& rEnd ) { sal_Bool bRet = false; diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx index 86bc5454203a..aa9cee00238e 100644 --- a/sc/source/ui/navipi/content.cxx +++ b/sc/source/ui/navipi/content.cxx @@ -39,6 +39,7 @@ #include <vcl/svapp.hxx> #include <tools/urlobj.hxx> #include <svl/urlbmk.hxx> +#include "svtools/svlbitm.hxx" #include <stdlib.h> #include "content.hxx" @@ -257,7 +258,7 @@ sal_uLong ScContentTree::GetChildIndex( SvLBoxEntry* pEntry ) const return nChild; } -String lcl_GetDBAreaRange( ScDocument* pDoc, const String& rDBName ) +static String lcl_GetDBAreaRange( ScDocument* pDoc, const String& rDBName ) { String aRet; if (pDoc) @@ -850,7 +851,7 @@ const ScAreaLink* ScContentTree::GetLink( sal_uLong nIndex ) return NULL; } -String lcl_NoteString( const ScPostIt& rNote ) +static String lcl_NoteString( const ScPostIt& rNote ) { String aText = rNote.GetText(); xub_StrLen nAt; @@ -1004,7 +1005,7 @@ sal_Bool ScContentTree::DrawNamesChanged( sal_uInt16 nType ) return !bEqual; } -bool lcl_GetRange( ScDocument* pDoc, sal_uInt16 nType, const String& rName, ScRange& rRange ) +static bool lcl_GetRange( ScDocument* pDoc, sal_uInt16 nType, const String& rName, ScRange& rRange ) { bool bFound = false; @@ -1039,7 +1040,7 @@ bool lcl_GetRange( ScDocument* pDoc, sal_uInt16 nType, const String& rName, ScRa return bFound; } -void lcl_DoDragObject( ScDocShell* pSrcShell, const String& rName, sal_uInt16 nType, Window* pWin ) +static void lcl_DoDragObject( ScDocShell* pSrcShell, const String& rName, sal_uInt16 nType, Window* pWin ) { ScDocument* pSrcDoc = pSrcShell->GetDocument(); ScDrawLayer* pModel = pSrcDoc->GetDrawLayer(); @@ -1077,7 +1078,7 @@ void lcl_DoDragObject( ScDocShell* pSrcShell, const String& rName, sal_uInt16 nT } } -void lcl_DoDragCells( ScDocShell* pSrcShell, const ScRange& rRange, sal_uInt16 nFlags, Window* pWin ) +static void lcl_DoDragCells( ScDocShell* pSrcShell, const ScRange& rRange, sal_uInt16 nFlags, Window* pWin ) { ScMarkData aMark; aMark.SelectTable( rRange.aStart.Tab(), sal_True ); diff --git a/sc/source/ui/optdlg/calcoptionsdlg.cxx b/sc/source/ui/optdlg/calcoptionsdlg.cxx index 69bd2a8c3332..c4df06a4c1a6 100644 --- a/sc/source/ui/optdlg/calcoptionsdlg.cxx +++ b/sc/source/ui/optdlg/calcoptionsdlg.cxx @@ -42,10 +42,10 @@ public: OptionString(const rtl::OUString& rDesc, const rtl::OUString& rValue) : maDesc(rDesc), maValue(rValue) {} - virtual void Paint(const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry); + virtual void Paint(const Point& rPos, SvTreeListBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry); }; -void OptionString::Paint(const Point& rPos, SvLBox& rDev, sal_uInt16 /*nFlags*/, SvLBoxEntry* /*pEntry*/) +void OptionString::Paint(const Point& rPos, SvTreeListBox& rDev, sal_uInt16 /*nFlags*/, SvLBoxEntry* /*pEntry*/) { Point aPos = rPos; rtl::OUString aDesc = maDesc + rtl::OUString(": "); diff --git a/sc/source/ui/pagedlg/areasdlg.cxx b/sc/source/ui/pagedlg/areasdlg.cxx index bee67f16b152..c67da84b5491 100644 --- a/sc/source/ui/pagedlg/areasdlg.cxx +++ b/sc/source/ui/pagedlg/areasdlg.cxx @@ -74,9 +74,9 @@ using ::rtl::OUString; // globale Funktionen (->am Ende der Datei): -bool lcl_CheckRepeatString( const String& rStr, ScDocument* pDoc, bool bIsRow, ScRange* pRange ); -void lcl_GetRepeatRangeString( const ScRange* pRange, ScDocument* pDoc, bool bIsRow, String& rStr ); -void lcl_GetRepeatRangeString( const ScRange* pRange, ScDocument* pDoc, bool bIsRow, OUString& rStr ) +static bool lcl_CheckRepeatString( const String& rStr, ScDocument* pDoc, bool bIsRow, ScRange* pRange ); +static void lcl_GetRepeatRangeString( const ScRange* pRange, ScDocument* pDoc, bool bIsRow, String& rStr ); +static void lcl_GetRepeatRangeString( const ScRange* pRange, ScDocument* pDoc, bool bIsRow, OUString& rStr ) { String aStr; lcl_GetRepeatRangeString(pRange, pDoc, bIsRow, aStr); @@ -698,7 +698,7 @@ IMPL_LINK( ScPrintAreasDlg, Impl_ModifyHdl, formula::RefEdit*, pEd ) // TODO: It might make sense to move these functions to address.?xx. -kohei -bool lcl_CheckOne_OOO( const String& rStr, bool bIsRow, SCCOLROW& rVal ) +static bool lcl_CheckOne_OOO( const String& rStr, bool bIsRow, SCCOLROW& rVal ) { // Zulaessige Syntax fuer rStr: // Row: [$]1-MAXTAB @@ -740,13 +740,13 @@ bool lcl_CheckOne_OOO( const String& rStr, bool bIsRow, SCCOLROW& rVal ) return bStrOk; } -bool lcl_CheckOne_XL_A1( const String& rStr, bool bIsRow, SCCOLROW& rVal ) +static bool lcl_CheckOne_XL_A1( const String& rStr, bool bIsRow, SCCOLROW& rVal ) { // XL A1 style is identical to OOO one for print range formats. return lcl_CheckOne_OOO(rStr, bIsRow, rVal); } -bool lcl_CheckOne_XL_R1C1( const String& rStr, bool bIsRow, SCCOLROW& rVal ) +static bool lcl_CheckOne_XL_R1C1( const String& rStr, bool bIsRow, SCCOLROW& rVal ) { xub_StrLen nLen = rStr.Len(); if (nLen <= 1) @@ -774,7 +774,7 @@ bool lcl_CheckOne_XL_R1C1( const String& rStr, bool bIsRow, SCCOLROW& rVal ) return true; } -bool lcl_CheckRepeatOne( const String& rStr, formula::FormulaGrammar::AddressConvention eConv, bool bIsRow, SCCOLROW& rVal ) +static bool lcl_CheckRepeatOne( const String& rStr, formula::FormulaGrammar::AddressConvention eConv, bool bIsRow, SCCOLROW& rVal ) { switch (eConv) { @@ -792,7 +792,7 @@ bool lcl_CheckRepeatOne( const String& rStr, formula::FormulaGrammar::AddressCon return false; } -bool lcl_CheckRepeatString( const String& rStr, ScDocument* pDoc, bool bIsRow, ScRange* pRange ) +static bool lcl_CheckRepeatString( const String& rStr, ScDocument* pDoc, bool bIsRow, ScRange* pRange ) { // Row: [valid row] rsep [valid row] // Col: [valid col] rsep [valid col] @@ -879,7 +879,7 @@ bool lcl_CheckRepeatString( const String& rStr, ScDocument* pDoc, bool bIsRow, S // ---------------------------------------------------------------------------- -void lcl_GetRepeatRangeString( const ScRange* pRange, ScDocument* pDoc, bool bIsRow, String& rStr ) +static void lcl_GetRepeatRangeString( const ScRange* pRange, ScDocument* pDoc, bool bIsRow, String& rStr ) { rStr.Erase(); if (!pRange) diff --git a/sc/source/ui/pagedlg/tphfedit.cxx b/sc/source/ui/pagedlg/tphfedit.cxx index 19925a2d05c7..0e6075afe1f2 100644 --- a/sc/source/ui/pagedlg/tphfedit.cxx +++ b/sc/source/ui/pagedlg/tphfedit.cxx @@ -67,7 +67,7 @@ ScEditWindow* GetScEditWindow () //======================================================================== -void lcl_GetFieldData( ScHeaderFieldData& rData ) +static void lcl_GetFieldData( ScHeaderFieldData& rData ) { SfxViewShell* pShell = SfxViewShell::Current(); if (pShell) diff --git a/sc/source/ui/pagedlg/tptable.cxx b/sc/source/ui/pagedlg/tptable.cxx index 4c6a29b97eb0..50857f9f4976 100644 --- a/sc/source/ui/pagedlg/tptable.cxx +++ b/sc/source/ui/pagedlg/tptable.cxx @@ -75,12 +75,12 @@ static sal_uInt16 pPageTableRanges[] = 0 }; -sal_Bool lcl_PutVObjModeItem( sal_uInt16 nWhich, +static sal_Bool lcl_PutVObjModeItem( sal_uInt16 nWhich, SfxItemSet& rCoreSet, const SfxItemSet& rOldSet, const CheckBox& rBtn ); -sal_Bool lcl_PutScaleItem( sal_uInt16 nWhich, +static sal_Bool lcl_PutScaleItem( sal_uInt16 nWhich, SfxItemSet& rCoreSet, const SfxItemSet& rOldSet, const ListBox& rListBox, @@ -88,7 +88,7 @@ sal_Bool lcl_PutScaleItem( sal_uInt16 nWhich, const SpinField& rEd, sal_uInt16 nValue ); -sal_Bool lcl_PutScaleItem2( sal_uInt16 nWhich, +static sal_Bool lcl_PutScaleItem2( sal_uInt16 nWhich, SfxItemSet& rCoreSet, const SfxItemSet& rOldSet, const ListBox& rListBox, @@ -96,7 +96,7 @@ sal_Bool lcl_PutScaleItem2( sal_uInt16 nWhich, const NumericField& rEd1, const NumericField& rEd2 ); -sal_Bool lcl_PutBoolItem( sal_uInt16 nWhich, +static sal_Bool lcl_PutBoolItem( sal_uInt16 nWhich, SfxItemSet& rCoreSet, const SfxItemSet& rOldSet, sal_Bool bIsChecked, @@ -472,7 +472,7 @@ IMPL_LINK_NOARG(ScTablePage, ScaleHdl) // Hilfsfunktionen fuer FillItemSet: //======================================================================== -sal_Bool lcl_PutBoolItem( sal_uInt16 nWhich, +static sal_Bool lcl_PutBoolItem( sal_uInt16 nWhich, SfxItemSet& rCoreSet, const SfxItemSet& rOldSet, sal_Bool bIsChecked, @@ -491,7 +491,7 @@ sal_Bool lcl_PutBoolItem( sal_uInt16 nWhich, //------------------------------------------------------------------------ -sal_Bool lcl_PutVObjModeItem( sal_uInt16 nWhich, +static sal_Bool lcl_PutVObjModeItem( sal_uInt16 nWhich, SfxItemSet& rCoreSet, const SfxItemSet& rOldSet, const CheckBox& rBtn ) @@ -512,7 +512,7 @@ sal_Bool lcl_PutVObjModeItem( sal_uInt16 nWhich, //------------------------------------------------------------------------ -sal_Bool lcl_PutScaleItem( sal_uInt16 nWhich, +static sal_Bool lcl_PutScaleItem( sal_uInt16 nWhich, SfxItemSet& rCoreSet, const SfxItemSet& rOldSet, const ListBox& rListBox, @@ -534,7 +534,7 @@ sal_Bool lcl_PutScaleItem( sal_uInt16 nWhich, } -sal_Bool lcl_PutScaleItem2( sal_uInt16 nWhich, +static sal_Bool lcl_PutScaleItem2( sal_uInt16 nWhich, SfxItemSet& rCoreSet, const SfxItemSet& rOldSet, const ListBox& rListBox, diff --git a/sc/source/ui/src/colorformat.src b/sc/source/ui/src/colorformat.src index ce07fcb8e85e..2cc585283e62 100644 --- a/sc/source/ui/src/colorformat.src +++ b/sc/source/ui/src/colorformat.src @@ -134,14 +134,13 @@ ModalDialog RID_SCDLG_DATABAR DropDown = TRUE; StringList [ en-US ] = { + "Automatic"; "Minimum"; "Maximum"; "Percentile"; - "Percent"; "Value"; + "Percent"; "Formula"; - "AutoMin"; - "AutoMax"; }; }; ListBox LB_AXIS_POSITION diff --git a/sc/source/ui/src/condformatdlg.src b/sc/source/ui/src/condformatdlg.src index 2800724d2036..5bd45a05d6ef 100644 --- a/sc/source/ui/src/condformatdlg.src +++ b/sc/source/ui/src/condformatdlg.src @@ -28,7 +28,7 @@ #include "condformatdlg.hrc" -ModalDialog RID_SCDLG_CONDFORMAT +ModelessDialog RID_SCDLG_CONDFORMAT { OutputSize = TRUE; Hide = TRUE; @@ -50,14 +50,14 @@ ModalDialog RID_SCDLG_CONDFORMAT }; PushButton BTN_ADD { - Pos = MAP_APPFONT( 5, 255 ); + Pos = MAP_APPFONT( 5, 245 ); Size = MAP_APPFONT( 50, 14 ); Text [ en-US ] = "Add"; TabStop = TRUE; }; PushButton BTN_REMOVE { - Pos = MAP_APPFONT( 60, 255 ); + Pos = MAP_APPFONT( 60, 245 ); Size = MAP_APPFONT( 50, 14 ); Text [ en-US ] = "Remove"; TabStop = TRUE; @@ -68,6 +68,24 @@ ModalDialog RID_SCDLG_CONDFORMAT Size = MAP_APPFONT( 290, 220 ); Border = TRUE; }; + FixedText FT_RANGE + { + Pos = MAP_APPFONT( 5, 262 ); + Size = MAP_APPFONT( 50, 16 ); + Text [ en-US ] = "Range:"; + }; + Edit ED_RANGE + { + Pos = MAP_APPFONT( 60, 262 ); + Size = MAP_APPFONT( 182, 14 ); + Border = TRUE; + }; + ImageButton RB_RANGE + { + Pos = MAP_APPFONT( 245, 262 ); + Size = MAP_APPFONT( 14, 14 ); + Border = TRUE; + }; }; Control RID_COND_ENTRY @@ -131,6 +149,12 @@ Control RID_COND_ENTRY Size = MAP_APPFONT( 50, 12 ); Border = TRUE; }; + Edit ED_FORMULA + { + Pos = MAP_APPFONT( 90, 15 ); + Size = MAP_APPFONT( 135, 12 ); + Border = TRUE; + }; Edit ED_VAL2 { Pos = MAP_APPFONT( 230, 15 ); @@ -167,7 +191,7 @@ Control RID_COND_ENTRY "New Style..."; }; }; - ListBox LB_TYPE_COL_SCALE + ListBox LB_TYPE_COL_SCALE_MIN { Pos = MAP_APPFONT( 5, 32 ); Size = MAP_APPFONT( 80, 60 ); @@ -175,14 +199,47 @@ Control RID_COND_ENTRY DropDown = TRUE; StringList [ en-US ] = { + "Automatic"; + "Min"; + "Max"; + "Percentile"; + "Value"; + "Percent"; + "Formula"; + }; + }; + ListBox LB_TYPE_COL_SCALE_MIDDLE + { + Pos = MAP_APPFONT( 100, 32 ); + Size = MAP_APPFONT( 80, 60 ); + Border = TRUE; + DropDown = TRUE; + StringList [ en-US ] = + { + "Automatic"; + "Min"; + "Max"; + "Percentile"; + "Value"; + "Percent"; + "Formula"; + }; + }; + ListBox LB_TYPE_COL_SCALE_MAX + { + Pos = MAP_APPFONT( 195, 32 ); + Size = MAP_APPFONT( 80, 60 ); + Border = TRUE; + DropDown = TRUE; + StringList [ en-US ] = + { + "Automatic"; "Min"; "Max"; "Percentile"; "Value"; "Percent"; "Formula"; - "AutoMin"; - "AutoMax"; }; }; Window WD_PREVIEW @@ -192,16 +249,44 @@ Control RID_COND_ENTRY Text [ en-US ] = "Example"; Border = TRUE; }; - Edit ED_COL_SCALE + Edit ED_COL_SCALE_MIN { Pos = MAP_APPFONT( 5, 48 ); - Size = MAP_APPFONT( 60, 12 ); + Size = MAP_APPFONT( 80, 12 ); Border = TRUE; }; - ListBox LB_COL + Edit ED_COL_SCALE_MIDDLE + { + Pos = MAP_APPFONT( 100, 48 ); + Size = MAP_APPFONT( 80, 12 ); + Border = TRUE; + }; + Edit ED_COL_SCALE_MAX + { + Pos = MAP_APPFONT( 195, 48 ); + Size = MAP_APPFONT( 80, 12 ); + Border = TRUE; + }; + ListBox LB_COL_MIN { Pos = MAP_APPFONT( 5, 62 ); - Size = MAP_APPFONT( 60, 40 ); + Size = MAP_APPFONT( 80, 40 ); + Border = TRUE; + DropDown = TRUE; + DDExtraWidth = TRUE; + }; + ListBox LB_COL_MIDDLE + { + Pos = MAP_APPFONT( 100, 62 ); + Size = MAP_APPFONT( 80, 40 ); + Border = TRUE; + DropDown = TRUE; + DDExtraWidth = TRUE; + }; + ListBox LB_COL_MAX + { + Pos = MAP_APPFONT( 195, 62 ); + Size = MAP_APPFONT( 80, 40 ); Border = TRUE; DropDown = TRUE; DDExtraWidth = TRUE; diff --git a/sc/source/ui/undo/areasave.cxx b/sc/source/ui/undo/areasave.cxx index 28d88c272665..15c376e4dbb3 100644 --- a/sc/source/ui/undo/areasave.cxx +++ b/sc/source/ui/undo/areasave.cxx @@ -132,7 +132,7 @@ bool ScAreaLinkSaveCollection::IsEqual( const ScDocument* pDoc ) const return true; } -ScAreaLink* lcl_FindLink( const ::sfx2::SvBaseLinks& rLinks, const ScAreaLinkSaver& rSaver ) +static ScAreaLink* lcl_FindLink( const ::sfx2::SvBaseLinks& rLinks, const ScAreaLinkSaver& rSaver ) { sal_uInt16 nLinkCount = rLinks.size(); for (sal_uInt16 i=0; i<nLinkCount; i++) diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx index 96a8bee02f70..3fe71b181e82 100644 --- a/sc/source/ui/undo/undoblk.cxx +++ b/sc/source/ui/undo/undoblk.cxx @@ -1712,7 +1712,7 @@ sal_Bool ScUndoEnterMatrix::CanRepeat(SfxRepeatTarget& rTarget) const return (rTarget.ISA(ScTabViewTarget)); } -ScRange lcl_GetMultiMarkRange( const ScMarkData& rMark ) +static ScRange lcl_GetMultiMarkRange( const ScMarkData& rMark ) { OSL_ENSURE( rMark.IsMultiMarked(), "wrong mark type" ); @@ -2078,7 +2078,7 @@ void ScUndoRemoveMerge::SetCurTab() } /** set only border, for ScRangeList (StarOne) */ -ScRange lcl_TotalRange( const ScRangeList& rRanges ) +static ScRange lcl_TotalRange( const ScRangeList& rRanges ) { ScRange aTotal; if ( !rRanges.empty() ) diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx index 339b6910dda4..b804f983a0ee 100644 --- a/sc/source/ui/undo/undoblk3.cxx +++ b/sc/source/ui/undo/undoblk3.cxx @@ -1457,7 +1457,7 @@ sal_Bool ScUndoRefreshLink::CanRepeat(SfxRepeatTarget& /* rTarget */) const return false; } -ScAreaLink* lcl_FindAreaLink( sfx2::LinkManager* pLinkManager, const String& rDoc, +static ScAreaLink* lcl_FindAreaLink( sfx2::LinkManager* pLinkManager, const String& rDoc, const String& rFlt, const String& rOpt, const String& rSrc, const ScRange& rDest ) { diff --git a/sc/source/ui/undo/undostyl.cxx b/sc/source/ui/undo/undostyl.cxx index c900324e0957..8e4347f25324 100644 --- a/sc/source/ui/undo/undostyl.cxx +++ b/sc/source/ui/undo/undostyl.cxx @@ -118,7 +118,7 @@ rtl::OUString ScUndoModifyStyle::GetComment() const return ScGlobal::GetRscString( nId ); } -void lcl_DocStyleChanged( ScDocument* pDoc, SfxStyleSheetBase* pStyle, sal_Bool bRemoved ) +static void lcl_DocStyleChanged( ScDocument* pDoc, SfxStyleSheetBase* pStyle, sal_Bool bRemoved ) { //! move to document or docshell diff --git a/sc/source/ui/undo/undotab.cxx b/sc/source/ui/undo/undotab.cxx index 00877a8d203d..f22162cd4f7e 100644 --- a/sc/source/ui/undo/undotab.cxx +++ b/sc/source/ui/undo/undotab.cxx @@ -311,7 +311,7 @@ void ScUndoDeleteTab::SetChangeTrack() nStartChangeAction = nEndChangeAction = 0; } -SCTAB lcl_GetVisibleTabBefore( ScDocument& rDoc, SCTAB nTab ) +static SCTAB lcl_GetVisibleTabBefore( ScDocument& rDoc, SCTAB nTab ) { while ( nTab > 0 && !rDoc.IsVisible( nTab ) ) --nTab; diff --git a/sc/source/ui/unoobj/afmtuno.cxx b/sc/source/ui/unoobj/afmtuno.cxx index bb6b37a17af4..fdc3c2f75e6b 100644 --- a/sc/source/ui/unoobj/afmtuno.cxx +++ b/sc/source/ui/unoobj/afmtuno.cxx @@ -78,7 +78,7 @@ using namespace ::com::sun::star; // AutoFormat-Map nur fuer PropertySetInfo, ohne Which-IDs -const SfxItemPropertyMapEntry* lcl_GetAutoFormatMap() +static const SfxItemPropertyMapEntry* lcl_GetAutoFormatMap() { static SfxItemPropertyMapEntry aAutoFormatMap_Impl[] = { @@ -96,7 +96,7 @@ const SfxItemPropertyMapEntry* lcl_GetAutoFormatMap() //! Zahlformat (String/Language) ??? (in XNumberFormat nur ReadOnly) //! table::TableBorder ??!? -const SfxItemPropertyMapEntry* lcl_GetAutoFieldMap() +static const SfxItemPropertyMapEntry* lcl_GetAutoFieldMap() { static SfxItemPropertyMapEntry aAutoFieldMap_Impl[] = { @@ -162,7 +162,7 @@ SC_SIMPLE_SERVICE_INFO( ScAutoFormatsObj, "ScAutoFormatsObj", SCAUTOFORMATSOBJ_S //------------------------------------------------------------------------ -bool lcl_FindAutoFormatIndex( const ScAutoFormat& rFormats, const rtl::OUString& rName, sal_uInt16& rOutIndex ) +static bool lcl_FindAutoFormatIndex( const ScAutoFormat& rFormats, const rtl::OUString& rName, sal_uInt16& rOutIndex ) { ScAutoFormat::const_iterator itBeg = rFormats.begin(), itEnd = rFormats.end(); for (ScAutoFormat::const_iterator it = itBeg; it != itEnd; ++it) diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index dd95c270d5fe..a5752a70cb5c 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -156,7 +156,7 @@ public: // Left/Right/Top/BottomBorder are mapped directly to the core items, // not collected/applied to the borders of a range -> ATTR_BORDER can be used directly -const SfxItemPropertySet* lcl_GetCellsPropertySet() +static const SfxItemPropertySet* lcl_GetCellsPropertySet() { static SfxItemPropertyMapEntry aCellsPropertyMap_Impl[] = { @@ -264,7 +264,7 @@ const SfxItemPropertySet* lcl_GetCellsPropertySet() // CellRange enthaelt alle Eintraege von Cells, zusaetzlich eigene Eintraege // mit Which-ID 0 (werden nur fuer getPropertySetInfo benoetigt). -const SfxItemPropertySet* lcl_GetRangePropertySet() +static const SfxItemPropertySet* lcl_GetRangePropertySet() { static SfxItemPropertyMapEntry aRangePropertyMap_Impl[] = { @@ -374,7 +374,7 @@ const SfxItemPropertySet* lcl_GetRangePropertySet() // Cell enthaelt alle Eintraege von CellRange, zusaetzlich eigene Eintraege // mit Which-ID 0 (werden nur fuer getPropertySetInfo benoetigt). -const SfxItemPropertySet* lcl_GetCellPropertySet() +static const SfxItemPropertySet* lcl_GetCellPropertySet() { static SfxItemPropertyMapEntry aCellPropertyMap_Impl[] = { @@ -487,7 +487,7 @@ const SfxItemPropertySet* lcl_GetCellPropertySet() // Column und Row enthalten alle Eintraege von CellRange, zusaetzlich eigene Eintraege // mit Which-ID 0 (werden nur fuer getPropertySetInfo benoetigt). -const SfxItemPropertySet* lcl_GetColumnPropertySet() +static const SfxItemPropertySet* lcl_GetColumnPropertySet() { static SfxItemPropertyMapEntry aColumnPropertyMap_Impl[] = { @@ -599,7 +599,7 @@ const SfxItemPropertySet* lcl_GetColumnPropertySet() return &aColumnPropertySet; } -const SfxItemPropertySet* lcl_GetRowPropertySet() +static const SfxItemPropertySet* lcl_GetRowPropertySet() { static SfxItemPropertyMapEntry aRowPropertyMap_Impl[] = { @@ -712,7 +712,7 @@ const SfxItemPropertySet* lcl_GetRowPropertySet() return &aRowPropertySet; } -const SfxItemPropertySet* lcl_GetSheetPropertySet() +static const SfxItemPropertySet* lcl_GetSheetPropertySet() { static SfxItemPropertyMapEntry aSheetPropertyMap_Impl[] = { @@ -836,7 +836,7 @@ const SfxItemPropertySet* lcl_GetSheetPropertySet() return &aSheetPropertySet; } -const SfxItemPropertyMapEntry* lcl_GetEditPropertyMap() +static const SfxItemPropertyMapEntry* lcl_GetEditPropertyMap() { static SfxItemPropertyMapEntry aEditPropertyMap_Impl[] = { @@ -850,7 +850,7 @@ const SfxItemPropertyMapEntry* lcl_GetEditPropertyMap() }; return aEditPropertyMap_Impl; } -const SvxItemPropertySet* lcl_GetEditPropertySet() +static const SvxItemPropertySet* lcl_GetEditPropertySet() { static SvxItemPropertySet aEditPropertySet( lcl_GetEditPropertyMap(), SdrObject::GetGlobalDrawObjectItemPool() ); return &aEditPropertySet; @@ -898,7 +898,7 @@ void ScLinkListener::Notify( SvtBroadcaster&, const SfxHint& rHint ) //------------------------------------------------------------------------ -void lcl_CopyProperties( beans::XPropertySet& rDest, beans::XPropertySet& rSource ) +static void lcl_CopyProperties( beans::XPropertySet& rDest, beans::XPropertySet& rSource ) { uno::Reference<beans::XPropertySetInfo> xInfo(rSource.getPropertySetInfo()); if (xInfo.is()) @@ -914,7 +914,7 @@ void lcl_CopyProperties( beans::XPropertySet& rDest, beans::XPropertySet& rSourc } } -SCTAB lcl_FirstTab( const ScRangeList& rRanges ) +static SCTAB lcl_FirstTab( const ScRangeList& rRanges ) { OSL_ENSURE(rRanges.size() >= 1, "was fuer Ranges ?!?!"); const ScRange* pFirst = rRanges[ 0 ]; @@ -924,7 +924,7 @@ SCTAB lcl_FirstTab( const ScRangeList& rRanges ) return 0; // soll nicht sein } -sal_Bool lcl_WholeSheet( const ScRangeList& rRanges ) +static sal_Bool lcl_WholeSheet( const ScRangeList& rRanges ) { if ( rRanges.size() == 1 ) { @@ -938,7 +938,7 @@ sal_Bool lcl_WholeSheet( const ScRangeList& rRanges ) //------------------------------------------------------------------------ -ScSubTotalFunc lcl_SummaryToSubTotal( sheet::GeneralFunction eSummary ) +static ScSubTotalFunc lcl_SummaryToSubTotal( sheet::GeneralFunction eSummary ) { ScSubTotalFunc eSubTotal; switch (eSummary) @@ -1153,7 +1153,7 @@ void ScHelperFunctions::ApplyBorder( ScDocShell* pDocShell, const ScRangeList& r //! move lcl_PutDataArray to docfunc? //! merge loop with ScFunctionAccess::callFunction -sal_Bool lcl_PutDataArray( ScDocShell& rDocShell, const ScRange& rRange, +static sal_Bool lcl_PutDataArray( ScDocShell& rDocShell, const ScRange& rRange, const uno::Sequence< uno::Sequence<uno::Any> >& aData ) { ScDocument* pDoc = rDocShell.GetDocument(); @@ -1269,7 +1269,7 @@ sal_Bool lcl_PutDataArray( ScDocShell& rDocShell, const ScRange& rRange, return !bError; } -sal_Bool lcl_PutFormulaArray( ScDocShell& rDocShell, const ScRange& rRange, +static sal_Bool lcl_PutFormulaArray( ScDocShell& rDocShell, const ScRange& rRange, const uno::Sequence< uno::Sequence<rtl::OUString> >& aData, const ::rtl::OUString& rFormulaNmsp, const formula::FormulaGrammar::Grammar eGrammar ) { @@ -1356,7 +1356,7 @@ sal_Bool lcl_PutFormulaArray( ScDocShell& rDocShell, const ScRange& rRange, } // used in ScCellRangeObj::getFormulaArray and ScCellObj::GetInputString_Impl -String lcl_GetInputString( ScDocument* pDoc, const ScAddress& rPosition, sal_Bool bEnglish ) +static String lcl_GetInputString( ScDocument* pDoc, const ScAddress& rPosition, sal_Bool bEnglish ) { rtl::OUString aVal; if ( pDoc ) @@ -1876,7 +1876,7 @@ const SfxItemPropertyMap& ScCellRangesBase::GetItemPropertyMap() return pPropSet->getPropertyMap(); } -void lcl_GetPropertyWhich( const SfxItemPropertySimpleEntry* pEntry, +static void lcl_GetPropertyWhich( const SfxItemPropertySimpleEntry* pEntry, sal_uInt16& rItemWhich ) { // Which-ID des betroffenen Items, auch wenn das Item die Property @@ -2151,7 +2151,7 @@ uno::Reference<beans::XPropertySetInfo> SAL_CALL ScCellRangesBase::getPropertySe return aRef; } -void lcl_SetCellProperty( const SfxItemPropertySimpleEntry& rEntry, const uno::Any& rValue, +static void lcl_SetCellProperty( const SfxItemPropertySimpleEntry& rEntry, const uno::Any& rValue, ScPatternAttr& rPattern, ScDocument* pDoc, sal_uInt16& rFirstItemId, sal_uInt16& rSecondItemId ) { @@ -2412,11 +2412,8 @@ void ScCellRangesBase::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pE ScConditionalFormat* pNew = new ScConditionalFormat( 0, pDoc ); // Index wird beim Einfuegen gesetzt pFormat->FillFormat( *pNew, pDoc, eGrammar ); pNew->AddRange( aRanges ); - sal_uLong nIndex = pDoc->AddCondFormat( pNew, aRanges.front()->aStart.Tab() ); - - ScPatternAttr aPattern( pDoc->GetPool() ); - aPattern.GetItemSet().Put( SfxUInt32Item( ATTR_CONDITIONAL, nIndex ) ); - pDocShell->GetDocFunc().ApplyAttributes( *GetMarkData(), aPattern, sal_True, sal_True ); + SCTAB nTab = aRanges.front()->aStart.Tab(); + pDocShell->GetDocFunc().ReplaceConditionalFormat( 0, pNew, nTab, aRanges ); } } } @@ -2572,8 +2569,11 @@ void ScCellRangesBase::GetOnePropertyValue( const SfxItemPropertySimpleEntry* pE formula::FormulaGrammar::Grammar eGrammar = (bXML ? pDoc->GetStorageGrammar() : formula::FormulaGrammar::mapAPItoGrammar( bEnglish, bXML)); - sal_uLong nIndex = ((const SfxUInt32Item&) - pPattern->GetItem(ATTR_CONDITIONAL)).GetValue(); + const std::vector<sal_uInt32>& rIndex = ((const ScCondFormatItem&) + pPattern->GetItem(ATTR_CONDITIONAL)).GetCondFormatData(); + sal_uLong nIndex = 0; + if(!rIndex.empty()) + nIndex = rIndex[0]; rAny <<= uno::Reference<sheet::XSheetConditionalEntries>( new ScTableConditionalFormat( pDoc, nIndex, aRanges.front()->aStart.Tab(), eGrammar )); } @@ -4350,7 +4350,7 @@ void SAL_CALL ScCellRangesObj::addRangeAddress( const table::CellRangeAddress& r AddRange(aRange, bMergeRanges); } -void lcl_RemoveNamedEntry( ScNamedEntryArr_Impl& rNamedEntries, const ScRange& rRange ) +static void lcl_RemoveNamedEntry( ScNamedEntryArr_Impl& rNamedEntries, const ScRange& rRange ) { sal_uInt16 nCount = rNamedEntries.size(); for ( sal_uInt16 n=nCount; n--; ) @@ -4446,7 +4446,7 @@ void SAL_CALL ScCellRangesObj::removeRangeAddresses( const uno::Sequence<table:: // XNameContainer -void lcl_RemoveNamedEntry( ScNamedEntryArr_Impl& rNamedEntries, const String& rName ) +static void lcl_RemoveNamedEntry( ScNamedEntryArr_Impl& rNamedEntries, const String& rName ) { sal_uInt16 nCount = rNamedEntries.size(); for ( sal_uInt16 n=nCount; n--; ) @@ -4510,7 +4510,7 @@ void SAL_CALL ScCellRangesObj::insertByName( const rtl::OUString& aName, const u } } -sal_Bool lcl_FindRangeByName( const ScRangeList& rRanges, ScDocShell* pDocSh, +static sal_Bool lcl_FindRangeByName( const ScRangeList& rRanges, ScDocShell* pDocSh, const String& rName, size_t& rIndex ) { if (pDocSh) @@ -4530,7 +4530,7 @@ sal_Bool lcl_FindRangeByName( const ScRangeList& rRanges, ScDocShell* pDocSh, return false; // nicht gefunden } -sal_Bool lcl_FindRangeOrEntry( const ScNamedEntryArr_Impl& rNamedEntries, +static sal_Bool lcl_FindRangeOrEntry( const ScNamedEntryArr_Impl& rNamedEntries, const ScRangeList& rRanges, ScDocShell* pDocSh, const String& rName, ScRange& rFound ) { @@ -4686,7 +4686,7 @@ uno::Any SAL_CALL ScCellRangesObj::getByName( const rtl::OUString& aName ) return aRet; } -sal_Bool lcl_FindEntryName( const ScNamedEntryArr_Impl& rNamedEntries, +static sal_Bool lcl_FindEntryName( const ScNamedEntryArr_Impl& rNamedEntries, const ScRange& rRange, String& rName ) { sal_uInt16 nCount = rNamedEntries.size(); diff --git a/sc/source/ui/unoobj/chartuno.cxx b/sc/source/ui/unoobj/chartuno.cxx index 275c19a5ec6b..1da873abf233 100644 --- a/sc/source/ui/unoobj/chartuno.cxx +++ b/sc/source/ui/unoobj/chartuno.cxx @@ -64,7 +64,7 @@ SC_SIMPLE_SERVICE_INFO( ScChartsObj, "ScChartsObj", "com.sun.star.table.TableCha //------------------------------------------------------------------------ -SdrOle2Obj* lcl_FindChartObj( ScDocShell* pDocShell, SCTAB nTab, const String& rName ) +static SdrOle2Obj* lcl_FindChartObj( ScDocShell* pDocShell, SCTAB nTab, const String& rName ) { if (pDocShell) { diff --git a/sc/source/ui/unoobj/confuno.cxx b/sc/source/ui/unoobj/confuno.cxx index 0e83f96145bd..9ac4ca544c58 100644 --- a/sc/source/ui/unoobj/confuno.cxx +++ b/sc/source/ui/unoobj/confuno.cxx @@ -49,7 +49,7 @@ using namespace com::sun::star; #define SCSAVEVERSION "SaveVersionOnClose" -const SfxItemPropertyMapEntry* lcl_GetConfigPropertyMap() +static const SfxItemPropertyMapEntry* lcl_GetConfigPropertyMap() { static SfxItemPropertyMapEntry aConfigPropertyMap_Impl[] = { diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx index 0d5e324d2b8c..7395a88b1a64 100644 --- a/sc/source/ui/unoobj/dapiuno.cxx +++ b/sc/source/ui/unoobj/dapiuno.cxx @@ -256,7 +256,7 @@ void ScDataPilotConversion::FillGroupInfo( DataPilotFieldGroupInfo& rInfo, const //------------------------------------------------------------------------ -ScDPObject* lcl_GetDPObject( ScDocShell* pDocShell, SCTAB nTab, const OUString& rName ) +static ScDPObject* lcl_GetDPObject( ScDocShell* pDocShell, SCTAB nTab, const OUString& rName ) { if (pDocShell) { @@ -277,7 +277,7 @@ ScDPObject* lcl_GetDPObject( ScDocShell* pDocShell, SCTAB nTab, const OUString& return NULL; // nicht gefunden } -String lcl_CreatePivotName( ScDocShell* pDocShell ) +static String lcl_CreatePivotName( ScDocShell* pDocShell ) { if (pDocShell) { @@ -289,7 +289,7 @@ String lcl_CreatePivotName( ScDocShell* pDocShell ) return String(); // sollte nicht vorkommen } -sal_Int32 lcl_GetObjectIndex( ScDPObject* pDPObj, const ScFieldIdentifier& rFieldId ) +static sal_Int32 lcl_GetObjectIndex( ScDPObject* pDPObj, const ScFieldIdentifier& rFieldId ) { // used for items - nRepeat in identifier can be ignored if ( pDPObj ) @@ -379,7 +379,7 @@ Reference<XDataPilotDescriptor> SAL_CALL ScDataPilotTablesObj::createDataPilotDe return NULL; } -bool lcl_IsDuplicated( const Reference<XPropertySet> xDimProps ) +static bool lcl_IsDuplicated( const Reference<XPropertySet> xDimProps ) { try { @@ -393,7 +393,7 @@ bool lcl_IsDuplicated( const Reference<XPropertySet> xDimProps ) return false; } -OUString lcl_GetOriginalName( const Reference< XNamed > xDim ) +static OUString lcl_GetOriginalName( const Reference< XNamed > xDim ) { Reference< XNamed > xOriginal; @@ -1587,7 +1587,7 @@ ScDataPilotFieldsObj::~ScDataPilotFieldsObj() { } -sal_Int32 lcl_GetFieldCount( const Reference<XDimensionsSupplier>& rSource, const Any& rOrient ) +static sal_Int32 lcl_GetFieldCount( const Reference<XDimensionsSupplier>& rSource, const Any& rOrient ) { if (!rSource.is()) throw RuntimeException(); @@ -1624,7 +1624,7 @@ sal_Int32 lcl_GetFieldCount( const Reference<XDimensionsSupplier>& rSource, cons return nRet; } -sal_Bool lcl_GetFieldDataByIndex( const Reference<XDimensionsSupplier>& rSource, +static sal_Bool lcl_GetFieldDataByIndex( const Reference<XDimensionsSupplier>& rSource, const Any& rOrient, SCSIZE nIndex, ScFieldIdentifier& rFieldId ) { if (!rSource.is()) @@ -1711,7 +1711,7 @@ sal_Bool lcl_GetFieldDataByIndex( const Reference<XDimensionsSupplier>& rSource, return bOk; } -sal_Bool lcl_GetFieldDataByName( ScDPObject* pDPObj, const OUString& rFieldName, ScFieldIdentifier& rFieldId ) +static sal_Bool lcl_GetFieldDataByName( ScDPObject* pDPObj, const OUString& rFieldName, ScFieldIdentifier& rFieldId ) { // "By name" is always the first match. // The name "Data" always refers to the data layout field. diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx index 76ec00446450..cbff0b43bdb9 100644 --- a/sc/source/ui/unoobj/datauno.cxx +++ b/sc/source/ui/unoobj/datauno.cxx @@ -70,7 +70,7 @@ using namespace com::sun::star; // alles ohne Which-ID, Map nur fuer PropertySetInfo -const SfxItemPropertyMapEntry* lcl_GetSubTotalPropertyMap() +static const SfxItemPropertyMapEntry* lcl_GetSubTotalPropertyMap() { // some old property names are for 5.2 compatibility @@ -93,7 +93,7 @@ const SfxItemPropertyMapEntry* lcl_GetSubTotalPropertyMap() return aSubTotalPropertyMap_Impl; } -const SfxItemPropertyMapEntry* lcl_GetFilterPropertyMap() +static const SfxItemPropertyMapEntry* lcl_GetFilterPropertyMap() { static SfxItemPropertyMapEntry aFilterPropertyMap_Impl[] = { @@ -111,7 +111,7 @@ const SfxItemPropertyMapEntry* lcl_GetFilterPropertyMap() return aFilterPropertyMap_Impl; } -const SfxItemPropertyMapEntry* lcl_GetDBRangePropertyMap() +static const SfxItemPropertyMapEntry* lcl_GetDBRangePropertyMap() { static SfxItemPropertyMapEntry aDBRangePropertyMap_Impl[] = { diff --git a/sc/source/ui/unoobj/defltuno.cxx b/sc/source/ui/unoobj/defltuno.cxx index a270e4afe3a6..b0c008453b58 100644 --- a/sc/source/ui/unoobj/defltuno.cxx +++ b/sc/source/ui/unoobj/defltuno.cxx @@ -49,7 +49,7 @@ using namespace ::com::sun::star; //------------------------------------------------------------------------ -const SfxItemPropertyMapEntry* lcl_GetDocDefaultsMap() +static const SfxItemPropertyMapEntry* lcl_GetDocDefaultsMap() { static SfxItemPropertyMapEntry aDocDefaultsMap_Impl[] = { diff --git a/sc/source/ui/unoobj/dispuno.cxx b/sc/source/ui/unoobj/dispuno.cxx index 9ca3481f8745..5ec8497aa1cc 100644 --- a/sc/source/ui/unoobj/dispuno.cxx +++ b/sc/source/ui/unoobj/dispuno.cxx @@ -50,7 +50,7 @@ static const char* cURLDocDataSource = ".uno:DataSourceBrowser/DocumentDataSourc //------------------------------------------------------------------------ -uno::Reference<view::XSelectionSupplier> lcl_GetSelectionSupplier( SfxViewShell* pViewShell ) +static uno::Reference<view::XSelectionSupplier> lcl_GetSelectionSupplier( SfxViewShell* pViewShell ) { if ( pViewShell ) { @@ -256,7 +256,7 @@ void SAL_CALL ScDispatch::dispatch( const util::URL& aURL, throw uno::RuntimeException(); } -void lcl_FillDataSource( frame::FeatureStateEvent& rEvent, const ScImportParam& rParam ) +static void lcl_FillDataSource( frame::FeatureStateEvent& rEvent, const ScImportParam& rParam ) { rEvent.IsEnabled = rParam.bImport; diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index 9d5964236895..388145c54b96 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -110,7 +110,7 @@ using namespace com::sun::star; // alles ohne Which-ID, Map nur fuer PropertySetInfo //! umbenennen, sind nicht mehr nur Options -const SfxItemPropertyMapEntry* lcl_GetDocOptPropertyMap() +static const SfxItemPropertyMapEntry* lcl_GetDocOptPropertyMap() { static SfxItemPropertyMapEntry aDocOptPropertyMap_Impl[] = { @@ -162,7 +162,7 @@ const SfxItemPropertyMapEntry* lcl_GetDocOptPropertyMap() //! StandardDecimals als Property und vom NumberFormatter ???????? -const SfxItemPropertyMapEntry* lcl_GetColumnsPropertyMap() +static const SfxItemPropertyMapEntry* lcl_GetColumnsPropertyMap() { static SfxItemPropertyMapEntry aColumnsPropertyMap_Impl[] = { @@ -176,7 +176,7 @@ const SfxItemPropertyMapEntry* lcl_GetColumnsPropertyMap() return aColumnsPropertyMap_Impl; } -const SfxItemPropertyMapEntry* lcl_GetRowsPropertyMap() +static const SfxItemPropertyMapEntry* lcl_GetRowsPropertyMap() { static SfxItemPropertyMapEntry aRowsPropertyMap_Impl[] = { @@ -650,7 +650,7 @@ uno::Reference<container::XNameAccess> SAL_CALL ScModelObj::getStyleFamilies() // XRenderable -OutputDevice* lcl_GetRenderDevice( const uno::Sequence<beans::PropertyValue>& rOptions ) +static OutputDevice* lcl_GetRenderDevice( const uno::Sequence<beans::PropertyValue>& rOptions ) { OutputDevice* pRet = NULL; const beans::PropertyValue* pPropArray = rOptions.getConstArray(); @@ -677,7 +677,7 @@ OutputDevice* lcl_GetRenderDevice( const uno::Sequence<beans::PropertyValue>& rO return pRet; } -bool lcl_ParseTarget( const String& rTarget, ScRange& rTargetRange, Rectangle& rTargetRect, +static bool lcl_ParseTarget( const String& rTarget, ScRange& rTargetRange, Rectangle& rTargetRect, bool& rIsSheet, ScDocument* pDoc, SCTAB nSourceTab ) { // test in same order as in SID_CURRENTCELL execute @@ -967,7 +967,7 @@ sal_Int32 SAL_CALL ScModelObj::getRendererCount( const uno::Any& aSelection, return nSelectCount; } -sal_Int32 lcl_GetRendererNum( sal_Int32 nSelRenderer, const String& rPagesStr, sal_Int32 nTotalPages ) +static sal_Int32 lcl_GetRendererNum( sal_Int32 nSelRenderer, const String& rPagesStr, sal_Int32 nTotalPages ) { if ( !rPagesStr.Len() ) return nSelRenderer; diff --git a/sc/source/ui/unoobj/eventuno.cxx b/sc/source/ui/unoobj/eventuno.cxx index 94c08b5a674d..3e67a6954a05 100644 --- a/sc/source/ui/unoobj/eventuno.cxx +++ b/sc/source/ui/unoobj/eventuno.cxx @@ -65,7 +65,7 @@ void ScSheetEventsObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) } } -sal_Int32 lcl_GetEventFromName( const rtl::OUString& aName ) +static sal_Int32 lcl_GetEventFromName( const rtl::OUString& aName ) { for (sal_Int32 nEvent=0; nEvent<SC_SHEETEVENT_COUNT; ++nEvent) if ( aName == ScSheetEvents::GetEventName(nEvent) ) diff --git a/sc/source/ui/unoobj/fmtuno.cxx b/sc/source/ui/unoobj/fmtuno.cxx index 8b981990be90..171ecb7474bf 100644 --- a/sc/source/ui/unoobj/fmtuno.cxx +++ b/sc/source/ui/unoobj/fmtuno.cxx @@ -52,7 +52,7 @@ using namespace ::formula; // Map nur fuer PropertySetInfo -const SfxItemPropertyMapEntry* lcl_GetValidatePropertyMap() +static const SfxItemPropertyMapEntry* lcl_GetValidatePropertyMap() { static SfxItemPropertyMapEntry aValidatePropertyMap_Impl[] = { @@ -79,7 +79,7 @@ SC_SIMPLE_SERVICE_INFO( ScTableValidationObj, "ScTableValidationObj", "com.sun.s //------------------------------------------------------------------------ -sal_Int32 lcl_ConditionModeToOperatorNew( ScConditionMode eMode ) +static sal_Int32 lcl_ConditionModeToOperatorNew( ScConditionMode eMode ) { sal_Int32 eOper = sheet::ConditionOperator2::NONE; switch (eMode) @@ -102,7 +102,7 @@ sal_Int32 lcl_ConditionModeToOperatorNew( ScConditionMode eMode ) return eOper; } -sheet::ConditionOperator lcl_ConditionModeToOperator( ScConditionMode eMode ) +static sheet::ConditionOperator lcl_ConditionModeToOperator( ScConditionMode eMode ) { sheet::ConditionOperator eOper = sheet::ConditionOperator_NONE; switch (eMode) @@ -124,7 +124,7 @@ sheet::ConditionOperator lcl_ConditionModeToOperator( ScConditionMode eMode ) return eOper; } -ScConditionMode lcl_ConditionOperatorToMode( sheet::ConditionOperator eOper ) +static ScConditionMode lcl_ConditionOperatorToMode( sheet::ConditionOperator eOper ) { ScConditionMode eMode = SC_COND_NONE; switch (eOper) @@ -430,7 +430,7 @@ sal_Bool SAL_CALL ScTableConditionalFormat::hasElements() throw(uno::RuntimeExce // conditional format entries have no real names // -> generate name from index -rtl::OUString lcl_GetEntryNameFromIndex( sal_Int32 nIndex ) +static rtl::OUString lcl_GetEntryNameFromIndex( sal_Int32 nIndex ) { rtl::OUString aRet( RTL_CONSTASCII_USTRINGPARAM( "Entry" ) ); aRet += rtl::OUString::valueOf( nIndex ); diff --git a/sc/source/ui/unoobj/forbiuno.cxx b/sc/source/ui/unoobj/forbiuno.cxx index 281282af04d3..1e3c565cbcc5 100644 --- a/sc/source/ui/unoobj/forbiuno.cxx +++ b/sc/source/ui/unoobj/forbiuno.cxx @@ -35,7 +35,7 @@ using namespace ::com::sun::star; //------------------------------------------------------------------------ -rtl::Reference<SvxForbiddenCharactersTable> lcl_GetForbidden( ScDocShell* pDocSh ) +static rtl::Reference<SvxForbiddenCharactersTable> lcl_GetForbidden( ScDocShell* pDocSh ) { rtl::Reference<SvxForbiddenCharactersTable> xRet; if ( pDocSh ) diff --git a/sc/source/ui/unoobj/funcuno.cxx b/sc/source/ui/unoobj/funcuno.cxx index c2f758dae7b8..7cbfcf52f47a 100644 --- a/sc/source/ui/unoobj/funcuno.cxx +++ b/sc/source/ui/unoobj/funcuno.cxx @@ -153,7 +153,7 @@ void ScTempDocCache::Clear() //! merge this with ScAreaLink::Refresh //! copy directly without a clipboard document? -sal_Bool lcl_CopyData( ScDocument* pSrcDoc, const ScRange& rSrcRange, +static sal_Bool lcl_CopyData( ScDocument* pSrcDoc, const ScRange& rSrcRange, ScDocument* pDestDoc, const ScAddress& rDestPos ) { SCTAB nSrcTab = rSrcRange.aStart.Tab(); @@ -349,7 +349,7 @@ SC_IMPL_DUMMY_PROPERTY_LISTENER( ScFunctionAccess ) // XFunctionAccess -sal_Bool lcl_AddFunctionToken( ScTokenArray& rArray, const rtl::OUString& rName,const ScCompiler& rCompiler ) +static sal_Bool lcl_AddFunctionToken( ScTokenArray& rArray, const rtl::OUString& rName,const ScCompiler& rCompiler ) { // function names are always case-insensitive rtl::OUString aUpper = ScGlobal::pCharClass->uppercase(rName); @@ -385,7 +385,7 @@ sal_Bool lcl_AddFunctionToken( ScTokenArray& rArray, const rtl::OUString& rName, return false; // no valid function name } -void lcl_AddRef( ScTokenArray& rArray, long nStartRow, long nColCount, long nRowCount ) +static void lcl_AddRef( ScTokenArray& rArray, long nStartRow, long nColCount, long nRowCount ) { ScComplexRefData aRef; aRef.InitFlags(); diff --git a/sc/source/ui/unoobj/linkuno.cxx b/sc/source/ui/unoobj/linkuno.cxx index 4986f514450c..a618287fc5a3 100644 --- a/sc/source/ui/unoobj/linkuno.cxx +++ b/sc/source/ui/unoobj/linkuno.cxx @@ -60,7 +60,7 @@ using ::std::vector; //------------------------------------------------------------------------ // fuer Sheet- und Area-Links benutzt: -const SfxItemPropertyMapEntry* lcl_GetSheetLinkMap() +static const SfxItemPropertyMapEntry* lcl_GetSheetLinkMap() { static SfxItemPropertyMapEntry aSheetLinkMap_Impl[] = { @@ -591,7 +591,7 @@ uno::Sequence<rtl::OUString> SAL_CALL ScSheetLinksObj::getElementNames() throw(u //------------------------------------------------------------------------ -ScAreaLink* lcl_GetAreaLink( ScDocShell* pDocShell, sal_uInt16 nPos ) +static ScAreaLink* lcl_GetAreaLink( ScDocShell* pDocShell, sal_uInt16 nPos ) { if (pDocShell) { @@ -1090,7 +1090,7 @@ void ScDDELinkObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) // XNamed -String lcl_BuildDDEName( const String& rAppl, const String& rTopic, const String& rItem ) +static String lcl_BuildDDEName( const String& rAppl, const String& rTopic, const String& rItem ) { // Appl|Topic!Item (wie Excel) String aRet = rAppl; diff --git a/sc/source/ui/unoobj/nameuno.cxx b/sc/source/ui/unoobj/nameuno.cxx index c04b8e95c2f8..da9778931b05 100644 --- a/sc/source/ui/unoobj/nameuno.cxx +++ b/sc/source/ui/unoobj/nameuno.cxx @@ -56,7 +56,7 @@ using ::com::sun::star::uno::Any; //------------------------------------------------------------------------ -const SfxItemPropertyMapEntry* lcl_GetNamedRangeMap() +static const SfxItemPropertyMapEntry* lcl_GetNamedRangeMap() { static SfxItemPropertyMapEntry aNamedRangeMap_Impl[] = { @@ -69,7 +69,7 @@ const SfxItemPropertyMapEntry* lcl_GetNamedRangeMap() return aNamedRangeMap_Impl; } -const SfxItemPropertyMapEntry* lcl_GetNamedRangesMap() +static const SfxItemPropertyMapEntry* lcl_GetNamedRangesMap() { static SfxItemPropertyMapEntry aNamedRangesMap_Impl[] = { @@ -87,7 +87,7 @@ SC_SIMPLE_SERVICE_INFO( ScLabelRangeObj, "ScLabelRangeObj", "com.sun.star.sheet. SC_SIMPLE_SERVICE_INFO( ScLabelRangesObj, "ScLabelRangesObj", "com.sun.star.sheet.LabelRanges" ) SC_SIMPLE_SERVICE_INFO( ScNamedRangesObj, "ScNamedRangesObj", "com.sun.star.sheet.NamedRanges" ) -bool lcl_UserVisibleName(const ScRangeData& rData) +static bool lcl_UserVisibleName(const ScRangeData& rData) { //! als Methode an ScRangeData diff --git a/sc/source/ui/unoobj/notesuno.cxx b/sc/source/ui/unoobj/notesuno.cxx index 924d9b049476..297f7c43c42e 100644 --- a/sc/source/ui/unoobj/notesuno.cxx +++ b/sc/source/ui/unoobj/notesuno.cxx @@ -63,7 +63,7 @@ using namespace com::sun::star; //------------------------------------------------------------------------ -const SvxItemPropertySet* lcl_GetAnnotationPropertySet() +static const SvxItemPropertySet* lcl_GetAnnotationPropertySet() { static SfxItemPropertyMapEntry aAnnotationPropertyMap_Impl[] = { diff --git a/sc/source/ui/unoobj/shapeuno.cxx b/sc/source/ui/unoobj/shapeuno.cxx index bb0c5ab1c3a6..d723dac26657 100644 --- a/sc/source/ui/unoobj/shapeuno.cxx +++ b/sc/source/ui/unoobj/shapeuno.cxx @@ -60,7 +60,7 @@ DECLARE_STL_USTRINGACCESS_MAP( uno::Sequence< sal_Int8 > *, ScShapeImplementati static ScShapeImplementationIdMap aImplementationIdMap; -const SfxItemPropertyMapEntry* lcl_GetShapeMap() +static const SfxItemPropertyMapEntry* lcl_GetShapeMap() { static SfxItemPropertyMapEntry aShapeMap_Impl[] = { @@ -87,7 +87,7 @@ const SvEventDescription* ScShapeObj::GetSupportedMacroItems() return aMacroDescriptionsImpl; } // #i66550 HLINK_FOR_SHAPES -ScMacroInfo* lcl_getShapeHyperMacroInfo( ScShapeObj* pShape, sal_Bool bCreate = false ) +ScMacroInfo* ScShapeObj_getShapeHyperMacroInfo( ScShapeObj* pShape, sal_Bool bCreate = false ) { if( pShape ) if( SdrObject* pObj = pShape->GetSdrObject() ) @@ -205,7 +205,7 @@ void ScShapeObj::GetShapePropertyState() } } -uno::Reference<lang::XComponent> lcl_GetComponent( const uno::Reference<uno::XAggregation>& xAgg ) +static uno::Reference<lang::XComponent> lcl_GetComponent( const uno::Reference<uno::XAggregation>& xAgg ) { uno::Reference<lang::XComponent> xRet; if ( xAgg.is() ) @@ -213,7 +213,7 @@ uno::Reference<lang::XComponent> lcl_GetComponent( const uno::Reference<uno::XAg return xRet; } -uno::Reference<text::XText> lcl_GetText( const uno::Reference<uno::XAggregation>& xAgg ) +static uno::Reference<text::XText> lcl_GetText( const uno::Reference<uno::XAggregation>& xAgg ) { uno::Reference<text::XText> xRet; if ( xAgg.is() ) @@ -221,7 +221,7 @@ uno::Reference<text::XText> lcl_GetText( const uno::Reference<uno::XAggregation> return xRet; } -uno::Reference<text::XSimpleText> lcl_GetSimpleText( const uno::Reference<uno::XAggregation>& xAgg ) +static uno::Reference<text::XSimpleText> lcl_GetSimpleText( const uno::Reference<uno::XAggregation>& xAgg ) { uno::Reference<text::XSimpleText> xRet; if ( xAgg.is() ) @@ -229,7 +229,7 @@ uno::Reference<text::XSimpleText> lcl_GetSimpleText( const uno::Reference<uno::X return xRet; } -uno::Reference<text::XTextRange> lcl_GetTextRange( const uno::Reference<uno::XAggregation>& xAgg ) +static uno::Reference<text::XTextRange> lcl_GetTextRange( const uno::Reference<uno::XAggregation>& xAgg ) { uno::Reference<text::XTextRange> xRet; if ( xAgg.is() ) @@ -259,7 +259,7 @@ uno::Reference<beans::XPropertySetInfo> SAL_CALL ScShapeObj::getPropertySetInfo( return mxPropSetInfo; } -sal_Bool lcl_GetPageNum( SdrPage* pPage, SdrModel& rModel, SCTAB& rNum ) +static sal_Bool lcl_GetPageNum( SdrPage* pPage, SdrModel& rModel, SCTAB& rNum ) { sal_uInt16 nCount = rModel.GetPageCount(); for (sal_uInt16 i=0; i<nCount; i++) @@ -272,7 +272,7 @@ sal_Bool lcl_GetPageNum( SdrPage* pPage, SdrModel& rModel, SCTAB& rNum ) return false; } -sal_Bool lcl_GetCaptionPoint( uno::Reference< drawing::XShape >& xShape, awt::Point& rCaptionPoint ) +static sal_Bool lcl_GetCaptionPoint( uno::Reference< drawing::XShape >& xShape, awt::Point& rCaptionPoint ) { sal_Bool bReturn = false; rtl::OUString sType(xShape->getShapeType()); @@ -289,7 +289,7 @@ sal_Bool lcl_GetCaptionPoint( uno::Reference< drawing::XShape >& xShape, awt::Po return bReturn; } -ScRange lcl_GetAnchorCell( uno::Reference< drawing::XShape >& xShape, ScDocument* pDoc, SCTAB nTab, +static ScRange lcl_GetAnchorCell( uno::Reference< drawing::XShape >& xShape, ScDocument* pDoc, SCTAB nTab, awt::Point& rUnoPoint, awt::Size& rUnoSize, awt::Point& rCaptionPoint ) { ScRange aReturn; @@ -324,7 +324,7 @@ ScRange lcl_GetAnchorCell( uno::Reference< drawing::XShape >& xShape, ScDocument return aReturn; } -awt::Point lcl_GetRelativePos( uno::Reference< drawing::XShape >& xShape, ScDocument* pDoc, SCTAB nTab, ScRange& rRange, +static awt::Point lcl_GetRelativePos( uno::Reference< drawing::XShape >& xShape, ScDocument* pDoc, SCTAB nTab, ScRange& rRange, awt::Size& rUnoSize, awt::Point& rCaptionPoint) { awt::Point aUnoPoint; @@ -645,7 +645,7 @@ void SAL_CALL ScShapeObj::setPropertyValue( aNameString.EqualsAscii( SC_UNONAME_URL) ) { rtl::OUString sHlink; - ScMacroInfo* pInfo = lcl_getShapeHyperMacroInfo(this, true); + ScMacroInfo* pInfo = ScShapeObj_getShapeHyperMacroInfo(this, true); if ( ( aValue >>= sHlink ) && pInfo ) pInfo->SetHlink( sHlink ); } @@ -830,7 +830,7 @@ uno::Any SAL_CALL ScShapeObj::getPropertyValue( const rtl::OUString& aPropertyNa aNameString.EqualsAscii( SC_UNONAME_URL ) ) { rtl::OUString sHlink; - if ( ScMacroInfo* pInfo = lcl_getShapeHyperMacroInfo(this) ) + if ( ScMacroInfo* pInfo = ScShapeObj_getShapeHyperMacroInfo(this) ) sHlink = pInfo->GetHlink(); aAny <<= sHlink; } @@ -1102,7 +1102,7 @@ void SAL_CALL ScShapeObj::removeEventListener( // XText // (special handling for ScCellFieldObj) -void lcl_CopyOneProperty( beans::XPropertySet& rDest, beans::XPropertySet& rSource, const sal_Char* pName ) +static void lcl_CopyOneProperty( beans::XPropertySet& rDest, beans::XPropertySet& rSource, const sal_Char* pName ) { rtl::OUString aNameStr(rtl::OUString::createFromAscii(pName)); try @@ -1375,7 +1375,7 @@ private: ScMacroInfo* getInfo( sal_Bool bCreate = false ) { - return lcl_getShapeHyperMacroInfo( mpShape, bCreate ); + return ScShapeObj_getShapeHyperMacroInfo( mpShape, bCreate ); } public: diff --git a/sc/source/ui/unoobj/srchuno.cxx b/sc/source/ui/unoobj/srchuno.cxx index e1c860f0060e..a6c9a2497b05 100644 --- a/sc/source/ui/unoobj/srchuno.cxx +++ b/sc/source/ui/unoobj/srchuno.cxx @@ -48,7 +48,7 @@ using namespace com::sun::star; // SfxItemPropertyMapEntry nur fuer GetPropertySetInfo -const SfxItemPropertyMapEntry* lcl_GetSearchPropertyMap() +static const SfxItemPropertyMapEntry* lcl_GetSearchPropertyMap() { static SfxItemPropertyMapEntry aSearchPropertyMap_Impl[] = { diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx index e1be3eaf5db0..360cb68b0c93 100644 --- a/sc/source/ui/unoobj/styleuno.cxx +++ b/sc/source/ui/unoobj/styleuno.cxx @@ -77,7 +77,7 @@ using namespace ::com::sun::star; //------------------------------------------------------------------------ -const SfxItemPropertySet* lcl_GetCellStyleSet() +static const SfxItemPropertySet* lcl_GetCellStyleSet() { static SfxItemPropertyMapEntry aCellStyleMap_Impl[] = { @@ -175,7 +175,7 @@ const SfxItemPropertySet* lcl_GetCellStyleSet() // Map mit allen Seitenattributen, incl. Kopf-/Fusszeilenattribute -const SfxItemPropertySet * lcl_GetPageStyleSet() +static const SfxItemPropertySet * lcl_GetPageStyleSet() { static SfxItemPropertyMapEntry aPageStyleMap_Impl[] = { @@ -295,7 +295,7 @@ const SfxItemPropertySet * lcl_GetPageStyleSet() // Map mit Inhalten des Header-Item-Sets -const SfxItemPropertyMap* lcl_GetHeaderStyleMap() +static const SfxItemPropertyMap* lcl_GetHeaderStyleMap() { static SfxItemPropertyMapEntry aHeaderStyleMap_Impl[] = { @@ -334,7 +334,7 @@ const SfxItemPropertyMap* lcl_GetHeaderStyleMap() // Map mit Inhalten des Footer-Item-Sets -const SfxItemPropertyMap* lcl_GetFooterStyleMap() +static const SfxItemPropertyMap* lcl_GetFooterStyleMap() { static SfxItemPropertyMapEntry aFooterStyleMap_Impl[] = { @@ -421,7 +421,7 @@ struct ScDisplayNameMap String aProgName; }; -const ScDisplayNameMap* lcl_GetStyleNameMap( sal_uInt16 nType ) +static const ScDisplayNameMap* lcl_GetStyleNameMap( sal_uInt16 nType ) { if ( nType == SFX_STYLE_FAMILY_PARA ) { @@ -478,7 +478,7 @@ const ScDisplayNameMap* lcl_GetStyleNameMap( sal_uInt16 nType ) #define SC_SUFFIX_USER " (user)" #define SC_SUFFIX_USER_LEN 7 -sal_Bool lcl_EndsWithUser( const String& rString ) +static sal_Bool lcl_EndsWithUser( const String& rString ) { const sal_Unicode *pChar = rString.GetBuffer(); xub_StrLen nLen = rString.Len(); @@ -545,7 +545,7 @@ String ScStyleNameConversion::ProgrammaticToDisplayName( const String& rProgName //------------------------------------------------------------------------ -sal_Bool lcl_AnyTabProtected( ScDocument& rDoc ) +static sal_Bool lcl_AnyTabProtected( ScDocument& rDoc ) { SCTAB nTabCount = rDoc.GetTableCount(); for (SCTAB i=0; i<nTabCount; i++) diff --git a/sc/source/ui/unoobj/targuno.cxx b/sc/source/ui/unoobj/targuno.cxx index b300f924c23f..e1701b0de4f3 100644 --- a/sc/source/ui/unoobj/targuno.cxx +++ b/sc/source/ui/unoobj/targuno.cxx @@ -57,7 +57,7 @@ sal_uInt16 nTypeResIds[SC_LINKTARGETTYPE_COUNT] = SCSTR_CONTENT_DBAREA // SC_LINKTARGETTYPE_DBAREA }; -const SfxItemPropertyMapEntry* lcl_GetLinkTargetMap() +static const SfxItemPropertyMapEntry* lcl_GetLinkTargetMap() { static SfxItemPropertyMapEntry aLinkTargetMap_Impl[] = { diff --git a/sc/source/ui/unoobj/textuno.cxx b/sc/source/ui/unoobj/textuno.cxx index 81d2f97a7949..43476e5f631e 100644 --- a/sc/source/ui/unoobj/textuno.cxx +++ b/sc/source/ui/unoobj/textuno.cxx @@ -60,7 +60,7 @@ using namespace com::sun::star; //------------------------------------------------------------------------ -const SvxItemPropertySet * lcl_GetHdFtPropertySet() +static const SvxItemPropertySet * lcl_GetHdFtPropertySet() { static SfxItemPropertyMapEntry aHdFtPropertyMap_Impl[] = { diff --git a/sc/source/ui/unoobj/tokenuno.cxx b/sc/source/ui/unoobj/tokenuno.cxx index 1929a6014524..fe879a0ca3b1 100644 --- a/sc/source/ui/unoobj/tokenuno.cxx +++ b/sc/source/ui/unoobj/tokenuno.cxx @@ -56,7 +56,7 @@ using namespace ::com::sun::star; // ============================================================================ -const SfxItemPropertyMapEntry* lcl_GetFormulaParserMap() +static const SfxItemPropertyMapEntry* lcl_GetFormulaParserMap() { static SfxItemPropertyMapEntry aFormulaParserMap_Impl[] = { @@ -295,7 +295,7 @@ SC_IMPL_DUMMY_PROPERTY_LISTENER( ScFormulaParserObj ) // ============================================================================ -void lcl_ExternalRefToApi( sheet::SingleReference& rAPI, const ScSingleRefData& rRef ) +static void lcl_ExternalRefToApi( sheet::SingleReference& rAPI, const ScSingleRefData& rRef ) { rAPI.Column = rRef.nCol; rAPI.Row = rRef.nRow; @@ -314,7 +314,7 @@ void lcl_ExternalRefToApi( sheet::SingleReference& rAPI, const ScSingleRefData& rAPI.Flags = nFlags; } -void lcl_SingleRefToApi( sheet::SingleReference& rAPI, const ScSingleRefData& rRef ) +static void lcl_SingleRefToApi( sheet::SingleReference& rAPI, const ScSingleRefData& rRef ) { rAPI.Column = rRef.nCol; rAPI.Row = rRef.nRow; diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx index 4ecc009653a8..c28ad1a13bd3 100644 --- a/sc/source/ui/unoobj/viewuno.cxx +++ b/sc/source/ui/unoobj/viewuno.cxx @@ -86,7 +86,7 @@ using namespace com::sun::star; // alles ohne Which-ID, Map nur fuer PropertySetInfo -const SfxItemPropertyMapEntry* lcl_GetViewOptPropertyMap() +static const SfxItemPropertyMapEntry* lcl_GetViewOptPropertyMap() { static SfxItemPropertyMapEntry aViewOptPropertyMap_Impl[] = { @@ -527,7 +527,7 @@ void SAL_CALL ScTabViewObj::release() throw() SfxBaseController::release(); } -void lcl_CallActivate( ScDocShell* pDocSh, SCTAB nTab, sal_Int32 nEvent ) +static void lcl_CallActivate( ScDocShell* pDocSh, SCTAB nTab, sal_Int32 nEvent ) { ScDocument* pDoc = pDocSh->GetDocument(); // when deleting a sheet, nPreviousTab can be invalid @@ -654,7 +654,7 @@ uno::Sequence<sal_Int8> SAL_CALL ScTabViewObj::getImplementationId() // XDocumentView -sal_Bool lcl_TabInRanges( SCTAB nTab, const ScRangeList& rRanges ) +static sal_Bool lcl_TabInRanges( SCTAB nTab, const ScRangeList& rRanges ) { for (size_t i = 0, nCount = rRanges.size(); i < nCount; ++i) { @@ -665,7 +665,7 @@ sal_Bool lcl_TabInRanges( SCTAB nTab, const ScRangeList& rRanges ) return false; } -void lcl_ShowObject( ScTabViewShell& rViewSh, ScDrawView& rDrawView, SdrObject* pSelObj ) +static void lcl_ShowObject( ScTabViewShell& rViewSh, ScDrawView& rDrawView, SdrObject* pSelObj ) { sal_Bool bFound = false; SCTAB nObjectTab = 0; diff --git a/sc/source/ui/vba/vbaapplication.cxx b/sc/source/ui/vba/vbaapplication.cxx index b7b53f956392..edb088a907db 100644 --- a/sc/source/ui/vba/vbaapplication.cxx +++ b/sc/source/ui/vba/vbaapplication.cxx @@ -883,7 +883,7 @@ ScVbaApplication::Calculate() throw( script::BasicErrorException , uno::Runtime xCalculatable->calculateAll(); } -uno::Reference< beans::XPropertySet > lcl_getPathSettingsService( const uno::Reference< uno::XComponentContext >& xContext ) throw ( uno::RuntimeException ) +static uno::Reference< beans::XPropertySet > lcl_getPathSettingsService( const uno::Reference< uno::XComponentContext >& xContext ) throw ( uno::RuntimeException ) { static uno::Reference< beans::XPropertySet > xPathSettings; if ( !xPathSettings.is() ) diff --git a/sc/source/ui/vba/vbaborders.cxx b/sc/source/ui/vba/vbaborders.cxx index 753e6552a1ea..974ebfe10061 100644 --- a/sc/source/ui/vba/vbaborders.cxx +++ b/sc/source/ui/vba/vbaborders.cxx @@ -473,7 +473,7 @@ void SAL_CALL ScVbaBorders::setColorIndex( const uno::Any& _colorindex ) throw ( } } -bool +static bool lcl_areAllLineWidthsSame( const table::TableBorder& maTableBorder, bool bIsCell ) { diff --git a/sc/source/ui/vba/vbafont.cxx b/sc/source/ui/vba/vbafont.cxx index 2be56260987b..0cab6650633c 100644 --- a/sc/source/ui/vba/vbafont.cxx +++ b/sc/source/ui/vba/vbafont.cxx @@ -68,7 +68,7 @@ ScVbaFont::~ScVbaFont() } -uno::Reference< beans::XPropertySet > lcl_TextProperties( uno::Reference< table::XCell >& xIf ) throw ( uno::RuntimeException ) +static uno::Reference< beans::XPropertySet > lcl_TextProperties( uno::Reference< table::XCell >& xIf ) throw ( uno::RuntimeException ) { uno::Reference< text::XTextRange > xTxtRange( xIf, uno::UNO_QUERY_THROW ); uno::Reference< text::XSimpleText > xTxt( xTxtRange->getText(), uno::UNO_QUERY_THROW ) ; diff --git a/sc/source/ui/vba/vbaformatcondition.cxx b/sc/source/ui/vba/vbaformatcondition.cxx index 7a722439416e..e26b6296310c 100644 --- a/sc/source/ui/vba/vbaformatcondition.cxx +++ b/sc/source/ui/vba/vbaformatcondition.cxx @@ -32,7 +32,7 @@ using namespace ::ooo::vba; using namespace ::com::sun::star; -ScVbaFormatConditions* +static ScVbaFormatConditions* lcl_getScVbaFormatConditionsPtr( const uno::Reference< excel::XFormatConditions >& xFormatConditions ) throw ( script::BasicErrorException ) { ScVbaFormatConditions* pFormatConditions = static_cast< ScVbaFormatConditions* >( xFormatConditions.get() ); diff --git a/sc/source/ui/vba/vbainterior.cxx b/sc/source/ui/vba/vbainterior.cxx index b5e4746fe141..56a92def3a7a 100644 --- a/sc/source/ui/vba/vbainterior.cxx +++ b/sc/source/ui/vba/vbainterior.cxx @@ -61,7 +61,7 @@ static const rtl::OUString BACKCOLOR( RTL_CONSTASCII_USTRINGPARAM( "CellBackColo static const rtl::OUString PATTERN( RTL_CONSTASCII_USTRINGPARAM( "Pattern" ) ); static const rtl::OUString PATTERNCOLOR( RTL_CONSTASCII_USTRINGPARAM( "PatternColor" ) ); -PatternMap lcl_getPatternMap() +static PatternMap lcl_getPatternMap() { PatternMap aPatternMap; aPatternMap.insert( PatternPair( xlPatternAutomatic, 0 ) ); diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx index b18f8c6a6b7d..8527b04ad739 100644 --- a/sc/source/ui/vba/vbarange.cxx +++ b/sc/source/ui/vba/vbarange.cxx @@ -189,23 +189,23 @@ const double fExtraWidth = 182.0 / 256.0; // * 1 point = 1/72 inch = 20 twips // * 1 inch = 72 points = 1440 twips // * 1 cm = 567 twips -double lcl_hmmToPoints( double nVal ) { return ( (double)((nVal /1000 ) * 567 ) / 20 ); } +static double lcl_hmmToPoints( double nVal ) { return ( (double)((nVal /1000 ) * 567 ) / 20 ); } static const sal_Int16 supportedIndexTable[] = { excel::XlBordersIndex::xlEdgeLeft, excel::XlBordersIndex::xlEdgeTop, excel::XlBordersIndex::xlEdgeBottom, excel::XlBordersIndex::xlEdgeRight, excel::XlBordersIndex::xlDiagonalDown, excel::XlBordersIndex::xlDiagonalUp, excel::XlBordersIndex::xlInsideVertical, excel::XlBordersIndex::xlInsideHorizontal }; -sal_uInt16 lcl_pointsToTwips( double nVal ) +static sal_uInt16 lcl_pointsToTwips( double nVal ) { nVal = nVal * static_cast<double>(20); short nTwips = static_cast<short>(nVal); return nTwips; } -double lcl_TwipsToPoints( sal_uInt16 nVal ) +static double lcl_TwipsToPoints( sal_uInt16 nVal ) { double nPoints = nVal; return nPoints / 20; } -double lcl_Round2DecPlaces( double nVal ) +static double lcl_Round2DecPlaces( double nVal ) { nVal = (nVal * (double)100); long tmp = static_cast<long>(nVal); @@ -216,13 +216,13 @@ double lcl_Round2DecPlaces( double nVal ) return nVal; } -uno::Any lcl_makeRange( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Any aAny, bool bIsRows, bool bIsColumns ) +static uno::Any lcl_makeRange( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Any aAny, bool bIsRows, bool bIsColumns ) { uno::Reference< table::XCellRange > xCellRange( aAny, uno::UNO_QUERY_THROW ); return uno::makeAny( uno::Reference< excel::XRange >( new ScVbaRange( xParent, xContext, xCellRange, bIsRows, bIsColumns ) ) ); } -uno::Reference< excel::XRange > lcl_makeXRangeFromSheetCellRanges( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< sheet::XSheetCellRanges >& xLocSheetCellRanges, ScDocShell* pDoc ) +static uno::Reference< excel::XRange > lcl_makeXRangeFromSheetCellRanges( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< sheet::XSheetCellRanges >& xLocSheetCellRanges, ScDocShell* pDoc ) { uno::Reference< excel::XRange > xRange; uno::Sequence< table::CellRangeAddress > sAddresses = xLocSheetCellRanges->getRangeAddresses(); @@ -1423,7 +1423,7 @@ table::CellRangeAddress getCellRangeAddressForVBARange( const uno::Any& aParam, return lclGetRangeAddress( xRangeParam ); } -uno::Reference< XCollection > +static uno::Reference< XCollection > lcl_setupBorders( const uno::Reference< excel::XRange >& xParentRange, const uno::Reference<uno::XComponentContext>& xContext, const uno::Reference< table::XCellRange >& xRange ) throw( uno::RuntimeException ) { uno::Reference< XHelperInterface > xParent( xParentRange, uno::UNO_QUERY_THROW ); @@ -4198,7 +4198,7 @@ ScVbaRange::ApplicationRange( const uno::Reference< uno::XComponentContext >& xC } // Helper functions for AutoFilter -ScDBData* lcl_GetDBData_Impl( ScDocShell* pDocShell, sal_Int16 nSheet ) +static ScDBData* lcl_GetDBData_Impl( ScDocShell* pDocShell, sal_Int16 nSheet ) { ScDBData* pRet = NULL; if (pDocShell) @@ -4208,7 +4208,7 @@ ScDBData* lcl_GetDBData_Impl( ScDocShell* pDocShell, sal_Int16 nSheet ) return pRet; } -void lcl_SelectAll( ScDocShell* pDocShell, ScQueryParam& aParam ) +static void lcl_SelectAll( ScDocShell* pDocShell, ScQueryParam& aParam ) { if ( pDocShell ) { @@ -4221,7 +4221,7 @@ void lcl_SelectAll( ScDocShell* pDocShell, ScQueryParam& aParam ) } } -ScQueryParam lcl_GetQueryParam( ScDocShell* pDocShell, sal_Int16 nSheet ) +static ScQueryParam lcl_GetQueryParam( ScDocShell* pDocShell, sal_Int16 nSheet ) { ScDBData* pDBData = lcl_GetDBData_Impl( pDocShell, nSheet ); ScQueryParam aParam; @@ -4232,7 +4232,7 @@ ScQueryParam lcl_GetQueryParam( ScDocShell* pDocShell, sal_Int16 nSheet ) return aParam; } -void lcl_SetAllQueryForField( ScDocShell* pDocShell, SCCOLROW nField, sal_Int16 nSheet ) +static void lcl_SetAllQueryForField( ScDocShell* pDocShell, SCCOLROW nField, sal_Int16 nSheet ) { ScQueryParam aParam = lcl_GetQueryParam( pDocShell, nSheet ); aParam.RemoveEntryByField(nField); @@ -4240,7 +4240,7 @@ void lcl_SetAllQueryForField( ScDocShell* pDocShell, SCCOLROW nField, sal_Int16 } // Modifies sCriteria, and nOp depending on the value of sCriteria -void lcl_setTableFieldsFromCriteria( rtl::OUString& sCriteria1, uno::Reference< beans::XPropertySet >& xDescProps, sheet::TableFilterField2& rFilterField ) +static void lcl_setTableFieldsFromCriteria( rtl::OUString& sCriteria1, uno::Reference< beans::XPropertySet >& xDescProps, sheet::TableFilterField2& rFilterField ) { // #TODO make this more efficient and cycle through // sCriteria1 character by character to pick up <,<>,=, * etc. @@ -5153,7 +5153,7 @@ ScVbaRange::Ungroup( ) throw (script::BasicErrorException, uno::RuntimeExceptio groupUnGroup(true); } -void lcl_mergeCellsOfRange( const uno::Reference< table::XCellRange >& xCellRange, sal_Bool _bMerge = sal_True ) throw ( uno::RuntimeException ) +static void lcl_mergeCellsOfRange( const uno::Reference< table::XCellRange >& xCellRange, sal_Bool _bMerge = sal_True ) throw ( uno::RuntimeException ) { uno::Reference< util::XMergeable > xMergeable( xCellRange, uno::UNO_QUERY_THROW ); xMergeable->merge(_bMerge); @@ -5366,7 +5366,7 @@ ScVbaRange::SpecialCells( const uno::Any& _oType, const uno::Any& _oValue) throw return pRangeToUse->SpecialCellsImpl( nType, _oValue ); } -sal_Int32 lcl_getFormulaResultFlags(const uno::Any& aType) throw ( script::BasicErrorException ) +static sal_Int32 lcl_getFormulaResultFlags(const uno::Any& aType) throw ( script::BasicErrorException ) { sal_Int32 nType = excel::XlSpecialCellsValue::xlNumbers; aType >>= nType; diff --git a/sc/source/ui/vba/vbasheetobject.cxx b/sc/source/ui/vba/vbasheetobject.cxx index 7e0431cc5a05..71f41de7bef2 100644 --- a/sc/source/ui/vba/vbasheetobject.cxx +++ b/sc/source/ui/vba/vbasheetobject.cxx @@ -38,7 +38,6 @@ #include <ooo/vba/excel/XlPlacement.hpp> #include <rtl/ustrbuf.hxx> #include <filter/msfilter/msvbahelper.hxx> -#include <oox/helper/helper.hxx> #include <svx/unoshape.hxx> #include "vbafont.hxx" #include "drwlayer.hxx" @@ -155,12 +154,12 @@ VBAHELPER_IMPL_XHELPERINTERFACE( ScVbaButtonCharacters, "ooo.vba.excel.Character OUString ScVbaButtonCharacters::getFullString() const throw (uno::RuntimeException) { - return mxPropSet->getPropertyValue( CREATE_OUSTRING( "Label" ) ).get< OUString >(); + return mxPropSet->getPropertyValue( "Label" ).get< OUString >(); } void ScVbaButtonCharacters::setFullString( const OUString& rString ) throw (uno::RuntimeException) { - mxPropSet->setPropertyValue( CREATE_OUSTRING( "Label" ), uno::Any( rString ) ); + mxPropSet->setPropertyValue( "Label", uno::Any( rString ) ); } // ============================================================================ @@ -230,12 +229,12 @@ void SAL_CALL ScVbaSheetObjectBase::setHeight( double fHeight ) throw (uno::Runt OUString SAL_CALL ScVbaSheetObjectBase::getName() throw (uno::RuntimeException) { - return mxShapeProps->getPropertyValue( CREATE_OUSTRING( "Name" ) ).get< OUString >(); + return mxShapeProps->getPropertyValue( "Name" ).get< OUString >(); } void SAL_CALL ScVbaSheetObjectBase::setName( const OUString& rName ) throw (uno::RuntimeException) { - mxShapeProps->setPropertyValue( CREATE_OUSTRING( "Name" ), uno::Any( rName ) ); + mxShapeProps->setPropertyValue( "Name", uno::Any( rName ) ); } sal_Int32 SAL_CALL ScVbaSheetObjectBase::getPlacement() throw (uno::RuntimeException) @@ -319,24 +318,24 @@ ScVbaControlObjectBase::ScVbaControlObjectBase( switch( eListenerType ) { case LISTENER_ACTION: - maListenerType = CREATE_OUSTRING( "XActionListener" ); - maEventMethod = CREATE_OUSTRING( "actionPerformed" ); + maListenerType = "XActionListener"; + maEventMethod = "actionPerformed"; break; case LISTENER_MOUSE: - maListenerType = CREATE_OUSTRING( "XMouseListener" ); - maEventMethod = CREATE_OUSTRING( "mouseReleased" ); + maListenerType = "XMouseListener"; + maEventMethod = "mouseReleased"; break; case LISTENER_TEXT: - maListenerType = CREATE_OUSTRING( "XTextListener" ); - maEventMethod = CREATE_OUSTRING( "textChanged" ); + maListenerType = "XTextListener"; + maEventMethod = "textChanged"; break; case LISTENER_VALUE: - maListenerType = CREATE_OUSTRING( "XAdjustmentListener" ); - maEventMethod = CREATE_OUSTRING( "adjustmentValueChanged" ); + maListenerType = "XAdjustmentListener"; + maEventMethod = "adjustmentValueChanged"; break; case LISTENER_CHANGE: - maListenerType = CREATE_OUSTRING( "XChangeListener" ); - maEventMethod = CREATE_OUSTRING( "changed" ); + maListenerType = "XChangeListener"; + maEventMethod = "changed"; break; // no default, to let the compiler complain about missing case } @@ -346,12 +345,12 @@ ScVbaControlObjectBase::ScVbaControlObjectBase( OUString SAL_CALL ScVbaControlObjectBase::getName() throw (uno::RuntimeException) { - return mxControlProps->getPropertyValue( CREATE_OUSTRING( "Name" ) ).get< OUString >(); + return mxControlProps->getPropertyValue( "Name" ).get< OUString >(); } void SAL_CALL ScVbaControlObjectBase::setName( const OUString& rName ) throw (uno::RuntimeException) { - mxControlProps->setPropertyValue( CREATE_OUSTRING( "Name" ), uno::Any( rName ) ); + mxControlProps->setPropertyValue( "Name", uno::Any( rName ) ); } OUString SAL_CALL ScVbaControlObjectBase::getOnAction() throw (uno::RuntimeException) @@ -363,7 +362,7 @@ OUString SAL_CALL ScVbaControlObjectBase::getOnAction() throw (uno::RuntimeExcep { const script::ScriptEventDescriptor* pEvent = aEvents.getConstArray(); const script::ScriptEventDescriptor* pEventEnd = pEvent + aEvents.getLength(); - const OUString aScriptType = CREATE_OUSTRING( "Script" ); + const OUString aScriptType = "Script"; for( ; pEvent < pEventEnd; ++pEvent ) if( (pEvent->ListenerType == maListenerType) && (pEvent->EventMethod == maEventMethod) && (pEvent->ScriptType == aScriptType) ) return extractMacroName( pEvent->ScriptCode ); @@ -388,7 +387,7 @@ void SAL_CALL ScVbaControlObjectBase::setOnAction( const OUString& rMacroName ) script::ScriptEventDescriptor aDescriptor; aDescriptor.ListenerType = maListenerType; aDescriptor.EventMethod = maEventMethod; - aDescriptor.ScriptType = CREATE_OUSTRING( "Script" ); + aDescriptor.ScriptType = "Script"; aDescriptor.ScriptCode = makeMacroURL( aResolvedMacro.msResolvedMacro ); xEventMgr->registerScriptEvent( nIndex, aDescriptor ); } @@ -396,12 +395,12 @@ void SAL_CALL ScVbaControlObjectBase::setOnAction( const OUString& rMacroName ) sal_Bool SAL_CALL ScVbaControlObjectBase::getPrintObject() throw (uno::RuntimeException) { - return mxControlProps->getPropertyValue( CREATE_OUSTRING( "Printable" ) ).get< sal_Bool >(); + return mxControlProps->getPropertyValue( "Printable" ).get< sal_Bool >(); } void SAL_CALL ScVbaControlObjectBase::setPrintObject( sal_Bool bPrintObject ) throw (uno::RuntimeException) { - mxControlProps->setPropertyValue( CREATE_OUSTRING( "Printable" ), uno::Any( bPrintObject ) ); + mxControlProps->setPropertyValue( "Printable", uno::Any( bPrintObject ) ); } // XControlObject attributes @@ -446,12 +445,12 @@ ScVbaButton::ScVbaButton( OUString SAL_CALL ScVbaButton::getCaption() throw (uno::RuntimeException) { - return mxControlProps->getPropertyValue( CREATE_OUSTRING( "Label" ) ).get< OUString >(); + return mxControlProps->getPropertyValue( "Label" ).get< OUString >(); } void SAL_CALL ScVbaButton::setCaption( const OUString& rCaption ) throw (uno::RuntimeException) { - mxControlProps->setPropertyValue( CREATE_OUSTRING( "Label" ), uno::Any( rCaption ) ); + mxControlProps->setPropertyValue( "Label", uno::Any( rCaption ) ); } uno::Reference< excel::XFont > SAL_CALL ScVbaButton::getFont() throw (uno::RuntimeException) @@ -466,7 +465,7 @@ void SAL_CALL ScVbaButton::setFont( const uno::Reference< excel::XFont >& /*rxFo sal_Int32 SAL_CALL ScVbaButton::getHorizontalAlignment() throw (uno::RuntimeException) { - switch( mxControlProps->getPropertyValue( CREATE_OUSTRING( "Align" ) ).get< sal_Int16 >() ) + switch( mxControlProps->getPropertyValue( "Align" ).get< sal_Int16 >() ) { case awt::TextAlign::LEFT: return excel::Constants::xlLeft; case awt::TextAlign::RIGHT: return excel::Constants::xlRight; @@ -485,12 +484,12 @@ void SAL_CALL ScVbaButton::setHorizontalAlignment( sal_Int32 nAlign ) throw (uno case excel::Constants::xlCenter: nAwtAlign = awt::TextAlign::CENTER; break; } // form controls expect short value - mxControlProps->setPropertyValue( CREATE_OUSTRING( "Align" ), uno::Any( static_cast< sal_Int16 >( nAwtAlign ) ) ); + mxControlProps->setPropertyValue( "Align", uno::Any( static_cast< sal_Int16 >( nAwtAlign ) ) ); } sal_Int32 SAL_CALL ScVbaButton::getVerticalAlignment() throw (uno::RuntimeException) { - switch( mxControlProps->getPropertyValue( CREATE_OUSTRING( "VerticalAlign" ) ).get< style::VerticalAlignment >() ) + switch( mxControlProps->getPropertyValue( "VerticalAlign" ).get< style::VerticalAlignment >() ) { case style::VerticalAlignment_TOP: return excel::Constants::xlTop; case style::VerticalAlignment_BOTTOM: return excel::Constants::xlBottom; @@ -509,7 +508,7 @@ void SAL_CALL ScVbaButton::setVerticalAlignment( sal_Int32 nAlign ) throw (uno:: case excel::Constants::xlBottom: eAwtAlign = style::VerticalAlignment_BOTTOM; break; case excel::Constants::xlCenter: eAwtAlign = style::VerticalAlignment_MIDDLE; break; } - mxControlProps->setPropertyValue( CREATE_OUSTRING( "VerticalAlign" ), uno::Any( eAwtAlign ) ); + mxControlProps->setPropertyValue( "VerticalAlign", uno::Any( eAwtAlign ) ); } sal_Int32 SAL_CALL ScVbaButton::getOrientation() throw (uno::RuntimeException) @@ -538,7 +537,7 @@ VBAHELPER_IMPL_XHELPERINTERFACE( ScVbaButton, "ooo.vba.excel.Button" ) OUString ScVbaButton::implGetBaseName() const { - return CREATE_OUSTRING( "Button" ); + return OUString( "Button" ); } void ScVbaButton::implSetDefaultProperties() throw (uno::RuntimeException) diff --git a/sc/source/ui/vba/vbasheetobjects.cxx b/sc/source/ui/vba/vbasheetobjects.cxx index 76a7cdc6de18..e5e95148c874 100644 --- a/sc/source/ui/vba/vbasheetobjects.cxx +++ b/sc/source/ui/vba/vbasheetobjects.cxx @@ -39,7 +39,6 @@ #include <com/sun/star/form/XForm.hpp> #include <com/sun/star/form/XFormComponent.hpp> #include <com/sun/star/form/XFormsSupplier.hpp> -#include <oox/helper/helper.hxx> #include "vbasheetobject.hxx" using ::rtl::OUString; @@ -243,7 +242,7 @@ sal_Bool SAL_CALL ScVbaObjectContainer::hasElements() throw (uno::RuntimeExcepti OUString ScVbaObjectContainer::implGetShapeName( const uno::Reference< drawing::XShape >& rxShape ) const throw (uno::RuntimeException) { uno::Reference< beans::XPropertySet > xPropSet( rxShape, uno::UNO_QUERY_THROW ); - return xPropSet->getPropertyValue( CREATE_OUSTRING( "Name" ) ).get< OUString >(); + return xPropSet->getPropertyValue( "Name" ).get< OUString >(); } void ScVbaObjectContainer::implOnShapeCreated( const uno::Reference< drawing::XShape >& /*rxShape*/ ) throw (uno::RuntimeException) @@ -404,14 +403,14 @@ uno::Reference< container::XIndexContainer > ScVbaControlContainer::createForm() { uno::Reference< form::XFormsSupplier > xFormsSupp( mxShapes, uno::UNO_QUERY_THROW ); uno::Reference< container::XNameContainer > xFormsNC( xFormsSupp->getForms(), uno::UNO_SET_THROW ); - OUString aFormName = CREATE_OUSTRING( "Standard" ); + OUString aFormName = "Standard"; if( xFormsNC->hasByName( aFormName ) ) { mxFormIC.set( xFormsNC->getByName( aFormName ), uno::UNO_QUERY_THROW ); } else { - uno::Reference< form::XForm > xForm( mxFactory->createInstance( CREATE_OUSTRING( "com.sun.star.form.component.Form" ) ), uno::UNO_QUERY_THROW ); + uno::Reference< form::XForm > xForm( mxFactory->createInstance( "com.sun.star.form.component.Form" ), uno::UNO_QUERY_THROW ); xFormsNC->insertByName( aFormName, uno::Any( xForm ) ); mxFormIC.set( xForm, uno::UNO_QUERY_THROW ); } @@ -426,7 +425,7 @@ bool ScVbaControlContainer::implPickShape( const uno::Reference< drawing::XShape uno::Reference< drawing::XControlShape > xControlShape( rxShape, uno::UNO_QUERY_THROW ); uno::Reference< beans::XPropertySet > xModelProps( xControlShape->getControl(), uno::UNO_QUERY_THROW ); sal_Int16 nClassId = -1; - return lclGetProperty( nClassId, xModelProps, CREATE_OUSTRING( "ClassId" ) ) && + return lclGetProperty( nClassId, xModelProps, "ClassId" ) && (nClassId == mnComponentType) && implCheckProperties( xModelProps ); } catch( uno::Exception& ) @@ -437,7 +436,7 @@ bool ScVbaControlContainer::implPickShape( const uno::Reference< drawing::XShape OUString ScVbaControlContainer::implGetShapeServiceName() const { - return CREATE_OUSTRING( "com.sun.star.drawing.ControlShape" ); + return OUString( "com.sun.star.drawing.ControlShape" ); } bool ScVbaControlContainer::implCheckProperties( const uno::Reference< beans::XPropertySet >& /*rxModelProps*/ ) const @@ -494,7 +493,7 @@ ScVbaButtonContainer::ScVbaButtonContainer( ScVbaControlContainer( rxParent, rxContext, rxModel, rxSheet, excel::XButton::static_type( 0 ), - CREATE_OUSTRING( "com.sun.star.form.component.CommandButton" ), + "com.sun.star.form.component.CommandButton", form::FormComponentType::COMMANDBUTTON ) { } @@ -509,7 +508,7 @@ bool ScVbaButtonContainer::implCheckProperties( const uno::Reference< beans::XPr { // do not insert toggle buttons into the 'Buttons' collection bool bToggle = false; - return lclGetProperty( bToggle, rxModelProps, CREATE_OUSTRING( "Toggle" ) ) && !bToggle; + return lclGetProperty( bToggle, rxModelProps, "Toggle" ) && !bToggle; } // ============================================================================ diff --git a/sc/source/ui/vba/vbastyle.cxx b/sc/source/ui/vba/vbastyle.cxx index 670480cad7af..9b09263a657a 100644 --- a/sc/source/ui/vba/vbastyle.cxx +++ b/sc/source/ui/vba/vbastyle.cxx @@ -44,7 +44,7 @@ ScVbaStyle::getStylesNameContainer( const uno::Reference< frame::XModel >& xMode return xStylesAccess; } -uno::Reference< beans::XPropertySet > +static uno::Reference< beans::XPropertySet > lcl_getStyleProps( const rtl::OUString& sStyleName, const uno::Reference< frame::XModel >& xModel ) throw ( script::BasicErrorException, uno::RuntimeException ) { diff --git a/sc/source/ui/vba/vbastyles.cxx b/sc/source/ui/vba/vbastyles.cxx index 3a8b8c1a0a7f..2d353b549a87 100644 --- a/sc/source/ui/vba/vbastyles.cxx +++ b/sc/source/ui/vba/vbastyles.cxx @@ -33,7 +33,7 @@ using namespace ::ooo::vba; using namespace ::com::sun::star; static rtl::OUString SDEFAULTCELLSTYLENAME( RTL_CONSTASCII_USTRINGPARAM("Default") ); -css::uno::Any +static css::uno::Any lcl_createAPIStyleToVBAObject( const css::uno::Any& aObject, const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< frame::XModel >& xModel ) { uno::Reference< beans::XPropertySet > xStyleProps( aObject, uno::UNO_QUERY_THROW ); diff --git a/sc/source/ui/vba/vbavalidation.cxx b/sc/source/ui/vba/vbavalidation.cxx index 03ce70ab85fd..ce7f8ec8ba37 100644 --- a/sc/source/ui/vba/vbavalidation.cxx +++ b/sc/source/ui/vba/vbavalidation.cxx @@ -52,14 +52,14 @@ const static rtl::OUString STYPE( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_TYPE const static rtl::OUString SHOWLIST( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_SHOWLIST ) ); const static rtl::OUString ALERTSTYLE( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_ERRALSTY ) ); -void +static void lcl_setValidationProps( const uno::Reference< table::XCellRange >& xRange, const uno::Reference< beans::XPropertySet >& xProps ) { uno::Reference< beans::XPropertySet > xRangeProps( xRange, uno::UNO_QUERY_THROW ); xRangeProps->setPropertyValue( VALIDATION , uno::makeAny( xProps ) ); } -uno::Reference< beans::XPropertySet > +static uno::Reference< beans::XPropertySet > lcl_getValidationProps( const uno::Reference< table::XCellRange >& xRange ) { uno::Reference< beans::XPropertySet > xProps( xRange, uno::UNO_QUERY_THROW ); diff --git a/sc/source/ui/vba/vbawindows.cxx b/sc/source/ui/vba/vbawindows.cxx index b15d7539cd6c..88abe681d8c4 100644 --- a/sc/source/ui/vba/vbawindows.cxx +++ b/sc/source/ui/vba/vbawindows.cxx @@ -44,7 +44,7 @@ sal_Int32, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > NameIndexHash; -uno::Reference< XHelperInterface > lcl_createWorkbookHIParent( const uno::Reference< frame::XModel >& xModel, const uno::Reference< uno::XComponentContext >& xContext, const uno::Any& aApplication ) +static uno::Reference< XHelperInterface > lcl_createWorkbookHIParent( const uno::Reference< frame::XModel >& xModel, const uno::Reference< uno::XComponentContext >& xContext, const uno::Any& aApplication ) { return new ScVbaWorkbook( uno::Reference< XHelperInterface >( aApplication, uno::UNO_QUERY_THROW ), xContext, xModel ); } diff --git a/sc/source/ui/vba/vbaworksheets.cxx b/sc/source/ui/vba/vbaworksheets.cxx index e952d9a2d1cb..1ea357111911 100644 --- a/sc/source/ui/vba/vbaworksheets.cxx +++ b/sc/source/ui/vba/vbaworksheets.cxx @@ -73,7 +73,7 @@ typedef std::vector< uno::Reference< sheet::XSpreadsheet > > SheetMap; // #FIXME #TODO the implementation of the Sheets collections sucks, // e.g. there is no support for tracking sheets added/removed from the collection -uno::Reference< uno::XInterface > +static uno::Reference< uno::XInterface > lcl_getModulAsUnoObject( const uno::Reference< sheet::XSpreadsheet >& xSheet, const uno::Reference< frame::XModel >& xModel ) throw ( uno::RuntimeException ) { uno::Reference< uno::XInterface > xRet; diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx index 4e2291385ef5..89478f5fcd66 100644 --- a/sc/source/ui/view/cellsh.cxx +++ b/sc/source/ui/view/cellsh.cxx @@ -328,7 +328,7 @@ void ScCellShell::GetCellState( SfxItemSet& rSet ) } } -sal_Bool lcl_TestFormat( SvxClipboardFmtItem& rFormats, const TransferableDataHelper& rDataHelper, +static sal_Bool lcl_TestFormat( SvxClipboardFmtItem& rFormats, const TransferableDataHelper& rDataHelper, SotFormatStringId nFormatId ) { if ( rDataHelper.HasFormat( nFormatId ) ) @@ -393,7 +393,7 @@ void ScCellShell::GetPossibleClipboardFormats( SvxClipboardFmtItem& rFormats ) // insert, insert contents -sal_Bool lcl_IsCellPastePossible( const TransferableDataHelper& rData ) +static sal_Bool lcl_IsCellPastePossible( const TransferableDataHelper& rData ) { sal_Bool bPossible = false; if ( ScTransferObj::GetOwnClipboard( NULL ) || ScDrawTransferObj::GetOwnClipboard( NULL ) ) diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index e9211c109d8a..6cfd3f8cea88 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -126,6 +126,9 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) case FID_INSERT_NAME: case SID_SPELL_DIALOG: case SID_HANGUL_HANJA_CONVERSION: + case SID_OPENDLG_CONDFRMT: + case SID_OPENDLG_COLORSCALE: + case SID_OPENDLG_DATABAR: pScMod->InputEnterHandler(); pTabViewShell->UpdateInputHandler(); @@ -1762,6 +1765,32 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) } break; + case SID_OPENDLG_CONDFRMT: + case SID_OPENDLG_COLORSCALE: + case SID_OPENDLG_DATABAR: + { + sal_uInt16 nId = 0; + switch( nSlot ) + { + case SID_OPENDLG_CONDFRMT: + nId = ScCondFormatConditionDlgWrapper::GetChildWindowId(); + break; + case SID_OPENDLG_COLORSCALE: + nId = ScCondFormatColorScaleDlgWrapper::GetChildWindowId(); + break; + case SID_OPENDLG_DATABAR: + nId = ScCondFormatDataBarDlgWrapper::GetChildWindowId(); + break; + default: + break; + } + SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame(); + SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId ); + + pScMod->SetRefDialog( nId, pWnd ? false : sal_True ); + } + break; + case SID_DEFINE_COLROWNAMERANGES: { @@ -2034,52 +2063,6 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) } break; - case SID_OPENDLG_CONDFRMT: - { - ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); - OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - - ScRangeList aRangeList; - ScViewData* pData = GetViewData(); - pData->GetMarkData().FillRangeListWithMarks(&aRangeList, false); - ScDocument* pDoc = pData->GetDocument(); - - if(pDoc->IsTabProtected(pData->GetTabNo())) - { - pTabViewShell->ErrorMessage( STR_ERR_CONDFORMAT_PROTECTED ); - break; - } - - ScAddress aPos(pData->GetCurX(), pData->GetCurY(), pData->GetTabNo()); - if(aRangeList.empty()) - { - ScRange* pRange = new ScRange(aPos); - aRangeList.push_back(pRange); - } - - AbstractScCondFormatDlg* pDlg = NULL; - const ScConditionalFormat* pCondFormat = pDoc->GetCondFormat(aPos.Col(), aPos.Row(), aPos.Tab()); - if(pCondFormat) - { - pDlg = pFact->CreateScCondFormatDlg( pTabViewShell->GetDialogParent(), pDoc, pCondFormat, pCondFormat->GetRange(), pCondFormat->GetRange().GetTopLeftCorner(), RID_SCDLG_CONDFORMAT ); - } - else - { - pDlg = pFact->CreateScCondFormatDlg( pTabViewShell->GetDialogParent(), pDoc, NULL, aRangeList, aRangeList.GetTopLeftCorner(), RID_SCDLG_CONDFORMAT ); - } - - if(pDlg->Execute() == RET_OK) - { - ScConditionalFormat* pFormat = pDlg->GetConditionalFormat(); - sal_uLong nOldIndex = 0; - if(pCondFormat) - nOldIndex = pCondFormat->GetKey(); - pData->GetDocShell()->GetDocFunc().ReplaceConditionalFormat( nOldIndex, pFormat, pData->GetTabNo(), pFormat->GetRange() ); - } - delete pDlg; - } - break; - case SID_OPENDLG_CONDFRMT_MANAGER: { ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); @@ -2097,41 +2080,12 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) ScAddress aPos(pData->GetCurX(), pData->GetCurY(), pData->GetTabNo()); ScConditionalFormatList* pList = pDoc->GetCondFormList( aPos.Tab() ); - AbstractScCondFormatManagerDlg* pDlg = pFact->CreateScCondFormatMgrDlg( pTabViewShell->GetDialogParent(), pDoc, pList, aPos, RID_SCDLG_COND_FORMAT_MANAGER); - if(pDlg->Execute() == RET_OK) - { - pDoc->SetCondFormList(pDlg->GetConditionalFormatList(), aPos.Tab()); - } - delete pDlg; - } - break; - - case SID_COLORSCALE: - { - ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); - OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - - ScDocument* pDoc = GetViewData()->GetDocument(); - AbstractScDataBarSettingsDlg* pDlg = pFact->CreateScDataBarSetttingsDlg( pTabViewShell->GetDialogParent(), pDoc, RID_SCDLG_DATABAR ); - OSL_ENSURE(pDlg, "Dialog create fail!"); - pDlg->Execute(); - delete pDlg; - } - break; - - case SID_DATABAR: - { - ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); - OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - - ScDocument* pDoc = GetViewData()->GetDocument(); - AbstractScDataBarSettingsDlg* pDlg = pFact->CreateScDataBarSetttingsDlg( pTabViewShell->GetDialogParent(), pDoc, RID_SCDLG_DATABAR ); - OSL_ENSURE(pDlg, "Dialog create fail!"); - if(pDlg->Execute() == RET_OK) + boost::scoped_ptr<AbstractScCondFormatManagerDlg> pDlg(pFact->CreateScCondFormatMgrDlg( pTabViewShell->GetDialogParent(), pDoc, pList, aPos, RID_SCDLG_COND_FORMAT_MANAGER)); + if(pDlg->Execute() == RET_OK && pDlg->CondFormatsChanged()) { - //add here code that handles the data bar inserting + ScConditionalFormatList* pCondFormatList = pDlg->GetConditionalFormatList(); + pData->GetDocShell()->GetDocFunc().SetConditionalFormatList(pCondFormatList, aPos.Tab()); } - delete pDlg; } break; diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx index 325e71362797..3f120adcdc85 100644 --- a/sc/source/ui/view/cellsh2.cxx +++ b/sc/source/ui/view/cellsh2.cxx @@ -71,7 +71,7 @@ using namespace com::sun::star; -bool lcl_GetTextToColumnsRange( const ScViewData* pData, ScRange& rRange ) +static bool lcl_GetTextToColumnsRange( const ScViewData* pData, ScRange& rRange ) { OSL_ENSURE( pData, "lcl_GetTextToColumnsRange: pData is null!" ); @@ -111,7 +111,7 @@ bool lcl_GetTextToColumnsRange( const ScViewData* pData, ScRange& rRange ) return bRet; } -sal_Bool lcl_GetSortParam( const ScViewData* pData, ScSortParam& rSortParam ) +static sal_Bool lcl_GetSortParam( const ScViewData* pData, ScSortParam& rSortParam ) { ScTabViewShell* pTabViewShell = pData->GetViewShell(); ScDBData* pDBData = pTabViewShell->GetDBData(); diff --git a/sc/source/ui/view/colrowba.cxx b/sc/source/ui/view/colrowba.cxx index 890b05e98ca9..2272a4ad9b13 100644 --- a/sc/source/ui/view/colrowba.cxx +++ b/sc/source/ui/view/colrowba.cxx @@ -42,7 +42,7 @@ //================================================================== -String lcl_MetricString( long nTwips, const String& rText ) +static String lcl_MetricString( long nTwips, const String& rText ) { if ( nTwips <= 0 ) return ScGlobal::GetRscString(STR_TIP_HIDE); diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx index 3d175b752638..05144a4c61fa 100644 --- a/sc/source/ui/view/dbfunc3.cxx +++ b/sc/source/ui/view/dbfunc3.cxx @@ -566,7 +566,7 @@ void ScDBFunc::Consolidate( const ScConsolidateParam& rParam, sal_Bool bRecord ) // Pivot // -String lcl_MakePivotTabName( const String& rPrefix, SCTAB nNumber ) +static String lcl_MakePivotTabName( const String& rPrefix, SCTAB nNumber ) { String aName = rPrefix; aName += String::CreateFromInt32( nNumber ); @@ -1651,7 +1651,7 @@ void ScDBFunc::DataPilotInput( const ScAddress& rPos, const rtl::OUString& rStri } } -void lcl_MoveToEnd( ScDPSaveDimension& rDim, const String& rItemName ) +static void lcl_MoveToEnd( ScDPSaveDimension& rDim, const String& rItemName ) { ScDPSaveMember* pNewMember = NULL; const ScDPSaveMember* pOldMember = rDim.GetExistingMemberByName( rItemName ); diff --git a/sc/source/ui/view/drawvie4.cxx b/sc/source/ui/view/drawvie4.cxx index 30aaf0d5ad6c..0c48b58b4a38 100644 --- a/sc/source/ui/view/drawvie4.cxx +++ b/sc/source/ui/view/drawvie4.cxx @@ -67,7 +67,7 @@ Point aDragStartDiff; // ----------------------------------------------------------------------- -void lcl_CheckOle( const SdrMarkList& rMarkList, sal_Bool& rAnyOle, sal_Bool& rOneOle ) +void ScDrawView::CheckOle( const SdrMarkList& rMarkList, sal_Bool& rAnyOle, sal_Bool& rOneOle ) { rAnyOle = rOneOle = false; sal_uLong nCount = rMarkList.GetMarkCount(); @@ -115,7 +115,7 @@ sal_Bool ScDrawView::BeginDrag( Window* pWindow, const Point& rStartPos ) sal_Bool bAnyOle, bOneOle; const SdrMarkList& rMarkList = GetMarkedObjectList(); - lcl_CheckOle( rMarkList, bAnyOle, bOneOle ); + CheckOle( rMarkList, bAnyOle, bOneOle ); ScDocShellRef aDragShellRef; if (bAnyOle) @@ -157,7 +157,7 @@ void ScDrawView::DoCopy() { sal_Bool bAnyOle, bOneOle; const SdrMarkList& rMarkList = GetMarkedObjectList(); - lcl_CheckOle( rMarkList, bAnyOle, bOneOle ); + CheckOle( rMarkList, bAnyOle, bOneOle ); // update ScGlobal::pDrawClipDocShellRef ScDrawLayer::SetGlobalDrawPersist( ScTransferObj::SetDrawClipDoc( bAnyOle ) ); @@ -193,7 +193,7 @@ uno::Reference<datatransfer::XTransferable> ScDrawView::CopyToTransferable() { sal_Bool bAnyOle, bOneOle; const SdrMarkList& rMarkList = GetMarkedObjectList(); - lcl_CheckOle( rMarkList, bAnyOle, bOneOle ); + CheckOle( rMarkList, bAnyOle, bOneOle ); // update ScGlobal::pDrawClipDocShellRef ScDrawLayer::SetGlobalDrawPersist( ScTransferObj::SetDrawClipDoc( bAnyOle ) ); diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx index 04524ecf6020..a9681cbc2bd2 100644 --- a/sc/source/ui/view/editsh.cxx +++ b/sc/source/ui/view/editsh.cxx @@ -134,7 +134,7 @@ void ScEditShell::SetEditView(EditView* pView) SetUndoManager( &pEditView->GetEditEngine()->GetUndoManager() ); } -void lcl_RemoveAttribs( EditView& rEditView ) +static void lcl_RemoveAttribs( EditView& rEditView ) { ScEditEngineDefaulter* pEngine = static_cast<ScEditEngineDefaulter*>(rEditView.GetEditEngine()); @@ -622,7 +622,7 @@ void ScEditShell::Execute( SfxRequest& rReq ) pHdl->SetSelIsRef(sal_True); } -void lcl_DisableAll( SfxItemSet& rSet ) // disable all slots +static void lcl_DisableAll( SfxItemSet& rSet ) // disable all slots { SfxWhichIter aIter( rSet ); sal_uInt16 nWhich = aIter.FirstWhich(); @@ -804,7 +804,7 @@ void ScEditShell::GetClipState( SfxItemSet& rSet ) } } -void lcl_InvalidateUnder( SfxBindings& rBindings ) +static void lcl_InvalidateUnder( SfxBindings& rBindings ) { rBindings.Invalidate( SID_ATTR_CHAR_UNDERLINE ); rBindings.Invalidate( SID_ULINE_VAL_NONE ); diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index f4e317e10317..247ff7385c26 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -42,7 +42,6 @@ #include <sfx2/viewfrm.hxx> #include <sfx2/docfile.hxx> #include <svl/stritem.hxx> -#include <svtools/svlbox.hxx> #include <svtools/svtabbx.hxx> #include <svl/urlbmk.hxx> #include <vcl/cursor.hxx> @@ -344,7 +343,7 @@ Window* ScFilterFloatingWindow::GetPreferredKeyInputWindow() // ============================================================================ -sal_Bool lcl_IsEditableMatrix( ScDocument* pDoc, const ScRange& rRange ) +static sal_Bool lcl_IsEditableMatrix( ScDocument* pDoc, const ScRange& rRange ) { // wenn es ein editierbarer Bereich ist, und rechts unten eine Matrix-Zelle // mit Origin links oben liegt, enthaelt der Bereich genau die Matrix. @@ -361,7 +360,7 @@ sal_Bool lcl_IsEditableMatrix( ScDocument* pDoc, const ScRange& rRange ) } -void lcl_UnLockComment( ScDrawView* pView, SdrPageView* pPV, SdrModel* pDrDoc, const Point& rPos, ScViewData* pViewData ) +static void lcl_UnLockComment( ScDrawView* pView, SdrPageView* pPV, SdrModel* pDrDoc, const Point& rPos, ScViewData* pViewData ) { if (!pView && !pPV && !pDrDoc && !pViewData) return; @@ -380,7 +379,7 @@ void lcl_UnLockComment( ScDrawView* pView, SdrPageView* pPV, SdrModel* pDrDoc, c } } -sal_Bool lcl_GetHyperlinkCell(ScDocument* pDoc, SCCOL& rPosX, SCROW& rPosY, SCTAB nTab, ScBaseCell*& rpCell ) +static sal_Bool lcl_GetHyperlinkCell(ScDocument* pDoc, SCCOL& rPosX, SCROW& rPosY, SCTAB nTab, ScBaseCell*& rpCell ) { sal_Bool bFound = false; do @@ -2665,7 +2664,7 @@ void ScGridWindow::MouseMove( const MouseEvent& rMEvt ) return; } -void lcl_InitMouseEvent( ::com::sun::star::awt::MouseEvent& rEvent, const MouseEvent& rEvt ) +static void lcl_InitMouseEvent( ::com::sun::star::awt::MouseEvent& rEvent, const MouseEvent& rEvt ) { rEvent.Modifiers = 0; if ( rEvt.IsShift() ) @@ -2840,7 +2839,7 @@ void ScGridWindow::StartDrag( sal_Int8 /* nAction */, const Point& rPosPixel ) pViewData->GetView()->GetSelEngine()->Command( aDragEvent ); } -void lcl_SetTextCursorPos( ScViewData* pViewData, ScSplitPos eWhich, Window* pWin ) +static void lcl_SetTextCursorPos( ScViewData* pViewData, ScSplitPos eWhich, Window* pWin ) { SCCOL nCol = pViewData->GetCurX(); SCROW nRow = pViewData->GetCurY(); @@ -3438,7 +3437,7 @@ bool ScGridWindow::DropScroll( const Point& rMousePos ) return false; } -sal_Bool lcl_TestScenarioRedliningDrop( ScDocument* pDoc, const ScRange& aDragRange) +static sal_Bool lcl_TestScenarioRedliningDrop( ScDocument* pDoc, const ScRange& aDragRange) { // Testet, ob bei eingeschalteten RedLining, // bei einem Drop ein Scenario betroffen ist. @@ -3468,7 +3467,7 @@ sal_Bool lcl_TestScenarioRedliningDrop( ScDocument* pDoc, const ScRange& aDragRa return bReturn; } -ScRange lcl_MakeDropRange( SCCOL nPosX, SCROW nPosY, SCTAB nTab, const ScRange& rSource ) +static ScRange lcl_MakeDropRange( SCCOL nPosX, SCROW nPosY, SCTAB nTab, const ScRange& rSource ) { SCCOL nCol1 = nPosX; SCCOL nCol2 = nCol1 + ( rSource.aEnd.Col() - rSource.aStart.Col() ); @@ -3868,7 +3867,7 @@ sal_Int8 ScGridWindow::AcceptDrop( const AcceptDropEvent& rEvt ) return nRet; } -sal_uLong lcl_GetDropFormatId( const uno::Reference<datatransfer::XTransferable>& xTransfer, bool bPreferText = false ) +static sal_uLong lcl_GetDropFormatId( const uno::Reference<datatransfer::XTransferable>& xTransfer, bool bPreferText = false ) { TransferableDataHelper aDataHelper( xTransfer ); @@ -3953,7 +3952,7 @@ sal_uLong lcl_GetDropFormatId( const uno::Reference<datatransfer::XTransferable> return nFormatId; } -sal_uLong lcl_GetDropLinkId( const uno::Reference<datatransfer::XTransferable>& xTransfer ) +static sal_uLong lcl_GetDropLinkId( const uno::Reference<datatransfer::XTransferable>& xTransfer ) { TransferableDataHelper aDataHelper( xTransfer ); @@ -4819,7 +4818,7 @@ bool ScGridWindow::HitRangeFinder( const Point& rMouse, bool& rCorner, #define SCE_RIGHT 8 #define SCE_ALL 15 -void lcl_PaintOneRange( ScDocShell* pDocSh, const ScRange& rRange, sal_uInt16 nEdges ) +static void lcl_PaintOneRange( ScDocShell* pDocSh, const ScRange& rRange, sal_uInt16 nEdges ) { // der Range ist immer richtigherum @@ -4878,7 +4877,7 @@ void lcl_PaintOneRange( ScDocShell* pDocSh, const ScRange& rRange, sal_uInt16 nE pDocSh->PostPaint( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2, PAINT_MARKS ); } -void lcl_PaintRefChanged( ScDocShell* pDocSh, const ScRange& rOldUn, const ScRange& rNewUn ) +static void lcl_PaintRefChanged( ScDocShell* pDocSh, const ScRange& rOldUn, const ScRange& rNewUn ) { // Repaint fuer die Teile des Rahmens in Old, die bei New nicht mehr da sind diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index eee44ec52c15..44901dd90f67 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -75,7 +75,7 @@ //------------------------------------------------------------------------ -void lcl_LimitRect( Rectangle& rRect, const Rectangle& rVisible ) +static void lcl_LimitRect( Rectangle& rRect, const Rectangle& rVisible ) { if ( rRect.Top() < rVisible.Top()-1 ) rRect.Top() = rVisible.Top()-1; if ( rRect.Bottom() > rVisible.Bottom()+1 ) rRect.Bottom() = rVisible.Bottom()+1; @@ -85,7 +85,7 @@ void lcl_LimitRect( Rectangle& rRect, const Rectangle& rVisible ) // Wenn's weit daneben liegt, wird lcl_DrawOneFrame erst gar nicht gerufen. } -void lcl_DrawOneFrame( OutputDevice* pDev, const Rectangle& rInnerPixel, +static void lcl_DrawOneFrame( OutputDevice* pDev, const Rectangle& rInnerPixel, const String& rTitle, const Color& rColor, sal_Bool bTextBelow, double nPPTX, double nPPTY, const Fraction& rZoomY, ScDocument* pDoc, ScViewData* pButtonViewData, sal_Bool bLayoutRTL ) @@ -185,7 +185,7 @@ void lcl_DrawOneFrame( OutputDevice* pDev, const Rectangle& rInnerPixel, pDev->DrawRect( aOuter ); } -void lcl_DrawScenarioFrames( OutputDevice* pDev, ScViewData* pViewData, ScSplitPos eWhich, +static void lcl_DrawScenarioFrames( OutputDevice* pDev, ScViewData* pViewData, ScSplitPos eWhich, SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2 ) { ScDocument* pDoc = pViewData->GetDocument(); @@ -262,7 +262,7 @@ void lcl_DrawScenarioFrames( OutputDevice* pDev, ScViewData* pViewData, ScSplitP //------------------------------------------------------------------------ -void lcl_DrawHighlight( ScOutputData& rOutputData, ScViewData* pViewData, +static void lcl_DrawHighlight( ScOutputData& rOutputData, ScViewData* pViewData, const std::vector<ScHighlightEntry>& rHighlightRanges ) { SCTAB nTab = pViewData->GetTabNo(); diff --git a/sc/source/ui/view/notemark.cxx b/sc/source/ui/view/notemark.cxx index 233afcd811a7..47677aae231f 100644 --- a/sc/source/ui/view/notemark.cxx +++ b/sc/source/ui/view/notemark.cxx @@ -120,7 +120,7 @@ IMPL_LINK_NOARG(ScNoteMarker, TimeHdl) return 0; } -void lcl_DrawWin( SdrObject* pObject, Window* pWindow, const MapMode& rMap ) +static void lcl_DrawWin( SdrObject* pObject, Window* pWindow, const MapMode& rMap ) { MapMode aOld = pWindow->GetMapMode(); pWindow->SetMapMode( rMap ); @@ -138,7 +138,7 @@ void lcl_DrawWin( SdrObject* pObject, Window* pWindow, const MapMode& rMap ) pWindow->SetMapMode( aOld ); } -MapMode lcl_MoveMapMode( const MapMode& rMap, const Size& rMove ) +static MapMode lcl_MoveMapMode( const MapMode& rMap, const Size& rMove ) { MapMode aNew = rMap; Point aOrigin = aNew.GetOrigin(); diff --git a/sc/source/ui/view/olinewin.cxx b/sc/source/ui/view/olinewin.cxx index 66cc41ec8daf..0fd030a3d9b1 100644 --- a/sc/source/ui/view/olinewin.cxx +++ b/sc/source/ui/view/olinewin.cxx @@ -717,7 +717,7 @@ void ScOutlineWindow::Paint( const Rectangle& /* rRect */ ) /** Increments or decrements a value and wraps at the specified limits. @return true = value wrapped. */ -bool lcl_RotateValue( size_t& rnValue, size_t nMin, size_t nMax, bool bForward ) +static bool lcl_RotateValue( size_t& rnValue, size_t nMin, size_t nMax, bool bForward ) { OSL_ENSURE( nMin <= nMax, "lcl_RotateValue - invalid range" ); OSL_ENSURE( nMax < static_cast< size_t >( -1 ), "lcl_RotateValue - range overflow" ); diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx index 2ae53056f4a5..24b4fca77e41 100644 --- a/sc/source/ui/view/output.cxx +++ b/sc/source/ui/view/output.cxx @@ -33,6 +33,7 @@ #include <editeng/brshitem.hxx> #include <editeng/editdata.hxx> #include <svtools/colorcfg.hxx> +#include "svtools/optionsdrawinglayer.hxx" #include <svx/rotmodit.hxx> #include <editeng/shaditem.hxx> #include <editeng/svxfont.hxx> @@ -650,7 +651,7 @@ void ScOutputData::FindRotated() // ---------------------------------------------------------------------------- -sal_uInt16 lcl_GetRotateDir( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab ) +static sal_uInt16 lcl_GetRotateDir( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab ) { const ScPatternAttr* pPattern = pDoc->GetPattern( nCol, nRow, nTab ); const SfxItemSet* pCondSet = pDoc->GetCondResult( nCol, nRow, nTab ); @@ -683,7 +684,7 @@ sal_uInt16 lcl_GetRotateDir( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTa return nRet; } -const SvxBrushItem* lcl_FindBackground( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab ) +static const SvxBrushItem* lcl_FindBackground( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab ) { const ScPatternAttr* pPattern = pDoc->GetPattern( nCol, nRow, nTab ); const SfxItemSet* pCondSet = pDoc->GetCondResult( nCol, nRow, nTab ); @@ -723,7 +724,7 @@ const SvxBrushItem* lcl_FindBackground( ScDocument* pDoc, SCCOL nCol, SCROW nRow // ---------------------------------------------------------------------------- -sal_Bool lcl_EqualBack( const RowInfo& rFirst, const RowInfo& rOther, +static sal_Bool lcl_EqualBack( const RowInfo& rFirst, const RowInfo& rOther, SCCOL nX1, SCCOL nX2, sal_Bool bShowProt, sal_Bool bPagebreakMode ) { if ( rFirst.bChanged != rOther.bChanged || @@ -1237,10 +1238,7 @@ void ScOutputData::DrawClear() } } - -// -// Linien -// +namespace { long lclGetSnappedX( OutputDevice& rDev, long nPosX, bool bSnapPixel ) { @@ -1257,8 +1255,32 @@ size_t lclGetArrayColFromCellInfoX( sal_uInt16 nCellInfoX, sal_uInt16 nCellInfoF return static_cast< size_t >( bRTL ? (nCellInfoLastX + 2 - nCellInfoX) : (nCellInfoX - nCellInfoFirstX) ); } +/** + * Temporarily turn off antialiasing. + */ +class AntiAliasingSwitch +{ + SvtOptionsDrawinglayer maDrawOpt; + bool mbOldSetting; +public: + AntiAliasingSwitch(bool bOn) : mbOldSetting(maDrawOpt.IsAntiAliasing()) + { + maDrawOpt.SetAntiAliasing(bOn); + } + + ~AntiAliasingSwitch() + { + maDrawOpt.SetAntiAliasing(mbOldSetting); + } +}; + +} + void ScOutputData::DrawFrame() { + // No anti-aliasing for drawing cell borders. + AntiAliasingSwitch aAASwitch(false); + sal_uLong nOldDrawMode = mpDev->GetDrawMode(); Color aSingleColor; @@ -1384,7 +1406,7 @@ void ScOutputData::DrawFrame() // Linie unter der Zelle -const ::editeng::SvxBorderLine* lcl_FindHorLine( ScDocument* pDoc, +static const ::editeng::SvxBorderLine* lcl_FindHorLine( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab, sal_uInt16 nRotDir, sal_Bool bTopLine ) { @@ -1438,7 +1460,7 @@ const ::editeng::SvxBorderLine* lcl_FindHorLine( ScDocument* pDoc, } -long lcl_getRotate( ScDocument* pDoc, SCTAB nTab, SCCOL nX, SCROW nY ) +static long lcl_getRotate( ScDocument* pDoc, SCTAB nTab, SCCOL nX, SCROW nY ) { long nRotate = 0; diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index de84767a1d23..2bf2721a4e3b 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -820,7 +820,7 @@ double ScOutputData::GetStretch() // output strings // -void lcl_DoHyperlinkResult( OutputDevice* pDev, const Rectangle& rRect, ScBaseCell* pCell ) +static void lcl_DoHyperlinkResult( OutputDevice* pDev, const Rectangle& rRect, ScBaseCell* pCell ) { vcl::PDFExtOutDevData* pPDFData = PTR_CAST( vcl::PDFExtOutDevData, pDev->GetExtOutDevData() ); @@ -866,7 +866,7 @@ void ScOutputData::SetSyntaxColor( Font* pFont, ScBaseCell* pCell ) } } -void lcl_SetEditColor( EditEngine& rEngine, const Color& rColor ) +static void lcl_SetEditColor( EditEngine& rEngine, const Color& rColor ) { ESelection aSel( 0, 0, rEngine.GetParagraphCount(), 0 ); SfxItemSet aSet( rEngine.GetEmptyItemSet() ); @@ -1050,7 +1050,7 @@ inline sal_Bool StringDiffer( const ScPatternAttr*& rpOldPattern, const ScPatter } } -inline void lcl_CreateInterpretProgress( sal_Bool& bProgress, ScDocument* pDoc, +static inline void lcl_CreateInterpretProgress( sal_Bool& bProgress, ScDocument* pDoc, ScFormulaCell* pFCell ) { if ( !bProgress && pFCell->GetDirty() ) @@ -2021,7 +2021,7 @@ ScFieldEditEngine* ScOutputData::CreateOutputEditEngine() return pEngine; } -void lcl_ClearEdit( EditEngine& rEngine ) // Text und Attribute +static void lcl_ClearEdit( EditEngine& rEngine ) // Text und Attribute { rEngine.SetUpdateMode( false ); @@ -2033,7 +2033,7 @@ void lcl_ClearEdit( EditEngine& rEngine ) // Text und Attribute SfxItemSet( *rPara.GetPool(), rPara.GetRanges() ) ); } -sal_Bool lcl_SafeIsValue( ScBaseCell* pCell ) +static sal_Bool lcl_SafeIsValue( ScBaseCell* pCell ) { if (!pCell) return false; @@ -2059,7 +2059,7 @@ sal_Bool lcl_SafeIsValue( ScBaseCell* pCell ) return bRet; } -void lcl_ScaleFonts( EditEngine& rEngine, long nPercent ) +static void lcl_ScaleFonts( EditEngine& rEngine, long nPercent ) { sal_Bool bUpdateMode = rEngine.GetUpdateMode(); if ( bUpdateMode ) @@ -2100,7 +2100,7 @@ void lcl_ScaleFonts( EditEngine& rEngine, long nPercent ) rEngine.SetUpdateMode( sal_True ); } -long lcl_GetEditSize( EditEngine& rEngine, sal_Bool bWidth, sal_Bool bSwap, long nAttrRotate ) +static long lcl_GetEditSize( EditEngine& rEngine, sal_Bool bWidth, sal_Bool bSwap, long nAttrRotate ) { if ( bSwap ) bWidth = !bWidth; diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx index 1f0ea75504e7..2b9c870d17ef 100644 --- a/sc/source/ui/view/preview.cxx +++ b/sc/source/ui/view/preview.cxx @@ -74,7 +74,7 @@ #define SC_PREVIEW_SHADOWSIZE 2 -long lcl_GetDisplayStart( SCTAB nTab, ScDocument* pDoc, std::vector<long>& nPages ) +static long lcl_GetDisplayStart( SCTAB nTab, ScDocument* pDoc, std::vector<long>& nPages ) { long nDisplayStart = 0; for (SCTAB i=0; i<nTab; i++) @@ -748,7 +748,7 @@ long ScPreview::GetFirstPage(SCTAB nTabP) } -Size lcl_GetDocPageSize( ScDocument* pDoc, SCTAB nTab ) +static Size lcl_GetDocPageSize( ScDocument* pDoc, SCTAB nTab ) { String aName = pDoc->GetPageStyle( nTab ); ScStyleSheetPool* pStylePool = pDoc->GetStyleSheetPool(); diff --git a/sc/source/ui/view/prevloc.cxx b/sc/source/ui/view/prevloc.cxx index 8fe962cc07aa..83a575fb2d2d 100644 --- a/sc/source/ui/view/prevloc.cxx +++ b/sc/source/ui/view/prevloc.cxx @@ -274,7 +274,7 @@ void ScPreviewLocationData::GetDrawRange( sal_uInt16 nPos, Rectangle& rPixelRect } } -ScPreviewLocationEntry* lcl_GetEntryByAddress( const boost::ptr_list<ScPreviewLocationEntry> &rEntries, +static ScPreviewLocationEntry* lcl_GetEntryByAddress( const boost::ptr_list<ScPreviewLocationEntry> &rEntries, const ScAddress& rPos, ScPreviewLocationType eType ) { boost::ptr_list<ScPreviewLocationEntry>::const_iterator it; diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx index 9e028ded5c4d..c6f7b8a891b2 100644 --- a/sc/source/ui/view/printfun.cxx +++ b/sc/source/ui/view/printfun.cxx @@ -172,7 +172,7 @@ size_t ScPageRowEntry::CountVisible() const //------------------------------------------------------------------------ -long lcl_LineTotal(const ::editeng::SvxBorderLine* pLine) +static long lcl_LineTotal(const ::editeng::SvxBorderLine* pLine) { return pLine ? ( pLine->GetOutWidth() + pLine->GetInWidth() + pLine->GetDistance() ) : 0; } @@ -370,7 +370,7 @@ void ScPrintFunc::SetDrawView( FmFormView* pNew ) pDrawView = pNew; } -void lcl_HidePrint( ScTableInfo& rTabInfo, SCCOL nX1, SCCOL nX2 ) +static void lcl_HidePrint( ScTableInfo& rTabInfo, SCCOL nX1, SCCOL nX2 ) { for (SCSIZE nArrY=1; nArrY+1<rTabInfo.mnArrCount; nArrY++) { @@ -597,7 +597,7 @@ void ScPrintFunc::DrawToDev( ScDocument* pDoc, OutputDevice* pDev, double /* nPr // Drucken // -void lcl_FillHFParam( ScPrintHFParam& rParam, const SfxItemSet* pHFSet ) +static void lcl_FillHFParam( ScPrintHFParam& rParam, const SfxItemSet* pHFSet ) { // nDistance muss vorher unterschiedlich initalisiert sein @@ -1075,7 +1075,7 @@ void ScPrintFunc::SetDateTime( const Date& rDate, const Time& rTime ) aFieldData.aTime = rTime; } -void lcl_DrawGraphic( const Graphic &rGraphic, OutputDevice *pOut, +static void lcl_DrawGraphic( const Graphic &rGraphic, OutputDevice *pOut, const Rectangle &rGrf, const Rectangle &rOut ) { const bool bNotInside = !rOut.IsInside( rGrf ); @@ -1091,7 +1091,7 @@ void lcl_DrawGraphic( const Graphic &rGraphic, OutputDevice *pOut, pOut->Pop(); } -void lcl_DrawGraphic( const SvxBrushItem &rBrush, OutputDevice *pOut, OutputDevice* pRefDev, +static void lcl_DrawGraphic( const SvxBrushItem &rBrush, OutputDevice *pOut, OutputDevice* pRefDev, const Rectangle &rOrg, const Rectangle &rOut ) { Size aGrfSize(0,0); @@ -2911,7 +2911,7 @@ void ScPrintFunc::ResetBreaks( SCTAB nTab ) // Breaks fuer Anzeige richt pDoc->UpdatePageBreaks( nTab, NULL ); } -void lcl_SetHidden( ScDocument* pDoc, SCTAB nPrintTab, ScPageRowEntry& rPageRowEntry, +static void lcl_SetHidden( ScDocument* pDoc, SCTAB nPrintTab, ScPageRowEntry& rPageRowEntry, SCCOL nStartCol, const SCCOL* pPageEndX ) { size_t nPagesX = rPageRowEntry.GetPagesX(); diff --git a/sc/source/ui/view/reffact.cxx b/sc/source/ui/view/reffact.cxx index 746d7b283d0e..dfc2b1deab24 100644 --- a/sc/source/ui/view/reffact.cxx +++ b/sc/source/ui/view/reffact.cxx @@ -44,6 +44,9 @@ SFX_IMPL_MODELESSDIALOG_WITHID(ScNameDlgWrapper, FID_DEFINE_NAME ) SFX_IMPL_MODELESSDIALOG_WITHID(ScNameDefDlgWrapper, FID_ADD_NAME ) +SFX_IMPL_MODELESSDIALOG_WITHID(ScCondFormatConditionDlgWrapper, SID_OPENDLG_CONDFRMT ) +SFX_IMPL_MODELESSDIALOG_WITHID(ScCondFormatColorScaleDlgWrapper, SID_OPENDLG_COLORSCALE ) +SFX_IMPL_MODELESSDIALOG_WITHID(ScCondFormatDataBarDlgWrapper, SID_OPENDLG_DATABAR ) SFX_IMPL_MODELESSDIALOG_WITHID(ScSolverDlgWrapper, SID_OPENDLG_SOLVE ) SFX_IMPL_MODELESSDIALOG_WITHID(ScOptSolverDlgWrapper, SID_OPENDLG_OPTSOLVER ) SFX_IMPL_MODELESSDIALOG_WITHID(ScPivotLayoutWrapper, SID_OPENDLG_PIVOTTABLE ) @@ -116,6 +119,24 @@ IMPL_CHILD_CTOR( ScNameDlgWrapper, FID_DEFINE_NAME ) IMPL_CHILD_CTOR( ScNameDefDlgWrapper, FID_ADD_NAME ) //------------------------------------------------------------------------- +// ScCondFormatConditionDlgWrapper +//------------------------------------------------------------------------- + +IMPL_CHILD_CTOR( ScCondFormatConditionDlgWrapper, SID_OPENDLG_CONDFRMT ) + +//------------------------------------------------------------------------- +// ScCondFormatColorScaleDlgWrapper +//------------------------------------------------------------------------- + +IMPL_CHILD_CTOR( ScCondFormatColorScaleDlgWrapper, SID_OPENDLG_COLORSCALE ) + +//------------------------------------------------------------------------- +// ScCondFormatDataBarDlgWrapper +//------------------------------------------------------------------------- + +IMPL_CHILD_CTOR( ScCondFormatDataBarDlgWrapper, SID_OPENDLG_DATABAR ) + +//------------------------------------------------------------------------- // ScSolverDlgWrapper //------------------------------------------------------------------------- diff --git a/sc/source/ui/view/tabcont.cxx b/sc/source/ui/view/tabcont.cxx index f086ad693f6e..c195e6092730 100644 --- a/sc/source/ui/view/tabcont.cxx +++ b/sc/source/ui/view/tabcont.cxx @@ -176,7 +176,8 @@ void ScTabControl::MouseButtonUp( const MouseEvent& rMEvt ) { // Insert a new sheet at the right end, with default name. ScDocument* pDoc = pViewData->GetDocument(); - if (!pDoc->IsDocEditable()) + ScModule* pScMod = SC_MOD(); + if (!pDoc->IsDocEditable() || pScMod->IsTableLocked()) return; rtl::OUString aName; pDoc->CreateValidTabName(aName); @@ -467,7 +468,7 @@ void ScTabControl::DoDrag( const Region& /* rRegion */ ) pTransferObj->StartDrag( pWindow, DND_ACTION_COPYMOVE | DND_ACTION_LINK ); } -sal_uInt16 lcl_DocShellNr( ScDocument* pDoc ) +static sal_uInt16 lcl_DocShellNr( ScDocument* pDoc ) { sal_uInt16 nShellCnt = 0; SfxObjectShell* pShell = SfxObjectShell::GetFirst(); diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index 4322cc9111cf..a9e85e368595 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -208,7 +208,7 @@ void ScCornerButton::MouseButtonDown( const MouseEvent& rMEvt ) //================================================================== -bool lcl_HasColOutline( const ScViewData& rViewData ) +static bool lcl_HasColOutline( const ScViewData& rViewData ) { const ScOutlineTable* pTable = rViewData.GetDocument()->GetOutlineTable(rViewData.GetTabNo()); if (pTable) @@ -220,7 +220,7 @@ bool lcl_HasColOutline( const ScViewData& rViewData ) return false; } -bool lcl_HasRowOutline( const ScViewData& rViewData ) +static bool lcl_HasRowOutline( const ScViewData& rViewData ) { const ScOutlineTable* pTable = rViewData.GetDocument()->GetOutlineTable(rViewData.GetTabNo()); if (pTable) @@ -309,7 +309,7 @@ IMPL_LINK_NOARG(ScTabView, TimerHdl) // --- Resize --------------------------------------------------------------------- -void lcl_SetPosSize( Window& rWindow, const Point& rPos, const Size& rSize, +static void lcl_SetPosSize( Window& rWindow, const Point& rPos, const Size& rSize, long nTotalWidth, bool bLayoutRTL ) { Point aNewPos = rPos; @@ -1400,7 +1400,7 @@ void ScTabView::ScrollLines( long nDeltaX, long nDeltaY ) ScrollY(nDeltaY,WhichV(eWhich)); } -SCROW lcl_LastVisible( ScViewData& rViewData ) +static SCROW lcl_LastVisible( ScViewData& rViewData ) { // wenn am Dokumentende viele Zeilen ausgeblendet sind (welcher Trottel macht sowas?), // soll dadurch nicht auf breite Zeilenkoepfe geschaltet werden @@ -1983,7 +1983,7 @@ Point ScTabView::GetMousePosPixel() return aPos; } -sal_Bool lcl_MouseIsOverWin( const Point& rScreenPosPixel, Window* pWin ) +static sal_Bool lcl_MouseIsOverWin( const Point& rScreenPosPixel, Window* pWin ) { if (pWin) { diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx index e8f3fa5e137d..756661c84fc2 100644 --- a/sc/source/ui/view/tabview2.cxx +++ b/sc/source/ui/view/tabview2.cxx @@ -1067,7 +1067,7 @@ void ScTabView::DeselectAllTables() rBind.Invalidate( FID_TAB_DESELECTALL ); } -bool lcl_FitsInWindow( double fScaleX, double fScaleY, sal_uInt16 nZoom, +static bool lcl_FitsInWindow( double fScaleX, double fScaleY, sal_uInt16 nZoom, long nWindowX, long nWindowY, ScDocument* pDoc, SCTAB nTab, SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCCOL nFixPosX, SCROW nFixPosY ) diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index ba93fea23743..f31cddc3a6b3 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -666,7 +666,7 @@ void ScTabView::RemoveHintWindow() // find window that should not be over the cursor -Window* lcl_GetCareWin(SfxViewFrame* pViewFrm) +static Window* lcl_GetCareWin(SfxViewFrame* pViewFrm) { //! auch Spelling ??? (dann beim Aufruf Membervariable setzen) diff --git a/sc/source/ui/view/tabview4.cxx b/sc/source/ui/view/tabview4.cxx index fe36239421c0..342880ac1ea9 100644 --- a/sc/source/ui/view/tabview4.cxx +++ b/sc/source/ui/view/tabview4.cxx @@ -358,7 +358,7 @@ long ScTabView::GetScrollBarPos( ScrollBar& rScroll, bool bLayoutRTL ) // UpdateScrollBars - sichtbaren Bereich und Scrollweite der Scrollbars einstellen -long lcl_UpdateBar( ScrollBar& rScroll, SCCOLROW nSize ) // Size = (komplette) Zellen +static long lcl_UpdateBar( ScrollBar& rScroll, SCCOLROW nSize ) // Size = (komplette) Zellen { long nOldPos; long nNewPos; @@ -373,7 +373,7 @@ long lcl_UpdateBar( ScrollBar& rScroll, SCCOLROW nSize ) // Size = (kompl return nNewPos - nOldPos; } -long lcl_GetScrollRange( SCCOLROW nDocEnd, SCCOLROW nPos, SCCOLROW nVis, SCCOLROW nMax, SCCOLROW nStart ) +static long lcl_GetScrollRange( SCCOLROW nDocEnd, SCCOLROW nPos, SCCOLROW nVis, SCCOLROW nMax, SCCOLROW nStart ) { // get the end (positive) of a scroll bar range that always starts at 0 diff --git a/sc/source/ui/view/tabvwsh.cxx b/sc/source/ui/view/tabvwsh.cxx index 6c976cb6e6ec..06f6dd45162d 100644 --- a/sc/source/ui/view/tabvwsh.cxx +++ b/sc/source/ui/view/tabvwsh.cxx @@ -35,6 +35,7 @@ #include <sfx2/viewfrm.hxx> #include <sfx2/bindings.hxx> #include <sfx2/app.hxx> +#include <sfx2/infobar.hxx> #include "tabvwsh.hxx" #include "docsh.hxx" @@ -59,10 +60,14 @@ SFX_IMPL_INTERFACE(ScTabViewShell,SfxViewShell,ScResId(SCSTR_TABVIEWSHELL)) SFX_CHILDWINDOW_REGISTRATION(FID_INPUTLINE_STATUS); SFX_CHILDWINDOW_REGISTRATION(SfxTemplateDialogWrapper::GetChildWindowId()); + SFX_CHILDWINDOW_REGISTRATION(SfxInfoBarContainerChild::GetChildWindowId()); SFX_CHILDWINDOW_CONTEXT_REGISTRATION(SID_NAVIGATOR); SFX_CHILDWINDOW_REGISTRATION(SID_TASKPANE); SFX_CHILDWINDOW_REGISTRATION(ScNameDlgWrapper::GetChildWindowId()); SFX_CHILDWINDOW_REGISTRATION(ScNameDefDlgWrapper::GetChildWindowId()); + SFX_CHILDWINDOW_REGISTRATION(ScCondFormatConditionDlgWrapper::GetChildWindowId()); + SFX_CHILDWINDOW_REGISTRATION(ScCondFormatColorScaleDlgWrapper::GetChildWindowId()); + SFX_CHILDWINDOW_REGISTRATION(ScCondFormatDataBarDlgWrapper::GetChildWindowId()); SFX_CHILDWINDOW_REGISTRATION(ScSolverDlgWrapper::GetChildWindowId()); SFX_CHILDWINDOW_REGISTRATION(ScOptSolverDlgWrapper::GetChildWindowId()); SFX_CHILDWINDOW_REGISTRATION(ScPivotLayoutWrapper::GetChildWindowId()); diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx index 224b2cf4f168..bc0b088181e6 100644 --- a/sc/source/ui/view/tabvwsh3.cxx +++ b/sc/source/ui/view/tabvwsh3.cxx @@ -83,7 +83,7 @@ using ::std::auto_ptr; /** Try to parse the given range using Calc-style syntax first, then Excel-style if that fails. */ -sal_uInt16 lcl_ParseRange(ScRange& rScRange, const String& aAddress, ScDocument* pDoc, sal_uInt16 /* nSlot */) +static sal_uInt16 lcl_ParseRange(ScRange& rScRange, const String& aAddress, ScDocument* pDoc, sal_uInt16 /* nSlot */) { sal_uInt16 nResult = rScRange.Parse(aAddress, pDoc); if ( (nResult & SCA_VALID) ) @@ -94,7 +94,7 @@ sal_uInt16 lcl_ParseRange(ScRange& rScRange, const String& aAddress, ScDocument* /** Try to parse the given address using Calc-style syntax first, then Excel-style if that fails. */ -sal_uInt16 lcl_ParseAddress(ScAddress& rScAddress, const String& aAddress, ScDocument* pDoc, sal_uInt16 /* nSlot */) +static sal_uInt16 lcl_ParseAddress(ScAddress& rScAddress, const String& aAddress, ScDocument* pDoc, sal_uInt16 /* nSlot */) { sal_uInt16 nResult = rScAddress.Parse(aAddress, pDoc); if ( (nResult & SCA_VALID) ) diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx index 7afb032060b8..595a93f319f0 100644 --- a/sc/source/ui/view/tabvwsh4.cxx +++ b/sc/source/ui/view/tabvwsh4.cxx @@ -1139,7 +1139,7 @@ IMPL_LINK_NOARG(ScTabViewShell, SimpleRefClose) // handlers to call UNO listeners: -ScTabViewObj* lcl_GetViewObj( ScTabViewShell& rShell ) +static ScTabViewObj* lcl_GetViewObj( ScTabViewShell& rShell ) { ScTabViewObj* pRet = NULL; SfxViewFrame* pViewFrame = rShell.GetViewFrame(); diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx index a92fca945f8b..6ef470ac9d23 100644 --- a/sc/source/ui/view/tabvwshc.cxx +++ b/sc/source/ui/view/tabvwshc.cxx @@ -63,6 +63,7 @@ #include "dpobject.hxx" #include "markdata.hxx" #include "reffact.hxx" +#include "condformatdlg.hxx" //------------------------------------------------------------------ @@ -180,6 +181,58 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog( } break; + case SID_OPENDLG_CONDFRMT: + case SID_OPENDLG_COLORSCALE: + case SID_OPENDLG_DATABAR: + { + ScRangeList aRangeList; + ScViewData* pData = GetViewData(); + pData->GetMarkData().FillRangeListWithMarks(&aRangeList, false); + + if(pDoc->IsTabProtected(pData->GetTabNo())) + { + ErrorMessage( STR_ERR_CONDFORMAT_PROTECTED ); + break; + } + + ScAddress aPos(pData->GetCurX(), pData->GetCurY(), pData->GetTabNo()); + if(aRangeList.empty()) + { + ScRange* pRange = new ScRange(aPos); + aRangeList.push_back(pRange); + } + + const ScConditionalFormat* pCondFormat = pDoc->GetCondFormat(aPos.Col(), aPos.Row(), aPos.Tab()); + if(pCondFormat) + { + const ScRangeList& rCondFormatRange = pCondFormat->GetRange(); + if(rCondFormatRange == aRangeList) + pResult = new ScCondFormatDlg( pB, pCW, pParent, pDoc, NULL, rCondFormatRange, aPos, condformat::dialog::NONE ); + } + + if(!pResult) + { + condformat::dialog::ScCondFormatDialogType eType = condformat::dialog::NONE; + switch(nSlotId) + { + case SID_OPENDLG_CONDFRMT: + eType = condformat::dialog::CONDITION; + break; + case SID_OPENDLG_COLORSCALE: + eType = condformat::dialog::COLORSCALE; + break; + case SID_OPENDLG_DATABAR: + eType = condformat::dialog::DATABAR; + break; + default: + break; + } + pResult = new ScCondFormatDlg( pB, pCW, pParent, pDoc, NULL, aRangeList, aRangeList.GetTopLeftCorner(), eType ); + } + } + + break; + case SID_DEFINE_COLROWNAMERANGES: { pResult = new ScColRowNameRangesDlg( pB, pCW, pParent, GetViewData() ); diff --git a/sc/source/ui/view/tabvwshe.cxx b/sc/source/ui/view/tabvwshe.cxx index 642e999a9f83..101a956e5895 100644 --- a/sc/source/ui/view/tabvwshe.cxx +++ b/sc/source/ui/view/tabvwshe.cxx @@ -169,7 +169,7 @@ void ScTabViewShell::InsertURL( const String& rName, const String& rURL, const S // wenn CLOOKs: -> mit <editview.hxx> <flditem.hxx>in neue tabvwsh -void lcl_SelectFieldAfterInsert( EditView& rView ) +static void lcl_SelectFieldAfterInsert( EditView& rView ) { ESelection aSel = rView.GetSelection(); if ( aSel.nStartPos == aSel.nEndPos && aSel.nStartPos > 0 ) diff --git a/sc/source/ui/view/tabvwshh.cxx b/sc/source/ui/view/tabvwshh.cxx index 199a9db69d4b..1f13aa07e68a 100644 --- a/sc/source/ui/view/tabvwshh.cxx +++ b/sc/source/ui/view/tabvwshh.cxx @@ -154,7 +154,7 @@ void ScTabViewShell::ExecuteObject( SfxRequest& rReq ) } } -uno::Reference < embed::XEmbeddedObject > lcl_GetSelectedObj( SdrView* pDrView ) //! Member von ScDrawView? +static uno::Reference < embed::XEmbeddedObject > lcl_GetSelectedObj( SdrView* pDrView ) //! Member von ScDrawView? { uno::Reference < embed::XEmbeddedObject > xRet; if (pDrView) diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx index a98936b3978d..cedb1aeb2f2c 100644 --- a/sc/source/ui/view/viewfun2.cxx +++ b/sc/source/ui/view/viewfun2.cxx @@ -218,7 +218,7 @@ enum ScAutoSum }; -ScAutoSum lcl_IsAutoSumData( ScDocument* pDoc, SCCOL nCol, SCROW nRow, +static ScAutoSum lcl_IsAutoSumData( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab, ScDirection eDir, SCCOLROW& nExtend ) { ScBaseCell* pCell; @@ -245,7 +245,7 @@ ScAutoSum lcl_IsAutoSumData( ScDocument* pDoc, SCCOL nCol, SCROW nRow, #define SC_AUTOSUM_MAXCOUNT 20 -ScAutoSum lcl_SeekAutoSumData( ScDocument* pDoc, SCCOL& nCol, SCROW& nRow, +static ScAutoSum lcl_SeekAutoSumData( ScDocument* pDoc, SCCOL& nCol, SCROW& nRow, SCTAB nTab, ScDirection eDir, SCCOLROW& nExtend ) { sal_uInt16 nCount = 0; @@ -278,7 +278,7 @@ ScAutoSum lcl_SeekAutoSumData( ScDocument* pDoc, SCCOL& nCol, SCROW& nRow, //---------------------------------------------------------------------------- -bool lcl_FindNextSumEntryInColumn( ScDocument* pDoc, SCCOL nCol, SCROW& nRow, +static bool lcl_FindNextSumEntryInColumn( ScDocument* pDoc, SCCOL nCol, SCROW& nRow, SCTAB nTab, SCCOLROW& nExtend, SCROW nMinRow ) { const SCROW nTmp = nRow; @@ -297,7 +297,7 @@ bool lcl_FindNextSumEntryInColumn( ScDocument* pDoc, SCCOL nCol, SCROW& nRow, //---------------------------------------------------------------------------- -bool lcl_FindNextSumEntryInRow( ScDocument* pDoc, SCCOL& nCol, SCROW nRow, +static bool lcl_FindNextSumEntryInRow( ScDocument* pDoc, SCCOL& nCol, SCROW nRow, SCTAB nTab, SCCOLROW& nExtend, SCROW nMinCol ) { const SCCOL nTmp = nCol; @@ -316,7 +316,7 @@ bool lcl_FindNextSumEntryInRow( ScDocument* pDoc, SCCOL& nCol, SCROW nRow, //---------------------------------------------------------------------------- -bool lcl_GetAutoSumForColumnRange( ScDocument* pDoc, ScRangeList& rRangeList, const ScRange& rRange ) +static bool lcl_GetAutoSumForColumnRange( ScDocument* pDoc, ScRangeList& rRangeList, const ScRange& rRange ) { const ScAddress aStart = rRange.aStart; const ScAddress aEnd = rRange.aEnd; @@ -360,7 +360,7 @@ bool lcl_GetAutoSumForColumnRange( ScDocument* pDoc, ScRangeList& rRangeList, co //---------------------------------------------------------------------------- -bool lcl_GetAutoSumForRowRange( ScDocument* pDoc, ScRangeList& rRangeList, const ScRange& rRange ) +static bool lcl_GetAutoSumForRowRange( ScDocument* pDoc, ScRangeList& rRangeList, const ScRange& rRange ) { const ScAddress aStart = rRange.aStart; const ScAddress aEnd = rRange.aEnd; diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx index 5def6996cc0c..08c7625a2dcd 100644 --- a/sc/source/ui/view/viewfun3.cxx +++ b/sc/source/ui/view/viewfun3.cxx @@ -783,7 +783,7 @@ sal_Bool ScViewFunc::PasteOnDrawObject( const uno::Reference<datatransfer::XTran return bRet; } -sal_Bool lcl_SelHasAttrib( ScDocument* pDoc, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, +static sal_Bool lcl_SelHasAttrib( ScDocument* pDoc, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, const ScMarkData& rTabSelection, sal_uInt16 nMask ) { ScMarkData::const_iterator itr = rTabSelection.begin(), itrEnd = rTabSelection.end(); diff --git a/sc/source/ui/view/viewfun7.cxx b/sc/source/ui/view/viewfun7.cxx index 415e7a2885a9..ebf357328fae 100644 --- a/sc/source/ui/view/viewfun7.cxx +++ b/sc/source/ui/view/viewfun7.cxx @@ -67,7 +67,7 @@ using namespace com::sun::star; //================================================================== -void lcl_AdjustInsertPos( ScViewData* pData, Point& rPos, Size& rSize ) +static void lcl_AdjustInsertPos( ScViewData* pData, Point& rPos, Size& rSize ) { SdrPage* pPage = pData->GetScDrawView()->GetModel()->GetPage( static_cast<sal_uInt16>(pData->GetTabNo()) ); OSL_ENSURE(pPage,"pPage ???"); diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index f999b52d1a1e..8b13ebd501d2 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -280,7 +280,7 @@ sal_Bool ScViewFunc::SelectionEditable( bool* pOnlyNotBecauseOfMatrix /* = NULL #define LRU_MAX 10 #endif -sal_Bool lcl_FunctionKnown( sal_uInt16 nOpCode ) +static sal_Bool lcl_FunctionKnown( sal_uInt16 nOpCode ) { const ScFunctionList* pFuncList = ScGlobal::GetStarCalcFunctionList(); if ( pFuncList ) @@ -293,7 +293,7 @@ sal_Bool lcl_FunctionKnown( sal_uInt16 nOpCode ) return false; } -sal_Bool lcl_AddFunction( ScAppOptions& rAppOpt, sal_uInt16 nOpCode ) +static sal_Bool lcl_AddFunction( ScAppOptions& rAppOpt, sal_uInt16 nOpCode ) { sal_uInt16 nOldCount = rAppOpt.GetLRUFuncListCount(); sal_uInt16* pOldList = rAppOpt.GetLRUFuncList(); @@ -2724,9 +2724,8 @@ void ScViewFunc::ChangeNumFmtDecimals( sal_Bool bIncrement ) if (!bError) { - String aNewPicture; - pFormatter->GenerateFormat( aNewPicture, nOldFormat, eLanguage, - bThousand, bNegRed, nPrecision, nLeading ); + String aNewPicture = pFormatter->GenerateFormat(nOldFormat, eLanguage, + bThousand, bNegRed, nPrecision, nLeading); nNewFormat = pFormatter->GetEntryKey( aNewPicture, eLanguage ); if ( nNewFormat == NUMBERFORMAT_ENTRY_NOT_FOUND ) diff --git a/sc/uiconfig/scalc/menubar/menubar.xml b/sc/uiconfig/scalc/menubar/menubar.xml index 0bff97cd0f7e..621586ea85e1 100644 --- a/sc/uiconfig/scalc/menubar/menubar.xml +++ b/sc/uiconfig/scalc/menubar/menubar.xml @@ -277,6 +277,8 @@ <menu:menu menu:id=".uno:ConditionalFormatMenu"> <menu:menupopup> <menu:menuitem menu:id=".uno:ConditionalFormatDialog"/> + <menu:menuitem menu:id=".uno:ColorScaleFormatDialog"/> + <menu:menuitem menu:id=".uno:DataBarFormatDialog"/> <menu:menuseparator/> <menu:menuitem menu:id=".uno:ConditionalFormatManagerDialog"/> </menu:menupopup> |