diff options
1094 files changed, 12054 insertions, 1284 deletions
diff --git a/chart2/inc/pch/precompiled_chart2.cxx b/chart2/inc/pch/precompiled_chart2.cxx index a1ea4db5fe99..d1c378632c2a 100644 --- a/chart2/inc/pch/precompiled_chart2.cxx +++ b/chart2/inc/pch/precompiled_chart2.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -27,3 +28,4 @@ #include "precompiled_chart2.hxx" +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/accessibility/AccStatisticsObject.cxx b/chart2/source/controller/accessibility/AccStatisticsObject.cxx index 9028973936e0..a248266874fc 100644 --- a/chart2/source/controller/accessibility/AccStatisticsObject.cxx +++ b/chart2/source/controller/accessibility/AccStatisticsObject.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -79,3 +80,5 @@ OUString SAL_CALL AccStatisticsObject::getImplementationName() } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/accessibility/AccessibleBase.cxx b/chart2/source/controller/accessibility/AccessibleBase.cxx index 00335eab296e..fa09ec3ca0d0 100644 --- a/chart2/source/controller/accessibility/AccessibleBase.cxx +++ b/chart2/source/controller/accessibility/AccessibleBase.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1008,3 +1009,5 @@ void SAL_CALL AccessibleBase::removeEventListener( const Reference< XAccessibleE } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/accessibility/AccessibleChartElement.cxx b/chart2/source/controller/accessibility/AccessibleChartElement.cxx index 46be54473fd8..99e6fd60e83d 100644 --- a/chart2/source/controller/accessibility/AccessibleChartElement.cxx +++ b/chart2/source/controller/accessibility/AccessibleChartElement.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -313,3 +314,5 @@ sal_Int32 SAL_CALL AccessibleChartElement::getBackground() } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/accessibility/AccessibleChartShape.cxx b/chart2/source/controller/accessibility/AccessibleChartShape.cxx index bbf6176641da..41567440e835 100644 --- a/chart2/source/controller/accessibility/AccessibleChartShape.cxx +++ b/chart2/source/controller/accessibility/AccessibleChartShape.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -287,3 +288,5 @@ Reference< awt::XFont > AccessibleChartShape::getFont() } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/accessibility/AccessibleChartView.cxx b/chart2/source/controller/accessibility/AccessibleChartView.cxx index 4833991ad7cc..9fae22226cb5 100644 --- a/chart2/source/controller/accessibility/AccessibleChartView.cxx +++ b/chart2/source/controller/accessibility/AccessibleChartView.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -414,3 +415,5 @@ void SAL_CALL AccessibleChartView::disposing( const lang::EventObject& /*Source* //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/accessibility/AccessibleTextHelper.cxx b/chart2/source/controller/accessibility/AccessibleTextHelper.cxx index 0ba078e82886..2f3d732a06ae 100644 --- a/chart2/source/controller/accessibility/AccessibleTextHelper.cxx +++ b/chart2/source/controller/accessibility/AccessibleTextHelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -201,3 +202,5 @@ lang::Locale SAL_CALL AccessibleTextHelper::getLocale() } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/accessibility/AccessibleViewForwarder.cxx b/chart2/source/controller/accessibility/AccessibleViewForwarder.cxx index 5014198761f8..38108fced14b 100644 --- a/chart2/source/controller/accessibility/AccessibleViewForwarder.cxx +++ b/chart2/source/controller/accessibility/AccessibleViewForwarder.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -114,3 +115,5 @@ Size AccessibleViewForwarder::PixelToLogic( const Size& rSize ) const } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/accessibility/ChartElementFactory.cxx b/chart2/source/controller/accessibility/ChartElementFactory.cxx index b2599fec0c74..8c53795c12bd 100644 --- a/chart2/source/controller/accessibility/ChartElementFactory.cxx +++ b/chart2/source/controller/accessibility/ChartElementFactory.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -143,3 +144,5 @@ AccessibleBase* ChartElementFactory::CreateChartElement( const AccessibleElement } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/chartapiwrapper/AreaWrapper.cxx b/chart2/source/controller/chartapiwrapper/AreaWrapper.cxx index 2e1636b4406b..853fc6e0a5d0 100644 --- a/chart2/source/controller/chartapiwrapper/AreaWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/AreaWrapper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -205,3 +206,5 @@ APPHELPER_XSERVICEINFO_IMPL( AreaWrapper, lcl_aServiceName ); } // namespace wrapper } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx b/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx index 6d53fb8b01f6..091287a70e91 100644 --- a/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -594,3 +595,5 @@ APPHELPER_XSERVICEINFO_IMPL( AxisWrapper, lcl_aServiceName ); } // namespace wrapper } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx b/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx index 1b0d8fb4889c..8814be1dc7bd 100644 --- a/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx +++ b/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -317,3 +318,5 @@ awt::Point Chart2ModelContact::GetAxisPosition( const uno::Reference< } // namespace wrapper } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx index 062dcc1a129d..92f7d5ab3db3 100644 --- a/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/ChartDataWrapper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -631,3 +632,5 @@ APPHELPER_XSERVICEINFO_IMPL( ChartDataWrapper, lcl_aServiceName ); } // namespace wrapper } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx index d6487d425657..828cca5cdec8 100644 --- a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1621,3 +1622,5 @@ APPHELPER_XSERVICEINFO_IMPL( ChartDocumentWrapper, CHART_CHARTAPIWRAPPER_IMPLEME } // namespace wrapper } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx index d69212512ebe..6c4841489947 100644 --- a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -885,3 +886,5 @@ APPHELPER_XSERVICEINFO_IMPL( DataSeriesPointWrapper, lcl_aServiceName ); } // namespace wrapper } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx index c0be0ddcbf0d..b7a4717636a3 100644 --- a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -2146,3 +2147,5 @@ APPHELPER_XSERVICEINFO_IMPL( DiagramWrapper, lcl_aServiceName ); } // namespace wrapper } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/chartapiwrapper/GridWrapper.cxx b/chart2/source/controller/chartapiwrapper/GridWrapper.cxx index ff36c4cebcc7..a3dd61f3670b 100644 --- a/chart2/source/controller/chartapiwrapper/GridWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/GridWrapper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -209,3 +210,5 @@ APPHELPER_XSERVICEINFO_IMPL( GridWrapper, lcl_aServiceName ); } // namespace wrapper } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/chartapiwrapper/LegendWrapper.cxx b/chart2/source/controller/chartapiwrapper/LegendWrapper.cxx index 02ffcb942c99..e78b23a4bb0f 100644 --- a/chart2/source/controller/chartapiwrapper/LegendWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/LegendWrapper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -457,3 +458,5 @@ APPHELPER_XSERVICEINFO_IMPL( LegendWrapper, lcl_aServiceName ); } // namespace wrapper } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.cxx b/chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.cxx index fdfc7c094aaf..e468160edc8a 100644 --- a/chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/MinMaxLineWrapper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -433,3 +434,5 @@ APPHELPER_XSERVICEINFO_IMPL( MinMaxLineWrapper, lcl_aServiceName ); } // namespace wrapper } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx b/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx index 20785faa8b66..654cadbf5c97 100644 --- a/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/TitleWrapper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -564,3 +565,5 @@ APPHELPER_XSERVICEINFO_IMPL( TitleWrapper, lcl_aServiceName ); } // namespace wrapper } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx b/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx index 86c36ad1fb1b..ea66d775c7cc 100644 --- a/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/UpDownBarWrapper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -399,3 +400,5 @@ APPHELPER_XSERVICEINFO_IMPL( UpDownBarWrapper, lcl_aServiceName ); } // namespace wrapper } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/chartapiwrapper/WallFloorWrapper.cxx b/chart2/source/controller/chartapiwrapper/WallFloorWrapper.cxx index a43bc610fc0c..3636ced033f8 100644 --- a/chart2/source/controller/chartapiwrapper/WallFloorWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/WallFloorWrapper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -190,3 +191,5 @@ APPHELPER_XSERVICEINFO_IMPL( WallFloorWrapper, lcl_aServiceName ); } // namespace wrapper } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/chartapiwrapper/WrappedAddInProperty.cxx b/chart2/source/controller/chartapiwrapper/WrappedAddInProperty.cxx index 8315a22d8ab4..be6b924d21a9 100644 --- a/chart2/source/controller/chartapiwrapper/WrappedAddInProperty.cxx +++ b/chart2/source/controller/chartapiwrapper/WrappedAddInProperty.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -156,3 +157,5 @@ Any WrappedRefreshAddInAllowedProperty::getPropertyValue( const Reference< beans //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/chartapiwrapper/WrappedAutomaticPositionProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedAutomaticPositionProperties.cxx index 15ae48bc22dd..01b812475d59 100644 --- a/chart2/source/controller/chartapiwrapper/WrappedAutomaticPositionProperties.cxx +++ b/chart2/source/controller/chartapiwrapper/WrappedAutomaticPositionProperties.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -154,3 +155,5 @@ void WrappedAutomaticPositionProperties::addWrappedProperties( std::vector< Wrap } //namespace wrapper } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/chartapiwrapper/WrappedAxisAndGridExistenceProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedAxisAndGridExistenceProperties.cxx index 0c4a98263a04..9e663863a26d 100644 --- a/chart2/source/controller/chartapiwrapper/WrappedAxisAndGridExistenceProperties.cxx +++ b/chart2/source/controller/chartapiwrapper/WrappedAxisAndGridExistenceProperties.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -446,3 +447,5 @@ Any WrappedAxisLabelExistenceProperty::getPropertyDefault( const Reference< bean } //namespace wrapper } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/chartapiwrapper/WrappedCharacterHeightProperty.cxx b/chart2/source/controller/chartapiwrapper/WrappedCharacterHeightProperty.cxx index 5fca42c2b3ad..ebf2885c9702 100644 --- a/chart2/source/controller/chartapiwrapper/WrappedCharacterHeightProperty.cxx +++ b/chart2/source/controller/chartapiwrapper/WrappedCharacterHeightProperty.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -170,3 +171,5 @@ WrappedComplexCharacterHeightProperty::~WrappedComplexCharacterHeightProperty() } //namespace wrapper } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/chartapiwrapper/WrappedDataCaptionProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedDataCaptionProperties.cxx index bc91136590cb..d2c9393edb72 100644 --- a/chart2/source/controller/chartapiwrapper/WrappedDataCaptionProperties.cxx +++ b/chart2/source/controller/chartapiwrapper/WrappedDataCaptionProperties.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -191,3 +192,5 @@ void WrappedDataCaptionProperty::setValueToSeries( const Reference< beans::XProp } //namespace wrapper } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/chartapiwrapper/WrappedGapwidthProperty.cxx b/chart2/source/controller/chartapiwrapper/WrappedGapwidthProperty.cxx index a5dc9b23feed..0213f928daf1 100644 --- a/chart2/source/controller/chartapiwrapper/WrappedGapwidthProperty.cxx +++ b/chart2/source/controller/chartapiwrapper/WrappedGapwidthProperty.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -199,3 +200,5 @@ WrappedBarOverlapProperty::~WrappedBarOverlapProperty() } // namespace wrapper } // namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.cxx b/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.cxx index 7a8d1554df7d..e07c0176eced 100644 --- a/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.cxx +++ b/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -197,3 +198,5 @@ Any WrappedLinkNumberFormatProperty::getPropertyDefault( const Reference< beans: } //namespace wrapper } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx b/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx index b0fc030d0fbf..34a56497c55b 100644 --- a/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx +++ b/chart2/source/controller/chartapiwrapper/WrappedScaleProperty.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -509,3 +510,5 @@ Any WrappedScaleProperty::getPropertyValue( tScaleProperty eScaleProperty, const } // namespace wrapper } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/chartapiwrapper/WrappedScaleTextProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedScaleTextProperties.cxx index 5e11a3012cf3..f64d72e2e0b9 100644 --- a/chart2/source/controller/chartapiwrapper/WrappedScaleTextProperties.cxx +++ b/chart2/source/controller/chartapiwrapper/WrappedScaleTextProperties.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -165,3 +166,5 @@ void WrappedScaleTextProperties::addWrappedProperties( std::vector< WrappedPrope } //namespace wrapper } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/chartapiwrapper/WrappedSceneProperty.cxx b/chart2/source/controller/chartapiwrapper/WrappedSceneProperty.cxx index 68d408ea7147..18bec7594174 100644 --- a/chart2/source/controller/chartapiwrapper/WrappedSceneProperty.cxx +++ b/chart2/source/controller/chartapiwrapper/WrappedSceneProperty.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -129,3 +130,5 @@ Any WrappedD3DTransformMatrixProperty::getPropertyDefault( const Reference< bean } //namespace wrapper } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/chartapiwrapper/WrappedSeriesAreaOrLineProperty.cxx b/chart2/source/controller/chartapiwrapper/WrappedSeriesAreaOrLineProperty.cxx index 6124e2baf506..0a5a9b4890e1 100644 --- a/chart2/source/controller/chartapiwrapper/WrappedSeriesAreaOrLineProperty.cxx +++ b/chart2/source/controller/chartapiwrapper/WrappedSeriesAreaOrLineProperty.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -68,3 +69,5 @@ WrappedSeriesAreaOrLineProperty::~WrappedSeriesAreaOrLineProperty() } //namespace wrapper } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/chartapiwrapper/WrappedSplineProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedSplineProperties.cxx index ebc3fd358c0d..26da2212720d 100644 --- a/chart2/source/controller/chartapiwrapper/WrappedSplineProperties.cxx +++ b/chart2/source/controller/chartapiwrapper/WrappedSplineProperties.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -285,3 +286,5 @@ Any WrappedSplineTypeProperty::convertOuterToInnerValue( const Any& rOuterValue } //namespace wrapper } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx index 1c7b495bd566..6b8d8d4bbe4c 100644 --- a/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx +++ b/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1152,3 +1153,5 @@ void WrappedStatisticProperties::addWrappedPropertiesForDiagram( std::vector< Wr } //namespace wrapper } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/chartapiwrapper/WrappedStockProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedStockProperties.cxx index 3ecb23ce84d2..5e0f9d102064 100644 --- a/chart2/source/controller/chartapiwrapper/WrappedStockProperties.cxx +++ b/chart2/source/controller/chartapiwrapper/WrappedStockProperties.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -328,3 +329,5 @@ void WrappedStockProperties::addWrappedProperties( std::vector< WrappedProperty* } //namespace wrapper } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx index 4ca8f7161f6e..170e48f3547f 100644 --- a/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx +++ b/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -591,3 +592,5 @@ beans::PropertyState WrappedSymbolAndLinesProperty::getPropertyState( const Refe } //namespace wrapper } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/chartapiwrapper/WrappedTextRotationProperty.cxx b/chart2/source/controller/chartapiwrapper/WrappedTextRotationProperty.cxx index a5d5afe6debc..31c16863a710 100644 --- a/chart2/source/controller/chartapiwrapper/WrappedTextRotationProperty.cxx +++ b/chart2/source/controller/chartapiwrapper/WrappedTextRotationProperty.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -85,3 +86,5 @@ Any WrappedTextRotationProperty::convertOuterToInnerValue( const Any& rOuterValu //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/ChangingResource.cxx b/chart2/source/controller/dialogs/ChangingResource.cxx index 22886c9b6108..0e60e798e196 100644 --- a/chart2/source/controller/dialogs/ChangingResource.cxx +++ b/chart2/source/controller/dialogs/ChangingResource.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -54,3 +55,5 @@ void ChangingResource::setChangeListener( ResourceChangeListener* pListener ) //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx index 6b0d278dd419..60c2d87ec784 100644 --- a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx +++ b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1281,3 +1282,5 @@ void BubbleChartDialogController::adjustParameterToSubType( ChartTypeParameter& //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/DataBrowser.cxx b/chart2/source/controller/dialogs/DataBrowser.cxx index 67930fc6f7a7..4c098c9e759e 100644 --- a/chart2/source/controller/dialogs/DataBrowser.cxx +++ b/chart2/source/controller/dialogs/DataBrowser.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1362,3 +1363,5 @@ sal_Int32 DataBrowser::GetTotalWidth() const } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/DataBrowserModel.cxx b/chart2/source/controller/dialogs/DataBrowserModel.cxx index c0b865536686..8bfab0867de3 100644 --- a/chart2/source/controller/dialogs/DataBrowserModel.cxx +++ b/chart2/source/controller/dialogs/DataBrowserModel.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -998,3 +999,5 @@ void DataBrowserModel::addErrorBarRanges( } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/DialogModel.cxx b/chart2/source/controller/dialogs/DialogModel.cxx index f32a882aa1e9..f06ef9efe501 100644 --- a/chart2/source/controller/dialogs/DialogModel.cxx +++ b/chart2/source/controller/dialogs/DialogModel.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -847,3 +848,5 @@ sal_Int32 DialogModel::countSeries() const } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/ObjectNameProvider.cxx b/chart2/source/controller/dialogs/ObjectNameProvider.cxx index 0836ab9ca93a..1a84ec0be18a 100644 --- a/chart2/source/controller/dialogs/ObjectNameProvider.cxx +++ b/chart2/source/controller/dialogs/ObjectNameProvider.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -850,3 +851,5 @@ rtl::OUString ObjectNameProvider::getName_ObjectForAllSeries( ObjectType eObject //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/RangeEdit.cxx b/chart2/source/controller/dialogs/RangeEdit.cxx index 55888156b1b1..f01456b89ee3 100644 --- a/chart2/source/controller/dialogs/RangeEdit.cxx +++ b/chart2/source/controller/dialogs/RangeEdit.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -68,3 +69,5 @@ void RangeEdit::KeyInput( const KeyEvent& rKEvt ) //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/RangeSelectionButton.cxx b/chart2/source/controller/dialogs/RangeSelectionButton.cxx index 9b94d7e1752b..30b1a0a33fb5 100644 --- a/chart2/source/controller/dialogs/RangeSelectionButton.cxx +++ b/chart2/source/controller/dialogs/RangeSelectionButton.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -54,3 +55,5 @@ RangeSelectionButton::~RangeSelectionButton() //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/RangeSelectionHelper.cxx b/chart2/source/controller/dialogs/RangeSelectionHelper.cxx index ccb4979420d1..7f41675a901c 100644 --- a/chart2/source/controller/dialogs/RangeSelectionHelper.cxx +++ b/chart2/source/controller/dialogs/RangeSelectionHelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -196,3 +197,5 @@ bool RangeSelectionHelper::verifyArguments( const Sequence< beans::PropertyValue } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/RangeSelectionListener.cxx b/chart2/source/controller/dialogs/RangeSelectionListener.cxx index a2bb0b7602d6..a6285f0970a4 100644 --- a/chart2/source/controller/dialogs/RangeSelectionListener.cxx +++ b/chart2/source/controller/dialogs/RangeSelectionListener.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -73,3 +74,5 @@ void SAL_CALL RangeSelectionListener::disposing( const lang::EventObject& /*Sour } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/TextDirectionListBox.cxx b/chart2/source/controller/dialogs/TextDirectionListBox.cxx index 23a1b4e806bd..cd11b6e7c3d2 100644 --- a/chart2/source/controller/dialogs/TextDirectionListBox.cxx +++ b/chart2/source/controller/dialogs/TextDirectionListBox.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -58,3 +59,4 @@ TextDirectionListBox::~TextDirectionListBox() } //namespace chart +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/TimerTriggeredControllerLock.cxx b/chart2/source/controller/dialogs/TimerTriggeredControllerLock.cxx index f1af209697cc..2147a7c0033b 100644 --- a/chart2/source/controller/dialogs/TimerTriggeredControllerLock.cxx +++ b/chart2/source/controller/dialogs/TimerTriggeredControllerLock.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -68,3 +69,5 @@ IMPL_LINK( TimerTriggeredControllerLock, TimerTimeout, void*, EMPTYARG ) //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/TitleDialogData.cxx b/chart2/source/controller/dialogs/TitleDialogData.cxx index 8846b310cde4..a6e4213c955f 100644 --- a/chart2/source/controller/dialogs/TitleDialogData.cxx +++ b/chart2/source/controller/dialogs/TitleDialogData.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -122,3 +123,5 @@ bool TitleDialogData::writeDifferenceToModel( //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/dlg_ChartType.cxx b/chart2/source/controller/dialogs/dlg_ChartType.cxx index f446c52ac0de..304aa1db7baf 100644 --- a/chart2/source/controller/dialogs/dlg_ChartType.cxx +++ b/chart2/source/controller/dialogs/dlg_ChartType.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -76,3 +77,5 @@ ChartTypeDialog::~ChartTypeDialog() //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/dlg_ChartType_UNO.cxx b/chart2/source/controller/dialogs/dlg_ChartType_UNO.cxx index aa9db2cdbbe4..420b20a4a7e0 100644 --- a/chart2/source/controller/dialogs/dlg_ChartType_UNO.cxx +++ b/chart2/source/controller/dialogs/dlg_ChartType_UNO.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -137,3 +138,5 @@ uno::Reference<beans::XPropertySetInfo> SAL_CALL ChartTypeUnoDlg::getPropertySe //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/dlg_CreationWizard.cxx b/chart2/source/controller/dialogs/dlg_CreationWizard.cxx index 5b82e57f7044..52d3eb00c108 100644 --- a/chart2/source/controller/dialogs/dlg_CreationWizard.cxx +++ b/chart2/source/controller/dialogs/dlg_CreationWizard.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -265,3 +266,5 @@ String CreationWizard::getStateDisplayName( WizardState nState ) const //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx b/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx index f9c25f94f7f3..db35da266064 100644 --- a/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx +++ b/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -431,3 +432,5 @@ void SAL_CALL CreationWizardUnoDlg::removeVetoableChangeListener( const ::rtl::O //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/dlg_DataEditor.cxx b/chart2/source/controller/dialogs/dlg_DataEditor.cxx index afc25fba9559..8225feba7a16 100644 --- a/chart2/source/controller/dialogs/dlg_DataEditor.cxx +++ b/chart2/source/controller/dialogs/dlg_DataEditor.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -358,3 +359,5 @@ void DataEditor::notifySystemWindow( } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/dlg_DataSource.cxx b/chart2/source/controller/dialogs/dlg_DataSource.cxx index 9469293ae1c5..8fd7133b3f4f 100644 --- a/chart2/source/controller/dialogs/dlg_DataSource.cxx +++ b/chart2/source/controller/dialogs/dlg_DataSource.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -251,3 +252,5 @@ void DataSourceDialog::setValidPage( TabPage * pTabPage ) } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/dlg_InsertAxis_Grid.cxx b/chart2/source/controller/dialogs/dlg_InsertAxis_Grid.cxx index e97f15898064..cef864201c49 100644 --- a/chart2/source/controller/dialogs/dlg_InsertAxis_Grid.cxx +++ b/chart2/source/controller/dialogs/dlg_InsertAxis_Grid.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -162,3 +163,4 @@ SchGridDlg::~SchGridDlg() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/dlg_InsertDataLabel.cxx b/chart2/source/controller/dialogs/dlg_InsertDataLabel.cxx index 2105b0bb2c87..4b5d27e40dc0 100644 --- a/chart2/source/controller/dialogs/dlg_InsertDataLabel.cxx +++ b/chart2/source/controller/dialogs/dlg_InsertDataLabel.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -72,3 +73,4 @@ void DataLabelsDialog::FillItemSet(SfxItemSet& rOutAttrs) } //namespace chart //............................................................................. +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx b/chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx index 9c4438b6f1ca..e6e691e00bee 100644 --- a/chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx +++ b/chart2/source/controller/dialogs/dlg_InsertErrorBars.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -132,3 +133,5 @@ double InsertErrorBarsDialog::getAxisMinorStepWidthForErrorBarDecimals( //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/dlg_InsertLegend.cxx b/chart2/source/controller/dialogs/dlg_InsertLegend.cxx index e722ede09c5a..7fdec77c4fcb 100644 --- a/chart2/source/controller/dialogs/dlg_InsertLegend.cxx +++ b/chart2/source/controller/dialogs/dlg_InsertLegend.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -76,3 +77,5 @@ bool SchLegendDlg::writeToModel( const uno::Reference< frame::XModel >& xChartMo //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/dlg_InsertTitle.cxx b/chart2/source/controller/dialogs/dlg_InsertTitle.cxx index bd98774c57a8..e292c2cd9ba9 100644 --- a/chart2/source/controller/dialogs/dlg_InsertTitle.cxx +++ b/chart2/source/controller/dialogs/dlg_InsertTitle.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -65,3 +66,4 @@ void SchTitleDlg::getResult( TitleDialogData& rOutput ) } //namespace chart //............................................................................. +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/dlg_InsertTrendline.cxx b/chart2/source/controller/dialogs/dlg_InsertTrendline.cxx index 58b29b4bdfe3..05ca9b7fbf0d 100644 --- a/chart2/source/controller/dialogs/dlg_InsertTrendline.cxx +++ b/chart2/source/controller/dialogs/dlg_InsertTrendline.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -112,3 +113,5 @@ void InsertTrendlineDialog::DataChanged( const DataChangedEvent& rDCEvt ) //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/dlg_NumberFormat.cxx b/chart2/source/controller/dialogs/dlg_NumberFormat.cxx index bf0dedfbc6e8..b9086018503e 100644 --- a/chart2/source/controller/dialogs/dlg_NumberFormat.cxx +++ b/chart2/source/controller/dialogs/dlg_NumberFormat.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -84,3 +85,5 @@ SfxItemSet NumberFormatDialog::CreateEmptyItemSetForNumberFormatDialog( SfxItemP //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx index 535b221488dd..88f8b43401ce 100644 --- a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx +++ b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -647,3 +648,5 @@ bool SchAttribTabDlg::DialogWasClosedWithOK() const //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/dlg_ShapeFont.cxx b/chart2/source/controller/dialogs/dlg_ShapeFont.cxx index 280a1adecba2..3f188aa90bfd 100644 --- a/chart2/source/controller/dialogs/dlg_ShapeFont.cxx +++ b/chart2/source/controller/dialogs/dlg_ShapeFont.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -90,3 +91,5 @@ void ShapeFontDialog::PageCreated( USHORT nId, SfxTabPage& rPage ) //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/dlg_ShapeParagraph.cxx b/chart2/source/controller/dialogs/dlg_ShapeParagraph.cxx index 2f0173fc8408..ee43d301255f 100644 --- a/chart2/source/controller/dialogs/dlg_ShapeParagraph.cxx +++ b/chart2/source/controller/dialogs/dlg_ShapeParagraph.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -91,3 +92,5 @@ void ShapeParagraphDialog::PageCreated( USHORT nId, SfxTabPage& rPage ) //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/dlg_View3D.cxx b/chart2/source/controller/dialogs/dlg_View3D.cxx index 26a726ac5156..352fb95a29fa 100644 --- a/chart2/source/controller/dialogs/dlg_View3D.cxx +++ b/chart2/source/controller/dialogs/dlg_View3D.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -116,3 +117,5 @@ short View3DDialog::Execute() //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/res_BarGeometry.cxx b/chart2/source/controller/dialogs/res_BarGeometry.cxx index 35dbc08f9efa..06b8be7a3f6e 100644 --- a/chart2/source/controller/dialogs/res_BarGeometry.cxx +++ b/chart2/source/controller/dialogs/res_BarGeometry.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -108,3 +109,4 @@ void BarGeometryResources::SelectEntryPos( USHORT nPos ) } //namespace chart //............................................................................. +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/res_DataLabel.cxx b/chart2/source/controller/dialogs/res_DataLabel.cxx index 25d279eaad37..623294542829 100644 --- a/chart2/source/controller/dialogs/res_DataLabel.cxx +++ b/chart2/source/controller/dialogs/res_DataLabel.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -417,3 +418,5 @@ void DataLabelResources::Reset(const SfxItemSet& rInAttrs) //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/res_ErrorBar.cxx b/chart2/source/controller/dialogs/res_ErrorBar.cxx index 8b649072538e..9a24eb06aa44 100644 --- a/chart2/source/controller/dialogs/res_ErrorBar.cxx +++ b/chart2/source/controller/dialogs/res_ErrorBar.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -785,3 +786,5 @@ bool ErrorBarResources::isRangeFieldContentValid( Edit & rEdit ) //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/res_LegendPosition.cxx b/chart2/source/controller/dialogs/res_LegendPosition.cxx index bacb815e784e..33f02c442f1b 100644 --- a/chart2/source/controller/dialogs/res_LegendPosition.cxx +++ b/chart2/source/controller/dialogs/res_LegendPosition.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -261,3 +262,4 @@ void LegendPositionResources::SetChangeHdl( const Link& rLink ) } //namespace chart //............................................................................. +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/res_TextSeparator.cxx b/chart2/source/controller/dialogs/res_TextSeparator.cxx index fd5ccb1eb5cd..cef13277d9cf 100644 --- a/chart2/source/controller/dialogs/res_TextSeparator.cxx +++ b/chart2/source/controller/dialogs/res_TextSeparator.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -151,3 +152,4 @@ rtl::OUString TextSeparatorResources::GetValue() const } //namespace chart //............................................................................. +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/res_Titles.cxx b/chart2/source/controller/dialogs/res_Titles.cxx index 225c8fe8748b..2b164216c28a 100644 --- a/chart2/source/controller/dialogs/res_Titles.cxx +++ b/chart2/source/controller/dialogs/res_Titles.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -222,3 +223,4 @@ void TitleResources::readFromResources( TitleDialogData& rOutput ) } //namespace chart //............................................................................. +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/res_Trendline.cxx b/chart2/source/controller/dialogs/res_Trendline.cxx index a395d32c2efa..46435152be8c 100644 --- a/chart2/source/controller/dialogs/res_Trendline.cxx +++ b/chart2/source/controller/dialogs/res_Trendline.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -280,3 +281,5 @@ void TrendlineResources::UpdateControlStates() } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/tp_3D_SceneAppearance.cxx b/chart2/source/controller/dialogs/tp_3D_SceneAppearance.cxx index 6b3b63495126..b13e93a573b2 100644 --- a/chart2/source/controller/dialogs/tp_3D_SceneAppearance.cxx +++ b/chart2/source/controller/dialogs/tp_3D_SceneAppearance.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -361,3 +362,5 @@ IMPL_LINK( ThreeD_SceneAppearance_TabPage, SelectRoundedEdgeOrObjectLines, Check //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/tp_3D_SceneGeometry.cxx b/chart2/source/controller/dialogs/tp_3D_SceneGeometry.cxx index 39175695a48b..35ae7ee8a1b3 100644 --- a/chart2/source/controller/dialogs/tp_3D_SceneGeometry.cxx +++ b/chart2/source/controller/dialogs/tp_3D_SceneGeometry.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -294,3 +295,5 @@ IMPL_LINK( ThreeD_SceneGeometry_TabPage, RightAngledAxesToggled, void*, EMPTYARG //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx index 14e22841fc41..3ccbe844bc97 100644 --- a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx +++ b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -646,3 +647,5 @@ void ThreeD_SceneIllumination_TabPage::updatePreview() //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/tp_AxisLabel.cxx b/chart2/source/controller/dialogs/tp_AxisLabel.cxx index 3dcaa3092e57..fd21bacca0b2 100644 --- a/chart2/source/controller/dialogs/tp_AxisLabel.cxx +++ b/chart2/source/controller/dialogs/tp_AxisLabel.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -321,3 +322,5 @@ IMPL_LINK ( SchAxisLabelTabPage, ToggleShowLabel, void *, EMPTYARG ) //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/tp_AxisPositions.cxx b/chart2/source/controller/dialogs/tp_AxisPositions.cxx index d5e84e055b2f..c4d073e3d03d 100644 --- a/chart2/source/controller/dialogs/tp_AxisPositions.cxx +++ b/chart2/source/controller/dialogs/tp_AxisPositions.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -494,3 +495,5 @@ IMPL_LINK ( AxisPositionsTabPage, PlaceLabelsSelectHdl, void *, EMPTYARG ) //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/tp_ChartType.cxx b/chart2/source/controller/dialogs/tp_ChartType.cxx index 4ff705fb09cf..d82879a93080 100644 --- a/chart2/source/controller/dialogs/tp_ChartType.cxx +++ b/chart2/source/controller/dialogs/tp_ChartType.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1179,3 +1180,5 @@ uno::Reference< XChartTypeTemplate > ChartTypeTabPage::getCurrentTemplate() cons //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/tp_DataLabel.cxx b/chart2/source/controller/dialogs/tp_DataLabel.cxx index 909c263ba83b..a53c205d9ecc 100644 --- a/chart2/source/controller/dialogs/tp_DataLabel.cxx +++ b/chart2/source/controller/dialogs/tp_DataLabel.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -72,3 +73,5 @@ void DataLabelsTabPage::SetNumberFormatter( SvNumberFormatter* pFormatter ) //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/tp_DataSource.cxx b/chart2/source/controller/dialogs/tp_DataSource.cxx index 7c5f0fb3967b..d7a2d9ac84c8 100644 --- a/chart2/source/controller/dialogs/tp_DataSource.cxx +++ b/chart2/source/controller/dialogs/tp_DataSource.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1074,3 +1075,5 @@ bool DataSourceTabPage::updateModelFromControl( Edit * pField ) } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/tp_DataSourceControls.cxx b/chart2/source/controller/dialogs/tp_DataSourceControls.cxx index b6f7ad680591..72aa5cfb25c6 100644 --- a/chart2/source/controller/dialogs/tp_DataSourceControls.cxx +++ b/chart2/source/controller/dialogs/tp_DataSourceControls.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -55,3 +56,5 @@ SvLBoxEntry* SeriesListBox::CreateEntry() const } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/tp_ErrorBars.cxx b/chart2/source/controller/dialogs/tp_ErrorBars.cxx index 395c956372ea..14214eb4189a 100644 --- a/chart2/source/controller/dialogs/tp_ErrorBars.cxx +++ b/chart2/source/controller/dialogs/tp_ErrorBars.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -98,3 +99,5 @@ void ErrorBarsTabPage::SetChartDocumentForRangeChoosing( //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/tp_LegendPosition.cxx b/chart2/source/controller/dialogs/tp_LegendPosition.cxx index e3d23366a820..9b7d34b72930 100644 --- a/chart2/source/controller/dialogs/tp_LegendPosition.cxx +++ b/chart2/source/controller/dialogs/tp_LegendPosition.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -86,3 +87,5 @@ void SchLegendPosTabPage::Reset(const SfxItemSet& rInAttrs) //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/tp_Location.cxx b/chart2/source/controller/dialogs/tp_Location.cxx index a8a4d1317be8..e13c1c2f9779 100644 --- a/chart2/source/controller/dialogs/tp_Location.cxx +++ b/chart2/source/controller/dialogs/tp_Location.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -69,3 +70,5 @@ bool LocationTabPage::canAdvance() const //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/tp_PointGeometry.cxx b/chart2/source/controller/dialogs/tp_PointGeometry.cxx index 661bae6ac326..5dd8f7cb44e6 100644 --- a/chart2/source/controller/dialogs/tp_PointGeometry.cxx +++ b/chart2/source/controller/dialogs/tp_PointGeometry.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -102,3 +103,5 @@ void SchLayoutTabPage::Reset(const SfxItemSet& rInAttrs) //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/tp_PolarOptions.cxx b/chart2/source/controller/dialogs/tp_PolarOptions.cxx index 9a193c028e05..267ccf81a60e 100644 --- a/chart2/source/controller/dialogs/tp_PolarOptions.cxx +++ b/chart2/source/controller/dialogs/tp_PolarOptions.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -124,3 +125,5 @@ void PolarOptionsTabPage::Reset(const SfxItemSet& rInAttrs) //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/tp_RangeChooser.cxx b/chart2/source/controller/dialogs/tp_RangeChooser.cxx index 3ba6ca0f74b2..4235a7bfcdc4 100644 --- a/chart2/source/controller/dialogs/tp_RangeChooser.cxx +++ b/chart2/source/controller/dialogs/tp_RangeChooser.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -412,3 +413,5 @@ void RangeChooserTabPage::setDirty() //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/tp_Scale.cxx b/chart2/source/controller/dialogs/tp_Scale.cxx index ee12d11b6132..039fcc9e599a 100644 --- a/chart2/source/controller/dialogs/tp_Scale.cxx +++ b/chart2/source/controller/dialogs/tp_Scale.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -514,3 +515,5 @@ bool ScaleTabPage::ShowWarning( USHORT nResIdMessage, Edit * pControl /* = NULL //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/tp_SeriesToAxis.cxx b/chart2/source/controller/dialogs/tp_SeriesToAxis.cxx index fbe2f4bf1907..b99675652084 100644 --- a/chart2/source/controller/dialogs/tp_SeriesToAxis.cxx +++ b/chart2/source/controller/dialogs/tp_SeriesToAxis.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -311,3 +312,5 @@ void SchOptionTabPage::AdaptControlPositionsAndVisibility() //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/tp_TitleRotation.cxx b/chart2/source/controller/dialogs/tp_TitleRotation.cxx index 5b1d5647dc6c..89e6545aa79a 100644 --- a/chart2/source/controller/dialogs/tp_TitleRotation.cxx +++ b/chart2/source/controller/dialogs/tp_TitleRotation.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -124,3 +125,4 @@ void SchAlignmentTabPage::Reset(const SfxItemSet& rInAttrs) //............................................................................. +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/tp_Trendline.cxx b/chart2/source/controller/dialogs/tp_Trendline.cxx index 31b35b24a5b4..97859daa14fc 100644 --- a/chart2/source/controller/dialogs/tp_Trendline.cxx +++ b/chart2/source/controller/dialogs/tp_Trendline.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -75,3 +76,5 @@ void TrendlineTabPage::DataChanged( const DataChangedEvent& rDCEvt ) //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.cxx b/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.cxx index 03988116854e..792ae2faef74 100644 --- a/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.cxx +++ b/chart2/source/controller/dialogs/tp_Wizard_TitlesAndObjects.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -185,3 +186,5 @@ bool TitlesAndObjectsTabPage::canAdvance() const //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx b/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx index f863c6bd9d34..bd8f44568b01 100644 --- a/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx +++ b/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -441,3 +442,5 @@ SdrObject* DrawViewWrapper::getSdrObject( const uno::Reference< //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx b/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx index 755058050a2d..3a613fbc79d0 100644 --- a/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx +++ b/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -272,3 +273,5 @@ SfxPrinter* ObjectPropertiesDialogParameter::getPrinter() //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx index 8cf07aabad08..e6b75214f601 100644 --- a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -833,3 +834,5 @@ bool AxisItemConverter::ApplySpecialItem( USHORT nWhichId, const SfxItemSet & rI } // namespace wrapper } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx b/chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx index 3382ae1ff085..177764d6787f 100644 --- a/chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/CharacterPropertyItemConverter.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -516,3 +517,5 @@ uno::Reference< beans::XPropertySet > } // namespace wrapper } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx index 14590b6f6f9c..51df4136ad2d 100644 --- a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -698,3 +699,5 @@ void DataPointItemConverter::FillSpecialItem( } // namespace wrapper } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/itemsetwrapper/ErrorBarItemConverter.cxx b/chart2/source/controller/itemsetwrapper/ErrorBarItemConverter.cxx index 0e2e6cdd4644..072768c13658 100644 --- a/chart2/source/controller/itemsetwrapper/ErrorBarItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/ErrorBarItemConverter.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -454,3 +455,5 @@ void ErrorBarItemConverter::FillSpecialItem( } // namespace wrapper } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx b/chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx index c732dfe80ede..c5a6491cc3d7 100644 --- a/chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -807,3 +808,5 @@ bool GraphicPropertyItemConverter::ApplySpecialItem( } // namespace wrapper } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/itemsetwrapper/ItemConverter.cxx b/chart2/source/controller/itemsetwrapper/ItemConverter.cxx index 5ee167260974..6fe6df1b3096 100644 --- a/chart2/source/controller/itemsetwrapper/ItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/ItemConverter.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -267,3 +268,5 @@ void ItemConverter::InvalidateUnequalItems( SfxItemSet &rDestSet, const SfxItem } } // namespace comphelper + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/itemsetwrapper/LegendItemConverter.cxx b/chart2/source/controller/itemsetwrapper/LegendItemConverter.cxx index 3af6d9342f33..d17feda59b48 100644 --- a/chart2/source/controller/itemsetwrapper/LegendItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/LegendItemConverter.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -234,3 +235,5 @@ void LegendItemConverter::FillSpecialItem( } // namespace wrapper } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/itemsetwrapper/MultipleChartConverters.cxx b/chart2/source/controller/itemsetwrapper/MultipleChartConverters.cxx index e111eb314360..9ba75dbbe6ea 100644 --- a/chart2/source/controller/itemsetwrapper/MultipleChartConverters.cxx +++ b/chart2/source/controller/itemsetwrapper/MultipleChartConverters.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -231,3 +232,5 @@ const USHORT * AllSeriesStatisticsConverter::GetWhichPairs() const } // namespace wrapper } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/itemsetwrapper/MultipleItemConverter.cxx b/chart2/source/controller/itemsetwrapper/MultipleItemConverter.cxx index e24be80bb429..b696d05088f4 100644 --- a/chart2/source/controller/itemsetwrapper/MultipleItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/MultipleItemConverter.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -82,3 +83,5 @@ bool MultipleItemConverter::GetItemProperty( tWhichIdType /*nWhichId*/, tPropert } } // namespace comphelper + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/itemsetwrapper/RegressionCurveItemConverter.cxx b/chart2/source/controller/itemsetwrapper/RegressionCurveItemConverter.cxx index 2fee8702e6d8..672bf52ab652 100644 --- a/chart2/source/controller/itemsetwrapper/RegressionCurveItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/RegressionCurveItemConverter.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -274,3 +275,5 @@ void RegressionCurveItemConverter::FillSpecialItem( } // namespace wrapper } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/itemsetwrapper/RegressionEquationItemConverter.cxx b/chart2/source/controller/itemsetwrapper/RegressionEquationItemConverter.cxx index 6035f21696a9..a918b428b988 100644 --- a/chart2/source/controller/itemsetwrapper/RegressionEquationItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/RegressionEquationItemConverter.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -185,3 +186,5 @@ void RegressionEquationItemConverter::FillSpecialItem( } // namespace wrapper } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx b/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx index b1931d63cfbb..eefa60a3f85b 100644 --- a/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -451,3 +452,5 @@ void SeriesOptionsItemConverter::FillSpecialItem( } // namespace wrapper } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx b/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx index f2df5c96dd71..409b675e41b9 100644 --- a/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -695,3 +696,5 @@ void StatisticsItemConverter::FillSpecialItem( } // namespace wrapper } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/itemsetwrapper/TitleItemConverter.cxx b/chart2/source/controller/itemsetwrapper/TitleItemConverter.cxx index f745dd37e9c3..fffaa31a8590 100644 --- a/chart2/source/controller/itemsetwrapper/TitleItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/TitleItemConverter.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -243,3 +244,5 @@ void TitleItemConverter::FillSpecialItem( } // namespace wrapper } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx index e0da3b1fc5b0..1b6f98bf64cb 100644 --- a/chart2/source/controller/main/ChartController.cxx +++ b/chart2/source/controller/main/ChartController.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1578,3 +1579,5 @@ void ChartController::impl_initializeAccessible( const uno::Reference< lang::XIn //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/main/ChartController_EditData.cxx b/chart2/source/controller/main/ChartController_EditData.cxx index 0248732a63a7..e095fff8e5b6 100644 --- a/chart2/source/controller/main/ChartController_EditData.cxx +++ b/chart2/source/controller/main/ChartController_EditData.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -78,3 +79,5 @@ void ChartController::executeDispatch_EditData() } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/main/ChartController_Insert.cxx b/chart2/source/controller/main/ChartController_Insert.cxx index 0a7a4057ef9a..0dbec246be0b 100644 --- a/chart2/source/controller/main/ChartController_Insert.cxx +++ b/chart2/source/controller/main/ChartController_Insert.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -944,3 +945,5 @@ void ChartController::executeDispatch_DeleteMinorGrid() //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/main/ChartController_Position.cxx b/chart2/source/controller/main/ChartController_Position.cxx index 619d308ffad2..833d903f204f 100644 --- a/chart2/source/controller/main/ChartController_Position.cxx +++ b/chart2/source/controller/main/ChartController_Position.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -189,3 +190,5 @@ void SAL_CALL ChartController::executeDispatch_PositionAndSize() //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/main/ChartController_Properties.cxx b/chart2/source/controller/main/ChartController_Properties.cxx index 649b9cb62f9d..217b21c030b5 100644 --- a/chart2/source/controller/main/ChartController_Properties.cxx +++ b/chart2/source/controller/main/ChartController_Properties.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -858,3 +859,5 @@ void SAL_CALL ChartController::executeDispatch_View3D() //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/main/ChartController_TextEdit.cxx b/chart2/source/controller/main/ChartController_TextEdit.cxx index 384a0a321883..37a426ef8a7d 100644 --- a/chart2/source/controller/main/ChartController_TextEdit.cxx +++ b/chart2/source/controller/main/ChartController_TextEdit.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -267,3 +268,5 @@ uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/main/ChartController_Tools.cxx b/chart2/source/controller/main/ChartController_Tools.cxx index 779e3c32f1e7..9e774b0ef661 100644 --- a/chart2/source/controller/main/ChartController_Tools.cxx +++ b/chart2/source/controller/main/ChartController_Tools.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -917,3 +918,5 @@ void ChartController::impl_switchDiagramPositioningToExcludingPositioning() } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx index 56908ac4ef79..901eddaae224 100644 --- a/chart2/source/controller/main/ChartController_Window.cxx +++ b/chart2/source/controller/main/ChartController_Window.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -2027,3 +2028,5 @@ void ChartController::impl_SetMousePointer( const MouseEvent & rEvent ) //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/main/ChartDropTargetHelper.cxx b/chart2/source/controller/main/ChartDropTargetHelper.cxx index 8749ca1bc062..0e779b3833a1 100644 --- a/chart2/source/controller/main/ChartDropTargetHelper.cxx +++ b/chart2/source/controller/main/ChartDropTargetHelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -202,3 +203,5 @@ sal_Int8 ChartDropTargetHelper::ExecuteDrop( const ExecuteDropEvent& rEvt ) } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/main/ChartFrameloader.cxx b/chart2/source/controller/main/ChartFrameloader.cxx index cab3816d5033..0650318ab9e9 100644 --- a/chart2/source/controller/main/ChartFrameloader.cxx +++ b/chart2/source/controller/main/ChartFrameloader.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -206,3 +207,5 @@ APPHELPER_XSERVICEINFO_IMPL(ChartFrameLoader,CHART_FRAMELOADER_SERVICE_IMPLEMENT //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/main/ChartRenderer.cxx b/chart2/source/controller/main/ChartRenderer.cxx index 3419f7a53bec..f8dce6e96fdb 100644 --- a/chart2/source/controller/main/ChartRenderer.cxx +++ b/chart2/source/controller/main/ChartRenderer.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -176,3 +177,5 @@ Sequence< OUString > ChartRenderer::getSupportedServiceNames_Static() //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/main/ChartTransferable.cxx b/chart2/source/controller/main/ChartTransferable.cxx index 80041d4c3818..aaf23fcc68a4 100644 --- a/chart2/source/controller/main/ChartTransferable.cxx +++ b/chart2/source/controller/main/ChartTransferable.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -170,3 +171,5 @@ sal_Bool ChartTransferable::WriteObject( SotStorageStreamRef& rxOStm, void* pUse } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/main/ChartWindow.cxx b/chart2/source/controller/main/ChartWindow.cxx index 240b615cf0f6..45a206abff55 100644 --- a/chart2/source/controller/main/ChartWindow.cxx +++ b/chart2/source/controller/main/ChartWindow.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -269,3 +270,5 @@ void ChartWindow::Invalidate( const Region& rRegion, USHORT nFlags ) //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/main/CommandDispatch.cxx b/chart2/source/controller/main/CommandDispatch.cxx index bd040fce8fff..ae7a54f26939 100644 --- a/chart2/source/controller/main/CommandDispatch.cxx +++ b/chart2/source/controller/main/CommandDispatch.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -209,3 +210,5 @@ void CommandDispatch::fireStatusEventForURL( } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/main/CommandDispatchContainer.cxx b/chart2/source/controller/main/CommandDispatchContainer.cxx index e0d689340760..399b0e1d6aab 100644 --- a/chart2/source/controller/main/CommandDispatchContainer.cxx +++ b/chart2/source/controller/main/CommandDispatchContainer.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -214,3 +215,5 @@ void CommandDispatchContainer::setShapeController( ShapeController* pController } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/main/ConfigurationAccess.cxx b/chart2/source/controller/main/ConfigurationAccess.cxx index bf0bc6e14eec..3c4ea5d6d742 100644 --- a/chart2/source/controller/main/ConfigurationAccess.cxx +++ b/chart2/source/controller/main/ConfigurationAccess.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -118,3 +119,5 @@ namespace ConfigurationAccess //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/main/ControllerCommandDispatch.cxx b/chart2/source/controller/main/ControllerCommandDispatch.cxx index a01b80bfa22b..c2134bef3ff1 100644 --- a/chart2/source/controller/main/ControllerCommandDispatch.cxx +++ b/chart2/source/controller/main/ControllerCommandDispatch.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -803,3 +804,5 @@ void SAL_CALL ControllerCommandDispatch::selectionChanged( const lang::EventObje } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/main/DragMethod_Base.cxx b/chart2/source/controller/main/DragMethod_Base.cxx index 11ba7b7b8016..23eada69efd9 100644 --- a/chart2/source/controller/main/DragMethod_Base.cxx +++ b/chart2/source/controller/main/DragMethod_Base.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -91,3 +92,5 @@ Pointer DragMethod_Base::GetSdrDragPointer() const //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/main/DragMethod_PieSegment.cxx b/chart2/source/controller/main/DragMethod_PieSegment.cxx index 5074147fa9e2..2746471dd36d 100644 --- a/chart2/source/controller/main/DragMethod_PieSegment.cxx +++ b/chart2/source/controller/main/DragMethod_PieSegment.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -161,3 +162,5 @@ void DragMethod_PieSegment::createSdrDragEntries() //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/main/DragMethod_RotateDiagram.cxx b/chart2/source/controller/main/DragMethod_RotateDiagram.cxx index 944b44dd25bf..f46b46bed32e 100644 --- a/chart2/source/controller/main/DragMethod_RotateDiagram.cxx +++ b/chart2/source/controller/main/DragMethod_RotateDiagram.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -235,3 +236,5 @@ void DragMethod_RotateDiagram::CreateOverlayGeometry(sdr::overlay::OverlayManage //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/main/DrawCommandDispatch.cxx b/chart2/source/controller/main/DrawCommandDispatch.cxx index aa28028c4861..1fd6b624c30f 100644 --- a/chart2/source/controller/main/DrawCommandDispatch.cxx +++ b/chart2/source/controller/main/DrawCommandDispatch.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -672,3 +673,5 @@ bool DrawCommandDispatch::parseCommandURL( const ::rtl::OUString& rCommandURL, s //............................................................................. } // namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/main/ElementSelector.cxx b/chart2/source/controller/main/ElementSelector.cxx index 3b41fd1b6b66..e96438e36850 100644 --- a/chart2/source/controller/main/ElementSelector.cxx +++ b/chart2/source/controller/main/ElementSelector.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -342,3 +343,5 @@ uno::Reference< awt::XWindow > SAL_CALL ElementSelectorToolbarController::create //.......................................................................... } // chart2 //.......................................................................... + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/main/FeatureCommandDispatchBase.cxx b/chart2/source/controller/main/FeatureCommandDispatchBase.cxx index 39b4e1d4a171..09be57fa1d86 100644 --- a/chart2/source/controller/main/FeatureCommandDispatchBase.cxx +++ b/chart2/source/controller/main/FeatureCommandDispatchBase.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -112,3 +113,5 @@ void FeatureCommandDispatchBase::fillSupportedFeatures() } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/main/ImplUndoManager.cxx b/chart2/source/controller/main/ImplUndoManager.cxx index 57e8e7315334..ef7d3cd5fa34 100644 --- a/chart2/source/controller/main/ImplUndoManager.cxx +++ b/chart2/source/controller/main/ImplUndoManager.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -503,3 +504,5 @@ sal_Int32 UndoStepsConfigItem::getUndoSteps() } // namespace impl } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/main/ObjectHierarchy.cxx b/chart2/source/controller/main/ObjectHierarchy.cxx index fe73d15500f5..507b74baeecd 100644 --- a/chart2/source/controller/main/ObjectHierarchy.cxx +++ b/chart2/source/controller/main/ObjectHierarchy.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -860,3 +861,5 @@ bool ObjectKeyNavigation::veryLast() } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/main/PositionAndSizeHelper.cxx b/chart2/source/controller/main/PositionAndSizeHelper.cxx index f0ce3eaaa04e..fd88410697f0 100644 --- a/chart2/source/controller/main/PositionAndSizeHelper.cxx +++ b/chart2/source/controller/main/PositionAndSizeHelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -187,3 +188,5 @@ bool PositionAndSizeHelper::moveObject( const rtl::OUString& rObjectCID //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/main/SelectionHelper.cxx b/chart2/source/controller/main/SelectionHelper.cxx index 567a36473a5b..a94d73cd0289 100644 --- a/chart2/source/controller/main/SelectionHelper.cxx +++ b/chart2/source/controller/main/SelectionHelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -683,3 +684,5 @@ bool SelectionHelper::getMarkHandles( SdrHdlList& rHdlList ) //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/main/ShapeController.cxx b/chart2/source/controller/main/ShapeController.cxx index b6adf9bf7477..50abc6c4a668 100644 --- a/chart2/source/controller/main/ShapeController.cxx +++ b/chart2/source/controller/main/ShapeController.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -736,3 +737,5 @@ bool ShapeController::isForwardPossible() //............................................................................. } // namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/main/ShapeToolbarController.cxx b/chart2/source/controller/main/ShapeToolbarController.cxx index 9c6ed747e1d5..138a6cf96137 100644 --- a/chart2/source/controller/main/ShapeToolbarController.cxx +++ b/chart2/source/controller/main/ShapeToolbarController.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -296,3 +297,5 @@ void ShapeToolbarController::updateImage() throw (uno::RuntimeException) //............................................................................. } // namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/main/StatusBarCommandDispatch.cxx b/chart2/source/controller/main/StatusBarCommandDispatch.cxx index bc4c66f9674f..82620e94acce 100644 --- a/chart2/source/controller/main/StatusBarCommandDispatch.cxx +++ b/chart2/source/controller/main/StatusBarCommandDispatch.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -147,3 +148,5 @@ void SAL_CALL StatusBarCommandDispatch::selectionChanged( const lang::EventObjec } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/main/UndoCommandDispatch.cxx b/chart2/source/controller/main/UndoCommandDispatch.cxx index eb3d00a2723a..4e349ec9d506 100644 --- a/chart2/source/controller/main/UndoCommandDispatch.cxx +++ b/chart2/source/controller/main/UndoCommandDispatch.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -145,3 +146,5 @@ void SAL_CALL UndoCommandDispatch::disposing( const lang::EventObject& /* Source } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/main/UndoGuard.cxx b/chart2/source/controller/main/UndoGuard.cxx index 8513b6ba9093..17d33f689975 100644 --- a/chart2/source/controller/main/UndoGuard.cxx +++ b/chart2/source/controller/main/UndoGuard.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -141,3 +142,5 @@ UndoGuardWithSelection::~UndoGuardWithSelection() } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/main/UndoManager.cxx b/chart2/source/controller/main/UndoManager.cxx index 21e27922b1c8..63c7bcebcd29 100644 --- a/chart2/source/controller/main/UndoManager.cxx +++ b/chart2/source/controller/main/UndoManager.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -438,3 +439,5 @@ UndoManager* UndoManager::getImplementation( const Reference< uno::XInterface > } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/controller/main/_serviceregistration_controller.cxx b/chart2/source/controller/main/_serviceregistration_controller.cxx index cf8f5525e624..26576d026b46 100644 --- a/chart2/source/controller/main/_serviceregistration_controller.cxx +++ b/chart2/source/controller/main/_serviceregistration_controller.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -123,3 +124,5 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( } } //========================================================================= + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/filter/XMLFilter.cxx b/chart2/source/model/filter/XMLFilter.cxx index b66c4bc46102..6d52957177f8 100644 --- a/chart2/source/model/filter/XMLFilter.cxx +++ b/chart2/source/model/filter/XMLFilter.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -871,3 +872,5 @@ void XMLReportFilterHelper::isOasisFormat(const Sequence< beans::PropertyValue > } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/main/Axis.cxx b/chart2/source/model/main/Axis.cxx index fd1d78ebe071..4f5bd0301e28 100644 --- a/chart2/source/model/main/Axis.cxx +++ b/chart2/source/model/main/Axis.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -644,3 +645,5 @@ IMPLEMENT_FORWARD_XTYPEPROVIDER2( Axis, Axis_Base, ::property::OPropertySet ) APPHELPER_XSERVICEINFO_IMPL( Axis, lcl_aServiceName ); } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/main/BaseCoordinateSystem.cxx b/chart2/source/model/main/BaseCoordinateSystem.cxx index 4fa58cff5039..fae7f1f69698 100644 --- a/chart2/source/model/main/BaseCoordinateSystem.cxx +++ b/chart2/source/model/main/BaseCoordinateSystem.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -407,3 +408,5 @@ IMPLEMENT_FORWARD_XINTERFACE2( BaseCoordinateSystem, BaseCoordinateSystem_Base, IMPLEMENT_FORWARD_XTYPEPROVIDER2( BaseCoordinateSystem, BaseCoordinateSystem_Base, ::property::OPropertySet ) } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/main/CartesianCoordinateSystem.cxx b/chart2/source/model/main/CartesianCoordinateSystem.cxx index fdaa333b1cb8..eeb19be0cf8c 100644 --- a/chart2/source/model/main/CartesianCoordinateSystem.cxx +++ b/chart2/source/model/main/CartesianCoordinateSystem.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -153,3 +154,5 @@ Sequence< OUString > CartesianCoordinateSystem3d::getSupportedServiceNames_Stati APPHELPER_XSERVICEINFO_IMPL( CartesianCoordinateSystem3d, lcl_aImplementationNameCartesian3d ) } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx index 5a30d97118c5..3628b35d2490 100644 --- a/chart2/source/model/main/ChartModel.cxx +++ b/chart2/source/model/main/ChartModel.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1377,3 +1378,5 @@ uno::Sequence< Reference< chart2::data::XLabeledDataSequence > > SAL_CALL ChartM } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/main/ChartModel_Persistence.cxx b/chart2/source/model/main/ChartModel_Persistence.cxx index 0c4c2b7b9979..93ebc8aa88eb 100644 --- a/chart2/source/model/main/ChartModel_Persistence.cxx +++ b/chart2/source/model/main/ChartModel_Persistence.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -856,3 +857,5 @@ void SAL_CALL ChartModel::removeStorageChangeListener( const Reference< document } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/main/DataPoint.cxx b/chart2/source/model/main/DataPoint.cxx index 1f3d92e4d94b..2b2f3482376d 100644 --- a/chart2/source/model/main/DataPoint.cxx +++ b/chart2/source/model/main/DataPoint.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -317,3 +318,5 @@ IMPLEMENT_FORWARD_XINTERFACE2( DataPoint, DataPoint_Base, ::property::OPropertyS APPHELPER_XSERVICEINFO_IMPL( DataPoint, C2U( "com.sun.star.comp.chart.DataPoint" )); } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/main/DataPointProperties.cxx b/chart2/source/model/main/DataPointProperties.cxx index bcba4c8bd5a8..f7b49295da04 100644 --- a/chart2/source/model/main/DataPointProperties.cxx +++ b/chart2/source/model/main/DataPointProperties.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -427,3 +428,5 @@ void DataPointProperties::AddDefaultsToMap( } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/main/DataSeries.cxx b/chart2/source/model/main/DataSeries.cxx index 89197aa5ba3f..a949d9e68722 100644 --- a/chart2/source/model/main/DataSeries.cxx +++ b/chart2/source/model/main/DataSeries.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -622,3 +623,5 @@ APPHELPER_XSERVICEINFO_IMPL( DataSeries, C2U( "com.sun.star.comp.chart.DataSeries" )); } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/main/DataSeriesProperties.cxx b/chart2/source/model/main/DataSeriesProperties.cxx index 29a41bd38e14..6e0e96c51922 100644 --- a/chart2/source/model/main/DataSeriesProperties.cxx +++ b/chart2/source/model/main/DataSeriesProperties.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -96,3 +97,5 @@ void DataSeriesProperties::AddDefaultsToMap( } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/main/Diagram.cxx b/chart2/source/model/main/Diagram.cxx index ff8a0c4030bc..a414cf2ae405 100644 --- a/chart2/source/model/main/Diagram.cxx +++ b/chart2/source/model/main/Diagram.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -711,3 +712,5 @@ APPHELPER_XSERVICEINFO_IMPL( Diagram, C2U( "com.sun.star.comp.chart2.Diagram" )); } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/main/FormattedString.cxx b/chart2/source/model/main/FormattedString.cxx index 9d38fafd3cf7..32713538730b 100644 --- a/chart2/source/model/main/FormattedString.cxx +++ b/chart2/source/model/main/FormattedString.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -261,3 +262,5 @@ APPHELPER_XSERVICEINFO_IMPL( FormattedString, C2U( "com.sun.star.comp.chart.FormattedString" )); } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/main/GridProperties.cxx b/chart2/source/model/main/GridProperties.cxx index a8d5be5d1453..14b15d38a232 100644 --- a/chart2/source/model/main/GridProperties.cxx +++ b/chart2/source/model/main/GridProperties.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -271,3 +272,5 @@ IMPLEMENT_FORWARD_XINTERFACE2( GridProperties, GridProperties_Base, ::property:: IMPLEMENT_FORWARD_XTYPEPROVIDER2( GridProperties, GridProperties_Base, ::property::OPropertySet ) } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/main/LayoutContainer.cxx b/chart2/source/model/main/LayoutContainer.cxx index d962113f78c7..937232ae6ce2 100644 --- a/chart2/source/model/main/LayoutContainer.cxx +++ b/chart2/source/model/main/LayoutContainer.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -136,3 +137,5 @@ uno::Sequence< ::rtl::OUString > LayoutContainer::getSupportedServiceNames_Stati APPHELPER_XSERVICEINFO_IMPL( LayoutContainer, lcl_aServiceName ); } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/main/Legend.cxx b/chart2/source/model/main/Legend.cxx index c1143ecdf77a..53847b4e1ea8 100644 --- a/chart2/source/model/main/Legend.cxx +++ b/chart2/source/model/main/Legend.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -367,3 +368,5 @@ IMPLEMENT_FORWARD_XINTERFACE2( Legend, Legend_Base, ::property::OPropertySet ) IMPLEMENT_FORWARD_XTYPEPROVIDER2( Legend, Legend_Base, ::property::OPropertySet ) } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/main/PageBackground.cxx b/chart2/source/model/main/PageBackground.cxx index 0dbe1d82fcf3..6b24505f2854 100644 --- a/chart2/source/model/main/PageBackground.cxx +++ b/chart2/source/model/main/PageBackground.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -253,3 +254,5 @@ using impl::PageBackground_Base; IMPLEMENT_FORWARD_XINTERFACE2( PageBackground, PageBackground_Base, ::property::OPropertySet ) } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/main/PolarCoordinateSystem.cxx b/chart2/source/model/main/PolarCoordinateSystem.cxx index 9022a5e17901..218bc3b462a0 100644 --- a/chart2/source/model/main/PolarCoordinateSystem.cxx +++ b/chart2/source/model/main/PolarCoordinateSystem.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -153,3 +154,5 @@ Sequence< OUString > PolarCoordinateSystem3d::getSupportedServiceNames_Static() APPHELPER_XSERVICEINFO_IMPL( PolarCoordinateSystem3d, lcl_aImplementationNamePolar3d ) } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/main/StockBar.cxx b/chart2/source/model/main/StockBar.cxx index 9a3c7f8ab623..f2703df4d07b 100644 --- a/chart2/source/model/main/StockBar.cxx +++ b/chart2/source/model/main/StockBar.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -265,3 +266,5 @@ using impl::StockBar_Base; IMPLEMENT_FORWARD_XINTERFACE2( StockBar, StockBar_Base, ::property::OPropertySet ) } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/main/Title.cxx b/chart2/source/model/main/Title.cxx index d7c5691d160d..8e125e708271 100644 --- a/chart2/source/model/main/Title.cxx +++ b/chart2/source/model/main/Title.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -410,3 +411,5 @@ IMPLEMENT_FORWARD_XINTERFACE2( Title, Title_Base, ::property::OPropertySet ) IMPLEMENT_FORWARD_XTYPEPROVIDER2( Title, Title_Base, ::property::OPropertySet ) } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/main/Wall.cxx b/chart2/source/model/main/Wall.cxx index 2ad00a4c90ae..037d8a8d6e35 100644 --- a/chart2/source/model/main/Wall.cxx +++ b/chart2/source/model/main/Wall.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -258,3 +259,5 @@ using impl::Wall_Base; IMPLEMENT_FORWARD_XINTERFACE2( Wall, Wall_Base, ::property::OPropertySet ) } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/main/_serviceregistration_model.cxx b/chart2/source/model/main/_serviceregistration_model.cxx index de33941ec8a0..9eddacfd5cf7 100644 --- a/chart2/source/model/main/_serviceregistration_model.cxx +++ b/chart2/source/model/main/_serviceregistration_model.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -216,3 +217,5 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( } } //========================================================================= + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/template/AreaChartType.cxx b/chart2/source/model/template/AreaChartType.cxx index 003220c87dfb..5c9c9388ce25 100644 --- a/chart2/source/model/template/AreaChartType.cxx +++ b/chart2/source/model/template/AreaChartType.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -75,3 +76,5 @@ APPHELPER_XSERVICEINFO_IMPL( AreaChartType, C2U( "com.sun.star.comp.chart.AreaChartType" )); } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/template/AreaChartTypeTemplate.cxx b/chart2/source/model/template/AreaChartTypeTemplate.cxx index 5fe21cfb25e0..98a5e49da85a 100644 --- a/chart2/source/model/template/AreaChartTypeTemplate.cxx +++ b/chart2/source/model/template/AreaChartTypeTemplate.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -279,3 +280,5 @@ IMPLEMENT_FORWARD_XINTERFACE2( AreaChartTypeTemplate, ChartTypeTemplate, OProper IMPLEMENT_FORWARD_XTYPEPROVIDER2( AreaChartTypeTemplate, ChartTypeTemplate, OPropertySet ) } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/template/BarChartType.cxx b/chart2/source/model/template/BarChartType.cxx index e877a34007de..f955d7aac413 100644 --- a/chart2/source/model/template/BarChartType.cxx +++ b/chart2/source/model/template/BarChartType.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -76,3 +77,5 @@ APPHELPER_XSERVICEINFO_IMPL( BarChartType, C2U( "com.sun.star.comp.chart.BarChartType" )); } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/template/BarChartTypeTemplate.cxx b/chart2/source/model/template/BarChartTypeTemplate.cxx index 01dc4c253d2b..bd504417d42b 100644 --- a/chart2/source/model/template/BarChartTypeTemplate.cxx +++ b/chart2/source/model/template/BarChartTypeTemplate.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -351,3 +352,5 @@ IMPLEMENT_FORWARD_XINTERFACE2( BarChartTypeTemplate, ChartTypeTemplate, OPropert IMPLEMENT_FORWARD_XTYPEPROVIDER2( BarChartTypeTemplate, ChartTypeTemplate, OPropertySet ) } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/template/BubbleChartType.cxx b/chart2/source/model/template/BubbleChartType.cxx index 9922ed4df5fb..f502cba4d4e2 100644 --- a/chart2/source/model/template/BubbleChartType.cxx +++ b/chart2/source/model/template/BubbleChartType.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -240,3 +241,5 @@ APPHELPER_XSERVICEINFO_IMPL( BubbleChartType, C2U( "com.sun.star.comp.chart.BubbleChartType" )); } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/template/BubbleChartTypeTemplate.cxx b/chart2/source/model/template/BubbleChartTypeTemplate.cxx index 59b552cc8995..0c3dee1fae53 100644 --- a/chart2/source/model/template/BubbleChartTypeTemplate.cxx +++ b/chart2/source/model/template/BubbleChartTypeTemplate.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -312,3 +313,5 @@ IMPLEMENT_FORWARD_XINTERFACE2( BubbleChartTypeTemplate, ChartTypeTemplate, OProp IMPLEMENT_FORWARD_XTYPEPROVIDER2( BubbleChartTypeTemplate, ChartTypeTemplate, OPropertySet ) } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/template/BubbleDataInterpreter.cxx b/chart2/source/model/template/BubbleDataInterpreter.cxx index 1f26fff907e4..7741c4488f85 100644 --- a/chart2/source/model/template/BubbleDataInterpreter.cxx +++ b/chart2/source/model/template/BubbleDataInterpreter.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -306,3 +307,5 @@ sal_Bool SAL_CALL BubbleDataInterpreter::isDataCompatible( } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/template/CandleStickChartType.cxx b/chart2/source/model/template/CandleStickChartType.cxx index 22c8e058ea53..40ecfa6087c1 100644 --- a/chart2/source/model/template/CandleStickChartType.cxx +++ b/chart2/source/model/template/CandleStickChartType.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -353,3 +354,5 @@ APPHELPER_XSERVICEINFO_IMPL( CandleStickChartType, C2U( "com.sun.star.comp.chart.CandleStickChartType" )); } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/template/ChartType.cxx b/chart2/source/model/template/ChartType.cxx index 22a744769fc6..db202923152b 100644 --- a/chart2/source/model/template/ChartType.cxx +++ b/chart2/source/model/template/ChartType.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -323,3 +324,5 @@ IMPLEMENT_FORWARD_XINTERFACE2( ChartType, ChartType_Base, ::property::OPropertyS IMPLEMENT_FORWARD_XTYPEPROVIDER2( ChartType, ChartType_Base, ::property::OPropertySet ) } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/template/ChartTypeManager.cxx b/chart2/source/model/template/ChartTypeManager.cxx index d34617ffce1f..4a866b2f0fa6 100644 --- a/chart2/source/model/template/ChartTypeManager.cxx +++ b/chart2/source/model/template/ChartTypeManager.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -617,3 +618,5 @@ Sequence< OUString > ChartTypeManager::getSupportedServiceNames_Static() APPHELPER_XSERVICEINFO_IMPL( ChartTypeManager, C2U( "com.sun.star.comp.chart.ChartTypeManager" )); } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/template/ChartTypeTemplate.cxx b/chart2/source/model/template/ChartTypeTemplate.cxx index e3943e9eb45f..124d73f69a0d 100644 --- a/chart2/source/model/template/ChartTypeTemplate.cxx +++ b/chart2/source/model/template/ChartTypeTemplate.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -931,3 +932,5 @@ Reference< uno::XComponentContext > ChartTypeTemplate::GetComponentContext() con APPHELPER_XSERVICEINFO_IMPL( ChartTypeTemplate, C2U( "com.sun.star.comp.chart.ChartTypeTemplate" )); } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/template/ColumnChartType.cxx b/chart2/source/model/template/ColumnChartType.cxx index aa11d77e8995..b117a0e525ac 100644 --- a/chart2/source/model/template/ColumnChartType.cxx +++ b/chart2/source/model/template/ColumnChartType.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -200,3 +201,5 @@ APPHELPER_XSERVICEINFO_IMPL( ColumnChartType, C2U( "com.sun.star.comp.chart.ColumnChartType" )); } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/template/ColumnLineChartTypeTemplate.cxx b/chart2/source/model/template/ColumnLineChartTypeTemplate.cxx index 663cad4c2fe4..58631b1267aa 100644 --- a/chart2/source/model/template/ColumnLineChartTypeTemplate.cxx +++ b/chart2/source/model/template/ColumnLineChartTypeTemplate.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -451,3 +452,5 @@ IMPLEMENT_FORWARD_XINTERFACE2( ColumnLineChartTypeTemplate, ChartTypeTemplate, O IMPLEMENT_FORWARD_XTYPEPROVIDER2( ColumnLineChartTypeTemplate, ChartTypeTemplate, OPropertySet ) } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/template/ColumnLineDataInterpreter.cxx b/chart2/source/model/template/ColumnLineDataInterpreter.cxx index 652c4532ffbe..d98ce6500c42 100644 --- a/chart2/source/model/template/ColumnLineDataInterpreter.cxx +++ b/chart2/source/model/template/ColumnLineDataInterpreter.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -97,3 +98,5 @@ InterpretedData SAL_CALL ColumnLineDataInterpreter::interpretDataSource( } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/template/DataInterpreter.cxx b/chart2/source/model/template/DataInterpreter.cxx index b619553ee959..ed447b065460 100644 --- a/chart2/source/model/template/DataInterpreter.cxx +++ b/chart2/source/model/template/DataInterpreter.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -459,3 +460,5 @@ void lcl_ShowDataSource( const Reference< data::XDataSource > & xSource ) } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/template/FilledNetChartType.cxx b/chart2/source/model/template/FilledNetChartType.cxx index d90dc8b9f7c7..ec9e6d6d945a 100644 --- a/chart2/source/model/template/FilledNetChartType.cxx +++ b/chart2/source/model/template/FilledNetChartType.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -92,3 +93,5 @@ APPHELPER_XSERVICEINFO_IMPL( FilledNetChartType, C2U( "com.sun.star.comp.chart.FilledNetChartType" )); } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/template/LineChartType.cxx b/chart2/source/model/template/LineChartType.cxx index f96d7ed1297d..3c8b403f1444 100644 --- a/chart2/source/model/template/LineChartType.cxx +++ b/chart2/source/model/template/LineChartType.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -212,3 +213,5 @@ APPHELPER_XSERVICEINFO_IMPL( LineChartType, C2U( "com.sun.star.comp.chart.LineChartType" )); } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/template/LineChartTypeTemplate.cxx b/chart2/source/model/template/LineChartTypeTemplate.cxx index 8d582178a128..c062ac4fbb06 100644 --- a/chart2/source/model/template/LineChartTypeTemplate.cxx +++ b/chart2/source/model/template/LineChartTypeTemplate.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -410,3 +411,5 @@ IMPLEMENT_FORWARD_XINTERFACE2( LineChartTypeTemplate, ChartTypeTemplate, OProper IMPLEMENT_FORWARD_XTYPEPROVIDER2( LineChartTypeTemplate, ChartTypeTemplate, OPropertySet ) } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/template/NetChartType.cxx b/chart2/source/model/template/NetChartType.cxx index ddf001b2a6e4..5c947f6a0504 100644 --- a/chart2/source/model/template/NetChartType.cxx +++ b/chart2/source/model/template/NetChartType.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -178,3 +179,5 @@ APPHELPER_XSERVICEINFO_IMPL( NetChartType, C2U( "com.sun.star.comp.chart.NetChartType" )); } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/template/NetChartTypeTemplate.cxx b/chart2/source/model/template/NetChartTypeTemplate.cxx index b67817e73997..25efd6877a7c 100644 --- a/chart2/source/model/template/NetChartTypeTemplate.cxx +++ b/chart2/source/model/template/NetChartTypeTemplate.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -227,3 +228,5 @@ Sequence< OUString > NetChartTypeTemplate::getSupportedServiceNames_Static() APPHELPER_XSERVICEINFO_IMPL( NetChartTypeTemplate, lcl_aServiceName ); } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/template/PieChartType.cxx b/chart2/source/model/template/PieChartType.cxx index 9c199bb23d70..29fd80d3614b 100644 --- a/chart2/source/model/template/PieChartType.cxx +++ b/chart2/source/model/template/PieChartType.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -237,3 +238,5 @@ APPHELPER_XSERVICEINFO_IMPL( PieChartType, C2U( "com.sun.star.comp.chart.PieChartType" )); } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/template/PieChartTypeTemplate.cxx b/chart2/source/model/template/PieChartTypeTemplate.cxx index c16682846d53..2ca8847701fc 100644 --- a/chart2/source/model/template/PieChartTypeTemplate.cxx +++ b/chart2/source/model/template/PieChartTypeTemplate.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -659,3 +660,5 @@ IMPLEMENT_FORWARD_XINTERFACE2( PieChartTypeTemplate, ChartTypeTemplate, OPropert IMPLEMENT_FORWARD_XTYPEPROVIDER2( PieChartTypeTemplate, ChartTypeTemplate, OPropertySet ) } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/template/ScatterChartType.cxx b/chart2/source/model/template/ScatterChartType.cxx index 8c4ab0d18415..3ff448664e57 100644 --- a/chart2/source/model/template/ScatterChartType.cxx +++ b/chart2/source/model/template/ScatterChartType.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -294,3 +295,5 @@ APPHELPER_XSERVICEINFO_IMPL( ScatterChartType, C2U( "com.sun.star.comp.chart.ScatterChartType" )); } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/template/ScatterChartTypeTemplate.cxx b/chart2/source/model/template/ScatterChartTypeTemplate.cxx index a83d9a8a4ea3..28bbee840c08 100644 --- a/chart2/source/model/template/ScatterChartTypeTemplate.cxx +++ b/chart2/source/model/template/ScatterChartTypeTemplate.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -430,3 +431,5 @@ IMPLEMENT_FORWARD_XINTERFACE2( ScatterChartTypeTemplate, ChartTypeTemplate, OPro IMPLEMENT_FORWARD_XTYPEPROVIDER2( ScatterChartTypeTemplate, ChartTypeTemplate, OPropertySet ) } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/template/StockChartTypeTemplate.cxx b/chart2/source/model/template/StockChartTypeTemplate.cxx index 00ace6c330ad..7565e333ea40 100644 --- a/chart2/source/model/template/StockChartTypeTemplate.cxx +++ b/chart2/source/model/template/StockChartTypeTemplate.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -558,3 +559,5 @@ IMPLEMENT_FORWARD_XINTERFACE2( StockChartTypeTemplate, ChartTypeTemplate, OPrope IMPLEMENT_FORWARD_XTYPEPROVIDER2( StockChartTypeTemplate, ChartTypeTemplate, OPropertySet ) } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/template/StockDataInterpreter.cxx b/chart2/source/model/template/StockDataInterpreter.cxx index a4070029e58e..4842bdb02d81 100644 --- a/chart2/source/model/template/StockDataInterpreter.cxx +++ b/chart2/source/model/template/StockDataInterpreter.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -340,3 +341,5 @@ InterpretedData SAL_CALL StockDataInterpreter::reinterpretDataSeries( } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/template/XYDataInterpreter.cxx b/chart2/source/model/template/XYDataInterpreter.cxx index 839c0cbac510..249a6a69c1b2 100644 --- a/chart2/source/model/template/XYDataInterpreter.cxx +++ b/chart2/source/model/template/XYDataInterpreter.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -271,3 +272,5 @@ sal_Bool SAL_CALL XYDataInterpreter::isDataCompatible( } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/model/template/_serviceregistration_charttypes.cxx b/chart2/source/model/template/_serviceregistration_charttypes.cxx index c0ffb8f4825f..8ea2f8065bf0 100644 --- a/chart2/source/model/template/_serviceregistration_charttypes.cxx +++ b/chart2/source/model/template/_serviceregistration_charttypes.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -136,3 +137,5 @@ struct ::cppu::ImplementationEntry * { return g_entries_chart2_charttypes; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/AxisHelper.cxx b/chart2/source/tools/AxisHelper.cxx index 8cdd24e4dc05..d19cfdc91ebd 100644 --- a/chart2/source/tools/AxisHelper.cxx +++ b/chart2/source/tools/AxisHelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -974,3 +975,5 @@ bool AxisHelper::isAxisPositioningEnabled() //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/BaseGFXHelper.cxx b/chart2/source/tools/BaseGFXHelper.cxx index 0ec7df9b7d71..71c2c973bec1 100644 --- a/chart2/source/tools/BaseGFXHelper.cxx +++ b/chart2/source/tools/BaseGFXHelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -220,3 +221,5 @@ double Rad2Deg( double fRadians ) } // namespace BaseGFXHelper } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/CachedDataSequence.cxx b/chart2/source/tools/CachedDataSequence.cxx index 678cd8ba8314..1c25fe346d32 100644 --- a/chart2/source/tools/CachedDataSequence.cxx +++ b/chart2/source/tools/CachedDataSequence.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -407,3 +408,5 @@ void SAL_CALL CachedDataSequence::initialize(const uno::Sequence< uno::Any > & _ } } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/CharacterProperties.cxx b/chart2/source/tools/CharacterProperties.cxx index 80fdf589e5fa..3c30ba77f869 100644 --- a/chart2/source/tools/CharacterProperties.cxx +++ b/chart2/source/tools/CharacterProperties.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -600,3 +601,5 @@ awt::FontDescriptor CharacterProperties::createFontDescriptorFromPropertySet( } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/ChartDebugTrace.cxx b/chart2/source/tools/ChartDebugTrace.cxx index 9629138cb2be..5cabb1d60666 100644 --- a/chart2/source/tools/ChartDebugTrace.cxx +++ b/chart2/source/tools/ChartDebugTrace.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -415,3 +416,5 @@ void ChartDebugTraceDiagram( } // namespace debug } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/ChartModelHelper.cxx b/chart2/source/tools/ChartModelHelper.cxx index a49b2abeac98..1e7c902478ee 100644 --- a/chart2/source/tools/ChartModelHelper.cxx +++ b/chart2/source/tools/ChartModelHelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -265,3 +266,5 @@ bool ChartModelHelper::setIncludeHiddenCells( bool bIncludeHiddenCells, const un //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/ChartTypeHelper.cxx b/chart2/source/tools/ChartTypeHelper.cxx index b851a3864b97..fb275440a3c7 100644 --- a/chart2/source/tools/ChartTypeHelper.cxx +++ b/chart2/source/tools/ChartTypeHelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -683,3 +684,5 @@ bool ChartTypeHelper::isSupportingOnlyDeepStackingFor3D( const uno::Reference< X //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/ChartViewHelper.cxx b/chart2/source/tools/ChartViewHelper.cxx index 55fbd368426a..ca5fda2ebfe3 100644 --- a/chart2/source/tools/ChartViewHelper.cxx +++ b/chart2/source/tools/ChartViewHelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -70,3 +71,5 @@ void ChartViewHelper::setViewToDirtyState( const uno::Reference< frame::XModel > //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/ColorPerPointHelper.cxx b/chart2/source/tools/ColorPerPointHelper.cxx index 762cb436a9a7..b18470ffdde7 100644 --- a/chart2/source/tools/ColorPerPointHelper.cxx +++ b/chart2/source/tools/ColorPerPointHelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -95,3 +96,5 @@ bool ColorPerPointHelper::hasPointOwnProperties( //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/CommonConverters.cxx b/chart2/source/tools/CommonConverters.cxx index e9d90248ce84..1dd6359b4d84 100644 --- a/chart2/source/tools/CommonConverters.cxx +++ b/chart2/source/tools/CommonConverters.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -547,3 +548,5 @@ bool replaceParamterInString( rtl::OUString & rInOutResourceString, //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/ConfigColorScheme.cxx b/chart2/source/tools/ConfigColorScheme.cxx index fb7106d87096..d0d0d722b764 100644 --- a/chart2/source/tools/ConfigColorScheme.cxx +++ b/chart2/source/tools/ConfigColorScheme.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -200,3 +201,5 @@ APPHELPER_XSERVICEINFO_IMPL( ConfigColorScheme, // ================================================================================ } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/ControllerLockGuard.cxx b/chart2/source/tools/ControllerLockGuard.cxx index 4ef430c5e483..7d17853257a5 100644 --- a/chart2/source/tools/ControllerLockGuard.cxx +++ b/chart2/source/tools/ControllerLockGuard.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -87,3 +88,5 @@ ControllerLockHelperGuard::~ControllerLockHelperGuard() } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/DataSeriesHelper.cxx b/chart2/source/tools/DataSeriesHelper.cxx index acff332d4229..4630ebd9b766 100644 --- a/chart2/source/tools/DataSeriesHelper.cxx +++ b/chart2/source/tools/DataSeriesHelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -916,3 +917,5 @@ void deleteDataLabelsFromPoint( const Reference< beans::XPropertySet >& xPointPr } // namespace DataSeriesHelper } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/DataSource.cxx b/chart2/source/tools/DataSource.cxx index edbf4dfacfeb..55f1439ef6f7 100644 --- a/chart2/source/tools/DataSource.cxx +++ b/chart2/source/tools/DataSource.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -89,3 +90,5 @@ Sequence< OUString > DataSource::getSupportedServiceNames_Static() APPHELPER_XSERVICEINFO_IMPL( DataSource, lcl_aServiceName ); } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/DataSourceHelper.cxx b/chart2/source/tools/DataSourceHelper.cxx index 0cc6ef4a4315..32e0a64718d6 100644 --- a/chart2/source/tools/DataSourceHelper.cxx +++ b/chart2/source/tools/DataSourceHelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -550,3 +551,5 @@ Sequence< OUString > DataSourceHelper::getRangesFromDataSource( const Reference< //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/DiagramHelper.cxx b/chart2/source/tools/DiagramHelper.cxx index 36afef60a6d4..7f8fbc22ee64 100644 --- a/chart2/source/tools/DiagramHelper.cxx +++ b/chart2/source/tools/DiagramHelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1557,3 +1558,5 @@ bool DiagramHelper::switchDiagramPositioningToExcludingPositioning( } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/ErrorBar.cxx b/chart2/source/tools/ErrorBar.cxx index 7468d8bb7896..268a538a9f50 100644 --- a/chart2/source/tools/ErrorBar.cxx +++ b/chart2/source/tools/ErrorBar.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -361,3 +362,5 @@ IMPLEMENT_FORWARD_XINTERFACE2( ErrorBar, ErrorBar_Base, OPropertySet ) IMPLEMENT_FORWARD_XTYPEPROVIDER2( ErrorBar, ErrorBar_Base, OPropertySet ) } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/ExplicitCategoriesProvider.cxx b/chart2/source/tools/ExplicitCategoriesProvider.cxx index bd1c1bb79813..7202d0e857fe 100644 --- a/chart2/source/tools/ExplicitCategoriesProvider.cxx +++ b/chart2/source/tools/ExplicitCategoriesProvider.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -420,3 +421,5 @@ OUString ExplicitCategoriesProvider::getCategoryByIndex( //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/ExponentialRegressionCurveCalculator.cxx b/chart2/source/tools/ExponentialRegressionCurveCalculator.cxx index d7bb86174323..fd97cfda7615 100644 --- a/chart2/source/tools/ExponentialRegressionCurveCalculator.cxx +++ b/chart2/source/tools/ExponentialRegressionCurveCalculator.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -181,3 +182,5 @@ OUString ExponentialRegressionCurveCalculator::ImplGetRepresentation( } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/FillProperties.cxx b/chart2/source/tools/FillProperties.cxx index ee23727c321b..e0be001c1449 100644 --- a/chart2/source/tools/FillProperties.cxx +++ b/chart2/source/tools/FillProperties.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -275,3 +276,5 @@ void FillProperties::AddDefaultsToMap( } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/FormattedStringHelper.cxx b/chart2/source/tools/FormattedStringHelper.cxx index c13c87d45931..c31000aed1a0 100644 --- a/chart2/source/tools/FormattedStringHelper.cxx +++ b/chart2/source/tools/FormattedStringHelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -78,3 +79,4 @@ Sequence< Reference< chart2::XFormattedString > > } //namespace chart //............................................................................. +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/ImplOPropertySet.cxx b/chart2/source/tools/ImplOPropertySet.cxx index faf1defd20ac..cb1fc996f5a1 100644 --- a/chart2/source/tools/ImplOPropertySet.cxx +++ b/chart2/source/tools/ImplOPropertySet.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -205,3 +206,5 @@ void ImplOPropertySet::cloneInterfaceProperties() } // namespace impl } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/InternalData.cxx b/chart2/source/tools/InternalData.cxx index 65fc97a04b38..ecd34372641e 100644 --- a/chart2/source/tools/InternalData.cxx +++ b/chart2/source/tools/InternalData.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -528,3 +529,5 @@ void InternalData::traceData() const #endif } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/InternalDataProvider.cxx b/chart2/source/tools/InternalDataProvider.cxx index 4abc51be31af..66c17da1186d 100644 --- a/chart2/source/tools/InternalDataProvider.cxx +++ b/chart2/source/tools/InternalDataProvider.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1312,3 +1313,5 @@ Sequence< OUString > InternalDataProvider::getSupportedServiceNames_Static() APPHELPER_XSERVICEINFO_IMPL( InternalDataProvider, lcl_aServiceName ); } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/LabeledDataSequence.cxx b/chart2/source/tools/LabeledDataSequence.cxx index 21ade3aefadc..971e281cc81b 100644 --- a/chart2/source/tools/LabeledDataSequence.cxx +++ b/chart2/source/tools/LabeledDataSequence.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -177,3 +178,5 @@ APPHELPER_XSERVICEINFO_IMPL( LabeledDataSequence, // ================================================================================ } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/LegendHelper.cxx b/chart2/source/tools/LegendHelper.cxx index 4e778db1a68c..905e6c3388ea 100644 --- a/chart2/source/tools/LegendHelper.cxx +++ b/chart2/source/tools/LegendHelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -145,3 +146,4 @@ bool LegendHelper::hasLegend( const uno::Reference< chart2::XDiagram > & xDiagra } //namespace chart //............................................................................. +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/LifeTime.cxx b/chart2/source/tools/LifeTime.cxx index 444e894a101d..ff1e12bd88db 100644 --- a/chart2/source/tools/LifeTime.cxx +++ b/chart2/source/tools/LifeTime.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -544,3 +545,5 @@ the XCloseable::close method has to be implemented in the following way: */ }//end namespace apphelper + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/LineProperties.cxx b/chart2/source/tools/LineProperties.cxx index 95cf95e21a86..30e7d1cbbaaa 100644 --- a/chart2/source/tools/LineProperties.cxx +++ b/chart2/source/tools/LineProperties.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -183,3 +184,5 @@ void LineProperties::SetLineInvisible( const ::com::sun::star::uno::Reference< } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/LinearRegressionCurveCalculator.cxx b/chart2/source/tools/LinearRegressionCurveCalculator.cxx index 7a372cff4f51..892d55892d0e 100644 --- a/chart2/source/tools/LinearRegressionCurveCalculator.cxx +++ b/chart2/source/tools/LinearRegressionCurveCalculator.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -177,3 +178,5 @@ OUString LinearRegressionCurveCalculator::ImplGetRepresentation( } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/LogarithmicRegressionCurveCalculator.cxx b/chart2/source/tools/LogarithmicRegressionCurveCalculator.cxx index c7c2db60431c..01259515159b 100644 --- a/chart2/source/tools/LogarithmicRegressionCurveCalculator.cxx +++ b/chart2/source/tools/LogarithmicRegressionCurveCalculator.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -189,3 +190,5 @@ OUString LogarithmicRegressionCurveCalculator::ImplGetRepresentation( } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/MeanValueRegressionCurveCalculator.cxx b/chart2/source/tools/MeanValueRegressionCurveCalculator.cxx index 8277a5830b0a..7c541397e4be 100644 --- a/chart2/source/tools/MeanValueRegressionCurveCalculator.cxx +++ b/chart2/source/tools/MeanValueRegressionCurveCalculator.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -141,3 +142,5 @@ OUString MeanValueRegressionCurveCalculator::ImplGetRepresentation( } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/MediaDescriptorHelper.cxx b/chart2/source/tools/MediaDescriptorHelper.cxx index 687bc203a84f..07b48f505cfd 100644 --- a/chart2/source/tools/MediaDescriptorHelper.cxx +++ b/chart2/source/tools/MediaDescriptorHelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -219,3 +220,5 @@ MediaDescriptorHelper::~MediaDescriptorHelper() return m_aModelProperties; } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/ModifyListenerCallBack.cxx b/chart2/source/tools/ModifyListenerCallBack.cxx index ae13b65c39c2..df3c81ce36e7 100644 --- a/chart2/source/tools/ModifyListenerCallBack.cxx +++ b/chart2/source/tools/ModifyListenerCallBack.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -132,3 +133,4 @@ void ModifyListenerCallBack::stopListening() } // namespace chart +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/ModifyListenerHelper.cxx b/chart2/source/tools/ModifyListenerHelper.cxx index 7ac5a2786cef..350731d338ea 100644 --- a/chart2/source/tools/ModifyListenerHelper.cxx +++ b/chart2/source/tools/ModifyListenerHelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -211,3 +212,5 @@ void SAL_CALL ModifyEventForwarder::disposing() } // namespace ModifyListenerHelper } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/MutexContainer.cxx b/chart2/source/tools/MutexContainer.cxx index 4fbb14674cdb..a042cf97aef5 100644 --- a/chart2/source/tools/MutexContainer.cxx +++ b/chart2/source/tools/MutexContainer.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -41,3 +42,5 @@ MutexContainer::~MutexContainer() } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/NameContainer.cxx b/chart2/source/tools/NameContainer.cxx index 05169c4608f9..c6f7c14f9e26 100644 --- a/chart2/source/tools/NameContainer.cxx +++ b/chart2/source/tools/NameContainer.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -187,3 +188,5 @@ uno::Reference< util::XCloneable > SAL_CALL NameContainer::createClone() //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/NamedFillProperties.cxx b/chart2/source/tools/NamedFillProperties.cxx index f904c34c1df1..885b0e53bc43 100644 --- a/chart2/source/tools/NamedFillProperties.cxx +++ b/chart2/source/tools/NamedFillProperties.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -112,3 +113,5 @@ OUString NamedFillProperties::GetPropertyNameForHandle( sal_Int32 nHandle ) } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/NamedLineProperties.cxx b/chart2/source/tools/NamedLineProperties.cxx index 02680abf690e..ef3cae6f01c1 100644 --- a/chart2/source/tools/NamedLineProperties.cxx +++ b/chart2/source/tools/NamedLineProperties.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -97,3 +98,5 @@ OUString NamedLineProperties::GetPropertyNameForHandle( sal_Int32 nHandle ) } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/NamedProperties.cxx b/chart2/source/tools/NamedProperties.cxx index 4fcb536b3279..732a65cbc453 100644 --- a/chart2/source/tools/NamedProperties.cxx +++ b/chart2/source/tools/NamedProperties.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -57,3 +58,5 @@ OUString NamedProperties::GetPropertyNameForHandle( sal_Int32 nHandle ) } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/OPropertySet.cxx b/chart2/source/tools/OPropertySet.cxx index a1caac803dd7..d80e284cdfae 100644 --- a/chart2/source/tools/OPropertySet.cxx +++ b/chart2/source/tools/OPropertySet.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -528,3 +529,5 @@ void SAL_CALL OPropertySet::setFastPropertyValue( sal_Int32 nHandle, const Any& } // namespace property + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/ObjectIdentifier.cxx b/chart2/source/tools/ObjectIdentifier.cxx index 0599f9317aed..bd29b48b937b 100644 --- a/chart2/source/tools/ObjectIdentifier.cxx +++ b/chart2/source/tools/ObjectIdentifier.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1489,3 +1490,5 @@ Any ObjectIdentifier::getAny() const //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/PotentialRegressionCurveCalculator.cxx b/chart2/source/tools/PotentialRegressionCurveCalculator.cxx index b1d10424b9a1..f6a814f2c400 100644 --- a/chart2/source/tools/PotentialRegressionCurveCalculator.cxx +++ b/chart2/source/tools/PotentialRegressionCurveCalculator.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -175,3 +176,5 @@ OUString PotentialRegressionCurveCalculator::ImplGetRepresentation( } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/PropertyHelper.cxx b/chart2/source/tools/PropertyHelper.cxx index dd0a1ad6cf2f..863fca8bcbc3 100644 --- a/chart2/source/tools/PropertyHelper.cxx +++ b/chart2/source/tools/PropertyHelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -312,3 +313,5 @@ void setEmptyPropertyValueDefault( tPropertyValueMap & rOutMap, tPropertyValueMa } // namespace PropertyHelper } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/RangeHighlighter.cxx b/chart2/source/tools/RangeHighlighter.cxx index 1565344923b1..8f3a504bfb0a 100644 --- a/chart2/source/tools/RangeHighlighter.cxx +++ b/chart2/source/tools/RangeHighlighter.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -404,3 +405,5 @@ void SAL_CALL RangeHighlighter::disposing() } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/ReferenceSizeProvider.cxx b/chart2/source/tools/ReferenceSizeProvider.cxx index 5a37f4980323..909eaf61942c 100644 --- a/chart2/source/tools/ReferenceSizeProvider.cxx +++ b/chart2/source/tools/ReferenceSizeProvider.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -376,3 +377,5 @@ void ReferenceSizeProvider::setAutoResizeState( ReferenceSizeProvider::AutoResiz } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/RegressionCurveCalculator.cxx b/chart2/source/tools/RegressionCurveCalculator.cxx index 68e041e668ca..1d4b4450ef4a 100644 --- a/chart2/source/tools/RegressionCurveCalculator.cxx +++ b/chart2/source/tools/RegressionCurveCalculator.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -166,3 +167,5 @@ OUString SAL_CALL RegressionCurveCalculator::getFormattedRepresentation( } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/RegressionCurveHelper.cxx b/chart2/source/tools/RegressionCurveHelper.cxx index b553dbc2d217..3014a89eae35 100644 --- a/chart2/source/tools/RegressionCurveHelper.cxx +++ b/chart2/source/tools/RegressionCurveHelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -734,3 +735,5 @@ bool RegressionCurveHelper::hasEquation( const Reference< chart2::XRegressionCur //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/RegressionCurveModel.cxx b/chart2/source/tools/RegressionCurveModel.cxx index cf5be998308e..65f33aec111e 100644 --- a/chart2/source/tools/RegressionCurveModel.cxx +++ b/chart2/source/tools/RegressionCurveModel.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -439,3 +440,5 @@ uno::Reference< util::XCloneable > SAL_CALL PotentialRegressionCurve::createClon } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/RegressionEquation.cxx b/chart2/source/tools/RegressionEquation.cxx index ea16e5b7702a..452242df6705 100644 --- a/chart2/source/tools/RegressionEquation.cxx +++ b/chart2/source/tools/RegressionEquation.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -360,3 +361,5 @@ using impl::RegressionEquation_Base; IMPLEMENT_FORWARD_XINTERFACE2( RegressionEquation, RegressionEquation_Base, ::property::OPropertySet ) } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/RelativePositionHelper.cxx b/chart2/source/tools/RelativePositionHelper.cxx index 4d566b1f7f48..56d4d072efe2 100644 --- a/chart2/source/tools/RelativePositionHelper.cxx +++ b/chart2/source/tools/RelativePositionHelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -397,3 +398,5 @@ bool RelativePositionHelper::moveObject( } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/RelativeSizeHelper.cxx b/chart2/source/tools/RelativeSizeHelper.cxx index d3da090ca397..7f3fb3fb2154 100644 --- a/chart2/source/tools/RelativeSizeHelper.cxx +++ b/chart2/source/tools/RelativeSizeHelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -98,3 +99,5 @@ void RelativeSizeHelper::adaptFontSizes( } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/ResId.cxx b/chart2/source/tools/ResId.cxx index 0d6e35974aaa..2b74471495a7 100644 --- a/chart2/source/tools/ResId.cxx +++ b/chart2/source/tools/ResId.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -45,3 +46,5 @@ SchResId::SchResId( sal_Int16 nId ) } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/RessourceManager.cxx b/chart2/source/tools/RessourceManager.cxx index a2d43b309019..ffcd62a721a2 100644 --- a/chart2/source/tools/RessourceManager.cxx +++ b/chart2/source/tools/RessourceManager.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -47,3 +48,5 @@ ResMgr & RessourceManager::getRessourceManager() } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/Scaling.cxx b/chart2/source/tools/Scaling.cxx index e106f1dcc5e2..1dd5b9fb17e7 100644 --- a/chart2/source/tools/Scaling.cxx +++ b/chart2/source/tools/Scaling.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -269,3 +270,5 @@ APPHELPER_XSERVICEINFO_IMPL( PowerScaling, lcl_aServiceName_Power ) //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/SceneProperties.cxx b/chart2/source/tools/SceneProperties.cxx index 21a95d99be7d..7f66b14ff6db 100644 --- a/chart2/source/tools/SceneProperties.cxx +++ b/chart2/source/tools/SceneProperties.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -380,3 +381,5 @@ void SceneProperties::AddDefaultsToMap( } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/StatisticsHelper.cxx b/chart2/source/tools/StatisticsHelper.cxx index 721451c276da..943b6d97040d 100644 --- a/chart2/source/tools/StatisticsHelper.cxx +++ b/chart2/source/tools/StatisticsHelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -401,3 +402,5 @@ bool StatisticsHelper::usesErrorBarRanges( } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/ThreeDHelper.cxx b/chart2/source/tools/ThreeDHelper.cxx index 44ed73eade43..38c4adf59509 100644 --- a/chart2/source/tools/ThreeDHelper.cxx +++ b/chart2/source/tools/ThreeDHelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1525,3 +1526,5 @@ CuboidPlanePosition ThreeDHelper::getAutomaticCuboidPlanePositionForStandardBott //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/TitleHelper.cxx b/chart2/source/tools/TitleHelper.cxx index 828a523245ff..8b414ac35562 100644 --- a/chart2/source/tools/TitleHelper.cxx +++ b/chart2/source/tools/TitleHelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -376,3 +377,4 @@ bool TitleHelper::getTitleType( eTitleType& rType } //namespace chart //............................................................................. +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/TrueGuard.cxx b/chart2/source/tools/TrueGuard.cxx index 6992552367ed..1fec6904c8b3 100644 --- a/chart2/source/tools/TrueGuard.cxx +++ b/chart2/source/tools/TrueGuard.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -45,3 +46,5 @@ TrueGuard::~TrueGuard() } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/UncachedDataSequence.cxx b/chart2/source/tools/UncachedDataSequence.cxx index 52cc6b9c03b6..ccaca323b60e 100644 --- a/chart2/source/tools/UncachedDataSequence.cxx +++ b/chart2/source/tools/UncachedDataSequence.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -377,3 +378,5 @@ void UncachedDataSequence::fireModifyEvent() } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/UserDefinedProperties.cxx b/chart2/source/tools/UserDefinedProperties.cxx index 707c48c1a6cc..f758d376add5 100644 --- a/chart2/source/tools/UserDefinedProperties.cxx +++ b/chart2/source/tools/UserDefinedProperties.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -71,3 +72,5 @@ void UserDefinedProperties::AddPropertiesToVector( } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/WeakListenerAdapter.cxx b/chart2/source/tools/WeakListenerAdapter.cxx index bbb54e20bdce..91a91f66b52e 100644 --- a/chart2/source/tools/WeakListenerAdapter.cxx +++ b/chart2/source/tools/WeakListenerAdapter.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -74,3 +75,5 @@ void SAL_CALL WeakSelectionChangeListenerAdapter::selectionChanged( const lang:: } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/WrappedDefaultProperty.cxx b/chart2/source/tools/WrappedDefaultProperty.cxx index 03178d204ef7..084eceb4ce46 100644 --- a/chart2/source/tools/WrappedDefaultProperty.cxx +++ b/chart2/source/tools/WrappedDefaultProperty.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -90,3 +91,5 @@ beans::PropertyState WrappedDefaultProperty::getPropertyState( } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/WrappedDirectStateProperty.cxx b/chart2/source/tools/WrappedDirectStateProperty.cxx index 601b6e199d59..6fc4e324fb63 100644 --- a/chart2/source/tools/WrappedDirectStateProperty.cxx +++ b/chart2/source/tools/WrappedDirectStateProperty.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -57,3 +58,5 @@ beans::PropertyState WrappedDirectStateProperty::getPropertyState( } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/WrappedIgnoreProperty.cxx b/chart2/source/tools/WrappedIgnoreProperty.cxx index aaa6c545a799..8f1d7a793e29 100644 --- a/chart2/source/tools/WrappedIgnoreProperty.cxx +++ b/chart2/source/tools/WrappedIgnoreProperty.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -146,3 +147,5 @@ void WrappedIgnoreProperties::addIgnoreFillProperties_only_BitmapProperties( ::s //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/WrappedProperty.cxx b/chart2/source/tools/WrappedProperty.cxx index b41d8a331f11..fcec72ea1745 100644 --- a/chart2/source/tools/WrappedProperty.cxx +++ b/chart2/source/tools/WrappedProperty.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -148,3 +149,5 @@ beans::PropertyState WrappedProperty::getPropertyState( const Reference< beans:: //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/WrappedPropertySet.cxx b/chart2/source/tools/WrappedPropertySet.cxx index 843aeb261a5f..5c7257da2f3d 100644 --- a/chart2/source/tools/WrappedPropertySet.cxx +++ b/chart2/source/tools/WrappedPropertySet.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -493,3 +494,5 @@ tWrappedPropertyMap& WrappedPropertySet::getWrappedPropertyMap() //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/XMLRangeHelper.cxx b/chart2/source/tools/XMLRangeHelper.cxx index c5d345db0124..66c0de454ce1 100644 --- a/chart2/source/tools/XMLRangeHelper.cxx +++ b/chart2/source/tools/XMLRangeHelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -416,3 +417,5 @@ OUString getXMLStringFromCellRange( const CellRange & rRange ) } // namespace XMLRangeHelper } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/_serviceregistration_tools.cxx b/chart2/source/tools/_serviceregistration_tools.cxx index 387b87dfab5a..dac0efaf0b47 100644 --- a/chart2/source/tools/_serviceregistration_tools.cxx +++ b/chart2/source/tools/_serviceregistration_tools.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -198,3 +199,5 @@ OOO_DLLPUBLIC_CHARTTOOLS void * SAL_CALL component_getFactory( } } //========================================================================= + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/axes/MinimumAndMaximumSupplier.cxx b/chart2/source/view/axes/MinimumAndMaximumSupplier.cxx index 88f99b493144..f9522bdc0005 100644 --- a/chart2/source/view/axes/MinimumAndMaximumSupplier.cxx +++ b/chart2/source/view/axes/MinimumAndMaximumSupplier.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -199,3 +200,5 @@ void MergedMinimumAndMaximumSupplier::clearMinimumAndMaximumSupplierList() //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/axes/ScaleAutomatism.cxx b/chart2/source/view/axes/ScaleAutomatism.cxx index 890bf87df96e..72256024ef7c 100644 --- a/chart2/source/view/axes/ScaleAutomatism.cxx +++ b/chart2/source/view/axes/ScaleAutomatism.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -758,3 +759,5 @@ void ScaleAutomatism::calculateExplicitIncrementAndScaleForLinear( //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/axes/TickmarkHelper.cxx b/chart2/source/view/axes/TickmarkHelper.cxx index 9e2e2707c035..719ea642724a 100644 --- a/chart2/source/view/axes/TickmarkHelper.cxx +++ b/chart2/source/view/axes/TickmarkHelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -935,3 +936,5 @@ TickmarkHelper_3D::~TickmarkHelper_3D() //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/axes/VAxisBase.cxx b/chart2/source/view/axes/VAxisBase.cxx index 0159fb20cad6..cc9402c669aa 100644 --- a/chart2/source/view/axes/VAxisBase.cxx +++ b/chart2/source/view/axes/VAxisBase.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -251,3 +252,5 @@ void VAxisBase::updateUnscaledValuesAtTicks( TickIter& rIter ) //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/axes/VAxisOrGridBase.cxx b/chart2/source/view/axes/VAxisOrGridBase.cxx index f2e2e90c1045..19e219e5fb37 100644 --- a/chart2/source/view/axes/VAxisOrGridBase.cxx +++ b/chart2/source/view/axes/VAxisOrGridBase.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -96,3 +97,5 @@ TickmarkHelper* VAxisOrGridBase::createTickmarkHelper() //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/axes/VAxisProperties.cxx b/chart2/source/view/axes/VAxisProperties.cxx index 1e3e62894741..fc5e3757e5aa 100644 --- a/chart2/source/view/axes/VAxisProperties.cxx +++ b/chart2/source/view/axes/VAxisProperties.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -484,3 +485,5 @@ sal_Bool AxisLabelProperties::getIsStaggered() const //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx index 8ec895fbd452..7d6a7094c203 100644 --- a/chart2/source/view/axes/VCartesianAxis.cxx +++ b/chart2/source/view/axes/VCartesianAxis.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1598,3 +1599,5 @@ void SAL_CALL VCartesianAxis::createShapes() //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/axes/VCartesianCoordinateSystem.cxx b/chart2/source/view/axes/VCartesianCoordinateSystem.cxx index a196397e0e9f..35f626ff25f1 100644 --- a/chart2/source/view/axes/VCartesianCoordinateSystem.cxx +++ b/chart2/source/view/axes/VCartesianCoordinateSystem.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -248,3 +249,5 @@ void VCartesianCoordinateSystem::updateScalesAndIncrementsOnAxes() //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/axes/VCartesianGrid.cxx b/chart2/source/view/axes/VCartesianGrid.cxx index 7fe6b9937ca6..b7b6de67b8e9 100644 --- a/chart2/source/view/axes/VCartesianGrid.cxx +++ b/chart2/source/view/axes/VCartesianGrid.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -337,3 +338,5 @@ void SAL_CALL VCartesianGrid::createShapes() //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/axes/VCoordinateSystem.cxx b/chart2/source/view/axes/VCoordinateSystem.cxx index bc908acdf85a..7e75acd55933 100644 --- a/chart2/source/view/axes/VCoordinateSystem.cxx +++ b/chart2/source/view/axes/VCoordinateSystem.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -596,3 +597,5 @@ sal_Int32 VCoordinateSystem::getNumberFormatKeyForAxis( //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/axes/VPolarAngleAxis.cxx b/chart2/source/view/axes/VPolarAngleAxis.cxx index 865a7848aa9a..968c52b68bcd 100644 --- a/chart2/source/view/axes/VPolarAngleAxis.cxx +++ b/chart2/source/view/axes/VPolarAngleAxis.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -232,3 +233,5 @@ void SAL_CALL VPolarAngleAxis::createShapes() //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/axes/VPolarAxis.cxx b/chart2/source/view/axes/VPolarAxis.cxx index 23908585ec3a..5caee2fff67a 100644 --- a/chart2/source/view/axes/VPolarAxis.cxx +++ b/chart2/source/view/axes/VPolarAxis.cxx @@ -1,3 +1,4 @@ +/* -*- 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,3 +82,5 @@ sal_Bool SAL_CALL VPolarAxis::isAnythingToDraw() //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/axes/VPolarCoordinateSystem.cxx b/chart2/source/view/axes/VPolarCoordinateSystem.cxx index 76e057a2b32d..e3aaf77c0d38 100644 --- a/chart2/source/view/axes/VPolarCoordinateSystem.cxx +++ b/chart2/source/view/axes/VPolarCoordinateSystem.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -209,3 +210,5 @@ void VPolarCoordinateSystem::createGridShapes() //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/axes/VPolarGrid.cxx b/chart2/source/view/axes/VPolarGrid.cxx index 0bd98b642acb..5d8105db0fab 100644 --- a/chart2/source/view/axes/VPolarGrid.cxx +++ b/chart2/source/view/axes/VPolarGrid.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -271,3 +272,5 @@ void SAL_CALL VPolarGrid::createShapes() //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/axes/VPolarRadiusAxis.cxx b/chart2/source/view/axes/VPolarRadiusAxis.cxx index 2206d4d8f559..b7792a783138 100644 --- a/chart2/source/view/axes/VPolarRadiusAxis.cxx +++ b/chart2/source/view/axes/VPolarRadiusAxis.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -184,3 +185,5 @@ void SAL_CALL VPolarRadiusAxis::createShapes() //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/charttypes/AreaChart.cxx b/chart2/source/view/charttypes/AreaChart.cxx index 7c9a182cfc42..4d2f5ad8716b 100644 --- a/chart2/source/view/charttypes/AreaChart.cxx +++ b/chart2/source/view/charttypes/AreaChart.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -976,3 +977,5 @@ void AreaChart::createShapes() //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/charttypes/BarChart.cxx b/chart2/source/view/charttypes/BarChart.cxx index ad921f2919e7..cbcfd48f0f9d 100644 --- a/chart2/source/view/charttypes/BarChart.cxx +++ b/chart2/source/view/charttypes/BarChart.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -964,3 +965,5 @@ void BarChart::createShapes() //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/charttypes/BarPositionHelper.cxx b/chart2/source/view/charttypes/BarPositionHelper.cxx index b1735e99de5d..271e0c5dd636 100644 --- a/chart2/source/view/charttypes/BarPositionHelper.cxx +++ b/chart2/source/view/charttypes/BarPositionHelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -136,3 +137,5 @@ uno::Reference< XTransformation > BarPositionHelper::getTransformationScaledLogi //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/charttypes/BubbleChart.cxx b/chart2/source/view/charttypes/BubbleChart.cxx index c5454edcc6fd..27b952938b82 100644 --- a/chart2/source/view/charttypes/BubbleChart.cxx +++ b/chart2/source/view/charttypes/BubbleChart.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -415,3 +416,5 @@ void BubbleChart::createShapes() //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/charttypes/CandleStickChart.cxx b/chart2/source/view/charttypes/CandleStickChart.cxx index bb1339d8d5e8..971545c98415 100644 --- a/chart2/source/view/charttypes/CandleStickChart.cxx +++ b/chart2/source/view/charttypes/CandleStickChart.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -367,3 +368,5 @@ void CandleStickChart::createShapes() //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/charttypes/CategoryPositionHelper.cxx b/chart2/source/view/charttypes/CategoryPositionHelper.cxx index d43fd0856e02..657004706e81 100644 --- a/chart2/source/view/charttypes/CategoryPositionHelper.cxx +++ b/chart2/source/view/charttypes/CategoryPositionHelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -98,3 +99,5 @@ void CategoryPositionHelper::setOuterDistance( double fOuterDistance ) //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/charttypes/PieChart.cxx b/chart2/source/view/charttypes/PieChart.cxx index 1e21659a7195..edb9e08b8018 100644 --- a/chart2/source/view/charttypes/PieChart.cxx +++ b/chart2/source/view/charttypes/PieChart.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -878,3 +879,5 @@ void PieChart::rearrangeLabelToAvoidOverlapIfRequested( const awt::Size& rPageSi //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/charttypes/Splines.cxx b/chart2/source/view/charttypes/Splines.cxx index 67ecac93b64c..1865ab87c779 100644 --- a/chart2/source/view/charttypes/Splines.cxx +++ b/chart2/source/view/charttypes/Splines.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -543,3 +544,4 @@ void SplineCalculater::CalculateBSplines( } //namespace chart //............................................................................. +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx index 840cbbe3e1e1..97a3cbd86f2d 100644 --- a/chart2/source/view/charttypes/VSeriesPlotter.cxx +++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -2108,3 +2109,5 @@ VSeriesPlotter* VSeriesPlotter::createSeriesPlotter( //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/diagram/VDiagram.cxx b/chart2/source/view/diagram/VDiagram.cxx index 4174226b6f62..774e3c8809cb 100644 --- a/chart2/source/view/diagram/VDiagram.cxx +++ b/chart2/source/view/diagram/VDiagram.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -809,3 +810,4 @@ void VDiagram::reduceToMimimumSize() } //namespace chart //............................................................................. +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/main/ChartItemPool.cxx b/chart2/source/view/main/ChartItemPool.cxx index d8f997d36da9..f0a57b7f2f6a 100644 --- a/chart2/source/view/main/ChartItemPool.cxx +++ b/chart2/source/view/main/ChartItemPool.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -256,3 +257,5 @@ SfxItemPool* ChartItemPool::CreateChartItemPool() } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx index 2347824664c5..2e2d0ead72e7 100644 --- a/chart2/source/view/main/ChartView.cxx +++ b/chart2/source/view/main/ChartView.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -3185,3 +3186,5 @@ uno::Sequence< ::rtl::OUString > ChartView::getAvailableServiceNames() throw (un //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/main/Clipping.cxx b/chart2/source/view/main/Clipping.cxx index e61096e5a0ba..20e59e4a8442 100644 --- a/chart2/source/view/main/Clipping.cxx +++ b/chart2/source/view/main/Clipping.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -302,3 +303,5 @@ void Clipping::clipPolygonAtRectangle( const drawing::PolyPolygonShape3D& rPolyg //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/main/DataPointSymbolSupplier.cxx b/chart2/source/view/main/DataPointSymbolSupplier.cxx index d59a011cd429..13749d205f91 100644 --- a/chart2/source/view/main/DataPointSymbolSupplier.cxx +++ b/chart2/source/view/main/DataPointSymbolSupplier.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -64,3 +65,5 @@ uno::Reference< drawing::XShapes > DataPointSymbolSupplier::create2DSymbolList( //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/main/DrawModelWrapper.cxx b/chart2/source/view/main/DrawModelWrapper.cxx index 577f450172b5..eddc7dee4fae 100644 --- a/chart2/source/view/main/DrawModelWrapper.cxx +++ b/chart2/source/view/main/DrawModelWrapper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -409,3 +410,5 @@ bool DrawModelWrapper::removeShape( const uno::Reference< drawing::XShape >& xSh //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/main/LabelPositionHelper.cxx b/chart2/source/view/main/LabelPositionHelper.cxx index 24ec5a285468..0ed941757a33 100644 --- a/chart2/source/view/main/LabelPositionHelper.cxx +++ b/chart2/source/view/main/LabelPositionHelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -486,3 +487,5 @@ void LabelPositionHelper::correctPositionForRotation( const uno::Reference< draw //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/main/Linear3DTransformation.cxx b/chart2/source/view/main/Linear3DTransformation.cxx index 9292ee6eb757..e804735dbaa6 100644 --- a/chart2/source/view/main/Linear3DTransformation.cxx +++ b/chart2/source/view/main/Linear3DTransformation.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -105,3 +106,5 @@ sal_Int32 SAL_CALL Linear3DTransformation::getTargetDimension() } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/main/NumberFormatterWrapper.cxx b/chart2/source/view/main/NumberFormatterWrapper.cxx index 4e4cd342506c..2e5a85f3c5ab 100644 --- a/chart2/source/view/main/NumberFormatterWrapper.cxx +++ b/chart2/source/view/main/NumberFormatterWrapper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -167,3 +168,5 @@ rtl::OUString NumberFormatterWrapper::getFormattedString( //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/main/PlotterBase.cxx b/chart2/source/view/main/PlotterBase.cxx index 08f43dc7064d..3dab3c42c4be 100644 --- a/chart2/source/view/main/PlotterBase.cxx +++ b/chart2/source/view/main/PlotterBase.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -133,3 +134,5 @@ bool PlotterBase::isValidPosition( const drawing::Position3D& rPos ) //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/main/PlottingPositionHelper.cxx b/chart2/source/view/main/PlottingPositionHelper.cxx index deb390b70a79..65ae1fa6c000 100644 --- a/chart2/source/view/main/PlottingPositionHelper.cxx +++ b/chart2/source/view/main/PlottingPositionHelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -665,3 +666,5 @@ sal_Int32 SAL_CALL PolarPlottingPositionHelper::getTargetDimension() throw (uno: //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/main/PolarLabelPositionHelper.cxx b/chart2/source/view/main/PolarLabelPositionHelper.cxx index 8e5402b48d63..bcc53068bef0 100644 --- a/chart2/source/view/main/PolarLabelPositionHelper.cxx +++ b/chart2/source/view/main/PolarLabelPositionHelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -186,3 +187,5 @@ awt::Point PolarLabelPositionHelper::getLabelScreenPositionAndAlignmentForUnitCi //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/main/PropertyMapper.cxx b/chart2/source/view/main/PropertyMapper.cxx index 1979582763fa..7e8b70c33eb4 100644 --- a/chart2/source/view/main/PropertyMapper.cxx +++ b/chart2/source/view/main/PropertyMapper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -537,3 +538,5 @@ void PropertyMapper::getPreparedTextShapePropertyLists( //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/main/ShapeFactory.cxx b/chart2/source/view/main/ShapeFactory.cxx index bd19f2d380b7..f42036efa37f 100644 --- a/chart2/source/view/main/ShapeFactory.cxx +++ b/chart2/source/view/main/ShapeFactory.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -2107,3 +2108,5 @@ void ShapeFactory::removeSubShapes( const uno::Reference< drawing::XShapes >& xS //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/main/Stripe.cxx b/chart2/source/view/main/Stripe.cxx index 2df78e2a8e91..0daddbbc0ea6 100644 --- a/chart2/source/view/main/Stripe.cxx +++ b/chart2/source/view/main/Stripe.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -358,3 +359,5 @@ uno::Any Stripe::getTexturePolygon( short nRotatedTexture ) const //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx index c43302981a8f..3fa2f3d1828b 100644 --- a/chart2/source/view/main/VDataSeries.cxx +++ b/chart2/source/view/main/VDataSeries.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -983,3 +984,5 @@ sal_Int32 VDataSeries::getMissingValueTreatment() const //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/main/VLegend.cxx b/chart2/source/view/main/VLegend.cxx index 7101a984ee24..f5208d3170e3 100644 --- a/chart2/source/view/main/VLegend.cxx +++ b/chart2/source/view/main/VLegend.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -832,3 +833,5 @@ void VLegend::changePosition( //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/main/VLegendSymbolFactory.cxx b/chart2/source/view/main/VLegendSymbolFactory.cxx index 958a8defe0b6..ee5b07d6e830 100644 --- a/chart2/source/view/main/VLegendSymbolFactory.cxx +++ b/chart2/source/view/main/VLegendSymbolFactory.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -372,3 +373,5 @@ Reference< drawing::XShape > VLegendSymbolFactory::createSymbol( } } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/main/VLineProperties.cxx b/chart2/source/view/main/VLineProperties.cxx index dc8409a6891d..90f80462694a 100644 --- a/chart2/source/view/main/VLineProperties.cxx +++ b/chart2/source/view/main/VLineProperties.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -107,3 +108,5 @@ bool VLineProperties::isLineVisible() const //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/main/VPolarTransformation.cxx b/chart2/source/view/main/VPolarTransformation.cxx index fd3037316cc6..8c40283cb4a4 100644 --- a/chart2/source/view/main/VPolarTransformation.cxx +++ b/chart2/source/view/main/VPolarTransformation.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -92,3 +93,5 @@ sal_Int32 SAL_CALL VPolarTransformation::getTargetDimension() } // namespace chart + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/main/VTitle.cxx b/chart2/source/view/main/VTitle.cxx index f62142735b7c..7723b802a537 100644 --- a/chart2/source/view/main/VTitle.cxx +++ b/chart2/source/view/main/VTitle.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -297,3 +298,5 @@ void VTitle::createShapes( //............................................................................. } //namespace chart //............................................................................. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/main/_serviceregistration_view.cxx b/chart2/source/view/main/_serviceregistration_view.cxx index 26f8b9d7cf7e..8e6059afce6a 100644 --- a/chart2/source/view/main/_serviceregistration_view.cxx +++ b/chart2/source/view/main/_serviceregistration_view.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -69,3 +70,5 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( } } //========================================================================= + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/workbench/addin/sampleaddin.cxx b/chart2/workbench/addin/sampleaddin.cxx index a986dd9557c7..7b5b672d1be6 100644 --- a/chart2/workbench/addin/sampleaddin.cxx +++ b/chart2/workbench/addin/sampleaddin.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -714,3 +715,5 @@ lang::Locale SAL_CALL SampleAddIn::getLocale() { return maLocale; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/inc/address.hxx b/sc/inc/address.hxx index 15084565dfe0..bb4e97d45cf8 100644 --- a/sc/inc/address.hxx +++ b/sc/inc/address.hxx @@ -232,6 +232,9 @@ inline SCTAB SanitizeTab( SCTAB nTab, SCTAB nMaxTab ) #define SCA_VALID_ROW 0x0100 #define SCA_VALID_COL 0x0200 #define SCA_VALID_TAB 0x0400 +// SCA_BITS is a convience for +// (SCA_VALID_TAB | SCA_VALID_COL | SCA_VALID_ROW | SCA_TAB_3D | SCA_TAB_ABSOLUTE | SCA_ROW_ABSOLUTE | SCA_COL_ABSOLUTE) +#define SCA_BITS 0x070F // somewhat cheesy kludge to force the display of the document name even for // local references. Requires TAB_3D to be valid #define SCA_FORCE_DOC 0x0800 diff --git a/sc/inc/addruno.hxx b/sc/inc/addruno.hxx index d6df571a29aa..6e71230b21d4 100644 --- a/sc/inc/addruno.hxx +++ b/sc/inc/addruno.hxx @@ -47,7 +47,7 @@ private: sal_Int32 nRefSheet; sal_Bool bIsRange; - sal_Bool ParseUIString( const String& rUIString ); + sal_Bool ParseUIString( const String& rUIString, ::formula::FormulaGrammar::AddressConvention eConv = ::formula::FormulaGrammar::CONV_OOO ); public: diff --git a/sc/inc/appoptio.hxx b/sc/inc/appoptio.hxx index 91fc43fc249a..bbff1dfd6ad4 100644 --- a/sc/inc/appoptio.hxx +++ b/sc/inc/appoptio.hxx @@ -44,6 +44,10 @@ public: void SetDefaults(); + // Set or get the initial tab count for new spreadsheet, it is used by VBA API currently. + void SetTabCountInNewSpreadsheet( sal_Int16 nCount ) { nTabCountInNewSpreadsheet = nCount; } + sal_Int16 GetTabCountInNewSpreadsheet() const { return nTabCountInNewSpreadsheet; } + void SetAppMetric( FieldUnit eUnit ) { eMetric = eUnit; } FieldUnit GetAppMetric() const { return eMetric; } void SetZoom( USHORT nNew ) { nZoom = nNew; } @@ -87,6 +91,7 @@ public: const ScAppOptions& operator= ( const ScAppOptions& rOpt ); private: + sal_Int16 nTabCountInNewSpreadsheet; FieldUnit eMetric; USHORT nLRUFuncCount; USHORT* pLRUList; diff --git a/sc/inc/cell.hxx b/sc/inc/cell.hxx index f9cce9e94ed2..4e2c0395ab9d 100644 --- a/sc/inc/cell.hxx +++ b/sc/inc/cell.hxx @@ -406,7 +406,7 @@ public: const formula::FormulaGrammar::Grammar = formula::FormulaGrammar::GRAM_DEFAULT ) const; void SetDirty(); - inline void SetDirtyVar() { bDirty = TRUE; } + void SetDirtyVar(); // If setting entire document dirty after load, no broadcasts but still append to FormulaTree. void SetDirtyAfterLoad(); inline void ResetTableOpDirtyVar() { bTableOpDirty = FALSE; } diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 8964f756f07e..1c2e20e55d32 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -104,6 +104,7 @@ class ScDrawLayer; class ScExtDocOptions; class ScExternalRefManager; class ScFormulaCell; +class ScMacroManager; class ScMarkData; class ScOutlineTable; class ScPatternAttr; @@ -309,6 +310,8 @@ private: ::std::auto_ptr<ScClipParam> mpClipParam; ::std::auto_ptr<ScExternalRefManager> pExternalRefMgr; + ::std::auto_ptr<ScMacroManager> mpMacroMgr; + // mutable for lazy construction mutable ::std::auto_ptr< ScFormulaParserPool > @@ -467,6 +470,8 @@ public: const String& GetCodeName() const { return aDocCodeName; } void SetCodeName( const String& r ) { aDocCodeName = r; } + SC_DLLPUBLIC NameToNameMap* GetLocalNameMap( SCTAB& rTab ); + void GetDocStat( ScDocStat& rDocStat ); SC_DLLPUBLIC void InitDrawLayer( SfxObjectShell* pDocShell = NULL ); @@ -586,6 +591,7 @@ public: BOOL HasSelectedBlockMatrixFragment( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, const ScMarkData& rMark ) const; + BOOL HasSelectedBlockMatrixFragment( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTAB ) const; BOOL GetMatrixFormulaRange( const ScAddress& rCellPos, ScRange& rMatrix ); @@ -958,7 +964,7 @@ public: SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab, ScDirection eDir ); - void FindAreaPos( SCCOL& rCol, SCROW& rRow, SCTAB nTab, SCsCOL nMovX, SCsROW nMovY ); + SC_DLLPUBLIC void FindAreaPos( SCCOL& rCol, SCROW& rRow, SCTAB nTab, SCsCOL nMovX, SCsROW nMovY ); SC_DLLPUBLIC void GetNextPos( SCCOL& rCol, SCROW& rRow, SCTAB nTab, SCsCOL nMovX, SCsROW nMovY, BOOL bMarked, BOOL bUnprotected, const ScMarkData& rMark ); @@ -979,7 +985,7 @@ public: SCROW nStartRow, SCSIZE nSize, ScDocument* pRefUndoDoc = NULL, BOOL* pUndoOutline = NULL, const ScMarkData* pTabMark = NULL ); - void DeleteRow( const ScRange& rRange, + SC_DLLPUBLIC void DeleteRow( const ScRange& rRange, ScDocument* pRefUndoDoc = NULL, BOOL* pUndoOutline = NULL ); BOOL InsertCol( SCROW nStartRow, SCTAB nStartTab, SCROW nEndRow, SCTAB nEndTab, @@ -1017,7 +1023,7 @@ public: SC_DLLPUBLIC void ResetClip( ScDocument* pSourceDoc, const ScMarkData* pMarks ); SC_DLLPUBLIC void ResetClip( ScDocument* pSourceDoc, SCTAB nTab ); void SetCutMode( BOOL bCut ); - BOOL IsCutMode(); + SC_DLLPUBLIC BOOL IsCutMode(); void SetClipArea( const ScRange& rArea, BOOL bCut = FALSE ); SC_DLLPUBLIC BOOL IsDocVisible() const { return bIsVisible; } @@ -1039,6 +1045,9 @@ public: const ScMarkData* pMarks = NULL, bool bAllTabs = false, bool bKeepScenarioFlags = false, bool bIncludeObjects = false, bool bCloneNoteCaptions = true); + void CopyToClip4VBA(const ScClipParam& rClipParam, ScDocument* pClipDoc, bool bKeepScenarioFlags = false, + bool bIncludeObjects = false, bool bCloneNoteCaptions = true); + void CopyTabToClip(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, SCTAB nTab, ScDocument* pClipDoc = NULL); void CopyBlockFromClip( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, @@ -1594,6 +1603,7 @@ public: SC_DLLPUBLIC ScLkUpdMode GetLinkMode() const { return eLinkMode ;} void SetLinkMode( ScLkUpdMode nSet ) { eLinkMode = nSet;} + SC_DLLPUBLIC ScMacroManager* GetMacroManager(); private: ScDocument(const ScDocument& r); // disabled with no definition @@ -1861,6 +1871,7 @@ private: // CLOOK-Impl-Methoden const ScRange& r, SCsCOL nDx, SCsROW nDy, SCsTAB nDz ); void CopyRangeNamesToClip(ScDocument* pClipDoc, const ScRange& rClipRange, const ScMarkData* pMarks, bool bAllTabs); + void CopyRangeNamesToClip(ScDocument* pClipDoc, const ScRange& rClipRange, SCTAB nTab); void CopyRangeNamesFromClip(ScDocument* pClipDoc, ScClipRangeNameData& rRangeNames); void UpdateRangeNamesInFormulas( ScClipRangeNameData& rRangeNames, const ScRangeList& rDestRanges, const ScMarkData& rMark, diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx index db87877df738..1f31acd8349b 100644 --- a/sc/inc/global.hxx +++ b/sc/inc/global.hxx @@ -225,6 +225,7 @@ const USHORT IDF_HARDATTR = 0x0020; /// Hard cell attributes. const USHORT IDF_STYLES = 0x0040; /// Cell styles. const USHORT IDF_OBJECTS = 0x0080; /// Drawing objects. const USHORT IDF_EDITATTR = 0x0100; /// Rich-text attributes. +const USHORT IDF_SPECIAL_BOOLEAN = 0x1000; const USHORT IDF_ATTRIB = IDF_HARDATTR | IDF_STYLES; const USHORT IDF_CONTENTS = IDF_VALUE | IDF_DATETIME | IDF_STRING | IDF_NOTE | IDF_FORMULA; const USHORT IDF_ALL = IDF_CONTENTS | IDF_ATTRIB | IDF_OBJECTS; diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc index bc3094424d69..67f2da962258 100644 --- a/sc/inc/globstr.hrc +++ b/sc/inc/globstr.hrc @@ -579,8 +579,23 @@ #define STR_UNDO_INSERT_CURRENT_TIME 441 #define STR_OPTIONS_WARN_SEPARATORS 442 - -#define STR_COUNT 443 +#define STR_SHAPE_AUTOSHAPE 443 +#define STR_SHAPE_RECTANGLE 444 +#define STR_SHAPE_LINE 445 +#define STR_SHAPE_OVAL 446 +#define STR_SHAPE_TEXTBOX 447 + +#define STR_FORM_BUTTON 448 +#define STR_FORM_CHECKBOX 449 +#define STR_FORM_OPTIONBUTTON 450 +#define STR_FORM_LABEL 451 +#define STR_FORM_LISTBOX 452 +#define STR_FORM_GROUPBOX 453 +#define STR_FORM_DROPDOWN 454 +#define STR_FORM_SPINNER 455 +#define STR_FORM_SCROLLBAR 456 + +#define STR_COUNT 456 #endif diff --git a/sc/inc/macromgr.hxx b/sc/inc/macromgr.hxx new file mode 100644 index 000000000000..ae99f8188189 --- /dev/null +++ b/sc/inc/macromgr.hxx @@ -0,0 +1,69 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: document.hxx,v $ + * $Revision: 1.115.36.9 $ + * + * 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_MACROMGR_HXX +#define SC_MACROMGR_HXX + +#include <com/sun/star/container/XContainerListener.hpp> + +#include "rtl/ustring.hxx" +#include "scdllapi.h" + +#include <hash_map> +#include <memory> + +class ScDocument; +class ScFormulaCell; +class ScUserMacroDepTracker; + +class ScMacroManager +{ +public: + explicit ScMacroManager(ScDocument* pDoc); + ~ScMacroManager(); + + SC_DLLPUBLIC void InitUserFuncData(); + SC_DLLPUBLIC void SetUserFuncVolatile( const rtl::OUString& sName, bool isVolatile ); + SC_DLLPUBLIC bool GetUserFuncVolatile( const rtl::OUString& sName ); + + void AddDependentCell(const ::rtl::OUString& aModuleName, ScFormulaCell* pCell); + void RemoveDependentCell(ScFormulaCell* pCell); + void BroadcastModuleUpdate(const ::rtl::OUString& aModuleName); + +private: + typedef std::hash_map< ::rtl::OUString, bool, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > NameBoolMap; + NameBoolMap mhFuncToVolatile; + com::sun::star::uno::Reference< com::sun::star::container::XContainerListener > mxContainerListener; + + ::std::auto_ptr<ScUserMacroDepTracker> mpDepTracker; + ScDocument* mpDoc; +}; + +#endif diff --git a/sc/inc/pch/precompiled_sc.cxx b/sc/inc/pch/precompiled_sc.cxx index 6d7b708ffd69..705088caeddb 100644 --- a/sc/inc/pch/precompiled_sc.cxx +++ b/sc/inc/pch/precompiled_sc.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -26,3 +27,5 @@ ************************************************************************/ #include "precompiled_sc.hxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/inc/rangenam.hxx b/sc/inc/rangenam.hxx index 889efcf164d7..37b70554b708 100644 --- a/sc/inc/rangenam.hxx +++ b/sc/inc/rangenam.hxx @@ -142,7 +142,7 @@ public: SC_DLLPUBLIC BOOL IsReference( ScRange& rRef ) const; BOOL IsReference( ScRange& rRef, const ScAddress& rPos ) const; - BOOL IsValidReference( ScRange& rRef ) const; + SC_DLLPUBLIC BOOL IsValidReference( ScRange& rRef ) const; BOOL IsRangeAtBlock( const ScRange& ) const; void UpdateTabRef(SCTAB nOldTable, USHORT nFlag, SCTAB nNewTable); diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index 88a28b043f6c..45acdd99c5d4 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -592,11 +592,9 @@ // #i59082# assign macro to shape #define SID_ASSIGNMACRO (SC_VIEW_START + 95) -#ifdef ISSUE66550_HLINK_FOR_SHAPES // #i66550# hyperlinks in shapes #define SID_DRAW_HLINK_EDIT (SC_VIEW_START + 96) #define SID_DRAW_HLINK_DELETE (SC_VIEW_START + 97) -#endif // "Zoom / Synchronize sheets" in options dialog #define SID_SC_OPT_SYNCZOOM (SC_VIEW_START + 98) @@ -1672,6 +1670,10 @@ // Insert current date and time to cell via command #define SID_INSERT_CURRENT_DATE (SC_OOO_BUILD_START + 4) #define SID_INSERT_CURRENT_TIME (SC_OOO_BUILD_START + 5) +// Data Form +#define SID_DATAFORM_NEW (SC_OOO_BUILD_START + 6) // message +#define SID_DATA_FORM (SC_OOO_BUILD_START + 7) // menu (in Data menu) +#define RID_SCDLG_DATAFORM (SC_OOO_BUILD_START + 8) // dialog // Compatibility options page #define RID_SCPAGE_COMPATIBILITY (SC_OOO_BUILD_START + 6) diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx index 442e62bdd9cb..d075785c56d6 100644 --- a/sc/inc/scabstdlg.hxx +++ b/sc/inc/scabstdlg.hxx @@ -40,6 +40,8 @@ #include "pivot.hxx" #include "i18npool/lang.h" +#include <tabvwsh.hxx> + class ScAsciiOptions; class ScAutoFormat; class ScAutoFormatData; @@ -113,6 +115,12 @@ public: virtual DelCellCmd GetDelCellCmd() const = 0; }; +//for dataform +class AbstractScDataFormDlg : public VclAbstractDialog //add for ScDeleteCellDlg +{ + +}; + class AbstractScDeleteContentsDlg: public VclAbstractDialog //add for ScDeleteContentsDlg { public: @@ -309,7 +317,7 @@ public: class ScAbstractDialogFactory { public: - static ScAbstractDialogFactory* Create(); + SC_DLLPUBLIC static ScAbstractDialogFactory* Create(); virtual AbstractScImportAsciiDlg * CreateScImportAsciiDlg( Window* pParent, String aDatName, //add for ScImportAsciiDlg SvStream* pInStream, int nId, @@ -343,6 +351,9 @@ public: virtual AbstractScDeleteCellDlg * CreateScDeleteCellDlg( Window* pParent, int nId, BOOL bDisallowCellMove = FALSE ) = 0 ; //add for ScDeleteCellDlg + //for dataform + virtual AbstractScDataFormDlg * CreateScDataFormDlg( Window* pParent, int nId, ScTabViewShell* pTabViewShell ) = 0 ; //add for ScDataFormDlg + virtual AbstractScDeleteContentsDlg * CreateScDeleteContentsDlg(Window* pParent,int nId, //add for ScDeleteContentsDlg USHORT nCheckDefaults = 0 ) = 0; virtual AbstractScFillSeriesDlg * CreateScFillSeriesDlg( Window* pParent, //add for ScFillSeriesDlg diff --git a/sc/inc/scmod.hxx b/sc/inc/scmod.hxx index bd5d40709cd4..1cbc3065c613 100644 --- a/sc/inc/scmod.hxx +++ b/sc/inc/scmod.hxx @@ -201,12 +201,12 @@ public: // Options: const ScViewOptions& GetViewOptions (); - const ScDocOptions& GetDocOptions (); +SC_DLLPUBLIC const ScDocOptions& GetDocOptions (); SC_DLLPUBLIC const ScAppOptions& GetAppOptions (); const ScInputOptions& GetInputOptions (); SC_DLLPUBLIC const ScPrintOptions& GetPrintOptions (); void SetViewOptions ( const ScViewOptions& rOpt ); - void SetDocOptions ( const ScDocOptions& rOpt ); +SC_DLLPUBLIC void SetDocOptions ( const ScDocOptions& rOpt ); SC_DLLPUBLIC void SetAppOptions ( const ScAppOptions& rOpt ); void SetInputOptions ( const ScInputOptions& rOpt ); void SetPrintOptions ( const ScPrintOptions& rOpt ); diff --git a/sc/inc/shapeuno.hxx b/sc/inc/shapeuno.hxx index ddbbf3108daf..880ab42357a5 100644 --- a/sc/inc/shapeuno.hxx +++ b/sc/inc/shapeuno.hxx @@ -52,6 +52,7 @@ namespace com { namespace sun { namespace star { class SdrObject; struct SvEventDescription; class ShapeUnoEventAccessImpl; +class ScMacroInfo; //------------------------------------------------------------------------ @@ -70,6 +71,7 @@ class ScShapeObj :public ScShapeObj_Base ,public ScShapeObj_TextBase { private: +friend ScMacroInfo* lcl_getShapeHyperMacroInfo( ScShapeObj* pShape, 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/table.hxx b/sc/inc/table.hxx index 21b6107bd535..dd3e05699ed4 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -89,6 +89,8 @@ struct ScSetStringParam; struct ScColWidthParam; struct ScColWidthParam; +typedef std::hash_map< ::rtl::OUString, rtl::OUString, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > NameToNameMap; + class ScTable { private: @@ -183,6 +185,7 @@ private: Color aTabBgColor; USHORT nScenarioFlags; BOOL bActiveScenario; + NameToNameMap localNameToGlobalName; bool mbPageBreaksValid; friend class ScDocument; // fuer FillInfo diff --git a/sc/inc/unonames.hxx b/sc/inc/unonames.hxx index f66f6c8cf6eb..d1accadbbbf6 100644 --- a/sc/inc/unonames.hxx +++ b/sc/inc/unonames.hxx @@ -186,6 +186,8 @@ #define SC_UNONAME_ANCHOR "Anchor" #define SC_UNONAME_HORIPOS "HoriOrientPosition" #define SC_UNONAME_VERTPOS "VertOrientPosition" +// #i66550 HLINK_FOR_SHAPES +#define SC_UNONAME_HYPERLINK "Hyperlink" // other cell properties #define SC_UNONAME_CHCOLHDR "ChartColumnAsLabel" @@ -531,6 +533,7 @@ #define SC_UNO_ZOOMTYPE "ZoomType" #define SC_UNO_ZOOMVALUE "ZoomValue" #define SC_UNO_UPDTEMPL "UpdateFromTemplate" +#define SC_UNO_FILTERED_RANGE_SELECTION "FilteredRangeSelection" /*Stampit enable/disable print cancel */ #define SC_UNO_ALLOWPRINTJOBCANCEL "AllowPrintJobCancel" @@ -613,6 +616,7 @@ #define SC_UNONAME_ADDRESS "Address" #define SC_UNONAME_UIREPR "UserInterfaceRepresentation" #define SC_UNONAME_PERSREPR "PersistentRepresentation" +#define SC_UNONAME_XL_A1_REPR "XL_A1_Representation" #define SC_UNONAME_REFSHEET "ReferenceSheet" // --> PB 2004-08-23 #i33095# Security Options diff --git a/sc/inc/userdat.hxx b/sc/inc/userdat.hxx index 88dea98ec22a..f457ca33e22a 100644 --- a/sc/inc/userdat.hxx +++ b/sc/inc/userdat.hxx @@ -99,16 +99,12 @@ public: void SetMacro( const rtl::OUString& rMacro ) { maMacro = rMacro; } const rtl::OUString& GetMacro() const { return maMacro; } -#ifdef ISSUE66550_HLINK_FOR_SHAPES void SetHlink( const rtl::OUString& rHlink ) { maHlink = rHlink; } const rtl::OUString& GetHlink() const { return maHlink; } -#endif private: rtl::OUString maMacro; -#ifdef ISSUE66550_HLINK_FOR_SHAPES rtl::OUString maHlink; -#endif }; //------------------------------------------------------------------------- diff --git a/sc/inc/viewuno.hxx b/sc/inc/viewuno.hxx index 19b5c60fd070..26c4cf93d817 100644 --- a/sc/inc/viewuno.hxx +++ b/sc/inc/viewuno.hxx @@ -199,6 +199,7 @@ private: XActivationEventListenerArr_Impl aActivationListeners; SCTAB nPreviousTab; sal_Bool bDrawSelModeSet; + sal_Bool bFilteredRangeSelection; ScViewPaneObj* GetObjectByIndex_Impl(USHORT nIndex) const; INT16 GetZoom(void) const; @@ -313,6 +314,13 @@ public: ::com::sun::star::sheet::XSpreadsheet >& xActiveSheet ) throw(::com::sun::star::uno::RuntimeException); + //liuchen 2009-9-2 support expand (but not replace) the active sheet + virtual void SAL_CALL selectSheet( const ::com::sun::star::uno::Reference< + ::com::sun::star::sheet::XSpreadsheet >& xActiveSheet, + sal_Bool bExpand) + throw(::com::sun::star::uno::RuntimeException); + //liuchen 2009-9-2 + //XEnhancedMouseClickBroadcaster virtual void SAL_CALL addEnhancedMouseClickHandler( const ::com::sun::star::uno::Reference< diff --git a/sc/sdi/cellsh.sdi b/sc/sdi/cellsh.sdi index 3e35a77d9723..a50f2e963713 100644 --- a/sc/sdi/cellsh.sdi +++ b/sc/sdi/cellsh.sdi @@ -60,6 +60,7 @@ interface CellSelection SID_SBA_BRW_INSERT [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ] SID_SELECT_DB [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ] SID_SORT [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ] + SID_DATA_FORM [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ] FID_FILTER_OK [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ] SID_AUTO_FILTER [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ] SID_AUTOFILTER_HIDE [ ExecMethod = ExecuteDB; StateMethod = GetDBState; ] diff --git a/sc/sdi/drawsh.sdi b/sc/sdi/drawsh.sdi index 98c7bf3a009d..8ba2a6759b15 100644 --- a/sc/sdi/drawsh.sdi +++ b/sc/sdi/drawsh.sdi @@ -226,9 +226,9 @@ interface TableDraw SID_FONTWORK_CHARACTER_SPACING_DIALOG [ ExecMethod = ExecDrawFunc ; StateMethod = GetDrawFuncState ; ] // ISSUE66550_HLINK_FOR_SHAPES -// SID_DRAW_HLINK_EDIT [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawFuncState; Export = FALSE; ] -// SID_DRAW_HLINK_DELETE [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawFuncState; Export = FALSE; ] -// SID_OPEN_HYPERLINK [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawFuncState; Export = FALSE; ] + SID_DRAW_HLINK_EDIT [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawFuncState; Export = FALSE; ] + SID_DRAW_HLINK_DELETE [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawFuncState; Export = FALSE; ] + SID_OPEN_HYPERLINK [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawFuncState; Export = FALSE; ] } diff --git a/sc/sdi/scalc.sdi b/sc/sdi/scalc.sdi index d2d425c7b646..a1ea25518037 100644 --- a/sc/sdi/scalc.sdi +++ b/sc/sdi/scalc.sdi @@ -1598,6 +1598,31 @@ SfxVoidItem DataSort SID_SORT ] //-------------------------------------------------------------------------- +SfxVoidItem DataForm SID_DATA_FORM +() +[ + /* 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 = FALSE, + GroupId = GID_DATA; +] + +//-------------------------------------------------------------------------- SfxVoidItem DataSubTotals SID_SUBTOTALS () [ @@ -6271,55 +6296,55 @@ SfxVoidItem StandardFonts SID_STANDARD_FONTS //-------------------------------------------------------------------------- // ISSUE66550_HLINK_FOR_SHAPES -//SfxVoidItem EditShapeHyperlink SID_DRAW_HLINK_EDIT -//() -//[ -// /* flags: */ -// AutoUpdate = FALSE, -// Cachable = Cachable, -// FastCall = TRUE, -// HasCoreId = FALSE, -// HasDialog = TRUE, -// ReadOnlyDoc = TRUE, -// Toggle = FALSE, -// Container = FALSE, -// RecordAbsolute = FALSE, -// RecordPerSet; -// Synchron; -// +SfxVoidItem EditShapeHyperlink SID_DRAW_HLINK_EDIT +() +[ + /* flags: */ + AutoUpdate = FALSE, + Cachable = Cachable, + FastCall = TRUE, + HasCoreId = FALSE, + HasDialog = TRUE, + ReadOnlyDoc = TRUE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + // /* config: */ -// AccelConfig = TRUE, -// MenuConfig = FALSE, -// StatusBarConfig = FALSE, -// ToolBoxConfig = FALSE, -// GroupId = GID_DRAWING; -//] + AccelConfig = TRUE, + MenuConfig = FALSE, + StatusBarConfig = FALSE, + ToolBoxConfig = FALSE, + GroupId = GID_DRAWING; +] //-------------------------------------------------------------------------- // ISSUE66550_HLINK_FOR_SHAPES -//SfxVoidItem DeleteShapeHyperlink SID_DRAW_HLINK_DELETE -//() -//[ -// /* flags: */ -// AutoUpdate = TRUE, -// Cachable = Cachable, -// FastCall = TRUE, -// HasCoreId = FALSE, -// HasDialog = FALSE, -// ReadOnlyDoc = TRUE, -// Toggle = FALSE, -// Container = FALSE, -// RecordAbsolute = FALSE, -// RecordPerSet; -// Synchron; -// -// /* config: */ -// AccelConfig = TRUE, -// MenuConfig = FALSE, -// StatusBarConfig = FALSE, -// ToolBoxConfig = FALSE, -// GroupId = GID_DRAWING; -//] +SfxVoidItem DeleteShapeHyperlink SID_DRAW_HLINK_DELETE +() +[ + /* flags: */ + AutoUpdate = TRUE, + Cachable = Cachable, + FastCall = TRUE, + HasCoreId = FALSE, + HasDialog = FALSE, + ReadOnlyDoc = TRUE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + /* config: */ + AccelConfig = TRUE, + MenuConfig = FALSE, + StatusBarConfig = FALSE, + ToolBoxConfig = FALSE, + GroupId = GID_DRAWING; +] //-------------------------------------------------------------------------- SfxVoidItem StandardTextAttributes SID_TEXT_STANDARD diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx index fbb07705c0b1..9c3840db8100 100644 --- a/sc/source/core/data/attarray.cxx +++ b/sc/source/core/data/attarray.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -2583,3 +2584,4 @@ void ScAttrArray::Load( SvStream& /* rStream */ ) } #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/attrib.cxx b/sc/source/core/data/attrib.cxx index 26c5c91104da..7924b4e2612f 100644 --- a/sc/source/core/data/attrib.cxx +++ b/sc/source/core/data/attrib.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1231,3 +1232,4 @@ bool ScPageScaleToItem::PutValue( const uno::Any& rAny, BYTE nMemberId ) // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/autonamecache.cxx b/sc/source/core/data/autonamecache.cxx index c9abd4aa90b8..0b97623b7efb 100644 --- a/sc/source/core/data/autonamecache.cxx +++ b/sc/source/core/data/autonamecache.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -107,3 +108,4 @@ const ScAutoNameAddresses& ScAutoNameCache::GetNameOccurences( const String& rNa return rAddresses; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/bcaslot.cxx b/sc/source/core/data/bcaslot.cxx index 540fb577a79b..abd6f055b716 100644 --- a/sc/source/core/data/bcaslot.cxx +++ b/sc/source/core/data/bcaslot.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -935,3 +936,5 @@ size_t ScBroadcastAreaSlotMachine::RemoveBulkArea( const ScBroadcastArea* pArea { return aBulkBroadcastAreas.erase( pArea ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx index 8b1e66de6c55..49676e29525d 100644 --- a/sc/source/core/data/cell.cxx +++ b/sc/source/core/data/cell.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -51,6 +52,7 @@ #include "recursionhelper.hxx" #include "postit.hxx" #include "externalrefmgr.hxx" +#include "macromgr.hxx" #include <editeng/editobj.hxx> #include <svl/intitem.hxx> #include <editeng/flditem.hxx> @@ -826,6 +828,8 @@ ScFormulaCell::~ScFormulaCell() { pDocument->RemoveFromFormulaTree( this ); pDocument->RemoveSubTotalCell(this); + if (pCode->HasOpCode(ocMacro)) + pDocument->GetMacroManager()->RemoveDependentCell(this); if (pDocument->HasExternalRefManager()) pDocument->GetExternalRefManager()->removeRefCell(this); @@ -1757,6 +1761,36 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam ) // Reschedule verlangsamt das ganze erheblich, nur bei Prozentaenderung ausfuehren ScProgress::GetInterpretProgress()->SetStateCountDownOnPercent( pDocument->GetFormulaCodeInTree()/MIN_NO_CODES_PER_PROGRESS_UPDATE ); + + switch (p->GetVolatileType()) + { + case ScInterpreter::VOLATILE: + // Volatile via built-in volatile functions. No actions needed. + break; + case ScInterpreter::VOLATILE_MACRO: + // The formula contains a volatile macro. + pCode->SetRecalcModeAlways(); + pDocument->PutInFormulaTree(this); + StartListeningTo(pDocument); + break; + case ScInterpreter::NOT_VOLATILE: + if (pCode->IsRecalcModeAlways()) + { + // The formula was previously volatile, but no more. + EndListeningTo(pDocument); + pCode->SetRecalcModeNormal(); + } + else + { + // non-volatile formula. End listening to the area in case + // it's listening due to macro module change. + pDocument->EndListeningArea(BCA_LISTEN_ALWAYS, this); + } + pDocument->RemoveFromFormulaTree(this); + break; + default: + ; + } } else { @@ -1824,7 +1858,7 @@ void __EXPORT ScFormulaCell::Notify( SvtBroadcaster&, const SfxHint& rHint) else { bForceTrack = !bDirty; - bDirty = TRUE; + SetDirtyVar(); } // #35962# Don't remove from FormulaTree to put in FormulaTrack to // put in FormulaTree again and again, only if necessary. @@ -1847,7 +1881,7 @@ void ScFormulaCell::SetDirty() if ( !IsInChangeTrack() ) { if ( pDocument->GetHardRecalcState() ) - bDirty = TRUE; + SetDirtyVar(); else { // Mehrfach-FormulaTracking in Load und in CompileAll @@ -1856,7 +1890,7 @@ void ScFormulaCell::SetDirty() // setzen, z.B. in CompileTokenArray if ( !bDirty || !pDocument->IsInFormulaTree( this ) ) { - bDirty = TRUE; + SetDirtyVar(); pDocument->AppendToFormulaTrack( this ); pDocument->TrackFormulas(); } @@ -1867,6 +1901,13 @@ void ScFormulaCell::SetDirty() } } +void ScFormulaCell::SetDirtyVar() +{ + bDirty = TRUE; + // mark the sheet of this cell to be calculated + //#FIXME do we need to revert this remnant of old fake vba events? pDocument->AddCalculateTable( aPos.Tab() ); +} + void ScFormulaCell::SetDirtyAfterLoad() { bDirty = TRUE; @@ -2063,3 +2104,5 @@ ScToken* ScDetectiveRefIter::GetNextRefToken() } // ============================================================================ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/cell2.cxx b/sc/source/core/data/cell2.cxx index f4478f7610b7..4e1823b97b6a 100644 --- a/sc/source/core/data/cell2.cxx +++ b/sc/source/core/data/cell2.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1712,3 +1713,4 @@ void ScFormulaCell::CompileColRowNameFormula() // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/clipparam.cxx b/sc/source/core/data/clipparam.cxx index 9ab5995ca26c..6cae3916fc47 100644 --- a/sc/source/core/data/clipparam.cxx +++ b/sc/source/core/data/clipparam.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -198,3 +199,5 @@ void ScClipRangeNameData::insert(sal_uInt16 nOldIndex, sal_uInt16 nNewIndex) maRangeMap.insert( ScRangeData::IndexMap::value_type(nOldIndex, nNewIndex)); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index 53463a0242db..c36ff0dfe61b 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -2201,3 +2202,4 @@ BOOL ScColumn::SearchStyleRange( SCsROW& rRow, SCsROW& rEndRow, const ScStyleShe } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index b9fb3f9a7a1d..9fc09c2addc6 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1788,3 +1789,4 @@ ULONG ScColumn::GetCodeCount() const +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index 642d5bdcf3f0..298b979dcdd2 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -829,8 +830,10 @@ ScBaseCell* ScColumn::CloneCell(SCSIZE nIndex, USHORT nFlags, ScDocument& rDestD bool bCloneValue = (nFlags & IDF_VALUE) != 0; bool bCloneDateTime = (nFlags & IDF_DATETIME) != 0; bool bCloneString = (nFlags & IDF_STRING) != 0; + bool bCloneSpecialBoolean = (nFlags & IDF_SPECIAL_BOOLEAN) != 0; bool bCloneFormula = (nFlags & IDF_FORMULA) != 0; bool bCloneNote = (nFlags & IDF_NOTE) != 0; + bool bForceFormula = false; ScBaseCell* pNew = 0; ScBaseCell& rSource = *pItems[nIndex].pCell; @@ -854,7 +857,18 @@ ScBaseCell* ScColumn::CloneCell(SCSIZE nIndex, USHORT nFlags, ScDocument& rDestD break; case CELLTYPE_FORMULA: - if (bCloneFormula) + if ( bCloneSpecialBoolean ) + { + ScFormulaCell& rForm = (ScFormulaCell&)rSource; + rtl::OUStringBuffer aBuf; + // #TODO #FIXME do we have a localisation issue here? + rForm.GetFormula( aBuf ); + rtl::OUString aVal( aBuf.makeStringAndClear() ); + if ( aVal.equalsAscii( "=TRUE()" ) + || aVal.equalsAscii( "=FALSE()" ) ) + bForceFormula = true; + } + if (bForceFormula || bCloneFormula) { // note will be cloned below pNew = rSource.CloneWithoutNote( rDestDoc, rDestPos ); @@ -2016,3 +2030,4 @@ xub_StrLen ScColumn::GetMaxNumberStringLen( return nStringLen; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/compressedarray.cxx b/sc/source/core/data/compressedarray.cxx index 95da04fef0e0..be541decc632 100644 --- a/sc/source/core/data/compressedarray.cxx +++ b/sc/source/core/data/compressedarray.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -904,3 +905,5 @@ template void ScCompressedArrayIterator< SCROW, USHORT>::Follow( template class ScCoupledCompressedArrayIterator< SCROW, BYTE, USHORT>; // === EOF =================================================================== + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx index b08838198477..b3852e705e17 100644 --- a/sc/source/core/data/conditio.cxx +++ b/sc/source/core/data/conditio.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1601,3 +1602,5 @@ bool ScConditionalFormatList::MarkUsedExternalReferences() const bAllMarked = (*this)[i]->MarkUsedExternalReferences(); return bAllMarked; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/dbdocutl.cxx b/sc/source/core/data/dbdocutl.cxx index 7a56f90bbffa..2bd9b6755776 100644 --- a/sc/source/core/data/dbdocutl.cxx +++ b/sc/source/core/data/dbdocutl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -205,3 +206,4 @@ void ScDatabaseDocUtil::PutData( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx index 280cd340e59f..9bd907be742c 100644 --- a/sc/source/core/data/dociter.cxx +++ b/sc/source/core/data/dociter.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -2213,3 +2214,5 @@ SCROW ScRowBreakIterator::next() ++maItr; return maItr == maEnd ? NOT_FOUND : *maItr; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/docparam.cxx b/sc/source/core/data/docparam.cxx index bb2e073f0af5..c6d47fc5615f 100644 --- a/sc/source/core/data/docparam.cxx +++ b/sc/source/core/data/docparam.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -37,3 +38,5 @@ ScColWidthParam::ScColWidthParam() : mnMaxTextRow(-1), mnMaxTextLen(0), mbSimpleText(true) {} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/docpool.cxx b/sc/source/core/data/docpool.cxx index ae7adbcaed39..08e275f46833 100644 --- a/sc/source/core/data/docpool.cxx +++ b/sc/source/core/data/docpool.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1065,3 +1066,4 @@ SfxMapUnit __EXPORT ScDocumentPool::GetMetric( USHORT nWhich ) const +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx index 8c695c7ee467..5cf6bd3b54cc 100644 --- a/sc/source/core/data/documen2.cxx +++ b/sc/source/core/data/documen2.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -94,6 +95,7 @@ #include "tabprotection.hxx" #include "formulaparserpool.hxx" #include "clipparam.hxx" +#include "macromgr.hxx" using namespace com::sun::star; @@ -156,6 +158,7 @@ ScDocument::ScDocument( ScDocumentMode eMode, pCacheFieldEditEngine( NULL ), pDocProtection( NULL ), mpClipParam( NULL), + mpMacroMgr( NULL ), pExternalRefMgr( NULL ), pViewOptions( NULL ), pDocOptions( NULL ), @@ -1276,3 +1279,5 @@ void ScDocument::ClearLookupCaches() if( pLookupCacheMapImpl ) pLookupCacheMapImpl->clear(); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx index 37630134382e..0902ec4bbbaf 100644 --- a/sc/source/core/data/documen3.cxx +++ b/sc/source/core/data/documen3.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -2160,3 +2161,5 @@ void ScDocument::GetUsedDPObjectCache( std::list<ScDPTableDataCache*>& usedlist } } // End Comments + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx index a296ab068804..a803ba81e40f 100644 --- a/sc/source/core/data/documen4.cxx +++ b/sc/source/core/data/documen4.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1196,3 +1197,4 @@ void ScDocument::CompareDocument( ScDocument& rOtherDoc ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/documen5.cxx b/sc/source/core/data/documen5.cxx index d86d174ab414..ffd6dce73d27 100644 --- a/sc/source/core/data/documen5.cxx +++ b/sc/source/core/data/documen5.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -792,3 +793,4 @@ void ScDocument::AddOLEObjectToCollection(const String& rName) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/documen6.cxx b/sc/source/core/data/documen6.cxx index 8706c49320d1..de0105cb63af 100644 --- a/sc/source/core/data/documen6.cxx +++ b/sc/source/core/data/documen6.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -182,3 +183,4 @@ BYTE ScDocument::GetScriptType( SCCOL nCol, SCROW nRow, SCTAB nTab, ScBaseCell* } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/documen7.cxx b/sc/source/core/data/documen7.cxx index d77dc1041d9c..fba5fa0a1b82 100644 --- a/sc/source/core/data/documen7.cxx +++ b/sc/source/core/data/documen7.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -532,3 +533,4 @@ void ScDocument::SetAutoCalc( BOOL bNewAutoCalc ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx index f2c2f4925859..8b9d6714246b 100644 --- a/sc/source/core/data/documen8.cxx +++ b/sc/source/core/data/documen8.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -93,6 +94,7 @@ #include "globstr.hrc" #include "sc.hrc" #include "charthelper.hxx" +#include "macromgr.hxx" #include "dpobject.hxx" #define GET_SCALEVALUE(set,id) ((const SfxUInt16Item&)(set.Get( id ))).GetValue() @@ -412,6 +414,13 @@ BYTE ScDocument::GetEditTextDirection(SCTAB nTab) const return sal::static_int_cast<BYTE>(eRet); } +ScMacroManager* ScDocument::GetMacroManager() +{ + if (!mpMacroMgr.get()) + mpMacroMgr.reset(new ScMacroManager(this)); + return mpMacroMgr.get(); +} + //------------------------------------------------------------------------ void ScDocument::InvalidateTextWidth( const ScAddress* pAdrFrom, const ScAddress* pAdrTo, @@ -1625,3 +1634,4 @@ void ScDocument::TransliterateText( const ScMarkData& rMultiMark, sal_Int32 nTyp delete pEngine; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/documen9.cxx b/sc/source/core/data/documen9.cxx index 08e1c28599b7..feadd4f7fd23 100644 --- a/sc/source/core/data/documen9.cxx +++ b/sc/source/core/data/documen9.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -775,3 +776,4 @@ void ScDocument::SetAsianKerning(BOOL bNew) pDrawLayer->SetKernAsianPunctuation( (BOOL)nAsianKerning ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 0bd50b75f04d..305f47df8442 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -97,6 +98,8 @@ #include <map> #include <limits> +using namespace ::com::sun::star; + namespace WritingMode2 = ::com::sun::star::text::WritingMode2; using ::com::sun::star::uno::Sequence; using ::com::sun::star::sheet::TablePageBreakData; @@ -184,6 +187,13 @@ BOOL ScDocument::GetCodeName( SCTAB nTab, String& rName ) const return FALSE; } +NameToNameMap* +ScDocument::GetLocalNameMap( SCTAB& rTab ) +{ + if ( !HasTable( rTab ) ) + return NULL; + return &pTab[rTab]->localNameToGlobalName; +} BOOL ScDocument::GetTable( const String& rName, SCTAB& rTab ) const { @@ -448,6 +458,7 @@ BOOL ScDocument::DeleteTab( SCTAB nTab, ScDocument* pRefUndoDoc ) delete pTab[nTab]; for (i=nTab + 1; i < nTabCount; i++) pTab[i - 1] = pTab[i]; + pTab[nTabCount - 1] = NULL; --nMaxTableNumber; // UpdateBroadcastAreas must be called between UpdateDeleteTab, @@ -1608,6 +1619,40 @@ void ScDocument::CopyToClip(const ScClipParam& rClipParam, pClipDoc->ExtendMerge(aClipRange, true); } +// Copy the content of the Range into clipboard. Adding this method for VBA API: Range.Copy(). +void ScDocument::CopyToClip4VBA(const ScClipParam& rClipParam, ScDocument* pClipDoc, bool bKeepScenarioFlags, bool bIncludeObjects, bool bCloneNoteCaptions) +{ + if ( !bIsClip ) + { + pClipDoc = pClipDoc ? pClipDoc : SC_MOD()->GetClipDoc(); + if ( !pClipDoc ) + { + return; + } + ScRange aClipRange = rClipParam.getWholeRange(); + SCTAB nTab = aClipRange.aStart.Tab(); + pClipDoc->aDocName = aDocName; + pClipDoc->SetClipParam( rClipParam ); + pClipDoc->ResetClip( this, nTab ); + + CopyRangeNamesToClip( pClipDoc, aClipRange, nTab ); + + if ( pTab[nTab] && pClipDoc->pTab[nTab] ) + { + pTab[nTab]->CopyToClip( rClipParam.maRanges, pClipDoc->pTab[nTab], bKeepScenarioFlags, bCloneNoteCaptions ); + if ( pDrawLayer && bIncludeObjects ) + { + // Also copy drawing objects. + Rectangle aObjRect = GetMMRect( aClipRange.aStart.Col(), aClipRange.aStart.Row(), aClipRange.aEnd.Col(), aClipRange.aEnd.Row(), nTab ); + pDrawLayer->CopyToClip( pClipDoc, nTab, aObjRect ); + } + } + + // Make sure to mark overlapped cells. + pClipDoc->ExtendMerge( aClipRange, true ); + } +} + void ScDocument::CopyTabToClip(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, SCTAB nTab, ScDocument* pClipDoc) @@ -1729,6 +1774,31 @@ void ScDocument::CopyRangeNamesToClip(ScDocument* pClipDoc, const ScRange& rClip } } +void ScDocument::CopyRangeNamesToClip(ScDocument* pClipDoc, const ScRange& rClipRange, SCTAB nTab) +{ + // Indexes of named ranges that are used in the copied cells + std::set<USHORT> aUsedNames; + if ( pTab[nTab] && pClipDoc->pTab[nTab] ) + { + pTab[nTab]->FindRangeNamesInUse( rClipRange.aStart.Col(), rClipRange.aStart.Row(), rClipRange.aEnd.Col(), rClipRange.aEnd.Row(), aUsedNames ); + } + + pClipDoc->pRangeName->FreeAll(); + for ( USHORT i = 0; i < pRangeName->GetCount(); i++ ) + { + USHORT nIndex = ((ScRangeData*)((*pRangeName)[i]))->GetIndex(); + bool bInUse = ( aUsedNames.find(nIndex) != aUsedNames.end() ); + if ( bInUse ) + { + ScRangeData* pData = new ScRangeData(*((*pRangeName)[i])); + if ( !pClipDoc->pRangeName->Insert(pData) ) + delete pData; + else + pData->SetIndex(nIndex); + } + } +} + ScDocument::NumFmtMergeHandler::NumFmtMergeHandler(ScDocument* pDoc, ScDocument* pSrcDoc) : mpDoc(pDoc) { @@ -4502,6 +4572,15 @@ BOOL ScDocument::HasSelectedBlockMatrixFragment( SCCOL nStartCol, SCROW nStartRo return !bOk; } +BOOL ScDocument::HasSelectedBlockMatrixFragment( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab ) const +{ + BOOL bOk = TRUE; + if ( pTab[nTab] && pTab[nTab]->HasBlockMatrixFragment( nStartCol, nStartRow, nEndCol, nEndRow ) ) + { + bOk = FALSE; + } + return !bOk; +} BOOL ScDocument::GetMatrixFormulaRange( const ScAddress& rCellPos, ScRange& rMatrix ) { @@ -5354,3 +5433,5 @@ bool ScDocument::IsInVBAMode() const } return bResult; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/dpcachetable.cxx b/sc/source/core/data/dpcachetable.cxx index d97900e6b904..b371a30b7542 100644 --- a/sc/source/core/data/dpcachetable.cxx +++ b/sc/source/core/data/dpcachetable.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -466,3 +467,5 @@ ScDPTableDataCache* ScDPCacheTable::GetCache() const return mpNoneCache; } // End Comments + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/dpdimsave.cxx b/sc/source/core/data/dpdimsave.cxx index 21669eb7a435..f8b06fbb0dd1 100644 --- a/sc/source/core/data/dpdimsave.cxx +++ b/sc/source/core/data/dpdimsave.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -582,3 +583,4 @@ String ScDPDimensionSaveData::CreateDateGroupDimName( sal_Int32 nDatePart, const // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/dpglobal.cxx b/sc/source/core/data/dpglobal.cxx index 6b84d37d8d0f..4ce715600a9c 100644 --- a/sc/source/core/data/dpglobal.cxx +++ b/sc/source/core/data/dpglobal.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -148,3 +149,4 @@ sal_Int32 ScDPItemDataPool::insertData( const ScDPItemData& aData ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/dpgroup.cxx b/sc/source/core/data/dpgroup.cxx index edb3b787b9b2..216d90352c9d 100644 --- a/sc/source/core/data/dpgroup.cxx +++ b/sc/source/core/data/dpgroup.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1587,3 +1588,4 @@ long ScDPGroupTableData::GetSourceDim( long nDim ) } // ----------------------------------------------------------------------- +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index f69d6529e7f3..d8abd8d7dee3 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -2641,3 +2642,4 @@ bool ScDPCollection::HasDPTable(SCCOL nCol, SCROW nRow, SCTAB nTab) const } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/dpoutput.cxx b/sc/source/core/data/dpoutput.cxx index ac3ca76a7b2f..43b2e91ff18f 100644 --- a/sc/source/core/data/dpoutput.cxx +++ b/sc/source/core/data/dpoutput.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -2059,3 +2060,4 @@ BOOL ScDPOutput::GetHeaderDrag( const ScAddress& rPos, BOOL bMouseLeft, BOOL bMo +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/dpoutputgeometry.cxx b/sc/source/core/data/dpoutputgeometry.cxx index fd9bee0ed572..99a465188105 100644 --- a/sc/source/core/data/dpoutputgeometry.cxx +++ b/sc/source/core/data/dpoutputgeometry.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -212,3 +213,5 @@ ScDPOutputGeometry::FieldType ScDPOutputGeometry::getFieldButtonType(const ScAdd return None; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/dpsave.cxx b/sc/source/core/data/dpsave.cxx index 2b51ca68d170..f6f6cf216c76 100644 --- a/sc/source/core/data/dpsave.cxx +++ b/sc/source/core/data/dpsave.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1474,3 +1475,4 @@ bool operator == (const ::com::sun::star::sheet::DataPilotFieldReference &l, con l.ReferenceItemName == r.ReferenceItemName; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/dpsdbtab.cxx b/sc/source/core/data/dpsdbtab.cxx index b966d9d458ea..6847b3aace87 100644 --- a/sc/source/core/data/dpsdbtab.cxx +++ b/sc/source/core/data/dpsdbtab.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -310,3 +311,4 @@ const ScDPCacheTable& ScDatabaseDPData::GetCacheTable() const +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/dpshttab.cxx b/sc/source/core/data/dpshttab.cxx index a1fa9d2d60a6..7da7c956d26f 100644 --- a/sc/source/core/data/dpshttab.cxx +++ b/sc/source/core/data/dpshttab.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -313,3 +314,4 @@ ULONG ScSheetSourceDesc::CheckValidate( ScDocument* pDoc ) const +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/dptabdat.cxx b/sc/source/core/data/dptabdat.cxx index cb68732a237f..c0c2d6d33122 100644 --- a/sc/source/core/data/dptabdat.cxx +++ b/sc/source/core/data/dptabdat.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -327,3 +328,5 @@ long ScDPTableData::GetSourceDim( long nDim ) } // End Comments // ----------------------------------------------------------------------- + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/dptablecache.cxx b/sc/source/core/data/dptablecache.cxx index 8f25b70e41b6..3cf660b609e7 100644 --- a/sc/source/core/data/dptablecache.cxx +++ b/sc/source/core/data/dptablecache.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1123,3 +1124,5 @@ long ScDPTableDataCache::GetId() const return mnID; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/dptabres.cxx b/sc/source/core/data/dptabres.cxx index c79f7c1b17a6..cc7b986eeb16 100644 --- a/sc/source/core/data/dptabres.cxx +++ b/sc/source/core/data/dptabres.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -4107,3 +4108,5 @@ void ScDPResultMember::CheckShowEmpty( BOOL bShow ) } } }// End Comments + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx index c971302b1b1e..97dbdb9b14a6 100644 --- a/sc/source/core/data/dptabsrc.cxx +++ b/sc/source/core/data/dptabsrc.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -2907,3 +2908,4 @@ const ScDPItemData* ScDPMembers::GetSrcItemDataByIndex( SCROW nIndex) } // End Comments +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/drawpage.cxx b/sc/source/core/data/drawpage.cxx index 715b99f362a1..541318df0c8c 100644 --- a/sc/source/core/data/drawpage.cxx +++ b/sc/source/core/data/drawpage.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -63,3 +64,4 @@ __EXPORT ScDrawPage::~ScDrawPage() } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx index 49a31b3f6af6..450ae369e81d 100644 --- a/sc/source/core/data/drwlayer.cxx +++ b/sc/source/core/data/drwlayer.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -2117,3 +2118,5 @@ SdrLayerID __EXPORT ScDrawLayer::GetControlExportLayerId( const SdrObject & ) co return xRet; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/fillinfo.cxx b/sc/source/core/data/fillinfo.cxx index 99da4979a1b6..9715c7f69833 100644 --- a/sc/source/core/data/fillinfo.cxx +++ b/sc/source/core/data/fillinfo.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1077,3 +1078,4 @@ ScTableInfo::~ScTableInfo() // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx index a8fba9574049..0ceb96f85c4d 100644 --- a/sc/source/core/data/global.cxx +++ b/sc/source/core/data/global.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1990,3 +1991,4 @@ IntlWrapper* ScGlobal::GetScIntlWrapper() return pLocale; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/global2.cxx b/sc/source/core/data/global2.cxx index 9aa5851dfca0..c9aaff566b15 100644 --- a/sc/source/core/data/global2.cxx +++ b/sc/source/core/data/global2.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -892,3 +893,4 @@ String ScGlobal::GetDocTabName( const String& rFileName, return aDocTab; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/globalx.cxx b/sc/source/core/data/globalx.cxx index 2accdadeb781..be5cf810a967 100644 --- a/sc/source/core/data/globalx.cxx +++ b/sc/source/core/data/globalx.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -169,3 +170,5 @@ String ScGlobal::GetOrdinalSuffix( sal_Int32 nNumber) } return String(); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/markarr.cxx b/sc/source/core/data/markarr.cxx index 0550309f4eb1..b5b20084fc6d 100644 --- a/sc/source/core/data/markarr.cxx +++ b/sc/source/core/data/markarr.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -403,3 +404,4 @@ BOOL ScMarkArrayIter::Next( SCROW& rTop, SCROW& rBottom ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/markdata.cxx b/sc/source/core/data/markdata.cxx index 4401ac19d199..e9486e7705b0 100644 --- a/sc/source/core/data/markdata.cxx +++ b/sc/source/core/data/markdata.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -606,3 +607,4 @@ void ScMarkData::DeleteTab( SCTAB nTab ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/olinetab.cxx b/sc/source/core/data/olinetab.cxx index af444c4b2123..19706ce86c0f 100644 --- a/sc/source/core/data/olinetab.cxx +++ b/sc/source/core/data/olinetab.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -804,3 +805,4 @@ void ScSubOutlineIterator::DeleteLast() } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/pagepar.cxx b/sc/source/core/data/pagepar.cxx index 318f5c19501b..03ca4060d49b 100644 --- a/sc/source/core/data/pagepar.cxx +++ b/sc/source/core/data/pagepar.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -120,3 +121,5 @@ BOOL ScPageAreaParam::operator==( const ScPageAreaParam& r ) const return bEqual; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx index 2d8c2f6bf8d3..eef90c7df8df 100644 --- a/sc/source/core/data/patattr.cxx +++ b/sc/source/core/data/patattr.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1336,3 +1337,4 @@ BYTE ScPatternAttr::GetRotateDir( const SfxItemSet* pCondSet ) const +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/pivot2.cxx b/sc/source/core/data/pivot2.cxx index 8bb32a4c8386..dd9980340cda 100644 --- a/sc/source/core/data/pivot2.cxx +++ b/sc/source/core/data/pivot2.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -118,3 +119,4 @@ ScDPFuncData::ScDPFuncData( short nCol, USHORT nFuncMask, const DataPilotFieldRe // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/poolhelp.cxx b/sc/source/core/data/poolhelp.cxx index 010cc502798b..99e22727bd89 100644 --- a/sc/source/core/data/poolhelp.cxx +++ b/sc/source/core/data/poolhelp.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -126,3 +127,4 @@ void ScPoolHelper::SourceDocumentGone() // ----------------------------------------------------------------------- +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx index a4bc9a473768..a80567b3c302 100644 --- a/sc/source/core/data/postit.cxx +++ b/sc/source/core/data/postit.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -918,3 +919,5 @@ ScPostIt* ScNoteUtil::CreateNoteFromString( } // ============================================================================ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/scdpoutputimpl.cxx b/sc/source/core/data/scdpoutputimpl.cxx index 6a667806e097..0ca69195dd63 100644 --- a/sc/source/core/data/scdpoutputimpl.cxx +++ b/sc/source/core/data/scdpoutputimpl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -185,3 +186,5 @@ void OutputImpl::OutputBlockFrame ( SCCOL nStartCol, SCROW nStartRow, SCCOL nEnd mpDoc->ApplyFrameAreaTab( ScRange( nStartCol, nStartRow, mnTab, nEndCol, nEndRow , mnTab ), &aBox, &aBoxInfo ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/segmenttree.cxx b/sc/source/core/data/segmenttree.cxx index 86b53582d1d4..dd40e726fd9e 100644 --- a/sc/source/core/data/segmenttree.cxx +++ b/sc/source/core/data/segmenttree.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -580,3 +581,4 @@ void ScFlatUInt16RowSegments::setInsertFromBack(bool bInsertFromBack) mpImpl->setInsertFromBack(bInsertFromBack); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/sheetevents.cxx b/sc/source/core/data/sheetevents.cxx index e1875b5db15b..d1df2bb04df6 100644 --- a/sc/source/core/data/sheetevents.cxx +++ b/sc/source/core/data/sheetevents.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -170,3 +171,4 @@ void ScSheetEvents::SetScript(sal_Int32 nEvent, const rtl::OUString* pNew) mpScriptNames[nEvent] = NULL; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/sortparam.cxx b/sc/source/core/data/sortparam.cxx index 75b63c5b5653..00f9bc6386a0 100644 --- a/sc/source/core/data/sortparam.cxx +++ b/sc/source/core/data/sortparam.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -267,3 +268,4 @@ void ScSortParam::MoveToDest() } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/stlpool.cxx b/sc/source/core/data/stlpool.cxx index f8ef7ec8de65..c391f09b1380 100644 --- a/sc/source/core/data/stlpool.cxx +++ b/sc/source/core/data/stlpool.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -525,3 +526,4 @@ ScStyleSheet* ScStyleSheetPool::FindCaseIns( const String& rName, SfxStyleFamily return NULL; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/stlsheet.cxx b/sc/source/core/data/stlsheet.cxx index a3319eafd3fd..c77fc710b325 100644 --- a/sc/source/core/data/stlsheet.cxx +++ b/sc/source/core/data/stlsheet.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -344,3 +345,4 @@ BOOL ScStyleSheet::SetName( const String& rNew ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/tabbgcolor.cxx b/sc/source/core/data/tabbgcolor.cxx index a3d9eec16d99..5e8479d4bdd6 100644 --- a/sc/source/core/data/tabbgcolor.cxx +++ b/sc/source/core/data/tabbgcolor.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -60,3 +61,5 @@ ScUndoTabColorInfo::ScUndoTabColorInfo(const ScUndoTabColorInfo& r) : maNewTabBgColor(r.maNewTabBgColor) { } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index 010f344df3ca..d4dd2026a019 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1811,3 +1812,4 @@ SCROW ScTable::VisibleDataCellIterator::getRow() const return mnCurRow; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index 598be4ee92fc..f2cfae40d466 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -3173,3 +3174,4 @@ ULONG ScTable::GetColOffset( SCCOL nCol ) const return n; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx index 449edcd1c61f..48035ec5b655 100644 --- a/sc/source/core/data/table3.cxx +++ b/sc/source/core/data/table3.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -2109,3 +2110,4 @@ void ScTable::FindConditionalFormat( ULONG nKey, ScRangeList& rList ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx index 9cbcb3970196..a523827ad940 100644 --- a/sc/source/core/data/table4.cxx +++ b/sc/source/core/data/table4.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1984,3 +1985,4 @@ void ScTable::CompileColRowNameFormula() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/table5.cxx b/sc/source/core/data/table5.cxx index fc4f55e7d681..04c43a2eaf27 100644 --- a/sc/source/core/data/table5.cxx +++ b/sc/source/core/data/table5.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1203,3 +1204,4 @@ void ScTable::InvalidateTextWidth( const ScAddress* pAdrFrom, const ScAddress* p +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/table6.cxx b/sc/source/core/data/table6.cxx index 277dd99af763..b71d55aeebb6 100644 --- a/sc/source/core/data/table6.cxx +++ b/sc/source/core/data/table6.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1042,3 +1043,5 @@ bool ScTable::SearchRangeForAllEmptyCells( } return bFound; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/tabprotection.cxx b/sc/source/core/data/tabprotection.cxx index 44fde303ab62..c53c74b6fa2d 100644 --- a/sc/source/core/data/tabprotection.cxx +++ b/sc/source/core/data/tabprotection.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -522,3 +523,4 @@ void ScTableProtection::setOption(Option eOption, bool bEnabled) mpImpl->setOption(eOption, bEnabled); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/userdat.cxx b/sc/source/core/data/userdat.cxx index 466e83b15fad..443d056a77f7 100644 --- a/sc/source/core/data/userdat.cxx +++ b/sc/source/core/data/userdat.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -125,3 +126,4 @@ SdrObjUserData* ScMacroInfo::Clone( SdrObject* /*pObj*/ ) const return new ScMacroInfo( *this ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx index 2239b1d0f773..8a81b75ec343 100644 --- a/sc/source/core/data/validat.cxx +++ b/sc/source/core/data/validat.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -994,3 +995,4 @@ BOOL ScValidationDataList::operator==( const ScValidationDataList& r ) const return bEqual; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx index 98c6afbe466c..138d1bec9b66 100644 --- a/sc/source/core/inc/interpre.hxx +++ b/sc/source/core/inc/interpre.hxx @@ -135,6 +135,15 @@ public: static inline double div( const double& fNumerator, const double& fDenominator ); ScMatrixRef GetNewMat(SCSIZE nC, SCSIZE nR); + + enum VolatileType { + VOLATILE, + VOLATILE_MACRO, + NOT_VOLATILE + }; + + VolatileType GetVolatileType() const; + private: static ScTokenStack* pGlobalStack; static BOOL bGlobalStackInUse; @@ -169,6 +178,8 @@ private: BOOL bCalcAsShown; // precision as shown BOOL bMatrixFormula; // formula cell is a matrix formula + VolatileType meVolaileType; + //---------------------------------Funktionen in interpre.cxx--------- // nMust <= nAct <= nMax ? ok : PushError inline BOOL MustHaveParamCount( short nAct, short nMust ); diff --git a/sc/source/core/tool/addincfg.cxx b/sc/source/core/tool/addincfg.cxx index c76b60eae077..92017aad9f82 100644 --- a/sc/source/core/tool/addincfg.cxx +++ b/sc/source/core/tool/addincfg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -70,3 +71,4 @@ void ScAddInCfg::Notify( const uno::Sequence<rtl::OUString>& ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/addincol.cxx b/sc/source/core/tool/addincol.cxx index 07b79c11b373..18d17bd9a6e6 100644 --- a/sc/source/core/tool/addincol.cxx +++ b/sc/source/core/tool/addincol.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1800,3 +1801,4 @@ void ScUnoAddInCall::SetResult( const uno::Any& rNewRes ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/addinhelpid.cxx b/sc/source/core/tool/addinhelpid.cxx index bb51fb174fc2..9ed593f58cde 100644 --- a/sc/source/core/tool/addinhelpid.cxx +++ b/sc/source/core/tool/addinhelpid.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -210,3 +211,4 @@ sal_uInt16 ScUnoAddInHelpIdGenerator::GetHelpId( const ::rtl::OUString& rFuncNam // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/addinlis.cxx b/sc/source/core/tool/addinlis.cxx index ad6b60073ccb..36430d9fa2cf 100644 --- a/sc/source/core/tool/addinlis.cxx +++ b/sc/source/core/tool/addinlis.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -188,3 +189,4 @@ void SAL_CALL ScAddInListener::disposing( const ::com::sun::star::lang::EventObj +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx index 5e0327e06c91..0039892b2c18 100644 --- a/sc/source/core/tool/address.cxx +++ b/sc/source/core/tool/address.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1378,7 +1379,7 @@ lcl_ScRange_Parse_OOo( ScRange &aRange, const String& r, ScDocument* pDoc, ScAdd } nRes1 = ( ( nRes1 | nRes2 ) & SCA_VALID ) | nRes1 - | ( ( nRes2 & 0x070F ) << 4 ); + | ( ( nRes2 & SCA_BITS ) << 4 ); return nRes1; } @@ -2031,3 +2032,5 @@ bool AlphaToCol( SCCOL& rCol, const String& rStr) rCol = nResult; return bOk; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/adiasync.cxx b/sc/source/core/tool/adiasync.cxx index 4f19a043a34d..823dcb597b7f 100644 --- a/sc/source/core/tool/adiasync.cxx +++ b/sc/source/core/tool/adiasync.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -185,3 +186,4 @@ void ScAddInAsync::RemoveDocument( ScDocument* pDocumentP ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/appoptio.cxx b/sc/source/core/tool/appoptio.cxx index 857efd972886..be483c8bf574 100644 --- a/sc/source/core/tool/appoptio.cxx +++ b/sc/source/core/tool/appoptio.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -82,6 +83,9 @@ ScAppOptions::~ScAppOptions() void ScAppOptions::SetDefaults() { + // Set default tab count for new spreadsheet. + nTabCountInNewSpreadsheet = 3; + if ( ScOptionsUtil::IsMetricSystem() ) eMetric = FUNIT_CM; // default for countries with metric system else @@ -119,6 +123,7 @@ void ScAppOptions::SetDefaults() const ScAppOptions& ScAppOptions::operator=( const ScAppOptions& rCpy ) { + nTabCountInNewSpreadsheet = rCpy.nTabCountInNewSpreadsheet; eMetric = rCpy.eMetric; eZoomType = rCpy.eZoomType; bSynchronizeZoom = rCpy.bSynchronizeZoom; @@ -743,3 +748,4 @@ void ScAppCfg::OptionsChanged() } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/autoform.cxx b/sc/source/core/tool/autoform.cxx index 5a7f117e75d9..ba8daad319a3 100644 --- a/sc/source/core/tool/autoform.cxx +++ b/sc/source/core/tool/autoform.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1198,3 +1199,4 @@ USHORT ScAutoFormat::FindIndexPerName( const String& rName ) const +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/callform.cxx b/sc/source/core/tool/callform.cxx index e8e2b28f3f8e..0c3c7e8b20b3 100644 --- a/sc/source/core/tool/callform.cxx +++ b/sc/source/core/tool/callform.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -467,3 +468,4 @@ BOOL FuncData::GetParamDesc( String& aName, String& aDesc, USHORT nParam ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/cellform.cxx b/sc/source/core/tool/cellform.cxx index 45d2c4a890bb..3bab9ecdcc35 100644 --- a/sc/source/core/tool/cellform.cxx +++ b/sc/source/core/tool/cellform.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -214,3 +215,4 @@ void ScCellFormat::GetInputString( ScBaseCell* pCell, ULONG nFormat, String& rSt +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/cellkeytranslator.cxx b/sc/source/core/tool/cellkeytranslator.cxx index 4db8c22d19d8..466457cf5651 100644 --- a/sc/source/core/tool/cellkeytranslator.cxx +++ b/sc/source/core/tool/cellkeytranslator.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -230,3 +231,5 @@ void ScCellKeywordTranslator::addToMap(const TransItem* pItems, const Locale& rL for (sal_uInt16 i = 0; pItems[i].from != NULL; ++i) addToMap(String(pItems[i].from), pItems[i].to, rLocale, pItems[i].func); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/chartarr.cxx b/sc/source/core/tool/chartarr.cxx index 573763141b18..691e05d6d0e1 100644 --- a/sc/source/core/tool/chartarr.cxx +++ b/sc/source/core/tool/chartarr.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -613,3 +614,4 @@ BOOL ScChartCollection::operator==(const ScChartCollection& rCmp) const return TRUE; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/charthelper.cxx b/sc/source/core/tool/charthelper.cxx index 4c314ee37ff4..19b9e4099be3 100644 --- a/sc/source/core/tool/charthelper.cxx +++ b/sc/source/core/tool/charthelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -294,3 +295,5 @@ void ScChartHelper::SetChartRanges( const uno::Reference< chart2::XChartDocument if( xModel.is() ) xModel->unlockControllers(); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/chartlis.cxx b/sc/source/core/tool/chartlis.cxx index b729ce0b30b5..15489babda4f 100644 --- a/sc/source/core/tool/chartlis.cxx +++ b/sc/source/core/tool/chartlis.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -734,3 +735,4 @@ void ScChartListenerCollection::EndListeningHiddenRange( ScChartHiddenRangeListe maHiddenListeners.remove_if(MatchListener(pListener)); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/chartlock.cxx b/sc/source/core/tool/chartlock.cxx index 54a49fb4b4aa..f73b74ff778c 100644 --- a/sc/source/core/tool/chartlock.cxx +++ b/sc/source/core/tool/chartlock.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -193,3 +194,5 @@ IMPL_LINK( ScTemporaryChartLock, TimeoutHdl, Timer*, EMPTYARG ) mapScChartLockGuard.reset(); return 0; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/chartpos.cxx b/sc/source/core/tool/chartpos.cxx index e36786955755..f8630df4a836 100644 --- a/sc/source/core/tool/chartpos.cxx +++ b/sc/source/core/tool/chartpos.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -611,3 +612,5 @@ ScChartPositionMap::~ScChartPositionMap() } delete [] ppRowHeader; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx index ba3f3e47bfb7..7ff7e4c17b49 100644 --- a/sc/source/core/tool/chgtrack.cxx +++ b/sc/source/core/tool/chgtrack.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -4867,3 +4868,5 @@ String ScChangeTrack::ToString() const return aReturn; } #endif // DEBUG_CHANGETRACK + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/chgviset.cxx b/sc/source/core/tool/chgviset.cxx index ac587db2bd12..df7ea28feb77 100644 --- a/sc/source/core/tool/chgviset.cxx +++ b/sc/source/core/tool/chgviset.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -176,3 +177,4 @@ void ScChangeViewSettings::AdjustDateMode( const ScDocument& rDoc ) } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/collect.cxx b/sc/source/core/tool/collect.cxx index d1726d031e7d..1b929892bd1e 100644 --- a/sc/source/core/tool/collect.cxx +++ b/sc/source/core/tool/collect.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -502,3 +503,4 @@ BOOL TypedScStrCollection::GetExactMatch( String& rString ) const +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 0a41583a130a..d5f22a5cc9c9 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -5498,3 +5499,5 @@ FormulaTokenRef ScCompiler::ExtendRangeReference( FormulaToken & rTok1, FormulaT { return ScToken::ExtendRangeReference( rTok1, rTok2, aPos,bReuseDoubleRef ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/consoli.cxx b/sc/source/core/tool/consoli.cxx index 916511414e94..006d1746501b 100644 --- a/sc/source/core/tool/consoli.cxx +++ b/sc/source/core/tool/consoli.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -858,3 +859,4 @@ void ScConsData::OutputToDocument( ScDocument* pDestDoc, SCCOL nCol, SCROW nRow, +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/dbcolect.cxx b/sc/source/core/tool/dbcolect.cxx index c9e926252be8..3bd737b2c572 100644 --- a/sc/source/core/tool/dbcolect.cxx +++ b/sc/source/core/tool/dbcolect.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -895,3 +896,4 @@ BOOL ScDBCollection::Insert(ScDataObject* pScDataObject) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/ddelink.cxx b/sc/source/core/tool/ddelink.cxx index 977161760eb0..00b97d430f0c 100644 --- a/sc/source/core/tool/ddelink.cxx +++ b/sc/source/core/tool/ddelink.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -277,3 +278,4 @@ void ScDdeLink::TryUpdate() } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/detdata.cxx b/sc/source/core/tool/detdata.cxx index a1add9ca6939..075187105461 100644 --- a/sc/source/core/tool/detdata.cxx +++ b/sc/source/core/tool/detdata.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -116,3 +117,4 @@ BOOL ScDetOpList::operator==( const ScDetOpList& r ) const +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/detfunc.cxx b/sc/source/core/tool/detfunc.cxx index 3774cbee7d06..3916e2e27de3 100644 --- a/sc/source/core/tool/detfunc.cxx +++ b/sc/source/core/tool/detfunc.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1762,3 +1763,4 @@ BOOL ScDetectiveFunc::IsColorsInitialized() return bColorsInitialized; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/docoptio.cxx b/sc/source/core/tool/docoptio.cxx index ef20ae4d33ad..e905cbe7f24d 100644 --- a/sc/source/core/tool/docoptio.cxx +++ b/sc/source/core/tool/docoptio.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -709,3 +710,4 @@ void ScDocCfg::SetOptions( const ScDocOptions& rNew ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/doubleref.cxx b/sc/source/core/tool/doubleref.cxx index 740413ea8533..a547041b4ce2 100644 --- a/sc/source/core/tool/doubleref.cxx +++ b/sc/source/core/tool/doubleref.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -563,3 +564,4 @@ bool ScDBExternalRange::isRangeEqual(const ScRange& /*rRange*/) const return false; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/editutil.cxx b/sc/source/core/tool/editutil.cxx index 335f8c0d925b..a8a5e2cda967 100644 --- a/sc/source/core/tool/editutil.cxx +++ b/sc/source/core/tool/editutil.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -777,3 +778,5 @@ ScNoteEditEngine::ScNoteEditEngine( SfxItemPool* pEnginePoolP, SetEditTextObjectPool( pTextObjectPool ); SetControlWord( (GetControlWord() | EE_CNTRL_MARKFIELDS) & ~EE_CNTRL_RTFSTYLESHEETS ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/filtopt.cxx b/sc/source/core/tool/filtopt.cxx index 7ac3d710b420..b5c109b6602f 100644 --- a/sc/source/core/tool/filtopt.cxx +++ b/sc/source/core/tool/filtopt.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -118,3 +119,4 @@ void ScFilterOptions::Notify( const Sequence<rtl::OUString>& /* aPropertyNames * } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/formulaparserpool.cxx b/sc/source/core/tool/formulaparserpool.cxx index 75d1c874eba8..1270bf185ff4 100644 --- a/sc/source/core/tool/formulaparserpool.cxx +++ b/sc/source/core/tool/formulaparserpool.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -166,3 +167,4 @@ Reference< XFormulaParser > ScFormulaParserPool::getFormulaParser( const OUStrin // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/hints.cxx b/sc/source/core/tool/hints.cxx index e9225b39c29f..7597070fbe18 100644 --- a/sc/source/core/tool/hints.cxx +++ b/sc/source/core/tool/hints.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -156,3 +157,4 @@ ScDataPilotModifiedHint::~ScDataPilotModifiedHint() } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/inputopt.cxx b/sc/source/core/tool/inputopt.cxx index ed5a74582348..449ec8355dc1 100644 --- a/sc/source/core/tool/inputopt.cxx +++ b/sc/source/core/tool/inputopt.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -272,3 +273,4 @@ void ScInputCfg::OptionsChanged() } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index fec208671760..abfad9c44dab 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -70,6 +71,7 @@ #include "rangenam.hxx" #include "compiler.hxx" #include "externalrefmgr.hxx" +#include <basic/sbstar.hxx> #include "doubleref.hxx" #include "queryparam.hxx" @@ -4297,7 +4299,17 @@ void ScInterpreter::ScMatch() } } if ( rEntry.bQueryByString ) - rParam.bRegExp = MayBeRegExp( *rEntry.pStr, pDok ); + { + BOOL bIsVBAMode = FALSE; + if ( pDok ) + bIsVBAMode = pDok->IsInVBAMode(); + + // #TODO handle MSO wildcards + if ( bIsVBAMode ) + rParam.bRegExp = FALSE; + else + rParam.bRegExp = MayBeRegExp( *rEntry.pStr, pDok ); + } if (pMatSrc) // The source data is matrix array. { @@ -7631,3 +7643,5 @@ bool ScInterpreter::LookupQueryWithCache( ScAddress & o_rResultPos, } return bFound; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx index f65ccc41314c..599d2ba08e3b 100644 --- a/sc/source/core/tool/interpr2.cxx +++ b/sc/source/core/tool/interpr2.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -3032,3 +3033,4 @@ failed : PushError( errNoRef ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx index bcea57703d78..92899399429d 100644 --- a/sc/source/core/tool/interpr3.cxx +++ b/sc/source/core/tool/interpr3.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -4242,3 +4243,4 @@ void ScInterpreter::ScForecast() } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index 2edd18a369f0..8ae964952cd1 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -33,10 +34,14 @@ #include <sfx2/app.hxx> #include <sfx2/docfile.hxx> #include <sfx2/objsh.hxx> +#include <sfx2/docfilt.hxx> #include <basic/sbmeth.hxx> #include <basic/sbmod.hxx> #include <basic/sbstar.hxx> #include <basic/sbx.hxx> +#include <basic/sbxobj.hxx> +#include <basic/sbuno.hxx> +#include <svl/zforlist.hxx> #include <svl/zforlist.hxx> #include <tools/urlobj.hxx> #include <rtl/logfile.hxx> @@ -45,6 +50,8 @@ #include <signal.h> #include <com/sun/star/table/XCellRange.hpp> +#include <com/sun/star/sheet/XSheetCellRange.hpp> +#include <comphelper/processfactory.hxx> #include "interpre.hxx" #include "global.hxx" @@ -65,6 +72,8 @@ #include "jumpmatrix.hxx" #include "parclass.hxx" #include "externalrefmgr.hxx" +#include "formula/FormulaCompiler.hxx" +#include "macromgr.hxx" #include "doubleref.hxx" #include <math.h> @@ -72,6 +81,8 @@ #include <map> #include <algorithm> #include <functional> +#include <basic/basmgr.hxx> +#include <vbahelper/vbaaccesshelper.hxx> #include <memory> using namespace com::sun::star; @@ -2925,6 +2936,61 @@ void ScInterpreter::ScMissing() PushTempToken( new FormulaMissingToken ); } +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 ); + rtl::OUString sCodeName; + xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("CodeName") ) ) >>= sCodeName; + // #TODO #FIXME ideally we should 'throw' here if we don't get a valid parent, but... it is possible + // to create a module ( and use 'Option VBASupport 1' ) for a calc document, in this scenario there + // are *NO* special document module objects ( of course being able to switch between vba/non vba mode at + // the document in the future could fix this, especially IF the switching of the vba mode takes care to + // create the special document module objects if they don't exist. + BasicManager* pBasMgr = pDok->GetDocumentShell()->GetBasicManager(); + + uno::Reference< uno::XInterface > xIf; + if ( pBasMgr && pBasMgr->GetName().Len() ) + { + String sProj = String( RTL_CONSTASCII_USTRINGPARAM( "Standard" ) ); + if ( pDok->GetDocumentShell()->GetBasicManager()->GetName().Len() ) + sProj = pDok->GetDocumentShell()->GetBasicManager()->GetName(); + StarBASIC* pBasic = pDok->GetDocumentShell()->GetBasicManager()->GetLib( sProj ); + if ( pBasic ) + { + SbModule* pMod = pBasic->FindModule( sCodeName ); + if ( pMod ) + xIf = pMod->GetUnoModule(); + } + } + return uno::makeAny( xIf ); +} + +bool +lcl_setVBARange( ScRange& aRange, ScDocument* pDok, SbxVariable* pPar ) +{ + bool bOk = false; + try + { + uno::Reference< uno::XInterface > xVBARange; + uno::Reference<table::XCellRange> xCellRange = ScCellRangeObj::CreateRangeFromDoc( pDok, aRange ); + uno::Sequence< uno::Any > aArgs(2); + aArgs[0] = lcl_getSheetModule( xCellRange, pDok ); + aArgs[1] = uno::Any( xCellRange ); + xVBARange = ooo::vba::createVBAUnoAPIServiceWithArgs( pDok->GetDocumentShell(), "ooo.vba.excel.Range", aArgs ); + if ( xVBARange.is() ) + { + String sDummy(RTL_CONSTASCII_USTRINGPARAM("A-Range") ); + SbxObjectRef aObj = GetSbUnoObject( sDummy, uno::Any( xVBARange ) ); + SetSbUnoObjectDfltPropName( aObj ); + bOk = pPar->PutObject( aObj ); + } + } + catch( uno::Exception& ) + { + } + return bOk; +} void ScInterpreter::ScMacro() { @@ -2962,8 +3028,11 @@ void ScInterpreter::ScMacro() return; } + bool bVolatileMacro = false; SbMethod* pMethod = (SbMethod*)pVar; + SbModule* pModule = pMethod->GetModule(); + bool bUseVBAObjects = pModule->IsVBACompat(); SbxObject* pObject = pModule->GetParent(); DBG_ASSERT(pObject->IsA(TYPE(StarBASIC)), "Kein Basic gefunden!"); String aMacroStr = pObject->GetName(); @@ -2973,7 +3042,13 @@ void ScInterpreter::ScMacro() aMacroStr += pMethod->GetName(); String aBasicStr; if (pObject->GetParent()) + { aBasicStr = pObject->GetParent()->GetName(); // Dokumentenbasic + const SfxFilter* pFilter = NULL; + SfxMedium* pMedium = pDok->GetDocumentShell()->GetMedium(); + if ( pMedium ) + pFilter = pMedium->GetFilter(); + } else aBasicStr = SFX_APP()->GetName(); // Applikationsbasic @@ -2997,7 +3072,13 @@ void ScInterpreter::ScMacro() { ScAddress aAdr; PopSingleRef( aAdr ); - bOk = SetSbxVariable( pPar, aAdr ); + if ( bUseVBAObjects ) + { + ScRange aRange( aAdr ); + bOk = lcl_setVBARange( aRange, pDok, pPar ); + } + else + bOk = SetSbxVariable( pPar, aAdr ); } break; case svDoubleRef: @@ -3016,24 +3097,32 @@ void ScInterpreter::ScMacro() } else { - SbxDimArrayRef refArray = new SbxDimArray; - refArray->AddDim32( 1, nRow2 - nRow1 + 1 ); - refArray->AddDim32( 1, nCol2 - nCol1 + 1 ); - ScAddress aAdr( nCol1, nRow1, nTab1 ); - for( SCROW nRow = nRow1; bOk && nRow <= nRow2; nRow++ ) + if ( bUseVBAObjects ) { - aAdr.SetRow( nRow ); - INT32 nIdx[ 2 ]; - nIdx[ 0 ] = nRow-nRow1+1; - for( SCCOL nCol = nCol1; bOk && nCol <= nCol2; nCol++ ) + ScRange aRange( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 ); + bOk = lcl_setVBARange( aRange, pDok, pPar ); + } + else + { + SbxDimArrayRef refArray = new SbxDimArray; + refArray->AddDim32( 1, nRow2 - nRow1 + 1 ); + refArray->AddDim32( 1, nCol2 - nCol1 + 1 ); + ScAddress aAdr( nCol1, nRow1, nTab1 ); + for( SCROW nRow = nRow1; bOk && nRow <= nRow2; nRow++ ) { - aAdr.SetCol( nCol ); - nIdx[ 1 ] = nCol-nCol1+1; - SbxVariable* p = refArray->Get32( nIdx ); - bOk = SetSbxVariable( p, aAdr ); + aAdr.SetRow( nRow ); + INT32 nIdx[ 2 ]; + nIdx[ 0 ] = nRow-nRow1+1; + for( SCCOL nCol = nCol1; bOk && nCol <= nCol2; nCol++ ) + { + aAdr.SetCol( nCol ); + nIdx[ 1 ] = nCol-nCol1+1; + SbxVariable* p = refArray->Get32( nIdx ); + bOk = SetSbxVariable( p, aAdr ); + } } + pPar->PutObject( refArray ); } - pPar->PutObject( refArray ); } } break; @@ -3081,6 +3170,13 @@ void ScInterpreter::ScMacro() pDok->DecMacroInterpretLevel(); pDok->UnlockTable( aPos.Tab() ); + ScMacroManager* pMacroMgr = pDok->GetMacroManager(); + if (pMacroMgr) + { + bVolatileMacro = pMacroMgr->GetUserFuncVolatile( pMethod->GetName() ); + pMacroMgr->AddDependentCell(pModule->GetName(), pMyFormulaCell); + } + SbxDataType eResType = refRes->GetType(); if( pVar->GetError() ) SetError( errNoValue); @@ -3152,6 +3248,9 @@ void ScInterpreter::ScMacro() } pSfxApp->LeaveBasicCall(); + + if (bVolatileMacro && meVolaileType == NOT_VOLATILE) + meVolaileType = VOLATILE_MACRO; } @@ -3448,7 +3547,8 @@ ScInterpreter::ScInterpreter( ScFormulaCell* pCell, ScDocument* pDoc, pMyFormulaCell( pCell ), pFormatter( pDoc->GetFormatTable() ), mnStringNoValueError( errNoValue), - bCalcAsShown( pDoc->GetDocOptions().IsCalcAsShown() ) + bCalcAsShown( pDoc->GetDocOptions().IsCalcAsShown() ), + meVolaileType(NOT_VOLATILE) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScTTT" ); // pStack = new ScToken*[ MAXSTACK ]; @@ -3895,6 +3995,9 @@ StackVar ScInterpreter::Interpret() continue; // while( ( pCur = aCode.Next() ) != NULL ... } + if (FormulaCompiler::IsOpCodeVolatile(eOp)) + meVolaileType = VOLATILE; + // Remember result matrix in case it could be reused. if (pTokenMatrixMap && sp && GetStackType() == svMatrix) pTokenMatrixMap->insert( ScTokenMatrixMap::value_type( pCur, @@ -4160,3 +4263,5 @@ StackVar ScInterpreter::Interpret() static_cast<ScToken*>(xResult.operator->())->GetMatrix()->SetImmutable( true); return eType; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/interpr5.cxx b/sc/source/core/tool/interpr5.cxx index 82830796ec09..049e7a235870 100644 --- a/sc/source/core/tool/interpr5.cxx +++ b/sc/source/core/tool/interpr5.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -322,6 +323,11 @@ ScMatrixRef ScInterpreter::GetNewMat(SCSIZE nC, SCSIZE nR) return pMat; } +ScInterpreter::VolatileType ScInterpreter::GetVolatileType() const +{ + return meVolaileType; +} + ScMatrixRef ScInterpreter::CreateMatrixFromDoubleRef( const FormulaToken* pToken, SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2 ) @@ -2811,3 +2817,5 @@ void ScInterpreter::ScInfo() PushIllegalArgument(); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/interpr6.cxx b/sc/source/core/tool/interpr6.cxx index c514f15043a9..109495ddb6d2 100644 --- a/sc/source/core/tool/interpr6.cxx +++ b/sc/source/core/tool/interpr6.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -195,3 +196,5 @@ double ScInterpreter::GetGammaDist( double fX, double fAlpha, double fLambda ) else return GetLowRegIGamma( fAlpha, fX / fLambda); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/lookupcache.cxx b/sc/source/core/tool/lookupcache.cxx index 3ba66011d0e4..75f45261e471 100644 --- a/sc/source/core/tool/lookupcache.cxx +++ b/sc/source/core/tool/lookupcache.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -124,3 +125,5 @@ void ScLookupCache::Notify( SvtBroadcaster & /* rBC */ , const SfxHint & rHint } } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/navicfg.cxx b/sc/source/core/tool/navicfg.cxx index 0991071774ed..a0b9b629bc34 100644 --- a/sc/source/core/tool/navicfg.cxx +++ b/sc/source/core/tool/navicfg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -78,3 +79,4 @@ void ScNavipiCfg::SetRootType(USHORT nNew) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/odffmap.cxx b/sc/source/core/tool/odffmap.cxx index d6243c652b10..28b13e249a07 100644 --- a/sc/source/core/tool/odffmap.cxx +++ b/sc/source/core/tool/odffmap.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -148,3 +149,5 @@ size_t ScCompiler::GetAddInMapCount() { return SAL_N_ELEMENTS(maAddInMap); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/optutil.cxx b/sc/source/core/tool/optutil.cxx index dc63c7819eff..03f4174c8613 100644 --- a/sc/source/core/tool/optutil.cxx +++ b/sc/source/core/tool/optutil.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -77,3 +78,4 @@ void ScLinkConfigItem::Commit() } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/parclass.cxx b/sc/source/core/tool/parclass.cxx index a863bc0a68c2..9af15044f69a 100644 --- a/sc/source/core/tool/parclass.cxx +++ b/sc/source/core/tool/parclass.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -576,3 +577,4 @@ void ScParameterClassification::GenerateDocumentation() #endif // OSL_DEBUG_LEVEL +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/printopt.cxx b/sc/source/core/tool/printopt.cxx index 28b9c45d1235..f895bbc0a6ca 100644 --- a/sc/source/core/tool/printopt.cxx +++ b/sc/source/core/tool/printopt.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -206,3 +207,4 @@ void ScPrintCfg::SetOptions( const ScPrintOptions& rNew ) void ScPrintCfg::Notify( const ::com::sun::star::uno::Sequence< rtl::OUString >& ) {} +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/prnsave.cxx b/sc/source/core/tool/prnsave.cxx index b432f585e854..35200d6b4ff9 100644 --- a/sc/source/core/tool/prnsave.cxx +++ b/sc/source/core/tool/prnsave.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -133,3 +134,4 @@ BOOL ScPrintRangeSaver::operator==( const ScPrintRangeSaver& rCmp ) const +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/progress.cxx b/sc/source/core/tool/progress.cxx index a2fa45764bcc..0a26b968f112 100644 --- a/sc/source/core/tool/progress.cxx +++ b/sc/source/core/tool/progress.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -196,3 +197,4 @@ void ScProgress::DeleteInterpretProgress() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/queryparam.cxx b/sc/source/core/tool/queryparam.cxx index 20c4b975c0c0..ca87b1503b0b 100644 --- a/sc/source/core/tool/queryparam.cxx +++ b/sc/source/core/tool/queryparam.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -377,3 +378,4 @@ ScDBQueryParamMatrix::~ScDBQueryParamMatrix() { } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/rangelst.cxx b/sc/source/core/tool/rangelst.cxx index 1ab978866c67..ed93713eb65f 100644 --- a/sc/source/core/tool/rangelst.cxx +++ b/sc/source/core/tool/rangelst.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -83,15 +84,18 @@ USHORT ScRangeList::Parse( const String& rStr, ScDocument* pDoc, USHORT nMask, for ( USHORT i=0; i<nTCount; i++ ) { aOne = rStr.GetToken( i, cDelimiter ); - // FIXME : broken for Lotus - if ( aOne.Search( ':' ) == STRING_NOTFOUND ) - { // Range muss es sein - String aStrTmp( aOne ); - aOne += ':'; - aOne += aStrTmp; - } aRange.aStart.SetTab( nTab ); // Default Tab wenn nicht angegeben - USHORT nRes = aRange.Parse( aOne, pDoc, eConv ); + USHORT nRes = aRange.ParseAny( aOne, pDoc, eConv ); + USHORT nEndRangeBits = SCA_VALID_COL2 | SCA_VALID_ROW2 | +SCA_VALID_TAB2; + USHORT nTmp1 = ( nRes & SCA_BITS ); + USHORT nTmp2 = ( nRes & nEndRangeBits ); + // If we have a valid single range with + // any of the address bits we are interested in + // set - set the equiv end range bits + if ( (nRes & SCA_VALID ) && nTmp1 && ( nTmp2 != nEndRangeBits ) ) + nRes |= ( nTmp1 << 4 ); + if ( (nRes & nMask) == nMask ) Append( aRange ); nResult &= nRes; // alle gemeinsamen Bits bleiben erhalten @@ -701,3 +705,4 @@ ScRangePair** ScRangePairList::CreateNameSortedArray( ULONG& nListCount, +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/rangenam.cxx b/sc/source/core/tool/rangenam.cxx index de90239c7123..f115f4a4bf62 100644 --- a/sc/source/core/tool/rangenam.cxx +++ b/sc/source/core/tool/rangenam.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -799,3 +800,4 @@ void ScRangeName::UpdateTabRef(SCTAB nOldTable, USHORT nFlag, SCTAB nNewTable) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/rangeseq.cxx b/sc/source/core/tool/rangeseq.cxx index 5584fb1c37e2..d7b86780e562 100644 --- a/sc/source/core/tool/rangeseq.cxx +++ b/sc/source/core/tool/rangeseq.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -474,3 +475,4 @@ BOOL ScByteSequenceToString::GetString( String& rString, const uno::Any& rAny, //------------------------------------------------------------------------ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/rangeutl.cxx b/sc/source/core/tool/rangeutl.cxx index a2d624d935f7..6cae0b6d2f24 100644 --- a/sc/source/core/tool/rangeutl.cxx +++ b/sc/source/core/tool/rangeutl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1105,3 +1106,4 @@ BOOL ScAreaNameIterator::Next( String& rName, ScRange& rRange ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/rechead.cxx b/sc/source/core/tool/rechead.cxx index 6da946463697..90818b37cd60 100644 --- a/sc/source/core/tool/rechead.cxx +++ b/sc/source/core/tool/rechead.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -171,3 +172,4 @@ void ScMultipleWriteHeader::StartEntry() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/refdata.cxx b/sc/source/core/tool/refdata.cxx index c6373426bbd1..07c8442f6bd7 100644 --- a/sc/source/core/tool/refdata.cxx +++ b/sc/source/core/tool/refdata.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -266,3 +267,5 @@ ScComplexRefData& ScComplexRefData::Extend( const ScComplexRefData & rRef, const { return Extend( rRef.Ref1, rPos).Extend( rRef.Ref2, rPos); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/reffind.cxx b/sc/source/core/tool/reffind.cxx index e406ebccf916..49c91cfa42e8 100644 --- a/sc/source/core/tool/reffind.cxx +++ b/sc/source/core/tool/reffind.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -173,3 +174,4 @@ void ScRefFinder::ToggleRel( xub_StrLen nStartPos, xub_StrLen nEndPos ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/refreshtimer.cxx b/sc/source/core/tool/refreshtimer.cxx index 5520aac6d6eb..a5c2e24f6082 100644 --- a/sc/source/core/tool/refreshtimer.cxx +++ b/sc/source/core/tool/refreshtimer.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -79,3 +80,4 @@ void ScRefreshTimer::Timeout() } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/reftokenhelper.cxx b/sc/source/core/tool/reftokenhelper.cxx index 660bdffc2cec..e7255f91911b 100644 --- a/sc/source/core/tool/reftokenhelper.cxx +++ b/sc/source/core/tool/reftokenhelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -493,3 +494,5 @@ ScSharedTokenRef ScRefTokenHelper::createRefToken(const ScRange& rRange) ScSharedTokenRef pRef(new ScDoubleRefToken(aRefData)); return pRef; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/refupdat.cxx b/sc/source/core/tool/refupdat.cxx index ad11190be75d..970a85d3392a 100644 --- a/sc/source/core/tool/refupdat.cxx +++ b/sc/source/core/tool/refupdat.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -937,3 +938,4 @@ ScRefUpdateRes ScRefUpdate::UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCRO } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx index 67e94823b71c..c7232c3adebc 100644 --- a/sc/source/core/tool/scmatrix.cxx +++ b/sc/source/core/tool/scmatrix.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -814,3 +815,4 @@ double ScMatrix::Or() return bOr; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/simplerangelist.cxx b/sc/source/core/tool/simplerangelist.cxx index ca86775b1487..278fd74c832a 100644 --- a/sc/source/core/tool/simplerangelist.cxx +++ b/sc/source/core/tool/simplerangelist.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -241,3 +242,5 @@ ScSimpleRangeList::RangeListRef ScSimpleRangeList::findTab(SCTAB nTab) return itr->second; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/stringutil.cxx b/sc/source/core/tool/stringutil.cxx index f8be97e22449..fd20988e688c 100644 --- a/sc/source/core/tool/stringutil.cxx +++ b/sc/source/core/tool/stringutil.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -138,3 +139,5 @@ bool ScStringUtil::parseSimpleNumber( return true; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/subtotal.cxx b/sc/source/core/tool/subtotal.cxx index 077b5a9d9751..7f211cef4033 100644 --- a/sc/source/core/tool/subtotal.cxx +++ b/sc/source/core/tool/subtotal.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -79,3 +80,5 @@ BOOL SubTotal::SafeDiv(double& fVal1, double fVal2) } return bOk; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index 2dd6dc1ff7ea..7c972250c7d2 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1795,3 +1796,4 @@ void ScTokenArray::ReadjustRelative3DReferences( const ScAddress& rOldPos, } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/unitconv.cxx b/sc/source/core/tool/unitconv.cxx index 21f80cb1c628..918060b12751 100644 --- a/sc/source/core/tool/unitconv.cxx +++ b/sc/source/core/tool/unitconv.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -176,3 +177,4 @@ BOOL ScUnitConverter::GetValue( double& fValue, const String& rFromUnit, } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/userlist.cxx b/sc/source/core/tool/userlist.cxx index 08609eeff940..deb070005653 100644 --- a/sc/source/core/tool/userlist.cxx +++ b/sc/source/core/tool/userlist.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -295,3 +296,4 @@ BOOL ScUserList::HasEntry( const String& rStr ) const return FALSE; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/viewopti.cxx b/sc/source/core/tool/viewopti.cxx index 3b85e4977510..4c01f443d0db 100644 --- a/sc/source/core/tool/viewopti.cxx +++ b/sc/source/core/tool/viewopti.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -748,3 +749,4 @@ void ScViewCfg::SetOptions( const ScViewOptions& rNew ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/zforauto.cxx b/sc/source/core/tool/zforauto.cxx index b505e5a5051c..0b9f116aa153 100644 --- a/sc/source/core/tool/zforauto.cxx +++ b/sc/source/core/tool/zforauto.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -104,3 +105,5 @@ ULONG ScNumFormatAbbrev::GetFormatIndex( SvNumberFormatter& rFormatter) return rFormatter.GetIndexPuttingAndConverting( sFormatstring, eLnge, eSysLnge, nType, bNewInserted, nCheckPos); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/dif/difexp.cxx b/sc/source/filter/dif/difexp.cxx index 69421879983e..0a04d2ca7d6f 100644 --- a/sc/source/filter/dif/difexp.cxx +++ b/sc/source/filter/dif/difexp.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -315,3 +316,4 @@ FltError ScFormatFilterPluginImpl::ScExportDif( SvStream& rOut, ScDocument* pDoc +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/dif/difimp.cxx b/sc/source/filter/dif/difimp.cxx index 2088cc84a791..3165ca2b5f4c 100644 --- a/sc/source/filter/dif/difimp.cxx +++ b/sc/source/filter/dif/difimp.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1006,3 +1007,4 @@ void DifAttrCache::Apply( ScDocument& rDoc, SCTAB nTab ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/colrowst.cxx b/sc/source/filter/excel/colrowst.cxx index 417f7aa525d3..6905d295009d 100644 --- a/sc/source/filter/excel/colrowst.cxx +++ b/sc/source/filter/excel/colrowst.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -363,3 +364,4 @@ void XclImpColRowSettings::ConvertHiddenFlags( SCTAB nScTab ) rDoc.ShowRows( mnLastScRow + 1, MAXROW, nScTab, FALSE ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/excdoc.cxx b/sc/source/filter/excel/excdoc.cxx index 458629979172..b366f3a413d5 100644 --- a/sc/source/filter/excel/excdoc.cxx +++ b/sc/source/filter/excel/excdoc.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -84,6 +85,8 @@ #include <math.h> +#include <com/sun/star/document/XDocumentProperties.hpp> +#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> #include <oox/core/tokens.hxx> using ::rtl::OString; @@ -119,27 +122,22 @@ static void lcl_AddCalcPr( XclExpRecordList<>& aRecList, ExcTable& self ) aRecList.AppendNewRecord( new XclExpXmlEndSingleElementRecord() ); // XML_calcPr } -#if 0 -// removed during rebase, because scsheetprotection02 is not yet up-stream :-( static void lcl_AddWorkbookProtection( XclExpRecordList<>& aRecList, ExcTable& self ) { aRecList.AppendNewRecord( new XclExpXmlStartSingleElementRecord( XML_workbookProtection ) ); + const ScDocProtection* pProtect = self.GetDoc().GetDocProtection(); if (pProtect && pProtect->isProtected()) { aRecList.AppendNewRecord( new XclExpWindowProtection(pProtect->isOptionEnabled(ScDocProtection::WINDOWS)) ); aRecList.AppendNewRecord( new XclExpProtection(pProtect->isOptionEnabled(ScDocProtection::STRUCTURE)) ); +#if ENABLE_SHEET_PROTECTION aRecList.AppendNewRecord( new XclExpPassHash(pProtect->getPasswordHash(PASSHASH_XL)) ); +#endif } - if( self.GetBiff() == EXC_BIFF8 ) - { - aRecList.AppendNewRecord( new XclExpProt4Rev ); - aRecList.AppendNewRecord( new XclExpProt4RevPass ); - } aRecList.AppendNewRecord( new XclExpXmlEndSingleElementRecord() ); // XML_workbookProtection } -#endif static void lcl_AddScenariosAndFilters( XclExpRecordList<>& aRecList, const XclExpRoot& rRoot, SCTAB nScTab ) { @@ -267,30 +265,25 @@ void ExcTable::FillAsHeader( ExcBoundsheetList& rBoundsheetList ) } // document protection options - const ScDocProtection* pProtect = GetDoc().GetDocProtection(); - if (pProtect && pProtect->isProtected()) + if( GetOutput() == EXC_OUTPUT_BINARY ) { - Add( new XclExpWindowProtection(pProtect->isOptionEnabled(ScDocProtection::WINDOWS)) ); - Add( new XclExpProtection(pProtect->isOptionEnabled(ScDocProtection::STRUCTURE)) ); -#if ENABLE_SHEET_PROTECTION - Add( new XclExpPassHash(pProtect->getPasswordHash(PASSHASH_XL)) ); -#endif - } + lcl_AddWorkbookProtection( aRecList, *this ); - if( GetBiff() == EXC_BIFF8 ) - { - Add( new XclExpProt4Rev ); - Add( new XclExpProt4RevPass ); - } + if( GetBiff() == EXC_BIFF8 ) + { + Add( new XclExpProt4Rev ); + Add( new XclExpProt4RevPass ); + } - // document protection options - if( GetOutput() == EXC_OUTPUT_BINARY ) - { - //lcl_AddWorkbookProtection( aRecList, *this ); lcl_AddBookviews( aRecList, *this ); } Add( new XclExpXmlStartSingleElementRecord( XML_workbookPr ) ); + if ( GetBiff() == EXC_BIFF8 && GetOutput() != EXC_OUTPUT_BINARY ) + { + Add( new XclExpBoolRecord(0x0040, false, XML_backupFile ) ); // BACKUP + Add( new XclExpBoolRecord(0x008D, false, XML_showObjects ) ); // HIDEOBJ + } if ( GetBiff() == EXC_BIFF8 ) { @@ -374,7 +367,7 @@ void ExcTable::FillAsHeader( ExcBoundsheetList& rBoundsheetList ) if( GetOutput() != EXC_OUTPUT_BINARY ) { - //lcl_AddWorkbookProtection( aRecList, *this ); + lcl_AddWorkbookProtection( aRecList, *this ); lcl_AddBookviews( aRecList, *this ); } @@ -635,6 +628,9 @@ void ExcTable::FillAsXmlTable( SCTAB nCodeNameIdx ) } } + // all MSODRAWING and OBJ stuff of this sheet goes here + aRecList.AppendRecord( GetObjectManager().ProcessDrawing( GetSdrPage( mnScTab ) ) ); + // EOF Add( new ExcEof ); } @@ -785,28 +781,34 @@ void ExcDocument::Write( SvStream& rSvStrm ) pExpChangeTrack->Write(); } -void ExcDocument::WriteXml( SvStream& rStrm ) +void ExcDocument::WriteXml( XclExpXmlStream& rStrm ) { + SfxObjectShell* pDocShell = GetDocShell(); + + using namespace ::com::sun::star; + uno::Reference<document::XDocumentPropertiesSupplier> xDPS( pDocShell->GetModel(), uno::UNO_QUERY_THROW ); + uno::Reference<document::XDocumentProperties> xDocProps = xDPS->getDocumentProperties(); + + rStrm.exportDocumentProperties( xDocProps ); + + sax_fastparser::FSHelperPtr& rWorkbook = rStrm.GetCurrentStream(); + rWorkbook->startElement( XML_workbook, + XML_xmlns, "http://schemas.openxmlformats.org/spreadsheetml/2006/main", + FSNS(XML_xmlns, XML_r), "http://schemas.openxmlformats.org/officeDocument/2006/relationships", + FSEND ); + rWorkbook->singleElement( XML_fileVersion, + XML_appName, "Calc", + // OOXTODO: XML_codeName + // OOXTODO: XML_lastEdited + // OOXTODO: XML_lowestEdited + // OOXTODO: XML_rupBuild + FSEND ); + if( !maTableList.IsEmpty() ) { InitializeSave(); - XclExpXmlStream aStrm( ::comphelper::getProcessServiceFactory(), rStrm, GetRoot() ); - - sax_fastparser::FSHelperPtr& rWorkbook = aStrm.GetCurrentStream(); - rWorkbook->startElement( XML_workbook, - XML_xmlns, "http://schemas.openxmlformats.org/spreadsheetml/2006/main", - FSNS(XML_xmlns, XML_r), "http://schemas.openxmlformats.org/officeDocument/2006/relationships", - FSEND ); - rWorkbook->singleElement( XML_fileVersion, - XML_appName, "Calc", - // OOXTODO: XML_codeName - // OOXTODO: XML_lastEdited - // OOXTODO: XML_lowestEdited - // OOXTODO: XML_rupBuild - FSEND ); - - aHeader.WriteXml( aStrm ); + aHeader.WriteXml( rStrm ); for( size_t nTab = 0, nTabCount = maTableList.GetSize(); nTab < nTabCount; ++nTab ) { @@ -817,16 +819,17 @@ void ExcDocument::WriteXml( SvStream& rStrm ) xBoundsheet->SetStreamPos( aXclStrm.GetSvStreamPos() ); #endif // write the table - maTableList.GetRecord( nTab )->WriteXml( aStrm ); + maTableList.GetRecord( nTab )->WriteXml( rStrm ); } - - rWorkbook->endElement( XML_workbook ); - rWorkbook.reset(); - aStrm.commitStorage(); } -#if 0 + if( pExpChangeTrack ) - pExpChangeTrack->WriteXml(); -#endif + pExpChangeTrack->WriteXml( rStrm ); + + rWorkbook->endElement( XML_workbook ); + rWorkbook.reset(); + + rStrm.commitStorage(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/excel.cxx b/sc/source/filter/excel/excel.cxx index 3a43a23cd624..c0012c5519f7 100644 --- a/sc/source/filter/excel/excel.cxx +++ b/sc/source/filter/excel/excel.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -261,25 +262,10 @@ static FltError lcl_ExportExcelBiff( SfxMedium& rMedium, ScDocument *pDocument, return eRet; } -static FltError lcl_ExportExcel2007Xml( SfxMedium& rMedium, ScDocument *pDocument, - SvStream* pMedStrm, CharSet eNach ) -{ - SotStorageRef xRootStrg = (SotStorage*) 0; - - XclExpRootData aExpData( EXC_BIFF8, rMedium, xRootStrg, *pDocument, eNach ); - aExpData.meOutput = EXC_OUTPUT_XML_2007; - - ExportXml2007 aFilter( aExpData, *pMedStrm ); - - FltError eRet = aFilter.Write(); - - return eRet; -} - FltError ScFormatFilterPluginImpl::ScExportExcel5( SfxMedium& rMedium, ScDocument *pDocument, ExportFormatExcel eFormat, CharSet eNach ) { - if( eFormat != ExpBiff5 && eFormat != ExpBiff8 && eFormat != Exp2007Xml ) + if( eFormat != ExpBiff5 && eFormat != ExpBiff8 ) return eERR_NI; // check the passed Calc document @@ -294,11 +280,10 @@ FltError ScFormatFilterPluginImpl::ScExportExcel5( SfxMedium& rMedium, ScDocumen FltError eRet = eERR_UNKN_BIFF; if( eFormat == ExpBiff5 || eFormat == ExpBiff8 ) eRet = lcl_ExportExcelBiff( rMedium, pDocument, pMedStrm, eFormat == ExpBiff8, eNach ); - else if( eFormat == Exp2007Xml ) - eRet = lcl_ExportExcel2007Xml( rMedium, pDocument, pMedStrm, eNach ); return eRet; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/excform.cxx b/sc/source/filter/excel/excform.cxx index 1157a9cc2cf6..73de780b7237 100644 --- a/sc/source/filter/excel/excform.cxx +++ b/sc/source/filter/excel/excform.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -2012,3 +2013,4 @@ void ExcelToSc::ReadExtensions( const ExtensionTypeVec& rExtensions, } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/excform8.cxx b/sc/source/filter/excel/excform8.cxx index c444de3c8eeb..6f4887841431 100644 --- a/sc/source/filter/excel/excform8.cxx +++ b/sc/source/filter/excel/excform8.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1595,3 +1596,4 @@ BOOL ExcelToSc8::GetAbsRefs( ScRangeList& r, XclImpStream& aIn, sal_Size nLen ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx index f9d1b5b34f99..d4cc47c1f5f3 100644 --- a/sc/source/filter/excel/excimp8.cxx +++ b/sc/source/filter/excel/excimp8.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -99,15 +100,20 @@ #include "stlpool.hxx" #include "stlsheet.hxx" #include "detfunc.hxx" +#include "macromgr.hxx" #include <com/sun/star/document/XDocumentProperties.hpp> #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> +#include <com/sun/star/script/ModuleInfo.hpp> #include <cppuhelper/component_context.hxx> #include <sfx2/app.hxx> +#include "xltoolbar.hxx" using namespace com::sun::star; using ::rtl::OUString; +// 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 ) @@ -242,7 +248,30 @@ void ImportExcel8::ReadBasic( void ) { SvxImportMSVBasic aBasicImport( *pShell, *xRootStrg, bLoadCode, bLoadStrg ); bool bAsComment = !bLoadExecutable; + + if ( !bAsComment ) + { + ScDocument& rDoc = GetDoc(); +#if 1 + // see if we have the XCB stream + SvStorageStreamRef xXCB = xRootStrg->OpenSotStream( String( RTL_CONSTASCII_USTRINGPARAM( "XCB" ) ), STREAM_STD_READ | STREAM_NOCREATE ); + if ( xXCB.Is()|| SVSTREAM_OK == xXCB->GetError() ) + { + CTBWrapper wrapper; + if ( wrapper.Read( xXCB ) ) + { +#if DEBUG + wrapper.Print( stderr ); +#endif + wrapper.ImportCustomToolBar( *pShell ); + } + } +#endif + + } aBasicImport.Import( EXC_STORAGE_VBA_PROJECT, EXC_STORAGE_VBA, bAsComment ); + if ( !bAsComment ) + GetObjectManager().SetOleNameOverrideInfo( aBasicImport.ControlNameForObjectId() ); } } } @@ -726,3 +755,4 @@ XclImpAutoFilterData* XclImpAutoFilterBuffer::GetByTab( SCTAB nTab ) return NULL; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/excrecds.cxx b/sc/source/filter/excel/excrecds.cxx index 9a66325db419..3585edf98671 100644 --- a/sc/source/filter/excel/excrecds.cxx +++ b/sc/source/filter/excel/excrecds.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -154,6 +155,10 @@ void ExcRecord::WriteBody( XclExpStream& rStrm ) SaveCont( rStrm ); } +void ExcRecord::SaveXml( XclExpXmlStream& rStrm ) +{ +} + //--------------------------------------------------------- class ExcEmptyRec - @@ -356,6 +361,7 @@ Exc1904::Exc1904( ScDocument& rDoc ) { Date* pDate = rDoc.GetFormatTable()->GetNullDate(); bVal = pDate ? (*pDate == Date( 1, 1, 1904 )) : FALSE; + bDateCompatibility = pDate ? !( *pDate == Date( 30, 12, 1899 )) : FALSE; } @@ -367,9 +373,21 @@ UINT16 Exc1904::GetNum( void ) const void Exc1904::SaveXml( XclExpXmlStream& rStrm ) { - rStrm.WriteAttributes( + bool bISOIEC = ( rStrm.getVersion() == oox::core::ISOIEC_29500_2008 ); + + if( bISOIEC ) + { + rStrm.WriteAttributes( + XML_dateCompatibility, XclXmlUtils::ToPsz( bDateCompatibility ), + FSEND ); + } + + if( !bISOIEC || bDateCompatibility ) + { + rStrm.WriteAttributes( XML_date1904, XclXmlUtils::ToPsz( bVal ), FSEND ); + } } @@ -838,6 +856,7 @@ ExcAutoFilterRecs::ExcAutoFilterRecs( const XclExpRoot& rRoot, SCTAB nTab ) : XclExpRoot( rRoot ), pFilterMode( NULL ), pFilterInfo( NULL ) + , mbAutoFilter (false) { ScDBCollection& rDBColl = GetDatabaseRanges(); XclExpNameManager& rNameMgr = GetNameManager(); @@ -938,6 +957,9 @@ ExcAutoFilterRecs::ExcAutoFilterRecs( const XclExpRoot& rRoot, SCTAB nTab ) : if( !maFilterList.IsEmpty() ) pFilterMode = new XclExpFiltermode; pFilterInfo = new XclExpAutofilterinfo( aRange.aStart, nColCnt ); + + if (maFilterList.IsEmpty () && !bConflict) + mbAutoFilter = true; } } } @@ -995,7 +1017,7 @@ void ExcAutoFilterRecs::Save( XclExpStream& rStrm ) void ExcAutoFilterRecs::SaveXml( XclExpXmlStream& rStrm ) { - if( maFilterList.IsEmpty() ) + if( maFilterList.IsEmpty() && !mbAutoFilter ) return; sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream(); @@ -1003,7 +1025,8 @@ void ExcAutoFilterRecs::SaveXml( XclExpXmlStream& rStrm ) XML_ref, XclXmlUtils::ToOString( maRef ).getStr(), FSEND ); // OOXTODO: XML_extLst, XML_sortState - maFilterList.SaveXml( rStrm ); + if( !maFilterList.IsEmpty() ) + maFilterList.SaveXml( rStrm ); rWorksheet->endElement( XML_autoFilter ); } @@ -1049,3 +1072,4 @@ bool XclExpFilterManager::HasFilterMode( SCTAB nScTab ) // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/exctools.cxx b/sc/source/filter/excel/exctools.cxx index 6dd853ef17df..e638236e34c8 100644 --- a/sc/source/filter/excel/exctools.cxx +++ b/sc/source/filter/excel/exctools.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -334,3 +335,4 @@ void ExcScenarioList::Apply( const XclImpRoot& rRoot ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/expop2.cxx b/sc/source/filter/excel/expop2.cxx index dbe70ae6a0ee..643b557300c6 100644 --- a/sc/source/filter/excel/expop2.cxx +++ b/sc/source/filter/excel/expop2.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -147,73 +148,4 @@ ExportBiff8::ExportBiff8( XclExpRootData& rExpData, SvStream& rStrm ) : ExportBiff8::~ExportBiff8() { } - - -ExportXml2007::ExportXml2007( XclExpRootData& rExpData, SvStream& rStrm ) - : ExportTyp( rStrm, &rExpData.mrDoc, rExpData.meTextEnc ) - , XclExpRoot( rExpData ) -{ - pExcRoot = &GetOldRoot(); - pExcRoot->pER = this; - pExcRoot->eDateiTyp = Biff8; - pExcDoc = new ExcDocument( *this ); -} - - -ExportXml2007::~ExportXml2007() -{ - delete pExcDoc; -} - - -FltError ExportXml2007::Write() -{ - SfxObjectShell* pDocShell = GetDocShell(); - DBG_ASSERT( pDocShell, "ExportXml2007::Write - no document shell" ); - - SotStorageRef xRootStrg = GetRootStorage(); - DBG_ASSERT( xRootStrg.Is(), "ExportXml2007::Write - no root storage" ); - - bool bWriteBasicCode = false; - bool bWriteBasicStrg = false; - - if( SvtFilterOptions* pFilterOpt = SvtFilterOptions::Get() ) - { - bWriteBasicCode = pFilterOpt->IsLoadExcelBasicCode(); - bWriteBasicStrg = pFilterOpt->IsLoadExcelBasicStorage(); - } - - if( pDocShell && xRootStrg.Is() && bWriteBasicStrg ) - { - SvxImportMSVBasic aBasicImport( *pDocShell, *xRootStrg, bWriteBasicCode, bWriteBasicStrg ); - ULONG nErr = aBasicImport.SaveOrDelMSVBAStorage( TRUE, EXC_STORAGE_VBA_PROJECT ); - if( nErr != ERRCODE_NONE ) - pDocShell->SetError( nErr, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); - } - - pExcDoc->ReadDoc(); // ScDoc -> ExcDoc - pExcDoc->WriteXml( aOut ); // wechstreamen - - if( pDocShell && xRootStrg.Is() ) - { - using namespace ::com::sun::star; - uno::Reference<document::XDocumentPropertiesSupplier> xDPS( - pDocShell->GetModel(), uno::UNO_QUERY_THROW); - uno::Reference<document::XDocumentProperties> xDocProps - = xDPS->getDocumentProperties(); - ::boost::shared_ptr<GDIMetaFile> pMetaFile = - pDocShell->GetPreviewMetaFile (sal_False); - uno::Sequence<sal_uInt8> metaFile( - sfx2::convertMetaFile(pMetaFile.get())); - sfx2::SaveOlePropertySet(xDocProps, xRootStrg, &metaFile); - } - - //! TODO: separate warnings for columns and sheets - const XclExpAddressConverter& rAddrConv = GetAddressConverter(); - if( rAddrConv.IsColTruncated() || rAddrConv.IsRowTruncated() || rAddrConv.IsTabTruncated() ) - return SCWARN_EXPORT_MAXROW; - - return eERR_OK; -} - - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/fontbuff.cxx b/sc/source/filter/excel/fontbuff.cxx index dca6723181ae..21f99163f52a 100644 --- a/sc/source/filter/excel/fontbuff.cxx +++ b/sc/source/filter/excel/fontbuff.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -161,3 +162,4 @@ void LotusFontBuffer::MakeFont( ENTRY* pEntry ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/frmbase.cxx b/sc/source/filter/excel/frmbase.cxx index eb3ddd541725..721ebb72f1b4 100644 --- a/sc/source/filter/excel/frmbase.cxx +++ b/sc/source/filter/excel/frmbase.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -276,3 +277,4 @@ void LotusConverterBase::Reset( const ScAddress& rEingPos ) aEingPos = rEingPos; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/impop.cxx b/sc/source/filter/excel/impop.cxx index 16307e6b7116..0ca50c16a52c 100644 --- a/sc/source/filter/excel/impop.cxx +++ b/sc/source/filter/excel/impop.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1337,3 +1338,5 @@ void XclImpOutlineDataBuffer::Convert() mxColRowBuff->ConvertHiddenFlags( mnScTab ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/makefile.mk b/sc/source/filter/excel/makefile.mk index 04ba76d4a68a..d5b90abad556 100644 --- a/sc/source/filter/excel/makefile.mk +++ b/sc/source/filter/excel/makefile.mk @@ -102,7 +102,8 @@ SLOFILES = \ $(SLO)$/xlstyle.obj \ $(SLO)$/xltools.obj \ $(SLO)$/xltracer.obj \ - $(SLO)$/xlview.obj + $(SLO)$/xlview.obj \ + $(SLO)$/xltoolbar.obj \ .IF "$(OS)$(COM)$(CPUNAME)"=="LINUXGCCSPARC" NOOPTFILES = \ @@ -151,6 +152,7 @@ EXCEPTIONSFILES = \ $(SLO)$/xlpivot.obj \ $(SLO)$/xlroot.obj \ $(SLO)$/xlstyle.obj \ + $(SLO)$/xltoolbar.obj \ $(SLO)$/xltools.obj \ $(SLO)$/xlview.obj diff --git a/sc/source/filter/excel/namebuff.cxx b/sc/source/filter/excel/namebuff.cxx index 7db7d17ed307..098dd370092d 100644 --- a/sc/source/filter/excel/namebuff.cxx +++ b/sc/source/filter/excel/namebuff.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -342,3 +343,4 @@ void ExtNameBuff::Reset( void ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/read.cxx b/sc/source/filter/excel/read.cxx index e3e46add1c73..d56c19a73bba 100644 --- a/sc/source/filter/excel/read.cxx +++ b/sc/source/filter/excel/read.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -832,6 +833,12 @@ FltError ImportExcel8::Read( void ) sal_Size nProgressBasePos = 0; sal_Size nProgressBaseSize = 0; + bool bSheetHasCodeName = false; + + std::vector< String > CodeNames; + + std::vector < SCTAB > nTabsWithNoCodeName; + while( eAkt != EXC_STATE_END ) { if( eAkt == EXC_STATE_BEFORE_SHEET ) @@ -913,6 +920,7 @@ FltError ImportExcel8::Read( void ) // #i62752# possible to have BIFF8 sheet without globals NeueTabelle(); eAkt = EXC_STATE_SHEET_PRE; // Shrfmla Prefetch, Row-Prefetch + bSheetHasCodeName = false; // reset aIn.StoreGlobalPosition(); } } @@ -1083,12 +1091,32 @@ FltError ImportExcel8::Read( void ) case EXC_ID2_DIMENSIONS: case EXC_ID3_DIMENSIONS: ReadDimensions(); break; - case EXC_ID_CODENAME: ReadCodeName( aIn, false ); break; + case EXC_ID_CODENAME: ReadCodeName( aIn, false ); bSheetHasCodeName = true; break; case 0x0A: // EOF [ 2345 ] + { eAkt = EXC_STATE_SHEET; + String sName; + GetDoc().GetName( GetCurrScTab(), sName ); + if ( !bSheetHasCodeName ) + { + nTabsWithNoCodeName.push_back( GetCurrScTab() ); + OSL_TRACE("No Codename for %d", GetCurrScTab() ); + } + else + { + String sCodeName; + GetDoc().GetCodeName( GetCurrScTab(), sCodeName ); + OSL_TRACE("Have CodeName %s for SheetName %s", + rtl::OUStringToOString( sCodeName, RTL_TEXTENCODING_UTF8 ).getStr(), rtl::OUStringToOString( sName, RTL_TEXTENCODING_UTF8 ).getStr() ); + CodeNames.push_back( sCodeName ); + } + + bSheetHasCodeName = false; // reset + aIn.SeekGlobalPosition(); // und zurueck an alte Position break; + } case 0x12: SheetProtect(); break; case 0x13: SheetPassword(); break; case 0x42: Codepage(); break; // CODEPAGE [ 2345 ] @@ -1207,6 +1235,42 @@ FltError ImportExcel8::Read( void ) if( eLastErr == eERR_OK ) { + // In some strange circumstances a the codename might be missing + // # Create any missing Sheet CodeNames + std::vector < SCTAB >::iterator it_end = nTabsWithNoCodeName.end(); + for ( std::vector < SCTAB >::iterator it = nTabsWithNoCodeName.begin(); it != it_end; ++it ) + { + bool bGotCodeName = false; + SCTAB nTab = 1; + OSL_TRACE("Trying to find suitable codename for %d", *it ); + while ( true ) + { + String sTmpName( RTL_CONSTASCII_USTRINGPARAM("Sheet" ) ); + sTmpName += String::CreateFromInt32( sal_Int32(nTab++) ); + std::vector< String >::iterator codeName_It = CodeNames.begin(); + std::vector< String >::iterator codeName_It_end = CodeNames.end(); + // search for codename + for ( ; codeName_It != codeName_It_end; ++codeName_It ) + { + if ( *codeName_It == sTmpName ) + break; + } + + if ( codeName_It == codeName_It_end ) // generated codename not found + { + OSL_TRACE("Using generated codename %s", rtl::OUStringToOString( sTmpName, RTL_TEXTENCODING_UTF8 ).getStr() ); + // Set new codename + GetDoc().SetCodeName( *it, sTmpName ); + // Record newly used codename + CodeNames.push_back( sTmpName ); + // Record those we have created so they can be created in + // basic + AutoGeneratedCodeNames.push_back( sTmpName ); + break; + } + } + + } // #i45843# Convert pivot tables before calculation, so they are available // for the GETPIVOTDATA function. if( GetBiff() == EXC_BIFF8 ) @@ -1245,3 +1309,4 @@ FltError ImportExcel8::Read( void ) //___________________________________________________________________ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/tokstack.cxx b/sc/source/filter/excel/tokstack.cxx index b1f7dfe12db6..52dced0c63ad 100644 --- a/sc/source/filter/excel/tokstack.cxx +++ b/sc/source/filter/excel/tokstack.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -853,3 +854,4 @@ ScMatrix* TokenPool::GetMatrix( unsigned int n ) const return NULL; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xechart.cxx b/sc/source/filter/excel/xechart.cxx index 7ca4bb724477..26d42d6c353b 100644 --- a/sc/source/filter/excel/xechart.cxx +++ b/sc/source/filter/excel/xechart.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -3338,3 +3339,4 @@ XclExpChart::XclExpChart( const XclExpRoot& rRoot, Reference< XModel > xModel, c // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx index 7bfd57be7290..139f9c4e4af7 100644 --- a/sc/source/filter/excel/xecontent.cxx +++ b/sc/source/filter/excel/xecontent.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -455,7 +456,16 @@ XclExpHyperlink::XclExpHyperlink( const XclExpRoot& rRoot, const SvxURLField& rU else if( rUrl.GetChar( 0 ) == '#' ) // hack for #89066# { String aTextMark( rUrl.Copy( 1 ) ); - aTextMark.SearchAndReplace( '.', '!' ); + + xub_StrLen nSepPos = aTextMark.SearchAndReplace( '.', '!' ); + String aSheetName( aTextMark.Copy(0, nSepPos)); + + if ( aSheetName.Search(' ') != STRING_NOTFOUND && aSheetName.GetChar(0) != '\'') + { + aTextMark.Insert('\'', nSepPos); + aTextMark.Insert('\'', 0); + } + mxTextMark.reset( new XclExpString( aTextMark, EXC_STR_FORCEUNICODE, 255 ) ); } @@ -516,24 +526,31 @@ void XclExpHyperlink::WriteBody( XclExpStream& rStrm ) { sal_uInt16 nXclCol = static_cast< sal_uInt16 >( maScPos.Col() ); sal_uInt16 nXclRow = static_cast< sal_uInt16 >( maScPos.Row() ); - mxVarData->Seek( STREAM_SEEK_TO_BEGIN ); + rStrm << nXclRow << nXclRow << nXclCol << nXclCol; + WriteEmbeddedData( rStrm ); +} - rStrm << nXclRow << nXclRow << nXclCol << nXclCol - << XclTools::maGuidStdLink +void XclExpHyperlink::WriteEmbeddedData( XclExpStream& rStrm ) +{ + rStrm << XclTools::maGuidStdLink << sal_uInt32( 2 ) << mnFlags; + + mxVarData->Seek( STREAM_SEEK_TO_BEGIN ); rStrm.CopyFromStream( *mxVarData ); } void XclExpHyperlink::SaveXml( XclExpXmlStream& rStrm ) { - OUString sId = rStrm.addRelation( rStrm.GetCurrentStream()->getOutputStream(), + OUString sId = msTarget.getLength() ? rStrm.addRelation( rStrm.GetCurrentStream()->getOutputStream(), XclXmlUtils::ToOUString( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink" ), msTarget, - XclXmlUtils::ToOUString( "External" ) ); + XclXmlUtils::ToOUString( "External" ) ) : OUString(); rStrm.GetCurrentStream()->singleElement( XML_hyperlink, XML_ref, XclXmlUtils::ToOString( maScPos ).getStr(), - FSNS( XML_r, XML_id ), XclXmlUtils::ToOString( sId ).getStr(), + FSNS( XML_r, XML_id ), sId.getLength() + ? XclXmlUtils::ToOString( sId ).getStr() + : NULL, XML_location, mxTextMark.get() != NULL ? XclXmlUtils::ToOString( *mxTextMark ).getStr() : NULL, @@ -1156,7 +1173,8 @@ void XclExpDV::SaveXml( XclExpXmlStream& rStrm ) XML_operator, lcl_GetOperatorType( mnFlags ), XML_prompt, XESTRING_TO_PSZ( maPromptText ), XML_promptTitle, XESTRING_TO_PSZ( maPromptTitle ), - XML_showDropDown, XclXmlUtils::ToPsz( ! ::get_flag( mnFlags, EXC_DV_SUPPRESSDROPDOWN ) ), + // showDropDown should have been showNoDropDown - check oox/xlsx import for details + XML_showDropDown, XclXmlUtils::ToPsz( ::get_flag( mnFlags, EXC_DV_SUPPRESSDROPDOWN ) ), XML_showErrorMessage, XclXmlUtils::ToPsz( ::get_flag( mnFlags, EXC_DV_SHOWERROR ) ), XML_showInputMessage, XclXmlUtils::ToPsz( ::get_flag( mnFlags, EXC_DV_SHOWPROMPT ) ), XML_sqref, XclXmlUtils::ToOString( maScRanges ).getStr(), @@ -1460,3 +1478,4 @@ XclExpWebQueryBuffer::XclExpWebQueryBuffer( const XclExpRoot& rRoot ) // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx index 0509f2afa5fa..baed64cb59ab 100644 --- a/sc/source/filter/excel/xeescher.cxx +++ b/sc/source/filter/excel/xeescher.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -63,8 +64,12 @@ #include "xelink.hxx" #include "xename.hxx" #include "xestyle.hxx" +#include "userdat.hxx" +#include "drwlayer.hxx" +#include "svx/unoapi.hxx" #include <oox/core/tokens.hxx> +#include <oox/export/drawingml.hxx> using ::rtl::OString; using ::rtl::OUString; @@ -86,6 +91,7 @@ using ::com::sun::star::form::binding::XListEntrySource; using ::com::sun::star::script::ScriptEventDescriptor; using ::com::sun::star::table::CellAddress; using ::com::sun::star::table::CellRangeAddress; +using ::oox::drawingml::DrawingML; // Escher client anchor ======================================================= @@ -294,6 +300,17 @@ void XclExpImgData::Save( XclExpStream& rStrm ) } } +void XclExpImgData::SaveXml( XclExpXmlStream& rStrm ) +{ + sax_fastparser::FSHelperPtr pWorksheet = rStrm.GetCurrentStream(); + + DrawingML aDML( pWorksheet, &rStrm, DrawingML::DOCUMENT_XLSX ); + OUString rId = aDML.WriteImage( maGraphic ); + pWorksheet->singleElement( XML_picture, + FSNS( XML_r, XML_id ), XclXmlUtils::ToOString( rId ).getStr(), + FSEND ); +} + // ============================================================================ XclExpControlHelper::XclExpControlHelper( const XclExpRoot& rRoot ) : @@ -484,9 +501,9 @@ void XclExpOcxControlObj::WriteSubRecs( XclExpStream& rStrm ) #else -XclExpTbxControlObj::XclExpTbxControlObj( XclExpObjectManager& rObjMgr, Reference< XShape > xShape, const Rectangle* pChildAnchor ) : - XclObj( rObjMgr, EXC_OBJTYPE_UNKNOWN, true ), - XclExpControlHelper( rObjMgr.GetRoot() ), +XclExpTbxControlObj::XclExpTbxControlObj( XclExpObjectManager& rRoot, Reference< XShape > xShape , const Rectangle* pChildAnchor ) : + XclObj( rRoot, EXC_OBJTYPE_UNKNOWN, true ), + XclMacroHelper( rRoot ), mnHeight( 0 ), mnState( 0 ), mnLineCount( 0 ), @@ -735,6 +752,8 @@ XclExpTbxControlObj::XclExpTbxControlObj( XclExpObjectManager& rObjMgr, Referenc bool XclExpTbxControlObj::SetMacroLink( const ScriptEventDescriptor& rEvent ) { + return XclMacroHelper::SetMacroLink( rEvent, meEventType ); +/* String aMacroName = XclControlHelper::ExtractFromMacroDescriptor( rEvent, meEventType ); if( aMacroName.Len() ) { @@ -744,6 +763,7 @@ bool XclExpTbxControlObj::SetMacroLink( const ScriptEventDescriptor& rEvent ) return true; } return false; +*/ } void XclExpTbxControlObj::WriteSubRecs( XclExpStream& rStrm ) @@ -841,7 +861,7 @@ void XclExpTbxControlObj::WriteSubRecs( XclExpStream& rStrm ) } else if( mnObjType == EXC_OBJTYPE_DROPDOWN ) { - rStrm << sal_uInt16( 0 ) << mnLineCount; + rStrm << sal_uInt16( 0 ) << mnLineCount << sal_uInt16( 0 ) << sal_uInt16( 0 ); } rStrm.EndRecord(); @@ -882,12 +902,6 @@ void XclExpTbxControlObj::WriteSubRecs( XclExpStream& rStrm ) } } -void XclExpTbxControlObj::WriteMacroSubRec( XclExpStream& rStrm ) -{ - if( mxMacroLink.is() ) - WriteFormulaSubRec( rStrm, EXC_ID_OBJMACRO, *mxMacroLink ); -} - void XclExpTbxControlObj::WriteCellLinkSubRec( XclExpStream& rStrm, sal_uInt16 nSubRecId ) { if( const XclTokenArray* pCellLink = GetCellLinkTokArr() ) @@ -916,6 +930,7 @@ void XclExpTbxControlObj::WriteSbs( XclExpStream& rStrm ) #endif + // ---------------------------------------------------------------------------- XclExpChartObj::XclExpChartObj( XclExpObjectManager& rObjMgr, Reference< XShape > xShape, const Rectangle* pChildAnchor ) : @@ -984,7 +999,12 @@ XclExpNote::XclExpNote( const XclExpRoot& rRoot, const ScAddress& rScPos, // get the main note text String aNoteText; if( pScNote ) + { aNoteText = pScNote->GetText(); + const EditTextObject *pEditObj = pScNote->GetEditTextObject(); + if( pEditObj ) + mpNoteContents = XclExpStringHelper::CreateString( rRoot, *pEditObj ); + } // append additional text ScGlobal::AddToken( aNoteText, rAddText, '\n', 2 ); maOrigNoteText = aNoteText; @@ -1002,7 +1022,7 @@ XclExpNote::XclExpNote( const XclExpRoot& rRoot, const ScAddress& rScPos, if( pScNote ) if( SdrCaptionObj* pCaption = pScNote->GetOrCreateCaption( maScPos ) ) if( const OutlinerParaObject* pOPO = pCaption->GetOutlinerParaObject() ) - mnObjId = rRoot.GetObjectManager().AddObj( new XclObjComment( rRoot.GetObjectManager(), pCaption->GetLogicRect(), pOPO->GetTextObject(), pCaption, mbVisible ) ); + mnObjId = rRoot.GetObjectManager().AddObj( new XclObjComment( rRoot.GetObjectManager(), pCaption->GetLogicRect(), pOPO->GetTextObject(), pCaption, mbVisible, maScPos ) ); SetRecSize( 9 + maAuthor.GetSize() ); } @@ -1059,6 +1079,7 @@ void XclExpNote::Save( XclExpStream& rStrm ) } } + void XclExpNote::WriteBody( XclExpStream& rStrm ) { // BIFF5/BIFF7 is written separately @@ -1086,15 +1107,86 @@ void XclExpNote::WriteXml( sal_Int32 nAuthorId, XclExpXmlStream& rStrm ) FSEND ); rComments->startElement( XML_text, FSEND ); // OOXTODO: phoneticPr, rPh, r +#if 0 rComments->startElement( XML_t, FSEND ); rComments->writeEscaped( XclXmlUtils::ToOUString( maOrigNoteText ) ); rComments->endElement ( XML_t ); +#else + if( mpNoteContents.is() ) + mpNoteContents->WriteXml( rStrm ); +#endif rComments->endElement( XML_text ); rComments->endElement( XML_comment ); } // ============================================================================ +XclMacroHelper::XclMacroHelper( const XclExpRoot& rRoot ) : + XclExpControlHelper( rRoot ) +{ +} + +XclMacroHelper::~XclMacroHelper() +{ +} + +void XclMacroHelper::WriteMacroSubRec( XclExpStream& rStrm ) +{ + if( mxMacroLink.is() ) + WriteFormulaSubRec( rStrm, EXC_ID_OBJMACRO, *mxMacroLink ); +} + +bool +XclMacroHelper::SetMacroLink( const ScriptEventDescriptor& rEvent, const XclTbxEventType& nEventType ) +{ + String aMacroName = XclControlHelper::ExtractFromMacroDescriptor( rEvent, nEventType, GetDocShell() ); + if( aMacroName.Len() ) + { + return SetMacroLink( aMacroName ); + } + return false; +} + +bool +XclMacroHelper::SetMacroLink( const String& rMacroName ) +{ + OSL_TRACE("SetMacroLink( macroname:=%s )", rtl::OUStringToOString( rMacroName, RTL_TEXTENCODING_UTF8 ).getStr() ); + if( rMacroName.Len() ) + { + sal_uInt16 nExtSheet = GetLocalLinkManager().FindExtSheet( EXC_EXTSH_OWNDOC ); + sal_uInt16 nNameIdx = GetNameManager().InsertMacroCall( rMacroName, true, false ); + mxMacroLink = GetFormulaCompiler().CreateNameXFormula( nExtSheet, nNameIdx ); + return true; + } + return false; +} + +XclExpShapeObj::XclExpShapeObj( XclExpObjectManager& rRoot, ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape ) : + XclObjAny( rRoot, xShape ), + XclMacroHelper( rRoot ) +{ + if( SdrObject* pSdrObj = ::GetSdrObjectFromXShape( xShape ) ) + { + ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pSdrObj ); + if ( pInfo && pInfo->GetMacro().getLength() ) +// FIXME ooo330-m2: XclControlHelper::GetXclMacroName was removed in upstream sources; they started to call XclTools::GetXclMacroName instead; is this enough? it has only one parameter +// SetMacroLink( XclControlHelper::GetXclMacroName( pInfo->GetMacro(), rRoot.GetDocShell() ) ); + SetMacroLink( XclTools::GetXclMacroName( pInfo->GetMacro() ) ); + } +} + +XclExpShapeObj::~XclExpShapeObj() +{ +} + +void XclExpShapeObj::WriteSubRecs( XclExpStream& rStrm ) +{ + XclObjAny::WriteSubRecs( rStrm ); + WriteMacroSubRec( rStrm ); +} + +// ============================================================================ + XclExpComments::XclExpComments( SCTAB nTab, XclExpRecordList< XclExpNote >& rNotes ) : mnTab( nTab ), mrNotes( rNotes ) { @@ -1104,7 +1196,7 @@ struct OUStringLess : public std::binary_function<OUString, OUString, bool> { bool operator()(const OUString& x, const OUString& y) const { - return x.compareTo( y ) <= 0; + return x.compareTo( y ) < 0; } }; @@ -1282,3 +1374,4 @@ XclExpDffAnchorBase* XclExpEmbeddedObjectManager::CreateDffAnchor() const // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xeformula.cxx b/sc/source/filter/excel/xeformula.cxx index 2b5d534c6d1e..0cacc055c341 100644 --- a/sc/source/filter/excel/xeformula.cxx +++ b/sc/source/filter/excel/xeformula.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -2644,3 +2645,4 @@ XclTokenArrayRef XclExpFormulaCompiler::CreateNameXFormula( // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xehelper.cxx b/sc/source/filter/excel/xehelper.cxx index 5393e229e5c4..f715b781fa4a 100644 --- a/sc/source/filter/excel/xehelper.cxx +++ b/sc/source/filter/excel/xehelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1126,3 +1127,4 @@ void XclExpCachedMatrix::Save( XclExpStream& rStrm ) const // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xelink.cxx b/sc/source/filter/excel/xelink.cxx index c6570c2736b8..49520c08e0de 100644 --- a/sc/source/filter/excel/xelink.cxx +++ b/sc/source/filter/excel/xelink.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -2363,3 +2364,4 @@ void XclExpLinkManager::Save( XclExpStream& rStrm ) // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xename.cxx b/sc/source/filter/excel/xename.cxx index 66e79aa4072b..0a244a2109a6 100644 --- a/sc/source/filter/excel/xename.cxx +++ b/sc/source/filter/excel/xename.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -562,7 +563,7 @@ sal_uInt16 XclExpNameManagerImpl::CreateName( const ScRangeData& rRangeData ) xName->SetTokenArray( xTokArr ); String sSymbol; - rRangeData.GetSymbol( sSymbol, formula::FormulaGrammar::GRAM_NATIVE_XL_A1 ); + rRangeData.GetSymbol( sSymbol, formula::FormulaGrammar::GRAM_ENGLISH_XL_A1 ); xName->SetSymbol( sSymbol ); /* Try to replace by existing built-in name - complete token array is @@ -784,3 +785,4 @@ void XclExpNameManager::SaveXml( XclExpXmlStream& rStrm ) // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xepage.cxx b/sc/source/filter/excel/xepage.cxx index 6194a04c27f6..4d3f3dae9d9e 100644 --- a/sc/source/filter/excel/xepage.cxx +++ b/sc/source/filter/excel/xepage.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -96,25 +97,37 @@ XclExpSetup::XclExpSetup( const XclPageData& rPageData ) : void XclExpSetup::SaveXml( XclExpXmlStream& rStrm ) { - rStrm.GetCurrentStream()->singleElement( XML_pageSetup, - XML_paperSize, OString::valueOf( (sal_Int32) mrData.mnPaperSize ).getStr(), - XML_scale, OString::valueOf( (sal_Int32) mrData.mnScaling ).getStr(), - XML_firstPageNumber, OString::valueOf( (sal_Int32) mrData.mnStartPage ).getStr(), - XML_fitToWidth, OString::valueOf( (sal_Int32) mrData.mnFitToWidth ).getStr(), - XML_fitToHeight, OString::valueOf( (sal_Int32) mrData.mnFitToHeight ).getStr(), - XML_pageOrder, mrData.mbPrintInRows ? "overThenDown" : "downThenOver", - XML_orientation, mrData.mbPortrait ? "portrait" : "landscape", // OOXTODO: "default"? - XML_usePrinterDefaults, XclXmlUtils::ToPsz( !mrData.mbValid ), - XML_blackAndWhite, XclXmlUtils::ToPsz( mrData.mbBlackWhite ), - XML_draft, XclXmlUtils::ToPsz( mrData.mbDraftQuality ), - XML_cellComments, mrData.mbPrintNotes ? "atEnd" : "none", // OOXTODO: "asDisplayed"? - XML_useFirstPageNumber, XclXmlUtils::ToPsz( mrData.mbManualStart ), - // OOXTODO: XML_errors, // == displayed|blank|dash|NA - XML_horizontalDpi, OString::valueOf( (sal_Int32) mrData.mnHorPrintRes ).getStr(), - XML_verticalDpi, OString::valueOf( (sal_Int32) mrData.mnVerPrintRes ).getStr(), - XML_copies, OString::valueOf( (sal_Int32) mrData.mnCopies ).getStr(), - // OOXTODO: devMode settings part RelationshipId: FSNS( XML_r, XML_id ), - FSEND ); + sax_fastparser::FastAttributeList* pAttrList=rStrm.GetCurrentStream()->createAttrList(); + if( rStrm.getVersion() != oox::core::ISOIEC_29500_2008 || + mrData.mnStrictPaperSize != EXC_PAPERSIZE_USER ) + { + pAttrList->add( XML_paperSize, OString::valueOf( (sal_Int32) mrData.mnPaperSize ).getStr() ); + } + else + { + pAttrList->add( XML_paperWidth, OString::valueOf( (sal_Int32) mrData.mnPaperWidth ).concat(OString("mm")).getStr() ); + pAttrList->add( XML_paperHeight, OString::valueOf( (sal_Int32) mrData.mnPaperHeight ).concat(OString("mm")).getStr() ); + // pAttrList->add( XML_paperUnits, "mm" ); + } + pAttrList->add( XML_scale, OString::valueOf( (sal_Int32) mrData.mnScaling ).getStr() ); + pAttrList->add( XML_firstPageNumber, OString::valueOf( (sal_Int32) mrData.mnStartPage ).getStr() ); + pAttrList->add( XML_fitToWidth, OString::valueOf( (sal_Int32) mrData.mnFitToWidth ).getStr() ); + pAttrList->add( XML_fitToHeight, OString::valueOf( (sal_Int32) mrData.mnFitToHeight ).getStr() ); + pAttrList->add( XML_pageOrder, mrData.mbPrintInRows ? "overThenDown" : "downThenOver" ); + pAttrList->add( XML_orientation, mrData.mbPortrait ? "portrait" : "landscape" ); // OOXTODO: "default"? + pAttrList->add( XML_usePrinterDefaults, XclXmlUtils::ToPsz( !mrData.mbValid ) ); + pAttrList->add( XML_blackAndWhite, XclXmlUtils::ToPsz( mrData.mbBlackWhite ) ); + pAttrList->add( XML_draft, XclXmlUtils::ToPsz( mrData.mbDraftQuality ) ); + pAttrList->add( XML_cellComments, mrData.mbPrintNotes ? "atEnd" : "none" ); // OOXTODO: "asDisplayed"? + pAttrList->add( XML_useFirstPageNumber, XclXmlUtils::ToPsz( mrData.mbManualStart ) ); + // OOXTODO: XML_errors, // == displayed|blank|dash|NA + pAttrList->add( XML_horizontalDpi, OString::valueOf( (sal_Int32) mrData.mnHorPrintRes ).getStr() ); + pAttrList->add( XML_verticalDpi, OString::valueOf( (sal_Int32) mrData.mnVerPrintRes ).getStr() ); + pAttrList->add( XML_copies, OString::valueOf( (sal_Int32) mrData.mnCopies ).getStr() ); + // OOXTODO: devMode settings part RelationshipId: FSNS( XML_r, XML_id ), + + ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList > aAttrs(pAttrList); + rStrm.GetCurrentStream()->singleElement( XML_pageSetup, aAttrs ); } void XclExpSetup::WriteBody( XclExpStream& rStrm ) @@ -412,3 +425,4 @@ void XclExpChartPageSettings::Save( XclExpStream& rStrm ) // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xepivot.cxx b/sc/source/filter/excel/xepivot.cxx index 1f3a263238a2..797317d9524e 100644 --- a/sc/source/filter/excel/xepivot.cxx +++ b/sc/source/filter/excel/xepivot.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -739,6 +740,8 @@ void XclExpPivotCache::Save( XclExpStream& rStrm ) void XclExpPivotCache::SaveXml( XclExpXmlStream& rStrm ) { DBG_ASSERT( mbValid, "XclExpPivotCache::Save - invalid pivot cache" ); +#ifdef XLSX_PIVOT_CACHE /* <pivotCache> without xl/pivotCaches/ cacheStream + results in a broken .xlsx */ sax_fastparser::FSHelperPtr& rWorkbook = rStrm.GetCurrentStream(); OUString sId = OUStringBuffer() .appendAscii("rId") @@ -757,6 +760,7 @@ void XclExpPivotCache::SaveXml( XclExpXmlStream& rStrm ) // create the pivot cache storage stream // OOXTODO: WriteCacheStream(); rWorkbook->endElement( XML_pivotCache ); +#endif /* XLSX_PIVOT_CACHE */ } // private -------------------------------------------------------------------- @@ -1345,6 +1349,149 @@ void XclExpPivotTable::Save( XclExpStream& rStrm ) } } +void XclExpPivotTable::SaveXml( XclExpXmlStream& rStrm ) +{ + if( !mbValid ) + return; + sax_fastparser::FSHelperPtr aPivotTableDefinition = rStrm.CreateOutputStream( + XclXmlUtils::GetStreamName( "xl/", "pivotTables/pivotTable", mnOutScTab+1), + XclXmlUtils::GetStreamName( "../", "pivotTables/pivotTable", mnOutScTab+1), + rStrm.GetCurrentStream()->getOutputStream(), + "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable"); + rStrm.PushStream( aPivotTableDefinition ); + + aPivotTableDefinition->startElement( XML_pivotTableDefinition, + XML_xmlns, "http://schemas.openxmlformats.org/spreadsheetml/2006/main", + XML_name, XclXmlUtils::ToOString( maPTInfo.maTableName ).getStr(), + XML_cacheId, OString::valueOf( (sal_Int32) maPTInfo.mnCacheIdx ).getStr(), + XML_dataOnRows, XclXmlUtils::ToPsz( maPTInfo.mnDataAxis == EXC_SXVD_AXIS_COL ), + XML_dataPosition, OString::valueOf( (sal_Int32) maPTInfo.mnDataPos ).getStr(), + XML_autoFormatId, OString::valueOf( (sal_Int32) maPTInfo.mnAutoFmtIdx ).getStr(), + // OOXTODO: XML_applyNumberFormats, [ SXVIEW fAtrNum (maPTInfo.mnFlags) ] + // OOXTODO: XML_applyBorderFormats, [ SXVIEW fAtrBdr (maPTInfo.mnFlags) ] + // OOXTODO: XML_applyFontFormats, [ SXVIEW fAtrFnt (maPTInfo.mnFlags) ] + // OOXTODO: XML_applyPatternFormats, [ SXVIEW fAtrPat (maPTInfo.mnFlags) ] + // OOXTODO: XML_applyAlignmentFormats, [ SXVIEW fAtrAlc (maPTInfo.mnFlags) ] + // OOXTODO: XML_applyWidthHeightFormats, [ SXVIEW fAtrProc (maPTInfo.mnFlags) ] + XML_dataCaption, XclXmlUtils::ToOString( maPTInfo.maDataName ).getStr(), + // OOXTODO: XML_grandTotalCaption, [ SxViewEx9 chGrand ] + // OOXTODO: XML_errorCaption, [ SXEx stError ] + // OOXTODO: XML_showError, [ SXEx fDisplayErrorString ] + // OOXTODO: XML_missingCaption, [ SXEx stDisplayNull ] + // OOXTODO: XML_showMissing, [ SXEx fDisplayNullString ] + // OOXTODO: XML_pageStyle, [ SXEx stPageFieldStyle ] + // OOXTODO: XML_pivotTableStyle, [ SXEx stTableStyle ] + // OOXTODO: XML_vacatedStyle, [ SXEx stVacateStyle ] + // OOXTODO: XML_tag, [ SXEx stTag ] + // OOXTODO: XML_updatedVersion, [ app-dependent ] + // OOXTODO: XML_minRefreshableVersion, [ app-dependent ] + // OOXTODO: XML_asteriskTotals, [ QsiSXTag/SXView9Save fHideTotAnnotation ] + // OOXTODO: XML_showItems, [ ??? ] + // OOXTODO: XML_editData, [ ??? ] + // OOXTODO: XML_disableFieldList, [ SXEx fEnableFieldDialog? ] + // OOXTODO: XML_showCalcMbrs, [ ??? ] + // OOXTODO: XML_visualTotals, [ ??? ] + // OOXTODO: XML_showMultipleLabel, [ SXEx fMergeLabels? ] + // OOXTODO: XML_showDataDropDown, [ SXEx fEnableDrillDown? ] + // OOXTODO: XML_showDrill, [ ??? ] + // OOXTODO: XML_printDrill, [ ??? ] + // OOXTODO: XML_showMemberPropertyTips, + // OOXTODO: XML_showDataTips, + // OOXTODO: XML_enableWizard, + XML_enableDrill, XclXmlUtils::ToPsz( maPTExtInfo.mnFlags & EXC_SXEX_DRILLDOWN ), // ??? + // OOXTODO: XML_enableFieldProperties, [ SXEx fEnableFieldDialog (maPTExtInfo.mnFlags) ] + // OOXTODO: XML_preserveFormatting, [ SXEx fPreserveFormatting (maPTExtInfo.mnFlags) ] +#if 0 + // XML_useAutoFormatting, [???], +#endif + // OOXTODO: XML_pageWrap, [ SXEx cWrapPage (maPTExtInfo.mnFlags) ] + // OOXTODO: XML_pageOverThenDown, [ SXEx fAcrossPageLay (maPTExtInfo.mnFlags) ] + // OOXTODO: XML_subtotalHiddenItems, [ SXEx fSubtotalHiddenPageItems (maPTExtInfo.mnFlags) ] + XML_rowGrandTotals, XclXmlUtils::ToPsz( maPTInfo.mnFlags & EXC_SXVIEW_ROWGRAND ), + XML_colGrandTotals, XclXmlUtils::ToPsz( maPTInfo.mnFlags & EXC_SXVIEW_COLGRAND ), + // OOXTODO: XML_fieldPrintTitles, + // OOXTODO: XML_itemPrintTitles, + // OOXTODO: XML_mergeItem, + // OOXTODO: XML_showDropZones, + // OOXTODO: XML_createdVersion, + // OOXTODO: XML_indent, + // OOXTODO: XML_showEmptyRow, + // OOXTODO: XML_showEmptyCol, + // OOXTODO: XML_showHeaders, + // OOXTODO: XML_compact, + // OOXTODO: XML_outline, + // OOXTODO: XML_outlineData, + // OOXTODO: XML_compactData, + // OOXTODO: XML_published, + // OOXTODO: XML_gridDropZones, + // OOXTODO: XML_immersive, + // OOXTODO: XML_multipleFieldFilters, + // OOXTODO: XML_chartFormat, + // OOXTODO: XML_rowHeaderCaption, + // OOXTODO: XML_colHeaderCaption, + // OOXTODO: XML_fieldListSortAscending, + // OOXTODO: XML_mdxSubqueries, + // OOXTODO: XML_customListSort, + FSEND ); + + aPivotTableDefinition->singleElement( XML_location, + XML_ref, XclXmlUtils::ToOString( maPTInfo.maOutXclRange ).getStr(), + XML_firstHeaderRow, OString::valueOf( (sal_Int32) maPTInfo.mnFirstHeadRow ).getStr(), + XML_firstDataRow, OString::valueOf( (sal_Int32) maPTInfo.maDataXclPos.mnRow ).getStr(), + XML_firstDataCol, OString::valueOf( (sal_Int32) maPTInfo.maDataXclPos.mnCol ).getStr(), + XML_rowPageCount, OString::valueOf( (sal_Int32) maPTInfo.mnDataRows ).getStr(), // OOXTODO? + XML_colPageCount, OString::valueOf( (sal_Int32) maPTInfo.mnDataCols ).getStr(), // OOXTODO? + FSEND ); + + // OOXTODO: XML_pivotFields + + // maPTInfo.mnFields? + if( maPTInfo.mnRowFields ) + { + aPivotTableDefinition->startElement( XML_rowFields, + XML_count, OString::valueOf( (sal_Int32) maPTInfo.mnRowFields ).getStr(), + FSEND ); + aPivotTableDefinition->endElement( XML_rowFields ); + } + + // OOXTODO: XML_rowItems + + if( maPTInfo.mnColFields ) + { + aPivotTableDefinition->startElement( XML_colFields, + XML_count, OString::valueOf( (sal_Int32) maPTInfo.mnColFields ).getStr(), + FSEND ); + aPivotTableDefinition->endElement( XML_colFields ); + } + + // OOXTODO: XML_colItems + + if( maPTInfo.mnPageFields ) + { + aPivotTableDefinition->startElement( XML_pageFields, + XML_count, OString::valueOf( (sal_Int32) maPTInfo.mnPageFields ).getStr(), + FSEND ); + aPivotTableDefinition->endElement( XML_pageFields ); + } + + if( maPTInfo.mnDataFields ) + { + aPivotTableDefinition->startElement( XML_dataFields, + XML_count, OString::valueOf( (sal_Int32) maPTInfo.mnDataFields ).getStr(), + FSEND ); + aPivotTableDefinition->endElement( XML_dataFields ); + } + + // OOXTODO: XML_formats, XML_conditionalFormats, XML_chartFormats, + // XML_pivotHierarchies, XML_pivotTableStyleInfo, XML_filters, + // XML_rowHierarchiesUsage, XML_colHierarchiesUsage, XML_ext + + aPivotTableDefinition->endElement( XML_pivotTableDefinition ); + + rStrm.PopStream(); +} + // private -------------------------------------------------------------------- XclExpPTField* XclExpPivotTable::GetFieldAcc( const String& rName ) @@ -1727,12 +1874,15 @@ void XclExpPivotTableManager::WritePivotCaches( XclExpStream& rStrm ) void XclExpPivotTableManager::WritePivotCachesXml( XclExpXmlStream& rStrm ) { +#ifdef XLSX_PIVOT_CACHE /* <pivotCache> without xl/pivotCaches/ cacheStream + results in a broken .xlsx */ if( maPCacheList.IsEmpty() ) return; sax_fastparser::FSHelperPtr& rWorkbook = rStrm.GetCurrentStream(); rWorkbook->startElement( XML_pivotCaches, FSEND ); maPCacheList.SaveXml( rStrm ); rWorkbook->endElement( XML_pivotCaches ); +#endif /* XLSX_PIVOT_CACHE */ } void XclExpPivotTableManager::WritePivotTables( XclExpStream& rStrm, SCTAB nScTab ) @@ -1798,3 +1948,4 @@ const XclExpPivotCache* XclExpPivotTableManager::CreatePivotCache( const ScDPObj // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xerecord.cxx b/sc/source/filter/excel/xerecord.cxx index fed58411aa5c..f02e2db82fc1 100644 --- a/sc/source/filter/excel/xerecord.cxx +++ b/sc/source/filter/excel/xerecord.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -300,3 +301,4 @@ void XclExpSubStream::Save( XclExpStream& rStrm ) // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xeroot.cxx b/sc/source/filter/excel/xeroot.cxx index 50e07ae1f2ed..27c844360f49 100644 --- a/sc/source/filter/excel/xeroot.cxx +++ b/sc/source/filter/excel/xeroot.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -267,3 +268,4 @@ XclExpRootData::XclExpLinkMgrRef XclExpRoot::GetLocalLinkMgrRef() const // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx index 60bde56e827d..7a2ed32d64e2 100644 --- a/sc/source/filter/excel/xestream.cxx +++ b/sc/source/filter/excel/xestream.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -42,23 +43,39 @@ #include "xlstring.hxx" #include "xeroot.hxx" #include "xestyle.hxx" +#include "xcl97rec.hxx" #include "rangelst.hxx" #include "compiler.hxx" +#include <../../ui/inc/docsh.hxx> +#include <../../ui/inc/viewdata.hxx> +#include <excdoc.hxx> + #include <oox/core/tokens.hxx> #include <formula/grammar.hxx> +#include <oox/export/drawingml.hxx> + +#include <sfx2/docfile.hxx> +#include <sfx2/objsh.hxx> +#include <sfx2/app.hxx> #define DEBUG_XL_ENCRYPTION 0 using ::com::sun::star::beans::PropertyValue; +using ::com::sun::star::embed::XStorage; using ::com::sun::star::io::XOutputStream; using ::com::sun::star::io::XStream; using ::com::sun::star::lang::XComponent; using ::com::sun::star::lang::XMultiServiceFactory; using ::com::sun::star::lang::XServiceInfo; +using ::com::sun::star::lang::XSingleServiceFactory; +using ::com::sun::star::registry::InvalidRegistryException; +using ::com::sun::star::registry::XRegistryKey; +using ::com::sun::star::uno::Exception; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::UNO_QUERY; +using ::com::sun::star::uno::XInterface; using ::rtl::OString; using ::rtl::OUString; using ::utl::OStreamWrapper; @@ -643,6 +660,70 @@ void XclExpBiff8Encrypter::EncryptBytes( SvStream& rStrm, vector<sal_uInt8>& aBy mnOldPos = nStrmPos; } +static const char* lcl_GetErrorString( USHORT nScErrCode ) +{ + sal_uInt8 nXclErrCode = XclTools::GetXclErrorCode( nScErrCode ); + switch( nXclErrCode ) + { + case EXC_ERR_NULL: return "#NULL!"; + case EXC_ERR_DIV0: return "#DIV/0!"; + case EXC_ERR_VALUE: return "#VALUE!"; + case EXC_ERR_REF: return "#REF!"; + case EXC_ERR_NAME: return "#NAME?"; + case EXC_ERR_NUM: return "#NUM!"; + case EXC_ERR_NA: + default: return "#N/A"; + } +} + +void XclXmlUtils::GetFormulaTypeAndValue( ScFormulaCell& rCell, const char*& rsType, OUString& rsValue ) +{ + switch( rCell.GetFormatType() ) + { + case NUMBERFORMAT_NUMBER: + { + // either value or error code + USHORT nScErrCode = rCell.GetErrCode(); + if( nScErrCode ) + { + rsType = "e"; + rsValue = ToOUString( lcl_GetErrorString( nScErrCode ) ); + } + else + { + rsType = "n"; + rsValue = OUString::valueOf( rCell.GetValue() ); + } + } + break; + + case NUMBERFORMAT_TEXT: + { + rsType = "str"; + String aResult; + rCell.GetString( aResult ); + rsValue = ToOUString( aResult ); + } + break; + + case NUMBERFORMAT_LOGICAL: + { + rsType = "b"; + rsValue = ToOUString( rCell.GetValue() == 0.0 ? "0" : "1" ); + } + break; + + default: + { + rsType = "inlineStr"; + String aResult; + rCell.GetString( aResult ); + rsValue = ToOUString( aResult ); + } + break; + } +} + rtl::OUString XclXmlUtils::GetStreamName( const char* sStreamDir, const char* sStream, sal_Int32 nId ) { rtl::OUStringBuffer sBuf; @@ -734,6 +815,11 @@ static ScRange lcl_ToRange( const XclRange& rRange ) return aRange; } +rtl::OString XclXmlUtils::ToOString( const XclRange& rRange ) +{ + return ToOString( lcl_ToRange( rRange ) ); +} + rtl::OString XclXmlUtils::ToOString( const XclRangeList& rRanges ) { ScRangeList aRanges; @@ -766,7 +852,7 @@ OUString XclXmlUtils::ToOUString( const String& s ) rtl::OUString XclXmlUtils::ToOUString( ScDocument& rDocument, const ScAddress& rAddress, ScTokenArray* pTokenArray ) { ScCompiler aCompiler( &rDocument, rAddress, *pTokenArray); - aCompiler.SetGrammar(FormulaGrammar::GRAM_NATIVE_XL_A1); + aCompiler.SetGrammar(FormulaGrammar::GRAM_ENGLISH_XL_A1); String s; aCompiler.CreateStringFromTokenArray( s ); return ToOUString( s ); @@ -783,28 +869,106 @@ const char* XclXmlUtils::ToPsz( bool b ) return b ? "true" : "false"; } -// ============================================================================ +sax_fastparser::FSHelperPtr XclXmlUtils::WriteElement( sax_fastparser::FSHelperPtr pStream, sal_Int32 nElement, sal_Int32 nValue ) +{ + pStream->startElement( nElement, FSEND ); + pStream->write( nValue ); + pStream->endElement( nElement ); -XclExpXmlStream::XclExpXmlStream( const Reference< XMultiServiceFactory >& rSMgr, SvStream& rStrm, const XclExpRoot& rRoot ) - : XmlFilterBase( rSMgr ) - , mrRoot( rRoot ) + return pStream; +} + +sax_fastparser::FSHelperPtr XclXmlUtils::WriteElement( sax_fastparser::FSHelperPtr pStream, sal_Int32 nElement, sal_Int64 nValue ) { - Sequence< PropertyValue > aArgs( 1 ); - const OUString sStream( RTL_CONSTASCII_USTRINGPARAM( "StreamForOutput" ) ); - aArgs[0].Name = sStream; - aArgs[0].Value <<= Reference< XStream > ( new OStreamWrapper( rStrm ) ); + pStream->startElement( nElement, FSEND ); + pStream->write( nValue ); + pStream->endElement( nElement ); + + return pStream; +} - XServiceInfo* pInfo = rRoot.GetDocModelObj(); - Reference< XComponent > aComponent( pInfo, UNO_QUERY ); - setSourceDocument( aComponent ); - filter( aArgs ); +sax_fastparser::FSHelperPtr XclXmlUtils::WriteElement( sax_fastparser::FSHelperPtr pStream, sal_Int32 nElement, const char* sValue ) +{ + pStream->startElement( nElement, FSEND ); + pStream->write( sValue ); + pStream->endElement( nElement ); - PushStream( CreateOutputStream( - OUString::createFromAscii( "xl/workbook.xml" ), - OUString::createFromAscii( "xl/workbook.xml" ), - Reference< XOutputStream >(), - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml", - "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" ) ); + return pStream; +} + +static void lcl_WriteValue( sax_fastparser::FSHelperPtr& rStream, sal_Int32 nElement, const char* pValue ) +{ + if( !pValue ) + return; + rStream->singleElement( nElement, + XML_val, pValue, + FSEND ); +} + +static const char* lcl_GetUnderlineStyle( FontUnderline eUnderline, bool& bHaveUnderline ) +{ + bHaveUnderline = true; + switch( eUnderline ) + { + // OOXTODO: doubleAccounting, singleAccounting + // OOXTODO: what should be done with the other FontUnderline values? + case UNDERLINE_SINGLE: return "single"; + case UNDERLINE_DOUBLE: return "double"; + case UNDERLINE_NONE: + default: bHaveUnderline = false; return "none"; + } +} + +static const char* lcl_ToVerticalAlignmentRun( SvxEscapement eEscapement, bool& bHaveAlignment ) +{ + bHaveAlignment = true; + switch( eEscapement ) + { + case SVX_ESCAPEMENT_SUPERSCRIPT: return "superscript"; + case SVX_ESCAPEMENT_SUBSCRIPT: return "subscript"; + case SVX_ESCAPEMENT_OFF: + default: bHaveAlignment = false; return "baseline"; + } +} + +sax_fastparser::FSHelperPtr XclXmlUtils::WriteFontData( sax_fastparser::FSHelperPtr pStream, const XclFontData& rFontData, sal_Int32 nFontId ) +{ + bool bHaveUnderline, bHaveVertAlign; + const char* pUnderline = lcl_GetUnderlineStyle( rFontData.GetScUnderline(), bHaveUnderline ); + const char* pVertAlign = lcl_ToVerticalAlignmentRun( rFontData.GetScEscapement(), bHaveVertAlign ); + + lcl_WriteValue( pStream, nFontId, XclXmlUtils::ToOString( rFontData.maName ).getStr() ); + lcl_WriteValue( pStream, XML_charset, rFontData.mnCharSet != 0 ? OString::valueOf( (sal_Int32) rFontData.mnCharSet ).getStr() : NULL ); + lcl_WriteValue( pStream, XML_family, OString::valueOf( (sal_Int32) rFontData.mnFamily ).getStr() ); + lcl_WriteValue( pStream, XML_b, rFontData.mnWeight > 400 ? XclXmlUtils::ToPsz( rFontData.mnWeight > 400 ) : NULL ); + lcl_WriteValue( pStream, XML_i, rFontData.mbItalic ? XclXmlUtils::ToPsz( rFontData.mbItalic ) : NULL ); + lcl_WriteValue( pStream, XML_strike, rFontData.mbStrikeout ? XclXmlUtils::ToPsz( rFontData.mbStrikeout ) : NULL ); + lcl_WriteValue( pStream, XML_outline, rFontData.mbOutline ? XclXmlUtils::ToPsz( rFontData.mbOutline ) : NULL ); + lcl_WriteValue( pStream, XML_shadow, rFontData.mbShadow ? XclXmlUtils::ToPsz( rFontData.mbShadow ) : NULL ); + // OOXTODO: lcl_WriteValue( rStream, XML_condense, ); // mac compatibility setting + // OOXTODO: lcl_WriteValue( rStream, XML_extend, ); // compatibility setting + if( rFontData.maColor != Color( 0xFF, 0xFF, 0xFF, 0xFF ) ) + pStream->singleElement( XML_color, + // OOXTODO: XML_auto, bool + // OOXTODO: XML_indexed, uint + XML_rgb, XclXmlUtils::ToOString( rFontData.maColor ).getStr(), + // OOXTODO: XML_theme, index into <clrScheme/> + // OOXTODO: XML_tint, double + FSEND ); + lcl_WriteValue( pStream, XML_sz, OString::valueOf( (double) (rFontData.mnHeight / 20.0) ) ); // Twips->Pt + lcl_WriteValue( pStream, XML_u, bHaveUnderline ? pUnderline : NULL ); + lcl_WriteValue( pStream, XML_vertAlign, bHaveVertAlign ? pVertAlign : NULL ); + + return pStream; +} + + +// ============================================================================ + +XclExpXmlStream::XclExpXmlStream( const Reference< XMultiServiceFactory >& rSMgr ) + : XmlFilterBase( rSMgr ), + mpRoot( NULL ) +{ } XclExpXmlStream::~XclExpXmlStream() @@ -867,75 +1031,6 @@ sax_fastparser::FSHelperPtr& XclExpXmlStream::WriteAttributes( sal_Int32 nAttrib return rStream; } - -static void lcl_WriteValue( sax_fastparser::FSHelperPtr& rStream, sal_Int32 nElement, const char* pValue ) -{ - if( !pValue ) - return; - rStream->singleElement( nElement, - XML_val, pValue, - FSEND ); -} - -static const char* lcl_GetUnderlineStyle( FontUnderline eUnderline, bool& bHaveUnderline ) -{ - bHaveUnderline = true; - switch( eUnderline ) - { - // OOXTODO: doubleAccounting, singleAccounting - // OOXTODO: what should be done with the other FontUnderline values? - case UNDERLINE_SINGLE: return "single"; - case UNDERLINE_DOUBLE: return "double"; - case UNDERLINE_NONE: - default: bHaveUnderline = false; return "none"; - } -} - -static const char* lcl_ToVerticalAlignmentRun( SvxEscapement eEscapement, bool& bHaveAlignment ) -{ - bHaveAlignment = true; - switch( eEscapement ) - { - case SVX_ESCAPEMENT_SUPERSCRIPT: return "superscript"; - case SVX_ESCAPEMENT_SUBSCRIPT: return "subscript"; - case SVX_ESCAPEMENT_OFF: - default: bHaveAlignment = false; return "baseline"; - } -} - -sax_fastparser::FSHelperPtr& XclExpXmlStream::WriteFontData( const XclFontData& rFontData, sal_Int32 nFontId ) -{ - bool bHaveUnderline, bHaveVertAlign; - const char* pUnderline = lcl_GetUnderlineStyle( rFontData.GetScUnderline(), bHaveUnderline ); - const char* pVertAlign = lcl_ToVerticalAlignmentRun( rFontData.GetScEscapement(), bHaveVertAlign ); - - sax_fastparser::FSHelperPtr& rStream = GetCurrentStream(); - - lcl_WriteValue( rStream, nFontId, XclXmlUtils::ToOString( rFontData.maName ).getStr() ); - lcl_WriteValue( rStream, XML_charset, rFontData.mnCharSet != 0 ? OString::valueOf( (sal_Int32) rFontData.mnCharSet ).getStr() : NULL ); - lcl_WriteValue( rStream, XML_family, OString::valueOf( (sal_Int32) rFontData.mnFamily ).getStr() ); - lcl_WriteValue( rStream, XML_b, rFontData.mnWeight > 400 ? XclXmlUtils::ToPsz( rFontData.mnWeight > 400 ) : NULL ); - lcl_WriteValue( rStream, XML_i, rFontData.mbItalic ? XclXmlUtils::ToPsz( rFontData.mbItalic ) : NULL ); - lcl_WriteValue( rStream, XML_strike, rFontData.mbStrikeout ? XclXmlUtils::ToPsz( rFontData.mbStrikeout ) : NULL ); - lcl_WriteValue( rStream, XML_outline, rFontData.mbOutline ? XclXmlUtils::ToPsz( rFontData.mbOutline ) : NULL ); - lcl_WriteValue( rStream, XML_shadow, rFontData.mbShadow ? XclXmlUtils::ToPsz( rFontData.mbShadow ) : NULL ); - // OOXTODO: lcl_WriteValue( rStream, XML_condense, ); // mac compatibility setting - // OOXTODO: lcl_WriteValue( rStream, XML_extend, ); // compatibility setting - if( rFontData.maColor != Color( 0xFF, 0xFF, 0xFF, 0xFF ) ) - rStream->singleElement( XML_color, - // OOXTODO: XML_auto, bool - // OOXTODO: XML_indexed, uint - XML_rgb, XclXmlUtils::ToOString( rFontData.maColor ).getStr(), - // OOXTODO: XML_theme, index into <clrScheme/> - // OOXTODO: XML_tint, double - FSEND ); - lcl_WriteValue( rStream, XML_sz, OString::valueOf( (double) (rFontData.mnHeight / 20.0) ) ); // Twips->Pt - lcl_WriteValue( rStream, XML_u, bHaveUnderline ? pUnderline : NULL ); - lcl_WriteValue( rStream, XML_vertAlign, bHaveVertAlign ? pVertAlign : NULL ); - - return rStream; -} - sax_fastparser::FSHelperPtr XclExpXmlStream::CreateOutputStream ( const OUString& sFullStream, const OUString& sRelativeStream, @@ -986,14 +1081,65 @@ oox::drawingml::chart::ChartConverter& XclExpXmlStream::getChartConverter() return * (oox::drawingml::chart::ChartConverter*) NULL; } -bool XclExpXmlStream::exportDocument() throw() +ScDocShell* XclExpXmlStream::getDocShell() { - return false; + Reference< XInterface > xModel( getModel(), UNO_QUERY ); + + ScModelObj *pObj = dynamic_cast < ScModelObj* >( xModel.get() ); + + if ( pObj ) + return reinterpret_cast < ScDocShell* >( pObj->GetEmbeddedObject() ); + + return 0; } -::rtl::OUString XclExpXmlStream::implGetImplementationName() const +bool XclExpXmlStream::exportDocument() throw() { - return CREATE_OUSTRING( "TODO" ); + ScDocShell* pShell = getDocShell(); + ScDocument* pDoc = pShell->GetDocument(); + // NOTE: Don't use SotStorage or SvStream any more, and never call + // SfxMedium::GetOutStream() anywhere in the xlsx export filter code! + // Instead, write via XOutputStream instance. + SotStorageRef rStorage = static_cast<SotStorage*>(NULL); + + XclExpRootData aData( EXC_BIFF8, *pShell->GetMedium (), rStorage, *pDoc, RTL_TEXTENCODING_DONTKNOW ); + aData.meOutput = EXC_OUTPUT_XML_2007; + XclExpRoot aRoot( aData ); + + mpRoot = &aRoot; + aRoot.GetOldRoot().pER = &aRoot; + aRoot.GetOldRoot().eDateiTyp = Biff8; +#if 0 // FIXME: Re-write this block without using SotStorage. + if ( SvtFilterOptions* pOptions = SvtFilterOptions::Get() ) + if ( pShell && pOptions->IsLoadExcelBasicStorage() ) + if ( sal_uInt32 nError + = SvxImportMSVBasic( *pShell, *rStorage, + pOptions->IsLoadExcelBasicCode(), + pOptions->IsLoadExcelBasicStorage() ) + .SaveOrDelMSVBAStorage( true, EXC_STORAGE_VBA_PROJECT) ) + { + pShell->SetError( nError, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); + } +#endif + // Get the viewsettings before processing + if( pShell->GetViewData() ) + pShell->GetViewData()->WriteExtOptions( mpRoot->GetExtDocOptions() ); + + OUString const workbook = CREATE_OUSTRING( "xl/workbook.xml" ); + PushStream( CreateOutputStream( workbook, workbook, + Reference <XOutputStream>(), + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" ) ); + + // destruct at the end of the block + { + ExcDocument aDocRoot( aRoot ); + aDocRoot.ReadDoc(); + aDocRoot.WriteXml( *this ); + } + + mpRoot = NULL; + return true; } void XclExpXmlStream::Trace( const char* format, ...) @@ -1004,3 +1150,99 @@ void XclExpXmlStream::Trace( const char* format, ...) va_end( ap ); } +////////////////////////////////////////////////////////////////////////// +// UNO stuff so that the filter is registered +////////////////////////////////////////////////////////////////////////// + +#define IMPL_NAME "com.sun.star.comp.oox.ExcelFilterExport" + +OUString XlsxExport_getImplementationName() +{ + return OUString( RTL_CONSTASCII_USTRINGPARAM( IMPL_NAME ) ); +} + +::rtl::OUString XclExpXmlStream::implGetImplementationName() const +{ + return CREATE_OUSTRING( "TODO" ); +} + + +Sequence< OUString > SAL_CALL XlsxExport_getSupportedServiceNames() throw() +{ + const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.ExportFilter" ) ); + const Sequence< OUString > aSeq( &aServiceName, 1 ); + return aSeq; +} + +Reference< XInterface > SAL_CALL XlsxExport_createInstance(const Reference< XMultiServiceFactory > & rSMgr ) throw( Exception ) +{ + return (cppu::OWeakObject*) new XclExpXmlStream( rSMgr ); +} + +#ifdef __cplusplus +extern "C" +{ +#endif + +SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */ ) +{ + *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; +} + +SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( void* /* pServiceManager */, void* pRegistryKey ) +{ + sal_Bool bRet = sal_False; + + if( pRegistryKey ) + { + try + { + Reference< XRegistryKey > xNewKey1( + static_cast< XRegistryKey* >( pRegistryKey )->createKey( + OUString::createFromAscii( IMPL_NAME "/UNO/SERVICES/" ) ) ); + xNewKey1->createKey( XlsxExport_getSupportedServiceNames().getConstArray()[0] ); + + bRet = sal_True; + } + catch( InvalidRegistryException& ) + { + OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); + } + } + + return bRet; +} + +// ------------------------ +// - component_getFactory - +// ------------------------ + +SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplName, void* pServiceManager, void* /* pRegistryKey */ ) +{ + Reference< XSingleServiceFactory > xFactory; + void* pRet = 0; + + if ( rtl_str_compare( pImplName, IMPL_NAME ) == 0 ) + { + const OUString aServiceName( OUString::createFromAscii( IMPL_NAME ) ); + + xFactory = Reference< XSingleServiceFactory >( ::cppu::createSingleFactory( + reinterpret_cast< XMultiServiceFactory* >( pServiceManager ), + XlsxExport_getImplementationName(), + XlsxExport_createInstance, + XlsxExport_getSupportedServiceNames() ) ); + } + + if ( xFactory.is() ) + { + xFactory->acquire(); + pRet = xFactory.get(); + } + + return pRet; +} + +#ifdef __cplusplus +} +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xestring.cxx b/sc/source/filter/excel/xestring.cxx index 6279ec4cd0fd..0247d765966a 100644 --- a/sc/source/filter/excel/xestring.cxx +++ b/sc/source/filter/excel/xestring.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,6 +31,8 @@ #include <algorithm> #include <stdio.h> +#include "xlstyle.hxx" +#include "xestyle.hxx" #include "xestream.hxx" #include "xlstyle.hxx" #include "xestyle.hxx" @@ -452,7 +455,7 @@ static sal_uInt16 lcl_WriteRun( XclExpXmlStream& rStrm, const ScfUInt16Vec& rBuf { const XclFontData& rFontData = pFont->GetFontData(); rWorksheet->startElement( XML_rPr, FSEND ); - rStrm.WriteFontData( rFontData, XML_rFont ); + XclXmlUtils::WriteFontData( rWorksheet, rFontData, XML_rFont ); rWorksheet->endElement( XML_rPr ); } rWorksheet->startElement( XML_t, @@ -461,7 +464,7 @@ static sal_uInt16 lcl_WriteRun( XclExpXmlStream& rStrm, const ScfUInt16Vec& rBuf rWorksheet->writeEscaped( XclXmlUtils::ToOUString( rBuffer, nStart, nLength ) ); rWorksheet->endElement( XML_t ); rWorksheet->endElement( XML_r ); - return static_cast<sal_uInt16>(nStart + nLength); + return nStart + nLength; } void XclExpString::WriteXml( XclExpXmlStream& rStrm ) const @@ -616,3 +619,4 @@ void XclExpString::PrepareWrite( XclExpStream& rStrm, sal_uInt16 nBytes ) const // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx index d3cabd1e66f9..1ea725a45acb 100644 --- a/sc/source/filter/excel/xestyle.cxx +++ b/sc/source/filter/excel/xestyle.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -981,7 +982,7 @@ void XclExpFont::SaveXml( XclExpXmlStream& rStrm ) { sax_fastparser::FSHelperPtr& rStyleSheet = rStrm.GetCurrentStream(); rStyleSheet->startElement( XML_font, FSEND ); - rStrm.WriteFontData( maData, XML_name ); + XclXmlUtils::WriteFontData( rStyleSheet, maData, XML_name ); // OOXTODO: XML_scheme; //scheme/@val values: "major", "minor", "none" rStyleSheet->endElement( XML_font ); } @@ -2241,7 +2242,10 @@ void XclExpStyle::SaveXml( XclExpXmlStream& rStrm ) rStrm.GetCurrentStream()->singleElement( XML_cellStyle, XML_name, sName.getStr(), XML_xfId, OString::valueOf( nXFId ).getStr(), - XML_builtinId, OString::valueOf( (sal_Int32) mnStyleId ).getStr(), +/* mso-excel 2007 complains when it finds builtinId >= 55, it is not + * bothered by multiple 54 values. */ +#define CELL_STYLE_MAX_BUILTIN_ID 55 + XML_builtinId, OString::valueOf( std::min( static_cast<sal_Int32>( CELL_STYLE_MAX_BUILTIN_ID - 1 ), static_cast <sal_Int32>( mnStyleId ) ) ).getStr(), // OOXTODO: XML_iLevel, // OOXTODO: XML_hidden, XML_customBuiltin, XclXmlUtils::ToPsz( ! IsBuiltIn() ), @@ -2901,3 +2905,4 @@ void XclExpXmlStyleSheet::SaveXml( XclExpXmlStream& rStrm ) // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx index 0bfb2d7904b3..05dbb579f385 100644 --- a/sc/source/filter/excel/xetable.cxx +++ b/sc/source/filter/excel/xetable.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -882,76 +883,12 @@ void XclExpFormulaCell::Save( XclExpStream& rStrm ) mxStringRec->Save( rStrm ); } -static const char* lcl_GetErrorString( USHORT nScErrCode ) -{ - sal_uInt8 nXclErrCode = XclTools::GetXclErrorCode( nScErrCode ); - switch( nXclErrCode ) - { - case EXC_ERR_NULL: return "#NULL!"; - case EXC_ERR_DIV0: return "#DIV/0!"; - case EXC_ERR_VALUE: return "#VALUE!"; - case EXC_ERR_REF: return "#REF!"; - case EXC_ERR_NAME: return "#NAME?"; - case EXC_ERR_NUM: return "#NUM!"; - case EXC_ERR_NA: - default: return "#N/A"; - } -} - -static void lcl_GetFormulaInfo( ScFormulaCell& rCell, const char** pType, OUString& rValue) -{ - switch( rCell.GetFormatType() ) - { - case NUMBERFORMAT_NUMBER: - { - // either value or error code - USHORT nScErrCode = rCell.GetErrCode(); - if( nScErrCode ) - { - *pType = "e"; - rValue = XclXmlUtils::ToOUString( lcl_GetErrorString( nScErrCode ) ); - } - else - { - *pType = "n"; - rValue = OUString::valueOf( rCell.GetValue() ); - } - } - break; - - case NUMBERFORMAT_TEXT: - { - *pType = "str"; - String aResult; - rCell.GetString( aResult ); - rValue = XclXmlUtils::ToOUString( aResult ); - } - break; - - case NUMBERFORMAT_LOGICAL: - { - *pType = "b"; - rValue = XclXmlUtils::ToOUString( rCell.GetValue() == 0.0 ? "0" : "1" ); - } - break; - - default: - { - *pType = "inlineStr"; - String aResult; - rCell.GetString( aResult ); - rValue = XclXmlUtils::ToOUString( aResult ); - } - break; - } -} - void XclExpFormulaCell::SaveXml( XclExpXmlStream& rStrm ) { const char* sType = NULL; OUString sValue; - lcl_GetFormulaInfo( mrScFmlaCell, &sType, sValue ); + XclXmlUtils::GetFormulaTypeAndValue( mrScFmlaCell, sType, sValue ); sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream(); rWorksheet->startElement( XML_c, XML_r, XclXmlUtils::ToOString( GetXclPos() ).getStr(), @@ -962,7 +899,7 @@ void XclExpFormulaCell::SaveXml( XclExpXmlStream& rStrm ) rWorksheet->startElement( XML_f, // OOXTODO: XML_t, ST_CellFormulaType - XML_aca, XclXmlUtils::ToPsz( mxTokArr->IsVolatile() || (mxAddRec.is() && mxAddRec->IsVolatile()) ), + XML_aca, XclXmlUtils::ToPsz( (mxTokArr.is() && mxTokArr->IsVolatile()) || (mxAddRec.is() && mxAddRec->IsVolatile()) ), // OOXTODO: XML_ref, ST_Ref // OOXTODO: XML_dt2D, bool // OOXTODO: XML_dtr, bool @@ -2062,9 +1999,7 @@ void XclExpRow::SaveXml( XclExpXmlStream& rStrm ) XclExpRowBuffer::XclExpRowBuffer( const XclExpRoot& rRoot ) : XclExpRoot( rRoot ), maOutlineBfr( rRoot ), - maDimensions( rRoot ), - mpLastUsedRow( 0 ), - mnLastUsedXclRow( 0 ) + maDimensions( rRoot ) { } @@ -2082,63 +2017,34 @@ void XclExpRowBuffer::CreateRows( SCROW nFirstFreeScRow ) void XclExpRowBuffer::Finalize( XclExpDefaultRowData& rDefRowData, const ScfUInt16Vec& rColXFIndexes ) { - size_t nPos, nSize; - // *** Finalize all rows *** ---------------------------------------------- GetProgressBar().ActivateFinalRowsSegment(); - // unused blank cell records will be removed - for( nPos = 0, nSize = maRowList.GetSize(); nPos < nSize; ++nPos ) - maRowList.GetRecord( nPos )->Finalize( rColXFIndexes ); + RowMap::iterator itr, itrBeg = maRowMap.begin(), itrEnd = maRowMap.end(); + for (itr = itrBeg; itr != itrEnd; ++itr) + itr->second->Finalize(rColXFIndexes); // *** Default row format *** --------------------------------------------- typedef ::std::map< XclExpDefaultRowData, size_t > XclExpDefRowDataMap; XclExpDefRowDataMap aDefRowMap; - // find default row format for rows beyond used area - sal_uInt32 nDefaultXclRow = maRowList.IsEmpty() ? 0 : (maRowList.GetLastRecord()->GetXclRow() + 1); XclExpDefaultRowData aMaxDefData; size_t nMaxDefCount = 0; - /* #i30411# Files saved with SO7/OOo1.x with nonstandard default column - formatting cause big Excel files, because all rows from row 1 to row - 32000 are exported. Now, if the used area goes exactly to row 32000, - ignore all rows >32000. - #i59220# Tolerance of +-128 rows for inserted/removed rows. */ - if( (nDefaultXclRow < 31872) || (nDefaultXclRow > 32128) ) - { - sal_uInt16 nLastXclRow = static_cast< sal_uInt16 >( GetMaxPos().Row() ); - if( nDefaultXclRow <= nLastXclRow ) - { - // create a dummy ROW record and fill aMaxDefData - XclExpRowOutlineBuffer aOutlineBfr( GetRoot() ); - XclExpRow aRow( GetRoot(), nLastXclRow, aOutlineBfr, true ); - aMaxDefData = XclExpDefaultRowData( aRow ); - aDefRowMap[ aMaxDefData ] = nMaxDefCount = - static_cast< size_t >( nLastXclRow - nDefaultXclRow + 1 ); - } - } - // only look for default format in existing rows, if there are more than unused - nSize = maRowList.GetSize(); - if( nMaxDefCount < nSize ) + for (itr = itrBeg; itr != itrEnd; ++itr) { - for( nPos = 0; nPos < nSize; ++nPos ) + const RowRef& rRow = itr->second; + if (rRow->IsDefaultable()) { - XclExpRowRef xRow = maRowList.GetRecord( nPos ); - /* Collect formats of unused rows (rows without cells), which are able - to be defaulted (i.e. no explicit format or outline level). */ - if( xRow->IsDefaultable() ) + XclExpDefaultRowData aDefData( *rRow ); + size_t& rnDefCount = aDefRowMap[ aDefData ]; + ++rnDefCount; + if( rnDefCount > nMaxDefCount ) { - XclExpDefaultRowData aDefData( *xRow ); - size_t& rnDefCount = aDefRowMap[ aDefData ]; - ++rnDefCount; - if( rnDefCount > nMaxDefCount ) - { - nMaxDefCount = rnDefCount; - aMaxDefData = aDefData; - } + nMaxDefCount = rnDefCount; + aMaxDefData = aDefData; } } } @@ -2153,24 +2059,23 @@ void XclExpRowBuffer::Finalize( XclExpDefaultRowData& rDefRowData, const ScfUInt sal_uInt32 nFirstUsedXclRow = SAL_MAX_UINT32; sal_uInt32 nFirstFreeXclRow = 0; - for( nPos = 0, nSize = maRowList.GetSize(); nPos < nSize; ++nPos ) + for (itr = itrBeg; itr != itrEnd; ++itr) { - XclExpRowRef xRow = maRowList.GetRecord( nPos ); - + const RowRef& rRow = itr->second; // disable unused rows - xRow->DisableIfDefault( aMaxDefData ); + rRow->DisableIfDefault( aMaxDefData ); // find used column range - if( !xRow->IsEmpty() ) // empty rows return (0...0) as used range + if( !rRow->IsEmpty() ) // empty rows return (0...0) as used range { - nFirstUsedXclCol = ::std::min( nFirstUsedXclCol, xRow->GetFirstUsedXclCol() ); - nFirstFreeXclCol = ::std::max( nFirstFreeXclCol, xRow->GetFirstFreeXclCol() ); + nFirstUsedXclCol = ::std::min( nFirstUsedXclCol, rRow->GetFirstUsedXclCol() ); + nFirstFreeXclCol = ::std::max( nFirstFreeXclCol, rRow->GetFirstFreeXclCol() ); } // find used row range - if( xRow->IsEnabled() ) + if( rRow->IsEnabled() ) { - sal_uInt16 nXclRow = xRow->GetXclRow(); + sal_uInt16 nXclRow = rRow->GetXclRow(); nFirstUsedXclRow = ::std::min< sal_uInt32 >( nFirstUsedXclRow, nXclRow ); nFirstFreeXclRow = ::std::max< sal_uInt32 >( nFirstFreeXclRow, nXclRow + 1 ); } @@ -2191,27 +2096,29 @@ void XclExpRowBuffer::Save( XclExpStream& rStrm ) maDimensions.Save( rStrm ); // save in blocks of 32 rows, each block contains first all ROWs, then all cells - size_t nSize = maRowList.GetSize(); - size_t nBlockStart = 0; - sal_uInt16 nStartXclRow = (nSize == 0) ? 0 : maRowList.GetRecord( 0 )->GetXclRow(); + size_t nSize = maRowMap.size(); + RowMap::iterator itr, itrBeg = maRowMap.begin(), itrEnd = maRowMap.end(); + RowMap::iterator itrBlkStart = maRowMap.begin(), itrBlkEnd = maRowMap.begin(); + sal_uInt16 nStartXclRow = (nSize == 0) ? 0 : itrBeg->second->GetXclRow(); + - while( nBlockStart < nSize ) + for (itr = itrBeg; itr != itrEnd; ++itr) { // find end of row block - size_t nBlockEnd = nBlockStart + 1; - while( (nBlockEnd < nSize) && (maRowList.GetRecord( nBlockEnd )->GetXclRow() - nStartXclRow < EXC_ROW_ROWBLOCKSIZE) ) - ++nBlockEnd; + ++itrBlkEnd; + while( (itrBlkEnd != itrEnd) && (itrBlkEnd->second->GetXclRow() - nStartXclRow < EXC_ROW_ROWBLOCKSIZE) ) + ++itrBlkEnd; // write the ROW records - size_t nPos; - for( nPos = nBlockStart; nPos < nBlockEnd; ++nPos ) - maRowList.GetRecord( nPos )->Save( rStrm ); + RowMap::iterator itRow; + for( itRow = itrBlkStart; itRow != itrBlkEnd; ++itRow ) + itRow->second->Save( rStrm ); // write the cell records - for( nPos = nBlockStart; nPos < nBlockEnd; ++nPos ) - maRowList.GetRecord( nPos )->WriteCellList( rStrm ); + for( itRow = itrBlkStart; itRow != itrBlkEnd; ++itRow ) + itRow->second->WriteCellList( rStrm ); - nBlockStart = nBlockEnd; + itrBlkStart = itrBlkEnd; nStartXclRow += EXC_ROW_ROWBLOCKSIZE; } } @@ -2219,23 +2126,22 @@ void XclExpRowBuffer::Save( XclExpStream& rStrm ) void XclExpRowBuffer::SaveXml( XclExpXmlStream& rStrm ) { sal_Int32 nNonEmpty = 0; - - size_t nRows = maRowList.GetSize(); - for( size_t i = 0; i < nRows; ++i) - if( maRowList.GetRecord( i )->IsEnabled() ) + RowMap::iterator itr = maRowMap.begin(), itrEnd = maRowMap.end(); + for (; itr != itrEnd; ++itr) + if (itr->second->IsEnabled()) ++nNonEmpty; - if( nNonEmpty == 0 ) + if (nNonEmpty == 0) { rStrm.GetCurrentStream()->singleElement( XML_sheetData, FSEND ); + return; } - else - { - sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream(); - rWorksheet->startElement( XML_sheetData, FSEND ); - maRowList.SaveXml( rStrm ); - rWorksheet->endElement( XML_sheetData ); - } + + sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream(); + rWorksheet->startElement( XML_sheetData, FSEND ); + for (itr = maRowMap.begin(); itr != itrEnd; ++itr) + itr->second->SaveXml(rStrm); + rWorksheet->endElement( XML_sheetData ); } XclExpDimensions* XclExpRowBuffer::GetDimensions() @@ -2245,18 +2151,14 @@ XclExpDimensions* XclExpRowBuffer::GetDimensions() XclExpRow& XclExpRowBuffer::GetOrCreateRow( sal_uInt16 nXclRow, bool bRowAlwaysEmpty ) { - if( !mpLastUsedRow || (mnLastUsedXclRow != nXclRow) ) + RowMap::iterator itr = maRowMap.find(nXclRow); + if (itr == maRowMap.end()) { - // fill up missing ROW records - // do not use sal_uInt16 for nFirstFreeXclRow, would cause loop in full sheets - for( size_t nFirstFreeXclRow = maRowList.GetSize(); nFirstFreeXclRow <= nXclRow; ++nFirstFreeXclRow ) - maRowList.AppendNewRecord( new XclExpRow( - GetRoot(), static_cast< sal_uInt16 >( nFirstFreeXclRow ), maOutlineBfr, bRowAlwaysEmpty ) ); - - mpLastUsedRow = maRowList.GetRecord( nXclRow ).get(); - mnLastUsedXclRow = nXclRow; + RowRef p(new XclExpRow(GetRoot(), nXclRow, maOutlineBfr, bRowAlwaysEmpty)); + ::std::pair<RowMap::iterator, bool> r = maRowMap.insert(RowMap::value_type(nXclRow, p)); + itr = r.first; } - return *mpLastUsedRow; + return *itr->second; } // ============================================================================ @@ -2323,7 +2225,7 @@ XclExpCellTable::XclExpCellTable( const XclExpRoot& rRoot ) : // range for cell iterator SCCOL nLastIterScCol = nMaxScCol; - SCROW nLastIterScRow = ulimit_cast< SCROW >( nLastUsedScRow + 128, nMaxScRow ); + SCROW nLastIterScRow = ulimit_cast< SCROW >( nLastUsedScRow, nMaxScRow ); ScUsedAreaIterator aIt( &rDoc, nScTab, 0, 0, nLastIterScCol, nLastIterScRow ); // activate the correct segment and sub segment at the progress bar @@ -2539,3 +2441,4 @@ void XclExpCellTable::SaveXml( XclExpXmlStream& rStrm ) // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xeview.cxx b/sc/source/filter/excel/xeview.cxx index 9cc691db940d..85cd24ece0a5 100644 --- a/sc/source/filter/excel/xeview.cxx +++ b/sc/source/filter/excel/xeview.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -536,3 +537,4 @@ void XclExpTabViewSettings::WriteTabBgColor( XclExpStream& rStrm ) const } // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx index 7cbd74a836d2..41565381e137 100644 --- a/sc/source/filter/excel/xichart.cxx +++ b/sc/source/filter/excel/xichart.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -4145,3 +4146,4 @@ void XclImpChart::ReadChChart( XclImpStream& rStrm ) // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx index e55889ed84bd..3ccf71e8e243 100644 --- a/sc/source/filter/excel/xicontent.cxx +++ b/sc/source/filter/excel/xicontent.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1340,3 +1341,4 @@ XclImpSheetProtectBuffer::Sheet* XclImpSheetProtectBuffer::GetSheetItem( SCTAB n // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx index dc2508fe74fe..7e89bb0ff8db 100644 --- a/sc/source/filter/excel/xiescher.cxx +++ b/sc/source/filter/excel/xiescher.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -109,6 +110,8 @@ #include "xipage.hxx" #include "xichart.hxx" #include "xicontent.hxx" +#include "scextopt.hxx" + #include "namebuff.hxx" using ::rtl::OUString; @@ -236,6 +239,7 @@ XclImpDrawObjBase::~XclImpDrawObjBase() } } + xDrawObj->mnTab = rRoot.GetCurrScTab(); xDrawObj->ImplReadObj3( rStrm ); return xDrawObj; } @@ -268,6 +272,7 @@ XclImpDrawObjBase::~XclImpDrawObjBase() } } + xDrawObj->mnTab = rRoot.GetCurrScTab(); xDrawObj->ImplReadObj4( rStrm ); return xDrawObj; } @@ -310,6 +315,7 @@ XclImpDrawObjBase::~XclImpDrawObjBase() } } + xDrawObj->mnTab = rRoot.GetCurrScTab(); xDrawObj->ImplReadObj5( rStrm ); return xDrawObj; } @@ -368,6 +374,7 @@ XclImpDrawObjBase::~XclImpDrawObjBase() } } + xDrawObj->mnTab = rRoot.GetCurrScTab(); xDrawObj->ImplReadObj8( rStrm ); return xDrawObj; } @@ -468,8 +475,9 @@ void XclImpDrawObjBase::PreProcessSdrObject( XclImpDffConverter& rDffConv, SdrOb } // macro and hyperlink -#ifdef ISSUE66550_HLINK_FOR_SHAPES - if( mbSimpleMacro && ((maMacroName.Len() > 0) || (maHyperlink.getLength() > 0)) ) + // removed oracle/sun check for mbSimpleMacro ( no idea what its for ) + if( (maMacroName.Len() > 0 ) || + (maHyperlink.Len() > 0) ) { if( ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( &rSdrObj, TRUE ) ) { @@ -477,11 +485,6 @@ void XclImpDrawObjBase::PreProcessSdrObject( XclImpDffConverter& rDffConv, SdrOb pInfo->SetHlink( maHyperlink ); } } -#else - if( mbSimpleMacro && (maMacroName.Len() > 0) ) - if( ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( &rSdrObj, TRUE ) ) - pInfo->SetMacro( XclTools::GetSbMacroUrl( maMacroName, GetDocShell() ) ); -#endif // call virtual function for object type specific processing DoPreProcessSdrObj( rDffConv, rSdrObj ); @@ -1761,22 +1764,15 @@ SdrObject* XclImpControlHelper::CreateSdrObjectFromShape( return xSdrObj.release(); } -void XclImpControlHelper::ProcessControl( const XclImpDrawObjBase& rDrawObj ) const +void XclImpControlHelper::ApplySheetLinkProps() const { + Reference< XControlModel > xCtrlModel = XclControlHelper::GetControlModel( mxShape ); if( !xCtrlModel.is() ) return; - ScfPropertySet aPropSet( xCtrlModel ); - // #118053# #i51348# set object name at control model - aPropSet.SetStringProperty( CREATE_OUSTRING( "Name" ), rDrawObj.GetObjName() ); - - // control visible and printable? - aPropSet.SetBoolProperty( CREATE_OUSTRING( "EnableVisible" ), rDrawObj.IsVisible() ); - aPropSet.SetBoolProperty( CREATE_OUSTRING( "Printable" ), rDrawObj.IsPrintable() ); - - // sheet links + // sheet links if( SfxObjectShell* pDocShell = mrRoot.GetDocShell() ) { Reference< XMultiServiceFactory > xFactory( pDocShell->GetModel(), UNO_QUERY ); @@ -1839,6 +1835,25 @@ void XclImpControlHelper::ProcessControl( const XclImpDrawObjBase& rDrawObj ) co } } } +} + +void XclImpControlHelper::ProcessControl( const XclImpDrawObjBase& rDrawObj ) const +{ + Reference< XControlModel > xCtrlModel = XclControlHelper::GetControlModel( mxShape ); + if( !xCtrlModel.is() ) + return; + + ApplySheetLinkProps(); + + ScfPropertySet aPropSet( xCtrlModel ); + + // #118053# #i51348# set object name at control model + aPropSet.SetStringProperty( CREATE_OUSTRING( "Name" ), rDrawObj.GetObjName() ); + + // control visible and printable? + aPropSet.SetBoolProperty( CREATE_OUSTRING( "EnableVisible" ), rDrawObj.IsVisible() ); + aPropSet.SetBoolProperty( CREATE_OUSTRING( "Printable" ), rDrawObj.IsPrintable() ); + // virtual call for type specific processing DoProcessControl( aPropSet ); @@ -2170,6 +2185,45 @@ void XclImpOptionButtonObj::DoProcessControl( ScfPropertySet& rPropSet ) const { XclImpCheckBoxObj::DoProcessControl( rPropSet ); // TODO: grouping + XclImpOptionButtonObj* pTbxObj = dynamic_cast< XclImpOptionButtonObj* >( GetObjectManager().GetSheetDrawing( GetTab() ).FindDrawObj( mnNextInGroup ).get() ); + if ( ( pTbxObj && pTbxObj->mnFirstInGroup ) ) + { + // Group has terminated + // traverse each RadioButton in group and + // a) apply the groupname + // b) propagate the linked cell from the lead radiobutton + // c) apply the correct Ref value + XclImpOptionButtonObj* pLeader = pTbxObj; + ; + sal_Int32 nRefVal = 1; + OSL_TRACE( "0x%x start group ", pLeader->GetObjId()/*.mnObjId */); + do + { + + Reference< XControlModel > xCtrlModel = XclControlHelper::GetControlModel( pTbxObj->mxShape ); + if ( xCtrlModel.is() ) + { + 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++ ) ); + if ( pLeader->HasCellLink() && !pTbxObj->HasCellLink() ) + { + // propagate cell link info + pTbxObj->mxCellLink.reset( new ScAddress( *pLeader->mxCellLink.get() ) ); + pTbxObj->ApplySheetLinkProps(); + } + pTbxObj = dynamic_cast< XclImpOptionButtonObj* >( GetObjectManager().GetSheetDrawing( GetTab() ).FindDrawObj( pTbxObj->mnNextInGroup ).get() ); + } + else + pTbxObj = NULL; + } while ( pTbxObj && !( pTbxObj->mnFirstInGroup == 1 ) ); + } + else + { + // not the leader? try and find it + } } OUString XclImpOptionButtonObj::DoGetServiceName() const @@ -2806,6 +2860,17 @@ SdrObject* XclImpPictureObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const return xSdrObj.release(); } +String XclImpPictureObj::GetObjName() const +{ + if( IsOcxControl() ) + { + String sName( GetObjectManager().GetOleNameOverride( GetTab(), GetObjId() ) ); + if ( sName.Len() > 0 ) + return sName; + } + return XclImpDrawObjBase::GetObjName(); +} + void XclImpPictureObj::DoPreProcessSdrObj( XclImpDffConverter& rDffConv, SdrObject& rSdrObj ) const { if( IsOcxControl() ) @@ -3115,6 +3180,27 @@ XclImpDffConverter::~XclImpDffConverter() { } +String XclImpObjectManager::GetOleNameOverride( SCTAB nTab, sal_uInt16 nObjId ) +{ + String sOleName; + String sCodeName = GetExtDocOptions().GetCodeName( nTab ); + + CodeNameToCntrlObjIdInfo::iterator it = maOleCtrlNameOverride.find( sCodeName ); + if ( it != maOleCtrlNameOverride.end() ) + { + CntrlObjIdToName::iterator it_id = it->second.find( nObjId ); + if ( it_id != it->second.end() ) + { + sOleName = it_id->second; + } + } + OSL_TRACE("XclImpObjectManager::GetOleNameOverride tab %d, ( module %s ) object id ( %d ) is %s", nTab, + rtl::OUStringToOString( sCodeName, RTL_TEXTENCODING_UTF8 ).getStr(), nObjId, + rtl::OUStringToOString( sOleName, RTL_TEXTENCODING_UTF8 ).getStr() ); + + return sOleName; +} + void XclImpDffConverter::StartProgressBar( sal_Size nProgressSize ) { mxProgress.reset( new ScfProgressBar( GetDocShell(), STR_PROGRESS_CALCULATING ) ); @@ -3985,27 +4071,27 @@ XclImpObjectManager::XclImpObjectManager( const XclImpRoot& rRoot ) : XclImpRoot( rRoot ) { maDefObjNames[ EXC_OBJTYPE_GROUP ] = CREATE_STRING( "Group" ); - maDefObjNames[ EXC_OBJTYPE_LINE ] = CREATE_STRING( "Line" ); - maDefObjNames[ EXC_OBJTYPE_RECTANGLE ] = CREATE_STRING( "Rectangle" ); - maDefObjNames[ EXC_OBJTYPE_OVAL ] = CREATE_STRING( "Oval" ); + maDefObjNames[ EXC_OBJTYPE_LINE ] = ScGlobal::GetRscString( STR_SHAPE_LINE ); + maDefObjNames[ EXC_OBJTYPE_RECTANGLE ] = ScGlobal::GetRscString( STR_SHAPE_RECTANGLE ); + maDefObjNames[ EXC_OBJTYPE_OVAL ] = ScGlobal::GetRscString( STR_SHAPE_OVAL ); maDefObjNames[ EXC_OBJTYPE_ARC ] = CREATE_STRING( "Arc" ); maDefObjNames[ EXC_OBJTYPE_CHART ] = CREATE_STRING( "Chart" ); maDefObjNames[ EXC_OBJTYPE_TEXT ] = CREATE_STRING( "Text" ); - maDefObjNames[ EXC_OBJTYPE_BUTTON ] = CREATE_STRING( "Button" ); + maDefObjNames[ EXC_OBJTYPE_BUTTON ] = ScGlobal::GetRscString( STR_FORM_BUTTON ); maDefObjNames[ EXC_OBJTYPE_PICTURE ] = CREATE_STRING( "Picture" ); maDefObjNames[ EXC_OBJTYPE_POLYGON ] = CREATE_STRING( "Freeform" ); - maDefObjNames[ EXC_OBJTYPE_CHECKBOX ] = CREATE_STRING( "Check Box" ); - maDefObjNames[ EXC_OBJTYPE_OPTIONBUTTON ] = CREATE_STRING( "Option Button" ); + maDefObjNames[ EXC_OBJTYPE_CHECKBOX ] = ScGlobal::GetRscString( STR_FORM_CHECKBOX ); + maDefObjNames[ EXC_OBJTYPE_OPTIONBUTTON ] = ScGlobal::GetRscString( STR_FORM_OPTIONBUTTON ); maDefObjNames[ EXC_OBJTYPE_EDIT ] = CREATE_STRING( "Edit Box" ); - maDefObjNames[ EXC_OBJTYPE_LABEL ] = CREATE_STRING( "Label" ); + maDefObjNames[ EXC_OBJTYPE_LABEL ] = ScGlobal::GetRscString( STR_FORM_LABEL ); maDefObjNames[ EXC_OBJTYPE_DIALOG ] = CREATE_STRING( "Dialog Frame" ); - maDefObjNames[ EXC_OBJTYPE_SPIN ] = CREATE_STRING( "Spinner" ); - maDefObjNames[ EXC_OBJTYPE_SCROLLBAR ] = CREATE_STRING( "Scroll Bar" ); - maDefObjNames[ EXC_OBJTYPE_LISTBOX ] = CREATE_STRING( "List Box" ); - maDefObjNames[ EXC_OBJTYPE_GROUPBOX ] = CREATE_STRING( "Group Box" ); - maDefObjNames[ EXC_OBJTYPE_DROPDOWN ] = CREATE_STRING( "Drop Down" ); + maDefObjNames[ EXC_OBJTYPE_SPIN ] = ScGlobal::GetRscString( STR_FORM_SPINNER ); + maDefObjNames[ EXC_OBJTYPE_SCROLLBAR ] = ScGlobal::GetRscString( STR_FORM_SCROLLBAR ); + maDefObjNames[ EXC_OBJTYPE_LISTBOX ] = ScGlobal::GetRscString( STR_FORM_LISTBOX ); + maDefObjNames[ EXC_OBJTYPE_GROUPBOX ] = ScGlobal::GetRscString( STR_FORM_GROUPBOX ); + maDefObjNames[ EXC_OBJTYPE_DROPDOWN ] = ScGlobal::GetRscString( STR_FORM_DROPDOWN ); maDefObjNames[ EXC_OBJTYPE_NOTE ] = CREATE_STRING( "Comment" ); - maDefObjNames[ EXC_OBJTYPE_DRAWING ] = CREATE_STRING( "AutoShape" ); + maDefObjNames[ EXC_OBJTYPE_DRAWING ] = ScGlobal::GetRscString( STR_SHAPE_AUTOSHAPE ); } XclImpObjectManager::~XclImpObjectManager() @@ -4113,3 +4199,4 @@ XclImpStream& operator>>( XclImpStream& rStrm, XclImpDffPropSet& rPropSet ) // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xiformula.cxx b/sc/source/filter/excel/xiformula.cxx index 40c6ef9be374..c9927ff570fd 100644 --- a/sc/source/filter/excel/xiformula.cxx +++ b/sc/source/filter/excel/xiformula.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -125,3 +126,4 @@ const ScTokenArray* XclImpFormulaCompiler::CreateFormula( // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xihelper.cxx b/sc/source/filter/excel/xihelper.cxx index d8b353179cd6..bb17cc656add 100644 --- a/sc/source/filter/excel/xihelper.cxx +++ b/sc/source/filter/excel/xihelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -894,3 +895,4 @@ ScMatrixRef XclImpCachedMatrix::CreateScMatrix() const // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xilink.cxx b/sc/source/filter/excel/xilink.cxx index aba90eceee94..ff45306b1c55 100644 --- a/sc/source/filter/excel/xilink.cxx +++ b/sc/source/filter/excel/xilink.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -769,3 +770,4 @@ const String& XclImpLinkManager::GetMacroName( sal_uInt16 nExtSheet, sal_uInt16 // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xiname.cxx b/sc/source/filter/excel/xiname.cxx index 5c0eac63de92..f34a66bf54c0 100644 --- a/sc/source/filter/excel/xiname.cxx +++ b/sc/source/filter/excel/xiname.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -35,7 +36,8 @@ #include "excform.hxx" // for filter manager #include "excimp8.hxx" - +#include "scextopt.hxx" +#include "document.hxx" // ============================================================================ // *** Implementation *** // ============================================================================ @@ -127,6 +129,7 @@ XclImpName::XclImpName( XclImpStream& rStrm, sal_uInt16 nXclNameIdx ) : maScName = maXclName; ScfTools::ConvertToScDefinedName( maScName ); } + rtl::OUString aRealOrigName = maScName; // add index for local names if( nXclTab != EXC_NAME_GLOBAL ) @@ -219,6 +222,25 @@ XclImpName::XclImpName( XclImpStream& rStrm, sal_uInt16 nXclNameIdx ) : pData->GuessPosition(); // calculate base position for relative refs pData->SetIndex( nXclNameIdx ); // used as unique identifier in formulas rRangeNames.Insert( pData ); // takes ownership of pData + if( nXclTab != EXC_NAME_GLOBAL ) + { + if (GetBiff() == EXC_BIFF8) + { + ScRange aRange; + // discard deleted ranges ( for the moment at least ) + if ( pData->IsValidReference( aRange ) ) + { + ScExtTabSettings& rTabSett = GetExtDocOptions().GetOrCreateTabSettings( nXclTab ); + // create a mapping between the unmodified localname to + // the name in the global name container for named ranges + OSL_TRACE(" mapping local name to global name for tab %d which exists? %s", nXclTab, GetDoc().HasTable( mnScTab ) ? "true" : "false" ); + SCTAB nTab( static_cast< SCTAB >( mnScTab ) ); + NameToNameMap* pMap = GetDoc().GetLocalNameMap( nTab ); + if ( pMap ) + (*pMap)[ aRealOrigName ] = maScName; + } + } + } mpScData = pData; // cache for later use } } @@ -262,3 +284,4 @@ const XclImpName* XclImpNameManager::GetName( sal_uInt16 nXclNameIdx ) const // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xipage.cxx b/sc/source/filter/excel/xipage.cxx index 38cebc2e6ca8..f40743c52146 100644 --- a/sc/source/filter/excel/xipage.cxx +++ b/sc/source/filter/excel/xipage.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -388,3 +389,4 @@ void XclImpPageSettings::Finalize() // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xipivot.cxx b/sc/source/filter/excel/xipivot.cxx index 29e27a698a42..3b30c7f84998 100644 --- a/sc/source/filter/excel/xipivot.cxx +++ b/sc/source/filter/excel/xipivot.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1636,3 +1637,4 @@ void XclImpPivotTableManager::MaybeRefreshPivotTables() // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xiroot.cxx b/sc/source/filter/excel/xiroot.cxx index 4bbb64a099f8..9a0b50e3a999 100644 --- a/sc/source/filter/excel/xiroot.cxx +++ b/sc/source/filter/excel/xiroot.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -304,3 +305,5 @@ void XclImpRoot::ReadCodeName( XclImpStream& rStrm, bool bGlobals ) } // ============================================================================ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xistream.cxx b/sc/source/filter/excel/xistream.cxx index a7e2af0c52f4..86dec6126200 100644 --- a/sc/source/filter/excel/xistream.cxx +++ b/sc/source/filter/excel/xistream.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1093,3 +1094,4 @@ sal_uInt16 XclImpStream::ReadRawData( void* pData, sal_uInt16 nBytes ) // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xistring.cxx b/sc/source/filter/excel/xistring.cxx index cb2645bec538..9afc0f0d2f22 100644 --- a/sc/source/filter/excel/xistring.cxx +++ b/sc/source/filter/excel/xistring.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -211,3 +212,4 @@ XclImpStringIterator& XclImpStringIterator::operator++() // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx index b9b68a91d05f..6693d6fe3936 100644 --- a/sc/source/filter/excel/xistyle.cxx +++ b/sc/source/filter/excel/xistyle.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -72,10 +73,70 @@ using ::std::list; +#include <cppuhelper/implbase1.hxx> +#include <com/sun/star/container/XIndexAccess.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> +using namespace ::com::sun::star; + +typedef ::cppu::WeakImplHelper1< container::XIndexAccess > XIndexAccess_BASE; +typedef ::std::vector< ColorData > ColorDataVec; + +class PaletteIndex : public XIndexAccess_BASE +{ +public: + PaletteIndex( const ColorDataVec& rColorDataTable ) : maColorData( rColorDataTable ) {} + + // Methods XIndexAccess + virtual ::sal_Int32 SAL_CALL getCount() throw (uno::RuntimeException) + { + return maColorData.size(); + } + + virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException) + { + //--Index; // apparently the palette is already 1 based + return uno::makeAny( sal_Int32( maColorData[ Index ] ) ); + } + + // Methods XElementAcess + virtual uno::Type SAL_CALL getElementType() throw (uno::RuntimeException) + { + return ::getCppuType( (sal_Int32*)0 ); + } + virtual ::sal_Bool SAL_CALL hasElements() throw (uno::RuntimeException) + { + return (maColorData.size() > 0); + } + +private: + ColorDataVec maColorData; +}; + +void +XclImpPalette::ExportPalette() +{ + if( SfxObjectShell* pDocShell = mrRoot.GetDocShell() ) + { + // copy values in color palette + sal_Int16 nColors = maColorTable.size(); + ColorDataVec aColors; + aColors.resize( nColors ); + for( sal_uInt16 nIndex = 0; nIndex < nColors; ++nIndex ) + aColors[ nIndex ] = GetColorData( nIndex ); + + uno::Reference< beans::XPropertySet > xProps( pDocShell->GetModel(), uno::UNO_QUERY ); + if ( xProps.is() ) + { + uno::Reference< container::XIndexAccess > xIndex( new PaletteIndex( aColors ) ); + xProps->setPropertyValue( CREATE_OUSTRING("ColorPalette"), uno::makeAny( xIndex ) ); + } + } + +} // PALETTE record - color information ========================================= XclImpPalette::XclImpPalette( const XclImpRoot& rRoot ) : - XclDefaultPalette( rRoot ) + XclDefaultPalette( rRoot ), mrRoot( rRoot ) { } @@ -109,6 +170,7 @@ void XclImpPalette::ReadPalette( XclImpStream& rStrm ) rStrm >> aColor; maColorTable[ nIndex ] = aColor.GetColor(); } + ExportPalette(); } // FONT record - font information ============================================= @@ -1880,3 +1942,4 @@ void XclImpXFRangeBuffer::Finalize() // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xiview.cxx b/sc/source/filter/excel/xiview.cxx index 1b047de977ab..5dbb119d3eab 100644 --- a/sc/source/filter/excel/xiview.cxx +++ b/sc/source/filter/excel/xiview.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -304,3 +305,4 @@ void XclImpTabViewSettings::Finalize() // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xladdress.cxx b/sc/source/filter/excel/xladdress.cxx index d0c1a925f8ab..64cd88908f22 100644 --- a/sc/source/filter/excel/xladdress.cxx +++ b/sc/source/filter/excel/xladdress.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -159,3 +160,4 @@ bool XclAddressConverterBase::CheckScTab( SCTAB nScTab, bool bWarn ) // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xlchart.cxx b/sc/source/filter/excel/xlchart.cxx index 10a0657c7899..34d011ed3d6a 100644 --- a/sc/source/filter/excel/xlchart.cxx +++ b/sc/source/filter/excel/xlchart.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1326,3 +1327,5 @@ Reference< XShape > XclChRootData::GetTitleShape( const XclChTextKey& rTitleKey } // ============================================================================ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xlescher.cxx b/sc/source/filter/excel/xlescher.cxx index 153a5d5ed3cc..15a903b5e3ef 100644 --- a/sc/source/filter/excel/xlescher.cxx +++ b/sc/source/filter/excel/xlescher.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -366,7 +367,7 @@ bool XclControlHelper::FillMacroDescriptor( ScriptEventDescriptor& rDescriptor, } String XclControlHelper::ExtractFromMacroDescriptor( - const ScriptEventDescriptor& rDescriptor, XclTbxEventType eEventType ) + const ScriptEventDescriptor& rDescriptor, XclTbxEventType eEventType, SfxObjectShell* pShell ) { if( (rDescriptor.ScriptCode.getLength() > 0) && rDescriptor.ScriptType.equalsIgnoreAsciiCaseAscii( "Script" ) && @@ -377,3 +378,5 @@ String XclControlHelper::ExtractFromMacroDescriptor( } // ============================================================================ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xlformula.cxx b/sc/source/filter/excel/xlformula.cxx index d613f1279242..04e428c3de7d 100644 --- a/sc/source/filter/excel/xlformula.cxx +++ b/sc/source/filter/excel/xlformula.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -784,3 +785,4 @@ bool XclTokenArrayHelper::GetMultipleOpRefs( XclMultipleOpRefs& rRefs, const ScT // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xlpage.cxx b/sc/source/filter/excel/xlpage.cxx index a59c6f761667..53cdd0550081 100644 --- a/sc/source/filter/excel/xlpage.cxx +++ b/sc/source/filter/excel/xlpage.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -36,6 +37,7 @@ #include <editeng/brshitem.hxx> #include "global.hxx" #include "xlconst.hxx" +#include <oox/core/xmlfilterbase.hxx> // Paper size ================================================================= @@ -48,6 +50,8 @@ struct XclPaperSize #define IN2TWIPS( v ) ((long)((v) * EXC_TWIPS_PER_INCH + 0.5)) #define MM2TWIPS( v ) ((long)((v) * EXC_TWIPS_PER_INCH / CM_PER_INCH / 10.0 + 0.5)) +#define TWIPS2MM( v ) ((long)((v - 0.5) / EXC_TWIPS_PER_INCH * CM_PER_INCH * 10.0)) + static const XclPaperSize pPaperSizeTable[] = { @@ -189,6 +193,8 @@ void XclPageData::SetDefaults() mfHdrLeftMargin = mfHdrRightMargin = XclTools::GetInchFromHmm( EXC_MARGIN_DEFAULT_HLR ); mfFtrLeftMargin = mfFtrRightMargin = XclTools::GetInchFromHmm( EXC_MARGIN_DEFAULT_FLR ); mnPaperSize = EXC_PAPERSIZE_DEFAULT; + mnPaperWidth = 0; + mnPaperHeight = 0; mnCopies = 1; mnStartPage = 0; mnScaling = 100; @@ -222,7 +228,7 @@ Size XclPageData::GetScPaperSize() const return aSize; } -void XclPageData::SetScPaperSize( const Size& rSize, bool bPortrait ) +void XclPageData::SetScPaperSize( const Size& rSize, bool bPortrait, bool bStrictSize ) { mbPortrait = bPortrait; mnPaperSize = 0; @@ -230,6 +236,20 @@ void XclPageData::SetScPaperSize( const Size& rSize, bool bPortrait ) long nHeight = bPortrait ? rSize.Height() : rSize.Width(); long nMaxWDiff = 80; long nMaxHDiff = 50; + + mnPaperWidth = TWIPS2MM( nWidth ); + mnPaperHeight = TWIPS2MM( nHeight ); + if( bStrictSize ) + { + nMaxWDiff = 5; + nMaxHDiff = 5; + mnStrictPaperSize = EXC_PAPERSIZE_USER; + } + else + { + mnPaperSize = 0; + } + for( const XclPaperSize* pEntry = pPaperSizeTable; pEntry != STATIC_TABLE_END( pPaperSizeTable ); ++pEntry ) { long nWDiff = Abs( pEntry->mnWidth - nWidth ); @@ -237,12 +257,20 @@ void XclPageData::SetScPaperSize( const Size& rSize, bool bPortrait ) if( ((nWDiff <= nMaxWDiff) && (nHDiff < nMaxHDiff)) || ((nWDiff < nMaxWDiff) && (nHDiff <= nMaxHDiff)) ) { - mnPaperSize = static_cast< sal_uInt16 >( pEntry - pPaperSizeTable ); + sal_uInt16 nIndex = static_cast< sal_uInt16 >( pEntry - pPaperSizeTable ); + if( !bStrictSize ) + mnPaperSize = nIndex; + else + mnStrictPaperSize = mnPaperSize = nIndex; + nMaxWDiff = nWDiff; nMaxHDiff = nHDiff; } } + if( !bStrictSize ) + SetScPaperSize( rSize, bPortrait, sal_True ); } // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xlpivot.cxx b/sc/source/filter/excel/xlpivot.cxx index ca16b2f525e8..68854d39a5c2 100644 --- a/sc/source/filter/excel/xlpivot.cxx +++ b/sc/source/filter/excel/xlpivot.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1024,3 +1025,4 @@ XclExpStream& operator<<( XclExpStream& rStrm, const XclPTViewEx9Info& rInfo ) << XclExpString(rInfo.maGrandTotalName, EXC_STR_DEFAULT, EXC_PT_MAXSTRLEN); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xlroot.cxx b/sc/source/filter/excel/xlroot.cxx index 2b2180db5e6a..afbe9d075ebd 100644 --- a/sc/source/filter/excel/xlroot.cxx +++ b/sc/source/filter/excel/xlroot.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -417,3 +418,4 @@ XclTracer& XclRoot::GetTracer() const // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xlstyle.cxx b/sc/source/filter/excel/xlstyle.cxx index 6382adf1bdb9..cb95fd1658ed 100644 --- a/sc/source/filter/excel/xlstyle.cxx +++ b/sc/source/filter/excel/xlstyle.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1767,3 +1768,4 @@ bool XclXFBase::Equals( const XclXFBase& rCmp ) const // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xltoolbar.cxx b/sc/source/filter/excel/xltoolbar.cxx new file mode 100644 index 000000000000..5ca4440d73db --- /dev/null +++ b/sc/source/filter/excel/xltoolbar.cxx @@ -0,0 +1,431 @@ +#include "xltoolbar.hxx" +#include <rtl/ustrbuf.hxx> +#include <stdarg.h> +#include <com/sun/star/ui/XUIConfigurationPersistence.hpp> +#include <com/sun/star/ui/XUIConfigurationPersistence.hpp> +#include <com/sun/star/ui/XModuleUIConfigurationManagerSupplier.hpp> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/lang/XSingleComponentFactory.hpp> +#include <com/sun/star/lang/XMultiComponentFactory.hpp> +#include <com/sun/star/ui/XImageManager.hpp> +#include <com/sun/star/ui/ItemType.hpp> +#include <fstream> +#include <comphelper/processfactory.hxx> +#include <vcl/graph.hxx> +#include <map> +using namespace com::sun::star; + +typedef std::map< sal_Int16, rtl::OUString > IdToString; + +class MSOExcelCommandConvertor : public MSOCommandConvertor +{ + IdToString msoToOOcmd; + IdToString tcidToOOcmd; +public: + MSOExcelCommandConvertor(); + virtual rtl::OUString MSOCommandToOOCommand( sal_Int16 msoCmd ); + virtual rtl::OUString MSOTCIDToOOCommand( sal_Int16 key ); +}; + +MSOExcelCommandConvertor::MSOExcelCommandConvertor() +{ +/* + // mso command id to ooo command string + // #FIXME and *HUNDREDS* of id's to added here + msoToOOcmd[ 0x20b ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(".uno:CloseDoc") ); + msoToOOcmd[ 0x50 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(".uno:Open") ); + + // mso tcid to ooo command string + // #FIXME and *HUNDREDS* of id's to added here + tcidToOOcmd[ 0x9d9 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(".uno:Print") ); +*/ +} + +rtl::OUString MSOExcelCommandConvertor::MSOCommandToOOCommand( sal_Int16 key ) +{ + rtl::OUString sResult; + IdToString::iterator it = msoToOOcmd.find( key ); + if ( it != msoToOOcmd.end() ) + sResult = it->second; + return sResult; +} + +rtl::OUString MSOExcelCommandConvertor::MSOTCIDToOOCommand( sal_Int16 key ) +{ + rtl::OUString sResult; + IdToString::iterator it = tcidToOOcmd.find( key ); + if ( it != tcidToOOcmd.end() ) + sResult = it->second; + return sResult; +} + + + +CTBS::CTBS() : bSignature(0), bVersion(0), reserved1(0), reserved2(0), reserved3(0), ctb(0), ctbViews(0), ictbView(0) +{ +} + +CTB::CTB() : nViews( 0 ), ectbid(0) +{ +} + +CTB::CTB(sal_uInt16 nNum ) : nViews( nNum ), ectbid(0) +{ +} + +bool CTB::Read( SvStream *pS ) +{ + OSL_TRACE("CTB::Read() stream pos 0x%x", pS->Tell() ); + nOffSet = pS->Tell(); + tb.Read( pS ); + for ( sal_uInt16 index = 0; index < nViews; ++index ) + { + TBVisualData aVisData; + aVisData.Read( pS ); + rVisualData.push_back( aVisData ); + } + *pS >> ectbid; + + for ( sal_Int16 index = 0; index < tb.getcCL(); ++index ) + { + TBC aTBC; + aTBC.Read( pS ); + rTBC.push_back( aTBC ); + } + return true; +} + +void CTB::Print( FILE* fp ) +{ + Indent a; + indent_printf( fp, "[ 0x%x ] CTB -- dump\n", nOffSet ); + indent_printf( fp, " nViews 0x%x\n", nViews); + tb.Print( fp ); + + std::vector<TBVisualData>::iterator visData_end = rVisualData.end(); + sal_Int32 counter = 0; + for ( std::vector<TBVisualData>::iterator it = rVisualData.begin(); it != visData_end; ++it ) + { + + indent_printf( fp, " TBVisualData [%d]\n", counter++ ); + Indent b; + it->Print( fp ); + } + indent_printf( fp, " ectbid 0x%x\n", ectbid); + std::vector<TBC>::iterator it_end = rTBC.end(); + counter = 0; + for ( std::vector<TBC>::iterator it = rTBC.begin(); it != it_end; ++it ) + { + indent_printf( fp, " TBC [%d]\n", counter++); + Indent c; + it->Print( fp ); + } +} + +bool CTB::IsMenuToolbar() +{ + return tb.IsMenuToolbar(); +} + +bool CTB::ImportMenuTB( CTBWrapper& 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 ) + { + if ( !it->ImportToolBarControl( rWrapper, xMenuDesc, helper, IsMenuToolbar() ) ) + return false; + } + return true; +} + +bool CTB::ImportCustomToolBar( CTBWrapper& rWrapper, CustomToolBarImportHelper& helper ) +{ + + static rtl::OUString sToolbarPrefix( RTL_CONSTASCII_USTRINGPARAM( "private:resource/toolbar/custom_" ) ); + bool bRes = false; + try + { + if ( !tb.IsEnabled() ) + return true; // didn't fail, just ignoring + + // Create default setting + uno::Reference< container::XIndexContainer > xIndexContainer( helper.getCfgManager()->createSettings(), uno::UNO_QUERY_THROW ); + uno::Reference< container::XIndexAccess > xIndexAccess( xIndexContainer, uno::UNO_QUERY_THROW ); + uno::Reference< beans::XPropertySet > xProps( xIndexContainer, uno::UNO_QUERY_THROW ); + WString& name = tb.getName(); + // set UI name for toolbar + 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 ) + { + if ( !it->ImportToolBarControl( rWrapper, xIndexContainer, helper, IsMenuToolbar() ) ) + return false; + } + + OSL_TRACE("Name of toolbar :-/ %s", rtl::OUStringToOString( sToolBarName, RTL_TEXTENCODING_UTF8 ).getStr() ); + + helper.getCfgManager()->insertSettings( sToolBarName, xIndexAccess ); + helper.applyIcons(); +#if 1 + uno::Reference< ui::XUIConfigurationPersistence > xPersistence( helper.getCfgManager()->getImageManager(), uno::UNO_QUERY_THROW ); + xPersistence->store(); + + xPersistence.set( helper.getCfgManager(), uno::UNO_QUERY_THROW ); + xPersistence->store(); +#endif + + bRes = true; + } + catch( uno::Exception& ) + { + bRes = false; + } + return bRes; +} +bool CTBS::Read( SvStream *pS ) +{ + OSL_TRACE("CTBS::Read() stream pos 0x%x", pS->Tell() ); + nOffSet = pS->Tell(); + *pS >> bSignature >> bVersion >> reserved1 >> reserved2 >> reserved3 >> ctb >> ctbViews >> ictbView; + return true; +} + +void CTBS::Print( FILE* fp ) +{ + Indent a; + indent_printf( fp, "[ 0x%x ] CTBS -- dump\n", nOffSet ); + + indent_printf( fp, " bSignature 0x%x\n", bSignature); + indent_printf( fp, " bVersion 0x%x\n", bVersion); + + indent_printf( fp, " reserved1 0x%x\n", reserved1 ); + indent_printf( fp, " reserved2 0x%x\n", reserved2 ); + indent_printf( fp, " reserved3 0x%x\n", reserved3 ); + + indent_printf( fp, " ctb 0x%x\n", ctb ); + indent_printf( fp, " ctbViews 0x%x\n", ctbViews ); + indent_printf( fp, " ictbView 0x%x\n", ictbView ); +} + +TBC::TBC() +{ +} + +bool +TBC::Read(SvStream *pS) +{ + OSL_TRACE("TBC::Read() stream pos 0x%x", pS->Tell() ); + nOffSet = pS->Tell(); + if ( !tbch.Read( pS ) ) + return false; + sal_uInt16 tcid = tbch.getTcID(); + sal_uInt8 tct = tbch.getTct(); + if ( ( tcid != 0x0001 && tcid != 0x06CC && tcid != 0x03D8 && tcid != 0x03EC && tcid != 0x1051 ) && ( ( tct > 0 && tct < 0x0B ) || ( ( tct > 0x0B && tct < 0x10 ) || tct == 0x15 ) ) ) + { + tbcCmd.reset( new TBCCmd ); + if ( ! tbcCmd->Read( pS ) ) + return false; + } + if ( tct != 0x16 ) + { + tbcd.reset( new TBCData( tbch ) ); + if ( !tbcd->Read( pS ) ) + return false; + } + return true; +} + + +void +TBC::Print(FILE* fp) +{ + Indent a; + indent_printf( fp, "[ 0x%x ] TBC -- dump\n", nOffSet ); + tbch.Print( fp ); + if ( tbcCmd.get() ) + tbcCmd->Print( fp ); + if ( tbcd.get() ) + tbcd->Print( fp ); +} + +bool TBC::ImportToolBarControl( CTBWrapper& rWrapper, const css::uno::Reference< css::container::XIndexContainer >& toolbarcontainer, CustomToolBarImportHelper& helper, bool bIsMenuToolbar ) +{ + // how to identify built-in-command ? +// bool bBuiltin = false; + if ( tbcd.get() ) + { + std::vector< css::beans::PropertyValue > props; +/* + if ( bBuiltin ) + { + rtl::OUString sCommand = helper.MSOCommandToOOCommand( cmdId ); + if ( sCommand.getLength() > 0 ) + { + beans::PropertyValue aProp; + + aProp.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("CommandURL") ); + aProp.Value <<= sCommand; + props.push_back( aProp ); + } + + } +*/ + bool bBeginGroup = false; + if ( ! tbcd->ImportToolBarControl( helper, props, bBeginGroup, bIsMenuToolbar ) ) + return false; + TBCMenuSpecific* pMenu = tbcd->getMenuSpecific(); + if ( pMenu ) + { + // search for CTB 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() ); + if ( pCustTB ) + { + uno::Reference< container::XIndexContainer > xMenuDesc; + uno::Reference< lang::XMultiServiceFactory > xMSF( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW ); + xMenuDesc.set( xMSF->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.IndexedPropertyValues" ) ) ), uno::UNO_QUERY_THROW ); + if ( !pCustTB->ImportMenuTB( rWrapper, xMenuDesc, helper ) ) + return false; + if ( !bIsMenuToolbar ) + { + if ( !helper.createMenu( pMenu->Name(), uno::Reference< container::XIndexAccess >( xMenuDesc, uno::UNO_QUERY ), true ) ) + return false; + } + else + { + beans::PropertyValue aProp; + aProp.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ItemDescriptorContainer") ); + aProp.Value <<= xMenuDesc; + props.push_back( aProp ); + } + } + } + + if ( bBeginGroup ) + { + // insert spacer + uno::Sequence< beans::PropertyValue > sProps( 1 ); + sProps[ 0 ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Type") ); + sProps[ 0 ].Value = uno::makeAny( ui::ItemType::SEPARATOR_LINE ); + toolbarcontainer->insertByIndex( toolbarcontainer->getCount(), uno::makeAny( sProps ) ); + } + uno::Sequence< beans::PropertyValue > sProps( props.size() ); + beans::PropertyValue* pProp = sProps.getArray(); + + for ( std::vector< css::beans::PropertyValue >::iterator it = props.begin(); it != props.end(); ++it, ++pProp ) + *pProp = *it; + + toolbarcontainer->insertByIndex( toolbarcontainer->getCount(), uno::makeAny( sProps ) ); + } + return true; +} + +void +TBCCmd::Print(FILE* fp) +{ + Indent a; + indent_printf( fp, " TBCCmd -- dump\n" ); + indent_printf( fp, " cmdID 0x%x\n", cmdID ); + indent_printf( fp, " A ( fHideDrawing ) %s\n", A ? "true" : "false" ); + indent_printf( fp, " B ( reserved - ignored ) %s\n", A ? "true" : "false" ); + indent_printf( fp, " cmdType 0x%x\n", cmdType ); + indent_printf( fp, " C ( reserved - ignored ) %s\n", A ? "true" : "false" ); + indent_printf( fp, " reserved3 0x%x\n", reserved3 ); +} + +bool TBCCmd::Read( SvStream *pS ) +{ + OSL_TRACE("TBCCmd::Read() stream pos 0x%x", pS->Tell() ); + nOffSet = pS->Tell(); + *pS >> cmdID; + sal_uInt16 temp; + *pS >> temp; + OSL_TRACE("TBCmd temp = 0x%x", temp ); + A = (temp & 0x8000 ) == 0x8000; + B = (temp & 0x4000) == 0x4000; + cmdType = ( temp & 0x3E00 ) >> 9; + C = ( temp & 0x100 ) == 0x100; + reserved3 = ( temp & 0xFF ); + return true; +} + +CTBWrapper::CTBWrapper() +{ +} + +CTBWrapper::~CTBWrapper() +{ +} + +bool +CTBWrapper::Read( SvStream *pS) +{ + OSL_TRACE("CTBWrapper::Read() stream pos 0x%x", pS->Tell() ); + nOffSet = pS->Tell(); + if ( !ctbSet.Read( pS ) ) + return false; + for ( sal_uInt16 index = 0; index < ctbSet.ctb; ++index ) + { + CTB aCTB( ctbSet.ctbViews ); + if ( !aCTB.Read( pS ) ) + return false; + rCTB.push_back( aCTB ); + } + return true; +} + +void +CTBWrapper::Print( FILE* fp ) +{ + Indent a; + indent_printf( fp, "[ 0x%x ] CTBWrapper -- 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 ) + { + Indent b; + it->Print( fp ); + } +} + +CTB* CTBWrapper::GetCustomizationData( const rtl::OUString& sTBName ) +{ + CTB* pCTB = NULL; + for ( std::vector< CTB >::iterator it = rCTB.begin(); it != rCTB.end(); ++it ) + { + if ( it->GetName().equals( sTBName ) ) + { + pCTB = &(*it); + break; + } + } + return pCTB; +} + +bool CTBWrapper::ImportCustomToolBar( SfxObjectShell& rDocSh ) +{ + std::vector<CTB>::iterator it_end = rCTB.end(); + for ( std::vector<CTB>::iterator it = rCTB.begin(); it != it_end; ++it ) + { + // for each customtoolbar + uno::Reference< lang::XMultiServiceFactory > xMSF( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW ); + uno::Reference< ui::XModuleUIConfigurationManagerSupplier > xAppCfgSupp( xMSF->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.ModuleUIConfigurationManagerSupplier" ) ) ), uno::UNO_QUERY_THROW ); + CustomToolBarImportHelper helper( rDocSh, xAppCfgSupp->getUIConfigurationManager( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.SpreadsheetDocument" ) ) ) ); + helper.setMSOCommandMap( new MSOExcelCommandConvertor() ); + // Ignore menu toolbars, excel doesn't ( afaics ) store + // menu customizations ( but you can have menus in a customtoolbar + // such menus will be dealt with when they are encountered + // as part of importing the appropriate MenuSpecific toolbar control ) + + + if ( !(*it).IsMenuToolbar() ) + { + if ( !(*it).ImportCustomToolBar( *this, helper ) ) + return false; + } + } + return true; +} diff --git a/sc/source/filter/excel/xltoolbar.hxx b/sc/source/filter/excel/xltoolbar.hxx new file mode 100644 index 000000000000..5152b6b398c4 --- /dev/null +++ b/sc/source/filter/excel/xltoolbar.hxx @@ -0,0 +1,95 @@ +#ifndef _XLTOOLBAR_HXX +#define _XLTOOLBAR_HXX + +#include <filter/msfilter/mstoolbar.hxx> + +namespace css = ::com::sun::star; + +class CTBWrapper; +// hmm I don't normally use these packed structures +// but.. hey always good to do something different +class TBCCmd : public TBBase +{ +public: + TBCCmd() : cmdID(0), A(0), B(0), cmdType(0), C(0), reserved3(0) {} + sal_uInt16 cmdID; + sal_uInt16 A:1; + sal_uInt16 B:1; + sal_uInt16 cmdType:5; + sal_uInt16 C:1; + sal_uInt16 reserved3:8; + bool Read( SvStream* pS ); + void Print(FILE* fp); +}; + +class TBC : public TBBase +{ + TBCHeader tbch; + boost::shared_ptr<TBCCmd> tbcCmd; // optional + boost::shared_ptr<TBCData> tbcd; +public: + TBC(); + ~TBC(){} + void Print( FILE* ); + bool Read(SvStream *pS); + bool ImportToolBarControl( CTBWrapper&, const com::sun::star::uno::Reference< com::sun::star::container::XIndexContainer >& toolbarcontainer, CustomToolBarImportHelper& helper, bool bIsMenuBar ); +}; + +class CTB : public TBBase +{ + sal_uInt16 nViews; + TB tb; + std::vector<TBVisualData> rVisualData; + sal_uInt32 ectbid; + std::vector< TBC > rTBC; + bool ImportCustomToolBar_Impl( CTBWrapper&, CustomToolBarImportHelper& ); +public: + CTB(); + CTB(sal_uInt16); + ~CTB(){} + void Print( FILE* ); + bool Read(SvStream *pS); + bool IsMenuToolbar(); + bool ImportCustomToolBar( CTBWrapper&, CustomToolBarImportHelper& ); + bool ImportMenuTB( CTBWrapper&, const css::uno::Reference< css::container::XIndexContainer >&, CustomToolBarImportHelper& ); + rtl::OUString GetName() { return tb.getName().getString(); } + + +}; + +class CTBS : public TBBase +{ +public: + sal_uInt8 bSignature; + sal_uInt8 bVersion; + sal_uInt16 reserved1; + sal_uInt16 reserved2; + sal_uInt16 reserved3; + sal_uInt16 ctb; + sal_uInt16 ctbViews; + sal_uInt16 ictbView; + CTBS(const CTBS&); + CTBS& operator = ( const CTBS&); + CTBS(); + ~CTBS(){} + void Print( FILE* ); + bool Read(SvStream *pS); +}; + +class CTBWrapper : public TBBase +{ + CTBS ctbSet; + + std::vector< CTB > rCTB; + +public: + CTBWrapper(); + ~CTBWrapper(); + bool Read(SvStream *pS); + void Print( FILE* ); + bool ImportCustomToolBar( SfxObjectShell& rDocSh ); + CTB* GetCustomizationData( const rtl::OUString& name ); +}; + + +#endif //_XLTOOLBAR_HXX diff --git a/sc/source/filter/excel/xltools.cxx b/sc/source/filter/excel/xltools.cxx index 0dd988d67586..5ee9429ebac7 100644 --- a/sc/source/filter/excel/xltools.cxx +++ b/sc/source/filter/excel/xltools.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -689,7 +690,7 @@ void XclTools::SkipSubStream( XclImpStream& rStrm ) // Basic macro names ---------------------------------------------------------- -const OUString XclTools::maSbMacroPrefix( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.script:Standard." ) ); +const OUString XclTools::maSbMacroPrefix( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.script:" ) ); const OUString XclTools::maSbMacroSuffix( RTL_CONSTASCII_USTRINGPARAM( "?language=Basic&location=document" ) ); OUString XclTools::GetSbMacroUrl( const String& rMacroName, SfxObjectShell* pDocShell ) @@ -714,7 +715,10 @@ String XclTools::GetXclMacroName( const OUString& rSbMacroUrl ) sal_Int32 nMacroNameLen = nSbMacroUrlLen - maSbMacroPrefix.getLength() - maSbMacroSuffix.getLength(); if( (nMacroNameLen > 0) && rSbMacroUrl.matchIgnoreAsciiCase( maSbMacroPrefix, 0 ) && rSbMacroUrl.matchIgnoreAsciiCase( maSbMacroSuffix, nSbMacroUrlLen - maSbMacroSuffix.getLength() ) ) - return rSbMacroUrl.copy( maSbMacroPrefix.getLength(), nMacroNameLen ); + { + sal_Int32 nPrjDot = rSbMacroUrl.indexOf( '.', maSbMacroPrefix.getLength() ) + 1; + return rSbMacroUrl.copy( nPrjDot, nSbMacroUrlLen - nPrjDot - maSbMacroSuffix.getLength() ); + } return String::EmptyString(); } @@ -734,3 +738,5 @@ XclExpStream& operator<<( XclExpStream& rStrm, const Color& rColor ) } // ============================================================================ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xltracer.cxx b/sc/source/filter/excel/xltracer.cxx index 7dadbde8198a..948fa41efbdf 100644 --- a/sc/source/filter/excel/xltracer.cxx +++ b/sc/source/filter/excel/xltracer.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -268,3 +269,4 @@ void XclTracer::TraceDVType( bool bType) // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xlview.cxx b/sc/source/filter/excel/xlview.cxx index 8e9df7e0ac1f..63512e4ec2d5 100644 --- a/sc/source/filter/excel/xlview.cxx +++ b/sc/source/filter/excel/xlview.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -113,3 +114,4 @@ XclSelectionData& XclTabViewData::CreateSelectionData( sal_uInt8 nPane ) // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/ftools/fapihelper.cxx b/sc/source/filter/ftools/fapihelper.cxx index bb97119a1338..ac41cc47b224 100644 --- a/sc/source/filter/ftools/fapihelper.cxx +++ b/sc/source/filter/ftools/fapihelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -404,3 +405,4 @@ Any* ScfPropSetHelper::GetNextAny() // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/ftools/fprogressbar.cxx b/sc/source/filter/ftools/fprogressbar.cxx index 176ff16ba5db..533891b0d6fc 100644 --- a/sc/source/filter/ftools/fprogressbar.cxx +++ b/sc/source/filter/ftools/fprogressbar.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -250,3 +251,4 @@ void ScfStreamProgressBar::Init( SfxObjectShell* pDocShell, const String& rText // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/ftools/ftools.cxx b/sc/source/filter/ftools/ftools.cxx index 72e5f115fed0..ce6264b50828 100644 --- a/sc/source/filter/ftools/ftools.cxx +++ b/sc/source/filter/ftools/ftools.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -404,3 +405,4 @@ ScFormatFilterPlugin * SAL_CALL ScFilterCreate(void) // implementation class inside the filters +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx index 05de5963b88b..5b4707e61ace 100644 --- a/sc/source/filter/html/htmlexp.cxx +++ b/sc/source/filter/html/htmlexp.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1347,3 +1348,4 @@ void ScHTMLExport::IncIndent( short nVal ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/html/htmlexp2.cxx b/sc/source/filter/html/htmlexp2.cxx index 341f9afbc739..c6299bda127a 100644 --- a/sc/source/filter/html/htmlexp2.cxx +++ b/sc/source/filter/html/htmlexp2.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -247,3 +248,4 @@ void ScHTMLExport::WriteImage( String& rLinkName, const Graphic& rGrf, +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/html/htmlimp.cxx b/sc/source/filter/html/htmlimp.cxx index 1c0b9fc8ec33..0c5e0ffd0b4c 100644 --- a/sc/source/filter/html/htmlimp.cxx +++ b/sc/source/filter/html/htmlimp.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -258,3 +259,4 @@ String ScHTMLImport::GetHTMLRangeNameList( ScDocument* pDoc, const String& rOrig return aNewName; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx index 5fea4b9687ae..e7caef029ed1 100644 --- a/sc/source/filter/html/htmlpars.cxx +++ b/sc/source/filter/html/htmlpars.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -3068,3 +3069,4 @@ IMPL_LINK( ScHTMLQueryParser, HTMLImportHdl, const ImportInfo*, pInfo ) // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/inc/XclExpChangeTrack.hxx b/sc/source/filter/inc/XclExpChangeTrack.hxx index 01eb076f6b3d..4a943de4d795 100644 --- a/sc/source/filter/inc/XclExpChangeTrack.hxx +++ b/sc/source/filter/inc/XclExpChangeTrack.hxx @@ -238,6 +238,8 @@ public: virtual UINT16 GetNum() const; virtual sal_Size GetLen() const; + + virtual void SaveXml( XclExpXmlStream& rStrm ); }; //___________________________________________________________________ @@ -247,6 +249,7 @@ class XclExpChTrInfo : public ExcRecord { private: XclExpString sUsername; + sal_Int32 mnLogNumber; DateTime aDateTime; sal_uInt8 aGUID[ 16 ]; @@ -256,15 +259,19 @@ public: inline XclExpChTrInfo( const String& rUsername, const DateTime& rDateTime, - const sal_uInt8* pGUID ); + const sal_uInt8* pGUID, + sal_Int32 nLogNumber ); virtual ~XclExpChTrInfo(); virtual UINT16 GetNum() const; virtual sal_Size GetLen() const; + + virtual void SaveXml( XclExpXmlStream& rStrm ); }; -inline XclExpChTrInfo::XclExpChTrInfo( const String& rUsername, const DateTime& rDateTime, const sal_uInt8* pGUID ) : +inline XclExpChTrInfo::XclExpChTrInfo( const String& rUsername, const DateTime& rDateTime, const sal_uInt8* pGUID, sal_Int32 nLogNumber ) : sUsername( rUsername ), + mnLogNumber( nLogNumber ), aDateTime( rDateTime ) { memcpy( aGUID, pGUID, 16 ); @@ -322,6 +329,7 @@ class XclExpChTrTabId : public ExcRecord private: sal_uInt16* pBuffer; sal_uInt16 nTabCount; + bool mbInRevisionHeaders; inline void Clear() { if( pBuffer ) delete[] pBuffer; pBuffer = NULL; } @@ -329,14 +337,16 @@ private: public: inline XclExpChTrTabId( sal_uInt16 nCount ) : - pBuffer( NULL ), nTabCount( nCount ) {} - XclExpChTrTabId( const XclExpChTrTabIdBuffer& rBuffer ); + pBuffer( NULL ), nTabCount( nCount ), mbInRevisionHeaders( false ) {} + XclExpChTrTabId( const XclExpChTrTabIdBuffer& rBuffer, bool bInRevisionHeaders = false ); virtual ~XclExpChTrTabId(); void Copy( const XclExpChTrTabIdBuffer& rBuffer ); virtual UINT16 GetNum() const; virtual sal_Size GetLen() const; + + virtual void SaveXml( XclExpXmlStream& rStrm ); }; //___________________________________________________________________ @@ -368,6 +378,7 @@ protected: inline void Write2DAddress( XclExpStream& rStrm, const ScAddress& rAddress ) const; inline void Write2DRange( XclExpStream& rStrm, const ScRange& rRange ) const; + inline sal_uInt16 GetTabId( SCTAB nTabId ) const; inline void WriteTabId( XclExpStream& rStrm, SCTAB nTabId ) const; // save header data, call SaveActionData() @@ -384,6 +395,9 @@ protected: // do something after writing the record virtual void CompleteSaveAction( XclExpStream& rStrm ) const; + inline sal_uInt32 GetActionNumber() const { return nIndex; } + inline sal_Bool GetAccepted() const { return bAccepted; } + public: XclExpChTrAction( const ScChangeAction& rAction, @@ -403,6 +417,8 @@ public: virtual void Save( XclExpStream& rStrm ); virtual sal_Size GetLen() const; + + inline XclExpChTrAction* GetAddAction() { return pAddAction; } }; inline void XclExpChTrAction::Write2DAddress( XclExpStream& rStrm, const ScAddress& rAddress ) const @@ -419,9 +435,14 @@ inline void XclExpChTrAction::Write2DRange( XclExpStream& rStrm, const ScRange& << (sal_uInt16) rRange.aEnd.Col(); } +inline sal_uInt16 XclExpChTrAction::GetTabId( SCTAB nTab ) const +{ + return rIdBuffer.GetId( rTabInfo.GetXclTab( nTab ) ); +} + inline void XclExpChTrAction::WriteTabId( XclExpStream& rStrm, SCTAB nTab ) const { - rStrm << rIdBuffer.GetId( rTabInfo.GetXclTab( nTab ) ); + rStrm << GetTabId( nTab ); } //___________________________________________________________________ @@ -430,6 +451,8 @@ inline void XclExpChTrAction::WriteTabId( XclExpStream& rStrm, SCTAB nTab ) cons struct XclExpChTrData { XclExpString* pString; + XclExpStringRef mpFormattedString; + const ScFormulaCell* mpFormulaCell; XclTokenArrayRef mxTokArr; XclExpRefLog maRefLog; double fValue; @@ -465,6 +488,7 @@ protected: ScAddress aPosition; void GetCellData( + const XclExpRoot& rRoot, const ScBaseCell* pScCell, XclExpChTrData*& rpData, sal_uInt32& rXclLength1, @@ -481,6 +505,8 @@ public: virtual UINT16 GetNum() const; virtual sal_Size GetActionByteCount() const; + + virtual void SaveXml( XclExpXmlStream& rStrm ); }; //___________________________________________________________________ @@ -508,6 +534,8 @@ public: virtual UINT16 GetNum() const; virtual sal_Size GetActionByteCount() const; + + virtual void SaveXml( XclExpXmlStream& rStrm ); }; //___________________________________________________________________ @@ -530,6 +558,8 @@ public: virtual UINT16 GetNum() const; virtual sal_Size GetActionByteCount() const; + + virtual void SaveXml( XclExpXmlStream& rStrm ); }; //___________________________________________________________________ @@ -555,6 +585,8 @@ public: virtual UINT16 GetNum() const; virtual sal_Size GetActionByteCount() const; + + virtual void SaveXml( XclExpXmlStream& rStrm ); }; //___________________________________________________________________ @@ -571,6 +603,8 @@ public: virtual UINT16 GetNum() const; virtual sal_Size GetActionByteCount() const; + + virtual void SaveXml( XclExpXmlStream& rStrm ); }; //___________________________________________________________________ @@ -603,6 +637,7 @@ public: using List::Count; void Append( ExcRecord* pNewRec ); void Save( XclExpStream& rStrm ); + void SaveXml( XclExpXmlStream& rStrm ); }; //___________________________________________________________________ @@ -633,6 +668,7 @@ public: ~XclExpChangeTrack(); void Write(); + void WriteXml( XclExpXmlStream& rStrm ); }; //___________________________________________________________________ diff --git a/sc/source/filter/inc/excdoc.hxx b/sc/source/filter/inc/excdoc.hxx index 5da6a5d38d83..39cacc405170 100644 --- a/sc/source/filter/inc/excdoc.hxx +++ b/sc/source/filter/inc/excdoc.hxx @@ -110,7 +110,7 @@ public: void ReadDoc( void ); void Write( SvStream& rSvStrm ); - void WriteXml( SvStream& rSvStrm ); + void WriteXml( XclExpXmlStream& ); }; diff --git a/sc/source/filter/inc/excimp8.hxx b/sc/source/filter/inc/excimp8.hxx index 7e4cca15dfe1..0f46a125b12c 100644 --- a/sc/source/filter/inc/excimp8.hxx +++ b/sc/source/filter/inc/excimp8.hxx @@ -57,6 +57,9 @@ public: virtual FltError Read( void ); protected: + // represents codename ( and associated modules ) + // not speficied directly in the binary format + std::vector< String > AutoGeneratedCodeNames; ExcScenarioList aScenList; void Calccount( void ); // 0x0C diff --git a/sc/source/filter/inc/excrecds.hxx b/sc/source/filter/inc/excrecds.hxx index bc960f05b3a5..11765fcf5daf 100644 --- a/sc/source/filter/inc/excrecds.hxx +++ b/sc/source/filter/inc/excrecds.hxx @@ -72,6 +72,7 @@ class ExcRecord : public XclExpRecord { public: virtual void Save( XclExpStream& rStrm ); + virtual void SaveXml( XclExpXmlStream& rStrm ); virtual UINT16 GetNum() const = 0; virtual sal_Size GetLen() const = 0; @@ -285,6 +286,8 @@ public: virtual UINT16 GetNum( void ) const; virtual void SaveXml( XclExpXmlStream& rStrm ); +private: + BOOL bDateCompatibility; }; @@ -471,6 +474,7 @@ private: XclExpFiltermode* pFilterMode; XclExpAutofilterinfo* pFilterInfo; ScRange maRef; + bool mbAutoFilter; }; // ---------------------------------------------------------------------------- diff --git a/sc/source/filter/inc/exp_op.hxx b/sc/source/filter/inc/exp_op.hxx index 79fff8675d84..9bb2765ccc0b 100644 --- a/sc/source/filter/inc/exp_op.hxx +++ b/sc/source/filter/inc/exp_op.hxx @@ -127,21 +127,6 @@ public: }; -class ExportXml2007 : public ExportTyp, protected XclExpRoot -{ -private: - ExcDocument* pExcDoc; - -protected: - RootData* pExcRoot; - -public: - ExportXml2007( XclExpRootData& rExpData, SvStream& rStrm ); - virtual ~ExportXml2007(); - FltError Write(); -}; - - #endif diff --git a/sc/source/filter/inc/xcl97esc.hxx b/sc/source/filter/inc/xcl97esc.hxx index fde03337cc0f..20735a11495d 100644 --- a/sc/source/filter/inc/xcl97esc.hxx +++ b/sc/source/filter/inc/xcl97esc.hxx @@ -34,6 +34,7 @@ #include <filter/msfilter/escherex.hxx> #include "xlescher.hxx" #include "xeroot.hxx" +#include <vector> // 0 = Export TBX form controls, 1 = Export OCX form controls. #define EXC_EXP_OCX_CTRL 0 @@ -70,6 +71,15 @@ class XclExpOcxControlObj; #else class XclExpTbxControlObj; #endif +class XclExpShapeObj; +class EscherExHostAppData; +class ShapeInteractionHelper +{ +public: + static XclExpShapeObj* CreateShapeObj( XclExpObjectManager& rObjMgr, const ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XShape >& xShape ); + static void PopulateShapeInteractionInfo( XclExpObjectManager& rObjMgr, const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& xShape, EscherExHostAppData& rHostAppData ); +}; class XclEscherEx : public EscherEx, protected XclExpRoot { diff --git a/sc/source/filter/inc/xcl97rec.hxx b/sc/source/filter/inc/xcl97rec.hxx index 201562fa752c..2269be1f2be8 100644 --- a/sc/source/filter/inc/xcl97rec.hxx +++ b/sc/source/filter/inc/xcl97rec.hxx @@ -36,6 +36,7 @@ class XclObj; class XclExpMsoDrawing; +class SdrCaptionObj; class XclExpObjList : public List, public ExcEmptyRec, protected XclExpRoot { @@ -56,8 +57,14 @@ public: void EndSheet(); virtual void Save( XclExpStream& rStrm ); + virtual void SaveXml( XclExpXmlStream& rStrm ); + + static void ResetCounters(); private: + static sal_Int32 mnDrawingMLCount, mnVmlCount; + SCTAB mnScTab; + XclEscherEx& mrEscherEx; XclExpMsoDrawing* pMsodrawingPerSheet; XclExpMsoDrawing* pSolverContainer; @@ -79,6 +86,7 @@ protected: sal_uInt16 mnObjType; UINT16 nObjId; UINT16 nGrbit; + SCTAB mnScTab; BOOL bFirstOnSheet; bool mbOwnEscher; /// true = Escher part created on the fly. @@ -100,6 +108,10 @@ public: inline sal_uInt16 GetObjType() const { return mnObjType; } inline void SetId( UINT16 nId ) { nObjId = nId; } + inline sal_uInt16 GetId() const { return nObjId; } + + inline void SetTab( SCTAB nScTab ) { mnScTab = nScTab; } + inline SCTAB GetTab() const { return mnScTab; } inline void SetLocked( BOOL b ) { b ? nGrbit |= 0x0001 : nGrbit &= ~0x0001; } @@ -136,9 +148,13 @@ public: class XclObjComment : public XclObj { + ScAddress maScPos; + std::auto_ptr< SdrCaptionObj > + mpCaption; + bool mbVisible; public: XclObjComment( XclExpObjectManager& rObjMgr, - const Rectangle& rRect, const EditTextObject& rEditObj, SdrObject* pCaption, bool bVisible ); + const Rectangle& rRect, const EditTextObject& rEditObj, SdrCaptionObj* pCaption, bool bVisible, const ScAddress& rAddress ); virtual ~XclObjComment(); /** c'tor process for formatted text objects above . @@ -148,6 +164,7 @@ public: virtual void Save( XclExpStream& rStrm ); + virtual void SaveXml( XclExpXmlStream& rStrm ); }; @@ -220,14 +237,24 @@ public: class XclObjAny : public XclObj { -private: +protected: virtual void WriteSubRecs( XclExpStream& rStrm ); public: - XclObjAny( XclExpObjectManager& rObjMgr ); + XclObjAny( XclExpObjectManager& rObjMgr, + const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& rShape ); virtual ~XclObjAny(); + com::sun::star::uno::Reference< com::sun::star::drawing::XShape > + GetShape() const { return mxShape; } + + virtual void Save( XclExpStream& rStrm ); + virtual void SaveXml( XclExpXmlStream& rStrm ); + +private: + com::sun::star::uno::Reference< com::sun::star::drawing::XShape > + mxShape; }; diff --git a/sc/source/filter/inc/xecontent.hxx b/sc/source/filter/inc/xecontent.hxx index 50c9466d2801..a999d97cb1f2 100644 --- a/sc/source/filter/inc/xecontent.hxx +++ b/sc/source/filter/inc/xecontent.hxx @@ -113,6 +113,8 @@ public: inline const String* GetRepr() const { return mxRepr.get(); } virtual void SaveXml( XclExpXmlStream& rStrm ); + + virtual void WriteEmbeddedData( XclExpStream& rStrm ); private: /** Builds file name from the passed file URL. Tries to convert to relative file name. @param rnLevel (out-param) The parent directory level. diff --git a/sc/source/filter/inc/xeescher.hxx b/sc/source/filter/inc/xeescher.hxx index d227db184f1a..25d997a44150 100644 --- a/sc/source/filter/inc/xeescher.hxx +++ b/sc/source/filter/inc/xeescher.hxx @@ -168,6 +168,7 @@ public: /** Writes the BITMAP record. */ virtual void Save( XclExpStream& rStrm ); + virtual void SaveXml( XclExpXmlStream& rStrm ); private: Graphic maGraphic; /// The VCL graphic. @@ -207,6 +208,34 @@ private: sal_uInt16 mnEntryCount; /// Number of entries in source range. }; +class XclMacroHelper : public XclExpControlHelper +{ +protected: + XclTokenArrayRef mxMacroLink; /// Token array containing a link to an attached macro. + +public: + explicit XclMacroHelper( const XclExpRoot& rRoot ); + virtual ~XclMacroHelper(); + /** Writes an ftMacro subrecord containing a macro link, or nothing, if no macro present. */ + void WriteMacroSubRec( XclExpStream& rStrm ); + /** Sets the name of a macro for object of passed type + @return true = The passed event descriptor was valid, macro name has been found. */ + bool SetMacroLink( const ::com::sun::star::script::ScriptEventDescriptor& rEvent, const XclTbxEventType& nEventType ); + + /** Sets the name of a macro + @return true = The passed macro name has been found. */ + bool SetMacroLink( const String& rMacro ); +}; + +class XclExpShapeObj : public XclObjAny, public XclMacroHelper +{ +public: + explicit XclExpShapeObj( XclExpObjectManager& rRoot, ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape ); + virtual ~XclExpShapeObj(); +private: + virtual void WriteSubRecs( XclExpStream& rStrm ); +}; + // ---------------------------------------------------------------------------- #if EXC_EXP_OCX_CTRL @@ -234,7 +263,7 @@ private: #else /** Represents an OBJ record for an TBX form control. */ -class XclExpTbxControlObj : public XclObj, public XclExpControlHelper +class XclExpTbxControlObj : public XclObj, public XclMacroHelper { public: explicit XclExpTbxControlObj( @@ -249,8 +278,6 @@ public: private: virtual void WriteSubRecs( XclExpStream& rStrm ); - /** Writes an ftMacro subrecord containing a macro link, or nothing, if no macro present. */ - void WriteMacroSubRec( XclExpStream& rStrm ); /** Writes a subrecord containing a cell link, or nothing, if no link present. */ void WriteCellLinkSubRec( XclExpStream& rStrm, sal_uInt16 nSubRecId ); /** Writes the ftSbs sub structure containing scrollbar data. */ @@ -258,7 +285,6 @@ private: private: ScfInt16Vec maMultiSel; /// Indexes of all selected entries in a multi selection. - XclTokenArrayRef mxMacroLink; /// Token array containing a link to an attached macro. XclTbxEventType meEventType; /// Type of supported macro event. sal_Int32 mnHeight; /// Height of the control. sal_uInt16 mnState; /// Checked/unchecked state. @@ -339,6 +365,7 @@ private: XclExpString maAuthor; /// Name of the author. String maOrigNoteText; /// Original main text of the note. ByteString maNoteText; /// Main text of the note (<=BIFF7). + XclExpStringRef mpNoteContents; /// Text and formatting data (OOXML) ScAddress maScPos; /// Calc cell address of the note. sal_uInt16 mnObjId; /// Escher object ID (BIFF8). bool mbVisible; /// true = permanently visible. diff --git a/sc/source/filter/inc/xepivot.hxx b/sc/source/filter/inc/xepivot.hxx index 17d81bb3fceb..150b441f04bf 100644 --- a/sc/source/filter/inc/xepivot.hxx +++ b/sc/source/filter/inc/xepivot.hxx @@ -371,6 +371,7 @@ public: /** Writes the entire pivot table. */ virtual void Save( XclExpStream& rStrm ); + virtual void SaveXml( XclExpXmlStream& rStrm ); // ------------------------------------------------------------------------ private: diff --git a/sc/source/filter/inc/xestream.hxx b/sc/source/filter/inc/xestream.hxx index 0e80b28eb939..f0bcb70cf033 100644 --- a/sc/source/filter/inc/xestream.hxx +++ b/sc/source/filter/inc/xestream.hxx @@ -257,12 +257,15 @@ private: (s.Len() && s.GetChar( 0 ) != 0 ? XclXmlUtils::ToOString( s ).getStr() : NULL) class ScAddress; +class ScDocShell; class ScDocument; +class ScFormulaCell; class ScRange; class ScRangeList; class ScTokenArray; struct XclAddress; struct XclFontData; +class XclRange; class XclRangeList; class XclXmlUtils @@ -272,6 +275,7 @@ class XclXmlUtils XclXmlUtils(const XclXmlUtils&); XclXmlUtils& operator=(const XclXmlUtils&); public: + static void GetFormulaTypeAndValue( ScFormulaCell& rCell, const char*& sType, ::rtl::OUString& rValue); static ::rtl::OUString GetStreamName( const char* sStreamDir, const char* sStream, sal_Int32 nId ); static ::rtl::OString ToOString( const Color& rColor ); @@ -283,6 +287,7 @@ public: static ::rtl::OString ToOString( const ScRangeList& rRangeList ); static ::rtl::OString ToOString( const XclAddress& rAddress ); static ::rtl::OString ToOString( const XclExpString& s ); + static ::rtl::OString ToOString( const XclRange& rRange ); static ::rtl::OString ToOString( const XclRangeList& rRangeList ); static ::rtl::OUString ToOUString( const char* s ); @@ -291,16 +296,21 @@ public: static ::rtl::OUString ToOUString( ScDocument& rDocument, const ScAddress& rAddress, ScTokenArray* pTokenArray ); static ::rtl::OUString ToOUString( const XclExpString& s ); static const char* ToPsz( bool b ); + + static sax_fastparser::FSHelperPtr WriteElement( sax_fastparser::FSHelperPtr pStream, sal_Int32 nElement, sal_Int32 nValue ); + static sax_fastparser::FSHelperPtr WriteElement( sax_fastparser::FSHelperPtr pStream, sal_Int32 nElement, sal_Int64 nValue ); + static sax_fastparser::FSHelperPtr WriteElement( sax_fastparser::FSHelperPtr pStream, sal_Int32 nElement, const char* sValue ); + static sax_fastparser::FSHelperPtr WriteFontData( sax_fastparser::FSHelperPtr pStream, const XclFontData& rFontData, sal_Int32 nNameId ); }; class XclExpXmlStream : public oox::core::XmlFilterBase { public: - XclExpXmlStream( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rSMgr, SvStream& rStrm, const XclExpRoot& rRoot ); + XclExpXmlStream( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rSMgr ); virtual ~XclExpXmlStream(); /** Returns the filter root data. */ - inline const XclExpRoot& GetRoot() const { return mrRoot; } + inline const XclExpRoot& GetRoot() const { return *mpRoot; } sax_fastparser::FSHelperPtr& GetCurrentStream(); void PushStream( sax_fastparser::FSHelperPtr aStream ); @@ -310,7 +320,6 @@ public: sax_fastparser::FSHelperPtr GetStreamForPath( const ::rtl::OUString& rPath ); sax_fastparser::FSHelperPtr& WriteAttributes( sal_Int32 nAttribute, ... ); - sax_fastparser::FSHelperPtr& WriteFontData( const XclFontData& rFontData, sal_Int32 nNameId ); sax_fastparser::FSHelperPtr CreateOutputStream ( const ::rtl::OUString& sFullStream, @@ -333,12 +342,13 @@ public: void Trace( const char* format, ...); private: virtual ::rtl::OUString implGetImplementationName() const; + ScDocShell *getDocShell(); typedef std::map< ::rtl::OUString, std::pair< ::rtl::OUString, sax_fastparser::FSHelperPtr > > XclExpXmlPathToStateMap; - const XclExpRoot& mrRoot; /// Filter root data. + const XclExpRoot* mpRoot; std::stack< sax_fastparser::FSHelperPtr > maStreams; XclExpXmlPathToStateMap maOpenedStreamMap; }; diff --git a/sc/source/filter/inc/xetable.hxx b/sc/source/filter/inc/xetable.hxx index 51187a9b0178..0ace2a942640 100644 --- a/sc/source/filter/inc/xetable.hxx +++ b/sc/source/filter/inc/xetable.hxx @@ -38,6 +38,9 @@ #include "xeformula.hxx" #include "xestyle.hxx" +#include <boost/shared_ptr.hpp> +#include <map> + /* ============================================================================ Export of cell tables including row and column description. - Managing all used and formatted cells in a sheet. @@ -980,14 +983,12 @@ private: XclExpRow& GetOrCreateRow( sal_uInt16 nXclRow, bool bRowAlwaysEmpty ); private: - typedef XclExpRecordList< XclExpRow > XclExpRowList; - typedef XclExpRowList::RecordRefType XclExpRowRef; + typedef ::boost::shared_ptr<XclExpRow> RowRef; + typedef ::std::map<sal_uInt32, RowRef> RowMap; - XclExpRowList maRowList; /// List of all ROW records. + RowMap maRowMap; XclExpRowOutlineBuffer maOutlineBfr; /// Buffer for row outline groups. XclExpDimensions maDimensions; /// DIMENSIONS record for used area. - XclExpRow* mpLastUsedRow; /// Last used row for faster access. - sal_uInt16 mnLastUsedXclRow; /// Last used row for faster access. }; // ============================================================================ diff --git a/sc/source/filter/inc/xiescher.hxx b/sc/source/filter/inc/xiescher.hxx index fc93af420667..f465753c4cc1 100644 --- a/sc/source/filter/inc/xiescher.hxx +++ b/sc/source/filter/inc/xiescher.hxx @@ -30,6 +30,7 @@ #include <vector> #include <map> +#include <hash_map> #include <filter/msfilter/msdffimp.hxx> #include <filter/msfilter/msocximex.hxx> #include <vcl/graph.hxx> @@ -92,7 +93,7 @@ public: /** Returns the Excel object type from OBJ record. */ inline sal_uInt16 GetObjType() const { return mnObjType; } /** Returns the name of this object, may generate a default name. */ - String GetObjName() const; + virtual String GetObjName() const; /** Returns associated macro name, if set, otherwise zero length string. */ inline const String& GetMacroName() const { return maMacroName; } @@ -172,7 +173,7 @@ protected: virtual void DoPreProcessSdrObj( XclImpDffConverter& rDffConv, SdrObject& rSdrObj ) const; /** Derived classes may perform additional processing for the passed SdrObject after insertion. */ virtual void DoPostProcessSdrObj( XclImpDffConverter& rDffConv, SdrObject& rSdrObj ) const; - + SCTAB GetTab() const { return mnTab; } private: /** Reads the contents of a BIFF3 OBJ record. */ void ImplReadObj3( XclImpStream& rStrm ); @@ -186,6 +187,7 @@ private: private: XclObjAnchor maAnchor; /// The position of the object in its parent. sal_uInt16 mnObjId; /// The object identifier (unique per drawing). + SCTAB mnTab; /// Location of object sal_uInt16 mnObjType; /// The Excel object type from OBJ record. sal_uInt32 mnDffShapeId; /// Shape ID from DFF stream. sal_uInt32 mnDffFlags; /// Shape flags from DFF stream. @@ -502,6 +504,10 @@ protected: /** Derived classes will set additional properties for the current form control. */ virtual void DoProcessControl( ScfPropertySet& rPropSet ) const; + void ApplySheetLinkProps() const; + mutable ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > + mxShape; /// The UNO wrapper of the control shape. + ScfRef< ScAddress > mxCellLink; /// Linked cell in the Calc document. private: /** Reads a list of cell ranges from a formula at the current stream position. */ void ReadRangeList( ScRangeList& rScRanges, XclImpStream& rStrm ); @@ -510,9 +516,6 @@ private: private: const XclImpRoot& mrRoot; /// Not derived from XclImpRoot to allow multiple inheritance. - mutable ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > - mxShape; /// The UNO wrapper of the control shape. - ScfRef< ScAddress > mxCellLink; /// Linked cell in the Calc document. ScfRef< ScRange > mxSrcRange; /// Source data range in the Calc document. XclCtrlBindMode meBindMode; /// Value binding mode. }; @@ -614,6 +617,7 @@ protected: virtual XclTbxEventType DoGetEventType() const; protected: + void ApplyGrouping( XclImpOptionButtonObj& rLeader, sal_Int32 nRefVal ); sal_uInt16 mnNextInGroup; /// Next option button in a group. sal_uInt16 mnFirstInGroup; /// 1 = Button is the first in a group. }; @@ -862,7 +866,8 @@ class XclImpPictureObj : public XclImpRectObj, public XclImpControlHelper { public: explicit XclImpPictureObj( const XclImpRoot& rRoot ); - + /** Returns the ObjectName - can use non-obvious lookup for override in the associated vba document module stream**/ + virtual String GetObjName() const; /** Returns the graphic imported from the IMGDATA record. */ inline const Graphic& GetGraphic() const { return maGraphic; } /** Returns the visible area of the imported graphic. */ @@ -1207,6 +1212,8 @@ private: /** Stores all drawing and OLE objects and additional data related to these objects. */ class XclImpObjectManager : protected XclImpRoot { +typedef std::hash_map< sal_Int32, String > CntrlObjIdToName; +typedef std::map< String, CntrlObjIdToName > CodeNameToCntrlObjIdInfo; public: explicit XclImpObjectManager( const XclImpRoot& rRoot ); virtual ~XclImpObjectManager(); @@ -1223,9 +1230,41 @@ public: String GetDefaultObjName( const XclImpDrawObjBase& rDrawObj ) const; /** Returns the used area in the sheet with the passed index. */ ScRange GetUsedArea( SCTAB nScTab ) const; + void SetOleNameOverrideInfo( const CodeNameToCntrlObjIdInfo& rOverrideInfo ) { maOleCtrlNameOverride = rOverrideInfo; } + String GetOleNameOverride( SCTAB nTab, sal_uInt16 nObjId ); + // ------------------------------------------------------------------------ +private: + + CodeNameToCntrlObjIdInfo maOleCtrlNameOverride; + + /** Reads and returns a bitmap from WMF/PICT format. */ + static void ReadWmf( Graphic& rGraphic, XclImpStream& rStrm ); + /** Reads and returns a bitmap from BMP format. */ + static void ReadBmp( Graphic& rGraphic, XclImpStream& rStrm ); + + /** Reads contents of an DFF record and append data to internal DFF stream. */ + void ReadDffRecord( XclImpStream& rStrm ); + /** Reads a BIFF8 OBJ record following an MSODRAWING record. */ + void ReadObj8( XclImpStream& rStrm ); + /** Reads the TXO record and following CONTINUE records containing string and formatting. */ + void ReadTxo( XclImpStream& rStrm ); + + /** Reads a BIFF3-BIFF5 NOTE record. */ + void ReadNote3( XclImpStream& rStrm ); + /** Reads a BIFF8 NOTE record. */ + void ReadNote8( XclImpStream& rStrm ); + + /** Returns the size of the progress bar shown while processing all objects. */ + sal_Size GetProgressSize() const; // ------------------------------------------------------------------------ private: + typedef ::std::map< sal_Size, XclImpDrawObjRef > XclImpObjMap; + typedef ::std::map< XclObjId, XclImpDrawObjRef > XclImpObjMapById; + typedef ScfRef< XclImpObjTextData > XclImpObjTextRef; + typedef ::std::map< sal_Size, XclImpObjTextRef > XclImpObjTextMap; + typedef ::std::vector< XclObjId > XclObjIdVec; + typedef ::std::map< sal_uInt16, String > DefObjNameMap; typedef ScfRef< XclImpSheetDrawing > XclImpSheetDrawingRef; typedef ::std::map< SCTAB, XclImpSheetDrawingRef > XclImpSheetDrawingMap; diff --git a/sc/source/filter/inc/xistyle.hxx b/sc/source/filter/inc/xistyle.hxx index a89122a7618a..d38fe6478512 100644 --- a/sc/source/filter/inc/xistyle.hxx +++ b/sc/source/filter/inc/xistyle.hxx @@ -70,8 +70,10 @@ public: void ReadPalette( XclImpStream& rStrm ); private: + void ExportPalette(); typedef ::std::vector< ColorData > ColorDataVec; ColorDataVec maColorTable; /// Colors read from file. + const XclImpRoot& mrRoot; }; // FONT record - font information ============================================= diff --git a/sc/source/filter/inc/xlescher.hxx b/sc/source/filter/inc/xlescher.hxx index 921da6b8741b..b1fe7410ecea 100644 --- a/sc/source/filter/inc/xlescher.hxx +++ b/sc/source/filter/inc/xlescher.hxx @@ -441,7 +441,7 @@ public: /** Tries to extract an Excel macro name from the passed macro descriptor. */ static String ExtractFromMacroDescriptor( const ::com::sun::star::script::ScriptEventDescriptor& rDescriptor, - XclTbxEventType eEventType ); + XclTbxEventType eEventType, SfxObjectShell* pShell = NULL ); }; // ============================================================================ diff --git a/sc/source/filter/inc/xlpage.hxx b/sc/source/filter/inc/xlpage.hxx index f6860595cd20..379d2a21e785 100644 --- a/sc/source/filter/inc/xlpage.hxx +++ b/sc/source/filter/inc/xlpage.hxx @@ -89,6 +89,7 @@ const sal_uInt16 EXC_SETUP_STARTPAGE = 0x0080; const sal_uInt16 EXC_SETUP_NOTES_END = 0x0200; const sal_uInt16 EXC_PAPERSIZE_DEFAULT = 0; +const sal_uInt16 EXC_PAPERSIZE_USER = 0xFFFF; // ============================================================================ @@ -118,6 +119,9 @@ struct XclPageData : ScfNoCopy double mfFtrLeftMargin; /// Left margin to footer. double mfFtrRightMargin; /// Right margin to footer. sal_uInt16 mnPaperSize; /// Index into paper size table. + sal_uInt16 mnStrictPaperSize; /// Same as papersize - but for ooxml (considering stricter dimensions) + sal_uInt16 mnPaperWidth; /// Paper Width in mm + sal_uInt16 mnPaperHeight; /// Paper Height in mm sal_uInt16 mnCopies; /// Number of copies. sal_uInt16 mnStartPage; /// Start page number. sal_uInt16 mnScaling; /// Scaling in percent. @@ -147,7 +151,7 @@ struct XclPageData : ScfNoCopy /** Returns the real paper size (twips) from the paper size index and paper orientation. */ Size GetScPaperSize() const; /** Sets the Excel paper size index and paper orientation from Calc paper size (twips). */ - void SetScPaperSize( const Size& rSize, bool bPortrait ); + void SetScPaperSize( const Size& rSize, bool bPortrait, bool bStrict = sal_False ); }; // ============================================================================ diff --git a/sc/source/filter/lotus/expop.cxx b/sc/source/filter/lotus/expop.cxx index 7ecc9127b49d..33ecf7d87d07 100644 --- a/sc/source/filter/lotus/expop.cxx +++ b/sc/source/filter/lotus/expop.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -410,3 +411,4 @@ FltError ExportWK1::Write() #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/lotus/export.cxx b/sc/source/filter/lotus/export.cxx index a9be45e24f23..5ca8cc7c6f49 100644 --- a/sc/source/filter/lotus/export.cxx +++ b/sc/source/filter/lotus/export.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -56,3 +57,4 @@ FltError ScFormatFilterPluginImpl::ScExportLotus123( SvStream& aStream, ScDocume #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/lotus/filter.cxx b/sc/source/filter/lotus/filter.cxx index 3a6e39b7d818..d521aec97315 100644 --- a/sc/source/filter/lotus/filter.cxx +++ b/sc/source/filter/lotus/filter.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -246,3 +247,4 @@ FltError ScImportLotus123old( SvStream& aStream, ScDocument* pDocument, CharSet } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/lotus/lotattr.cxx b/sc/source/filter/lotus/lotattr.cxx index c425760675f8..1644ee51856a 100644 --- a/sc/source/filter/lotus/lotattr.cxx +++ b/sc/source/filter/lotus/lotattr.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -298,3 +299,4 @@ void LotAttrTable::Apply( const SCTAB nTabNum ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/lotus/lotform.cxx b/sc/source/filter/lotus/lotform.cxx index e39891568e33..c307af332680 100644 --- a/sc/source/filter/lotus/lotform.cxx +++ b/sc/source/filter/lotus/lotform.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -2072,3 +2073,4 @@ DefTokenId lcl_KnownAddIn( const ByteString& sTest ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/lotus/lotimpop.cxx b/sc/source/filter/lotus/lotimpop.cxx index 2f6f81b7279c..a07998578f78 100644 --- a/sc/source/filter/lotus/lotimpop.cxx +++ b/sc/source/filter/lotus/lotimpop.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -471,3 +472,4 @@ void ImportLotus::_Row( const UINT16 nRecLen ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/lotus/lotread.cxx b/sc/source/filter/lotus/lotread.cxx index 917337fa91d5..ebd9f968686f 100644 --- a/sc/source/filter/lotus/lotread.cxx +++ b/sc/source/filter/lotus/lotread.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -322,3 +323,4 @@ FltError ImportLotus::Read( SvStream& rIn ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/lotus/lotus.cxx b/sc/source/filter/lotus/lotus.cxx index a1a428c5dbeb..8a9623057788 100644 --- a/sc/source/filter/lotus/lotus.cxx +++ b/sc/source/filter/lotus/lotus.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -100,3 +101,4 @@ FltError ScFormatFilterPluginImpl::ScImportLotus123( SfxMedium& rMedium, ScDocum return eRet; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/lotus/memory.cxx b/sc/source/filter/lotus/memory.cxx index 5731063e4cff..68b26befa1aa 100644 --- a/sc/source/filter/lotus/memory.cxx +++ b/sc/source/filter/lotus/memory.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -138,3 +139,4 @@ void MemDelete( void ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/lotus/op.cxx b/sc/source/filter/lotus/op.cxx index ce4d08b1b3ea..5d38852c2170 100644 --- a/sc/source/filter/lotus/op.cxx +++ b/sc/source/filter/lotus/op.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -665,3 +666,5 @@ void OP_ApplyPatternArea123( SvStream& rStream ) aLotusPatternPool.clear(); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/lotus/optab.cxx b/sc/source/filter/lotus/optab.cxx index 503d271a5b74..bf880614d48d 100644 --- a/sc/source/filter/lotus/optab.cxx +++ b/sc/source/filter/lotus/optab.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -246,3 +247,5 @@ OPCODE_FKT pOpFkt123[ FKT_LIMIT123 ] = NI // 100 }; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/lotus/tool.cxx b/sc/source/filter/lotus/tool.cxx index a375e60ea975..688334f5ec14 100644 --- a/sc/source/filter/lotus/tool.cxx +++ b/sc/source/filter/lotus/tool.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -650,3 +651,4 @@ BOOL RangeNameBufferWK3::FindAbs( const String& rRef, UINT16& rIndex ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/qpro/biff.cxx b/sc/source/filter/qpro/biff.cxx index 1d490358d315..b5bb830906bd 100644 --- a/sc/source/filter/qpro/biff.cxx +++ b/sc/source/filter/qpro/biff.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -102,3 +103,4 @@ bool ScBiffReader::nextRecord() return true; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/qpro/qpro.cxx b/sc/source/filter/qpro/qpro.cxx index 084aab135f70..320cf4bd819c 100644 --- a/sc/source/filter/qpro/qpro.cxx +++ b/sc/source/filter/qpro/qpro.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -228,3 +229,5 @@ void ScQProReader::readString( String &rString, sal_uInt16 nLength ) rString = String( pText, mpStream->GetStreamCharSet() ); delete [] pText; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/qpro/qproform.cxx b/sc/source/filter/qpro/qproform.cxx index 5d4045d6d9f2..b579dade9331 100644 --- a/sc/source/filter/qpro/qproform.cxx +++ b/sc/source/filter/qpro/qproform.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -744,3 +745,5 @@ const sal_Char* QProToSc::getString( sal_uInt8 nIndex ) } return pExtString; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/qpro/qprostyle.cxx b/sc/source/filter/qpro/qprostyle.cxx index 31003e1d6be8..5333c086c1a7 100644 --- a/sc/source/filter/qpro/qprostyle.cxx +++ b/sc/source/filter/qpro/qprostyle.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -166,3 +167,5 @@ void ScQProStyle::SetFormat( ScDocument *pDoc, sal_uInt8 nCol, sal_uInt16 nRow, pDoc->ApplyPattern( nCol, nRow, nTab, aPattern ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/rtf/eeimpars.cxx b/sc/source/filter/rtf/eeimpars.cxx index 05fdc294fc37..126ce0ef6865 100644 --- a/sc/source/filter/rtf/eeimpars.cxx +++ b/sc/source/filter/rtf/eeimpars.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -643,3 +644,4 @@ void ScEEParser::NewActEntry( ScEEParseEntry* pE ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/rtf/expbase.cxx b/sc/source/filter/rtf/expbase.cxx index cd3f30ef9c9f..4c0aa3a1619c 100644 --- a/sc/source/filter/rtf/expbase.cxx +++ b/sc/source/filter/rtf/expbase.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -105,3 +106,4 @@ ScFieldEditEngine& ScExportBase::GetEditEngine() const } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/rtf/rtfexp.cxx b/sc/source/filter/rtf/rtfexp.cxx index ef05ebed0238..c92d26d80197 100644 --- a/sc/source/filter/rtf/rtfexp.cxx +++ b/sc/source/filter/rtf/rtfexp.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -304,3 +305,4 @@ void ScRTFExport::WriteCell( SCTAB nTab, SCROW nRow, SCCOL nCol ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/rtf/rtfimp.cxx b/sc/source/filter/rtf/rtfimp.cxx index 83b48b1fa2b1..acf14f5620cc 100644 --- a/sc/source/filter/rtf/rtfimp.cxx +++ b/sc/source/filter/rtf/rtfimp.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -73,3 +74,4 @@ ScRTFImport::~ScRTFImport() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/rtf/rtfparse.cxx b/sc/source/filter/rtf/rtfparse.cxx index b3373bbf4596..b9db5db760f8 100644 --- a/sc/source/filter/rtf/rtfparse.cxx +++ b/sc/source/filter/rtf/rtfparse.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -418,3 +419,4 @@ void ScRTFParser::ProcToken( ImportInfo* pInfo ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/starcalc/scflt.cxx b/sc/source/filter/starcalc/scflt.cxx index 017c32c68745..4c7a019fd6a8 100644 --- a/sc/source/filter/starcalc/scflt.cxx +++ b/sc/source/filter/starcalc/scflt.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -2510,3 +2511,4 @@ FltError ScFormatFilterPluginImpl::ScImportStarCalc10( SvStream& rStream, ScDocu +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/starcalc/scfobj.cxx b/sc/source/filter/starcalc/scfobj.cxx index c0f575313459..536f0fd5b816 100644 --- a/sc/source/filter/starcalc/scfobj.cxx +++ b/sc/source/filter/starcalc/scfobj.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -102,3 +103,4 @@ void Sc10InsertObject::InsertChart( ScDocument* pDoc, SCTAB nDestTab, const Rect +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xcl97/XclExpChangeTrack.cxx b/sc/source/filter/xcl97/XclExpChangeTrack.cxx index 42cb37250c5c..daab6245d730 100644 --- a/sc/source/filter/xcl97/XclExpChangeTrack.cxx +++ b/sc/source/filter/xcl97/XclExpChangeTrack.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,12 +32,41 @@ //___________________________________________________________________ +#include <stdio.h> #include <sot/storage.hxx> #include "XclExpChangeTrack.hxx" #include "xeformula.hxx" #include "cell.hxx" #include "xcl97rec.hxx" +#include <oox/core/tokens.hxx> +#include <rtl/strbuf.hxx> + +using ::rtl::OUString; +using ::rtl::OString; +using ::rtl::OStringBuffer; + +static OString lcl_GuidToOString( sal_uInt8 aGuid[ 16 ] ) +{ + char sBuf[ 40 ]; + snprintf( sBuf, sizeof( sBuf ), + "{%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x}", + aGuid[ 0 ], aGuid[ 1 ], aGuid[ 2 ], aGuid[ 3 ], aGuid[ 4 ], aGuid[ 5 ], aGuid[ 6 ], aGuid[ 7 ], + aGuid[ 8 ], aGuid[ 9 ], aGuid[ 10 ], aGuid[ 11 ], aGuid[ 12 ], aGuid[ 13 ], aGuid[ 14 ], aGuid[ 15 ] ); + return OString( sBuf ); +} + +static OString lcl_DateTimeToOString( const DateTime& rDateTime ) +{ + char sBuf[ 200 ]; + snprintf( sBuf, sizeof( sBuf ), + "%d-%02d-%02dT%02d:%02d:%02d.%02dZ", + rDateTime.GetYear(), rDateTime.GetMonth(), rDateTime.GetDay(), + rDateTime.GetHour(), rDateTime.GetMin(), rDateTime.GetSec(), + rDateTime.Get100Sec() ); + return OString( sBuf ); +} + //___________________________________________________________________ // local functions @@ -354,6 +384,26 @@ sal_Size XclExpChTrHeader::GetLen() const return 50; } +void XclExpChTrHeader::SaveXml( XclExpXmlStream& rRevisionHeadersStrm ) +{ + sax_fastparser::FSHelperPtr pHeaders = rRevisionHeadersStrm.GetCurrentStream(); + rRevisionHeadersStrm.WriteAttributes( + XML_guid, lcl_GuidToOString( aGUID ).getStr(), + XML_lastGuid, NULL, // OOXTODO + XML_shared, NULL, // OOXTODO + XML_diskRevisions, NULL, // OOXTODO + XML_history, NULL, // OOXTODO + XML_trackRevisions, NULL, // OOXTODO + XML_exclusive, NULL, // OOXTODO + XML_revisionId, NULL, // OOXTODO + XML_version, NULL, // OOXTODO + XML_keepChangeHistory, NULL, // OOXTODO + XML_protected, NULL, // OOXTODO + XML_preserveHistory, NULL, // OOXTODO + FSEND ); + pHeaders->write( ">" ); +} + //___________________________________________________________________ XclExpChTrInfo::~XclExpChTrInfo() @@ -384,6 +434,33 @@ sal_Size XclExpChTrInfo::GetLen() const return 158; } +void XclExpChTrInfo::SaveXml( XclExpXmlStream& rRevisionHeadersStrm ) +{ + sax_fastparser::FSHelperPtr pHeader = rRevisionHeadersStrm.GetCurrentStream(); + + OUString sRelationshipId; + sax_fastparser::FSHelperPtr pRevisionLog = rRevisionHeadersStrm.CreateOutputStream( + XclXmlUtils::GetStreamName( "xl/revisions/", "revisionLog", mnLogNumber ), + XclXmlUtils::GetStreamName( NULL, "revisionLog", mnLogNumber ), + rRevisionHeadersStrm.GetCurrentStream()->getOutputStream(), + "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionLog+xml", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/revisionLog", + &sRelationshipId ); + + rRevisionHeadersStrm.WriteAttributes( + XML_guid, lcl_GuidToOString( aGUID ).getStr(), + XML_dateTime, lcl_DateTimeToOString( aDateTime ).getStr(), + XML_maxSheetId, NULL, // OOXTODO + XML_userName, XclXmlUtils::ToOString( sUsername ).getStr(), + FSNS( XML_r, XML_id ), XclXmlUtils::ToOString( sRelationshipId ).getStr(), + XML_minRId, NULL, // OOXTODO + XML_maxRId, NULL, // OOXTODO + FSEND ); + pHeader->write( ">" ); + + rRevisionHeadersStrm.PushStream( pRevisionLog ); +} + //___________________________________________________________________ XclExpChTrTabIdBuffer::XclExpChTrTabIdBuffer( sal_uInt16 nCount ) : @@ -466,8 +543,9 @@ XclExpChTrTabIdBufferList::~XclExpChTrTabIdBufferList() //___________________________________________________________________ -XclExpChTrTabId::XclExpChTrTabId( const XclExpChTrTabIdBuffer& rBuffer ) : - nTabCount( rBuffer.GetBufferCount() ) +XclExpChTrTabId::XclExpChTrTabId( const XclExpChTrTabIdBuffer& rBuffer, bool bInRevisionHeaders ) + : nTabCount( rBuffer.GetBufferCount() ) + , mbInRevisionHeaders( bInRevisionHeaders ) { pBuffer = new sal_uInt16[ nTabCount ]; rBuffer.GetBufferCopy( pBuffer ); @@ -507,6 +585,29 @@ sal_Size XclExpChTrTabId::GetLen() const return nTabCount << 1; } +void XclExpChTrTabId::SaveXml( XclExpXmlStream& rRevisionLogStrm ) +{ + if( !mbInRevisionHeaders ) + return; + + sax_fastparser::FSHelperPtr pRevisionLog = rRevisionLogStrm.GetCurrentStream(); + rRevisionLogStrm.PopStream(); + + sax_fastparser::FSHelperPtr pHeader = rRevisionLogStrm.GetCurrentStream(); + pHeader->startElement( XML_sheetIdMap, + XML_count, OString::valueOf( sal_Int32( nTabCount ) ).getStr(), + FSEND ); + for( int i = 0; i < nTabCount; ++i ) + { + pHeader->singleElement( XML_sheetId, + XML_val, OString::valueOf( sal_Int32( pBuffer[ i ] ) ).getStr(), + FSEND ); + } + pHeader->endElement( XML_sheetIdMap ); + + rRevisionLogStrm.PushStream( pRevisionLog ); +} + //___________________________________________________________________ // ! does not copy additional actions @@ -613,6 +714,7 @@ sal_Size XclExpChTrAction::GetLen() const XclExpChTrData::XclExpChTrData() : pString( NULL ), + mpFormulaCell( NULL ), fValue( 0.0 ), nRKValue( 0 ), nType( EXC_CHTR_TYPE_EMPTY ), @@ -628,6 +730,7 @@ XclExpChTrData::~XclExpChTrData() void XclExpChTrData::Clear() { DELETEZ( pString ); + mpFormulaCell = NULL; mxTokArr.reset(); maRefLog.clear(); fValue = 0.0; @@ -697,8 +800,8 @@ XclExpChTrCellContent::XclExpChTrCellContent( { sal_uInt32 nDummy32; sal_uInt16 nDummy16; - GetCellData( rAction.GetOldCell(), pOldData, nDummy32, nOldLength ); - GetCellData( rAction.GetNewCell(), pNewData, nLength, nDummy16 ); + GetCellData( rRoot, rAction.GetOldCell(), pOldData, nDummy32, nOldLength ); + GetCellData( rRoot, rAction.GetNewCell(), pNewData, nLength, nDummy16 ); } XclExpChTrCellContent::~XclExpChTrCellContent() @@ -718,6 +821,7 @@ void XclExpChTrCellContent::MakeEmptyChTrData( XclExpChTrData*& rpData ) } void XclExpChTrCellContent::GetCellData( + const XclExpRoot& rRoot, const ScBaseCell* pScCell, XclExpChTrData*& rpData, sal_uInt32& rXclLength1, @@ -760,9 +864,20 @@ void XclExpChTrCellContent::GetCellData( { String sCellStr; if( pScCell->GetCellType() == CELLTYPE_STRING ) - ((const ScStringCell*) pScCell)->GetString( sCellStr ); + { + const ScStringCell* pStrCell = static_cast< const ScStringCell* >( pScCell ); + pStrCell->GetString( sCellStr ); + rpData->mpFormattedString = XclExpStringHelper::CreateCellString( rRoot, + *pStrCell, NULL ); + } else - ((const ScEditCell*) pScCell)->GetString( sCellStr ); + { + const ScEditCell* pEditCell = static_cast< const ScEditCell* >( pScCell ); + pEditCell->GetString( sCellStr ); + XclExpHyperlinkHelper aLinkHelper( rRoot, aPosition ); + rpData->mpFormattedString = XclExpStringHelper::CreateCellString( rRoot, + *pEditCell, NULL, aLinkHelper ); + } rpData->pString = new XclExpString( sCellStr, EXC_STR_DEFAULT, 32766 ); rpData->nType = EXC_CHTR_TYPE_STRING; rpData->nSize = 3 + rpData->pString->GetSize(); @@ -773,6 +888,8 @@ void XclExpChTrCellContent::GetCellData( case CELLTYPE_FORMULA: { const ScFormulaCell* pFmlCell = (const ScFormulaCell*) pScCell; + rpData->mpFormulaCell = pFmlCell; + const ScTokenArray* pTokenArray = pFmlCell->GetCode(); if( pTokenArray ) { @@ -828,6 +945,105 @@ sal_Size XclExpChTrCellContent::GetActionByteCount() const return nLen; } +static const char* lcl_GetType( XclExpChTrData* pData ) +{ + switch( pData->nType ) + { + case EXC_CHTR_TYPE_RK: + case EXC_CHTR_TYPE_DOUBLE: + return "n"; + break; + case EXC_CHTR_TYPE_FORMULA: + { + ScFormulaCell* pFormulaCell = const_cast< ScFormulaCell* >( pData->mpFormulaCell ); + const char* sType; + OUString sValue; + XclXmlUtils::GetFormulaTypeAndValue( *pFormulaCell, sType, sValue ); + return sType; + } + break; + case EXC_CHTR_TYPE_STRING: + return "inlineStr"; + default: + return "*unknown*"; + } +} + +static void lcl_WriteCell( XclExpXmlStream& rStrm, sal_Int32 nElement, const ScAddress& rPosition, XclExpChTrData* pData ) +{ + sax_fastparser::FSHelperPtr pStream = rStrm.GetCurrentStream(); + + pStream->startElement( nElement, + XML_r, XclXmlUtils::ToOString( rPosition ).getStr(), + XML_s, NULL, // OOXTODO: not supported + XML_t, lcl_GetType( pData ), + XML_cm, NULL, // OOXTODO: not supported + XML_vm, NULL, // OOXTODO: not supported + XML_ph, NULL, // OOXTODO: not supported + FSEND ); + switch( pData->nType ) + { + case EXC_CHTR_TYPE_RK: + case EXC_CHTR_TYPE_DOUBLE: + pStream->startElement( XML_v, FSEND ); + pStream->write( pData->fValue ); + pStream->endElement( XML_v ); + break; + case EXC_CHTR_TYPE_FORMULA: + pStream->startElement( XML_f, + // OOXTODO: other attributes? see XclExpFormulaCell::SaveXml() + FSEND ); + pStream->writeEscaped( XclXmlUtils::ToOUString( + *pData->mpFormulaCell->GetDocument(), + pData->mpFormulaCell->aPos, pData->mpFormulaCell->GetCode() ) ); + pStream->endElement( XML_f ); + break; + case EXC_CHTR_TYPE_STRING: + pStream->startElement( XML_is, FSEND ); + if( pData->mpFormattedString.is() ) + pData->mpFormattedString->WriteXml( rStrm ); + else + pData->pString->WriteXml( rStrm ); + pStream->endElement( XML_is ); + break; + default: + // ignore + break; + } + pStream->endElement( nElement ); +} + +void XclExpChTrCellContent::SaveXml( XclExpXmlStream& rRevisionLogStrm ) +{ + sax_fastparser::FSHelperPtr pStream = rRevisionLogStrm.GetCurrentStream(); + pStream->startElement( XML_rcc, + XML_rId, OString::valueOf( (sal_Int32) GetActionNumber() ).getStr(), + XML_ua, XclXmlUtils::ToPsz( GetAccepted () ), // OOXTODO? bAccepted == ua or ra; not sure. + XML_ra, NULL, // OOXTODO: RRD.fUndoAction? Or RRD.fAccepted? + XML_sId, OString::valueOf( (sal_Int32) GetTabId( aPosition.Tab() ) ).getStr(), + XML_odxf, NULL, // OOXTODO: not supported + XML_xfDxf, NULL, // OOXTODO: not supported + XML_s, NULL, // OOXTODO: not supported + XML_dxf, NULL, // OOXTODO: not supported + XML_numFmtId, NULL, // OOXTODO: not supported + XML_quotePrefix, NULL, // OOXTODO: not supported + XML_oldQuotePrefix, NULL, // OOXTODO: not supported + XML_ph, NULL, // OOXTODO: not supported + XML_oldPh, NULL, // OOXTODO: not supported + XML_endOfListFormulaUpdate, NULL, // OOXTODO: not supported + FSEND ); + if( pOldData ) + { + lcl_WriteCell( rRevisionLogStrm, XML_oc, aPosition, pOldData ); + } + if( pNewData ) + { + lcl_WriteCell( rRevisionLogStrm, XML_nc, aPosition, pNewData ); + } + // OOXTODO: XML_odxf, XML_ndxf, XML_extLst elements + pStream->endElement( XML_rcc ); +} + //___________________________________________________________________ XclExpChTrInsert::XclExpChTrInsert( @@ -901,6 +1117,41 @@ sal_Size XclExpChTrInsert::GetActionByteCount() const return 16; } +static const char* lcl_GetAction( sal_uInt16 nOpCode ) +{ + switch( nOpCode ) + { + case EXC_CHTR_OP_INSCOL: return "insertCol"; + case EXC_CHTR_OP_INSROW: return "insertRow"; + case EXC_CHTR_OP_DELCOL: return "deleteCol"; + case EXC_CHTR_OP_DELROW: return "deleteRow"; + default: return "*unknown*"; + } +} + +void XclExpChTrInsert::SaveXml( XclExpXmlStream& rRevisionLogStrm ) +{ + sax_fastparser::FSHelperPtr pStream = rRevisionLogStrm.GetCurrentStream(); + pStream->startElement( XML_rrc, + XML_rId, OString::valueOf( (sal_Int32) GetActionNumber() ).getStr(), + XML_ua, XclXmlUtils::ToPsz( GetAccepted () ), // OOXTODO? bAccepted == ua or ra; not sure. + XML_ra, NULL, // OOXTODO: RRD.fUndoAction? Or RRD.fAccepted? + XML_sId, OString::valueOf( (sal_Int32) GetTabId( aRange.aStart.Tab() ) ).getStr(), + XML_eol, NULL, // OOXTODO: not supported? + XML_ref, XclXmlUtils::ToOString( aRange ).getStr(), + XML_action, lcl_GetAction( nOpCode ), + XML_edge, NULL, // OOXTODO: ??? + FSEND ); + // OOXTODO: does this handle XML_rfmt, XML_undo? + XclExpChTrAction* pAction = GetAddAction(); + while( pAction != NULL ) + { + pAction->SaveXml( rRevisionLogStrm ); + pAction = pAction->GetAddAction(); + } + pStream->endElement( XML_rrc ); +} + //___________________________________________________________________ XclExpChTrInsertTab::XclExpChTrInsertTab( @@ -938,6 +1189,19 @@ sal_Size XclExpChTrInsertTab::GetActionByteCount() const return 276; } +void XclExpChTrInsertTab::SaveXml( XclExpXmlStream& rStrm ) +{ + sax_fastparser::FSHelperPtr pStream = rStrm.GetCurrentStream(); + pStream->singleElement( XML_ris, + XML_rId, OString::valueOf( (sal_Int32) GetActionNumber() ).getStr(), + XML_ua, XclXmlUtils::ToPsz( GetAccepted () ), // OOXTODO? bAccepted == ua or ra; not sure. + XML_ra, NULL, // OOXTODO: RRD.fUndoAction? Or RRD.fAccepted? + XML_sheetId, OString::valueOf( (sal_Int32) GetTabId( nTab ) ).getStr(), + XML_name, XclXmlUtils::ToOString( GetTabInfo().GetScTabName( nTab ) ).getStr(), + XML_sheetPosition, OString::valueOf( (sal_Int32) nTab ).getStr(), + FSEND ); +} + //___________________________________________________________________ XclExpChTrMoveRange::XclExpChTrMoveRange( @@ -994,6 +1258,29 @@ sal_Size XclExpChTrMoveRange::GetActionByteCount() const return 24; } +void XclExpChTrMoveRange::SaveXml( XclExpXmlStream& rRevisionLogStrm ) +{ + sax_fastparser::FSHelperPtr pStream = rRevisionLogStrm.GetCurrentStream(); + + pStream->startElement( XML_rm, + XML_rId, OString::valueOf( (sal_Int32) GetActionNumber() ).getStr(), + XML_ua, XclXmlUtils::ToPsz( GetAccepted () ), // OOXTODO? bAccepted == ua or ra; not sure. + XML_ra, NULL, // OOXTODO: RRD.fUndoAction? Or RRD.fAccepted? + XML_sheetId, OString::valueOf( (sal_Int32) GetTabId( aDestRange.aStart.Tab() ) ).getStr(), + XML_source, XclXmlUtils::ToOString( aSourceRange ).getStr(), + XML_destination, XclXmlUtils::ToOString( aDestRange ).getStr(), + XML_sourceSheetId, OString::valueOf( (sal_Int32) GetTabId( aSourceRange.aStart.Tab() ) ).getStr(), + FSEND ); + // OOXTODO: does this handle XML_rfmt, XML_undo? + XclExpChTrAction* pAction = GetAddAction(); + while( pAction != NULL ) + { + pAction->SaveXml( rRevisionLogStrm ); + pAction = pAction->GetAddAction(); + } + pStream->endElement( XML_rm ); +} + //___________________________________________________________________ XclExpChTr0x014A::XclExpChTr0x014A( const XclExpChTrInsert& rAction ) : @@ -1025,6 +1312,23 @@ sal_Size XclExpChTr0x014A::GetActionByteCount() const return 14; } +void XclExpChTr0x014A::SaveXml( XclExpXmlStream& rStrm ) +{ + sax_fastparser::FSHelperPtr pStream = rStrm.GetCurrentStream(); + + pStream->startElement( XML_rfmt, + XML_sheetId, OString::valueOf( (sal_Int32) GetTabId( aRange.aStart.Tab() ) ).getStr(), + XML_xfDxf, NULL, // OOXTODO: not supported + XML_s, NULL, // OOXTODO: style + XML_sqref, XclXmlUtils::ToOString( aRange ).getStr(), + XML_start, NULL, // OOXTODO: for string changes + XML_length, NULL, // OOXTODO: for string changes + FSEND ); + // OOXTODO: XML_dxf, XML_extLst + + pStream->endElement( XML_rfmt ); +} + //___________________________________________________________________ XclExpChTrActionStack::~XclExpChTrActionStack() @@ -1061,8 +1365,99 @@ void XclExpChTrRecordList::Save( XclExpStream& rStrm ) pRec->Save( rStrm ); } +void XclExpChTrRecordList::SaveXml( XclExpXmlStream& rStrm ) +{ + for( ExcRecord* pRec = First(); pRec; pRec = Next() ) + pRec->SaveXml( rStrm ); +} + //___________________________________________________________________ +class ExcXmlRecord : public ExcRecord +{ +public: + virtual sal_Size GetLen() const; + virtual UINT16 GetNum() const; + virtual void Save( XclExpStream& rStrm ); + virtual void SaveXml( XclExpXmlStream& rStrm ) = 0; +}; + +sal_Size ExcXmlRecord::GetLen() const +{ + return 0; +} + +UINT16 ExcXmlRecord::GetNum() const +{ + return 0; +} + +void ExcXmlRecord::Save( XclExpStream& ) +{ + // Do nothing; ignored for BIFF output. +} + +class StartXmlElement : public ExcXmlRecord +{ +public: + enum Behavior { + CLOSE_ELEMENT = 0x1, + WRITE_NAMESPACES = 0x2, + }; + StartXmlElement( sal_Int32 nElement, sal_Int32 eBehavior ) + : mnElement( nElement ), meBehavior( (Behavior) eBehavior ) {} + virtual void SaveXml( XclExpXmlStream& rStrm ); +private: + sal_Int32 mnElement; + Behavior meBehavior; +}; + +void StartXmlElement::SaveXml( XclExpXmlStream& rStrm ) +{ + sax_fastparser::FSHelperPtr pStream = rStrm.GetCurrentStream(); + pStream->write( "<" ) + ->writeId( mnElement ); + if( meBehavior & WRITE_NAMESPACES ) + { + rStrm.WriteAttributes( + XML_xmlns, "http://schemas.openxmlformats.org/spreadsheetml/2006/main", + FSNS( XML_xmlns, XML_r ), "http://schemas.openxmlformats.org/officeDocument/2006/relationships", + FSEND ); + } + if( meBehavior & CLOSE_ELEMENT ) + { + pStream->write( ">" ); + } +} + +class EndXmlElement : public ExcXmlRecord +{ + sal_Int32 mnElement; +public: + EndXmlElement( sal_Int32 nElement ) : mnElement( nElement) {} + virtual void SaveXml( XclExpXmlStream& rStrm ); +}; + +void EndXmlElement::SaveXml( XclExpXmlStream& rStrm ) +{ + rStrm.GetCurrentStream()->endElement( mnElement ); +} + +class EndHeaderElement : public EndXmlElement +{ +public: + EndHeaderElement() : EndXmlElement( XML_header ) {} + virtual void SaveXml( XclExpXmlStream& rStrm ); +}; + +void EndHeaderElement::SaveXml( XclExpXmlStream& rStrm ) +{ + // Remove the `xl/revisions/revisionLogX.xml' file from the stack + rStrm.PopStream(); + + EndXmlElement::SaveXml( rStrm ); +} + XclExpChangeTrack::XclExpChangeTrack( const XclExpRoot& rRoot ) : XclExpRoot( rRoot ), aRecList(), @@ -1110,6 +1505,7 @@ XclExpChangeTrack::XclExpChangeTrack( const XclExpRoot& rRoot ) : // build record list pHeader = new XclExpChTrHeader; + aRecList.Append( new StartXmlElement( XML_headers, StartXmlElement::WRITE_NAMESPACES ) ); aRecList.Append( pHeader ); aRecList.Append( new XclExpChTr0x0195 ); aRecList.Append( new XclExpChTr0x0194( *pTempChangeTrack ) ); @@ -1117,17 +1513,27 @@ XclExpChangeTrack::XclExpChangeTrack( const XclExpRoot& rRoot ) : String sLastUsername; DateTime aLastDateTime; sal_uInt32 nIndex = 1; + sal_Int32 nLogNumber = 1; while( XclExpChTrAction* pAction = aActionStack.Pop() ) { if( (nIndex == 1) || pAction->ForceInfoRecord() || (pAction->GetUsername() != sLastUsername) || (pAction->GetDateTime() != aLastDateTime) ) { + if( nIndex != 1 ) + { + aRecList.Append( new EndXmlElement( XML_revisions ) ); + aRecList.Append( new EndHeaderElement() ); + } + lcl_GenerateGUID( aGUID, bValidGUID ); sLastUsername = pAction->GetUsername(); aLastDateTime = pAction->GetDateTime(); - aRecList.Append( new XclExpChTrInfo( sLastUsername, aLastDateTime, aGUID ) ); - aRecList.Append( new XclExpChTrTabId( pAction->GetTabIdBuffer() ) ); + + aRecList.Append( new StartXmlElement( XML_header, 0 ) ); + aRecList.Append( new XclExpChTrInfo( sLastUsername, aLastDateTime, aGUID, nLogNumber++ ) ); + aRecList.Append( new XclExpChTrTabId( pAction->GetTabIdBuffer(), true ) ); + aRecList.Append( new StartXmlElement( XML_revisions, StartXmlElement::WRITE_NAMESPACES | StartXmlElement::CLOSE_ELEMENT ) ); pHeader->SetGUID( aGUID ); } pAction->SetIndex( nIndex ); @@ -1136,6 +1542,12 @@ XclExpChangeTrack::XclExpChangeTrack( const XclExpRoot& rRoot ) : pHeader->SetGUID( aGUID ); pHeader->SetCount( nIndex - 1 ); + if( nLogNumber > 1 ) + { + aRecList.Append( new EndXmlElement( XML_revisions ) ); + aRecList.Append( new EndHeaderElement() ); + } + aRecList.Append( new EndXmlElement( XML_headers ) ); aRecList.Append( new ExcEof ); } @@ -1246,3 +1658,46 @@ void XclExpChangeTrack::Write() } } +static void lcl_WriteUserNamesXml( XclExpXmlStream& rWorkbookStrm ) +{ + sax_fastparser::FSHelperPtr pUserNames = rWorkbookStrm.CreateOutputStream( + OUString::createFromAscii( "xl/revisions/userNames.xml" ), + OUString::createFromAscii( "revisions/userNames.xml" ), + rWorkbookStrm.GetCurrentStream()->getOutputStream(), + "application/vnd.openxmlformats-officedocument.spreadsheetml.userNames+xml", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/usernames" ); + pUserNames->startElement( XML_users, + XML_xmlns, "http://schemas.openxmlformats.org/spreadsheetml/2006/main", + FSNS( XML_xmlns, XML_r ), "http://schemas.openxmlformats.org/officeDocument/2006/relationships", + XML_count, "0", + FSEND ); + // OOXTODO: XML_userinfo elements for each user editing the file + // Doesn't seem to be supported by .xls output either (based on + // contents of XclExpChangeTrack::WriteUserNamesStream()). + pUserNames->endElement( XML_users ); +} + +void XclExpChangeTrack::WriteXml( XclExpXmlStream& rWorkbookStrm ) +{ + if( !aRecList.Count() ) + return; + + lcl_WriteUserNamesXml( rWorkbookStrm ); + + sax_fastparser::FSHelperPtr pRevisionHeaders = rWorkbookStrm.CreateOutputStream( + OUString::createFromAscii( "xl/revisions/revisionHeaders.xml" ), + OUString::createFromAscii( "revisions/revisionHeaders.xml" ), + rWorkbookStrm.GetCurrentStream()->getOutputStream(), + "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionHeaders+xml", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/revisionHeaders" ); + // OOXTODO: XML_userinfo elements for each user editing the file + // Doesn't seem to be supported by .xls output either (based on + // contents of XclExpChangeTrack::WriteUserNamesStream()). + rWorkbookStrm.PushStream( pRevisionHeaders ); + + aRecList.SaveXml( rWorkbookStrm ); + + rWorkbookStrm.PopStream(); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xcl97/XclImpChangeTrack.cxx b/sc/source/filter/xcl97/XclImpChangeTrack.cxx index 96a301e1bef5..c20fba217513 100644 --- a/sc/source/filter/xcl97/XclImpChangeTrack.cxx +++ b/sc/source/filter/xcl97/XclImpChangeTrack.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -500,3 +501,4 @@ bool XclImpChTrFmlConverter::Read3DTabReference( UINT16 /*nIxti*/, SCTAB& rFirst return rChangeTrack.Read3DTabRefInfo( rFirstTab, rLastTab, rExtInfo ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xcl97/xcl97dum.cxx b/sc/source/filter/xcl97/xcl97dum.cxx index 1550fa97ed40..8340ce397ffa 100644 --- a/sc/source/filter/xcl97/xcl97dum.cxx +++ b/sc/source/filter/xcl97/xcl97dum.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -161,3 +162,4 @@ const BYTE* ExcDummy8_02::GetData() const return pMyData; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xcl97/xcl97esc.cxx b/sc/source/filter/xcl97/xcl97esc.cxx index a7c6dee67dc5..8f4674cb7e44 100644 --- a/sc/source/filter/xcl97/xcl97esc.cxx +++ b/sc/source/filter/xcl97/xcl97esc.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -54,6 +55,9 @@ #include "global.hxx" #include "document.hxx" #include "drwlayer.hxx" +#include "xecontent.hxx" +#include <editeng/flditem.hxx> +#include "userdat.hxx" #include "xcl97rec.hxx" #include "xehelper.hxx" #include "xechart.hxx" @@ -210,7 +214,7 @@ EscherExHostAppData* XclEscherEx::StartShape( const Reference< XShape >& rxShape pCurrAppData = new XclEscherHostAppData; SdrObject* pObj = GetSdrObjectFromXShape( rxShape ); if ( !pObj ) - pCurrXclObj = new XclObjAny( mrObjMgr ); // just what is it?!? + pCurrXclObj = new XclObjAny( mrObjMgr, rxShape ); // just what is it?!? else { pCurrXclObj = NULL; @@ -235,10 +239,10 @@ EscherExHostAppData* XclEscherEx::StartShape( const Reference< XShape >& rxShape pCurrXclObj = new XclObjOle( mrObjMgr, *pObj ); } else // just a metafile - pCurrXclObj = new XclObjAny( mrObjMgr ); + pCurrXclObj = new XclObjAny( mrObjMgr, rxShape ); } else - pCurrXclObj = new XclObjAny( mrObjMgr ); + pCurrXclObj = new XclObjAny( mrObjMgr, rxShape ); } else if( nObjType == OBJ_UNO ) { @@ -250,13 +254,14 @@ EscherExHostAppData* XclEscherEx::StartShape( const Reference< XShape >& rxShape pCurrXclObj = CreateCtrlObj( rxShape, pChildAnchor ); #endif if( !pCurrXclObj ) - pCurrXclObj = new XclObjAny( mrObjMgr ); // just a metafile + pCurrXclObj = new XclObjAny( mrObjMgr, rxShape ); // just a metafile } else if( !ScDrawLayer::IsNoteCaption( pObj ) ) { // #107540# ignore permanent note shapes // #i12190# do not ignore callouts (do not filter by object type ID) - pCurrXclObj = new XclObjAny( mrObjMgr ); // just a metafile + pCurrXclObj = ShapeInteractionHelper::CreateShapeObj( mrObjMgr, rxShape ); + ShapeInteractionHelper::PopulateShapeInteractionInfo( mrObjMgr, rxShape, *pCurrAppData ); } } if ( pCurrXclObj ) @@ -359,7 +364,6 @@ EscherExHostAppData* XclEscherEx::EnterAdditionalTextGroup() return pCurrAppData; } - void XclEscherEx::EndDocument() { if( mbIsRootDff ) @@ -478,6 +482,7 @@ void XclEscherEx::DeleteCurrAppData() delete pCurrAppData->GetClientAnchor(); // delete pCurrAppData->GetClientData(); delete pCurrAppData->GetClientTextbox(); + delete pCurrAppData->GetInteractionInfo(); delete pCurrAppData; } } @@ -509,4 +514,41 @@ void XclEscherClientTextbox::WriteData( EscherEx& /*rEx*/ ) const pXclObj->SetText( GetRoot(), rTextObj ); } +XclExpShapeObj* +ShapeInteractionHelper::CreateShapeObj( XclExpObjectManager& rObjMgr, const Reference< XShape >& xShape ) +{ + return new XclExpShapeObj( rObjMgr, xShape ); +} + +void +ShapeInteractionHelper::PopulateShapeInteractionInfo( XclExpObjectManager& rObjMgr, const Reference< XShape >& xShape, EscherExHostAppData& rHostAppData ) +{ + try + { + SvMemoryStream* pMemStrm = NULL; + rtl::OUString sHyperLink; + rtl::OUString sMacro; + if ( ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( ::GetSdrObjectFromXShape( xShape ) ) ) + { + sHyperLink = pInfo->GetHlink(); + sMacro = pInfo->GetMacro(); + } + if ( sHyperLink.getLength() > 0 ) + { + pMemStrm = new SvMemoryStream(); + XclExpStream tmpStream( *pMemStrm, rObjMgr.GetRoot() ); + ScAddress dummyAddress; + SvxURLField aUrlField; + aUrlField.SetURL( sHyperLink ); + XclExpHyperlink hExpHlink( rObjMgr.GetRoot(), aUrlField, dummyAddress ); + hExpHlink.WriteEmbeddedData( tmpStream ); + } + if ( ( sHyperLink.getLength() > 0 ) || ( sMacro.getLength() > 0 ) ) + rHostAppData.SetInteractionInfo( new InteractionInfo( pMemStrm, true ) ); + } + catch( Exception& ) + { + } +} +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx index df6bdcbbe671..059ba71f0337 100644 --- a/sc/source/filter/xcl97/xcl97rec.cxx +++ b/sc/source/filter/xcl97/xcl97rec.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -77,22 +78,34 @@ #include "patattr.hxx" #include "tabprotection.hxx" +#include <com/sun/star/sheet/XCellAddressable.hpp> +#include <com/sun/star/sheet/XCellRangeAddressable.hpp> #include <oox/core/tokens.hxx> +#include <oox/export/shapes.hxx> +#include <oox/export/utils.hxx> +#include <oox/export/vmlexport.hxx> using ::rtl::OString; using ::rtl::OUString; using namespace ::com::sun::star; using ::com::sun::star::uno::Reference; +using ::oox::drawingml::DrawingML; using ::com::sun::star::uno::UNO_QUERY; using ::com::sun::star::beans::XPropertySet; using ::com::sun::star::drawing::XShape; +using ::oox::drawingml::ShapeExport; +using ::oox::vml::VMLExport; // ============================================================================ +sal_Int32 XclExpObjList::mnDrawingMLCount; +sal_Int32 XclExpObjList::mnVmlCount; + XclExpObjList::XclExpObjList( const XclExpRoot& rRoot, XclEscherEx& rEscherEx ) : XclExpRoot( rRoot ), mrEscherEx( rEscherEx ), - pSolverContainer( 0 ) + pSolverContainer( 0 ), + mnScTab( rRoot.GetCurrScTab() ) { pMsodrawingPerSheet = new XclExpMsoDrawing( rEscherEx ); // open the DGCONTAINER and the patriarch group shape @@ -118,6 +131,7 @@ UINT16 XclExpObjList::Add( XclObj* pObj ) Insert( pObj, LIST_APPEND ); UINT16 nCnt = (UINT16) Count(); pObj->SetId( nCnt ); + pObj->SetTab( mnScTab ); return nCnt; } else @@ -149,6 +163,128 @@ void XclExpObjList::Save( XclExpStream& rStrm ) pSolverContainer->Save( rStrm ); } +static bool IsVmlObject( const XclObj& rObj ) +{ + switch( rObj.GetObjType() ) + { + case EXC_OBJTYPE_NOTE: + return true; + default: + return false; + } +} + + +static sal_Int32 GetVmlObjectCount( XclExpObjList& rList ) +{ + sal_Int32 nNumVml = 0; + + for ( XclObj* p = rList.First(); p; p = rList.Next() ) + if( IsVmlObject( *p ) ) + ++nNumVml; + + return nNumVml; +} + + +static void SaveDrawingMLObjects( XclExpObjList& rList, XclExpXmlStream& rStrm, sal_Int32& nDrawingMLCount ) +{ + sal_Int32 nVmlObjects = GetVmlObjectCount( rList ); + if( (rList.Count() - nVmlObjects) == 0 ) + return; + + sal_Int32 nDrawing = ++nDrawingMLCount; + OUString sId; + sax_fastparser::FSHelperPtr pDrawing = rStrm.CreateOutputStream( + XclXmlUtils::GetStreamName( "xl/", "drawings/drawing", nDrawing ), + XclXmlUtils::GetStreamName( "../", "drawings/drawing", nDrawing ), + rStrm.GetCurrentStream()->getOutputStream(), + "application/vnd.openxmlformats-officedocument.drawing+xml", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing", + &sId ); + + rStrm.GetCurrentStream()->singleElement( XML_drawing, + FSNS( XML_r, XML_id ), XclXmlUtils::ToOString( sId ).getStr(), + FSEND ); + + rStrm.PushStream( pDrawing ); + pDrawing->startElement( FSNS( XML_xdr, XML_wsDr ), + FSNS( XML_xmlns, XML_xdr ), "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing", + FSNS( XML_xmlns, XML_a ), "http://schemas.openxmlformats.org/drawingml/2006/main", + FSNS( XML_xmlns, XML_r ), "http://schemas.openxmlformats.org/officeDocument/2006/relationships", + FSEND ); + + for ( XclObj* p = rList.First(); p; p = rList.Next() ) + { + if( IsVmlObject( *p ) ) + continue; + p->SaveXml( rStrm ); + } + + pDrawing->endElement( FSNS( XML_xdr, XML_wsDr ) ); + + rStrm.PopStream(); +} + + +static void SaveVmlObjects( XclExpObjList& rList, XclExpXmlStream& rStrm, sal_Int32& nVmlCount ) +{ + if( GetVmlObjectCount( rList ) == 0 ) + return; + + sal_Int32 nDrawing = ++nVmlCount; + OUString sId; + sax_fastparser::FSHelperPtr pVmlDrawing = rStrm.CreateOutputStream( + XclXmlUtils::GetStreamName( "xl/", "drawings/vmlDrawing", nDrawing ), + XclXmlUtils::GetStreamName( "../", "drawings/vmlDrawing", nDrawing ), + rStrm.GetCurrentStream()->getOutputStream(), + "application/vnd.openxmlformats-officedocument.vmlDrawing", + "http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing", + &sId ); + + rStrm.GetCurrentStream()->singleElement( XML_legacyDrawing, + FSNS( XML_r, XML_id ), XclXmlUtils::ToOString( sId ).getStr(), + FSEND ); + + rStrm.PushStream( pVmlDrawing ); + pVmlDrawing->startElement( XML_xml, + FSNS( XML_xmlns, XML_v ), "urn:schemas-microsoft-com:vml", + FSNS( XML_xmlns, XML_o ), "urn:schemas-microsoft-com:office:office", + FSNS( XML_xmlns, XML_x ), "urn:schemas-microsoft-com:office:excel", + FSEND ); + + for ( XclObj* p = rList.First(); p; p = rList.Next() ) + { + if( !IsVmlObject( *p ) ) + continue; + p->SaveXml( rStrm ); + } + + pVmlDrawing->endElement( XML_xml ); + + rStrm.PopStream(); +} + + +void XclExpObjList::SaveXml( XclExpXmlStream& rStrm ) +{ + if( pSolverContainer ) + pSolverContainer->SaveXml( rStrm ); + + if( Count() == 0 ) + return; + + SaveDrawingMLObjects( *this, rStrm, mnDrawingMLCount ); + SaveVmlObjects( *this, rStrm, mnVmlCount ); +} + + +void XclExpObjList::ResetCounters() +{ + mnDrawingMLCount = 0; + mnVmlCount = 0; +} + // --- class XclObj -------------------------------------------------- XclObj::XclObj( XclExpObjectManager& rObjMgr, sal_uInt16 nObjType, bool bOwnEscher ) : @@ -286,69 +422,78 @@ void XclObj::SaveTextRecs( XclExpStream& rStrm ) pTxo->Save( rStrm ); } -// --- class XclObjComment ------------------------------------------- + // --- class XclObjComment ------------------------------------------ -XclObjComment::XclObjComment( XclExpObjectManager& rObjMgr, const Rectangle& rRect, const EditTextObject& rEditObj, SdrObject* pCaption, bool bVisible ) : +XclObjComment::XclObjComment( XclExpObjectManager& rObjMgr, const Rectangle& rRect, const EditTextObject& rEditObj, SdrCaptionObj* pCaption, bool bVisible, const ScAddress& rAddress ) : XclObj( rObjMgr, EXC_OBJTYPE_NOTE, true ) + , maScPos( rAddress ) + , mpCaption( static_cast< SdrCaptionObj* >( pCaption->Clone() ) ) + , mbVisible( bVisible ) { ProcessEscherObj( rObjMgr.GetRoot(), rRect, pCaption, bVisible); // TXO pTxo = new XclTxo( rObjMgr.GetRoot(), rEditObj, pCaption ); } -void XclObjComment::ProcessEscherObj( const XclExpRoot& rRoot, const Rectangle& rRect, SdrObject* pCaption, const bool bVisible ) +static void lcl_FillProps( EscherPropertyContainer& rPropOpt, SdrObject* pCaption, bool bVisible ) { - Reference<XShape> aXShape; - EscherPropertyContainer aPropOpt; - - if(pCaption) + if( pCaption ) { - aXShape = GetXShapeForSdrObject(pCaption); + Reference< XShape > aXShape = GetXShapeForSdrObject( pCaption ); Reference< XPropertySet > aXPropSet( aXShape, UNO_QUERY ); if( aXPropSet.is() ) { - aPropOpt.CreateFillProperties( aXPropSet, sal_True); + rPropOpt.CreateFillProperties( aXPropSet, sal_True); - aPropOpt.AddOpt( ESCHER_Prop_lTxid, 0 ); // undocumented - aPropOpt.AddOpt( 0x0158, 0x00000000 ); // undocumented + rPropOpt.AddOpt( ESCHER_Prop_lTxid, 0 ); // undocumented + rPropOpt.AddOpt( 0x0158, 0x00000000 ); // undocumented sal_uInt32 nValue = 0; - if(!aPropOpt.GetOpt( ESCHER_Prop_FitTextToShape, nValue )) - aPropOpt.AddOpt( ESCHER_Prop_FitTextToShape, 0x00080008 ); // bool field + if( !rPropOpt.GetOpt( ESCHER_Prop_FitTextToShape, nValue ) ) + rPropOpt.AddOpt( ESCHER_Prop_FitTextToShape, 0x00080008 ); // bool field - if(aPropOpt.GetOpt( ESCHER_Prop_fillColor, nValue )) + if( rPropOpt.GetOpt( ESCHER_Prop_fillColor, nValue ) ) { // If the Colour is the same as the 'ToolTip' System colour then // use the default rather than the explicit colour value. This will // be incorrect where user has chosen to use this colour explicity. Color aColor = Color( (BYTE)nValue, (BYTE)( nValue >> 8 ), (BYTE)( nValue >> 16 ) ); const StyleSettings& rSett = Application::GetSettings().GetStyleSettings(); - if(aColor == rSett.GetHelpColor().GetColor()) + if( aColor == rSett.GetHelpColor().GetColor() ) { - aPropOpt.AddOpt( ESCHER_Prop_fillColor, 0x08000050 ); - aPropOpt.AddOpt( ESCHER_Prop_fillBackColor, 0x08000050 ); + rPropOpt.AddOpt( ESCHER_Prop_fillColor, 0x08000050 ); + rPropOpt.AddOpt( ESCHER_Prop_fillBackColor, 0x08000050 ); } } else - aPropOpt.AddOpt( ESCHER_Prop_fillColor, 0x08000050 ); - - if(!aPropOpt.GetOpt( ESCHER_Prop_fillBackColor, nValue )) - aPropOpt.AddOpt( ESCHER_Prop_fillBackColor, 0x08000050 ); - if(!aPropOpt.GetOpt( ESCHER_Prop_fNoFillHitTest, nValue )) - aPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x00110010 ); // bool field - if(!aPropOpt.GetOpt( ESCHER_Prop_shadowColor, nValue )) - aPropOpt.AddOpt( ESCHER_Prop_shadowColor, 0x00000000 ); - if(!aPropOpt.GetOpt( ESCHER_Prop_fshadowObscured, nValue )) // bool field - aPropOpt.AddOpt( ESCHER_Prop_fshadowObscured, 0x00030003 ); // bool field + rPropOpt.AddOpt( ESCHER_Prop_fillColor, 0x08000050 ); + + if( !rPropOpt.GetOpt( ESCHER_Prop_fillBackColor, nValue ) ) + rPropOpt.AddOpt( ESCHER_Prop_fillBackColor, 0x08000050 ); + if( !rPropOpt.GetOpt( ESCHER_Prop_fNoFillHitTest, nValue ) ) + rPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x00110010 ); // bool field + if( !rPropOpt.GetOpt( ESCHER_Prop_shadowColor, nValue ) ) + rPropOpt.AddOpt( ESCHER_Prop_shadowColor, 0x00000000 ); + if( !rPropOpt.GetOpt( ESCHER_Prop_fshadowObscured, nValue ) ) // bool field + rPropOpt.AddOpt( ESCHER_Prop_fshadowObscured, 0x00030003 ); // bool field } } + sal_uInt32 nFlags = 0x000A0000; + ::set_flag( nFlags, sal_uInt32(2), !bVisible ); + rPropOpt.AddOpt( ESCHER_Prop_fPrint, nFlags ); // bool field +} + +void XclObjComment::ProcessEscherObj( const XclExpRoot& rRoot, const Rectangle& rRect, SdrObject* pCaption, const bool bVisible ) +{ + EscherPropertyContainer aPropOpt; + + + lcl_FillProps( aPropOpt, pCaption, bVisible ); + nGrbit = 0; // all off: AutoLine, AutoFill, Printable, Locked mrEscherEx.OpenContainer( ESCHER_SpContainer ); mrEscherEx.AddShape( ESCHER_ShpInst_TextBox, SHAPEFLAG_HAVEANCHOR | SHAPEFLAG_HAVESPT ); - sal_uInt32 nFlags = 0x000A0000; - ::set_flag( nFlags, sal_uInt32(2), !bVisible ); - aPropOpt.AddOpt( ESCHER_Prop_fPrint, nFlags ); // bool field aPropOpt.Commit( mrEscherEx.GetStream() ); XclExpDffNoteAnchor( rRoot, rRect ).WriteDffData( mrEscherEx ); @@ -374,6 +519,72 @@ void XclObjComment::Save( XclExpStream& rStrm ) XclObj::Save( rStrm ); } +class VmlCommentExporter : public VMLExport +{ + ScAddress maScPos; + SdrCaptionObj* mpCaption; + bool mbVisible; +public: + VmlCommentExporter ( sax_fastparser::FSHelperPtr p, ScAddress aScPos, SdrCaptionObj* pCaption, bool bVisible ); +protected: + virtual void Commit( EscherPropertyContainer& rProps, const Rectangle& rRect ); + virtual sal_Int32 StartShape(); + virtual void EndShape( sal_Int32 nShapeElement ); +}; + + +VmlCommentExporter::VmlCommentExporter( sax_fastparser::FSHelperPtr p, ScAddress aScPos, SdrCaptionObj* pCaption, bool bVisible ) + : VMLExport( p ) + , maScPos( aScPos ) + , mpCaption( pCaption ) + , mbVisible( bVisible ) +{ +} + +void VmlCommentExporter::Commit( EscherPropertyContainer& rProps, const Rectangle& rRect ) +{ + lcl_FillProps( rProps, mpCaption, mbVisible ); + rProps.AddOpt( ESCHER_Prop_fHidden, 1 ); // bool field + + VMLExport::Commit( rProps, rRect ); +} + +sal_Int32 VmlCommentExporter::StartShape() +{ + AddShapeAttribute( XML_type, OString( "#_x0000_t202") ); + + sal_Int32 nId = VMLExport::StartShape(); + + return nId; +} + +void VmlCommentExporter::EndShape( sal_Int32 nShapeElement ) +{ + sax_fastparser::FSHelperPtr pVmlDrawing = GetFS(); + + pVmlDrawing->startElement( FSNS( XML_x, XML_ClientData ), + XML_ObjectType, "Note", + FSEND ); + pVmlDrawing->singleElement( FSNS( XML_x, XML_MoveWithCells ), + FSEND ); + pVmlDrawing->singleElement( FSNS( XML_x, XML_SizeWithCells ), + FSEND ); + XclXmlUtils::WriteElement( pVmlDrawing, FSNS( XML_x, XML_Anchor ), "2, 15, 0, 15, 4, 31, 4, 21" ); + XclXmlUtils::WriteElement( pVmlDrawing, FSNS( XML_x, XML_AutoFill ), "False" ); + XclXmlUtils::WriteElement( pVmlDrawing, FSNS( XML_x, XML_Row ), maScPos.Row() ); + XclXmlUtils::WriteElement( pVmlDrawing, FSNS( XML_x, XML_Column ), sal_Int32( maScPos.Col() ) ); + pVmlDrawing->endElement( FSNS( XML_x, XML_ClientData ) ); + + VMLExport::EndShape( nShapeElement ); +} + +void XclObjComment::SaveXml( XclExpXmlStream& rStrm ) +{ + VmlCommentExporter aCommentExporter( rStrm.GetCurrentStream(), maScPos, mpCaption.get(), mbVisible ); + aCommentExporter.AddSdrObject( *mpCaption ); +} + + // --- class XclObjDropDown ------------------------------------------ XclObjDropDown::XclObjDropDown( XclExpObjectManager& rObjMgr, const ScAddress& rPos, BOOL bFilt ) : @@ -672,8 +883,9 @@ void XclObjOle::Save( XclExpStream& rStrm ) // --- class XclObjAny ------------------------------------------- -XclObjAny::XclObjAny( XclExpObjectManager& rObjMgr ) : - XclObj( rObjMgr, EXC_OBJTYPE_UNKNOWN ) +XclObjAny::XclObjAny( XclExpObjectManager& rObjMgr, const Reference< XShape >& rShape ) + : XclObj( rObjMgr, EXC_OBJTYPE_UNKNOWN ) + , mxShape( rShape ) { } @@ -710,6 +922,120 @@ ExcBof8_Base::ExcBof8_Base() nLowestBiffVer = 0x00000006; // Biff8 } +static void +WriteFromTo( XclExpXmlStream& rStrm, const XclObjAny& rObj ) +{ + sax_fastparser::FSHelperPtr pDrawing = rStrm.GetCurrentStream(); + + awt::Point aTopLeft = rObj.GetShape()->getPosition(); + awt::Size aSize = rObj.GetShape()->getSize(); + Rectangle aLocation( aTopLeft.X, aTopLeft.Y, aTopLeft.X + aSize.Width, aTopLeft.Y + aSize.Height ); + ScRange aRange = rStrm.GetRoot().GetDoc().GetRange( rObj.GetTab(), aLocation ); + Rectangle aRangeRect = rStrm.GetRoot().GetDoc().GetMMRect( aRange.aStart.Col(), aRange.aStart.Row(), + aRange.aEnd.Col()-1, aRange.aEnd.Row()-1, + rObj.GetTab() ); + + + pDrawing->startElement( FSNS( XML_xdr, XML_from ), + FSEND ); + XclXmlUtils::WriteElement( pDrawing, FSNS( XML_xdr, XML_col ), (sal_Int32) aRange.aStart.Col() ); + XclXmlUtils::WriteElement( pDrawing, FSNS( XML_xdr, XML_colOff ), + MM100toEMU( aLocation.Left() - aRangeRect.Left() ) ); + XclXmlUtils::WriteElement( pDrawing, FSNS( XML_xdr, XML_row ), (sal_Int32) aRange.aStart.Row() ); + XclXmlUtils::WriteElement( pDrawing, FSNS( XML_xdr, XML_rowOff ), + MM100toEMU( aLocation.Top() - aRangeRect.Top() ) ); + pDrawing->endElement( FSNS( XML_xdr, XML_from ) ); + + pDrawing->startElement( FSNS( XML_xdr, XML_to ), + FSEND ); + XclXmlUtils::WriteElement( pDrawing, FSNS( XML_xdr, XML_col ), (sal_Int32) aRange.aEnd.Col() ); + XclXmlUtils::WriteElement( pDrawing, FSNS( XML_xdr, XML_colOff ), + MM100toEMU( aLocation.Right() - aRangeRect.Right() ) ); + XclXmlUtils::WriteElement( pDrawing, FSNS( XML_xdr, XML_row ), (sal_Int32) aRange.aEnd.Row() ); + XclXmlUtils::WriteElement( pDrawing, FSNS( XML_xdr, XML_rowOff ), + MM100toEMU( aLocation.Bottom() - aRangeRect.Bottom() ) ); + pDrawing->endElement( FSNS( XML_xdr, XML_to ) ); +} + +static void +WritePicPr( sax_fastparser::FSHelperPtr pDrawing, sal_Int32 nId, Reference< XPropertySet > xPropSet ) +{ + pDrawing->startElement( FSNS( XML_xdr, XML_nvPicPr ), + FSEND ); + OUString sName, sDescr; + xPropSet->getPropertyValue( XclXmlUtils::ToOUString( "Name" ) ) >>= sName; + xPropSet->getPropertyValue( XclXmlUtils::ToOUString( "Description" ) ) >>= sDescr; + pDrawing->singleElement( FSNS( XML_xdr, XML_cNvPr ), + XML_id, OString::valueOf( nId ).getStr(), + XML_name, XclXmlUtils::ToOString( sName ).getStr(), + XML_descr, XclXmlUtils::ToOString( sDescr ).getStr(), + FSEND ); + // OOXTODO: //xdr:cNvPr children: XML_extLst, XML_hlinkClick, XML_hlinkHover + pDrawing->startElement( FSNS( XML_xdr, XML_cNvPicPr ), + // OOXTODO: FSNS( XML_xdr, XML_preferRelativeSize ) + FSEND ); + // OOXTODO: XML_extLst + pDrawing->singleElement( FSNS( XML_a, XML_picLocks ), + // OOXTODO: XML_noGrp, + // OOXTODO: XML_noSelect, + // OOXTODO: XML_noRot, + // OOXTODO: XML_noChangeAspect, + // OOXTODO: XML_noMove, + // OOXTODO: XML_noResize, + // OOXTODO: XML_noEditPoints, + // OOXTODO: XML_noAdjustHandles, + // OOXTODO: XML_noChangeArrowheads, + // OOXTODO: XML_noChangeShapeType, + // OOXTODO: XML_noCrop, + FSEND ); + pDrawing->endElement( FSNS( XML_xdr, XML_cNvPicPr ) ); + pDrawing->endElement( FSNS( XML_xdr, XML_nvPicPr ) ); +} + + +static const char* +GetEditAs( XclObjAny& rObj ) +{ + if( const SdrObject* pShape = EscherEx::GetSdrObject( rObj.GetShape() ) ) + { + // OOXTODO: returning "twoCell" + switch( ScDrawLayer::GetAnchor( pShape ) ) + { + case SCA_CELL: return "oneCell"; + default: break; + } + } + return "absolute"; +} + + +void XclObjAny::SaveXml( XclExpXmlStream& rStrm ) +{ + if( !mxShape.is() ) + return; + + sax_fastparser::FSHelperPtr pDrawing = rStrm.GetCurrentStream(); + + ShapeExport aDML( XML_xdr, pDrawing, &rStrm, DrawingML::DOCUMENT_XLSX ); + + pDrawing->startElement( FSNS( XML_xdr, XML_twoCellAnchor ), // OOXTODO: oneCellAnchor, absoluteAnchor + XML_editAs, GetEditAs( *this ), + FSEND ); + Reference< XPropertySet > xPropSet( mxShape, UNO_QUERY ); + if (xPropSet.is()) + { + WriteFromTo( rStrm, *this ); + aDML.WriteShape( mxShape ); + } + + pDrawing->singleElement( FSNS( XML_xdr, XML_clientData), + // OOXTODO: XML_fLocksWithSheet + // OOXTODO: XML_fPrintsWithSheet + FSEND ); + pDrawing->endElement( FSNS( XML_xdr, XML_twoCellAnchor ) ); +} + + void ExcBof8_Base::SaveCont( XclExpStream& rStrm ) { @@ -1446,3 +1772,4 @@ void XclRefmode::SaveXml( XclExpXmlStream& rStrm ) FSEND ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/XMLCalculationSettingsContext.cxx b/sc/source/filter/xml/XMLCalculationSettingsContext.cxx index b124e77ac745..98d7a41da7c7 100644 --- a/sc/source/filter/xml/XMLCalculationSettingsContext.cxx +++ b/sc/source/filter/xml/XMLCalculationSettingsContext.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -271,3 +272,5 @@ SvXMLImportContext *ScXMLIterationContext::CreateChildContext( USHORT nPrefix, void ScXMLIterationContext::EndElement() { } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/XMLCellRangeSourceContext.cxx b/sc/source/filter/xml/XMLCellRangeSourceContext.cxx index 9826e8385075..6b9bed748fb6 100644 --- a/sc/source/filter/xml/XMLCellRangeSourceContext.cxx +++ b/sc/source/filter/xml/XMLCellRangeSourceContext.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -131,3 +132,4 @@ void ScXMLCellRangeSourceContext::EndElement() { } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx b/sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx index 5cd97e0714a9..9f129bd160dd 100644 --- a/sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx +++ b/sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -815,3 +816,5 @@ void ScChangeTrackingExportHelper::CollectAndWriteChanges() } } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx b/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx index d928444dd8ce..65294d496d87 100644 --- a/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx +++ b/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -933,3 +934,5 @@ void ScXMLChangeTrackingImportHelper::CreateChangeTrack(ScDocument* pTempDoc) pDoc->SetChangeTrack(pTrack); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/XMLCodeNameProvider.cxx b/sc/source/filter/xml/XMLCodeNameProvider.cxx index 4cb9d9ab629e..2f971e547abf 100644 --- a/sc/source/filter/xml/XMLCodeNameProvider.cxx +++ b/sc/source/filter/xml/XMLCodeNameProvider.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -202,3 +203,5 @@ void XMLCodeNameProvider::set( const uno::Reference< container::XNameAccess>& xN } } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/XMLColumnRowGroupExport.cxx b/sc/source/filter/xml/XMLColumnRowGroupExport.cxx index 4c2929de02e3..bc53d9a373b2 100644 --- a/sc/source/filter/xml/XMLColumnRowGroupExport.cxx +++ b/sc/source/filter/xml/XMLColumnRowGroupExport.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -185,3 +186,4 @@ void ScMyOpenCloseColumnRowGroup::Sort() aTableEnd.sort(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/XMLConsolidationContext.cxx b/sc/source/filter/xml/XMLConsolidationContext.cxx index 0ca5fc360533..f075dfc68129 100644 --- a/sc/source/filter/xml/XMLConsolidationContext.cxx +++ b/sc/source/filter/xml/XMLConsolidationContext.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -158,3 +159,4 @@ void ScXMLConsolidationContext::EndElement() GetScImport().UnlockSolarMutex(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/XMLConverter.cxx b/sc/source/filter/xml/XMLConverter.cxx index bceb030957ee..ee6a345fdc11 100644 --- a/sc/source/filter/xml/XMLConverter.cxx +++ b/sc/source/filter/xml/XMLConverter.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -661,3 +662,4 @@ bool lclSkipEmptyParentheses( const sal_Unicode*& rpcString, const sal_Unicode* // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/XMLDDELinksContext.cxx b/sc/source/filter/xml/XMLDDELinksContext.cxx index d7fafe1d9423..c7e3923337da 100644 --- a/sc/source/filter/xml/XMLDDELinksContext.cxx +++ b/sc/source/filter/xml/XMLDDELinksContext.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -488,3 +489,5 @@ void ScXMLDDECellContext::EndElement() for(sal_Int32 i = 0; i < nCells; ++i) pDDELink->AddCellToRow(aCell); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/XMLDetectiveContext.cxx b/sc/source/filter/xml/XMLDetectiveContext.cxx index c127ca518266..131dea72379d 100644 --- a/sc/source/filter/xml/XMLDetectiveContext.cxx +++ b/sc/source/filter/xml/XMLDetectiveContext.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -263,3 +264,4 @@ void ScXMLDetectiveOperationContext::EndElement() GetScImport().GetDetectiveOpArray()->AddDetectiveOp( aDetectiveOp ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/XMLEmptyContext.cxx b/sc/source/filter/xml/XMLEmptyContext.cxx index dbba2732ecee..20bec1f097b2 100644 --- a/sc/source/filter/xml/XMLEmptyContext.cxx +++ b/sc/source/filter/xml/XMLEmptyContext.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -61,3 +62,5 @@ SvXMLImportContext *ScXMLEmptyContext::CreateChildContext( USHORT nPrefix, void ScXMLEmptyContext::EndElement() { } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/XMLExportDDELinks.cxx b/sc/source/filter/xml/XMLExportDDELinks.cxx index a29394bf850b..f0b80840098c 100644 --- a/sc/source/filter/xml/XMLExportDDELinks.cxx +++ b/sc/source/filter/xml/XMLExportDDELinks.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -219,3 +220,5 @@ void ScXMLExportDDELinks::WriteDDELinks(uno::Reference<sheet::XSpreadsheetDocume } } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/XMLExportDataPilot.cxx b/sc/source/filter/xml/XMLExportDataPilot.cxx index de39b168524a..0bfdafc4d566 100644 --- a/sc/source/filter/xml/XMLExportDataPilot.cxx +++ b/sc/source/filter/xml/XMLExportDataPilot.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -899,3 +900,5 @@ void ScXMLExportDataPilot::WriteDataPilots(const uno::Reference <sheet::XSpreads } } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/XMLExportDatabaseRanges.cxx b/sc/source/filter/xml/XMLExportDatabaseRanges.cxx index 3c7ee76c41e8..530ea31e47c7 100644 --- a/sc/source/filter/xml/XMLExportDatabaseRanges.cxx +++ b/sc/source/filter/xml/XMLExportDatabaseRanges.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -697,3 +698,5 @@ void ScXMLExportDatabaseRanges::WriteDatabaseRanges(const com::sun::star::uno::R } } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/XMLExportIterator.cxx b/sc/source/filter/xml/XMLExportIterator.cxx index 154fdebed95e..57b2534ed6ad 100644 --- a/sc/source/filter/xml/XMLExportIterator.cxx +++ b/sc/source/filter/xml/XMLExportIterator.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -890,3 +891,4 @@ sal_Bool ScMyNotEmptyCellsIterator::GetNext(ScMyCell& aCell, ScFormatRangeStyles return bFoundCell; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/XMLExportSharedData.cxx b/sc/source/filter/xml/XMLExportSharedData.cxx index eede3aa73499..a3e4d3ae80b5 100644 --- a/sc/source/filter/xml/XMLExportSharedData.cxx +++ b/sc/source/filter/xml/XMLExportSharedData.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -161,3 +162,5 @@ void ScMySharedData::SortNoteShapes() if (pNoteShapes) pNoteShapes->Sort(); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/XMLStylesExportHelper.cxx b/sc/source/filter/xml/XMLStylesExportHelper.cxx index 66f3ea613a3a..79c0d24eb1f8 100644 --- a/sc/source/filter/xml/XMLStylesExportHelper.cxx +++ b/sc/source/filter/xml/XMLStylesExportHelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1265,3 +1266,5 @@ rtl::OUString* ScRowStyles::GetStyleName(const sal_Int32 nTable, const sal_Int32 { return GetStyleNameByIndex(GetStyleNameIndex(nTable, nField)); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/XMLStylesImportHelper.cxx b/sc/source/filter/xml/XMLStylesImportHelper.cxx index 3bbff0c320c2..a7b91742f979 100644 --- a/sc/source/filter/xml/XMLStylesImportHelper.cxx +++ b/sc/source/filter/xml/XMLStylesImportHelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -625,3 +626,4 @@ void ScMyStylesImportHelper::SetStylesToRanges() nMaxRanges = 0; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx b/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx index fb0b1235007e..defb99bcde38 100644 --- a/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx +++ b/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -266,3 +267,5 @@ void XMLHeaderFooterRegionContext::EndElement() if (xOldTextCursor.is()) GetImport().GetTextImport()->SetCursor(xOldTextCursor); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/XMLTableMasterPageExport.cxx b/sc/source/filter/xml/XMLTableMasterPageExport.cxx index 91f27ab646a7..aeb0444ae2a5 100644 --- a/sc/source/filter/xml/XMLTableMasterPageExport.cxx +++ b/sc/source/filter/xml/XMLTableMasterPageExport.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -176,3 +177,4 @@ void XMLTableMasterPageExport::exportMasterPageContent( } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/XMLTableShapeImportHelper.cxx b/sc/source/filter/xml/XMLTableShapeImportHelper.cxx index cc425e0f4d65..ff50e7264fea 100644 --- a/sc/source/filter/xml/XMLTableShapeImportHelper.cxx +++ b/sc/source/filter/xml/XMLTableShapeImportHelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -213,3 +214,5 @@ void XMLTableShapeImportHelper::finishShape( static_cast<ScXMLImport&>(mrImporter).UnlockSolarMutex(); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/XMLTableShapeResizer.cxx b/sc/source/filter/xml/XMLTableShapeResizer.cxx index 415057c219f2..23e72c369267 100644 --- a/sc/source/filter/xml/XMLTableShapeResizer.cxx +++ b/sc/source/filter/xml/XMLTableShapeResizer.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -383,3 +384,5 @@ void ScMyShapeResizer::ResizeShapes() } } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/XMLTableShapesContext.cxx b/sc/source/filter/xml/XMLTableShapesContext.cxx index d841e1c4c748..2421bb785870 100644 --- a/sc/source/filter/xml/XMLTableShapesContext.cxx +++ b/sc/source/filter/xml/XMLTableShapesContext.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -85,3 +86,4 @@ void ScXMLTableShapesContext::EndElement() { } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/XMLTableSourceContext.cxx b/sc/source/filter/xml/XMLTableSourceContext.cxx index 00f5c9184a53..9cc6d9a7090a 100644 --- a/sc/source/filter/xml/XMLTableSourceContext.cxx +++ b/sc/source/filter/xml/XMLTableSourceContext.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -144,3 +145,4 @@ void ScXMLTableSourceContext::EndElement() } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/XMLTextPContext.cxx b/sc/source/filter/xml/XMLTextPContext.cxx index d6d02567b9bd..724a87a65626 100644 --- a/sc/source/filter/xml/XMLTextPContext.cxx +++ b/sc/source/filter/xml/XMLTextPContext.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -222,3 +223,4 @@ void ScXMLTextPContext::EndElement() } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/XMLTrackedChangesContext.cxx b/sc/source/filter/xml/XMLTrackedChangesContext.cxx index cf415142213a..ba9e508d50b3 100644 --- a/sc/source/filter/xml/XMLTrackedChangesContext.cxx +++ b/sc/source/filter/xml/XMLTrackedChangesContext.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -2023,3 +2024,4 @@ void ScXMLRejectionContext::EndElement() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/sheetdata.cxx b/sc/source/filter/xml/sheetdata.cxx index 947c1370fa4b..a5bf3515fe84 100644 --- a/sc/source/filter/xml/sheetdata.cxx +++ b/sc/source/filter/xml/sheetdata.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -281,3 +282,4 @@ void ScSheetSaveData::SetInSupportedSave( bool bSet ) mbInSupportedSave = bSet; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/xmlannoi.cxx b/sc/source/filter/xml/xmlannoi.cxx index 8db7a554256c..6fcb70393eec 100644 --- a/sc/source/filter/xml/xmlannoi.cxx +++ b/sc/source/filter/xml/xmlannoi.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -219,3 +220,4 @@ void ScXMLAnnotationContext::AddContentStyle( sal_uInt16 nFamily, const rtl::OUS mrAnnotationData.maContentStyles.push_back( ScXMLAnnotationStyleEntry( nFamily, rName, rSelection ) ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/xmlbodyi.cxx b/sc/source/filter/xml/xmlbodyi.cxx index a00f56e7d718..1048952c29c3 100644 --- a/sc/source/filter/xml/xmlbodyi.cxx +++ b/sc/source/filter/xml/xmlbodyi.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -342,3 +343,4 @@ void ScXMLBodyContext::EndElement() GetScImport().UnlockSolarMutex(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index ae5a7bcebe66..d0cbf9610383 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1125,3 +1126,5 @@ void ScXMLTableRowCellContext::EndElement() nMergedRows = 1; nCellsRepeated = 1; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/xmlcoli.cxx b/sc/source/filter/xml/xmlcoli.cxx index 6ea5b0192ab2..4b05c89dc4e2 100644 --- a/sc/source/filter/xml/xmlcoli.cxx +++ b/sc/source/filter/xml/xmlcoli.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -331,3 +332,5 @@ void ScXMLTableColsContext::EndElement() } } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/xmlconti.cxx b/sc/source/filter/xml/xmlconti.cxx index 3a0f5ef3126e..dfb34beab24c 100644 --- a/sc/source/filter/xml/xmlconti.cxx +++ b/sc/source/filter/xml/xmlconti.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -105,3 +106,5 @@ void ScXMLContentContext::EndElement() { sValue.append(sOUText); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/xmlcvali.cxx b/sc/source/filter/xml/xmlcvali.cxx index 451b085afe9e..40f1a00000a0 100644 --- a/sc/source/filter/xml/xmlcvali.cxx +++ b/sc/source/filter/xml/xmlcvali.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -694,3 +695,5 @@ void ScXMLErrorMacroContext::EndElement() { pValidationContext->SetErrorMacro( bExecute ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/xmldpimp.cxx b/sc/source/filter/xml/xmldpimp.cxx index 855fbcfefdf1..1f2e2db5f254 100644 --- a/sc/source/filter/xml/xmldpimp.cxx +++ b/sc/source/filter/xml/xmldpimp.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1838,3 +1839,5 @@ void ScXMLDataPilotGroupMemberContext::EndElement() if (sName.getLength()) pDataPilotGroup->AddMember(sName); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/xmldrani.cxx b/sc/source/filter/xml/xmldrani.cxx index c5731dfc28fb..33c19be9a824 100644 --- a/sc/source/filter/xml/xmldrani.cxx +++ b/sc/source/filter/xml/xmldrani.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -989,3 +990,4 @@ void ScXMLSubTotalFieldContext::EndElement() pSubTotalRuleContext->AddSubTotalColumn(aSubTotalColumn); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 6a72dfbc60fb..9f6a57cd7615 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -3204,7 +3205,34 @@ void ScXMLExport::ExportShape(const uno::Reference < drawing::XShape >& xShape, } } if (!bIsChart) + { + // #i66550 HLINK_FOR_SHAPES + rtl::OUString sHlink; + uno::Reference< beans::XPropertySet > xProps( xShape, uno::UNO_QUERY ); + if ( xProps.is() ) + xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_HYPERLINK ) ) ) >>= sHlink; + + std::auto_ptr< SvXMLElementExport > pDrawA; + // enlose shapes with <draw:a> element only if sHlink contains something + if ( sHlink.getLength() > 0 ) + { + // need to get delete the attributes that are pre-loaded + // for the shape export ( otherwise they will become + // attributes of the draw:a element ) This *shouldn't* + // affect performance adversely as there are only a + // couple of attributes involved + uno::Reference< xml::sax::XAttributeList > xSaveAttribs( new SvXMLAttributeList( GetAttrList() ) ); + ClearAttrList(); + // Add Hlink + AddAttribute( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE ); + AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, sHlink); + pDrawA.reset( new SvXMLElementExport( *this, XML_NAMESPACE_DRAW, XML_A, sal_False, sal_False ) ); + // Attribute list has been cleared by previous operation + // re-add pre-loaded attributes + AddAttributeList( xSaveAttribs ); + } GetShapeExport()->exportShape(xShape, SEF_DEFAULT, pPoint); + } IncrementProgressBar(sal_False); } @@ -4565,3 +4593,4 @@ void ScXMLExport::DisposingModel() xCurrentTable = 0; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/xmlexternaltabi.cxx b/sc/source/filter/xml/xmlexternaltabi.cxx index 083a73d81872..73c00cdc136b 100644 --- a/sc/source/filter/xml/xmlexternaltabi.cxx +++ b/sc/source/filter/xml/xmlexternaltabi.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -435,3 +436,5 @@ void ScXMLExternalRefCellTextContext::EndElement() { mrParent.SetCellString(maCellStrBuf.makeStringAndClear()); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/xmlfilti.cxx b/sc/source/filter/xml/xmlfilti.cxx index 55670d97637d..f30c4a87c5e7 100644 --- a/sc/source/filter/xml/xmlfilti.cxx +++ b/sc/source/filter/xml/xmlfilti.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -783,3 +784,4 @@ void ScXMLDPConditionContext::EndElement() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/xmlfonte.cxx b/sc/source/filter/xml/xmlfonte.cxx index 5cbb2604581f..ec9715c7131a 100644 --- a/sc/source/filter/xml/xmlfonte.cxx +++ b/sc/source/filter/xml/xmlfonte.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -150,3 +151,5 @@ XMLFontAutoStylePool* ScXMLExport::CreateFontAutoStylePool() { return new ScXMLFontAutoStylePool_Impl( *this ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index 33adf81a7d61..826edfac6895 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -3069,3 +3070,4 @@ void ScXMLImport::ExtractFormulaNamespaceGrammar( reGrammar = eDefaultGrammar; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/xmllabri.cxx b/sc/source/filter/xml/xmllabri.cxx index 70ec803cc46f..777190445f6e 100644 --- a/sc/source/filter/xml/xmllabri.cxx +++ b/sc/source/filter/xml/xmllabri.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -143,3 +144,4 @@ void ScXMLLabelRangeContext::EndElement() GetScImport().AddLabelRange(pLabelRange); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/xmlnexpi.cxx b/sc/source/filter/xml/xmlnexpi.cxx index 3ef17c321f23..4d81085bcdfd 100644 --- a/sc/source/filter/xml/xmlnexpi.cxx +++ b/sc/source/filter/xml/xmlnexpi.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -248,3 +249,4 @@ void ScXMLNamedExpressionContext::EndElement() { } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/xmlrowi.cxx b/sc/source/filter/xml/xmlrowi.cxx index 341445431cc8..b1daf5d18575 100644 --- a/sc/source/filter/xml/xmlrowi.cxx +++ b/sc/source/filter/xml/xmlrowi.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -358,3 +359,5 @@ void ScXMLTableRowsContext::EndElement() } } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/xmlsceni.cxx b/sc/source/filter/xml/xmlsceni.cxx index 652dd0a1dd43..047e275587e8 100644 --- a/sc/source/filter/xml/xmlsceni.cxx +++ b/sc/source/filter/xml/xmlsceni.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -171,3 +172,4 @@ void ScXMLTableScenarioContext::EndElement() } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/xmlsorti.cxx b/sc/source/filter/xml/xmlsorti.cxx index ff007240b12b..bf1f0427854d 100644 --- a/sc/source/filter/xml/xmlsorti.cxx +++ b/sc/source/filter/xml/xmlsorti.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -277,3 +278,4 @@ void ScXMLSortByContext::EndElement() pSortContext->AddSortField(sFieldNumber, sDataType, sOrder); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/xmlstyle.cxx b/sc/source/filter/xml/xmlstyle.cxx index bd48092f33f5..f686ed36bf9b 100644 --- a/sc/source/filter/xml/xmlstyle.cxx +++ b/sc/source/filter/xml/xmlstyle.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1975,3 +1976,5 @@ sal_Bool XmlScPropHdl_Vertical::exportXML( return bRetval; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/xmlstyli.cxx b/sc/source/filter/xml/xmlstyli.cxx index 9114c3c5707b..942151f50b78 100644 --- a/sc/source/filter/xml/xmlstyli.cxx +++ b/sc/source/filter/xml/xmlstyli.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1087,3 +1088,4 @@ void ScCellTextStyleContext::FillPropertySet( const uno::Reference<beans::XPrope } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/xmlsubti.cxx b/sc/source/filter/xml/xmlsubti.cxx index 7a6bf5a411af..d3e949acabd0 100644 --- a/sc/source/filter/xml/xmlsubti.cxx +++ b/sc/source/filter/xml/xmlsubti.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -842,3 +843,5 @@ void ScMyTables::SetMatrix(const table::CellRangeAddress& rRange, const rtl::OUS } } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/xmltabi.cxx b/sc/source/filter/xml/xmltabi.cxx index c3a766419152..01e613b1ea74 100644 --- a/sc/source/filter/xml/xmltabi.cxx +++ b/sc/source/filter/xml/xmltabi.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -489,3 +490,5 @@ SvXMLImportContext* ScXMLTableProtectionContext::CreateChildContext( void ScXMLTableProtectionContext::EndElement() { } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx index 0d7e5bcc7d11..0cb99a066b1d 100644 --- a/sc/source/filter/xml/xmlwrap.cxx +++ b/sc/source/filter/xml/xmlwrap.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -993,3 +994,4 @@ sal_Bool ScXMLImportWrapper::Export(sal_Bool bStylesOnly) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/Accessibility/AccessibilityHints.cxx b/sc/source/ui/Accessibility/AccessibilityHints.cxx index 6c276b806e88..d0b9d3192da6 100644 --- a/sc/source/ui/Accessibility/AccessibilityHints.cxx +++ b/sc/source/ui/Accessibility/AccessibilityHints.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -110,3 +111,5 @@ ScAccGridWinFocusGotHint::ScAccGridWinFocusGotHint(ScSplitPos eNew, ScAccGridWinFocusGotHint::~ScAccGridWinFocusGotHint() { } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/Accessibility/AccessibleCell.cxx b/sc/source/ui/Accessibility/AccessibleCell.cxx index a49ae24a970a..9d16743c4057 100644 --- a/sc/source/ui/Accessibility/AccessibleCell.cxx +++ b/sc/source/ui/Accessibility/AccessibleCell.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -451,3 +452,5 @@ void ScAccessibleCell::AddRelation(const ScRange& rRange, pRelationSet->AddRelation(aRelation); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/Accessibility/AccessibleCellBase.cxx b/sc/source/ui/Accessibility/AccessibleCellBase.cxx index 800b398710ae..75a853433d69 100644 --- a/sc/source/ui/Accessibility/AccessibleCellBase.cxx +++ b/sc/source/ui/Accessibility/AccessibleCellBase.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -337,3 +338,5 @@ sal_Bool ScAccessibleCellBase::IsEditable( bEditable = sal_True; return bEditable; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/Accessibility/AccessibleContextBase.cxx b/sc/source/ui/Accessibility/AccessibleContextBase.cxx index 1d1ad0a50550..c5a79d90604d 100644 --- a/sc/source/ui/Accessibility/AccessibleContextBase.cxx +++ b/sc/source/ui/Accessibility/AccessibleContextBase.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -622,3 +623,4 @@ void ScAccessibleContextBase::IsObjectValid() const throw lang::DisposedException(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx index b6a48ca53316..6a279f61d281 100644 --- a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx +++ b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1672,3 +1673,4 @@ Rectangle ScAccessibleCsvCell::implGetBoundingBox() const // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx b/sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx index 2063eac08663..51cadd4aed98 100644 --- a/sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx +++ b/sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -731,3 +732,5 @@ Rectangle ScAccessibleDataPilotButton::GetBoundingBox(void) const else return Rectangle(); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx index b2772cfbb92a..e27e135499b2 100644 --- a/sc/source/ui/Accessibility/AccessibleDocument.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -2110,3 +2111,5 @@ rtl::OUString ScAccessibleDocument::GetCurrentCellDescription() const { return rtl::OUString(); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/Accessibility/AccessibleDocumentBase.cxx b/sc/source/ui/Accessibility/AccessibleDocumentBase.cxx index 179e8ab2278a..6c48fbffb388 100644 --- a/sc/source/ui/Accessibility/AccessibleDocumentBase.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocumentBase.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -47,3 +48,5 @@ ScAccessibleDocumentBase::ScAccessibleDocumentBase( ScAccessibleDocumentBase::~ScAccessibleDocumentBase(void) { } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx index c3caf93b007d..9f2f0cab1749 100644 --- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1886,3 +1887,5 @@ ScShapeChilds* ScAccessibleDocumentPagePreview::GetShapeChilds() return mpShapeChilds; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/Accessibility/AccessibleEditObject.cxx b/sc/source/ui/Accessibility/AccessibleEditObject.cxx index 04df409a76bb..e91abb2524e9 100644 --- a/sc/source/ui/Accessibility/AccessibleEditObject.cxx +++ b/sc/source/ui/Accessibility/AccessibleEditObject.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -350,3 +351,4 @@ void ScAccessibleEditObject::CreateTextHelper() } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx b/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx index 02fb5c12463e..89dd008480a7 100644 --- a/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx +++ b/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -396,3 +397,5 @@ void ScAccessibleFilterMenu::updateStates() if (isSelected()) p->insert(SELECTED); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx b/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx index 0da1e6858a75..1c70ee6ba5c5 100644 --- a/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx +++ b/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -203,3 +204,4 @@ void ScAccessibleFilterMenuItem::updateStateSet() p->insert(SELECTED); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/Accessibility/AccessibleFilterTopWindow.cxx b/sc/source/ui/Accessibility/AccessibleFilterTopWindow.cxx index 2af69faa33c8..fb649eba5f4f 100644 --- a/sc/source/ui/Accessibility/AccessibleFilterTopWindow.cxx +++ b/sc/source/ui/Accessibility/AccessibleFilterTopWindow.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -125,3 +126,4 @@ void ScAccessibleFilterTopWindow::setAccessibleChild( } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/Accessibility/AccessibleGlobal.cxx b/sc/source/ui/Accessibility/AccessibleGlobal.cxx index ac2562fa9bd5..2ddc53694c89 100644 --- a/sc/source/ui/Accessibility/AccessibleGlobal.cxx +++ b/sc/source/ui/Accessibility/AccessibleGlobal.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -93,3 +94,4 @@ void ScAccessibleStateSet::clear() maStates.clear(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/Accessibility/AccessiblePageHeader.cxx b/sc/source/ui/Accessibility/AccessiblePageHeader.cxx index 51b8688e1a34..9912f3180aac 100644 --- a/sc/source/ui/Accessibility/AccessiblePageHeader.cxx +++ b/sc/source/ui/Accessibility/AccessiblePageHeader.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -437,3 +438,5 @@ void ScAccessiblePageHeader::AddChild(const EditTextObject* pArea, sal_uInt32 nI } } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx b/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx index a0e3b8af102a..e4849bd5e8f3 100644 --- a/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx +++ b/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -322,3 +323,5 @@ void ScAccessiblePageHeaderArea::CreateTextHelper() mpTextHelper->SetEventSource(this); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx b/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx index c07eb0844b7f..5ab74a176339 100644 --- a/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx +++ b/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -314,3 +315,4 @@ void ScAccessiblePreviewCell::CreateTextHelper() } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx index 1d91b7ebb2ae..b71bbf92936a 100644 --- a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx +++ b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -439,3 +440,5 @@ void ScAccessiblePreviewHeaderCell::FillTableInfo() const mpViewShell->GetLocationData().GetTableInfo( aVisRect, *mpTableInfo ); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx index a720085f8d93..8a8167d95fed 100644 --- a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx +++ b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -765,3 +766,4 @@ void ScAccessiblePreviewTable::FillTableInfo() const } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx index b10cfa1de06f..106d68ec4a43 100644 --- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx +++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -991,3 +992,5 @@ Rectangle ScAccessibleSpreadsheet::GetVisCells(const Rectangle& rVisArea) else return Rectangle(); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/Accessibility/AccessibleTableBase.cxx b/sc/source/ui/Accessibility/AccessibleTableBase.cxx index 4f4b2b7304bd..48b04220d834 100644 --- a/sc/source/ui/Accessibility/AccessibleTableBase.cxx +++ b/sc/source/ui/Accessibility/AccessibleTableBase.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -489,3 +490,5 @@ void ScAccessibleTableBase::CommitTableModelChange(sal_Int32 nStartRow, sal_Int3 CommitChange(aEvent); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/Accessibility/AccessibleText.cxx b/sc/source/ui/Accessibility/AccessibleText.cxx index 26a98b6cdacc..0ee57b63deb2 100644 --- a/sc/source/ui/Accessibility/AccessibleText.cxx +++ b/sc/source/ui/Accessibility/AccessibleText.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1841,3 +1842,5 @@ SvxEditViewForwarder* ScAccessibleCsvTextData::GetEditViewForwarder( sal_Bool /* { return NULL; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/Accessibility/DrawModelBroadcaster.cxx b/sc/source/ui/Accessibility/DrawModelBroadcaster.cxx index 31bf438772d0..053d0c11dd94 100644 --- a/sc/source/ui/Accessibility/DrawModelBroadcaster.cxx +++ b/sc/source/ui/Accessibility/DrawModelBroadcaster.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -90,3 +91,5 @@ void ScDrawModelBroadcaster::Notify( SfxBroadcaster&, } } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/app/client.cxx b/sc/source/ui/app/client.cxx index b1cb325ceb69..1553f37cc05c 100644 --- a/sc/source/ui/app/client.cxx +++ b/sc/source/ui/app/client.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -254,3 +255,4 @@ void __EXPORT ScClient::MakeVisible() } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/app/drwtrans.cxx b/sc/source/ui/app/drwtrans.cxx index b256233d7394..0a987024cf54 100644 --- a/sc/source/ui/app/drwtrans.cxx +++ b/sc/source/ui/app/drwtrans.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -802,3 +803,4 @@ sal_Int64 SAL_CALL ScDrawTransferObj::getSomething( const com::sun::star::uno::S } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 8e4bf74976a3..bf4707ae137f 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -3844,3 +3845,4 @@ ScInputHdlState& ScInputHdlState::operator=( const ScInputHdlState& r ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index 8f0465d7d7c7..e2c865e7d5b9 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1808,3 +1809,4 @@ void ScPosWnd::ReleaseFocus_Impl() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/app/lnktrans.cxx b/sc/source/ui/app/lnktrans.cxx index 2e0f5d276a97..055f8da1a828 100644 --- a/sc/source/ui/app/lnktrans.cxx +++ b/sc/source/ui/app/lnktrans.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -95,3 +96,4 @@ void ScLinkTransferObj::DragFinished( sal_Int8 nDropAction ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/app/msgpool.cxx b/sc/source/ui/app/msgpool.cxx index 78cb70fa64f0..0de23989202f 100644 --- a/sc/source/ui/app/msgpool.cxx +++ b/sc/source/ui/app/msgpool.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -121,3 +122,4 @@ SfxMapUnit __EXPORT ScMessagePool::GetMetric( USHORT nWhich ) const +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/app/rfindlst.cxx b/sc/source/ui/app/rfindlst.cxx index 3d62c0396b51..8f2526197787 100644 --- a/sc/source/ui/app/rfindlst.cxx +++ b/sc/source/ui/app/rfindlst.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -65,3 +66,4 @@ ColorData ScRangeFindList::GetColorName( USHORT nIndex ) // static //================================================================== +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/app/scdll.cxx b/sc/source/ui/app/scdll.cxx index ebc5a14687a7..8cd7a4e74686 100644 --- a/sc/source/ui/app/scdll.cxx +++ b/sc/source/ui/app/scdll.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -344,3 +345,5 @@ void ScDLL::Exit() // DetectFilter functionality has moved - please update your bookmarks // see sc/source/ui/unoobj/scdetect.cxx, have a nice day. + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx index 0c1957fdcf18..66b9fade4d8f 100644 --- a/sc/source/ui/app/scmod.cxx +++ b/sc/source/ui/app/scmod.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -2285,3 +2286,4 @@ Window * ScModule::Find1RefWindow( Window *pWndAncestor ) return NULL; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/app/scmod2.cxx b/sc/source/ui/app/scmod2.cxx index c92f0bf5d206..246d204038ae 100644 --- a/sc/source/ui/app/scmod2.cxx +++ b/sc/source/ui/app/scmod2.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -105,3 +106,4 @@ BOOL ScModule::HasThesaurusLanguage( USHORT nLang ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/app/seltrans.cxx b/sc/source/ui/app/seltrans.cxx index 0b213709863d..1866008f6782 100644 --- a/sc/source/ui/app/seltrans.cxx +++ b/sc/source/ui/app/seltrans.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -447,3 +448,4 @@ void ScSelectionTransferObj::ObjectReleased() } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/app/template.cxx b/sc/source/ui/app/template.cxx index 80dc667c5de6..edb30ff6468d 100644 --- a/sc/source/ui/app/template.cxx +++ b/sc/source/ui/app/template.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -77,3 +78,4 @@ void ScTemplateDlg::ToggleApplyTemplate() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx index 537f464ed045..00585e8e5051 100644 --- a/sc/source/ui/app/transobj.cxx +++ b/sc/source/ui/app/transobj.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -866,3 +867,4 @@ sal_Int64 SAL_CALL ScTransferObj::getSomething( const com::sun::star::uno::Seque } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/app/typemap.cxx b/sc/source/ui/app/typemap.cxx index 253560ca010c..10c35fde833f 100644 --- a/sc/source/ui/app/typemap.cxx +++ b/sc/source/ui/app/typemap.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -134,3 +135,5 @@ #define SFX_TYPEMAP #include "scslots.hxx" + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/app/uiitems.cxx b/sc/source/ui/app/uiitems.cxx index 3cd83ed42c03..4148b96675c6 100644 --- a/sc/source/ui/app/uiitems.cxx +++ b/sc/source/ui/app/uiitems.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -719,3 +720,5 @@ SfxPoolItem* __EXPORT ScCondFrmtItem::Clone( SfxItemPool * ) const { return new ScCondFrmtItem( *this ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/app/wtcdummy.cxx b/sc/source/ui/app/wtcdummy.cxx index a755830cbd71..055a37a644f4 100644 --- a/sc/source/ui/app/wtcdummy.cxx +++ b/sc/source/ui/app/wtcdummy.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -63,3 +64,5 @@ SdbRow::~SdbRow() { DBG_ERROR("WATCOM Hack failed !"); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/attrdlg/attrdlg.cxx b/sc/source/ui/attrdlg/attrdlg.cxx index c9f70fb91285..8ff3c4cdb573 100644 --- a/sc/source/ui/attrdlg/attrdlg.cxx +++ b/sc/source/ui/attrdlg/attrdlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -143,3 +144,4 @@ IMPL_LINK( ScAttrDlg, OkHandler, void*, EMPTYARG ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/attrdlg/condfrmt.cxx b/sc/source/ui/attrdlg/condfrmt.cxx index 5e3b23af8afa..dbdad9aace69 100644 --- a/sc/source/ui/attrdlg/condfrmt.cxx +++ b/sc/source/ui/attrdlg/condfrmt.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -827,3 +828,4 @@ IMPL_LINK( ScConditionalFormatDlg, NewBtnHdl, PushButton*, pBtn ) return 0; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/attrdlg/scabstdlg.cxx b/sc/source/ui/attrdlg/scabstdlg.cxx index b50435041409..23af73743aa9 100644 --- a/sc/source/ui/attrdlg/scabstdlg.cxx +++ b/sc/source/ui/attrdlg/scabstdlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -54,3 +55,5 @@ ScAbstractDialogFactory* ScAbstractDialogFactory::Create() return fp(); return 0; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx index bb1325e0280f..b4035b187197 100644 --- a/sc/source/ui/attrdlg/scdlgfact.cxx +++ b/sc/source/ui/attrdlg/scdlgfact.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -80,6 +81,7 @@ #include "tpusrlst.hxx" //add for ScTpUserLists #include "tpview.hxx" //add for ScTpContentOptions #include "tpformula.hxx" +#include "datafdlg.hxx" //add for ScDataFormDlg #include "tpcompatibility.hxx" // ause @@ -94,6 +96,8 @@ IMPL_ABSTDLG_BASE(AbstractScDataPilotDatabaseDlg_Impl); //add for ScDataPilotDat IMPL_ABSTDLG_BASE(AbstractScDataPilotSourceTypeDlg_Impl); //add for ScDataPilotSourceTypeDlg IMPL_ABSTDLG_BASE(AbstractScDataPilotServiceDlg_Impl); //add for ScDataPilotServiceDlg IMPL_ABSTDLG_BASE(AbstractScDeleteCellDlg_Impl); //add for ScDeleteCellDlg +//for dataform +IMPL_ABSTDLG_BASE(AbstractScDataFormDlg_Impl); //add for ScDataFormDlg IMPL_ABSTDLG_BASE(AbstractScDeleteContentsDlg_Impl); //add for ScDeleteContentsDlg IMPL_ABSTDLG_BASE(AbstractScFillSeriesDlg_Impl); //add for ScFillSeriesDlg IMPL_ABSTDLG_BASE(AbstractScGroupDlg_Impl); //add for ScGroupDlg @@ -865,6 +869,26 @@ AbstractScDeleteCellDlg* ScAbstractDialogFactory_Impl::CreateScDeleteCellDlg( Wi //add for ScDeleteCellDlg end +//add for ScDataFormDlg begin +AbstractScDataFormDlg* ScAbstractDialogFactory_Impl::CreateScDataFormDlg( Window* pParent, int nId, ScTabViewShell* pTabViewShell ) +{ + ScDataFormDlg * pDlg=NULL; + switch ( nId ) + { + case RID_SCDLG_DATAFORM : + pDlg = new ScDataFormDlg( pParent, pTabViewShell); + break; + default: + break; + } + + if ( pDlg ) + return new AbstractScDataFormDlg_Impl( pDlg ); + return 0; +} + +//add for ScDataFormDlg end + //add for ScDeleteContentsDlg begin AbstractScDeleteContentsDlg* ScAbstractDialogFactory_Impl::CreateScDeleteContentsDlg(Window* pParent,int nId, //add for ScDeleteContentsDlg USHORT nCheckDefaults ) @@ -1604,3 +1628,4 @@ void ScDPFunctionDlg_Dummy() ScDPListBoxWrapper aWrapper( *pListBox ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx index d0d3d0879e5f..4770923ea6d1 100644 --- a/sc/source/ui/attrdlg/scdlgfact.hxx +++ b/sc/source/ui/attrdlg/scdlgfact.hxx @@ -37,6 +37,7 @@ class ScDataPilotDatabaseDlg; class ScDataPilotSourceTypeDlg; class ScDataPilotServiceDlg; class ScDeleteCellDlg; +class ScDataFormDlg; class ScDeleteContentsDlg; class ScFillSeriesDlg; class ScGroupDlg; @@ -163,6 +164,12 @@ class AbstractScDeleteCellDlg_Impl : public AbstractScDeleteCellDlg //add for S virtual DelCellCmd GetDelCellCmd() const; }; +//for dataform +class AbstractScDataFormDlg_Impl : public AbstractScDataFormDlg //add for ScDataFormDlg +{ + DECL_ABSTDLG_BASE(AbstractScDataFormDlg_Impl,ScDataFormDlg); +}; + class AbstractScDeleteContentsDlg_Impl : public AbstractScDeleteContentsDlg //add for ScDeleteContentsDlg { DECL_ABSTDLG_BASE( AbstractScDeleteContentsDlg_Impl,ScDeleteContentsDlg) @@ -424,6 +431,9 @@ public: virtual AbstractScDeleteCellDlg * CreateScDeleteCellDlg( Window* pParent, int nId, BOOL bDisallowCellMove = FALSE ); //add for ScDeleteCellDlg + //for dataform + virtual AbstractScDataFormDlg * CreateScDataFormDlg( Window* pParent, int nId, ScTabViewShell* pTabViewShell); //add for ScDeleteCellDlg + virtual AbstractScDeleteContentsDlg * CreateScDeleteContentsDlg(Window* pParent,int nId, //add for ScDeleteContentsDlg USHORT nCheckDefaults = 0 ); diff --git a/sc/source/ui/attrdlg/scuiexp.cxx b/sc/source/ui/attrdlg/scuiexp.cxx index 35a0a3a1fb35..41ed3cdf9502 100644 --- a/sc/source/ui/attrdlg/scuiexp.cxx +++ b/sc/source/ui/attrdlg/scuiexp.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -53,3 +54,5 @@ extern "C" return ::scui::GetFactory(); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/attrdlg/tabpages.cxx b/sc/source/ui/attrdlg/tabpages.cxx index 21c769cf0603..84298f174211 100644 --- a/sc/source/ui/attrdlg/tabpages.cxx +++ b/sc/source/ui/attrdlg/tabpages.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -248,3 +249,5 @@ void ScTabPageProtection::UpdateButtons() aBtnHideFormula.Enable( bEnable ); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/cctrl/cbuttonw.cxx b/sc/source/ui/cctrl/cbuttonw.cxx index 6004fdfcfc51..4634b179664a 100644 --- a/sc/source/ui/cctrl/cbuttonw.cxx +++ b/sc/source/ui/cctrl/cbuttonw.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -176,3 +177,4 @@ void ScDDComboBoxButton::ImpDrawArrow( const Rectangle& rRect, +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx index 82c276d98f2c..c49b54ee9835 100644 --- a/sc/source/ui/cctrl/dpcontrol.cxx +++ b/sc/source/ui/cctrl/dpcontrol.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -66,7 +67,8 @@ ScDPFieldButton::ScDPFieldButton(OutputDevice* pOutDev, const StyleSettings* pSt mbBaseButton(true), mbPopupButton(false), mbHasHiddenMember(false), - mbPopupPressed(false) + mbPopupPressed(false), + mbPopupLeft(false) { if (pZoomX) maZoomX = *pZoomX; @@ -88,10 +90,15 @@ void ScDPFieldButton::setText(const OUString& rText) maText = rText; } -void ScDPFieldButton::setBoundingBox(const Point& rPos, const Size& rSize) +void ScDPFieldButton::setBoundingBox(const Point& rPos, const Size& rSize, bool bLayoutRTL) { maPos = rPos; maSize = rSize; + if (bLayoutRTL) + { + // rPos is the logical-left position, adjust maPos to visual-left (inside the cell border) + maPos.X() -= maSize.Width() - 1; + } } void ScDPFieldButton::setDrawBaseButton(bool b) @@ -114,6 +121,11 @@ void ScDPFieldButton::setPopupPressed(bool b) mbPopupPressed = b; } +void ScDPFieldButton::setPopupLeft(bool b) +{ + mbPopupLeft = b; +} + void ScDPFieldButton::draw() { const long nMargin = 2; @@ -179,7 +191,12 @@ void ScDPFieldButton::getPopupBoundingBox(Point& rPos, Size& rSize) const if (nH > 18) nH = 18; - rPos.setX(maPos.getX() + maSize.getWidth() - nW); + // #i114944# AutoFilter button is left-aligned in RTL. + // DataPilot button is always right-aligned for now, so text output isn't affected. + if (mbPopupLeft) + rPos.setX(maPos.getX()); + else + rPos.setX(maPos.getX() + maSize.getWidth() - nW); rPos.setY(maPos.getY() + maSize.getHeight() - nH); rSize.setWidth(nW); rSize.setHeight(nH); @@ -1404,3 +1421,4 @@ void ScDPFieldPopupWindow::setOKAction(Action* p) mpOKAction.reset(p); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/cctrl/editfield.cxx b/sc/source/ui/cctrl/editfield.cxx index 4358694f6b04..d52ccefea685 100644 --- a/sc/source/ui/cctrl/editfield.cxx +++ b/sc/source/ui/cctrl/editfield.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -82,3 +83,4 @@ void ScDoubleField::SetValue( double fValue, sal_Int32 nDecPlaces, bool bEraseTr // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/cctrl/popmenu.cxx b/sc/source/ui/cctrl/popmenu.cxx index 6510fff87ead..742104ea517f 100644 --- a/sc/source/ui/cctrl/popmenu.cxx +++ b/sc/source/ui/cctrl/popmenu.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -46,3 +47,4 @@ void __EXPORT ScPopupMenu::Select() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/cctrl/tbinsert.cxx b/sc/source/ui/cctrl/tbinsert.cxx index e27baecec115..6c439fd94693 100644 --- a/sc/source/ui/cctrl/tbinsert.cxx +++ b/sc/source/ui/cctrl/tbinsert.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -230,3 +231,4 @@ void __EXPORT ScTbxInsertPopup::PopupModeEnd() */ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx index 220a135d9a2e..9fe3acc0af73 100644 --- a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx +++ b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -528,3 +529,5 @@ void ScZoomSliderWnd::DoPaint( const Rectangle& /*rRect*/ ) } // ----------------------------------------------------------------------- + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/dbgui/asciiopt.cxx b/sc/source/ui/dbgui/asciiopt.cxx index a22953ade25b..157d6c4d2e4c 100644 --- a/sc/source/ui/dbgui/asciiopt.cxx +++ b/sc/source/ui/dbgui/asciiopt.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -478,3 +479,4 @@ void ScAsciiOptions::InterpretColumnList( const String& rString ) } #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/dbgui/consdlg.cxx b/sc/source/ui/dbgui/consdlg.cxx index e094149ab99b..7e2bafd2c42b 100644 --- a/sc/source/ui/dbgui/consdlg.cxx +++ b/sc/source/ui/dbgui/consdlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -653,3 +654,4 @@ USHORT ScConsolidateDlg::FuncToLbPos( ScSubTotalFunc eFunc ) } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/dbgui/csvcontrol.cxx b/sc/source/ui/dbgui/csvcontrol.cxx index 0dbc4e7dab39..3455fa72c1fd 100644 --- a/sc/source/ui/dbgui/csvcontrol.cxx +++ b/sc/source/ui/dbgui/csvcontrol.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -335,3 +336,4 @@ ScCsvControl::XAccessibleRef ScCsvControl::CreateAccessible() // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/dbgui/csvgrid.cxx b/sc/source/ui/dbgui/csvgrid.cxx index d271022a987c..a18bbb7e2607 100644 --- a/sc/source/ui/dbgui/csvgrid.cxx +++ b/sc/source/ui/dbgui/csvgrid.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1353,3 +1354,4 @@ ScAccessibleCsvControl* ScCsvGrid::ImplCreateAccessible() // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/dbgui/csvruler.cxx b/sc/source/ui/dbgui/csvruler.cxx index 56aa2a50a835..84d5ad6bee1b 100644 --- a/sc/source/ui/dbgui/csvruler.cxx +++ b/sc/source/ui/dbgui/csvruler.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -680,3 +681,4 @@ ScAccessibleCsvControl* ScCsvRuler::ImplCreateAccessible() // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/dbgui/csvsplits.cxx b/sc/source/ui/dbgui/csvsplits.cxx index b93bb09b5151..5215f3f9a799 100644 --- a/sc/source/ui/dbgui/csvsplits.cxx +++ b/sc/source/ui/dbgui/csvsplits.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -118,3 +119,4 @@ sal_uInt32 ScCsvSplits::GetIterIndex( const_iterator aIter ) const // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/dbgui/csvtablebox.cxx b/sc/source/ui/dbgui/csvtablebox.cxx index e6a900845eef..e7d3071da1f3 100644 --- a/sc/source/ui/dbgui/csvtablebox.cxx +++ b/sc/source/ui/dbgui/csvtablebox.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -432,3 +433,4 @@ ScAccessibleCsvControl* ScCsvTableBox::ImplCreateAccessible() // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/dbgui/dapidata.cxx b/sc/source/ui/dbgui/dapidata.cxx index 976e0ae23039..ab2159af2f93 100644 --- a/sc/source/ui/dbgui/dapidata.cxx +++ b/sc/source/ui/dbgui/dapidata.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -227,3 +228,4 @@ void ScDataPilotDatabaseDlg::FillObjects() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/dbgui/dapitype.cxx b/sc/source/ui/dbgui/dapitype.cxx index 31aafbcb13da..b9ca10fef09e 100644 --- a/sc/source/ui/dbgui/dapitype.cxx +++ b/sc/source/ui/dbgui/dapitype.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -140,3 +141,4 @@ String ScDataPilotServiceDlg::GetParPass() const +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/dbgui/dbnamdlg.cxx b/sc/source/ui/dbgui/dbnamdlg.cxx index a2f4d61af537..1782e4245b1d 100644 --- a/sc/source/ui/dbgui/dbnamdlg.cxx +++ b/sc/source/ui/dbgui/dbnamdlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -719,3 +720,4 @@ IMPL_LINK( ScDbNameDlg, AssModifyHdl, void *, EMPTYARG ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/dbgui/dpgroupdlg.cxx b/sc/source/ui/dbgui/dpgroupdlg.cxx index 2e3da92fbd05..e665b215c0e9 100644 --- a/sc/source/ui/dbgui/dpgroupdlg.cxx +++ b/sc/source/ui/dbgui/dpgroupdlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -354,3 +355,4 @@ IMPL_LINK( ScDPDateGroupDlg, CheckHdl, SvxCheckListBox*, pListBox ) // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/dbgui/expftext.cxx b/sc/source/ui/dbgui/expftext.cxx index 405a18fcc004..b05d9c193638 100644 --- a/sc/source/ui/dbgui/expftext.cxx +++ b/sc/source/ui/dbgui/expftext.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -93,3 +94,4 @@ void ScExpandedFixedText::RequestHelp(const HelpEvent& rEvt) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/dbgui/fieldwnd.cxx b/sc/source/ui/dbgui/fieldwnd.cxx index d4b477cd4b33..8c181959f049 100644 --- a/sc/source/ui/dbgui/fieldwnd.cxx +++ b/sc/source/ui/dbgui/fieldwnd.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -774,3 +775,4 @@ String ScDPFieldWindow::GetDescription() const //=================================================================== +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/dbgui/filtdlg.cxx b/sc/source/ui/dbgui/filtdlg.cxx index 8ca95f70441e..02188e367f0c 100644 --- a/sc/source/ui/dbgui/filtdlg.cxx +++ b/sc/source/ui/dbgui/filtdlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1184,3 +1185,5 @@ void ScFilterDlg::RefreshEditRow( USHORT nOffset ) UpdateValueList( static_cast<USHORT>(i+1) ); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/dbgui/foptmgr.cxx b/sc/source/ui/dbgui/foptmgr.cxx index 1e274690c31c..d6b331494667 100644 --- a/sc/source/ui/dbgui/foptmgr.cxx +++ b/sc/source/ui/dbgui/foptmgr.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -335,3 +336,5 @@ IMPL_LINK( ScFilterOptionsMgr, BtnCopyResultHdl, CheckBox*, pBox ) return 0; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/dbgui/imoptdlg.cxx b/sc/source/ui/dbgui/imoptdlg.cxx index bd18008afd47..641ce7dc6374 100644 --- a/sc/source/ui/dbgui/imoptdlg.cxx +++ b/sc/source/ui/dbgui/imoptdlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -88,3 +89,5 @@ void ScImportOptions::SetTextEncoding( rtl_TextEncoding nEnc ) gsl_getSystemTextEncoding() : nEnc); aStrFont = ScGlobal::GetCharsetString( nEnc ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/dbgui/pfiltdlg.cxx b/sc/source/ui/dbgui/pfiltdlg.cxx index d590ffb83457..dfbf7e8989fa 100644 --- a/sc/source/ui/dbgui/pfiltdlg.cxx +++ b/sc/source/ui/dbgui/pfiltdlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -618,3 +619,4 @@ IMPL_LINK( ScPivotFilterDlg, ValModifyHdl, ComboBox*, pEd ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/dbgui/pvfundlg.cxx b/sc/source/ui/dbgui/pvfundlg.cxx index daa549688f21..4e834fb95935 100644 --- a/sc/source/ui/dbgui/pvfundlg.cxx +++ b/sc/source/ui/dbgui/pvfundlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -854,3 +855,4 @@ IMPL_LINK( ScDPShowDetailDlg, DblClickHdl, ListBox*, pLBox ) // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/dbgui/pvlaydlg.cxx b/sc/source/ui/dbgui/pvlaydlg.cxx index 2d3ae285c45f..3b26d1c836f6 100644 --- a/sc/source/ui/dbgui/pvlaydlg.cxx +++ b/sc/source/ui/dbgui/pvlaydlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1867,3 +1868,4 @@ IMPL_LINK( ScDPLayoutDlg, GetFocusHdl, Control*, pCtrl ) return 0; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/dbgui/scendlg.cxx b/sc/source/ui/dbgui/scendlg.cxx index 58e153387e09..916bb0db8a34 100644 --- a/sc/source/ui/dbgui/scendlg.cxx +++ b/sc/source/ui/dbgui/scendlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -241,3 +242,4 @@ IMPL_LINK( ScNewScenarioDlg, EnableHdl, CheckBox *, pBox ) return 0; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx b/sc/source/ui/dbgui/scuiasciiopt.cxx index e29e33e8fd64..67817a140af2 100644 --- a/sc/source/ui/dbgui/scuiasciiopt.cxx +++ b/sc/source/ui/dbgui/scuiasciiopt.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -721,3 +722,5 @@ IMPL_LINK( ScImportAsciiDlg, ColTypeHdl, ScCsvTableBox*, pTableBox ) return 0; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/dbgui/scuiimoptdlg.cxx b/sc/source/ui/dbgui/scuiimoptdlg.cxx index 5440f515c86a..547983af83fe 100644 --- a/sc/source/ui/dbgui/scuiimoptdlg.cxx +++ b/sc/source/ui/dbgui/scuiimoptdlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -314,3 +315,5 @@ IMPL_LINK( ScImportOptionsDlg, FixedWidthHdl, CheckBox*, pCheckBox ) } return 0; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/dbgui/sfiltdlg.cxx b/sc/source/ui/dbgui/sfiltdlg.cxx index f70fbb094c92..d66ff75d7530 100644 --- a/sc/source/ui/dbgui/sfiltdlg.cxx +++ b/sc/source/ui/dbgui/sfiltdlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -528,3 +529,4 @@ IMPL_LINK( ScSpecialFilterDlg, FilterAreaModHdl, formula::RefEdit*, pEd ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/dbgui/sortdlg.cxx b/sc/source/ui/dbgui/sortdlg.cxx index f2a733af3aa8..0fbbe991e327 100644 --- a/sc/source/ui/dbgui/sortdlg.cxx +++ b/sc/source/ui/dbgui/sortdlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -105,3 +106,5 @@ IMPL_LINK( ScSortWarningDlg, BtnHdl, PushButton*, pBtn ) return 0; } //========================================================================// + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/dbgui/subtdlg.cxx b/sc/source/ui/dbgui/subtdlg.cxx index 2c9cba31cd13..172e887cf51e 100644 --- a/sc/source/ui/dbgui/subtdlg.cxx +++ b/sc/source/ui/dbgui/subtdlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -67,3 +68,4 @@ IMPL_LINK_INLINE_START( ScSubTotalDlg, RemoveHdl, PushButton *, pBtn ) } IMPL_LINK_INLINE_END( ScSubTotalDlg, RemoveHdl, PushButton *, pBtn ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/dbgui/textimportoptions.cxx b/sc/source/ui/dbgui/textimportoptions.cxx index be918d2a0fbd..99253d6cc5a1 100644 --- a/sc/source/ui/dbgui/textimportoptions.cxx +++ b/sc/source/ui/dbgui/textimportoptions.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -119,3 +120,4 @@ IMPL_LINK( ScTextImportOptionsDlg, RadioHdl, RadioButton*, pBtn ) return 0; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx index 37a7dab398a4..7a54da38da03 100644 --- a/sc/source/ui/dbgui/tpsort.cxx +++ b/sc/source/ui/dbgui/tpsort.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1081,3 +1082,4 @@ IMPL_LINK( ScTabPageSortOptions, FillAlgorHdl, void *, EMPTYARG ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/dbgui/tpsubt.cxx b/sc/source/ui/dbgui/tpsubt.cxx index fbada165b55d..b4d6519d3388 100644 --- a/sc/source/ui/dbgui/tpsubt.cxx +++ b/sc/source/ui/dbgui/tpsubt.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -684,3 +685,4 @@ __EXPORT ScTpSubTotalGroup3::~ScTpSubTotalGroup3() { } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx index 7626a95971ca..6eed9ab7fee0 100644 --- a/sc/source/ui/dbgui/validate.cxx +++ b/sc/source/ui/dbgui/validate.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -993,3 +994,5 @@ bool ScValidationDlg::IsAlive() { return SC_MOD()->IsAliveRefDlg( SLOTID, this ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx index bed1622b0a2a..69a62985e02f 100644 --- a/sc/source/ui/docshell/arealink.cxx +++ b/sc/source/ui/docshell/arealink.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -527,3 +528,4 @@ IMPL_LINK( ScAreaLink, AreaEndEditHdl, void*, EMPTYARG ) return 0; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/docshell/autostyl.cxx b/sc/source/ui/docshell/autostyl.cxx index 61683e169f02..511d7695c471 100644 --- a/sc/source/ui/docshell/autostyl.cxx +++ b/sc/source/ui/docshell/autostyl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -242,3 +243,4 @@ IMPL_LINK( ScAutoStyleList, TimerHdl, Timer*, EMPTYARG ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx index c7a2f838e087..4a5f68b3e658 100644 --- a/sc/source/ui/docshell/dbdocfun.cxx +++ b/sc/source/ui/docshell/dbdocfun.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1500,3 +1501,4 @@ void ScDBDocFunc::UpdateImport( const String& rTarget, const String& rDBName, +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/docshell/dbdocimp.cxx b/sc/source/ui/docshell/dbdocimp.cxx index dee7438bc07f..8400f1ad8b6f 100644 --- a/sc/source/ui/docshell/dbdocimp.cxx +++ b/sc/source/ui/docshell/dbdocimp.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -721,3 +722,4 @@ BOOL ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam, +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index 57b2245ad9ce..4ee20c186299 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -109,6 +110,7 @@ using namespace com::sun::star; using ::com::sun::star::uno::Sequence; using ::std::vector; + // STATIC DATA ----------------------------------------------------------- //======================================================================== @@ -4188,6 +4190,13 @@ BOOL ScDocFunc::FillSeries( const ScRange& rRange, const ScMarkData* pTabMark, BOOL ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark, FillDir eDir, ULONG nCount, BOOL bRecord, BOOL bApi ) { + double fStep = 1.0; + double fMax = MAXDOUBLE; + return FillAuto( rRange, pTabMark, eDir, FILL_AUTO, FILL_DAY, nCount, fStep, fMax, bRecord, bApi ); +} + +BOOL ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark, FillDir eDir, FillCmd eCmd, FillDateCmd eDateCmd, ULONG nCount, double fStep, double fMax, BOOL bRecord, BOOL bApi ) +{ ScDocShellModificator aModificator( rDocShell ); ScDocument* pDoc = rDocShell.GetDocument(); @@ -4213,10 +4222,6 @@ BOOL ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark, ScRange aSourceArea = rRange; ScRange aDestArea = rRange; - FillCmd eCmd = FILL_AUTO; - FillDateCmd eDateCmd = FILL_DAY; - double fStep = 1.0; - double fMax = MAXDOUBLE; switch (eDir) { @@ -4948,3 +4953,4 @@ BOOL ScDocFunc::InsertAreaLink( const String& rFile, const String& rFilter, +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index 205fa3148b39..902a1994f3b4 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -178,7 +179,6 @@ static const sal_Char __FAR_DATA pFilterExcel95[] = "MS Excel 95"; static const sal_Char __FAR_DATA pFilterEx95Temp[] = "MS Excel 95 Vorlage/Template"; static const sal_Char __FAR_DATA pFilterExcel97[] = "MS Excel 97"; static const sal_Char __FAR_DATA pFilterEx97Temp[] = "MS Excel 97 Vorlage/Template"; -static const sal_Char __FAR_DATA pFilterEx07Xml[] = "MS Excel 2007 XML"; static const sal_Char __FAR_DATA pFilterDBase[] = "dBase"; static const sal_Char __FAR_DATA pFilterDif[] = "DIF"; static const sal_Char __FAR_DATA pFilterSylk[] = "SYLK"; @@ -2097,8 +2097,7 @@ BOOL __EXPORT ScDocShell::ConvertTo( SfxMedium &rMed ) } else if (aFltName.EqualsAscii(pFilterExcel5) || aFltName.EqualsAscii(pFilterExcel95) || aFltName.EqualsAscii(pFilterExcel97) || aFltName.EqualsAscii(pFilterEx5Temp) || - aFltName.EqualsAscii(pFilterEx95Temp) || aFltName.EqualsAscii(pFilterEx97Temp) || - aFltName.EqualsAscii(pFilterEx07Xml)) + aFltName.EqualsAscii(pFilterEx95Temp) || aFltName.EqualsAscii(pFilterEx97Temp)) { WaitObject aWait( GetActiveDialogParent() ); @@ -2140,8 +2139,6 @@ BOOL __EXPORT ScDocShell::ConvertTo( SfxMedium &rMed ) ExportFormatExcel eFormat = ExpBiff5; if( aFltName.EqualsAscii( pFilterExcel97 ) || aFltName.EqualsAscii( pFilterEx97Temp ) ) eFormat = ExpBiff8; - if( aFltName.EqualsAscii( pFilterEx07Xml ) ) - eFormat = Exp2007Xml; FltError eError = ScFormatFilter::Get().ScExportExcel5( rMed, &aDocument, eFormat, RTL_TEXTENCODING_MS_1252 ); if( eError && !GetError() ) @@ -3080,3 +3077,5 @@ bool ScDocShell::GetProtectionHash( /*out*/ ::com::sun::star::uno::Sequence< sal } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/docshell/docsh2.cxx b/sc/source/ui/docshell/docsh2.cxx index 14ff7622818c..d8a7311a6c94 100644 --- a/sc/source/ui/docshell/docsh2.cxx +++ b/sc/source/ui/docshell/docsh2.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -261,3 +262,5 @@ ScDrawLayer* ScDocShell::MakeDrawLayer() } return pDrawLayer; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx index 233843935bbd..8e0719ad328b 100644 --- a/sc/source/ui/docshell/docsh3.cxx +++ b/sc/source/ui/docshell/docsh3.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1407,3 +1408,5 @@ bool ScDocShell::MergeSharedDocument( ScDocShell* pSharedDocShell ) return ( pThisAction != NULL ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index ba4553fd8826..bc9681e2aaeb 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -2713,3 +2714,5 @@ uno::Reference< frame::XModel > ScDocShell::LoadSharedDocument() } return xModel; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx index 9510c91e3290..e852ca29a948 100644 --- a/sc/source/ui/docshell/docsh5.cxx +++ b/sc/source/ui/docshell/docsh5.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -853,6 +854,47 @@ SCTAB ScDocShell::MakeScenario( SCTAB nTab, const String& rName, const String& r return nTab; } +ULONG ScDocShell::TransferTab( ScDocShell& rSrcDocShell, SCTAB nSrcPos, + SCTAB nDestPos, BOOL bInsertNew, + BOOL bNotifyAndPaint ) +{ + ScDocument* pSrcDoc = rSrcDocShell.GetDocument(); + + ULONG nErrVal = aDocument.TransferTab( pSrcDoc, nSrcPos, nDestPos, + bInsertNew ); // no insert + + // TransferTab doesn't copy drawing objects with bInsertNew=FALSE + if ( nErrVal > 0 && !bInsertNew) + aDocument.TransferDrawPage( pSrcDoc, nSrcPos, nDestPos ); + + if(nErrVal>0 && pSrcDoc->IsScenario( nSrcPos )) + { + String aComment; + Color aColor; + USHORT nFlags; + + pSrcDoc->GetScenarioData( nSrcPos, aComment,aColor, nFlags); + aDocument.SetScenario(nDestPos,TRUE); + aDocument.SetScenarioData(nDestPos,aComment,aColor,nFlags); + BOOL bActive = pSrcDoc->IsActiveScenario(nSrcPos); + aDocument.SetActiveScenario(nDestPos, bActive ); + + BOOL bVisible=pSrcDoc->IsVisible(nSrcPos); + aDocument.SetVisible(nDestPos,bVisible ); + + } + + if ( nErrVal > 0 && pSrcDoc->IsTabProtected( nSrcPos ) ) + aDocument.SetTabProtection(nDestPos, pSrcDoc->GetTabProtection(nSrcPos)); + if ( bNotifyAndPaint ) + { + Broadcast( ScTablesHint( SC_TAB_INSERTED, nDestPos ) ); + PostPaintExtras(); + PostPaintGridAll(); + } + return nErrVal; +} + BOOL ScDocShell::MoveTable( SCTAB nSrcTab, SCTAB nDestTab, BOOL bCopy, BOOL bRecord ) { ScDocShellModificator aModificator( *this ); @@ -989,3 +1031,4 @@ IMPL_LINK( ScDocShell, RefreshDBDataHdl, ScRefreshTimer*, pRefreshTimer ) return bContinue != 0; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx index d735a359f0a2..60f75c885a83 100644 --- a/sc/source/ui/docshell/docsh6.cxx +++ b/sc/source/ui/docshell/docsh6.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -538,3 +539,4 @@ void ScDocShell::CheckConfigOptions() SetConfigOptionsChecked(true); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/docshell/docsh7.cxx b/sc/source/ui/docshell/docsh7.cxx index 89f082672b29..85ca951be483 100644 --- a/sc/source/ui/docshell/docsh7.cxx +++ b/sc/source/ui/docshell/docsh7.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -43,3 +44,4 @@ void ScDocShell::GetDrawObjState( SfxItemSet & /* rSet */ ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx index 8ef15badde9c..1e94a7f3b2e4 100644 --- a/sc/source/ui/docshell/docsh8.cxx +++ b/sc/source/ui/docshell/docsh8.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1180,3 +1181,4 @@ ULONG ScDocShell::DBaseExport( const String& rFullFileName, CharSet eCharSet, BO } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/docshell/editable.cxx b/sc/source/ui/docshell/editable.cxx index d381ff067a99..24cae921fddf 100644 --- a/sc/source/ui/docshell/editable.cxx +++ b/sc/source/ui/docshell/editable.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -160,3 +161,4 @@ USHORT ScEditableTester::GetMessageId() const return STR_PROTECTIONERR; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx index 68f0b277717a..c0fc2fbfa215 100644 --- a/sc/source/ui/docshell/externalrefmgr.cxx +++ b/sc/source/ui/docshell/externalrefmgr.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -2551,3 +2552,4 @@ IMPL_LINK(ScExternalRefManager, TimeOutHdl, AutoTimer*, pTimer) return 0; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/docshell/hiranges.cxx b/sc/source/ui/docshell/hiranges.cxx index af1226216a06..0ad4c4e3e5d8 100644 --- a/sc/source/ui/docshell/hiranges.cxx +++ b/sc/source/ui/docshell/hiranges.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -51,3 +52,4 @@ ScHighlightRanges::~ScHighlightRanges() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx index 9d57734dd2fb..b3c202d4bc40 100644 --- a/sc/source/ui/docshell/impex.cxx +++ b/sc/source/ui/docshell/impex.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -2111,3 +2112,5 @@ ScFormatFilterPlugin &ScFormatFilter::Get() return *plugin; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/docshell/macromgr.cxx b/sc/source/ui/docshell/macromgr.cxx new file mode 100644 index 000000000000..3adb03ddb42c --- /dev/null +++ b/sc/source/ui/docshell/macromgr.cxx @@ -0,0 +1,216 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: document.hxx,v $ + * $Revision: 1.115.36.9 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_sc.hxx" + +// INCLUDE --------------------------------------------------------------- + +#include "macromgr.hxx" +#include "document.hxx" + +#include "basic/basmgr.hxx" +#include "cppuhelper/implbase1.hxx" +#include "sfx2/objsh.hxx" +#include "cell.hxx" +#include <com/sun/star/container/XContainer.hpp> + +#include <list> + +using namespace ::com::sun::star; +using ::com::sun::star::uno::RuntimeException; +using ::com::sun::star::uno::Reference; +using ::rtl::OUString; +using ::rtl::OUStringHash; +using ::std::hash_map; +using ::std::list; +using ::std::for_each; +using ::std::pair; + +// ============================================================================ + +/** + * A simple container to keep track of cells that depend on basic modules + * changes. We don't check for duplicates at insertion time; instead, we + * remove duplicates at query time. + */ +class ScUserMacroDepTracker +{ +public: + void addCell(const OUString& rModuleName, ScFormulaCell* pCell) + { + ModuleCellMap::iterator itr = maCells.find(rModuleName); + if (itr == maCells.end()) + { + pair<ModuleCellMap::iterator, bool> r = maCells.insert( + ModuleCellMap::value_type(rModuleName, list<ScFormulaCell*>())); + + if (!r.second) + // insertion failed. + return; + + itr = r.first; + } + itr->second.push_back(pCell); + } + + void removeCell(ScFormulaCell* pCell) + { + ModuleCellMap::iterator itr = maCells.begin(), itrEnd = maCells.end(); + for (; itr != itrEnd; ++itr) + itr->second.remove(pCell); + } + + void getCellsByModule(const OUString& rModuleName, list<ScFormulaCell*>& rCells) + { + ModuleCellMap::iterator itr = maCells.find(rModuleName); + if (itr == maCells.end()) + return; + + list<ScFormulaCell*>& rCellList = itr->second; + + // Remove duplicates. + rCellList.sort(); + rCellList.unique(); + // exception safe copy + list<ScFormulaCell*> temp(rCellList); + rCells.swap(temp); + } + +private: + typedef hash_map<OUString, list<ScFormulaCell*>, OUStringHash> ModuleCellMap; + ModuleCellMap maCells; +}; + + +// ============================================================================ + +ScMacroManager::ScMacroManager(ScDocument* pDoc) : + mpDepTracker(new ScUserMacroDepTracker), + mpDoc(pDoc) +{ +} + +ScMacroManager::~ScMacroManager() +{ +} + +typedef ::cppu::WeakImplHelper1< ::com::sun::star::container::XContainerListener > ContainerListenerHelper; + +class VBAProjectListener : public ContainerListenerHelper +{ + ScMacroManager* mpMacroMgr; +public: + VBAProjectListener( ScMacroManager* pMacroMgr ) : mpMacroMgr( pMacroMgr ) {} + // XEventListener + virtual void SAL_CALL disposing( const lang::EventObject& /*Source*/ ) throw(RuntimeException) {} + + // XContainerListener + virtual void SAL_CALL elementInserted( const container::ContainerEvent& /*Event*/ ) throw(RuntimeException){} + virtual void SAL_CALL elementReplaced( const container::ContainerEvent& Event ) throw(RuntimeException) + { + rtl::OUString sModuleName; + Event.Accessor >>= sModuleName; + OSL_TRACE("VBAProjectListener::elementReplaced(%s)", rtl::OUStringToOString( sModuleName, RTL_TEXTENCODING_UTF8 ).getStr() ); + mpMacroMgr->InitUserFuncData(); + mpMacroMgr->BroadcastModuleUpdate(sModuleName); + } + virtual void SAL_CALL elementRemoved( const container::ContainerEvent& /*Event*/ ) throw(RuntimeException){} + +}; + +void ScMacroManager::InitUserFuncData() +{ + // Clear hash_map + mhFuncToVolatile.clear(); + String sProjectName( RTL_CONSTASCII_USTRINGPARAM("Standard") ); + + Reference< container::XContainer > xModuleContainer; + SfxObjectShell* pShell = mpDoc->GetDocumentShell(); + if ( pShell && pShell->GetBasicManager()->GetName().Len() > 0 ) + sProjectName = pShell->GetBasicManager()->GetName(); + try + { + Reference< script::XLibraryContainer > xLibraries( pShell->GetBasicContainer(), uno::UNO_QUERY_THROW ); + xModuleContainer.set( xLibraries->getByName( sProjectName ), uno::UNO_QUERY_THROW ); + + if ( xModuleContainer.is() ) + { + // remove old listener ( if there was one ) + if ( mxContainerListener.is() ) + xModuleContainer->removeContainerListener( mxContainerListener ); + // Create listener + mxContainerListener = new VBAProjectListener( this ); + xModuleContainer->addContainerListener( mxContainerListener ); + } + } + catch( uno::Exception& ) + { + } +} + +void ScMacroManager::SetUserFuncVolatile( const OUString& sName, bool isVolatile ) +{ + mhFuncToVolatile[ sName ] = isVolatile; +} + +bool ScMacroManager::GetUserFuncVolatile( const OUString& sName ) +{ + NameBoolMap::iterator it = mhFuncToVolatile.find( sName ); + if ( it == mhFuncToVolatile.end() ) + return false; + return it->second; +} + +void ScMacroManager::AddDependentCell(const OUString& aModuleName, ScFormulaCell* pCell) +{ + mpDepTracker->addCell(aModuleName, pCell); +} + +void ScMacroManager::RemoveDependentCell(ScFormulaCell* pCell) +{ + mpDepTracker->removeCell(pCell); +} + +void ScMacroManager::BroadcastModuleUpdate(const OUString& aModuleName) +{ + list<ScFormulaCell*> aCells; + mpDepTracker->getCellsByModule(aModuleName, aCells); + list<ScFormulaCell*>::iterator itr = aCells.begin(), itrEnd = aCells.end(); + for (; itr != itrEnd; ++itr) + { + ScFormulaCell* pCell = *itr; + mpDoc->PutInFormulaTree(pCell); // for F9 recalc + + // for recalc on cell value change. If the cell is not volatile, the + // cell stops listening right away after it gets re-interpreted. + mpDoc->StartListeningArea(BCA_LISTEN_ALWAYS, pCell); + } +} diff --git a/sc/source/ui/docshell/makefile.mk b/sc/source/ui/docshell/makefile.mk index dcfd0429bd50..df8d4c9b37f2 100644 --- a/sc/source/ui/docshell/makefile.mk +++ b/sc/source/ui/docshell/makefile.mk @@ -91,7 +91,8 @@ SLOFILES = \ $(SLO)$/hiranges.obj \ $(SLO)$/pntlock.obj \ $(SLO)$/sizedev.obj \ - $(SLO)$/editable.obj + $(SLO)$/editable.obj \ + $(SLO)$/macromgr.obj EXCEPTIONSFILES= \ @@ -102,7 +103,8 @@ EXCEPTIONSFILES= \ $(SLO)$/docsh8.obj \ $(SLO)$/externalrefmgr.obj \ $(SLO)$/dbdocimp.obj \ - $(SLO)$/docfunc.obj + $(SLO)$/docfunc.obj \ + $(SLO)$/macromgr.obj SRS1NAME=$(TARGET) SRC1FILES = tpstat.src @@ -132,7 +134,8 @@ LIB1OBJFILES = \ $(SLO)$/hiranges.obj \ $(SLO)$/pntlock.obj \ $(SLO)$/sizedev.obj \ - $(SLO)$/editable.obj + $(SLO)$/editable.obj \ + $(SLO)$/macromgr.obj # --- Tagets ------------------------------------------------------- diff --git a/sc/source/ui/docshell/olinefun.cxx b/sc/source/ui/docshell/olinefun.cxx index 32f803e75509..dfbe7ed24fe0 100644 --- a/sc/source/ui/docshell/olinefun.cxx +++ b/sc/source/ui/docshell/olinefun.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -795,3 +796,4 @@ BOOL ScOutlineDocFunc::HideOutline( SCTAB nTab, BOOL bColumns, USHORT nLevel, US +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/docshell/pagedata.cxx b/sc/source/ui/docshell/pagedata.cxx index db55c2364305..e87c2322a228 100644 --- a/sc/source/ui/docshell/pagedata.cxx +++ b/sc/source/ui/docshell/pagedata.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -137,3 +138,4 @@ void ScPageBreakData::AddPages() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/docshell/pntlock.cxx b/sc/source/ui/docshell/pntlock.cxx index 764d431f3af0..0450f7c67a0d 100644 --- a/sc/source/ui/docshell/pntlock.cxx +++ b/sc/source/ui/docshell/pntlock.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -59,3 +60,4 @@ void ScPaintLockData::AddRange( const ScRange& rRange, USHORT nP ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/docshell/servobj.cxx b/sc/source/ui/docshell/servobj.cxx index a30e60607b49..186b94f3bf83 100644 --- a/sc/source/ui/docshell/servobj.cxx +++ b/sc/source/ui/docshell/servobj.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -275,3 +276,4 @@ void __EXPORT ScServerObject::Notify( SfxBroadcaster& rBC, const SfxHint& rHint +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/docshell/sizedev.cxx b/sc/source/ui/docshell/sizedev.cxx index d89009540156..3171fa8164ae 100644 --- a/sc/source/ui/docshell/sizedev.cxx +++ b/sc/source/ui/docshell/sizedev.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -75,3 +76,4 @@ ScSizeDeviceProvider::~ScSizeDeviceProvider() pDevice->SetMapMode( aOldMapMode ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/docshell/tablink.cxx b/sc/source/ui/docshell/tablink.cxx index 697b39052b9f..f949b3ffb45c 100644 --- a/sc/source/ui/docshell/tablink.cxx +++ b/sc/source/ui/docshell/tablink.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -619,3 +620,4 @@ String ScDocumentLoader::GetTitle() const return EMPTY_STRING; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/docshell/tpstat.cxx b/sc/source/ui/docshell/tpstat.cxx index 1072af30c7a1..b5ced9d105a8 100644 --- a/sc/source/ui/docshell/tpstat.cxx +++ b/sc/source/ui/docshell/tpstat.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -99,3 +100,4 @@ void __EXPORT ScDocStatPage::Reset( const SfxItemSet& /* rSet */ ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/drawfunc/chartsh.cxx b/sc/source/ui/drawfunc/chartsh.cxx index 4099d599c29c..77823a9b37d3 100644 --- a/sc/source/ui/drawfunc/chartsh.cxx +++ b/sc/source/ui/drawfunc/chartsh.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -79,3 +80,4 @@ ScChartShell::~ScChartShell() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx index 5199b721352a..5da044f24d89 100644 --- a/sc/source/ui/drawfunc/drawsh.cxx +++ b/sc/source/ui/drawfunc/drawsh.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -205,7 +206,6 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq ) ExecuteTextAttrDlg( rReq ); break; -#ifdef ISSUE66550_HLINK_FOR_SHAPES case SID_DRAW_HLINK_EDIT: if ( pSingleSelectedObj ) pViewData->GetDispatcher().Execute( SID_HYPERLINK_DIALOG ); @@ -233,7 +233,6 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq ) ScGlobal::OpenURL( pInfo->GetHlink(), String::EmptyString() ); } break; -#endif case SID_ATTR_TRANSFORM: { @@ -473,7 +472,6 @@ void ScDrawShell::ExecuteTextAttrDlg( SfxRequest& rReq, USHORT /* nTabPage */ ) delete( pDlg ); } -#ifdef ISSUE66550_HLINK_FOR_SHAPES void ScDrawShell::SetHlinkForObject( SdrObject* pObj, const rtl::OUString& rHlnk ) { if ( pObj ) @@ -483,5 +481,5 @@ void ScDrawShell::SetHlinkForObject( SdrObject* pObj, const rtl::OUString& rHlnk lcl_setModified( GetObjectShell() ); } } -#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/drawfunc/drawsh2.cxx b/sc/source/ui/drawfunc/drawsh2.cxx index 7da571fc05a7..0a5b5ad7c21f 100644 --- a/sc/source/ui/drawfunc/drawsh2.cxx +++ b/sc/source/ui/drawfunc/drawsh2.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -197,24 +198,20 @@ void ScDrawShell::GetDrawFuncState( SfxItemSet& rSet ) // Funktionen disabl BOOL bCanRename = FALSE; if ( nMarkCount > 1 ) { -#ifdef ISSUE66550_HLINK_FOR_SHAPES // no hypelink options for a selected group rSet.DisableItem( SID_DRAW_HLINK_EDIT ); rSet.DisableItem( SID_DRAW_HLINK_DELETE ); rSet.DisableItem( SID_OPEN_HYPERLINK ); -#endif } else if ( nMarkCount == 1 ) { SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); -#ifdef ISSUE66550_HLINK_FOR_SHAPES ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj ); if ( !pInfo || (pInfo->GetHlink().getLength() == 0) ) { rSet.DisableItem( SID_DRAW_HLINK_DELETE ); rSet.DisableItem( SID_OPEN_HYPERLINK ); } -#endif SdrLayerID nLayerID = pObj->GetLayer(); if ( nLayerID != SC_LAYER_INTERN ) bCanRename = TRUE; // #i51351# anything except internal objects can be renamed @@ -397,3 +394,4 @@ BOOL ScDrawShell::AreAllObjectsOnLayer(USHORT nLayerNo,const SdrMarkList& rMark) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/drawfunc/drawsh4.cxx b/sc/source/ui/drawfunc/drawsh4.cxx index 45b26584f29a..fe432103a912 100644 --- a/sc/source/ui/drawfunc/drawsh4.cxx +++ b/sc/source/ui/drawfunc/drawsh4.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -113,3 +114,4 @@ void ScDrawShell::GetFormTextState(SfxItemSet& rSet) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/drawfunc/drawsh5.cxx b/sc/source/ui/drawfunc/drawsh5.cxx index a05083eeadcc..23270038e419 100644 --- a/sc/source/ui/drawfunc/drawsh5.cxx +++ b/sc/source/ui/drawfunc/drawsh5.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -90,14 +91,12 @@ void ScDrawShell::GetHLinkState( SfxItemSet& rSet ) // Hyperlink if ( nMarkCount == 1 ) // URL-Button markiert ? { SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); -#ifdef ISSUE66550_HLINK_FOR_SHAPES ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj ); if ( pInfo && (pInfo->GetHlink().getLength() > 0) ) { aHLinkItem.SetURL( pInfo->GetHlink() ); aHLinkItem.SetInsertMode(HLINK_FIELD); } -#endif SdrUnoObj* pUnoCtrl = PTR_CAST(SdrUnoObj, pObj); if (pUnoCtrl && FmFormInventor == pUnoCtrl->GetObjInventor()) { @@ -240,13 +239,11 @@ void ScDrawShell::ExecuteHLink( SfxRequest& rReq ) bDone = TRUE; } } -#ifdef ISSUE66550_HLINK_FOR_SHAPES else { SetHlinkForObject( pObj, rURL ); bDone = TRUE; } -#endif } } @@ -756,3 +753,4 @@ ScDrawView* ScDrawShell::GetDrawView() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/drawfunc/drformsh.cxx b/sc/source/ui/drawfunc/drformsh.cxx index a2531c208f18..e9a986cac5f9 100644 --- a/sc/source/ui/drawfunc/drformsh.cxx +++ b/sc/source/ui/drawfunc/drformsh.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -79,3 +80,4 @@ ScDrawFormShell::~ScDrawFormShell() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx index a5159d8a8043..5f4297fa42e7 100644 --- a/sc/source/ui/drawfunc/drtxtob.cxx +++ b/sc/source/ui/drawfunc/drtxtob.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1093,3 +1094,4 @@ void ScDrawTextObjectBar::ExecuteTrans( SfxRequest& rReq ) } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/drawfunc/drtxtob1.cxx b/sc/source/ui/drawfunc/drtxtob1.cxx index 0ed0853bcd73..e3ab9efcd409 100644 --- a/sc/source/ui/drawfunc/drtxtob1.cxx +++ b/sc/source/ui/drawfunc/drtxtob1.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -146,3 +147,4 @@ void ScDrawTextObjectBar::ExecutePasteContents( SfxRequest & /* rReq */ ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/drawfunc/drtxtob2.cxx b/sc/source/ui/drawfunc/drtxtob2.cxx index 27f1a3dbb77f..aef408544aa4 100644 --- a/sc/source/ui/drawfunc/drtxtob2.cxx +++ b/sc/source/ui/drawfunc/drtxtob2.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -297,3 +298,4 @@ void ScDrawTextObjectBar::GetFormTextState(SfxItemSet& rSet) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/drawfunc/fuconarc.cxx b/sc/source/ui/drawfunc/fuconarc.cxx index 20daacffac0e..48c529d923e6 100644 --- a/sc/source/ui/drawfunc/fuconarc.cxx +++ b/sc/source/ui/drawfunc/fuconarc.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -232,3 +233,4 @@ SdrObject* FuConstArc::CreateDefaultObject(const sal_uInt16 nID, const Rectangle } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/drawfunc/fuconcustomshape.cxx b/sc/source/ui/drawfunc/fuconcustomshape.cxx index 69a47f0584d0..dfcbdb2f5d49 100644 --- a/sc/source/ui/drawfunc/fuconcustomshape.cxx +++ b/sc/source/ui/drawfunc/fuconcustomshape.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -286,3 +287,5 @@ bool FuConstCustomShape::doConstructOrthogonal() const } // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/drawfunc/fuconpol.cxx b/sc/source/ui/drawfunc/fuconpol.cxx index 440f49f41326..d10259e3456e 100644 --- a/sc/source/ui/drawfunc/fuconpol.cxx +++ b/sc/source/ui/drawfunc/fuconpol.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -353,3 +354,5 @@ SdrObject* FuConstPolygon::CreateDefaultObject(const sal_uInt16 nID, const Recta } // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/drawfunc/fuconrec.cxx b/sc/source/ui/drawfunc/fuconrec.cxx index 733c6fe08b45..71d46ea98b7c 100644 --- a/sc/source/ui/drawfunc/fuconrec.cxx +++ b/sc/source/ui/drawfunc/fuconrec.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -313,3 +314,4 @@ SdrObject* FuConstRectangle::CreateDefaultObject(const sal_uInt16 nID, const Rec return pObj; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/drawfunc/fuconstr.cxx b/sc/source/ui/drawfunc/fuconstr.cxx index bb918e9005ae..63b1a34ac221 100644 --- a/sc/source/ui/drawfunc/fuconstr.cxx +++ b/sc/source/ui/drawfunc/fuconstr.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -333,3 +334,4 @@ void FuConstruct::Deactivate() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/drawfunc/fuconuno.cxx b/sc/source/ui/drawfunc/fuconuno.cxx index c1212d4d9699..45df699b3e75 100644 --- a/sc/source/ui/drawfunc/fuconuno.cxx +++ b/sc/source/ui/drawfunc/fuconuno.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -188,3 +189,4 @@ SdrObject* FuConstUnoControl::CreateDefaultObject(const sal_uInt16 /* nID */, co } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/drawfunc/fudraw.cxx b/sc/source/ui/drawfunc/fudraw.cxx index 1142e34b780d..70342cc10e24 100644 --- a/sc/source/ui/drawfunc/fudraw.cxx +++ b/sc/source/ui/drawfunc/fudraw.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -828,11 +829,7 @@ void FuDraw::ForcePointer(const MouseEvent* pMEvt) SdrObjMacroHitRec aHitRec; //! muss da noch irgendwas gesetzt werden ???? pViewShell->SetActivePointer( pObj->GetMacroPointer(aHitRec) ); } -#ifdef ISSUE66550_HLINK_FOR_SHAPES else if ( !bAlt && pInfo && ((pInfo->GetMacro().getLength() > 0) || (pInfo->GetHlink().getLength() > 0)) ) -#else - else if ( !bAlt && pInfo && (pInfo->GetMacro().getLength() > 0) ) -#endif pWindow->SetPointer( Pointer( POINTER_REFHAND ) ); else if ( IsDetectiveHit( aPnt ) ) pViewShell->SetActivePointer( Pointer( POINTER_DETECTIVE ) ); @@ -861,3 +858,5 @@ BOOL FuDraw::IsSizingOrMovingNote( const MouseEvent& rMEvt ) const } return bIsSizingOrMoving; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/drawfunc/fuins1.cxx b/sc/source/ui/drawfunc/fuins1.cxx index ead135751cce..bf1dc7abd133 100644 --- a/sc/source/ui/drawfunc/fuins1.cxx +++ b/sc/source/ui/drawfunc/fuins1.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -455,3 +456,5 @@ void FuInsertMedia::Deactivate() { FuPoor::Deactivate(); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx index f648a1484e8e..89a483d736d5 100644 --- a/sc/source/ui/drawfunc/fuins2.cxx +++ b/sc/source/ui/drawfunc/fuins2.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -847,3 +848,4 @@ void FuInsertChart::Deactivate() } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/drawfunc/fumark.cxx b/sc/source/ui/drawfunc/fumark.cxx index 02554c495729..dfbf584bc8bd 100644 --- a/sc/source/ui/drawfunc/fumark.cxx +++ b/sc/source/ui/drawfunc/fumark.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -288,3 +289,4 @@ void FuMarkRect::ForcePointer(const MouseEvent* /* pMEvt */) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/drawfunc/fupoor.cxx b/sc/source/ui/drawfunc/fupoor.cxx index 0bffdfe7ef84..370385aace20 100644 --- a/sc/source/ui/drawfunc/fupoor.cxx +++ b/sc/source/ui/drawfunc/fupoor.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -383,3 +384,5 @@ bool FuPoor::doConstructOrthogonal() const } // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/drawfunc/fusel.cxx b/sc/source/ui/drawfunc/fusel.cxx index 4a456522003c..1fdf75eabc2f 100644 --- a/sc/source/ui/drawfunc/fusel.cxx +++ b/sc/source/ui/drawfunc/fusel.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -202,7 +203,6 @@ BOOL __EXPORT FuSelection::MouseButtonDown(const MouseEvent& rMEvt) } ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj, TRUE ); -#ifdef ISSUE66550_HLINK_FOR_SHAPES // For interoperability favour links over macros if both are defined if ( pInfo->GetHlink().getLength() > 0 ) { @@ -210,20 +210,27 @@ BOOL __EXPORT FuSelection::MouseButtonDown(const MouseEvent& rMEvt) sURL = pInfo->GetHlink(); } else if ( pInfo->GetMacro().getLength() > 0 ) -#else - if ( pInfo->GetMacro().getLength() > 0 ) -#endif { SfxObjectShell* pObjSh = SfxObjectShell::Current(); if ( pObjSh && SfxApplication::IsXScriptURL( pInfo->GetMacro() ) ) { + uno::Reference< beans::XPropertySet > xProps( pObj->getUnoShape(), uno::UNO_QUERY ); + uno::Any aCaller; + if ( xProps.is() ) + { + try + { + aCaller = xProps->getPropertyValue( rtl::OUString::createFromAscii("Name") ); + } + catch( uno::Exception& ) {} + } uno::Any aRet; uno::Sequence< sal_Int16 > aOutArgsIndex; uno::Sequence< uno::Any > aOutArgs; uno::Sequence< uno::Any >* pInArgs = new uno::Sequence< uno::Any >(0); pObjSh->CallXScript( pInfo->GetMacro(), - *pInArgs, aRet, aOutArgsIndex, aOutArgs); + *pInArgs, aRet, aOutArgsIndex, aOutArgs, true, &aCaller ); pViewShell->FakeButtonUp( pViewShell->GetViewData()->GetActivePart() ); return TRUE; // kein CaptureMouse etc. } @@ -647,3 +654,4 @@ void FuSelection::Deactivate() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/drawfunc/fusel2.cxx b/sc/source/ui/drawfunc/fusel2.cxx index 402143ac0a8c..8e884ee45a61 100644 --- a/sc/source/ui/drawfunc/fusel2.cxx +++ b/sc/source/ui/drawfunc/fusel2.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -183,3 +184,4 @@ void FuSelection::ActivateNoteHandles(SdrObject* pObject) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/drawfunc/futext.cxx b/sc/source/ui/drawfunc/futext.cxx index a13cfc61d1c6..6742ea4c8186 100644 --- a/sc/source/ui/drawfunc/futext.cxx +++ b/sc/source/ui/drawfunc/futext.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -880,3 +881,4 @@ SdrObject* FuText::CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rR return pObj; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/drawfunc/futext2.cxx b/sc/source/ui/drawfunc/futext2.cxx index 340e71faa71c..354339dd0d75 100644 --- a/sc/source/ui/drawfunc/futext2.cxx +++ b/sc/source/ui/drawfunc/futext2.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -305,3 +306,4 @@ SdrOutliner* FuText::MakeOutliner() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/drawfunc/futext3.cxx b/sc/source/ui/drawfunc/futext3.cxx index 534e68705fa8..b1fad759a9ec 100644 --- a/sc/source/ui/drawfunc/futext3.cxx +++ b/sc/source/ui/drawfunc/futext3.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -247,3 +248,4 @@ void FuText::StopDragMode(SdrObject* /*pObject*/) #endif } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/drawfunc/graphsh.cxx b/sc/source/ui/drawfunc/graphsh.cxx index 25cda28aaa9d..101ce8578f05 100644 --- a/sc/source/ui/drawfunc/graphsh.cxx +++ b/sc/source/ui/drawfunc/graphsh.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -146,3 +147,4 @@ void ScGraphicShell::ExecuteFilter( SfxRequest& rReq ) Invalidate(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/drawfunc/makefile.mk b/sc/source/ui/drawfunc/makefile.mk index a50c450ab373..f82008e4cdeb 100644 --- a/sc/source/ui/drawfunc/makefile.mk +++ b/sc/source/ui/drawfunc/makefile.mk @@ -75,6 +75,7 @@ SLOFILES = \ $(SLO)$/mediash.obj EXCEPTIONSFILES= \ + $(SLO)$/fusel.obj \ $(SLO)$/fuins2.obj \ $(SLO)$/graphsh.obj \ $(SLO)$/mediash.obj diff --git a/sc/source/ui/drawfunc/mediash.cxx b/sc/source/ui/drawfunc/mediash.cxx index 78948550aea6..542573e39fa9 100644 --- a/sc/source/ui/drawfunc/mediash.cxx +++ b/sc/source/ui/drawfunc/mediash.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -141,3 +142,5 @@ void ScMediaShell::ExecuteMedia( SfxRequest& rReq ) 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 82649044b38c..c221567f3671 100644 --- a/sc/source/ui/drawfunc/objdraw.src +++ b/sc/source/ui/drawfunc/objdraw.src @@ -186,7 +186,6 @@ ITEM_FORMAT_PARA_DLG\ }; -#ifdef ISSUE66550_HLINK_FOR_SHAPES #define MN_EDITLNK \ MenuItem\ {\ @@ -202,7 +201,6 @@ HelpID = SID_DRAW_HLINK_DELETE ; \ Text [ en-US ] = "~Remove Hyperlink" ; \ }; -#endif #define MN_DRWTXTATTR \ MenuItem\ @@ -1297,14 +1295,12 @@ Menu RID_POPUP_DRAW MenuItem { Separator = TRUE ; }; //------------------------------ ITEM_GROUP_MENU -#ifdef ISSUE66550_HLINK_FOR_SHAPES //------------------------------ MenuItem { Separator = TRUE ; }; //------------------------------ MN_EDITLNK MN_DELLNK MenuItem { ITEM_OPEN_HYPERLINK }; -#endif }; }; @@ -1374,14 +1370,12 @@ Menu RID_POPUP_GRAPHIC MenuItem { Separator = TRUE ; }; //------------------------------ ITEM_GROUP_MENU -#ifdef ISSUE66550_HLINK_FOR_SHAPES //------------------------------ MenuItem { Separator = TRUE ; }; //------------------------------ MN_EDITLNK MN_DELLNK MenuItem { ITEM_OPEN_HYPERLINK }; -#endif }; }; diff --git a/sc/source/ui/drawfunc/oleobjsh.cxx b/sc/source/ui/drawfunc/oleobjsh.cxx index 5f6a3a6c2f5e..d8a0b8c052ac 100644 --- a/sc/source/ui/drawfunc/oleobjsh.cxx +++ b/sc/source/ui/drawfunc/oleobjsh.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -79,3 +80,4 @@ ScOleObjectShell::~ScOleObjectShell() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/formdlg/dwfunctr.cxx b/sc/source/ui/formdlg/dwfunctr.cxx index 1d522fb3211e..d22531e76f59 100644 --- a/sc/source/ui/formdlg/dwfunctr.cxx +++ b/sc/source/ui/formdlg/dwfunctr.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1180,3 +1181,4 @@ void ScFunctionDockWin::StateChanged( StateChangedType nStateChange ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/formdlg/formdata.cxx b/sc/source/ui/formdlg/formdata.cxx index e493e3f7b00f..d11ad33a6a45 100644 --- a/sc/source/ui/formdlg/formdata.cxx +++ b/sc/source/ui/formdlg/formdata.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -59,3 +60,4 @@ void ScFormEditData::SaveValues() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx index 25971594f116..fec3f5885932 100644 --- a/sc/source/ui/formdlg/formula.cxx +++ b/sc/source/ui/formdlg/formula.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -670,3 +671,4 @@ table::CellAddress ScFormulaDlg::getReferencePosition() const return pArray; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/formdlg/privsplt.cxx b/sc/source/ui/formdlg/privsplt.cxx index a3b27ba21b1d..2497a86707d6 100644 --- a/sc/source/ui/formdlg/privsplt.cxx +++ b/sc/source/ui/formdlg/privsplt.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -420,3 +421,4 @@ void ScPrivatSplit::DataChanged( const DataChangedEvent& rDCEvt ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/asciiopt.hxx b/sc/source/ui/inc/asciiopt.hxx index 9d798083a155..469a8f2da0f2 100644 --- a/sc/source/ui/inc/asciiopt.hxx +++ b/sc/source/ui/inc/asciiopt.hxx @@ -44,7 +44,7 @@ // ============================================================================ -class ScAsciiOptions +class SC_DLLPUBLIC ScAsciiOptions { private: BOOL bFixedLen; diff --git a/sc/source/ui/inc/datafdlg.hrc b/sc/source/ui/inc/datafdlg.hrc new file mode 100644 index 000000000000..edc14778ff8d --- /dev/null +++ b/sc/source/ui/inc/datafdlg.hrc @@ -0,0 +1,40 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Novell Inc. + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Amelia Wang <amwang@novell.com> + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ +#include "sc.hrc" // -> RID_SCDLG_DATAFORM + +//dataform +#define BTN_DATAFORM_NEW 1001 +#define BTN_DATAFORM_DELETE 1002 +#define BTN_DATAFORM_RESTORE 1003 +#define BTN_DATAFORM_LAST 1004 +#define BTN_DATAFORM_NEXT 1005 +#define BTN_DATAFORM_CLOSE 1007 +#define WND_DATAFORM_SCROLLBAR 1008 +#define LAB_DATAFORM_RECORDNO 1009 + +#define FT_DATAFORM_FIXEDTEXT1 2001 +#define ED_DATAFORM_EDIT1 2002 diff --git a/sc/source/ui/inc/datafdlg.hxx b/sc/source/ui/inc/datafdlg.hxx new file mode 100644 index 000000000000..bd6d3f3d4965 --- /dev/null +++ b/sc/source/ui/inc/datafdlg.hxx @@ -0,0 +1,111 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Novell Inc. + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Amelia Wang <amwang@novell.com> + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#ifndef SC_DATAFDLG_HXX +#define SC_DATAFDLG_HXX + + +#ifndef _SV_DIALOG_HXX //autogen +#include <vcl/dialog.hxx> +#endif + +#ifndef _SV_BUTTON_HXX //autogen +#include <vcl/imagebtn.hxx> +#endif + +#ifndef _SV_FIXED_HXX //autogen +#include <vcl/fixed.hxx> +#endif + + +#include "global.hxx" + +#include <tabvwsh.hxx> +#include <sfx2/bindings.hxx> +#include <sfx2/dispatch.hxx> + +#define MAX_DATAFORM_COLS 256 +#define MAX_DATAFORM_ROWS 32000 +#define CTRL_HEIGHT 22 +#define FIXED_WIDTH 60 +#define EDIT_WIDTH 140 +#define FIXED_LEFT 12 +#define EDIT_LEFT 78 +#define LINE_HEIGHT 30 + +//zhangyun +class ScDataFormDlg : public ModalDialog +{ +private: + + PushButton aBtnNew; + PushButton aBtnDelete; + PushButton aBtnRestore; + PushButton aBtnLast; + PushButton aBtnNext; + PushButton aBtnClose; + ScrollBar aSlider; + FixedText aFixedText; + //FixedText aFixedText1; + //Edit aEdit1; + + ScTabViewShell* pTabViewShell; + ScDocument* pDoc; + sal_uInt16 aColLength; + SCROW aCurrentRow; + SCCOL nStartCol; + SCCOL nEndCol; + SCROW nStartRow; + SCROW nEndRow; + SCTAB nTab; + BOOL bNoSelection; + + FixedText** pFixedTexts; + Edit** pEdits; + +public: + ScDataFormDlg( Window* pParent, ScTabViewShell* pTabViewShell); + ~ScDataFormDlg(); + + void FillCtrls(SCROW nCurrentRow); +private: + + void SetButtonState(); + + // Handler: + DECL_LINK( Impl_NewHdl, PushButton* ); + DECL_LINK( Impl_LastHdl, PushButton* ); + DECL_LINK( Impl_NextHdl, PushButton* ); + + DECL_LINK( Impl_RestoreHdl, PushButton* ); + DECL_LINK( Impl_DeleteHdl, PushButton* ); + DECL_LINK( Impl_CloseHdl, PushButton* ); + + DECL_LINK( Impl_ScrollHdl, ScrollBar* ); + DECL_LINK( Impl_DataModifyHdl, Edit* ); +}; +#endif // SC_DATAFDLG_HXX diff --git a/sc/source/ui/inc/docfunc.hxx b/sc/source/ui/inc/docfunc.hxx index 6c61364c5228..a28692350421 100644 --- a/sc/source/ui/inc/docfunc.hxx +++ b/sc/source/ui/inc/docfunc.hxx @@ -167,6 +167,8 @@ public: double fStart, double fStep, double fMax, BOOL bRecord, BOOL bApi ); // FillAuto: rRange wird von Source-Range auf Dest-Range angepasst + SC_DLLPUBLIC BOOL FillAuto( ScRange& rRange, const ScMarkData* pTabMark, FillDir eDir, FillCmd eCmd, FillDateCmd eDateCmd, ULONG nCount, double fStep, double fMax, BOOL bRecord, BOOL bApi ); + BOOL FillAuto( ScRange& rRange, const ScMarkData* pTabMark, FillDir eDir, ULONG nCount, BOOL bRecord, BOOL bApi ); diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx index f7061e179fae..db675399d688 100644 --- a/sc/source/ui/inc/docsh.hxx +++ b/sc/source/ui/inc/docsh.hxx @@ -43,6 +43,7 @@ #include "optutil.hxx" #include <hash_map> +#include <cppuhelper/implbase1.hxx> class ScEditEngineDefaulter; class FontList; @@ -301,6 +302,10 @@ public: ScMarkData& rMark, BOOL bRecord = TRUE ); void ModifyScenario( SCTAB nTab, const String& rName, const String& rComment, const Color& rColor, USHORT nFlags ); + ULONG TransferTab( ScDocShell& rSrcDocShell, SCTAB nSrcPos, + SCTAB nDestPos, BOOL bInsertNew, + BOOL bNotifyAndPaint ); + BOOL MoveTable( SCTAB nSrcTab, SCTAB nDestTab, BOOL bCopy, BOOL bRecord ); void DoRecalc( BOOL bApi ); diff --git a/sc/source/ui/inc/dpcontrol.hxx b/sc/source/ui/inc/dpcontrol.hxx index 45badf0c88fd..25cb3e05acac 100644 --- a/sc/source/ui/inc/dpcontrol.hxx +++ b/sc/source/ui/inc/dpcontrol.hxx @@ -69,11 +69,12 @@ public: ~ScDPFieldButton(); void setText(const ::rtl::OUString& rText); - void setBoundingBox(const Point& rPos, const Size& rSize); + void setBoundingBox(const Point& rPos, const Size& rSize, bool bLayoutRTL); void setDrawBaseButton(bool b); void setDrawPopupButton(bool b); void setHasHiddenMember(bool b); void setPopupPressed(bool b); + void setPopupLeft(bool b); void draw(); void getPopupBoundingBox(Point& rPos, Size& rSize) const; @@ -94,6 +95,7 @@ private: bool mbPopupButton; bool mbHasHiddenMember; bool mbPopupPressed; + bool mbPopupLeft; }; // ============================================================================ diff --git a/sc/source/ui/inc/drawsh.hxx b/sc/source/ui/inc/drawsh.hxx index e633ab00e277..8d2e7238f759 100644 --- a/sc/source/ui/inc/drawsh.hxx +++ b/sc/source/ui/inc/drawsh.hxx @@ -44,9 +44,7 @@ class ScDrawShell : public SfxShell DECL_LINK( NameObjectHdl, AbstractSvxNameDialog* ); -#ifdef ISSUE66550_HLINK_FOR_SHAPES void SetHlinkForObject( SdrObject* pObj, const rtl::OUString& rHlnk ); -#endif protected: ScViewData* GetViewData() { return pViewData; } diff --git a/sc/source/ui/inc/impex.hxx b/sc/source/ui/inc/impex.hxx index 86a91216edcc..164c4edb187c 100644 --- a/sc/source/ui/inc/impex.hxx +++ b/sc/source/ui/inc/impex.hxx @@ -50,7 +50,7 @@ struct ScExportTextOptions bool mbAddQuotes; }; -class ScImportExport +class SC_DLLPUBLIC ScImportExport { ScDocShell* pDocSh; ScDocument* pDoc; diff --git a/sc/source/ui/inc/tabcont.hxx b/sc/source/ui/inc/tabcont.hxx index d77ee812fdb3..245adc7e974e 100644 --- a/sc/source/ui/inc/tabcont.hxx +++ b/sc/source/ui/inc/tabcont.hxx @@ -76,6 +76,7 @@ public: using TabBar::StartDrag; + void UpdateInputContext(); void UpdateStatus(); void ActivateView(BOOL bActivate); diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx index 7bfd0201cbb8..5109c99cb223 100644 --- a/sc/source/ui/inc/tabvwsh.hxx +++ b/sc/source/ui/inc/tabvwsh.hxx @@ -246,7 +246,7 @@ public: virtual ~ScTabViewShell(); - Window* GetDialogParent(); + SC_DLLPUBLIC Window* GetDialogParent(); bool IsRefInputMode() const; void ExecuteInputDirect(); @@ -289,7 +289,7 @@ public: void GetSaveState( SfxItemSet& rSet ); void ExecSearch( SfxRequest& rReq ); - void ExecuteUndo(SfxRequest& rReq); + SC_DLLPUBLIC void ExecuteUndo(SfxRequest& rReq); void GetUndoState(SfxItemSet &rSet); void ExecuteSbx( SfxRequest& rReq ); diff --git a/sc/source/ui/inc/undodat.hxx b/sc/source/ui/inc/undodat.hxx index 76f3d42a8475..fafc71511f03 100644 --- a/sc/source/ui/inc/undodat.hxx +++ b/sc/source/ui/inc/undodat.hxx @@ -495,7 +495,43 @@ private: void Init(); }; +// amelia +class ScUndoDataForm: public ScBlockUndo +{ +public: + TYPEINFO(); + ScUndoDataForm( ScDocShell* pNewDocShell, + SCCOL nStartX, SCROW nStartY, SCTAB nStartZ, + SCCOL nEndX, SCROW nEndY, SCTAB nEndZ, + const ScMarkData& rMark, + ScDocument* pNewUndoDoc, ScDocument* pNewRedoDoc, + USHORT nNewFlags, + ScRefUndoData* pRefData, void* pFill1, void* pFill2, void* pFill3, + BOOL bRedoIsFilled = TRUE + ); + virtual ~ScUndoDataForm(); + + virtual void Undo(); + virtual void Redo(); + virtual void Repeat(SfxRepeatTarget& rTarget); + virtual BOOL CanRepeat(SfxRepeatTarget& rTarget) const; + virtual String GetComment() const; + +private: + ScMarkData aMarkData; + ScDocument* pUndoDoc; + ScDocument* pRedoDoc; + USHORT nFlags; + ScRefUndoData* pRefUndoData; + ScRefUndoData* pRefRedoData; + ULONG nStartChangeAction; + ULONG nEndChangeAction; + BOOL bRedoFilled; + + void DoChange( const BOOL bUndo ); + void SetChangeTrack(); +}; #endif diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx index 301c3e5663f7..4f7e9e01771a 100644 --- a/sc/source/ui/inc/viewfunc.hxx +++ b/sc/source/ui/inc/viewfunc.hxx @@ -110,6 +110,8 @@ public: SC_DLLPUBLIC void CutToClip( ScDocument* pClipDoc = NULL, BOOL bIncludeObjects = FALSE ); SC_DLLPUBLIC BOOL CopyToClip( ScDocument* pClipDoc = NULL, BOOL bCut = FALSE, BOOL bApi = FALSE, BOOL bIncludeObjects = FALSE, BOOL bStopEdit = TRUE ); + SC_DLLPUBLIC BOOL CopyToClip( ScDocument* pClipDoc, const ScRange& rRange, BOOL bCut = FALSE, + BOOL bApi = FALSE, BOOL bIncludeObjects = FALSE, BOOL bStopEdit = TRUE ); ScTransferObj* CopyToTransferable(); SC_DLLPUBLIC BOOL PasteFromClip( USHORT nFlags, ScDocument* pClipDoc, USHORT nFunction = PASTE_NOFUNC, BOOL bSkipEmpty = FALSE, @@ -337,6 +339,13 @@ public: void ForgetFormatArea() { bFormatValid = FALSE; } BOOL SelectionEditable( BOOL* pOnlyNotBecauseOfMatrix = NULL ); + // Amelia Wang + SC_DLLPUBLIC void DataFormPutData( SCROW nCurrentRow , + SCROW nStartRow , SCCOL nStartCol , + SCROW nEndRow , SCCOL nEndCol , + Edit** pEdits , + sal_uInt16 aColLength ); + // interne Hilfsfunktionen protected: void UpdateLineAttrs( SvxBorderLine& rLine, diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx index 626f48254f37..ce6473c2b068 100644 --- a/sc/source/ui/miscdlgs/acredlin.cxx +++ b/sc/source/ui/miscdlgs/acredlin.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -2133,3 +2134,4 @@ IMPL_LINK( ScAcceptChgDlg, ColCompareHdl, SvSortData*, pSortData ) return eCompare; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/miscdlgs/anyrefdg.cxx b/sc/source/ui/miscdlgs/anyrefdg.cxx index 32b3376da9a7..0c46284c77d7 100644 --- a/sc/source/ui/miscdlgs/anyrefdg.cxx +++ b/sc/source/ui/miscdlgs/anyrefdg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1009,3 +1010,4 @@ void ScRefHandler::RefInputDone( BOOL bForced ) m_aHelper.RefInputDone( bForced ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/miscdlgs/autofmt.cxx b/sc/source/ui/miscdlgs/autofmt.cxx index ce981a6e5793..18013a089306 100644 --- a/sc/source/ui/miscdlgs/autofmt.cxx +++ b/sc/source/ui/miscdlgs/autofmt.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -565,3 +566,4 @@ void ScAutoFmtPreview::Paint( const Rectangle& rRect ) DoPaint( rRect ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/miscdlgs/conflictsdlg.cxx b/sc/source/ui/miscdlgs/conflictsdlg.cxx index 213c0b6a16a3..ef525d6d8447 100644 --- a/sc/source/ui/miscdlgs/conflictsdlg.cxx +++ b/sc/source/ui/miscdlgs/conflictsdlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -856,3 +857,5 @@ void ScConflictsDlg::UpdateView() } } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/miscdlgs/crdlg.cxx b/sc/source/ui/miscdlgs/crdlg.cxx index 074d54a5c912..5100474274df 100644 --- a/sc/source/ui/miscdlgs/crdlg.cxx +++ b/sc/source/ui/miscdlgs/crdlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -85,3 +86,4 @@ IMPL_LINK_INLINE_END( ScColOrRowDlg, OkHdl, OKButton *, EMPTYARG ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/miscdlgs/crnrdlg.cxx b/sc/source/ui/miscdlgs/crnrdlg.cxx index 0ad2a2e80ca4..7afec7c603b4 100644 --- a/sc/source/ui/miscdlgs/crnrdlg.cxx +++ b/sc/source/ui/miscdlgs/crnrdlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1170,3 +1171,5 @@ IMPL_LINK( ScColRowNameRangesDlg, LoseFocusHdl, Control*, EMPTYARG ) bDlgLostFocus = !IsActive(); return 0; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/miscdlgs/datafdlg.cxx b/sc/source/ui/miscdlgs/datafdlg.cxx new file mode 100644 index 000000000000..b5d910f94343 --- /dev/null +++ b/sc/source/ui/miscdlgs/datafdlg.cxx @@ -0,0 +1,414 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Novell Inc. + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Amelia Wang <amwang@novell.com> + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_sc.hxx" + +#undef SC_DLLIMPLEMENTATION + +//------------------------------------------------------------------ + +#include "datafdlg.hxx" +#include "scresid.hxx" +#include "datafdlg.hrc" +#include "viewdata.hxx" +//#include "document.hxx" +#include "docsh.hxx" +#include "refundo.hxx" +#include "undodat.hxx" + +#define HDL(hdl) LINK( this, ScDataFormDlg, hdl ) + +//zhangyun +ScDataFormDlg::ScDataFormDlg( Window* pParent, ScTabViewShell* pTabViewShellOri) : + ModalDialog ( pParent, ScResId( RID_SCDLG_DATAFORM ) ), + // + aBtnNew ( this, ScResId( BTN_DATAFORM_NEW ) ), + aBtnDelete ( this, ScResId( BTN_DATAFORM_DELETE ) ), + aBtnRestore ( this, ScResId( BTN_DATAFORM_RESTORE ) ), + aBtnLast ( this, ScResId( BTN_DATAFORM_LAST ) ), + aBtnNext ( this, ScResId( BTN_DATAFORM_NEXT ) ), + aBtnClose ( this, ScResId( BTN_DATAFORM_CLOSE ) ), + aSlider ( this, ScResId( WND_DATAFORM_SCROLLBAR ) ), + aFixedText ( this, ScResId( LAB_DATAFORM_RECORDNO ) ) +{ + pTabViewShell = pTabViewShellOri; + FreeResource(); + //read header form current document, and add new controls + DBG_ASSERT( pTabViewShell, "pTabViewShell is NULL! :-/" ); + ScViewData* pViewData = pTabViewShell->GetViewData(); + + pDoc = pViewData->GetDocument(); + if (pDoc) + { + ScRange aRange; + pViewData->GetSimpleArea( aRange ); + ScAddress aStart = aRange.aStart; + ScAddress aEnd = aRange.aEnd; + + nStartCol = aStart.Col(); + nEndCol = aEnd.Col(); + nStartRow = aStart.Row(); + nEndRow = aEnd.Row(); + + nTab = pViewData->GetTabNo(); + //if there is no selection + if ((nStartCol == nEndCol) && (nStartRow == nEndRow)) + bNoSelection = TRUE; + + if (bNoSelection) + { + //find last not blank cell in row + for (int i=1;i<=MAX_DATAFORM_COLS;i++) + { + String aColName; + nEndCol++; + pDoc->GetString( nEndCol, nStartRow, nTab, aColName ); + int nColWidth = pDoc->GetColWidth( nEndCol, nTab ); + if ( aColName.Len() == 0 && nColWidth) + { + nEndCol--; + break; + } + } + + //find first not blank cell in row + for (int i=1;i<=MAX_DATAFORM_COLS;i++) + { + String aColName; + if (nStartCol <= 0) + break; + nStartCol--; + + pDoc->GetString( nStartCol, nStartRow, nTab, aColName ); + int nColWidth = pDoc->GetColWidth( nEndCol, nTab ); + if ( aColName.Len() == 0 && nColWidth) + { + nStartCol++; + break; + } + } + + //skip leading hide column + for (int i=1;i<=MAX_DATAFORM_COLS;i++) + { + String aColName; + int nColWidth = pDoc->GetColWidth( nStartCol, nTab ); + if (nColWidth) + break; + nStartCol++; + } + + if (nEndCol < nStartCol) + nEndCol = nStartCol; + + //find last not blank cell in row + for (int i=1;i<=MAX_DATAFORM_ROWS;i++) + { + String aColName; + nEndRow++; + pDoc->GetString( nStartCol, nEndRow, nTab, aColName ); + if ( aColName.Len() == 0 ) + { + nEndRow--; + break; + } + } + + //find first not blank cell in row + for (int i=1;i<=MAX_DATAFORM_ROWS;i++) + { + String aColName; + if (nStartRow <= 0) + break; + nStartRow--; + + pDoc->GetString( nStartCol, nStartRow, nTab, aColName ); + if ( aColName.Len() == 0 ) + { + nStartRow++; + break; + } + } + + if (nEndRow < nStartRow) + nEndRow = nStartRow; + } + + aCurrentRow = nStartRow + 1; + + String aFieldName; + + int nTop = 12; + + Size nFixedSize(FIXED_WIDTH, CTRL_HEIGHT ); + Size nEditSize(EDIT_WIDTH, CTRL_HEIGHT ); + + //pFtArray = new FixedText(this); + aColLength = nEndCol - nStartCol + 1; + + //new the controls + pFixedTexts = new FixedText*[aColLength]; + pEdits = new Edit*[aColLength]; + + for(sal_uInt16 nIndex = 0; nIndex < aColLength; nIndex++) + { + pDoc->GetString( nIndex + nStartCol, nStartRow, nTab, aFieldName ); + int nColWidth = pDoc->GetColWidth( nIndex + nStartCol, nTab ); + if (nColWidth) + { + pFixedTexts[nIndex] = new FixedText(this); + pEdits[nIndex] = new Edit(this, WB_BORDER); + + pFixedTexts[nIndex]->SetSizePixel(nFixedSize); + pEdits[nIndex]->SetSizePixel(nEditSize); + pFixedTexts[nIndex]->SetPosPixel(Point(FIXED_LEFT, nTop)); + pEdits[nIndex]->SetPosPixel(Point(EDIT_LEFT, nTop)); + //pFixedTexts[nIndex]->SetText(String::CreateFromAscii("W4W-Filter Nr. ")); + pFixedTexts[nIndex]->SetText(aFieldName); + pFixedTexts[nIndex]->Show(); + pEdits[nIndex]->Show(); + + nTop += LINE_HEIGHT; + } + else + { + pFixedTexts[nIndex] = NULL; + pEdits[nIndex] = NULL; + } + pEdits[nIndex]->SetModifyHdl( HDL(Impl_DataModifyHdl) ); + } + + Size nDialogSize = this->GetSizePixel(); + if (nTop > nDialogSize.Height()) + { + nDialogSize.setHeight(nTop); + this->SetSizePixel(nDialogSize); + } + Size nScrollSize = aSlider.GetSizePixel(); + nScrollSize.setHeight(nDialogSize.Height()-20); + aSlider.SetSizePixel(nScrollSize); + } + + FillCtrls(aCurrentRow); + + aSlider.SetPageSize( 10 ); + aSlider.SetVisibleSize( 1 ); + aSlider.SetLineSize( 1 ); + aSlider.SetRange( Range( 0, nEndRow - nStartRow + 1) ); + aSlider.Show(); + + aBtnNew.SetClickHdl ( HDL(Impl_NewHdl) ); + aBtnLast.SetClickHdl ( HDL(Impl_LastHdl) ); + aBtnNext.SetClickHdl ( HDL(Impl_NextHdl) ); + + aBtnRestore.SetClickHdl ( HDL(Impl_RestoreHdl) ); + aBtnDelete.SetClickHdl ( HDL(Impl_DeleteHdl) ); + aBtnClose.SetClickHdl ( HDL(Impl_CloseHdl) ); + + aSlider.SetEndScrollHdl( HDL( Impl_ScrollHdl ) ); + + SetButtonState(); + + //end + //FreeResource(); +} + +ScDataFormDlg::~ScDataFormDlg() +{ + for(sal_uInt16 i = 0; i < aColLength; i++) + { + if (pEdits[i]) + delete pEdits[i]; + if (pFixedTexts[i]) + delete pFixedTexts[i]; + } + if (pEdits) + delete pEdits; + if (pFixedTexts) + delete pFixedTexts; +} + +void ScDataFormDlg::FillCtrls(SCROW /*nCurrentRow*/) +{ + //ScViewData* pViewData = pTabViewShell->GetViewData(); + + //pDoc = pViewData->GetDocument(); + String aFieldName; + int nRecordNum = nEndRow - nStartRow; + for(sal_uInt16 i = 0; i < aColLength; i++) + { + if (pEdits[i]) + { + if (aCurrentRow<=nEndRow) + { + pDoc->GetString( i + nStartCol, aCurrentRow, nTab, aFieldName ); + pEdits[i]->SetText(aFieldName); + } + else + pEdits[i]->SetText(String()); + } + } + char sRecordStr[256]; + if (aCurrentRow<=nEndRow) + aFixedText.SetText(String::CreateFromAscii(sRecordStr)); + else + aFixedText.SetText(String::CreateFromAscii("New Record")); + + aSlider.SetThumbPos(aCurrentRow-nStartRow-1); +} + +IMPL_LINK( ScDataFormDlg, Impl_DataModifyHdl, Edit*, pEdit) +{ + if ( pEdit->IsModified() ) + aBtnRestore.Enable( TRUE ); + return 0; +} + +IMPL_LINK( ScDataFormDlg, Impl_NewHdl, PushButton*, EMPTYARG ) +{ + ScViewData* pViewData = pTabViewShell->GetViewData(); + ScDocShell* pDocSh = pViewData->GetDocShell(); + if ( pDoc ) + { + sal_Bool bHasData = sal_False; + for(sal_uInt16 i = 0; i < aColLength; i++) + if (pEdits[i]) + if ( pEdits[i]->GetText().Len() != 0 ) + { + bHasData = sal_True; + break; + } + + if ( bHasData ) + { + pTabViewShell->DataFormPutData( aCurrentRow , nStartRow , nStartCol , nEndRow , nEndCol , pEdits , aColLength ); + aCurrentRow++; + if (aCurrentRow >= nEndRow + 2) + { + nEndRow ++ ; + aSlider.SetRange( Range( 0, nEndRow - nStartRow + 1) ); + } + SetButtonState(); + FillCtrls(aCurrentRow); + pDocSh->SetDocumentModified(); + pDocSh->PostPaintGridAll(); + } + } + return 0; +} + +IMPL_LINK( ScDataFormDlg, Impl_LastHdl, PushButton*, EMPTYARG ) +{ + if (pDoc) + { + if ( aCurrentRow > nStartRow +1 ) + aCurrentRow--; + + SetButtonState(); + FillCtrls(aCurrentRow); + } + return 0; +} + +IMPL_LINK( ScDataFormDlg, Impl_NextHdl, PushButton*, EMPTYARG ) +{ + if (pDoc) + { + if ( aCurrentRow <= nEndRow) + aCurrentRow++; + + SetButtonState(); + FillCtrls(aCurrentRow); + } + return 0; +} + +IMPL_LINK( ScDataFormDlg, Impl_RestoreHdl, PushButton*, EMPTYARG ) +{ + if (pDoc) + { + FillCtrls(aCurrentRow); + } + return 0; +} + +IMPL_LINK( ScDataFormDlg, Impl_DeleteHdl, PushButton*, EMPTYARG ) +{ + ScViewData* pViewData = pTabViewShell->GetViewData(); + ScDocShell* pDocSh = pViewData->GetDocShell(); + if (pDoc) + { + ScRange aRange(nStartCol, aCurrentRow, nTab, nEndCol, aCurrentRow, nTab); + pDoc->DeleteRow(aRange); + nEndRow--; + + SetButtonState(); + pDocSh->GetUndoManager()->Clear(); + + FillCtrls(aCurrentRow); + pDocSh->SetDocumentModified(); + pDocSh->PostPaintGridAll(); + } + return 0; +} + +IMPL_LINK( ScDataFormDlg, Impl_CloseHdl, PushButton*, EMPTYARG ) +{ + EndDialog( ); + return 0; +} + +IMPL_LINK( ScDataFormDlg, Impl_ScrollHdl, ScrollBar*, EMPTYARG ) +{ + long nOffset = aSlider.GetThumbPos(); + aCurrentRow = nStartRow + nOffset + 1; + SetButtonState(); + FillCtrls(aCurrentRow); + return 0; +} + +void ScDataFormDlg::SetButtonState() +{ + if ( aCurrentRow > nEndRow ) + { + aBtnDelete.Enable( FALSE ); + aBtnLast.Enable( TRUE ); + aBtnNext.Enable( FALSE ); + } + else + { + aBtnDelete.Enable( TRUE ); + aBtnNext.Enable( TRUE ); + } + if ( 1 == aCurrentRow ) + aBtnLast.Enable( FALSE ); + + aBtnRestore.Enable( FALSE ); + if ( pEdits ) + pEdits[0]->GrabFocus(); +} diff --git a/sc/source/ui/miscdlgs/delcldlg.cxx b/sc/source/ui/miscdlgs/delcldlg.cxx index fd206ac537ba..8d20d2ee50e6 100644 --- a/sc/source/ui/miscdlgs/delcldlg.cxx +++ b/sc/source/ui/miscdlgs/delcldlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -118,3 +119,4 @@ __EXPORT ScDeleteCellDlg::~ScDeleteCellDlg() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/miscdlgs/delcodlg.cxx b/sc/source/ui/miscdlgs/delcodlg.cxx index 7be4c7a0bf3f..e8c7dde31443 100644 --- a/sc/source/ui/miscdlgs/delcodlg.cxx +++ b/sc/source/ui/miscdlgs/delcodlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -178,3 +179,4 @@ __EXPORT ScDeleteContentsDlg::~ScDeleteContentsDlg() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/miscdlgs/filldlg.cxx b/sc/source/ui/miscdlgs/filldlg.cxx index 2b247f0f9a07..46af2992e4a5 100644 --- a/sc/source/ui/miscdlgs/filldlg.cxx +++ b/sc/source/ui/miscdlgs/filldlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -373,3 +374,4 @@ IMPL_LINK( ScFillSeriesDlg, OKHdl, void *, EMPTYARG ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/miscdlgs/groupdlg.cxx b/sc/source/ui/miscdlgs/groupdlg.cxx index d6eb1865b184..d771e225ffdb 100644 --- a/sc/source/ui/miscdlgs/groupdlg.cxx +++ b/sc/source/ui/miscdlgs/groupdlg.cxx @@ -1,3 +1,4 @@ +/* -*- 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,3 +82,4 @@ __EXPORT ScGroupDlg::~ScGroupDlg() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/miscdlgs/highred.cxx b/sc/source/ui/miscdlgs/highred.cxx index dce755c10db3..d2c2f2c7cf84 100644 --- a/sc/source/ui/miscdlgs/highred.cxx +++ b/sc/source/ui/miscdlgs/highred.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -299,3 +300,4 @@ IMPL_LINK( ScHighlightChgDlg, OKBtnHdl, PushButton*, pOKBtn ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/miscdlgs/inscldlg.cxx b/sc/source/ui/miscdlgs/inscldlg.cxx index 2a3489088489..f09513960ae4 100644 --- a/sc/source/ui/miscdlgs/inscldlg.cxx +++ b/sc/source/ui/miscdlgs/inscldlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -118,3 +119,4 @@ __EXPORT ScInsertCellDlg::~ScInsertCellDlg() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/miscdlgs/inscodlg.cxx b/sc/source/ui/miscdlgs/inscodlg.cxx index b1c8e31ef373..63d55ac6f41e 100644 --- a/sc/source/ui/miscdlgs/inscodlg.cxx +++ b/sc/source/ui/miscdlgs/inscodlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -370,3 +371,4 @@ USHORT ScInsertContentsDlg::GetFormulaCmdBits() const +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/miscdlgs/instbdlg.cxx b/sc/source/ui/miscdlgs/instbdlg.cxx index 06d4f23389c0..d3a5cbe4f0dd 100644 --- a/sc/source/ui/miscdlgs/instbdlg.cxx +++ b/sc/source/ui/miscdlgs/instbdlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -431,3 +432,4 @@ IMPL_LINK( ScInsertTableDlg, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg return 0; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/miscdlgs/lbseldlg.cxx b/sc/source/ui/miscdlgs/lbseldlg.cxx index afdb2b70da8a..f340cab4127c 100644 --- a/sc/source/ui/miscdlgs/lbseldlg.cxx +++ b/sc/source/ui/miscdlgs/lbseldlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -99,3 +100,4 @@ __EXPORT ScSelEntryDlg::~ScSelEntryDlg() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/miscdlgs/linkarea.cxx b/sc/source/ui/miscdlgs/linkarea.cxx index 48e33622e99f..26bc8cc56dad 100644 --- a/sc/source/ui/miscdlgs/linkarea.cxx +++ b/sc/source/ui/miscdlgs/linkarea.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -364,3 +365,4 @@ ULONG ScLinkedAreaDlg::GetRefresh() return 0; // disabled } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/miscdlgs/makefile.mk b/sc/source/ui/miscdlgs/makefile.mk index d34994341ade..d3c6853d6875 100644 --- a/sc/source/ui/miscdlgs/makefile.mk +++ b/sc/source/ui/miscdlgs/makefile.mk @@ -41,6 +41,7 @@ LIBTARGET=no # --- Files -------------------------------------------------------- SLOFILES = \ + $(SLO)$/datafdlg.obj \ $(SLO)$/delcldlg.obj \ $(SLO)$/inscldlg.obj \ $(SLO)$/delcodlg.obj \ diff --git a/sc/source/ui/miscdlgs/mtrindlg.cxx b/sc/source/ui/miscdlgs/mtrindlg.cxx index 02bc77f8f89e..7bc19c14fa27 100644 --- a/sc/source/ui/miscdlgs/mtrindlg.cxx +++ b/sc/source/ui/miscdlgs/mtrindlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -184,3 +185,4 @@ IMPL_LINK_INLINE_END( ScMetricInputDlg, ModifyHdl, MetricField *, EMPTYARG ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/miscdlgs/mvtabdlg.cxx b/sc/source/ui/miscdlgs/mvtabdlg.cxx index 296cf8a8637f..b3505aa005ff 100644 --- a/sc/source/ui/miscdlgs/mvtabdlg.cxx +++ b/sc/source/ui/miscdlgs/mvtabdlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -203,3 +204,4 @@ IMPL_LINK( ScMoveTableDlg, SelHdl, ListBox *, pLb ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/miscdlgs/namecrea.cxx b/sc/source/ui/miscdlgs/namecrea.cxx index 1714fddd3b3d..269ae78ad21f 100644 --- a/sc/source/ui/miscdlgs/namecrea.cxx +++ b/sc/source/ui/miscdlgs/namecrea.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -77,3 +78,4 @@ USHORT ScNameCreateDlg::GetFlags() const +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/miscdlgs/namepast.cxx b/sc/source/ui/miscdlgs/namepast.cxx index c621f14b431c..6e5baea3ed42 100644 --- a/sc/source/ui/miscdlgs/namepast.cxx +++ b/sc/source/ui/miscdlgs/namepast.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -131,3 +132,4 @@ String ScNamePasteDlg::GetSelectedName() const } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/miscdlgs/optsolver.cxx b/sc/source/ui/miscdlgs/optsolver.cxx index 37759aef81b5..4f70376455b5 100644 --- a/sc/source/ui/miscdlgs/optsolver.cxx +++ b/sc/source/ui/miscdlgs/optsolver.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1064,3 +1065,4 @@ bool ScOptSolverDlg::CallSolver() // return true -> close dialog after cal return bClose; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/miscdlgs/protectiondlg.cxx b/sc/source/ui/miscdlgs/protectiondlg.cxx index 603b60e24884..d66bd541a174 100644 --- a/sc/source/ui/miscdlgs/protectiondlg.cxx +++ b/sc/source/ui/miscdlgs/protectiondlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -160,3 +161,5 @@ IMPL_LINK( ScTableProtectionDlg, PasswordModifyHdl, Edit*, EMPTYARG ) maBtnOk.Enable(aPass1.Equals(aPass2)); return 0; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/miscdlgs/redcom.cxx b/sc/source/ui/miscdlgs/redcom.cxx index 518c6515580b..cae6a64ce233 100644 --- a/sc/source/ui/miscdlgs/redcom.cxx +++ b/sc/source/ui/miscdlgs/redcom.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -183,3 +184,4 @@ IMPL_LINK(ScRedComDialog, NextHdl, AbstractSvxPostItDialog*, pDlgP ) return 0; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/miscdlgs/retypepassdlg.cxx b/sc/source/ui/miscdlgs/retypepassdlg.cxx index ef60b357489e..2a844c784888 100644 --- a/sc/source/ui/miscdlgs/retypepassdlg.cxx +++ b/sc/source/ui/miscdlgs/retypepassdlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -542,3 +543,5 @@ IMPL_LINK( ScRetypePassInputDlg, PasswordModifyHdl, Edit*, EMPTYARG ) CheckPasswordInput(); return 0; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/miscdlgs/scuiautofmt.cxx b/sc/source/ui/miscdlgs/scuiautofmt.cxx index b2f837db4cb4..a7637afc5381 100644 --- a/sc/source/ui/miscdlgs/scuiautofmt.cxx +++ b/sc/source/ui/miscdlgs/scuiautofmt.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -474,3 +475,5 @@ String __EXPORT ScAutoFormatDlg::GetCurrFormatName() return aResult; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/miscdlgs/sharedocdlg.cxx b/sc/source/ui/miscdlgs/sharedocdlg.cxx index 4a5b7cc2149b..797f29612fe6 100644 --- a/sc/source/ui/miscdlgs/sharedocdlg.cxx +++ b/sc/source/ui/miscdlgs/sharedocdlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -233,3 +234,5 @@ void ScShareDocumentDlg::UpdateView() maLbUsers.InsertEntry( aString, NULL ); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/miscdlgs/shtabdlg.cxx b/sc/source/ui/miscdlgs/shtabdlg.cxx index 7e57ebbe5d60..66cf2c8034e7 100644 --- a/sc/source/ui/miscdlgs/shtabdlg.cxx +++ b/sc/source/ui/miscdlgs/shtabdlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -109,3 +110,4 @@ __EXPORT ScShowTabDlg::~ScShowTabDlg() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/miscdlgs/simpref.cxx b/sc/source/ui/miscdlgs/simpref.cxx index 097016836ee5..732543394634 100644 --- a/sc/source/ui/miscdlgs/simpref.cxx +++ b/sc/source/ui/miscdlgs/simpref.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -255,3 +256,4 @@ IMPL_LINK( ScSimpleRefDlg, CancelBtnHdl, void *, EMPTYARG ) //------------------------------------------------------------------------ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/miscdlgs/solveroptions.cxx b/sc/source/ui/miscdlgs/solveroptions.cxx index 418a88b3cbea..4ed6eebb07cb 100644 --- a/sc/source/ui/miscdlgs/solveroptions.cxx +++ b/sc/source/ui/miscdlgs/solveroptions.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -490,3 +491,4 @@ double ScSolverValueDialog::GetValue() const return fValue; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/miscdlgs/solverutil.cxx b/sc/source/ui/miscdlgs/solverutil.cxx index ae080f2525c7..377ab4b358e7 100644 --- a/sc/source/ui/miscdlgs/solverutil.cxx +++ b/sc/source/ui/miscdlgs/solverutil.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -227,3 +228,4 @@ uno::Sequence<beans::PropertyValue> ScSolverUtil::GetDefaults( const rtl::OUStri return aDefaults; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/miscdlgs/solvrdlg.cxx b/sc/source/ui/miscdlgs/solvrdlg.cxx index 5b41592e8457..524fcb8420ed 100644 --- a/sc/source/ui/miscdlgs/solvrdlg.cxx +++ b/sc/source/ui/miscdlgs/solvrdlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -311,3 +312,4 @@ IMPL_LINK( ScSolverDlg, LoseFocusHdl, Control*, EMPTYARG ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/miscdlgs/strindlg.cxx b/sc/source/ui/miscdlgs/strindlg.cxx index b8dc2e13538e..f2bcd660bae6 100644 --- a/sc/source/ui/miscdlgs/strindlg.cxx +++ b/sc/source/ui/miscdlgs/strindlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -105,3 +106,4 @@ __EXPORT ScStringInputDlg::~ScStringInputDlg() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/miscdlgs/tabbgcolordlg.cxx b/sc/source/ui/miscdlgs/tabbgcolordlg.cxx index 463c06d76712..6154749f16aa 100644 --- a/sc/source/ui/miscdlgs/tabbgcolordlg.cxx +++ b/sc/source/ui/miscdlgs/tabbgcolordlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -196,3 +197,5 @@ void ScTabBgColorDlg::ScTabBgColorValueSet::KeyInput( const KeyEvent& rKEvt ) } ValueSet::KeyInput(rKEvt); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/miscdlgs/tabopdlg.cxx b/sc/source/ui/miscdlgs/tabopdlg.cxx index 38ae6bddaebd..2dce5792232d 100644 --- a/sc/source/ui/miscdlgs/tabopdlg.cxx +++ b/sc/source/ui/miscdlgs/tabopdlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -369,3 +370,4 @@ IMPL_LINK( ScTabOpDlg, LoseFocusHdl, Control*, EMPTYARG ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/miscdlgs/textdlgs.cxx b/sc/source/ui/miscdlgs/textdlgs.cxx index dcbb32bfa3e6..5af55079dda6 100644 --- a/sc/source/ui/miscdlgs/textdlgs.cxx +++ b/sc/source/ui/miscdlgs/textdlgs.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -128,3 +129,4 @@ void __EXPORT ScParagraphDlg::PageCreated( USHORT nId, SfxTabPage &rPage ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/miscdlgs/warnbox.cxx b/sc/source/ui/miscdlgs/warnbox.cxx index 24b2e62a1c78..acf12cf263b0 100644 --- a/sc/source/ui/miscdlgs/warnbox.cxx +++ b/sc/source/ui/miscdlgs/warnbox.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -89,3 +90,4 @@ void ScReplaceWarnBox::DisableDialog() // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/namedlg/namedlg.cxx b/sc/source/ui/namedlg/namedlg.cxx index bc79fa7c65e7..728fefae1443 100644 --- a/sc/source/ui/namedlg/namedlg.cxx +++ b/sc/source/ui/namedlg/namedlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -647,3 +648,4 @@ IMPL_LINK_INLINE_START( ScNameDlg, AssignGetFocusHdl, void *, EMPTYARG ) IMPL_LINK_INLINE_END( ScNameDlg, AssignGetFocusHdl, void *, EMPTYARG ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx index 5da1e4c273f7..5b55d47b70cd 100644 --- a/sc/source/ui/navipi/content.cxx +++ b/sc/source/ui/navipi/content.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1513,3 +1514,4 @@ void ScContentTree::StoreSettings() const +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/navipi/navcitem.cxx b/sc/source/ui/navipi/navcitem.cxx index e5002c44c60e..c6346ccc32c7 100644 --- a/sc/source/ui/navipi/navcitem.cxx +++ b/sc/source/ui/navipi/navcitem.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -125,3 +126,4 @@ void __EXPORT ScNavigatorControllerItem::StateChanged( USHORT /* nSID */, SfxIte +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx index e5f459d5b335..399cc85638c0 100644 --- a/sc/source/ui/navipi/navipi.cxx +++ b/sc/source/ui/navipi/navipi.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1562,3 +1563,4 @@ BOOL __EXPORT ScNavigatorDlg::QueryDrop( DropEvent& rEvt ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/navipi/scenwnd.cxx b/sc/source/ui/navipi/scenwnd.cxx index e7dff0bf37c7..d8733a2cfef2 100644 --- a/sc/source/ui/navipi/scenwnd.cxx +++ b/sc/source/ui/navipi/scenwnd.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -307,3 +308,4 @@ void ScScenarioWindow::SetSizePixel( const Size& rNewSize ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/optdlg/opredlin.cxx b/sc/source/ui/optdlg/opredlin.cxx index 1a45ab715dee..f438b3cdfcbc 100644 --- a/sc/source/ui/optdlg/opredlin.cxx +++ b/sc/source/ui/optdlg/opredlin.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -287,3 +288,4 @@ IMPL_LINK( ScRedlineOptionsTabPage, ColorHdl, ColorListBox *, EMPTYARG ) return 0; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/optdlg/tpcalc.cxx b/sc/source/ui/optdlg/tpcalc.cxx index 5b5920e904fc..7d56184d014e 100644 --- a/sc/source/ui/optdlg/tpcalc.cxx +++ b/sc/source/ui/optdlg/tpcalc.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -303,3 +304,4 @@ IMPL_LINK( ScTpCalcOptions, CheckClickHdl, CheckBox*, pBtn ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/optdlg/tpformula.cxx b/sc/source/ui/optdlg/tpformula.cxx index f793a058312d..8d7dd7daff95 100644 --- a/sc/source/ui/optdlg/tpformula.cxx +++ b/sc/source/ui/optdlg/tpformula.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -289,3 +290,5 @@ int ScTpFormulaOptions::DeactivatePage(SfxItemSet* /*pSet*/) // What's this method for ? return KEEP_PAGE; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/optdlg/tpprint.cxx b/sc/source/ui/optdlg/tpprint.cxx index d14b79bd739a..31f913e23061 100644 --- a/sc/source/ui/optdlg/tpprint.cxx +++ b/sc/source/ui/optdlg/tpprint.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -142,3 +143,4 @@ BOOL ScTpPrintOptions::FillItemSet( SfxItemSet& rCoreAttrs ) } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/optdlg/tpusrlst.cxx b/sc/source/ui/optdlg/tpusrlst.cxx index e3f6e488c310..da188c65470b 100644 --- a/sc/source/ui/optdlg/tpusrlst.cxx +++ b/sc/source/ui/optdlg/tpusrlst.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -825,3 +826,4 @@ IMPL_LINK( ScTpUserLists, EdEntriesModHdl, MultiLineEdit*, pEd ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/optdlg/tpview.cxx b/sc/source/ui/optdlg/tpview.cxx index 5c2e8dd52c9f..7c49d6d2d54c 100644 --- a/sc/source/ui/optdlg/tpview.cxx +++ b/sc/source/ui/optdlg/tpview.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -743,3 +744,4 @@ IMPL_LINK( ScTpLayoutOptions, AlignHdl, CheckBox*, pBox ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/pagedlg/areasdlg.cxx b/sc/source/ui/pagedlg/areasdlg.cxx index 915355d5d0f2..2391d426073e 100644 --- a/sc/source/ui/pagedlg/areasdlg.cxx +++ b/sc/source/ui/pagedlg/areasdlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -904,3 +905,4 @@ void lcl_GetRepeatRangeString( const ScRange* pRange, ScDocument* pDoc, bool bIs } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/pagedlg/hfedtdlg.cxx b/sc/source/ui/pagedlg/hfedtdlg.cxx index 263b4c0bae30..3fa032989dfc 100644 --- a/sc/source/ui/pagedlg/hfedtdlg.cxx +++ b/sc/source/ui/pagedlg/hfedtdlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -183,3 +184,4 @@ void __EXPORT ScHFEditDlg::PageCreated( USHORT /* nId */, SfxTabPage& rPage ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/pagedlg/scuitphfedit.cxx b/sc/source/ui/pagedlg/scuitphfedit.cxx index 15d1b646b73f..5ea90ef0d77d 100644 --- a/sc/source/ui/pagedlg/scuitphfedit.cxx +++ b/sc/source/ui/pagedlg/scuitphfedit.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -997,3 +998,5 @@ USHORT* __EXPORT ScLeftFooterEditPage::GetRanges() SfxTabPage* __EXPORT ScLeftFooterEditPage::Create( Window* pParent, const SfxItemSet& rCoreSet ) { return ( new ScLeftFooterEditPage( pParent, rCoreSet ) ); }; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/pagedlg/tphf.cxx b/sc/source/ui/pagedlg/tphf.cxx index 7c1c3046f743..96150acf4960 100644 --- a/sc/source/ui/pagedlg/tphf.cxx +++ b/sc/source/ui/pagedlg/tphf.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -328,3 +329,4 @@ USHORT* __EXPORT ScFooterPage::GetRanges() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/pagedlg/tphfedit.cxx b/sc/source/ui/pagedlg/tphfedit.cxx index fef6778d184f..52d8d7cad040 100644 --- a/sc/source/ui/pagedlg/tphfedit.cxx +++ b/sc/source/ui/pagedlg/tphfedit.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -563,3 +564,4 @@ Timer */ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/pagedlg/tptable.cxx b/sc/source/ui/pagedlg/tptable.cxx index a2b732464e12..a85ef657a3e1 100644 --- a/sc/source/ui/pagedlg/tptable.cxx +++ b/sc/source/ui/pagedlg/tptable.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -568,3 +569,4 @@ BOOL lcl_PutScaleItem2( USHORT nWhich, +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/src/datafdlg.src b/sc/source/ui/src/datafdlg.src new file mode 100644 index 000000000000..2c07a704d1c0 --- /dev/null +++ b/sc/source/ui/src/datafdlg.src @@ -0,0 +1,95 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Novell Inc. + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Amelia Wang <amwang@novell.com> + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ +#include "datafdlg.hrc" + +//zhangyun, dataform +ModalDialog RID_SCDLG_DATAFORM +{ + OutputSize = TRUE ; + SVLook = TRUE ; + Size = MAP_APPFONT ( 191 , 180 ) ; + Text [ en-US ] = "Data Form" ; + Moveable = TRUE ; + Closeable = TRUE ; + FixedText LAB_DATAFORM_RECORDNO + { + Pos = MAP_APPFONT ( 136 , 6 ) ; + Size = MAP_APPFONT ( 50 , 12 ) ; + Text [ en-US ] = "/" ; + }; + PushButton BTN_DATAFORM_NEW + { + Pos = MAP_APPFONT ( 135 , 23 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + TabStop = TRUE ; + DefButton = TRUE ; + Text [ en-US ] = "New" ; + }; + PushButton BTN_DATAFORM_DELETE + { + Pos = MAP_APPFONT ( 135 , 40 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + TabStop = TRUE ; + Text [ en-US ] = "Delete" ; + }; + PushButton BTN_DATAFORM_RESTORE + { + Pos = MAP_APPFONT ( 135 , 57 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + TabStop = TRUE ; + Text [ en-US ] = "Restore" ; + }; + PushButton BTN_DATAFORM_LAST + { + Pos = MAP_APPFONT ( 135 , 82 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + TabStop = TRUE ; + Text [ en-US ] = "Last Record" ; + }; + PushButton BTN_DATAFORM_NEXT + { + Pos = MAP_APPFONT ( 135 , 99 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + TabStop = TRUE ; + Text [ en-US ] = "Next Record" ; + }; + PushButton BTN_DATAFORM_CLOSE + { + Pos = MAP_APPFONT ( 135 , 116 ) ; + Size = MAP_APPFONT ( 50 , 14 ) ; + TabStop = TRUE ; + Text [ en-US ] = "Close" ; + }; + ScrollBar WND_DATAFORM_SCROLLBAR + { + Pos = MAP_APPFONT ( 124 , 6 ) ; + Size = MAP_APPFONT ( 8 , 135 ) ; + HScroll = FALSE ; + TabStop = FALSE ; + }; +}; +//end diff --git a/sc/source/ui/src/globstr.src b/sc/source/ui/src/globstr.src index 6f0b1f1fd789..c18dd724014b 100644 --- a/sc/source/ui/src/globstr.src +++ b/sc/source/ui/src/globstr.src @@ -1718,6 +1718,77 @@ Resource RID_GLOBSTR { Text [ en-US ] = "Unknown User"; }; + + String STR_SHAPE_AUTOSHAPE + { + Text [ en-US ] = "AutoShape"; + }; + + String STR_SHAPE_RECTANGLE + { + Text [ en-US ] = "Rectangle"; + }; + + String STR_SHAPE_LINE + { + Text [ en-US ] = "Line"; + }; + + String STR_SHAPE_OVAL + { + Text [ en-US ] = "Oval"; + }; + + String STR_SHAPE_TEXTBOX + { + Text [ en-US ] = "Text Box"; + }; + + String STR_FORM_BUTTON + { + Text [ en-US ] = "Button"; + }; + + String STR_FORM_CHECKBOX + { + Text [ en-US ] = "Check Box"; + }; + + String STR_FORM_OPTIONBUTTON + { + Text [ en-US ] = "Option Button"; + }; + + String STR_FORM_LABEL + { + Text [ en-US ] = "Label"; + }; + + String STR_FORM_LISTBOX + { + Text [ en-US ] = "List Box"; + }; + + String STR_FORM_GROUPBOX + { + Text [ en-US ] = "Group Box"; + }; + + String STR_FORM_DROPDOWN + { + Text [ en-US ] = "Drop Down"; + }; + + String STR_FORM_SPINNER + { + Text [ en-US ] = "Spinner"; + }; + + String STR_FORM_SCROLLBAR + { + Text [ en-US ] = "Scroll Bar"; + }; + String STR_STYLE_FAMILY_CELL { Text [ en-US ] = "Cell Styles"; diff --git a/sc/source/ui/src/makefile.mk b/sc/source/ui/src/makefile.mk index 96bb78e2902c..7036ad8bde27 100644 --- a/sc/source/ui/src/makefile.mk +++ b/sc/source/ui/src/makefile.mk @@ -53,6 +53,7 @@ SRC1FILES = \ dbnamdlg.src \ subtdlg.src \ miscdlgs.src \ + datafdlg.src \ autofmt.src \ solvrdlg.src \ optsolver.src \ diff --git a/sc/source/ui/styleui/styledlg.cxx b/sc/source/ui/styleui/styledlg.cxx index 2452f338b8e7..bc2d2f2dfdf0 100644 --- a/sc/source/ui/styleui/styledlg.cxx +++ b/sc/source/ui/styleui/styledlg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -215,3 +216,4 @@ const SfxItemSet* __EXPORT ScStyleDlg::GetRefreshedSet() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/undo/areasave.cxx b/sc/source/ui/undo/areasave.cxx index 8f5ce350b887..9f2b4eb7f03c 100644 --- a/sc/source/ui/undo/areasave.cxx +++ b/sc/source/ui/undo/areasave.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -228,3 +229,4 @@ ScAreaLinkSaveCollection* ScAreaLinkSaveCollection::CreateFromDoc( const ScDocum return pColl; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/undo/refundo.cxx b/sc/source/ui/undo/refundo.cxx index c863259ddf94..e4ca41b3ed30 100644 --- a/sc/source/ui/undo/refundo.cxx +++ b/sc/source/ui/undo/refundo.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -212,3 +213,4 @@ void ScRefUndoData::DoUndo( ScDocument* pDoc, BOOL bUndoRefFirst ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/undo/target.cxx b/sc/source/ui/undo/target.cxx index 1c2e4a925378..492c18bebc9a 100644 --- a/sc/source/ui/undo/target.cxx +++ b/sc/source/ui/undo/target.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -43,3 +44,5 @@ TYPEINIT1(ScTabViewTarget, SfxRepeatTarget); __EXPORT ScTabViewTarget::~ScTabViewTarget() { } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/undo/undobase.cxx b/sc/source/ui/undo/undobase.cxx index fffb76ebd061..e1d7c65c5072 100644 --- a/sc/source/ui/undo/undobase.cxx +++ b/sc/source/ui/undo/undobase.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -537,3 +538,4 @@ BOOL ScUndoWrapper::CanRepeat(SfxRepeatTarget& rTarget) const } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx index 6a12201d9b41..eda49aa114c5 100644 --- a/sc/source/ui/undo/undoblk.cxx +++ b/sc/source/ui/undo/undoblk.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -2273,3 +2274,4 @@ BOOL __EXPORT ScUndoBorder::CanRepeat(SfxRepeatTarget& /* rTarget */) const +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/undo/undoblk2.cxx b/sc/source/ui/undo/undoblk2.cxx index 2ab03eb71923..4a46c61683c5 100644 --- a/sc/source/ui/undo/undoblk2.cxx +++ b/sc/source/ui/undo/undoblk2.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -213,3 +214,4 @@ BOOL __EXPORT ScUndoWidthOrHeight::CanRepeat(SfxRepeatTarget& rTarget) const } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx index f5c05178ac8a..f73e664a5bcd 100644 --- a/sc/source/ui/undo/undoblk3.cxx +++ b/sc/source/ui/undo/undoblk3.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -2177,3 +2178,4 @@ BOOL __EXPORT ScUndoUpdateAreaLink::CanRepeat(SfxRepeatTarget& /* rTarget */) co +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/undo/undocell.cxx b/sc/source/ui/undo/undocell.cxx index a9376e5e9b1d..65e903c42990 100644 --- a/sc/source/ui/undo/undocell.cxx +++ b/sc/source/ui/undo/undocell.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1143,3 +1144,4 @@ BOOL __EXPORT ScUndoRangeNames::CanRepeat(SfxRepeatTarget& /* rTarget */) const +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/undo/undodat.cxx b/sc/source/ui/undo/undodat.cxx index 36b192abce24..308a3e7b2ef7 100644 --- a/sc/source/ui/undo/undodat.cxx +++ b/sc/source/ui/undo/undodat.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -52,6 +53,8 @@ #include "attrib.hxx" #include "hints.hxx" #include "sc.hrc" +#include "chgtrack.hxx" // Amelia Wang +#include "refundo.hxx" // Amelia Wang // ----------------------------------------------------------------------- @@ -71,6 +74,7 @@ TYPEINIT1(ScUndoRepeatDB, ScSimpleUndo); TYPEINIT1(ScUndoDataPilot, ScSimpleUndo); TYPEINIT1(ScUndoConsolidate, ScSimpleUndo); TYPEINIT1(ScUndoChartData, ScSimpleUndo); +TYPEINIT1(ScUndoDataForm, SfxUndoAction); // amelia // ----------------------------------------------------------------------- @@ -2027,8 +2031,211 @@ BOOL __EXPORT ScUndoChartData::CanRepeat(SfxRepeatTarget& /* rTarget */) const return FALSE; } +// Amelia Wang +ScUndoDataForm::ScUndoDataForm( ScDocShell* pNewDocShell, + SCCOL nStartX, SCROW nStartY, SCTAB nStartZ, + SCCOL nEndX, SCROW nEndY, SCTAB nEndZ, + const ScMarkData& rMark, + ScDocument* pNewUndoDoc, ScDocument* pNewRedoDoc, + USHORT nNewFlags, + ScRefUndoData* pRefData, + void* /*pFill1*/, void* /*pFill2*/, void* /*pFill3*/, + BOOL bRedoIsFilled ) : + ScBlockUndo( pNewDocShell, ScRange( nStartX, nStartY, nStartZ, nEndX, nEndY, nEndZ ), SC_UNDO_SIMPLE ), + aMarkData( rMark ), + pUndoDoc( pNewUndoDoc ), + pRedoDoc( pNewRedoDoc ), + nFlags( nNewFlags ), + pRefUndoData( pRefData ), + pRefRedoData( NULL ), + bRedoFilled( bRedoIsFilled ) +{ + // pFill1,pFill2,pFill3 are there so the ctor calls for simple paste (without cutting) + // don't have to be changed and branched for 641. + // They can be removed later. + + if ( !aMarkData.IsMarked() ) // no cell marked: + aMarkData.SetMarkArea( aBlockRange ); // mark paste block + + if ( pRefUndoData ) + pRefUndoData->DeleteUnchanged( pDocShell->GetDocument() ); + + SetChangeTrack(); +} + +ScUndoDataForm::~ScUndoDataForm() +{ + delete pUndoDoc; + delete pRedoDoc; + delete pRefUndoData; + delete pRefRedoData; +} + +String ScUndoDataForm::GetComment() const +{ + return ScGlobal::GetRscString( STR_UNDO_PASTE ); +} + +void ScUndoDataForm::SetChangeTrack() +{ + ScChangeTrack* pChangeTrack = pDocShell->GetDocument()->GetChangeTrack(); + if ( pChangeTrack && (nFlags & IDF_CONTENTS) ) + pChangeTrack->AppendContentRange( aBlockRange, pUndoDoc, + nStartChangeAction, nEndChangeAction, SC_CACM_PASTE ); + else + nStartChangeAction = nEndChangeAction = 0; +} + + +void ScUndoDataForm::Undo() +{ + BeginUndo(); + DoChange( TRUE ); + ShowTable( aBlockRange ); + EndUndo(); + SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) ); +} + +void ScUndoDataForm::Redo() +{ + BeginRedo(); + ScDocument* pDoc = pDocShell->GetDocument(); + EnableDrawAdjust( pDoc, FALSE ); //! include in ScBlockUndo? + DoChange( FALSE ); + EnableDrawAdjust( pDoc, TRUE ); //! include in ScBlockUndo? + EndRedo(); + SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) ); +} + +void ScUndoDataForm::Repeat(SfxRepeatTarget& /*rTarget*/) +{ +} + +BOOL ScUndoDataForm::CanRepeat(SfxRepeatTarget& rTarget) const +{ + return (rTarget.ISA(ScTabViewTarget)); +} + +void ScUndoDataForm::DoChange( const BOOL bUndo ) +{ + ScDocument* pDoc = pDocShell->GetDocument(); + + // RefUndoData for redo is created before first undo + // (with DeleteUnchanged after the DoUndo call) + BOOL bCreateRedoData = ( bUndo && pRefUndoData && !pRefRedoData ); + if ( bCreateRedoData ) + pRefRedoData = new ScRefUndoData( pDoc ); + + ScRefUndoData* pWorkRefData = bUndo ? pRefUndoData : pRefRedoData; + + // fuer Undo immer alle oder keine Inhalte sichern + USHORT nUndoFlags = IDF_NONE; + if (nFlags & IDF_CONTENTS) + nUndoFlags |= IDF_CONTENTS; + if (nFlags & IDF_ATTRIB) + nUndoFlags |= IDF_ATTRIB; + BOOL bPaintAll = FALSE; + ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); + + // marking is in ScBlockUndo... + //ScUndoUtil::MarkSimpleBlock( pDocShell, aBlockRange ); + + SCTAB nTabCount = pDoc->GetTableCount(); + if ( bUndo && !bRedoFilled ) + { + if (!pRedoDoc) + { + BOOL bColInfo = ( aBlockRange.aStart.Row()==0 && aBlockRange.aEnd.Row()==MAXROW ); + BOOL bRowInfo = ( aBlockRange.aStart.Col()==0 && aBlockRange.aEnd.Col()==MAXCOL ); + + pRedoDoc = new ScDocument( SCDOCMODE_UNDO ); + pRedoDoc->InitUndoSelected( pDoc, aMarkData, bColInfo, bRowInfo ); + } + // read "redo" data from the document in the first undo + // all sheets - CopyToDocument skips those that don't exist in pRedoDoc + ScRange aCopyRange = aBlockRange; + aCopyRange.aStart.SetTab(0); + aCopyRange.aEnd.SetTab(nTabCount-1); + pDoc->CopyToDocument( aCopyRange, 1, FALSE, pRedoDoc ); + bRedoFilled = TRUE; + } + + USHORT nExtFlags = 0; + pDocShell->UpdatePaintExt( nExtFlags, aBlockRange ); + + for ( sal_uInt16 i=0; i <= ( aBlockRange.aEnd.Col() - aBlockRange.aStart.Col() ); i++ ) + { + String aOldString; + pUndoDoc->GetString( aBlockRange.aStart.Col()+i , aBlockRange.aStart.Row() , aBlockRange.aStart.Tab() , aOldString ); + pDoc->SetString( aBlockRange.aStart.Col()+i , aBlockRange.aStart.Row() , aBlockRange.aStart.Tab() , aOldString ); + } + + //ScRange aTabSelectRange = aBlockRange; + + if (pWorkRefData) + { + pWorkRefData->DoUndo( pDoc, TRUE ); // TRUE = bSetChartRangeLists for SetChartListenerCollection + if ( pDoc->RefreshAutoFilter( 0,0, MAXCOL,MAXROW, aBlockRange.aStart.Tab() ) ) + bPaintAll = TRUE; + } + + if ( bCreateRedoData && pRefRedoData ) + pRefRedoData->DeleteUnchanged( pDoc ); + + if ( bUndo ) + { + ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack(); + if ( pChangeTrack ) + pChangeTrack->Undo( nStartChangeAction, nEndChangeAction ); + } + else + SetChangeTrack(); + + ScRange aDrawRange( aBlockRange ); + pDoc->ExtendMerge( aDrawRange, TRUE ); // only needed for single sheet (text/rtf etc.) + USHORT nPaint = PAINT_GRID; + if (bPaintAll) + { + aDrawRange.aStart.SetCol(0); + aDrawRange.aStart.SetRow(0); + aDrawRange.aEnd.SetCol(MAXCOL); + aDrawRange.aEnd.SetRow(MAXROW); + nPaint |= PAINT_TOP | PAINT_LEFT; +/*A*/ if (pViewShell) + pViewShell->AdjustBlockHeight(FALSE); + } + else + { + if ( aBlockRange.aStart.Row() == 0 && aBlockRange.aEnd.Row() == MAXROW ) // ganze Spalte + { + nPaint |= PAINT_TOP; + aDrawRange.aEnd.SetCol(MAXCOL); + } + if ( aBlockRange.aStart.Col() == 0 && aBlockRange.aEnd.Col() == MAXCOL ) // ganze Zeile + { + nPaint |= PAINT_LEFT; + aDrawRange.aEnd.SetRow(MAXROW); + } +/*A*/ if ((pViewShell) && pViewShell->AdjustBlockHeight(FALSE)) + { + aDrawRange.aStart.SetCol(0); + aDrawRange.aStart.SetRow(0); + aDrawRange.aEnd.SetCol(MAXCOL); + aDrawRange.aEnd.SetRow(MAXROW); + nPaint |= PAINT_LEFT; + } + pDocShell->UpdatePaintExt( nExtFlags, aDrawRange ); + } + if ( !bUndo ) // draw redo after updating row heights + RedoSdrUndoAction( pDrawUndo ); //! include in ScBlockUndo? + pDocShell->PostPaint( aDrawRange, nPaint, nExtFlags ); + pDocShell->PostDataChanged(); + if (pViewShell) + pViewShell->CellContentChanged(); +} +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/undo/undodraw.cxx b/sc/source/ui/undo/undodraw.cxx index a10a7381d808..e1bfb468fb4e 100644 --- a/sc/source/ui/undo/undodraw.cxx +++ b/sc/source/ui/undo/undodraw.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -267,3 +268,4 @@ BOOL __EXPORT ScUndoDraw::CanRepeat(SfxRepeatTarget& rTarget) const +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/undo/undoolk.cxx b/sc/source/ui/undo/undoolk.cxx index 183b9d1cd7b4..bfb1e0a27cc6 100644 --- a/sc/source/ui/undo/undoolk.cxx +++ b/sc/source/ui/undo/undoolk.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -100,3 +101,4 @@ void EnableDrawAdjust( ScDocument* pDoc, BOOL bEnable ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/undo/undostyl.cxx b/sc/source/ui/undo/undostyl.cxx index b4ea7f35448c..5d4af591a2bc 100644 --- a/sc/source/ui/undo/undostyl.cxx +++ b/sc/source/ui/undo/undostyl.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -309,3 +310,4 @@ BOOL ScUndoApplyPageStyle::CanRepeat(SfxRepeatTarget& /* rTarget */) const } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/undo/undotab.cxx b/sc/source/ui/undo/undotab.cxx index 8d852ce0cda5..c3fdfc156528 100644 --- a/sc/source/ui/undo/undotab.cxx +++ b/sc/source/ui/undo/undotab.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1664,3 +1665,4 @@ String ScUndoLayoutRTL::GetComment() const return ScGlobal::GetRscString( STR_UNDO_TAB_RTL ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/undo/undoutil.cxx b/sc/source/ui/undo/undoutil.cxx index 168975cdda3a..0be0a7f4f363 100644 --- a/sc/source/ui/undo/undoutil.cxx +++ b/sc/source/ui/undo/undoutil.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -131,3 +132,5 @@ void ScUndoUtil::PaintMore( ScDocShell* pDocShell, pDocShell->PostPaint( nCol1,nRow1,rRange.aStart.Tab(), nCol2,nRow2,rRange.aEnd.Tab(), PAINT_GRID ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/ChartRangeSelectionListener.cxx b/sc/source/ui/unoobj/ChartRangeSelectionListener.cxx index e8000d71518b..ac4b8550c292 100644 --- a/sc/source/ui/unoobj/ChartRangeSelectionListener.cxx +++ b/sc/source/ui/unoobj/ChartRangeSelectionListener.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -93,3 +94,5 @@ void SAL_CALL ScChartRangeSelectionListener::disposing() { m_pViewShell = 0; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/addruno.cxx b/sc/source/ui/unoobj/addruno.cxx index 10627222be80..854b0d67b81c 100644 --- a/sc/source/ui/unoobj/addruno.cxx +++ b/sc/source/ui/unoobj/addruno.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -69,7 +70,7 @@ void ScAddressConversionObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) } } -sal_Bool ScAddressConversionObj::ParseUIString( const String& rUIString ) +sal_Bool ScAddressConversionObj::ParseUIString( const String& rUIString, ::formula::FormulaGrammar::AddressConvention eConv ) { if (!pDocShell) return sal_False; @@ -78,7 +79,7 @@ sal_Bool ScAddressConversionObj::ParseUIString( const String& rUIString ) sal_Bool bSuccess = sal_False; if ( bIsRange ) { - USHORT nResult = aRange.ParseAny( rUIString, pDoc ); + USHORT nResult = aRange.ParseAny( rUIString, pDoc, eConv ); if ( nResult & SCA_VALID ) { if ( ( nResult & SCA_TAB_3D ) == 0 ) @@ -92,7 +93,7 @@ sal_Bool ScAddressConversionObj::ParseUIString( const String& rUIString ) } else { - USHORT nResult = aRange.aStart.Parse( rUIString, pDoc ); + USHORT nResult = aRange.aStart.Parse( rUIString, pDoc, eConv ); if ( nResult & SCA_VALID ) { if ( ( nResult & SCA_TAB_3D ) == 0 ) @@ -116,6 +117,7 @@ uno::Reference<beans::XPropertySetInfo> SAL_CALL ScAddressConversionObj::getProp { {MAP_CHAR_LEN(SC_UNONAME_ADDRESS), 0, &getCppuType((table::CellRangeAddress*)0), 0, 0 }, {MAP_CHAR_LEN(SC_UNONAME_PERSREPR), 0, &getCppuType((rtl::OUString*)0), 0, 0 }, + {MAP_CHAR_LEN(SC_UNONAME_XL_A1_REPR), 0, &getCppuType((rtl::OUString*)0), 0, 0 }, {MAP_CHAR_LEN(SC_UNONAME_REFSHEET), 0, &getCppuType((sal_Int32*)0), 0, 0 }, {MAP_CHAR_LEN(SC_UNONAME_UIREPR), 0, &getCppuType((rtl::OUString*)0), 0, 0 }, {0,0,0,0,0,0} @@ -129,6 +131,7 @@ uno::Reference<beans::XPropertySetInfo> SAL_CALL ScAddressConversionObj::getProp { {MAP_CHAR_LEN(SC_UNONAME_ADDRESS), 0, &getCppuType((table::CellAddress*)0), 0, 0 }, {MAP_CHAR_LEN(SC_UNONAME_PERSREPR), 0, &getCppuType((rtl::OUString*)0), 0, 0 }, + {MAP_CHAR_LEN(SC_UNONAME_XL_A1_REPR), 0, &getCppuType((rtl::OUString*)0), 0, 0 }, {MAP_CHAR_LEN(SC_UNONAME_REFSHEET), 0, &getCppuType((sal_Int32*)0), 0, 0 }, {MAP_CHAR_LEN(SC_UNONAME_UIREPR), 0, &getCppuType((rtl::OUString*)0), 0, 0 }, {0,0,0,0,0,0} @@ -190,8 +193,11 @@ void SAL_CALL ScAddressConversionObj::setPropertyValue( const rtl::OUString& aPr bSuccess = ParseUIString( aUIString ); } } - else if ( aNameStr.EqualsAscii( SC_UNONAME_PERSREPR ) ) + else if ( aNameStr.EqualsAscii( SC_UNONAME_PERSREPR ) || aNameStr.EqualsAscii( SC_UNONAME_XL_A1_REPR ) ) { + ::formula::FormulaGrammar::AddressConvention aConv = ::formula::FormulaGrammar::CONV_OOO; + if ( aNameStr.EqualsAscii( SC_UNONAME_XL_A1_REPR ) ) + aConv = ::formula::FormulaGrammar::CONV_XL_A1; // parse the file format string rtl::OUString sRepresentation; if (aValue >>= sRepresentation) @@ -212,7 +218,7 @@ void SAL_CALL ScAddressConversionObj::setPropertyValue( const rtl::OUString& aPr } // parse the rest like a UI string - bSuccess = ParseUIString( aUIString ); + bSuccess = ParseUIString( aUIString, aConv ); } } else @@ -265,17 +271,24 @@ uno::Any SAL_CALL ScAddressConversionObj::getPropertyValue( const rtl::OUString& aRange.aStart.Format( aFormatStr, nFlags, pDoc ); aRet <<= rtl::OUString( aFormatStr ); } - else if ( aNameStr.EqualsAscii( SC_UNONAME_PERSREPR ) ) + else if ( aNameStr.EqualsAscii( SC_UNONAME_PERSREPR ) || aNameStr.EqualsAscii( SC_UNONAME_XL_A1_REPR ) ) { + ::formula::FormulaGrammar::AddressConvention aConv = ::formula::FormulaGrammar::CONV_OOO; + if ( aNameStr.EqualsAscii( SC_UNONAME_XL_A1_REPR ) ) + aConv = ::formula::FormulaGrammar::CONV_XL_A1; + // generate file format string - always include sheet String aFormatStr; - aRange.aStart.Format( aFormatStr, SCA_VALID | SCA_TAB_3D, pDoc ); + aRange.aStart.Format( aFormatStr, SCA_VALID | SCA_TAB_3D, pDoc, aConv ); if ( bIsRange ) { // manually concatenate range so both parts always have the sheet name aFormatStr.Append( (sal_Unicode) ':' ); String aSecond; - aRange.aEnd.Format( aSecond, SCA_VALID | SCA_TAB_3D, pDoc ); + USHORT nFlags = SCA_VALID; + if( aConv != ::formula::FormulaGrammar::CONV_XL_A1 ) + nFlags |= SCA_TAB_3D; + aRange.aEnd.Format( aSecond, SCA_VALID | SCA_TAB_3D, pDoc, aConv ); aFormatStr.Append( aSecond ); } aRet <<= rtl::OUString( aFormatStr ); @@ -313,3 +326,4 @@ uno::Sequence<rtl::OUString> SAL_CALL ScAddressConversionObj::getSupportedServic return aRet; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/afmtuno.cxx b/sc/source/ui/unoobj/afmtuno.cxx index e3fc18d8a926..81c7e0624521 100644 --- a/sc/source/ui/unoobj/afmtuno.cxx +++ b/sc/source/ui/unoobj/afmtuno.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -882,3 +883,4 @@ SC_IMPL_DUMMY_PROPERTY_LISTENER( ScAutoFormatFieldObj ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/appluno.cxx b/sc/source/ui/unoobj/appluno.cxx index 8b20d9849f47..338996a86ede 100644 --- a/sc/source/ui/unoobj/appluno.cxx +++ b/sc/source/ui/unoobj/appluno.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1084,3 +1085,4 @@ sal_Bool SAL_CALL ScFunctionListObj::hasByName( const rtl::OUString& aName ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/celllistsource.cxx b/sc/source/ui/unoobj/celllistsource.cxx index 246555d06f25..c10fadccea7c 100644 --- a/sc/source/ui/unoobj/celllistsource.cxx +++ b/sc/source/ui/unoobj/celllistsource.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -447,3 +448,5 @@ namespace calc //......................................................................... } // namespace calc //......................................................................... + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index 12ecf80b9e3f..cdb958f0ddf0 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -9859,3 +9860,4 @@ uno::Any SAL_CALL ScUniqueCellFormatsEnumeration::nextElement() throw(container: } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/cellvaluebinding.cxx b/sc/source/ui/unoobj/cellvaluebinding.cxx index 3b806ccf80b7..9e3cae0756c1 100644 --- a/sc/source/ui/unoobj/cellvaluebinding.cxx +++ b/sc/source/ui/unoobj/cellvaluebinding.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -661,3 +662,5 @@ namespace calc //......................................................................... } // namespace calc //......................................................................... + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx index f87818553ee1..a841c852f6ed 100644 --- a/sc/source/ui/unoobj/chart2uno.cxx +++ b/sc/source/ui/unoobj/chart2uno.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -3907,3 +3908,5 @@ void SAL_CALL ScChart2EmptyDataSequence::removeVetoableChangeListener( // return pRet; // } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/chartuno.cxx b/sc/source/ui/unoobj/chartuno.cxx index 86f59d66a7a4..dd3a0c098229 100644 --- a/sc/source/ui/unoobj/chartuno.cxx +++ b/sc/source/ui/unoobj/chartuno.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -815,3 +816,4 @@ uno::Reference< beans::XPropertySetInfo > ScChartObj::getPropertySetInfo() throw +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/confuno.cxx b/sc/source/ui/unoobj/confuno.cxx index a680185a1d1c..2b513d2b2e71 100644 --- a/sc/source/ui/unoobj/confuno.cxx +++ b/sc/source/ui/unoobj/confuno.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -486,3 +487,4 @@ uno::Sequence<rtl::OUString> SAL_CALL ScDocumentConfiguration::getSupportedServi //------------------------------------------------------------------------- +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/convuno.cxx b/sc/source/ui/unoobj/convuno.cxx index e3b0c09b25c2..7781ecf6ac4a 100644 --- a/sc/source/ui/unoobj/convuno.cxx +++ b/sc/source/ui/unoobj/convuno.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -62,3 +63,4 @@ void ScUnoConversion::FillLocale( lang::Locale& rLocale, LanguageType eLang ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/cursuno.cxx b/sc/source/ui/unoobj/cursuno.cxx index daf075964a3a..344ca2c71ebd 100644 --- a/sc/source/ui/unoobj/cursuno.cxx +++ b/sc/source/ui/unoobj/cursuno.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -508,3 +509,4 @@ uno::Sequence<rtl::OUString> SAL_CALL ScCellCursorObj::getSupportedServiceNames( +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx index c7bf89671161..4d5286c302a1 100644 --- a/sc/source/ui/unoobj/dapiuno.cxx +++ b/sc/source/ui/unoobj/dapiuno.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -3552,3 +3553,4 @@ void SAL_CALL ScDataPilotItemObj::removeVetoableChangeListener( +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx index 6e416764eb76..a1026fc4f325 100644 --- a/sc/source/ui/unoobj/datauno.cxx +++ b/sc/source/ui/unoobj/datauno.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -2369,3 +2370,4 @@ sal_Bool SAL_CALL ScDatabaseRangesObj::hasByName( const rtl::OUString& aName ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/defltuno.cxx b/sc/source/ui/unoobj/defltuno.cxx index f3f76685e5cb..1a5fd7fca33d 100644 --- a/sc/source/ui/unoobj/defltuno.cxx +++ b/sc/source/ui/unoobj/defltuno.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -385,3 +386,4 @@ uno::Any SAL_CALL ScDocDefaultsObj::getPropertyDefault( const rtl::OUString& aPr } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/detreg.cxx b/sc/source/ui/unoobj/detreg.cxx index 498d0fc886ec..da87ca9e3644 100644 --- a/sc/source/ui/unoobj/detreg.cxx +++ b/sc/source/ui/unoobj/detreg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -109,3 +110,4 @@ SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImple +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/dispuno.cxx b/sc/source/ui/unoobj/dispuno.cxx index 6c82871d02da..6c0d7375edc1 100644 --- a/sc/source/ui/unoobj/dispuno.cxx +++ b/sc/source/ui/unoobj/dispuno.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -413,3 +414,4 @@ void SAL_CALL ScDispatch::disposing( const ::com::sun::star::lang::EventObject& pViewShell = NULL; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index 83c9441d8fc7..8a403beb8be2 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -102,6 +103,7 @@ #include "scresid.hxx" using namespace com::sun::star; +#define SC_UNO_VBADOCOBJ "ThisVBADocObj" // perhaps we want to actually make this ThisWorkbook ? //------------------------------------------------------------------------ @@ -117,6 +119,7 @@ const SfxItemPropertyMapEntry* lcl_GetDocOptPropertyMap() {MAP_CHAR_LEN(SC_UNO_AUTOCONTFOC), 0, &getBooleanCppuType(), 0, 0}, {MAP_CHAR_LEN(SC_UNO_BASICLIBRARIES), 0, &getCppuType((uno::Reference< script::XLibraryContainer >*)0), beans::PropertyAttribute::READONLY, 0}, {MAP_CHAR_LEN(SC_UNO_DIALOGLIBRARIES), 0, &getCppuType((uno::Reference< script::XLibraryContainer >*)0), beans::PropertyAttribute::READONLY, 0}, + {MAP_CHAR_LEN(SC_UNO_VBADOCOBJ), 0, &getCppuType((beans::PropertyValue*)0), beans::PropertyAttribute::READONLY, 0}, {MAP_CHAR_LEN(SC_UNO_CALCASSHOWN), PROP_UNO_CALCASSHOWN, &getBooleanCppuType(), 0, 0}, {MAP_CHAR_LEN(SC_UNONAME_CLOCAL), 0, &getCppuType((lang::Locale*)0), 0, 0}, {MAP_CHAR_LEN(SC_UNO_CJK_CLOCAL), 0, &getCppuType((lang::Locale*)0), 0, 0}, @@ -1873,6 +1876,18 @@ uno::Any SAL_CALL ScModelObj::getPropertyValue( const rtl::OUString& aPropertyNa { aRet <<= pDocShell->GetDialogContainer(); } + else if ( aString.EqualsAscii( SC_UNO_VBADOCOBJ ) ) + { + // PropertyValue seems extreme because we store + // the model ( as the value member ) of the PropertyValue that is + // itself a property of the model ( the intention however is to + // store something like a Workbook object... but we don't do that ) + // yet + beans::PropertyValue aProp; + aProp.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ThisExcelDoc") ); + aProp.Value <<= pDocShell->GetModel(); + aRet <<= aProp; + } else if ( aString.EqualsAscii( SC_UNO_RUNTIMEUID ) ) { aRet <<= getRuntimeUID(); @@ -3768,3 +3783,4 @@ sal_Bool SAL_CALL ScScenariosObj::hasByName( const rtl::OUString& aName ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/drdefuno.cxx b/sc/source/ui/unoobj/drdefuno.cxx index 52fce55dfc58..ee4a89baf76b 100644 --- a/sc/source/ui/unoobj/drdefuno.cxx +++ b/sc/source/ui/unoobj/drdefuno.cxx @@ -1,3 +1,4 @@ +/* -*- 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,3 +82,4 @@ SfxItemPool* ScDrawDefaultsObj::getModelPool( sal_Bool bReadOnly ) throw() } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/editsrc.cxx b/sc/source/ui/unoobj/editsrc.cxx index 7febe374d0d9..aca36831415d 100644 --- a/sc/source/ui/unoobj/editsrc.cxx +++ b/sc/source/ui/unoobj/editsrc.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -371,3 +372,4 @@ SfxBroadcaster& ScAccessibilityEditSource::GetBroadcaster() const return mpAccessibleTextData->GetBroadcaster(); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/eventuno.cxx b/sc/source/ui/unoobj/eventuno.cxx index d7de00f4cc56..c5e86135319b 100644 --- a/sc/source/ui/unoobj/eventuno.cxx +++ b/sc/source/ui/unoobj/eventuno.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -199,3 +200,4 @@ sal_Bool SAL_CALL ScSheetEventsObj::hasElements() throw(uno::RuntimeException) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/fielduno.cxx b/sc/source/ui/unoobj/fielduno.cxx index 07a4cbda0230..7b118eb7c0ad 100644 --- a/sc/source/ui/unoobj/fielduno.cxx +++ b/sc/source/ui/unoobj/fielduno.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1526,3 +1527,4 @@ uno::Sequence<rtl::OUString> SAL_CALL ScHeaderFieldObj::getSupportedServiceNames +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/filtuno.cxx b/sc/source/ui/unoobj/filtuno.cxx index 8c7402de370b..bcbd3a4c4a93 100644 --- a/sc/source/ui/unoobj/filtuno.cxx +++ b/sc/source/ui/unoobj/filtuno.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -310,3 +311,4 @@ void SAL_CALL ScFilterOptionsObj::setSourceDocument( const uno::Reference<lang:: bExport = sal_True; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/fmtuno.cxx b/sc/source/ui/unoobj/fmtuno.cxx index ee828136cf14..b1397b3067ce 100644 --- a/sc/source/ui/unoobj/fmtuno.cxx +++ b/sc/source/ui/unoobj/fmtuno.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1059,3 +1060,4 @@ ScTableValidationObj* ScTableValidationObj::getImplementation( +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/forbiuno.cxx b/sc/source/ui/unoobj/forbiuno.cxx index 2807a12f7dac..e847c4ee25a3 100644 --- a/sc/source/ui/unoobj/forbiuno.cxx +++ b/sc/source/ui/unoobj/forbiuno.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -91,3 +92,4 @@ void ScForbiddenCharsObj::onChange() } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/funcuno.cxx b/sc/source/ui/unoobj/funcuno.cxx index 7012b477050c..a4b107492e54 100644 --- a/sc/source/ui/unoobj/funcuno.cxx +++ b/sc/source/ui/unoobj/funcuno.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -743,3 +744,4 @@ uno::Any SAL_CALL ScFunctionAccess::callFunction( const rtl::OUString& aName, } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/linkuno.cxx b/sc/source/ui/unoobj/linkuno.cxx index a119eda13a32..02bb69a412b9 100644 --- a/sc/source/ui/unoobj/linkuno.cxx +++ b/sc/source/ui/unoobj/linkuno.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1819,3 +1820,4 @@ sal_Bool SAL_CALL ScExternalDocLinksObj::hasElements() return mpRefMgr->getExternalFileCount() > 0; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/listenercalls.cxx b/sc/source/ui/unoobj/listenercalls.cxx index 9abc8e0ab826..8160cd470424 100644 --- a/sc/source/ui/unoobj/listenercalls.cxx +++ b/sc/source/ui/unoobj/listenercalls.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -87,3 +88,4 @@ void ScUnoListenerCalls::ExecuteAndClear() } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/miscuno.cxx b/sc/source/ui/unoobj/miscuno.cxx index 77232a176598..57e45f7fc73a 100644 --- a/sc/source/ui/unoobj/miscuno.cxx +++ b/sc/source/ui/unoobj/miscuno.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -326,3 +327,4 @@ sal_Bool SAL_CALL ScNameToIndexAccess::hasElements( ) throw(::com::sun::star::u +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/nameuno.cxx b/sc/source/ui/unoobj/nameuno.cxx index 8aa34b88f25d..1b5bc50766fe 100644 --- a/sc/source/ui/unoobj/nameuno.cxx +++ b/sc/source/ui/unoobj/nameuno.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1128,3 +1129,4 @@ sal_Bool SAL_CALL ScLabelRangesObj::hasElements() throw(uno::RuntimeException) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/notesuno.cxx b/sc/source/ui/unoobj/notesuno.cxx index c5dd11977478..453baa96afa4 100644 --- a/sc/source/ui/unoobj/notesuno.cxx +++ b/sc/source/ui/unoobj/notesuno.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -56,16 +57,20 @@ #include <svx/svditer.hxx> #include <svx/svdpage.hxx> #include <com/sun/star/drawing/XShapeDescriptor.hpp> +#include <editeng/unoprnms.hxx> using namespace com::sun::star; //------------------------------------------------------------------------ -// keine Properties fuer Text in Notizen const SvxItemPropertySet* lcl_GetAnnotationPropertySet() { static SfxItemPropertyMapEntry aAnnotationPropertyMap_Impl[] = { + SVX_UNOEDIT_CHAR_PROPERTIES, + SVX_UNOEDIT_FONT_PROPERTIES, + SVX_UNOEDIT_PARA_PROPERTIES, + SVX_UNOEDIT_NUMBERING_PROPERTIE, // for completeness of service ParagraphProperties {0,0,0,0,0,0} }; static SvxItemPropertySet aAnnotationPropertySet_Impl( aAnnotationPropertyMap_Impl, SdrObject::GetGlobalDrawObjectItemPool() ); @@ -727,3 +732,4 @@ void SAL_CALL ScAnnotationShapeObj::removeEventListener( const uno::Reference< l +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/optuno.cxx b/sc/source/ui/unoobj/optuno.cxx index 0d277fdb19fe..24da175d5834 100644 --- a/sc/source/ui/unoobj/optuno.cxx +++ b/sc/source/ui/unoobj/optuno.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -235,3 +236,4 @@ uno::Any SAL_CALL ScDocOptionsObj::getPropertyValue( const rtl::OUString& aPrope return aRet; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/pageuno.cxx b/sc/source/ui/unoobj/pageuno.cxx index 4687683a8ef4..37b7d83c6886 100644 --- a/sc/source/ui/unoobj/pageuno.cxx +++ b/sc/source/ui/unoobj/pageuno.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -76,3 +77,5 @@ uno::Sequence<rtl::OUString> SAL_CALL ScPageObj::getSupportedServiceNames() pArray[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sheet.SpreadsheetDrawPage")); return aRet; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/scdetect.cxx b/sc/source/ui/unoobj/scdetect.cxx index d04681460818..71881493eb2f 100644 --- a/sc/source/ui/unoobj/scdetect.cxx +++ b/sc/source/ui/unoobj/scdetect.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -914,3 +915,4 @@ UNOREFERENCE< UNOXINTERFACE > SAL_CALL ScFilterDetect::impl_createInstance( cons return UNOREFERENCE< UNOXINTERFACE >( *new ScFilterDetect( xServiceManager ) ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/servuno.cxx b/sc/source/ui/unoobj/servuno.cxx index 45f55b03df2c..450c5f8c3ef1 100644 --- a/sc/source/ui/unoobj/servuno.cxx +++ b/sc/source/ui/unoobj/servuno.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -36,6 +37,7 @@ #include <svx/unofill.hxx> #include <editeng/unonrule.hxx> #include <com/sun/star/sheet/XSpreadsheetDocument.hpp> +#include <com/sun/star/container/XNameAccess.hpp> #include "servuno.hxx" #include "unoguard.hxx" @@ -72,8 +74,27 @@ #include <basic/basmgr.hxx> #include <sfx2/app.hxx> +#include <comphelper/processfactory.hxx> +#include <com/sun/star/document/XCodeNameQuery.hpp> +#include <com/sun/star/drawing/XDrawPagesSupplier.hpp> +#include <com/sun/star/form/XFormsSupplier.hpp> +#include <com/sun/star/script/ScriptEventDescriptor.hpp> +#include <comphelper/componentcontext.hxx> +#include <cppuhelper/component_context.hxx> +#include <vbahelper/vbaaccesshelper.hxx> +#include <com/sun/star/script/vba/XVBACompatibility.hpp> + using namespace ::com::sun::star; +bool isInVBAMode( ScDocShell& rDocSh ) +{ + uno::Reference<script::XLibraryContainer> xLibContainer = rDocSh.GetBasicContainer(); + uno::Reference<script::vba::XVBACompatibility> xVBACompat( xLibContainer, uno::UNO_QUERY ); + if ( xVBACompat.is() ) + return xVBACompat->getVBACompatibilityMode(); + return false; +} + class ScVbaObjectForCodeNameProvider : public ::cppu::WeakImplHelper1< container::XNameAccess > { uno::Any maWorkbook; @@ -286,7 +307,8 @@ static const ProvNamesId_Type __FAR_DATA aProvNamesId[] = { "com.sun.star.text.textfield.Time", SC_SERVICE_TIMEFIELD }, { "com.sun.star.text.textfield.DocumentTitle", SC_SERVICE_TITLEFIELD }, { "com.sun.star.text.textfield.FileName", SC_SERVICE_FILEFIELD }, - { "com.sun.star.text.textfield.SheetName", SC_SERVICE_SHEETFIELD } + { "com.sun.star.text.textfield.SheetName", SC_SERVICE_SHEETFIELD }, + { "ooo.vba.VBAGlobals", SC_SERVICE_VBAGLOBALS }, }; // @@ -548,7 +570,7 @@ uno::Reference<uno::XInterface> ScServiceProvider::MakeInstance( } break; case SC_SERVICE_VBACODENAMEPROVIDER: - if (pDocShell && pDocShell->GetDocument()->IsInVBAMode()) + if ( pDocShell && ooo::vba::isAlienExcelDoc( *pDocShell ) && isInVBAMode( *pDocShell ) ) { OSL_TRACE("**** creating VBA Object provider"); xRet.set(static_cast<document::XCodeNameQuery*>(new ScVbaCodeNameProvider( pDocShell ))); @@ -590,3 +612,4 @@ uno::Sequence<rtl::OUString> ScServiceProvider::GetAllServiceNames() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/shapeuno.cxx b/sc/source/ui/unoobj/shapeuno.cxx index 1ed384ed2ebd..a5b8dcba36c4 100644 --- a/sc/source/ui/unoobj/shapeuno.cxx +++ b/sc/source/ui/unoobj/shapeuno.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -70,6 +71,8 @@ const SfxItemPropertyMapEntry* lcl_GetShapeMap() {MAP_CHAR_LEN(SC_UNONAME_HORIPOS), 0, &getCppuType((sal_Int32*)0), 0, 0 }, {MAP_CHAR_LEN(SC_UNONAME_IMAGEMAP), 0, &getCppuType((uno::Reference<container::XIndexContainer>*)0), 0, 0 }, {MAP_CHAR_LEN(SC_UNONAME_VERTPOS), 0, &getCppuType((sal_Int32*)0), 0, 0 }, + // #i66550 HLINK_FOR_SHAPES + {MAP_CHAR_LEN(SC_UNONAME_HYPERLINK), 0, &getCppuType((rtl::OUString*)0), 0, 0 }, {0,0,0,0,0,0} }; return aShapeMap_Impl; @@ -84,6 +87,14 @@ const SvEventDescription* ScShapeObj::GetSupportedMacroItems() }; return aMacroDescriptionsImpl; } +// #i66550 HLINK_FOR_SHAPES +ScMacroInfo* lcl_getShapeHyperMacroInfo( ScShapeObj* pShape, BOOL bCreate = FALSE ) +{ + if( pShape ) + if( SdrObject* pObj = pShape->GetSdrObject() ) + return ScDrawLayer::GetMacroInfo( pObj, bCreate ); + return 0; +} //------------------------------------------------------------------------ @@ -635,6 +646,13 @@ void SAL_CALL ScShapeObj::setPropertyValue( } } } + else if ( aNameString.EqualsAscii( SC_UNONAME_HYPERLINK ) ) + { + rtl::OUString sHlink; + ScMacroInfo* pInfo = lcl_getShapeHyperMacroInfo(this, TRUE); + if ( ( aValue >>= sHlink ) && pInfo ) + pInfo->SetHlink( sHlink ); + } else { GetShapePropertySet(); @@ -816,6 +834,13 @@ uno::Any SAL_CALL ScShapeObj::getPropertyValue( const rtl::OUString& aPropertyNa } } } + else if ( aNameString.EqualsAscii( SC_UNONAME_HYPERLINK ) ) + { + rtl::OUString sHlink; + if ( ScMacroInfo* pInfo = lcl_getShapeHyperMacroInfo(this) ) + sHlink = pInfo->GetHlink(); + aAny <<= sHlink; + } else { GetShapePropertySet(); @@ -1339,11 +1364,6 @@ SdrObject* ScShapeObj::GetSdrObject() const throw() } #define SC_EVENTACC_ONCLICK ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnClick" ) ) -#ifdef ISSUE66550_HLINK_FOR_SHAPES -#define SC_EVENTACC_ONACTION ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OnAction" ) ) -#define SC_EVENTACC_URL ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "URL" ) ) -#define SC_EVENTACC_ACTION ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Action" ) ) -#endif #define SC_EVENTACC_SCRIPT ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Script" ) ) #define SC_EVENTACC_EVENTTYPE ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "EventType" ) ) @@ -1355,10 +1375,7 @@ private: ScMacroInfo* getInfo( BOOL bCreate = FALSE ) { - if( mpShape ) - if( SdrObject* pObj = mpShape->GetSdrObject() ) - return ScDrawLayer::GetMacroInfo( pObj, bCreate ); - return 0; + return lcl_getShapeHyperMacroInfo( mpShape, bCreate ); } public: @@ -1384,11 +1401,7 @@ public: isEventType = true; continue; } -#ifdef ISSUE66550_HLINK_FOR_SHAPES - if ( isEventType && ((pProperties->Name == SC_EVENTACC_SCRIPT) || (pProperties->Name == SC_EVENTACC_URL)) ) -#else if ( isEventType && (pProperties->Name == SC_EVENTACC_SCRIPT) ) -#endif { rtl::OUString sValue; if ( pProperties->Value >>= sValue ) @@ -1399,10 +1412,8 @@ public: break; if ( pProperties->Name == SC_EVENTACC_SCRIPT ) pInfo->SetMacro( sValue ); -#ifdef ISSUE66550_HLINK_FOR_SHAPES else pInfo->SetHlink( sValue ); -#endif } } } @@ -1425,19 +1436,6 @@ public: aProperties[ 1 ].Value <<= pInfo->GetMacro(); } } -#ifdef ISSUE66550_HLINK_FOR_SHAPES - else if( aName == SC_EVENTACC_ONACTION ) - { - if ( pInfo && (pInfo->GetHlink().getLength() > 0) ) - { - aProperties.realloc( 2 ); - aProperties[ 0 ].Name = SC_EVENTACC_EVENTTYPE; - aProperties[ 0 ].Value <<= SC_EVENTACC_ACTION; - aProperties[ 1 ].Name = SC_EVENTACC_URL; - aProperties[ 1 ].Value <<= pInfo->GetHlink(); - } - } -#endif else { throw container::NoSuchElementException(); @@ -1448,25 +1446,14 @@ public: virtual uno::Sequence< rtl::OUString > SAL_CALL getElementNames() throw(uno::RuntimeException) { -#ifdef ISSUE66550_HLINK_FOR_SHAPES - uno::Sequence< rtl::OUString > aSeq( 2 ); -#else uno::Sequence< rtl::OUString > aSeq( 1 ); -#endif aSeq[ 0 ] = SC_EVENTACC_ONCLICK; -#ifdef ISSUE66550_HLINK_FOR_SHAPES - aSeq[ 1 ] = SC_EVENTACC_ONACTION; -#endif return aSeq; } virtual sal_Bool SAL_CALL hasByName( const rtl::OUString& aName ) throw(uno::RuntimeException) { -#ifdef ISSUE66550_HLINK_FOR_SHAPES - return (aName == SC_EVENTACC_ONCLICK) || (aName == SC_EVENTACC_ONACTION); -#else return aName == SC_EVENTACC_ONCLICK; -#endif } // XElementAccess @@ -1519,3 +1506,5 @@ uno::Sequence< ::rtl::OUString > SAL_CALL ScShapeObj::getSupportedServiceNames( aSupported[ aSupported.getLength() - 1 ] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sheet.Shape" ) ); return aSupported; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/srchuno.cxx b/sc/source/ui/unoobj/srchuno.cxx index f0bff44dc05c..d1999ed7bd13 100644 --- a/sc/source/ui/unoobj/srchuno.cxx +++ b/sc/source/ui/unoobj/srchuno.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -276,3 +277,4 @@ ScCellSearchObj* ScCellSearchObj::getImplementation( +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx index 36c2962bfc71..ea310e72a127 100644 --- a/sc/source/ui/unoobj/styleuno.cxx +++ b/sc/source/ui/unoobj/styleuno.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -2133,3 +2134,4 @@ uno::Sequence<rtl::OUString> SAL_CALL ScStyleObj::getSupportedServiceNames() //------------------------------------------------------------------------ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/targuno.cxx b/sc/source/ui/unoobj/targuno.cxx index e4a0768002a6..fa7d128b7f89 100644 --- a/sc/source/ui/unoobj/targuno.cxx +++ b/sc/source/ui/unoobj/targuno.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -314,3 +315,4 @@ sal_Bool SAL_CALL ScLinkTargetsObj::hasElements(void) throw( uno::RuntimeExcepti +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/textuno.cxx b/sc/source/ui/unoobj/textuno.cxx index 5c45195621d8..e24637d179ea 100644 --- a/sc/source/ui/unoobj/textuno.cxx +++ b/sc/source/ui/unoobj/textuno.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1150,3 +1151,4 @@ ScCellTextObj::~ScCellTextObj() throw() { } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/tokenuno.cxx b/sc/source/ui/unoobj/tokenuno.cxx index 49e5c65e29ec..a2cb339db36c 100644 --- a/sc/source/ui/unoobj/tokenuno.cxx +++ b/sc/source/ui/unoobj/tokenuno.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -467,3 +468,4 @@ ScFormulaOpCodeMapperObj::ScFormulaOpCodeMapperObj(::std::auto_ptr<formula::Form // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/unodoc.cxx b/sc/source/ui/unoobj/unodoc.cxx index d3d755e8b495..772bce48df0f 100644 --- a/sc/source/ui/unoobj/unodoc.cxx +++ b/sc/source/ui/unoobj/unodoc.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -65,3 +66,4 @@ uno::Reference< uno::XInterface > SAL_CALL ScDocument_createInstance( } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/unoguard.cxx b/sc/source/ui/unoobj/unoguard.cxx index ff1c94338b72..6f7a6bb9036a 100644 --- a/sc/source/ui/unoobj/unoguard.cxx +++ b/sc/source/ui/unoobj/unoguard.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -45,3 +46,4 @@ ScUnoGuard::ScUnoGuard() : +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/unoreflist.cxx b/sc/source/ui/unoobj/unoreflist.cxx index 65f43273f6e7..1a80e1e8b2c7 100644 --- a/sc/source/ui/unoobj/unoreflist.cxx +++ b/sc/source/ui/unoobj/unoreflist.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -71,3 +72,4 @@ ScUnoRefUndoHint::~ScUnoRefUndoHint() { } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx index 86ebf066a52d..d939018b707a 100644 --- a/sc/source/ui/unoobj/viewuno.cxx +++ b/sc/source/ui/unoobj/viewuno.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -460,6 +461,91 @@ void SAL_CALL ScViewPaneObj::release() throw() OWeakObject::release(); } +// To process sheet compatibile event +typedef ::cppu::WeakImplHelper2< awt::XEnhancedMouseClickHandler, view::XSelectionChangeListener > TabViewEventListener_BASE; +class ScTabViewEventListener: public TabViewEventListener_BASE +{ +private: + ScTabViewObj* pViewObj; + uno::Reference< script::vba::XVBAEventProcessor > xVbaEventsHelper; + sal_Bool bDelaySelectionEvent; + sal_Bool bSelectionChangeOccured; + + void fireSelectionChangeEvent(); + +public: + ScTabViewEventListener( ScTabViewObj* pObj, uno::Reference< script::vba::XVBAEventProcessor >& rVbaEventsHelper); + ~ScTabViewEventListener(); + // XEnhancedMouseClickHandler + virtual sal_Bool SAL_CALL mousePressed( const awt::EnhancedMouseEvent& e ) throw (uno::RuntimeException); + virtual sal_Bool SAL_CALL mouseReleased( const awt::EnhancedMouseEvent& e ) throw (uno::RuntimeException); + + // XSelectionChangeListener + virtual void SAL_CALL selectionChanged( const lang::EventObject& aEvent ) throw ( uno::RuntimeException ); + // XEventListener + virtual void SAL_CALL disposing( const lang::EventObject& aEvent ) throw ( uno::RuntimeException ); +}; + +ScTabViewEventListener::ScTabViewEventListener(ScTabViewObj* pObj, uno::Reference< script::vba::XVBAEventProcessor >& rVbaEventsHelper): + pViewObj( pObj ),xVbaEventsHelper( rVbaEventsHelper ), bDelaySelectionEvent( sal_False ), bSelectionChangeOccured( sal_False ) +{ +} + +ScTabViewEventListener::~ScTabViewEventListener() +{ +} + +void SAL_CALL ScTabViewEventListener::disposing( const lang::EventObject& /*aEvent*/ ) throw ( uno::RuntimeException ) +{ +} + +void ScTabViewEventListener::fireSelectionChangeEvent() +{ + if ( xVbaEventsHelper.is() && pViewObj ) + { + uno::Sequence< uno::Any > aArgs(1); + aArgs[0] = pViewObj->getSelection(); + try + { + xVbaEventsHelper->processVbaEvent( script::vba::VBAEventId::WORKSHEET_SELECTIONCHANGE, aArgs ); + } + catch( uno::Exception& ) + { + } + } + bDelaySelectionEvent = sal_False; + bSelectionChangeOccured = sal_False; +} + +sal_Bool SAL_CALL ScTabViewEventListener::mousePressed( const awt::EnhancedMouseEvent& e ) throw (uno::RuntimeException) +{ + // Delay to fire the selection change event if clicking the left mouse button to do selection. + bDelaySelectionEvent = ( e.Buttons == ::com::sun::star::awt::MouseButton::RIGHT ) ? sal_False : sal_True; + bSelectionChangeOccured = sal_False; + + // ScTabViewObj::MousePressed should handle process BeforeDoubleClick and BeforeRightClick events + return sal_True; +} + +sal_Bool SAL_CALL ScTabViewEventListener::mouseReleased( const awt::EnhancedMouseEvent&/*e*/) throw (uno::RuntimeException) +{ + if ( bSelectionChangeOccured ) + fireSelectionChangeEvent(); + return sal_True; +} + +void SAL_CALL ScTabViewEventListener::selectionChanged( const lang::EventObject& /*aEvent*/ ) throw ( uno::RuntimeException ) +{ + if ( !bDelaySelectionEvent ) + { + fireSelectionChangeEvent(); + } + else + { + bSelectionChangeOccured = sal_True; + } +} + //------------------------------------------------------------------------ // Default-ctor wird fuer SMART_REFLECTION_IMPLEMENTATION gebraucht @@ -474,7 +560,22 @@ ScTabViewObj::ScTabViewObj( ScTabViewShell* pViewSh ) : bDrawSelModeSet(sal_False) { if (pViewSh) + { nPreviousTab = pViewSh->GetViewData()->GetTabNo(); + ScViewData* pViewData = pViewSh->GetViewData(); + if( pViewData ) + { + uno::Reference< script::vba::XVBAEventProcessor > xVbaEventsHelper (pViewData->GetDocument()->GetVbaEventProcessor(), uno::UNO_QUERY ); + if ( xVbaEventsHelper.is() ) + { + ScTabViewEventListener* pEventListener = new ScTabViewEventListener( this, xVbaEventsHelper ); + uno::Reference< awt::XEnhancedMouseClickHandler > aMouseClickHandler( *pEventListener, uno::UNO_QUERY ); + addEnhancedMouseClickHandler( aMouseClickHandler ); + uno::Reference< view::XSelectionChangeListener > aSelectionChangeListener( *pEventListener, uno::UNO_QUERY ); + addSelectionChangeListener( aSelectionChangeListener ); + } + } + } } ScTabViewObj::~ScTabViewObj() @@ -1162,10 +1263,20 @@ uno::Reference<sheet::XSpreadsheet> SAL_CALL ScTabViewObj::getActiveSheet() return NULL; } +//liuchen 2009-9-2 support expand (but not replace) the active sheet void SAL_CALL ScTabViewObj::setActiveSheet( const uno::Reference<sheet::XSpreadsheet>& xActiveSheet ) throw(uno::RuntimeException) { + selectSheet(xActiveSheet, false); +} + +void SAL_CALL +ScTabViewObj::selectSheet( const uno::Reference<sheet::XSpreadsheet>& xActiveSheet, + sal_Bool bExpand) + throw(uno::RuntimeException) +{ ScUnoGuard aGuard; + sal_Bool bNew = bExpand; ScTabViewShell* pViewSh = GetViewShell(); if ( pViewSh && xActiveSheet.is() ) @@ -1180,7 +1291,7 @@ void SAL_CALL ScTabViewObj::setActiveSheet( const uno::Reference<sheet::XSpreads { SCTAB nNewTab = rRanges.GetObject(0)->aStart.Tab(); if ( pViewSh->GetViewData()->GetDocument()->HasTable(nNewTab) ) - pViewSh->SetTabNo( nNewTab ); + pViewSh->SetTabNo( nNewTab, bNew, bExpand ); } } } @@ -1837,19 +1948,7 @@ void ScTabViewObj::SelectionChanged() /*ErrCode eRet =*/ pDocSh->CallXScript( *pScript, aParams, aRet, aOutArgsIndex, aOutArgs ); } } - - // execute VBA event handler - try - { - uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents( pDoc->GetVbaEventProcessor(), uno::UNO_SET_THROW ); - // the parameter is the clicked object, as in the mousePressed call above - uno::Sequence< uno::Any > aArgs( 1 ); - aArgs[ 0 ] <<= getSelection(); - xVbaEvents->processVbaEvent( ScSheetEvents::GetVbaSheetEventId( SC_SHEETEVENT_SELECT ), aArgs ); - } - catch( uno::Exception& ) - { - } + // Removed Sun/Oracle code intentionally, it doesn't work properly ( selection should be fired after mouse release ) } @@ -1874,6 +1973,12 @@ void SAL_CALL ScTabViewObj::setPropertyValue( ScUnoGuard aGuard; String aString(aPropertyName); + if ( aString.EqualsAscii(SC_UNO_FILTERED_RANGE_SELECTION) ) + { + bFilteredRangeSelection = ScUnoHelpFunctions::GetBoolFromAny(aValue); + return; + } + ScTabViewShell* pViewSh = GetViewShell(); if (pViewSh) { @@ -1994,6 +2099,12 @@ uno::Any SAL_CALL ScTabViewObj::getPropertyValue( const rtl::OUString& aProperty String aString(aPropertyName); uno::Any aRet; + if ( aString.EqualsAscii(SC_UNO_FILTERED_RANGE_SELECTION) ) + { + ScUnoHelpFunctions::SetBoolInAny(aRet, bFilteredRangeSelection); + return aRet; + } + ScTabViewShell* pViewSh = GetViewShell(); if (pViewSh) { @@ -2345,3 +2456,4 @@ void SAL_CALL ScTabViewObj::insertTransferable( const ::com::sun::star::uno::Ref +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/unoobj/warnpassword.cxx b/sc/source/ui/unoobj/warnpassword.cxx index ce81fd2645c4..c00df0a3eedf 100644 --- a/sc/source/ui/unoobj/warnpassword.cxx +++ b/sc/source/ui/unoobj/warnpassword.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -93,3 +94,4 @@ bool ScWarnPassword::WarningOnPassword( SfxMedium& rMedium ) return bReturn; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/excelvbahelper.cxx b/sc/source/ui/vba/excelvbahelper.cxx index 2c39d7154b4b..3ca5ba861dc8 100644 --- a/sc/source/ui/vba/excelvbahelper.cxx +++ b/sc/source/ui/vba/excelvbahelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,6 +31,9 @@ #include "transobj.hxx" #include "scmod.hxx" #include "cellsuno.hxx" +#include "compiler.hxx" +#include "token.hxx" +#include "tokenarray.hxx" #include <comphelper/processfactory.hxx> #include <com/sun/star/sheet/XSheetCellRange.hpp> @@ -43,6 +47,52 @@ namespace vba namespace excel { +uno::Reference< sheet::XDatabaseRanges > +GetDataBaseRanges( ScDocShell* pShell ) throw ( uno::RuntimeException ) +{ + uno::Reference< frame::XModel > xModel; + if ( pShell ) + xModel.set( pShell->GetModel(), uno::UNO_QUERY_THROW ); + uno::Reference< beans::XPropertySet > xModelProps( xModel, uno::UNO_QUERY_THROW ); + uno::Reference< sheet::XDatabaseRanges > xDBRanges( xModelProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("DatabaseRanges") ) ), uno::UNO_QUERY_THROW ); + return xDBRanges; +} + +// returns the XDatabaseRange for the autofilter on sheet (nSheet) +// also populates sName with the name of range +uno::Reference< sheet::XDatabaseRange > +GetAutoFiltRange( ScDocShell* pShell, sal_Int16 nSheet, rtl::OUString& sName ) throw ( uno::RuntimeException ) +{ + uno::Reference< container::XIndexAccess > xIndexAccess( GetDataBaseRanges( pShell ), uno::UNO_QUERY_THROW ); + uno::Reference< sheet::XDatabaseRange > xDataBaseRange; + table::CellRangeAddress dbAddress; + for ( sal_Int32 index=0; index < xIndexAccess->getCount(); ++index ) + { + uno::Reference< sheet::XDatabaseRange > xDBRange( xIndexAccess->getByIndex( index ), uno::UNO_QUERY_THROW ); + uno::Reference< container::XNamed > xNamed( xDBRange, uno::UNO_QUERY_THROW ); + // autofilters work weirdly with openoffice, unnamed is the default + // named range which is used to create an autofilter, but + // its also possible that another name could be used + // this also causes problems when an autofilter is created on + // another sheet + // ( but.. you can use any named range ) + dbAddress = xDBRange->getDataArea(); + if ( dbAddress.Sheet == nSheet ) + { + sal_Bool bHasAuto = sal_False; + uno::Reference< beans::XPropertySet > xProps( xDBRange, uno::UNO_QUERY_THROW ); + xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("AutoFilter") ) ) >>= bHasAuto; + if ( bHasAuto ) + { + sName = xNamed->getName(); + xDataBaseRange=xDBRange; + break; + } + } + } + return xDataBaseRange; +} + ScDocShell* GetDocShellFromRange( const uno::Reference< uno::XInterface >& xRange ) throw ( uno::RuntimeException ) { ScCellRangesBase* pScCellRangesBase = ScCellRangesBase::getImplementation( xRange ); @@ -53,6 +103,13 @@ ScDocShell* GetDocShellFromRange( const uno::Reference< uno::XInterface >& xRang return pScCellRangesBase->GetDocShell(); } +ScDocShell* GetDocShellFromRanges( const uno::Reference< sheet::XSheetCellRangeContainer >& xRanges ) throw ( uno::RuntimeException ) +{ + // need the ScCellRangesBase to get docshell + uno::Reference< uno::XInterface > xIf( xRanges, uno::UNO_QUERY_THROW ); + return GetDocShellFromRange( xIf ); +} + ScDocument* GetDocumentFromRange( const uno::Reference< uno::XInterface >& xRange ) throw ( uno::RuntimeException ) { ScDocShell* pDocShell = GetDocShellFromRange( xRange ); @@ -63,6 +120,16 @@ ScDocument* GetDocumentFromRange( const uno::Reference< uno::XInterface >& xRang return pDocShell->GetDocument(); } +uno::Reference< frame::XModel > GetModelFromRange( const uno::Reference< uno::XInterface >& xRange ) throw ( uno::RuntimeException ) +{ + ScDocShell* pDocShell = GetDocShellFromRange( xRange ); + if ( !pDocShell ) + { + throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Failed to access underlying model uno range object" ) ), uno::Reference< uno::XInterface >() ); + } + return pDocShell->GetModel(); +} + void implSetZoom( const uno::Reference< frame::XModel >& xModel, sal_Int16 nZoom, std::vector< SCTAB >& nTabs ) { ScTabViewShell* pViewSh = excel::getBestViewShell( xModel ); @@ -192,6 +259,15 @@ void implnPasteSpecial( const uno::Reference< frame::XModel>& xModel, USHORT nFl } +void implnCopyRange( const uno::Reference< frame::XModel>& xModel, const ScRange& rRange ) +{ + ScTabViewShell* pViewShell = getBestViewShell( xModel ); + if ( pViewShell ) + { + pViewShell->CopyToClip( NULL, rRange, FALSE, TRUE, TRUE ); + } +} + ScDocShell* getDocShell( const css::uno::Reference< css::frame::XModel>& xModel ) { @@ -229,6 +305,19 @@ getViewFrame( const uno::Reference< frame::XModel >& xModel ) return NULL; } +sal_Bool IsR1C1ReferFormat( ScDocument* pDoc, const rtl::OUString& sRangeStr ) +{ + ScRangeList aCellRanges; + String sAddress( sRangeStr ); + USHORT nMask = SCA_VALID; + USHORT rResFlags = aCellRanges.Parse( sAddress, pDoc, nMask, formula::FormulaGrammar::CONV_XL_R1C1 ); + if ( rResFlags & SCA_VALID ) + { + return sal_True; + } + return sal_False; +} + uno::Reference< XHelperInterface > getUnoSheetModuleObj( const uno::Reference< table::XCellRange >& xRange ) throw ( uno::RuntimeException ) { @@ -246,6 +335,84 @@ getUnoSheetModuleObj( const uno::Reference< table::XCellRange >& xRange ) throw return xParent; } +formula::FormulaGrammar::Grammar GetFormulaGrammar( ScDocument* pDoc, const ScAddress& sAddress, const css::uno::Any& aFormula ) +{ + formula::FormulaGrammar::Grammar eGrammar = formula::FormulaGrammar::GRAM_NATIVE_XL_A1; + if ( pDoc && aFormula.hasValue() && aFormula.getValueTypeClass() == uno::TypeClass_STRING ) + { + rtl::OUString sFormula; + aFormula >>= sFormula; + + ScCompiler aCompiler( pDoc, sAddress ); + aCompiler.SetGrammar( formula::FormulaGrammar::GRAM_NATIVE_XL_R1C1 ); + ScTokenArray* pCode = aCompiler.CompileString( sFormula ); + if ( pCode ) + { + USHORT nLen = pCode->GetLen(); + formula::FormulaToken** pTokens = pCode->GetArray(); + for ( USHORT nPos = 0; nPos < nLen; nPos++ ) + { + const formula::FormulaToken& rToken = *pTokens[nPos]; + switch ( rToken.GetType() ) + { + case formula::svSingleRef: + case formula::svDoubleRef: + { + return formula::FormulaGrammar::GRAM_NATIVE_XL_R1C1; + } + break; + default: break; + } + } + } + } + return eGrammar; +} + +void CompileExcelFormulaToODF( ScDocument* pDoc, const String& rOldFormula, String& rNewFormula ) +{ + if ( !pDoc ) + { + return; + } + ScCompiler aCompiler( pDoc, ScAddress() ); + aCompiler.SetGrammar( excel::GetFormulaGrammar( pDoc, ScAddress(), uno::Any( rtl::OUString( rOldFormula ) ) ) ); + ScTokenArray* pCode = aCompiler.CompileString( rOldFormula ); + aCompiler.SetGrammar( formula::FormulaGrammar::GRAM_PODF_A1 ); + aCompiler.CreateStringFromTokenArray( rNewFormula ); +} + +void CompileODFFormulaToExcel( ScDocument* pDoc, const String& rOldFormula, String& rNewFormula, const formula::FormulaGrammar::Grammar eGrammar ) +{ + // eGrammar can be formula::FormulaGrammar::GRAM_NATIVE_XL_R1C1 and formula::FormulaGrammar::GRAM_NATIVE_XL_A1 + if ( !pDoc ) + { + return; + } + ScCompiler aCompiler( pDoc, ScAddress() ); + aCompiler.SetGrammar( formula::FormulaGrammar::GRAM_PODF_A1 ); + ScTokenArray* pCode = aCompiler.CompileString( rOldFormula ); + aCompiler.SetGrammar( eGrammar ); + if ( !pCode ) + { + return; + } + USHORT nLen = pCode->GetLen(); + formula::FormulaToken** pTokens = pCode->GetArray(); + for ( USHORT nPos = 0; nPos < nLen && pTokens[nPos]; nPos++ ) + { + String rFormula; + formula::FormulaToken* pToken = pTokens[nPos]; + aCompiler.CreateStringFromToken( rFormula, pToken, TRUE ); + if ( pToken->GetOpCode() == ocSep ) + { + // Excel formula separator is ",". + rFormula = String::CreateFromAscii(","); + } + rNewFormula += rFormula; + } +} + uno::Reference< XHelperInterface > getUnoSheetModuleObj( const uno::Reference< sheet::XSheetCellRangeContainer >& xRanges ) throw ( uno::RuntimeException ) { @@ -266,3 +433,5 @@ ScVbaCellRangeAccess::GetDataSet( ScCellRangesBase* pRangeObj ) } //excel } //vba } //ooo + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/excelvbahelper.hxx b/sc/source/ui/vba/excelvbahelper.hxx index da0474e6ceb0..fca3d11958fc 100644 --- a/sc/source/ui/vba/excelvbahelper.hxx +++ b/sc/source/ui/vba/excelvbahelper.hxx @@ -29,9 +29,12 @@ #include<vbahelper/vbahelper.hxx> #include <docsh.hxx> +#include <com/sun/star/sheet/XDatabaseRanges.hpp> +#include <com/sun/star/sheet/XDatabaseRange.hpp> #include <com/sun/star/table/XCellRange.hpp> #include <com/sun/star/sheet/XSheetCellRangeContainer.hpp> #include <ooo/vba/XHelperInterface.hpp> +#include <formula/grammar.hxx> class ScCellRangesBase; @@ -39,29 +42,39 @@ namespace ooo { namespace vba { - namespace excel + namespace excel { - // nTabs empty means apply zoom to all sheets - void implSetZoom( const css::uno::Reference< css::frame::XModel >& xModel, sal_Int16 nZoom, std::vector< SCTAB >& nTabs ); - void implnCopy( const css::uno::Reference< css::frame::XModel>& xModel ); - void implnPaste ( const css::uno::Reference< css::frame::XModel>& xModel ); - void implnCut( const css::uno::Reference< css::frame::XModel>& xModel ); - void implnPasteSpecial( const css::uno::Reference< css::frame::XModel>& xModel, sal_uInt16 nFlags,sal_uInt16 nFunction,sal_Bool bSkipEmpty, sal_Bool bTranspose); - ScTabViewShell* getBestViewShell( const css::uno::Reference< css::frame::XModel>& xModel ) ; - ScDocShell* getDocShell( const css::uno::Reference< css::frame::XModel>& xModel ) ; - ScTabViewShell* getCurrentBestViewShell( const css::uno::Reference< css::uno::XComponentContext >& xContext ); - SfxViewFrame* getViewFrame( const css::uno::Reference< css::frame::XModel >& xModel ); + // nTabs empty means apply zoom to all sheets + void implSetZoom( const css::uno::Reference< css::frame::XModel >& xModel, sal_Int16 nZoom, std::vector< SCTAB >& nTabs ); + void implnCopy( const css::uno::Reference< css::frame::XModel>& xModel ); + void implnPaste ( const css::uno::Reference< css::frame::XModel>& xModel ); + void implnCut( const css::uno::Reference< css::frame::XModel>& xModel ); + void implnPasteSpecial( const css::uno::Reference< css::frame::XModel>& xModel, sal_uInt16 nFlags,sal_uInt16 nFunction,sal_Bool bSkipEmpty, sal_Bool bTranspose); + void implnCopyRange( const css::uno::Reference< css::frame::XModel>& xModel, const ScRange& rRange ); + ScTabViewShell* getBestViewShell( const css::uno::Reference< css::frame::XModel>& xModel ) ; + ScDocShell* getDocShell( const css::uno::Reference< css::frame::XModel>& xModel ) ; + ScTabViewShell* getCurrentBestViewShell( const css::uno::Reference< css::uno::XComponentContext >& xContext ); + SfxViewFrame* getViewFrame( const css::uno::Reference< css::frame::XModel >& xModel ); + sal_Bool IsR1C1ReferFormat( ScDocument* pDoc, const ::rtl::OUString& sRangeStr ); + formula::FormulaGrammar::Grammar GetFormulaGrammar( ScDocument* pDoc, const ScAddress& sAddress, const css::uno::Any& aFormula ); + void CompileExcelFormulaToODF( ScDocument* pDoc, const String& rOldFormula, String& rNewFormula ); + void CompileODFFormulaToExcel( ScDocument* pDoc, const String& rOldFormula, String& rNewFormula, const formula::FormulaGrammar::Grammar eGrammar ); + css::uno::Reference< css::sheet::XDatabaseRanges > GetDataBaseRanges( ScDocShell* pShell ) throw ( css::uno::RuntimeException ); + + css::uno::Reference< css::sheet::XDatabaseRange > GetAutoFiltRange( ScDocShell* pShell, sal_Int16 nSheet, rtl::OUString& sName ) throw ( css::uno::RuntimeException ); css::uno::Reference< ooo::vba::XHelperInterface > getUnoSheetModuleObj( const css::uno::Reference< css::sheet::XSheetCellRangeContainer >& xRanges ) throw ( css::uno::RuntimeException ); css::uno::Reference< ooo::vba::XHelperInterface > getUnoSheetModuleObj( const css::uno::Reference< css::table::XCellRange >& xRange ) throw ( css::uno::RuntimeException ); ScDocShell* GetDocShellFromRange( const css::uno::Reference< css::uno::XInterface >& xRange ) throw ( css::uno::RuntimeException ); + ScDocShell* GetDocShellFromRanges( const css::uno::Reference< css::sheet::XSheetCellRangeContainer >& xRanges ) throw ( css::uno::RuntimeException ); ScDocument* GetDocumentFromRange( const css::uno::Reference< css::uno::XInterface >& xRange ) throw ( css::uno::RuntimeException ); css::uno::Reference< css::frame::XModel > GetModelFromRange( const css::uno::Reference< css::uno::XInterface >& xRange ) throw ( css::uno::RuntimeException ); + class ScVbaCellRangeAccess { public: static SfxItemSet* GetDataSet( ScCellRangesBase* pRangeObj ); }; -} -} + } + } } #endif diff --git a/sc/source/ui/vba/makefile.mk b/sc/source/ui/vba/makefile.mk index 92bb3fd39db0..ba50cbad9abd 100644 --- a/sc/source/ui/vba/makefile.mk +++ b/sc/source/ui/vba/makefile.mk @@ -31,7 +31,7 @@ PRJNAME=sc TARGET=vbaobj ENABLE_EXCEPTIONS=TRUE VISIBILITY_HIDDEN=TRUE - +CDEFS+=-DVBA_OOBUILD_HACK # --- Settings ----------------------------------------------------- .INCLUDE : settings.mk @@ -63,18 +63,29 @@ SLOFILES= \ $(SLO)$/vbacharttitle.obj \ $(SLO)$/vbacomment.obj \ $(SLO)$/vbacomments.obj \ + $(SLO)$/vbacommentshape.obj \ $(SLO)$/vbacondition.obj \ $(SLO)$/vbadialog.obj \ $(SLO)$/vbadialogs.obj \ $(SLO)$/vbaeventshelper.obj \ + $(SLO)$/vbafiledialog.obj \ + $(SLO)$/vbafiledialogselecteditems.obj \ + $(SLO)$/vbafilesearch.obj \ $(SLO)$/vbafont.obj \ $(SLO)$/vbaformat.obj \ $(SLO)$/vbaformatcondition.obj \ $(SLO)$/vbaformatconditions.obj \ + $(SLO)$/vbafoundfiles.obj \ $(SLO)$/vbaglobals.obj \ $(SLO)$/vbahyperlink.obj \ $(SLO)$/vbahyperlinks.obj \ $(SLO)$/vbainterior.obj \ + $(SLO)$/vbamenubar.obj \ + $(SLO)$/vbamenubars.obj \ + $(SLO)$/vbamenu.obj \ + $(SLO)$/vbamenus.obj \ + $(SLO)$/vbamenuitem.obj \ + $(SLO)$/vbamenuitems.obj \ $(SLO)$/vbaname.obj \ $(SLO)$/vbanames.obj \ $(SLO)$/vbaoleobject.obj \ @@ -88,6 +99,7 @@ SLOFILES= \ $(SLO)$/vbapivotcache.obj \ $(SLO)$/vbapivottable.obj \ $(SLO)$/vbapivottables.obj \ + $(SLO)$/vbaquerytable.obj \ $(SLO)$/vbarange.obj \ $(SLO)$/vbaseriescollection.obj \ $(SLO)$/vbasheetobject.obj \ diff --git a/sc/source/ui/vba/service.cxx b/sc/source/ui/vba/service.cxx index 2b1f14cf154a..e0ed82fbc0fd 100644 --- a/sc/source/ui/vba/service.cxx +++ b/sc/source/ui/vba/service.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -132,3 +133,5 @@ extern "C" return pRet; } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/testvba/testvba.cxx b/sc/source/ui/vba/testvba/testvba.cxx index 686b3e47eaa9..cf04d45250db 100644 --- a/sc/source/ui/vba/testvba/testvba.cxx +++ b/sc/source/ui/vba/testvba/testvba.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ #include "cppuhelper/bootstrap.hxx" #include <com/sun/star/beans/Property.hpp> @@ -159,15 +160,15 @@ mxCompLoader( _xCompLoader ), msOutDirPath( convertToURL( _outDirPath ) ) Reference< script::provider::XScript > xScript; try { - xScript = xProv->getScript( rtl::OUString::createFromAscii( "vnd.sun.star.script:Standard.TestMacros.Main?language=Basic&location=document" )); + xScript = xProv->getScript( rtl::OUString::createFromAscii( "vnd.sun.star.script:VBAProject.TestMacros.Main?language=Basic&location=document" )); } catch ( uno::Exception& e ) { try { - xScript = xProv->getScript( rtl::OUString::createFromAscii( "vnd.sun.star.script:Standard.testMacro.Main?language=Basic&location=document" )); + xScript = xProv->getScript( rtl::OUString::createFromAscii( "vnd.sun.star.script:VBAProject.testMacro.Main?language=Basic&location=document" )); } catch ( uno::Exception& e2 ) { - xScript = xProv->getScript( rtl::OUString::createFromAscii( "vnd.sun.star.script:Standard.testMain.Main?language=Basic&location=document" )); + xScript = xProv->getScript( rtl::OUString::createFromAscii( "vnd.sun.star.script:VBAProject.testMain.Main?language=Basic&location=document" )); } } OSL_TRACE("Got script for doc %s", rtl::OUStringToOString( sUrl, RTL_TEXTENCODING_UTF8 ).getStr() ); @@ -307,3 +308,5 @@ int main( int argv, char** argc ) } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbaapplication.cxx b/sc/source/ui/vba/vbaapplication.cxx index f3965393e919..7ed96e7f900e 100644 --- a/sc/source/ui/vba/vbaapplication.cxx +++ b/sc/source/ui/vba/vbaapplication.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -27,11 +28,14 @@ #include <stdio.h> +#include <com/sun/star/datatransfer/clipboard/XClipboard.hpp> +#include <com/sun/star/datatransfer/clipboard/XFlushableClipboard.hpp> #include <com/sun/star/sheet/XSpreadsheetView.hpp> #include <com/sun/star/sheet/XSpreadsheets.hpp> #include <com/sun/star/view/XSelectionSupplier.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <ooo/vba/excel/XlCalculation.hpp> +#include <ooo/vba/excel/XlCutCopyMode.hpp> #include <com/sun/star/sheet/XCellRangeReferrer.hpp> #include <com/sun/star/sheet/XCalculatable.hpp> #include <com/sun/star/frame/XLayoutManager.hpp> @@ -40,6 +44,19 @@ #include <ooo/vba/excel/XlMousePointer.hpp> #include <com/sun/star/sheet/XNamedRanges.hpp> #include <com/sun/star/sheet/XCellRangeAddressable.hpp> +#include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp> +#include <com/sun/star/ui/dialogs/XFilePicker.hpp> +#include <com/sun/star/ui/dialogs/XFilePicker2.hpp> +#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp> +#include <com/sun/star/ui/dialogs/TemplateDescription.hpp> +//2009-11-06 add by limingl +#include <com/sun/star/ui/dialogs/XFilterManager.hpp> +#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> +//end +#include<ooo/vba/XCommandBars.hpp> +#include <ooo/vba/excel/XlEnableCancelKey.hpp> //liuchen 2009-11-26 +#include <ooo/vba/excel/XlApplicationInternational.hpp> //liuchen 2009-11-26 +#include <unotools/localedatawrapper.hxx> //liuchen 2009-11-26 #include "vbaapplication.hxx" #include "vbaworkbooks.hxx" @@ -51,25 +68,37 @@ #include "vbawindow.hxx" #include "vbawindows.hxx" #include "vbaglobals.hxx" +#include "vbamenubars.hxx" #include "tabvwsh.hxx" #include "gridwin.hxx" #include "vbanames.hxx" #include <vbahelper/vbashape.hxx> #include "vbatextboxshape.hxx" #include "vbaassistant.hxx" +#include "vbafilesearch.hxx" //liuchen 2009-8-18, add the support of VBA Application.FileSearch #include "sc.hrc" +#include "macromgr.hxx" +#include "global.hxx" //liuchen 2009-11-26 +#include "scmod.hxx" //liuchen 2009-11-26 +#include "docoptio.hxx" //liuchen 2009-11-26 +#include "appoptio.hxx" #include <osl/file.hxx> +#include <map> + #include <sfx2/request.hxx> #include <sfx2/objsh.hxx> #include <sfx2/viewfrm.hxx> #include <sfx2/app.hxx> +#include <comphelper/processfactory.hxx> + #include <toolkit/awt/vclxwindow.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <tools/diagnose_ex.h> +#include <tools/urlobj.hxx> #include <docuno.hxx> @@ -78,15 +107,29 @@ #include <basic/sbuno.hxx> #include <basic/sbmeth.hxx> +#include "transobj.hxx" #include "convuno.hxx" #include "cellsuno.hxx" +#include "miscuno.hxx" +#include "unonames.hxx" #include "docsh.hxx" #include <vbahelper/helperdecl.hxx> #include "excelvbahelper.hxx" - +#include <basic/sbmeth.hxx> +#include <basic/sbmod.hxx> +#include <basic/sbstar.hxx> +#include <basic/sbx.hxx> +#include <basic/sbxobj.hxx> +#include <basic/sbuno.hxx> +//limingl 2009-07-20 +#include "vbafiledialog.hxx" using namespace ::ooo::vba; using namespace ::com::sun::star; +using ::com::sun::star::uno::Reference; +using ::com::sun::star::uno::UNO_QUERY_THROW; +using ::com::sun::star::uno::UNO_QUERY; +using ::rtl::OUString; // #TODO is this defined somewhere else? #if ( defined UNX ) || ( defined OS2 ) //unix @@ -237,16 +280,49 @@ ScVbaApplication::getAssistant() throw (uno::RuntimeException) return uno::Reference< XAssistant >( new ScVbaAssistant( this, mxContext ) ); } +//liuchen 2009-8-18, add support of VBA Application.FileSearch +uno::Reference< XFileSearch > SAL_CALL +ScVbaApplication::getFileSearch() throw (uno::RuntimeException) +{ + if (! m_xFileSearch.get() ) + { + m_xFileSearch = uno::Reference< XFileSearch >( new ScVbaFileSearch( this, uno::Reference< XHelperInterface >( this ), mxContext ) ); + } + + return m_xFileSearch; +} +//liuchen + uno::Any SAL_CALL ScVbaApplication::getSelection() throw (uno::RuntimeException) { OSL_TRACE("** ScVbaApplication::getSelection() ** "); uno::Reference< frame::XModel > xModel( getCurrentDocument() ); - uno::Reference< lang::XServiceInfo > xServiceInfo( xModel->getCurrentSelection(), uno::UNO_QUERY_THROW ); - rtl::OUString sImpementaionName = xServiceInfo->getImplementationName(); - if( sImpementaionName.equalsIgnoreAsciiCaseAscii("com.sun.star.drawing.SvxShapeCollection") ) + + Reference< view::XSelectionSupplier > xSelSupp( xModel->getCurrentController(), UNO_QUERY_THROW ); + Reference< beans::XPropertySet > xPropSet( xSelSupp, UNO_QUERY_THROW ); + OUString aPropName = OUString::createFromAscii( SC_UNO_FILTERED_RANGE_SELECTION ); + uno::Any aOldVal = xPropSet->getPropertyValue( aPropName ); + uno::Any any; + any <<= sal_False; + xPropSet->setPropertyValue( aPropName, any ); + uno::Reference< uno::XInterface > aSelection = ScUnoHelpFunctions::AnyToInterface( + xSelSupp->getSelection() ); + xPropSet->setPropertyValue( aPropName, aOldVal ); + + if (!aSelection.is()) { - uno::Reference< drawing::XShapes > xShapes( xModel->getCurrentSelection(), uno::UNO_QUERY_THROW ); + throw uno::RuntimeException( + rtl::OUString::createFromAscii("failed to obtain current selection"), + uno::Reference< uno::XInterface >() ); + } + + uno::Reference< lang::XServiceInfo > xServiceInfo( aSelection, uno::UNO_QUERY_THROW ); + rtl::OUString sImplementationName = xServiceInfo->getImplementationName(); + + if( sImplementationName.equalsIgnoreAsciiCaseAscii("com.sun.star.drawing.SvxShapeCollection") ) + { + uno::Reference< drawing::XShapes > xShapes( aSelection, uno::UNO_QUERY_THROW ); uno::Reference< container::XIndexAccess > xIndexAccess( xShapes, uno::UNO_QUERY_THROW ); uno::Reference< drawing::XShape > xShape( xIndexAccess->getByIndex(0), uno::UNO_QUERY_THROW ); // if ScVbaShape::getType( xShape ) == office::MsoShapeType::msoAutoShape @@ -265,10 +341,10 @@ ScVbaApplication::getSelection() throw (uno::RuntimeException) else if( xServiceInfo->supportsService( rtl::OUString::createFromAscii("com.sun.star.sheet.SheetCellRange")) || xServiceInfo->supportsService( rtl::OUString::createFromAscii("com.sun.star.sheet.SheetCellRanges"))) { - uno::Reference< table::XCellRange > xRange( getCurrentDocument()->getCurrentSelection(), ::uno::UNO_QUERY); + uno::Reference< table::XCellRange > xRange( aSelection, ::uno::UNO_QUERY); if ( !xRange.is() ) { - uno::Reference< sheet::XSheetCellRangeContainer > xRanges( getCurrentDocument()->getCurrentSelection(), ::uno::UNO_QUERY); + uno::Reference< sheet::XSheetCellRangeContainer > xRanges( aSelection, ::uno::UNO_QUERY); if ( xRanges.is() ) return uno::makeAny( uno::Reference< excel::XRange >( new ScVbaRange( excel::getUnoSheetModuleObj( xRanges ), mxContext, xRanges ) ) ); @@ -277,7 +353,7 @@ ScVbaApplication::getSelection() throw (uno::RuntimeException) } else { - throw uno::RuntimeException( sImpementaionName + rtl::OUString::createFromAscii(" not suported"), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( sImplementationName + rtl::OUString::createFromAscii(" not supported"), uno::Reference< uno::XInterface >() ); } } @@ -367,16 +443,67 @@ ScVbaApplication::getActiveWindow() throw (uno::RuntimeException) uno::Any SAL_CALL ScVbaApplication::getCutCopyMode() throw (uno::RuntimeException) { - //# FIXME TODO, implementation uno::Any result; - result <<= sal_False; + ScTransferObj* pOwnClip = ScTransferObj::GetOwnClipboard( NULL ); + ScDocument* pDoc = pOwnClip ? pOwnClip->GetDocument() : NULL; + if ( pDoc ) + { + if ( pDoc->IsCutMode() ) + { + result <<= excel::XlCutCopyMode::xlCut; + } + else + { + result <<= excel::XlCutCopyMode::xlCopy; + } + } + else + { + result <<= sal_False; + } return result; } void SAL_CALL -ScVbaApplication::setCutCopyMode( const uno::Any& /*_cutcopymode*/ ) throw (uno::RuntimeException) +ScVbaApplication::setCutCopyMode( const uno::Any& _cutcopymode ) throw (uno::RuntimeException) { - //# FIXME TODO, implementation + // According to Excel's behavior, no matter what is the value of _cutcopymode, always releases the clip object. + sal_Bool bCutCopyMode = sal_False; + if ( ( _cutcopymode >>= bCutCopyMode ) ) + { + ScTransferObj* pOwnClip = ScTransferObj::GetOwnClipboard( NULL ); + if ( pOwnClip ) + { + pOwnClip->ObjectReleased(); + ScTabViewShell* pTabViewShell = excel::getBestViewShell( getCurrentDocument() ); + if ( pTabViewShell ) + { + ScViewData* pView = pTabViewShell->GetViewData(); + Window* pWindow = pView ? pView->GetActiveWin() : NULL; + if ( pWindow ) + { + Reference< datatransfer::clipboard::XClipboard > xClipboard = pWindow->GetClipboard(); + Reference< datatransfer::clipboard::XFlushableClipboard > xFlushableClipboard( xClipboard, uno::UNO_QUERY ); + if ( xClipboard.is() ) + { + xClipboard->setContents( NULL, NULL ); + if ( xFlushableClipboard.is() ) + { + const sal_uInt32 nRef = Application::ReleaseSolarMutex(); + try + { + xFlushableClipboard->flushClipboard(); + } + catch( const uno::Exception& ) + { + } + Application::AcquireSolarMutex( nRef ); + } + } + } + } + } + } } uno::Any SAL_CALL @@ -725,6 +852,91 @@ ScVbaApplication::getEnableEvents() throw (uno::RuntimeException) return m_bEnableEvents; } +sal_Bool SAL_CALL +ScVbaApplication::getVisible() throw (uno::RuntimeException) +{ + sal_Bool bVisible = sal_True; + return bVisible; +} + +void SAL_CALL +ScVbaApplication::setVisible(sal_Bool /*bVisible*/) throw (uno::RuntimeException) +{ +} + +//liuchen 2009-11-25 add the support of Excel VBA Application.Iteration +//The Excel Iteration option is global and unique, but in Symphony there is an Iteration property in ScModule and one in every ScDocument, +//so the set method will set all the Iteration properties +sal_Bool SAL_CALL +ScVbaApplication::getIteration() throw (uno::RuntimeException) +{ + ScModule* pScMod = SC_MOD(); + ScDocOptions aDocOpt = pScMod->GetDocOptions(); + + return aDocOpt.IsIter(); +} + +void SAL_CALL +ScVbaApplication::setIteration(sal_Bool bIteration) throw (uno::RuntimeException) +{ + ScModule* pScMod = SC_MOD(); + ScDocOptions& aDocOpt = const_cast< ScDocOptions& > (pScMod->GetDocOptions()); + aDocOpt.SetIter( bIteration ); + + uno::Any aIteration; + aIteration <<= bIteration; + + OUString aPropName = OUString::createFromAscii( "IsIterationEnabled" ); + + uno::Reference< XCollection > xWorkbooks( new ScVbaWorkbooks( this, mxContext ) ); + sal_Int32 nCount = xWorkbooks->getCount(); + + for (sal_Int32 i = 1; i <= nCount; i++) + { + uno::Reference< ooo::vba::excel::XWorkbook > xWorkbook; + uno::Any aWorkbook = xWorkbooks->Item(uno::makeAny(i), uno::Any()); + aWorkbook >>= xWorkbook; + ScVbaWorkbook* pWorkbook = static_cast< ScVbaWorkbook* > ( xWorkbook.get() ); + + uno::Reference< frame::XModel > xModel( pWorkbook->getDocModel(), uno::UNO_QUERY_THROW ); + uno::Reference< beans::XPropertySet > xPropertySet( xModel, uno::UNO_QUERY_THROW ); + xPropertySet->setPropertyValue( aPropName, aIteration ); + } +} +//liuchen 2009-11-25 end + +//liuchen 2009-11-26 add the support of Excel VBA Application.EnableCancelKey +sal_Int32 SAL_CALL +ScVbaApplication::getEnableCancelKey() throw (uno::RuntimeException) +{ + return ooo::vba::excel::XlEnableCancelKey::xlDisabled; +} + +void SAL_CALL +ScVbaApplication::setEnableCancelKey(sal_Int32 /*lEnableCancelKey*/) throw (uno::RuntimeException) +{ +} +//liuchen 2009-11-26 end + +sal_Int32 SAL_CALL ScVbaApplication::getSheetsInNewWorkbook() throw (uno::RuntimeException) +{ + const ScAppOptions& rAppOpt = SC_MOD()->GetAppOptions(); + return rAppOpt.GetTabCountInNewSpreadsheet(); +} + +void SAL_CALL ScVbaApplication::setSheetsInNewWorkbook( sal_Int32 SheetsInNewWorkbook ) throw (script::BasicErrorException, uno::RuntimeException) +{ + if ( SheetsInNewWorkbook < 1 || SheetsInNewWorkbook > MAXTAB ) + { + DebugHelper::exception( OUString::createFromAscii("The number must be between 1 and 255"), uno::Exception(), SbERR_METHOD_FAILED, OUString() ); + } + else + { + ScAppOptions& rAppOpt = const_cast< ScAppOptions& >(SC_MOD()->GetAppOptions()); + rAppOpt.SetTabCountInNewSpreadsheet( SheetsInNewWorkbook ); + } +} + void SAL_CALL ScVbaApplication::Calculate() throw( script::BasicErrorException , uno::RuntimeException ) { @@ -1090,13 +1302,19 @@ ScVbaApplication::Volatile( const uno::Any& aVolatile ) throw ( uno::RuntimeExc { sal_Bool bVolatile = sal_True; aVolatile >>= bVolatile; + SbMethod* pMeth = StarBASIC::GetActiveMethod(); + if ( pMeth ) + { + OSL_TRACE("ScVbaApplication::Volatile() In method ->%s<-", rtl::OUStringToOString( pMeth->GetName(), RTL_TEXTENCODING_UTF8 ).getStr() ); + uno::Reference< frame::XModel > xModel( getCurrentDocument() ); + ScDocument* pDoc = excel::getDocShell( xModel )->GetDocument(); + pDoc->GetMacroManager()->SetUserFuncVolatile( pMeth->GetName(), bVolatile); + } + +// this is bound to break when loading the document return; } -void SAL_CALL -ScVbaApplication::DoEvents() throw ( uno::RuntimeException ) -{ -} ::sal_Bool SAL_CALL ScVbaApplication::getDisplayFormulaBar() throw ( css::uno::RuntimeException ) { @@ -1148,12 +1366,421 @@ ScVbaApplication::Caller( const uno::Any& /*aIndex*/ ) throw ( uno::RuntimeExcep return aRet; } +//Add by minz@cn.ibm.com. 2009-07-08. +uno::Any SAL_CALL +ScVbaApplication::GetOpenFilename(const uno::Any& FileFilter, const uno::Any& FilterIndex, const uno::Any& Title, const uno::Any& ButtonText, const uno::Any& MultiSelect) throw (uno::RuntimeException) +{ + uno::Any aRet = uno::makeAny( sal_False ); + try + { + const ::rtl::OUString sServiceName = ::rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.FilePicker" ); + uno::Reference< lang::XMultiServiceFactory > xMSF( comphelper::getProcessServiceFactory(), uno::UNO_QUERY ); + // Set the type of File Picker Dialog: TemplateDescription::FILEOPEN_SIMPLE. + uno::Sequence< uno::Any > aDialogType( 1 ); + aDialogType[0] <<= ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE; + uno::Reference< ui::dialogs::XFilePicker > xFilePicker( xMSF->createInstanceWithArguments( sServiceName, aDialogType ), UNO_QUERY ); + uno::Reference< ui::dialogs::XFilePicker2 > xFilePicker2( xFilePicker, UNO_QUERY ); + uno::Reference< ui::dialogs::XFilterManager > xFilterManager( xFilePicker, UNO_QUERY ); + uno::Reference< ui::dialogs::XExecutableDialog > xExecutableDialog( xFilePicker, UNO_QUERY ); + uno::Reference< ui::dialogs::XFilePickerControlAccess > xPickerControlAccess( xFilePicker, UNO_QUERY ); + + if ( xFilterManager.is() && FileFilter.hasValue() ) + { + sal_Int32 nFilterIndex = 1; + if ( FilterIndex.hasValue() ) + { + FilterIndex >>= nFilterIndex; + } + ::rtl::OUString strFilter; + FileFilter >>= strFilter; + sal_Int32 nCommaID = 0; + sal_Int32 nIndex = 1; + do + { + ::rtl::OUString aFilterTitleToken = strFilter.getToken( 0, ',' , nCommaID ); + ::rtl::OUString aFilterToken; + if ( nCommaID >= 0 ) + { + aFilterToken = strFilter.getToken( 0, ',' , nCommaID ); + } + else if ( nCommaID < 0 && nIndex == 1 ) + { + throw uno::RuntimeException( rtl::OUString::createFromAscii( "Invalid FileFilter format!" ), uno::Reference< uno::XInterface >() ); + } + xFilterManager->appendFilter( aFilterTitleToken, aFilterToken ); + if ( nFilterIndex == nIndex ) + { + xFilterManager->setCurrentFilter( aFilterTitleToken ); + } + nIndex++; + } while ( nCommaID >= 0 ); + } + if ( xExecutableDialog.is() && Title.hasValue() ) + { + ::rtl::OUString sTitle; + Title >>= sTitle; + xExecutableDialog->setTitle( sTitle ); + } + if ( xPickerControlAccess.is() && ButtonText.hasValue() ) + { + ::rtl::OUString sButtonText; + ButtonText >>= sButtonText; + xPickerControlAccess->setLabel( ui::dialogs::CommonFilePickerElementIds::PUSHBUTTON_OK, sButtonText ); + } + sal_Bool bMultiSelect = sal_False; + if ( xFilePicker.is() && MultiSelect.hasValue() ) + { + MultiSelect >>= bMultiSelect; + xFilePicker->setMultiSelectionMode( bMultiSelect ); + } + + if ( xFilePicker.is() && xFilePicker->execute() ) + { + sal_Bool bUseXFilePicker2 = sal_False; + uno::Reference< lang::XServiceInfo > xServiceInfo( xFilePicker, UNO_QUERY ); + if ( xServiceInfo.is() ) + { + rtl::OUString sImplName = xServiceInfo->getImplementationName(); + if ( sImplName.equalsAscii("com.sun.star.comp.fpicker.VistaFileDialog") || sImplName.equalsAscii("com.sun.star.ui.dialogs.SalGtkFilePicker") ) + { + bUseXFilePicker2 = sal_True; + } + } + uno::Sequence< rtl::OUString > aSelectedFiles; + if ( bUseXFilePicker2 && xFilePicker2.is() ) + { + // On Linux, XFilePicker->getFiles() always return one selected file although we select more than one file, also on Vista + // XFilePicker->getFiles() does not work well too, so we call XFilePicker2->getSelectedFiles() to get selected files. + aSelectedFiles = xFilePicker2->getSelectedFiles(); + } + else + { + // If only one file is selected, the first entry of the sequence contains the complete path/filename in URL format. If multiple files are selected, + // the first entry of the sequence contains the path in URL format, and the other entries contains the names of the selected files without path information. + uno::Sequence< rtl::OUString > aTmpFiles = xFilePicker->getFiles(); + aSelectedFiles = aTmpFiles; + sal_Int32 iFileCount = aTmpFiles.getLength(); + if ( iFileCount > 1 ) + { + aSelectedFiles.realloc( iFileCount - 1 ); + INetURLObject aPath( aTmpFiles[0] ); + aPath.setFinalSlash(); + for ( sal_Int32 i = 1; i < iFileCount; i++ ) + { + if ( aTmpFiles[i].indexOf ('/') > 0 || aTmpFiles[i].indexOf ('\\') > 0 ) + { + aSelectedFiles[i - 1] = aTmpFiles[i]; + } + else + { + if ( i == 1 ) + aPath.Append( aTmpFiles[i] ); + else + aPath.setName( aTmpFiles[i] ); + aSelectedFiles[i - 1] = aPath.GetMainURL( INetURLObject::NO_DECODE ); + } + } + } + } + + sal_Int32 iFileCount = aSelectedFiles.getLength(); + for ( sal_Int32 i = 0; i < iFileCount; i++ ) + { + INetURLObject aObj( aSelectedFiles[i] ); + if ( aObj.GetProtocol() == INET_PROT_FILE ) + { + rtl::OUString aTemp = aObj.PathToFileName(); + aSelectedFiles[i] = aTemp.getLength() > 0 ? aTemp : aSelectedFiles[i]; + } + } + if ( bMultiSelect ) + { + aRet = uno::makeAny( aSelectedFiles ); + } + else if ( aSelectedFiles.getLength() > 0 && !bMultiSelect ) + { + aRet = uno::makeAny( aSelectedFiles[0] ); + } + } + } + catch( const uno::Exception& ) + { + DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString()); + } + + return aRet; +} + +//liming 2009-7-17 +::com::sun::star::uno::Reference< ::ooo::vba::XFileDialog > SAL_CALL +ScVbaApplication::getFileDialog() throw (::com::sun::star::uno::RuntimeException) +{ + uno::Reference< XFileDialog > xFileDialogs( new ScVbaFileDialog( uno::Reference< XHelperInterface >( this ), mxContext, getCurrentDocument() ) ); + return xFileDialogs; +} + +typedef std::map< ::rtl::OUString, ::rtl::OUString > FileFilterMap; + +//2009-11-06 add by limingl +uno::Any SAL_CALL +ScVbaApplication::GetSaveAsFilename( const ::com::sun::star::uno::Any& InitialFilename, const ::com::sun::star::uno::Any& FileFilter, const ::com::sun::star::uno::Any& FilterIndex, const ::com::sun::star::uno::Any& Title, const ::com::sun::star::uno::Any& ButtonText ) throw (::com::sun::star::uno::RuntimeException) +{ + uno::Any strRet; + try + { + const ::rtl::OUString sServiceName = ::rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.FilePicker" ); + uno::Reference< lang::XMultiServiceFactory > xMSF( comphelper::getProcessServiceFactory(), uno::UNO_QUERY ); + + uno::Sequence< uno::Any > aDialogType( 1 ); + aDialogType[0] <<= ui::dialogs::TemplateDescription::FILESAVE_SIMPLE; + uno::Reference< ui::dialogs::XFilePicker > xFilePicker( xMSF->createInstanceWithArguments( sServiceName, aDialogType ), UNO_QUERY ); + + if (InitialFilename.hasValue()) + { + ::rtl::OUString strInitFileName; + InitialFilename >>= strInitFileName; + xFilePicker->setDefaultName(strInitFileName); + } + + // Begin from 1. + sal_Int32 nFilterIndex = 1; + if (FilterIndex.hasValue()) + { + FilterIndex >>= nFilterIndex; + } + + uno::Reference< ui::dialogs::XFilterManager > xFilter( xFilePicker, UNO_QUERY ); + FileFilterMap mFilterNameMap; + if (FileFilter.hasValue()) + { + ::rtl::OUString strFilter; + sal_Int32 nCommaID = 0; + FileFilter >>= strFilter; + + sal_Int32 nIndex = 1; + do + { + ::rtl::OUString aFilterTitleToken = strFilter.getToken( 0, ',' , nCommaID ); + ::rtl::OUString aFilterToken; + if ( nCommaID >= 0 ) + { + aFilterToken = strFilter.getToken( 0, ',' , nCommaID ); + } + else if ( nCommaID < 0 && nIndex == 1 ) + { + throw uno::RuntimeException( rtl::OUString::createFromAscii( "Invalid FileFilter format!" ), uno::Reference< uno::XInterface >() ); + } + + FileFilterMap::const_iterator aIt = mFilterNameMap.find( aFilterTitleToken ); + if ( aIt == mFilterNameMap.end() ) + { + xFilter->appendFilter( aFilterTitleToken, aFilterToken ); + if ( nFilterIndex == nIndex ) + { + xFilter->setCurrentFilter( aFilterTitleToken ); + } + nIndex++; + mFilterNameMap[aFilterTitleToken] = aFilterToken; + } + } while ( nCommaID >= 0 ); + } + + if (Title.hasValue()) + { + ::rtl::OUString strTitle; + Title >>= strTitle; + uno::Reference< ::com::sun::star::ui::dialogs::XExecutableDialog> xExcTblDlg(xFilePicker, UNO_QUERY ); + xExcTblDlg->setTitle(strTitle); + } + + if (ButtonText.hasValue()) + { + ::rtl::OUString strBttTxt; + ButtonText >>= strBttTxt; + } + + + if ( xFilePicker.is() ) + { + sal_Int16 nRet = xFilePicker->execute(); + if (nRet == 0) + { + strRet <<= sal_False; + } + else + { + uno::Sequence < rtl::OUString > aPathSeq = xFilePicker->getFiles(); + + if ( aPathSeq.getLength() ) + { + ::rtl::OUString sSelectedFilters; + if ( xFilter.is() ) + { + ::rtl::OUString sSelectedFilterName = xFilter->getCurrentFilter(); + FileFilterMap::const_iterator aIt = mFilterNameMap.find( sSelectedFilterName ); + if ( aIt != mFilterNameMap.end() ) + { + sSelectedFilters = aIt->second; + } + } + INetURLObject aURLObj( aPathSeq[0] ); + ::rtl::OUString aPathStr = aURLObj.PathToFileName(); + if ( aURLObj.GetProtocol() == INET_PROT_FILE ) + { + sal_Int32 nSemicolonID = 0; + ::rtl::OUString sFirstFilter = sSelectedFilters.getToken( 0, ';' , nSemicolonID ); + ::rtl::OUString sFileExtension = aURLObj.GetExtension(); + if ( sFileExtension.equalsAscii("") ) + { + sFileExtension = sFirstFilter.equalsAscii("*.*") ? sFileExtension : sFirstFilter.copy( sFirstFilter.indexOfAsciiL("*.", 2) + 2 ); + aPathStr = sFileExtension.equalsAscii("") ? aPathStr : aPathStr + ::rtl::OUString::createFromAscii(".") + sFileExtension; + } + else + { + sal_Bool bValidFilter = sal_False; + FileFilterMap::const_iterator aIt = mFilterNameMap.begin(); + while ( aIt != mFilterNameMap.end() ) + { + sSelectedFilters = aIt->second; + nSemicolonID = 0; + do + { + ::rtl::OUString aFilterToken = sSelectedFilters.getToken( 0, ';' , nSemicolonID ); + if ( aFilterToken.trim().equalsIgnoreAsciiCase(::rtl::OUString::createFromAscii("*.") + sFileExtension) ) + { + bValidFilter = sal_True; + break; + } + } while ( nSemicolonID >= 0 ); + if ( bValidFilter ) + { + break; + } + aIt++; + } + if ( !bValidFilter ) + { + sFileExtension = sFirstFilter.equalsAscii("*.*") ? ::rtl::OUString::createFromAscii("") : sFirstFilter.copy( sFirstFilter.indexOfAsciiL("*.", 2) + 2 ); + aPathStr = sFileExtension.equalsAscii("") ? aPathStr : aPathStr + ::rtl::OUString::createFromAscii(".") + sFileExtension; + } + } + } + strRet <<= aPathStr; + } + } + } + } + catch( const uno::Exception& ) + { + DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString()); + } + return strRet; +} + +//end add + uno::Reference< frame::XModel > ScVbaApplication::getCurrentDocument() throw (css::uno::RuntimeException) { return getCurrentExcelDoc(mxContext); } +uno::Any SAL_CALL +ScVbaApplication::MenuBars( const uno::Any& aIndex ) throw (uno::RuntimeException) +{ + uno::Reference< XCommandBars > xCommandBars( CommandBars( uno::Any() ), uno::UNO_QUERY_THROW ); + uno::Reference< XCollection > xMenuBars( new ScVbaMenuBars( this, mxContext, xCommandBars ) ); + if ( aIndex.hasValue() ) + { + return uno::Any ( xMenuBars->Item( aIndex, uno::Any() ) ); + } + + return uno::Any( xMenuBars ); +} + +//liuchen 2009-11-26 add the support of Application.International +sal_Int32 SAL_CALL +ConvertCountryCode(const OUString& language) +{ + sal_Int32 nCode = 0; + + if( language == OUString::createFromAscii("ar") ) nCode = 966; // Arabic + else if ( language == OUString::createFromAscii("cs") ) nCode = 42; // Czech + else if ( language == OUString::createFromAscii("da") ) nCode = 45; // Danish + else if ( language == OUString::createFromAscii("de") ) nCode = 49; // German + else if ( language == OUString::createFromAscii("en") ) nCode = 1; // English + else if ( language == OUString::createFromAscii("es") ) nCode = 34; // Spanish + else if ( language == OUString::createFromAscii("el") ) nCode = 30; // Greek + else if ( language == OUString::createFromAscii("fa") ) nCode = 98; // Persian = Farsi + else if ( language == OUString::createFromAscii("fi") ) nCode = 358; // Finnish + else if ( language == OUString::createFromAscii("fr") ) nCode = 33; // French + else if ( language == OUString::createFromAscii("he") ) nCode = 972; // Hebrew + else if ( language == OUString::createFromAscii("hi") ) nCode = 91; // Indian = Hindi + else if ( language == OUString::createFromAscii("hu") ) nCode = 36; // Hungarian + else if ( language == OUString::createFromAscii("it") ) nCode = 39; // Italian + else if ( language == OUString::createFromAscii("ja") ) nCode = 81; // Japanese + else if ( language == OUString::createFromAscii("ko") ) nCode = 82; // Korean + else if ( language == OUString::createFromAscii("nl") ) nCode = 31; // Dutch + else if ( language == OUString::createFromAscii("no") ) nCode = 47; // Norwegian + else if ( language == OUString::createFromAscii("pl") ) nCode = 48; // Polish + else if ( language == OUString::createFromAscii("pt") ) nCode = 351; // Portuguese + else if ( language == OUString::createFromAscii("ru") ) nCode = 7; // Russian + else if ( language == OUString::createFromAscii("sv") ) nCode = 46; // Swedish + else if ( language == OUString::createFromAscii("th") ) nCode = 66; // Thai + else if ( language == OUString::createFromAscii("tk") ) nCode = 90; // Turkish + else if ( language == OUString::createFromAscii("ur") ) nCode = 92; // Urdu + else if ( language == OUString::createFromAscii("vi") ) nCode = 84; // Vietnamese + else if ( language == OUString::createFromAscii("zh") ) nCode = 86; // Simplified Chinese + + return nCode; +} + +uno::Any SAL_CALL +ScVbaApplication::International( sal_Int32 Index ) throw (uno::RuntimeException) +{ + uno::Any aRet; + OUString str; + const LocaleDataWrapper* pLocaleData = ScGlobal::GetpLocaleData(); + switch ( Index ) + { + case excel::XlApplicationInternational::xlCountryCode: + aRet <<= ConvertCountryCode( pLocaleData->getLanguageCountryInfo().Language ); + break; + case excel::XlApplicationInternational::xlDecimalSeparator: + str = pLocaleData->getNumDecimalSep(); + aRet <<= str; + break; + case excel::XlApplicationInternational::xlDateSeparator: + str = pLocaleData->getDateSep(); + aRet <<= str; + break; + default: + break; + } + return aRet; +} +//liuchen 2009-11-26 end + +//2009-12-11 add by limingl +void SAL_CALL ScVbaApplication::Undo( ) throw (::com::sun::star::uno::RuntimeException) +{ + SfxAllItemSet reqList( SFX_APP()->GetPool() ); + SfxRequest rReq(SID_UNDO, 0, reqList); + ScTabViewShell* pViewShell = excel::getCurrentBestViewShell( mxContext ); + + if (pViewShell != NULL) + { + pViewShell->ExecuteUndo(rReq); + } +} +//end + +double SAL_CALL ScVbaApplication::InchesToPoints( double Inches ) throw (uno::RuntimeException) +{ + // Convert a measurement from Inch to Point (1 inch = 72 points). + return MetricField::ConvertDoubleValue( Inches, 0, 0, FUNIT_INCH, FUNIT_POINT ); +} + rtl::OUString& ScVbaApplication::getServiceImplName() { @@ -1182,3 +1809,5 @@ extern sdecl::ServiceDecl const serviceDecl( "ScVbaApplication", "ooo.vba.excel.Application" ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbaapplication.hxx b/sc/source/ui/vba/vbaapplication.hxx index a7be5feb1d27..9d865a513547 100644 --- a/sc/source/ui/vba/vbaapplication.hxx +++ b/sc/source/ui/vba/vbaapplication.hxx @@ -47,6 +47,7 @@ private: sal_Bool m_bEnableEvents; rtl::OUString getOfficePath( const rtl::OUString& sPath ) throw ( css::uno::RuntimeException ); + css::uno::Reference< ov::XFileSearch > m_xFileSearch; // protected: virtual css::uno::Reference< css::frame::XModel > getCurrentDocument() throw (css::uno::RuntimeException); @@ -89,6 +90,7 @@ public: virtual void SAL_CALL setDisplayFormulaBar( ::sal_Bool _displayformulabar ) throw ( css::uno::RuntimeException ); virtual css::uno::Reference< ov::XAssistant > SAL_CALL getAssistant() throw (css::uno::RuntimeException); + virtual css::uno::Reference< ov::XFileSearch > SAL_CALL getFileSearch() throw (css::uno::RuntimeException); //liuchen 2009-8-18 add the support of Application.FileSearch virtual css::uno::Reference< ov::excel::XWorkbook > SAL_CALL getThisWorkbook() throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL Workbooks( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL Worksheets( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); @@ -102,6 +104,17 @@ public: virtual ::sal_Int32 SAL_CALL getCursor() throw (css::uno::RuntimeException); virtual void SAL_CALL setCursor( ::sal_Int32 _cursor ) throw (css::uno::RuntimeException); + virtual sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException); + virtual void SAL_CALL setVisible( sal_Bool bVisible ) throw (css::uno::RuntimeException); + + virtual sal_Bool SAL_CALL getIteration() throw (css::uno::RuntimeException); //liuchen 2009-11-25 add the support of Iteration + virtual void SAL_CALL setIteration( sal_Bool bIteration ) throw (css::uno::RuntimeException); //liuchen 2009-11-25 add the support of Iteration + virtual sal_Int32 SAL_CALL getEnableCancelKey() throw (css::uno::RuntimeException); //liuchen 2009-11-26 add the support of EnableCancelKey + virtual void SAL_CALL setEnableCancelKey( sal_Int32 lEnableCancelKey ) throw (css::uno::RuntimeException); //liuchen 2009-11-26 add the support of EnableCancelKey + + virtual sal_Int32 SAL_CALL getSheetsInNewWorkbook() throw (css::uno::RuntimeException); + virtual void SAL_CALL setSheetsInNewWorkbook( sal_Int32 SheetsInNewWorkbook ) throw (css::script::BasicErrorException, css::uno::RuntimeException); + virtual sal_Bool SAL_CALL getEnableEvents() throw (css::uno::RuntimeException); virtual void SAL_CALL setEnableEvents( sal_Bool bEnable ) throw (css::uno::RuntimeException); @@ -114,8 +127,16 @@ public: virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Intersect( const css::uno::Reference< ov::excel::XRange >& Arg1, const css::uno::Reference< ov::excel::XRange >& Arg2, const css::uno::Any& Arg3, const css::uno::Any& Arg4, const css::uno::Any& Arg5, const css::uno::Any& Arg6, const css::uno::Any& Arg7, const css::uno::Any& Arg8, const css::uno::Any& Arg9, const css::uno::Any& Arg10, const css::uno::Any& Arg11, const css::uno::Any& Arg12, const css::uno::Any& Arg13, const css::uno::Any& Arg14, const css::uno::Any& Arg15, const css::uno::Any& Arg16, const css::uno::Any& Arg17, const css::uno::Any& Arg18, const css::uno::Any& Arg19, const css::uno::Any& Arg20, const css::uno::Any& Arg21, const css::uno::Any& Arg22, const css::uno::Any& Arg23, const css::uno::Any& Arg24, const css::uno::Any& Arg25, const css::uno::Any& Arg26, const css::uno::Any& Arg27, const css::uno::Any& Arg28, const css::uno::Any& Arg29, const css::uno::Any& Arg30 ) throw (css::script::BasicErrorException, css::uno::RuntimeException); virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Union( const css::uno::Reference< ov::excel::XRange >& Arg1, const css::uno::Reference< ov::excel::XRange >& Arg2, const css::uno::Any& Arg3, const css::uno::Any& Arg4, const css::uno::Any& Arg5, const css::uno::Any& Arg6, const css::uno::Any& Arg7, const css::uno::Any& Arg8, const css::uno::Any& Arg9, const css::uno::Any& Arg10, const css::uno::Any& Arg11, const css::uno::Any& Arg12, const css::uno::Any& Arg13, const css::uno::Any& Arg14, const css::uno::Any& Arg15, const css::uno::Any& Arg16, const css::uno::Any& Arg17, const css::uno::Any& Arg18, const css::uno::Any& Arg19, const css::uno::Any& Arg20, const css::uno::Any& Arg21, const css::uno::Any& Arg22, const css::uno::Any& Arg23, const css::uno::Any& Arg24, const css::uno::Any& Arg25, const css::uno::Any& Arg26, const css::uno::Any& Arg27, const css::uno::Any& Arg28, const css::uno::Any& Arg29, const css::uno::Any& Arg30 ) throw (css::script::BasicErrorException, css::uno::RuntimeException); virtual void SAL_CALL Volatile( const css::uno::Any& Volatile ) throw (css::uno::RuntimeException ); - virtual void SAL_CALL DoEvents() throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL Caller( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL MenuBars( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL GetOpenFilename( const css::uno::Any& FileFilter, const css::uno::Any& FilterIndex, const css::uno::Any& Title, const css::uno::Any& ButtonText, const css::uno::Any& MultiSelect ) throw (css::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::ooo::vba::XFileDialog > SAL_CALL getFileDialog() throw (::com::sun::star::uno::RuntimeException); //liminl 2009-08-12 add + virtual css::uno::Any SAL_CALL International( sal_Int32 Index ) throw (css::uno::RuntimeException); //liuchen 2009-11-26 + //2009-12-04 add by limingl + virtual css::uno::Any SAL_CALL GetSaveAsFilename( const ::com::sun::star::uno::Any& InitialFilename, const ::com::sun::star::uno::Any& FileFilter, const ::com::sun::star::uno::Any& FilterIndex, const ::com::sun::star::uno::Any& Title, const ::com::sun::star::uno::Any& ButtonText ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL Undo( ) throw (::com::sun::star::uno::RuntimeException); + virtual double SAL_CALL InchesToPoints( double Inches ) throw (css::uno::RuntimeException); + // XHelperInterface virtual rtl::OUString& getServiceImplName(); virtual css::uno::Sequence<rtl::OUString> getServiceNames(); diff --git a/sc/source/ui/vba/vbaassistant.cxx b/sc/source/ui/vba/vbaassistant.cxx index 51105d60b0d4..714bb783f3cb 100644 --- a/sc/source/ui/vba/vbaassistant.cxx +++ b/sc/source/ui/vba/vbaassistant.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -130,3 +131,5 @@ ScVbaAssistant::getServiceNames() } return aServiceNames; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbaaxes.cxx b/sc/source/ui/vba/vbaaxes.cxx index d563ba105108..eac7083a797c 100644 --- a/sc/source/ui/vba/vbaaxes.cxx +++ b/sc/source/ui/vba/vbaaxes.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -201,3 +202,4 @@ ScVbaAxes::getServiceNames() return aServiceNames; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbaaxis.cxx b/sc/source/ui/vba/vbaaxis.cxx index a9c91a4cea31..d51534264e38 100644 --- a/sc/source/ui/vba/vbaaxis.cxx +++ b/sc/source/ui/vba/vbaaxis.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -668,3 +669,4 @@ ScVbaAxis::getServiceNames() return aServiceNames; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbaaxistitle.cxx b/sc/source/ui/vba/vbaaxistitle.cxx index 89b12b6e2870..cc5b0d791b13 100644 --- a/sc/source/ui/vba/vbaaxistitle.cxx +++ b/sc/source/ui/vba/vbaaxistitle.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -56,3 +57,4 @@ ScVbaAxisTitle::getServiceNames() } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbaborders.cxx b/sc/source/ui/vba/vbaborders.cxx index 4c87fa6203ae..7fbe157e2bdf 100644 --- a/sc/source/ui/vba/vbaborders.cxx +++ b/sc/source/ui/vba/vbaborders.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -572,3 +573,5 @@ ScVbaBorders::getServiceNames() } return aServiceNames; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbacharacters.cxx b/sc/source/ui/vba/vbacharacters.cxx index 6c0079ac7a82..011b0a4a72e1 100644 --- a/sc/source/ui/vba/vbacharacters.cxx +++ b/sc/source/ui/vba/vbacharacters.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -134,3 +135,4 @@ ScVbaCharacters::getServiceNames() return aServiceNames; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbachart.cxx b/sc/source/ui/vba/vbachart.cxx index e2f446f93f2b..705f79ed42f9 100644 --- a/sc/source/ui/vba/vbachart.cxx +++ b/sc/source/ui/vba/vbachart.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1251,3 +1252,4 @@ ScVbaChart::getServiceNames() return aServiceNames; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbachartobject.cxx b/sc/source/ui/vba/vbachartobject.cxx index 617a090b6d7a..eaa42d1cc309 100644 --- a/sc/source/ui/vba/vbachartobject.cxx +++ b/sc/source/ui/vba/vbachartobject.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -208,3 +209,5 @@ ScVbaChartObject::getUnoObject() throw (script::BasicErrorException) { return uno::Reference< uno::XInterface >( xShape, uno::UNO_QUERY ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbachartobjects.cxx b/sc/source/ui/vba/vbachartobjects.cxx index 5117cfd75858..b8706b233462 100644 --- a/sc/source/ui/vba/vbachartobjects.cxx +++ b/sc/source/ui/vba/vbachartobjects.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -192,3 +193,4 @@ ScVbaChartObjects::getServiceNames() return sNames; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbacharts.cxx b/sc/source/ui/vba/vbacharts.cxx index da0c7789134b..d02e79e8d431 100644 --- a/sc/source/ui/vba/vbacharts.cxx +++ b/sc/source/ui/vba/vbacharts.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -118,3 +119,4 @@ ScVbaCharts::getServiceNames() return sNames; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbacharttitle.cxx b/sc/source/ui/vba/vbacharttitle.cxx index e797c4a0269e..09f678704422 100644 --- a/sc/source/ui/vba/vbacharttitle.cxx +++ b/sc/source/ui/vba/vbacharttitle.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -56,3 +57,4 @@ ScVbaChartTitle::getServiceNames() } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbacomment.cxx b/sc/source/ui/vba/vbacomment.cxx index 9c50a25b8b7c..f707fad1eb13 100644 --- a/sc/source/ui/vba/vbacomment.cxx +++ b/sc/source/ui/vba/vbacomment.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -33,14 +34,23 @@ #include <com/sun/star/sheet/XSheetAnnotationsSupplier.hpp> #include <com/sun/star/sheet/XSheetAnnotationShapeSupplier.hpp> #include <com/sun/star/sheet/XSheetCellRange.hpp> +#include <com/sun/star/sheet/XCellAddressable.hpp> #include <com/sun/star/table/CellAddress.hpp> #include <com/sun/star/table/XCell.hpp> #include <com/sun/star/text/XText.hpp> +#include <cellsuno.hxx> +#include <postit.hxx> +#include <svx/svdobj.hxx> +#include <svx/svdocapt.hxx> +#include <ooo/vba/msforms/XShape.hpp> +#include <com/sun/star/drawing/XShape.hpp> +#include <com/sun/star/frame/XModel.hpp> + #include <vbahelper/vbashape.hxx> #include "vbaglobals.hxx" #include "vbacomments.hxx" - +#include "vbacommentshape.hxx" using namespace ::ooo::vba; using namespace ::com::sun::star; @@ -178,7 +188,6 @@ ScVbaComment::Text( const uno::Any& aText, const uno::Any& aStart, const uno::An aText >>= sText; uno::Reference< text::XSimpleText > xAnnoText( getAnnotation(), uno::UNO_QUERY_THROW ); - rtl::OUString sAnnoText = xAnnoText->getString(); if ( aStart.hasValue() ) { @@ -212,10 +221,12 @@ ScVbaComment::Text( const uno::Any& aText, const uno::Any& aStart, const uno::An } else if ( aText.hasValue() ) { - xAnnoText->setString( sText ); - return sText; + uno::Reference< sheet::XCellAddressable > xCellAddr(mxRange->getCellByPosition(0, 0), uno::UNO_QUERY_THROW ); + table::CellAddress aAddress = xCellAddr->getCellAddress(); + getAnnotations()->insertNew( aAddress, sText ); } + rtl::OUString sAnnoText = xAnnoText->getString(); return sAnnoText; } @@ -237,3 +248,5 @@ ScVbaComment::getServiceNames() } return aServiceNames; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbacomments.cxx b/sc/source/ui/vba/vbacomments.cxx index 7a6d3d774937..c4c290da3b2a 100644 --- a/sc/source/ui/vba/vbacomments.cxx +++ b/sc/source/ui/vba/vbacomments.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -114,3 +115,5 @@ ScVbaComments::getServiceNames() } return sNames; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbacommentshape.cxx b/sc/source/ui/vba/vbacommentshape.cxx new file mode 100644 index 000000000000..4c0d15597ce7 --- /dev/null +++ b/sc/source/ui/vba/vbacommentshape.cxx @@ -0,0 +1,46 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright IBM Corporation 2009, 2010. + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "vbacommentshape.hxx" + +using namespace com::sun::star; +using namespace ooo::vba; + +ScVbaCommentShape::ScVbaCommentShape( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< drawing::XShape >& xShape, const uno::Reference< excel::XComment >& xComment, + const uno::Reference< drawing::XShapes >& xShapes, const uno::Reference< frame::XModel >& xModel, sal_Int32 nType ) : ScVbaShape( xParent, xContext, xShape, xShapes, xModel, nType ) +{ + m_xComment.set( xComment, uno::UNO_QUERY ); +} + +void SAL_CALL ScVbaCommentShape::Delete() throw (uno::RuntimeException) +{ + if ( m_xComment.is() ) + { + m_xComment->Delete(); + } +} diff --git a/sc/source/ui/vba/vbacommentshape.hxx b/sc/source/ui/vba/vbacommentshape.hxx new file mode 100644 index 000000000000..d55de4b07c18 --- /dev/null +++ b/sc/source/ui/vba/vbacommentshape.hxx @@ -0,0 +1,46 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright IBM Corporation 2009, 2010. + * 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_VBA_COMMENTSHAPE_HXX +#define SC_VBA_COMMENTSHAPE_HXX + +#include <ooo/vba/excel/XComment.hpp> +#include <vbahelper/vbashape.hxx> + +class ScVbaCommentShape : public ScVbaShape +{ + css::uno::Reference< ooo::vba::excel::XComment > m_xComment; + +public: + ScVbaCommentShape( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::drawing::XShape >& xShape, + const css::uno::Reference< ooo::vba::excel::XComment >& xComment, const css::uno::Reference< css::drawing::XShapes >& xShapes, const css::uno::Reference< css::frame::XModel >& xModel, sal_Int32 nType ); + + // Methods + virtual void SAL_CALL Delete() throw (css::uno::RuntimeException); +}; +#endif //SC_VBA_COMMENTSHAPE_HXX diff --git a/sc/source/ui/vba/vbacondition.cxx b/sc/source/ui/vba/vbacondition.cxx index 590d649ae561..321ca60d810f 100644 --- a/sc/source/ui/vba/vbacondition.cxx +++ b/sc/source/ui/vba/vbacondition.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -173,3 +174,4 @@ ScVbaCondition< Ifc1 >::Operator(sal_Bool _bIncludeFormulaValue) throw ( script: template class ScVbaCondition< excel::XFormatCondition >; +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbadialog.cxx b/sc/source/ui/vba/vbadialog.cxx index 88a4c4ae67fd..7b2a0edb4103 100644 --- a/sc/source/ui/vba/vbadialog.cxx +++ b/sc/source/ui/vba/vbadialog.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -31,42 +32,58 @@ using namespace ::ooo::vba; using namespace ::com::sun::star; -static const rtl::OUString aStringList[]= +//liuchen 2009-7-27 +//solve the problem that "Application.Dialogs.Item(***).Show" and "Application.Dialogs.Count" cannot get the correct result +struct DialogMatch { - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:Open" ) ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormatCellDialog" ) ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:InsertCell" ) ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:Print" ) ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:PasteSpecial" ) ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ToolProtectionDocument" ) ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ColumnWidth" ) ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DefineName" ) ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ConfigureDialog" ) ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:HyperlinkDialog" ) ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:InsertGraphic" ) ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:InsertObject" ) ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:PageFormatDialog" ) ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DataSort" ) ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:RowHeight" ) ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:AutoCorrectDlg" ) ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ConditionalFormatDialog" ) ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DataConsolidate" ) ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:CreateNames" ) ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FillSeries" ) ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:Validation") ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DefineLabelRange" ) ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DataFilterAutoFilter" ) ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DataFilterSpecialFilter" ) ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:AutoFormat" ) ) + sal_Int32 nVbaDlgIndex; + rtl::OUString aOODlgName; }; -const sal_Int32 nDialogSize = SAL_N_ELEMENTS( aStringList ) ; +static const DialogMatch aDialogMatchList[] = +{ + { 1, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:Open" ) ) }, // xlDialogOpen -> .uno:Open + { -1, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FormatCellDialog" ) ) }, // ??? -> .uno:FormatCellDialog + { 55, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:InsertCell" ) ) }, // xlDialogInsert -> .uno:InsertCell + { 8, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:Print" ) ) }, // xlDialogPrint -> .uno:Print + { 9, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:PrinterSetup" ) ) }, // xlDialogPrinterSetup -> .uno:PrinterSetup + { 53, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:PasteSpecial" ) ) }, // xlDialogPasteSpecial -> .uno:PasteSpecial + { 28, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ToolProtectionDocument" ) ) }, // xlDialogProtectDocument -> uno:ToolProtectionDocument + { 47, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ColumnWidth" ) ) }, // xlDialogColumnWidth -> .uno:ColumnWidth + { 61, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DefineName" ) ) }, // xlDialogDefineName -> .uno:DefineName + { -1, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ConfigureDialog" ) ) }, // ??? -> .uno:ConfigureDialog + { 596, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:HyperlinkDialog" ) ) }, // xlDialogInsertHyperlink -> .uno:HyperlinkDialog + { 342, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:InsertGraphic" ) ) }, // xlDialogInsertPicture -> .uno:InsertGraphic + { 259, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:InsertObject" ) ) }, // xlDialogInsertObject -> .uno:InsertObject + { 7, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:PageFormatDialog" ) ) }, // xlDialogPageSetup -> .uno:PageFormatDialog + { 39, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DataSort" ) ) }, // xlDialogSort -> .uno:DataSort + { 127, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:RowHeight" ) ) }, // xlDialogRowHeight -> .uno:RowHeight + { 485, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:AutoCorrectDlg" ) ) }, // xlDialogAutoCorrect -> .uno:AutoCorrectDlg + { 583, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:ConditionalFormatDialog" ) ) }, // xlDialogCondiationalFormatting -> .uno:ConditionalFormatDialog + { 191, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DataConsolidate" ) ) }, // xlDialogConsolidate -> .uno:DataConsolidate + { 62, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:CreateNames" ) ) }, // xlDialogCreateNames -> .uno:CreateNames + { -1, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:FillSeries" ) ) }, // ??? -> .uno:FillSeries + { -1, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:Validation" ) ) }, // ??? -> .uno:Validation" + { -1, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DefineLabelRange" ) ) }, // ??? -> .uno:DefineLabelRange + { -1, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DataFilterAutoFilter" ) ) }, // ??? -> .uno:DataFilterAutoFilter + { -1, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DataFilterSpecialFilter" ) ) }, // ??? -> .uno:DataFilterSpecialFilter + { 269, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:AutoFormat" ) ) } // xlDialogFormatAuto -> .uno:AutoFormat +}; + +const sal_Int32 nDialogSize = SAL_N_ELEMENTS( aDialogMatchList ) ; +//liuchen modified 2009-2-27 rtl::OUString ScVbaDialog::mapIndexToName( sal_Int32 nIndex ) { - if( nIndex < nDialogSize ) - return aStringList[ nIndex ]; + for (int i = 0; i < nDialogSize; i++) + { + if ( aDialogMatchList[i].nVbaDlgIndex == nIndex ) + { + return aDialogMatchList[i].aOODlgName; + } + } + return rtl::OUString(); } @@ -88,3 +105,10 @@ ScVbaDialog::getServiceNames() } return aServiceNames; } + +//liuchen add 2009-7-27 +sal_Int32 ScVbaDialog::GetSupportedDialogCount() +{ + return nDialogSize; +} +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbadialog.hxx b/sc/source/ui/vba/vbadialog.hxx index 40f4a4a83a11..086770f19357 100644 --- a/sc/source/ui/vba/vbadialog.hxx +++ b/sc/source/ui/vba/vbadialog.hxx @@ -45,6 +45,9 @@ public: // XHelperInterface virtual rtl::OUString& getServiceImplName(); virtual css::uno::Sequence<rtl::OUString> getServiceNames(); + + //liuchen 2009-7-27 + static sal_Int32 GetSupportedDialogCount(); }; #endif /* SC_VBA_DIALOG_HXX */ diff --git a/sc/source/ui/vba/vbadialogs.cxx b/sc/source/ui/vba/vbadialogs.cxx index 67070879535b..361d1a45329c 100644 --- a/sc/source/ui/vba/vbadialogs.cxx +++ b/sc/source/ui/vba/vbadialogs.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -64,5 +65,14 @@ ScVbaDialogs::getServiceNames() return aServiceNames; } +//liuchen 2009-7-27 +::sal_Int32 +ScVbaDialogs::getCount() throw (uno::RuntimeException) +{ + return ScVbaDialog::GetSupportedDialogCount(); +} + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbadialogs.hxx b/sc/source/ui/vba/vbadialogs.hxx index 9aab5daf11fe..6b5e1f9a8d90 100644 --- a/sc/source/ui/vba/vbadialogs.hxx +++ b/sc/source/ui/vba/vbadialogs.hxx @@ -44,6 +44,7 @@ public: // XCollection virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index ) throw (css::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getCount() throw (css::uno::RuntimeException); //liuchen 2009-7-27 // XDialogs virtual void SAL_CALL Dummy() throw (css::uno::RuntimeException); diff --git a/sc/source/ui/vba/vbaeventshelper.cxx b/sc/source/ui/vba/vbaeventshelper.cxx index 45667adf2f2c..5e9eab58e8c4 100644 --- a/sc/source/ui/vba/vbaeventshelper.cxx +++ b/sc/source/ui/vba/vbaeventshelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -372,7 +373,15 @@ void ScVbaEventsListener::processWindowResizeMacro() { OSL_TRACE( "**** Attempt to FIRE MACRO **** " ); if( !mbDisposed ) - mrVbaEvents.processVbaEvent( WORKBOOK_WINDOWRESIZE, uno::Sequence< uno::Any >() ); + { + try + { + mrVbaEvents.processVbaEvent( WORKBOOK_WINDOWRESIZE, uno::Sequence< uno::Any >() ); + } + catch( uno::Exception& ) + { + } + } } // ============================================================================ @@ -751,3 +760,5 @@ extern sdecl::ServiceDecl const serviceDecl( } // ============================================================================ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbafiledialog.cxx b/sc/source/ui/vba/vbafiledialog.cxx new file mode 100644 index 000000000000..af85f5d8aee7 --- /dev/null +++ b/sc/source/ui/vba/vbafiledialog.cxx @@ -0,0 +1,183 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright IBM Corporation 2009, 2010. + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "vbafiledialog.hxx" +#include "comphelper/processfactory.hxx" +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/ui/dialogs/XFilePicker.hpp> +#include <com/sun/star/ui/dialogs/XFilePicker2.hpp> +#include <com/sun/star/ui/dialogs/TemplateDescription.hpp> +#include "tools/urlobj.hxx" + + +using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; + + +ScVbaFileDialog::ScVbaFileDialog( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > &xContext, const css::uno::Reference< css::frame::XModel >& xModel ) +: ScVbaFileDialog_BASE( xParent, xContext, xModel ) +{ + m_pFileDialogSelectedItems = new VbaFileDialogSelectedItems(xParent, xContext, (com::sun::star::container::XIndexAccess *)&m_FileDialogSelectedObj); +} + +ScVbaFileDialog::~ScVbaFileDialog() +{ + if (m_pFileDialogSelectedItems != NULL) + { + delete m_pFileDialogSelectedItems; + } +} + +rtl::OUString& +ScVbaFileDialog::getServiceImplName() +{ + static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaFileDialog") ); + return sImplName; +} + +css::uno::Sequence<rtl::OUString> +ScVbaFileDialog::getServiceNames() +{ + static Sequence< rtl::OUString > aServiceNames; + if ( aServiceNames.getLength() == 0 ) + { + aServiceNames.realloc( 1 ); + aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.FileDialog" ) ); + } + return aServiceNames; + +} + +css::uno::Reference< ov::XFileDialogSelectedItems > SAL_CALL +ScVbaFileDialog::getSelectedItems() throw (css::uno::RuntimeException) +{ + css::uno::Reference< ov::XFileDialogSelectedItems > xFileDlgSlc = (ov::XFileDialogSelectedItems *)m_pFileDialogSelectedItems; + return xFileDlgSlc; +} + +::sal_Int32 SAL_CALL +ScVbaFileDialog::Show( ) throw (::com::sun::star::uno::RuntimeException) +{ + // Returns an Integer indicating if user pressed "Open" button(-1) or "Cancel" button(0). + sal_Int32 nResult = -1; + try + { + m_sSelectedItems.realloc(0); + + const ::rtl::OUString sServiceName = ::rtl::OUString::createFromAscii( "com.sun.star.ui.dialogs.FilePicker" ); + + Reference< lang::XMultiServiceFactory > xMSF( comphelper::getProcessServiceFactory(), uno::UNO_QUERY ); + // Set the type of File Picker Dialog: TemplateDescription::FILEOPEN_SIMPLE. + Sequence< uno::Any > aDialogType( 1 ); + aDialogType[0] <<= ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE; + Reference < ui::dialogs::XFilePicker > xFilePicker( xMSF->createInstanceWithArguments( sServiceName, aDialogType ), UNO_QUERY ); + Reference < ui::dialogs::XFilePicker2 > xFilePicker2( xFilePicker, UNO_QUERY ); + if ( xFilePicker.is() ) + { + xFilePicker->setMultiSelectionMode(sal_True); + if ( xFilePicker->execute() ) + { + sal_Bool bUseXFilePicker2 = sal_False; + Reference< lang::XServiceInfo > xServiceInfo( xFilePicker, UNO_QUERY ); + if (xServiceInfo.is()) + { + rtl::OUString sImplName = xServiceInfo->getImplementationName(); + if (sImplName.equalsAscii("com.sun.star.comp.fpicker.VistaFileDialog") || + sImplName.equalsAscii("com.sun.star.ui.dialogs.SalGtkFilePicker")) + { + bUseXFilePicker2 = sal_True; + } + } + if ( bUseXFilePicker2 && xFilePicker2.is() ) + { + // On Linux, XFilePicker->getFiles() always return one selected file although we select + // more than one file, also on Vista XFilePicker->getFiles() does not work well too, + // so we call XFilePicker2->getSelectedFiles() to get selected files. + m_sSelectedItems = xFilePicker2->getSelectedFiles(); + } + else + { + // If only one file is selected, the first entry of the sequence contains the complete path/filename in + // URL format. If multiple files are selected, the first entry of the sequence contains the path in URL + // format, and the other entries contains the names of the selected files without path information. + Sequence< rtl::OUString > aSelectedFiles = xFilePicker->getFiles(); + sal_Int32 iFileCount = aSelectedFiles.getLength(); + if ( iFileCount > 1 ) + { + m_sSelectedItems.realloc( iFileCount - 1 ); + INetURLObject aPath( aSelectedFiles[0] ); + aPath.setFinalSlash(); + for ( sal_Int32 i = 1; i < iFileCount; i++ ) + { + if ( aSelectedFiles[i].indexOf ('/') > 0 || aSelectedFiles[i].indexOf ('\\') > 0 ) + { + m_sSelectedItems[i - 1] = aSelectedFiles[i]; + } + else + { + if ( i == 1 ) + aPath.Append( aSelectedFiles[i] ); + else + aPath.setName( aSelectedFiles[i] ); + m_sSelectedItems[i - 1] = aPath.GetMainURL(INetURLObject::NO_DECODE); + } + } + } + else if ( iFileCount == 1 ) + { + m_sSelectedItems = aSelectedFiles; + } + } + + sal_Int32 iFileCount = m_sSelectedItems.getLength(); + rtl::OUString aTemp; + for ( sal_Int32 i = 0; i < iFileCount; i++ ) + { + INetURLObject aObj( m_sSelectedItems[i] ); + if ( aObj.GetProtocol() == INET_PROT_FILE ) + { + aTemp = aObj.PathToFileName(); + m_sSelectedItems[i] = aTemp.getLength() > 0 ? aTemp : m_sSelectedItems[i]; + } + } + } + else + { + nResult = 0; + } + } + + m_FileDialogSelectedObj.SetSelectedFile(m_sSelectedItems); + } + catch( const uno::Exception& ) + { + return 0; + } + + return nResult; +} diff --git a/sc/source/ui/vba/vbafiledialog.hxx b/sc/source/ui/vba/vbafiledialog.hxx new file mode 100644 index 000000000000..b38fc16e0c28 --- /dev/null +++ b/sc/source/ui/vba/vbafiledialog.hxx @@ -0,0 +1,60 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright IBM Corporation 2009, 2010. + * 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 _vbafiledialog_hxx_ +#define _vbafiledialog_hxx_ + +#include <cppuhelper/implbase1.hxx> +#include <vbahelper/vbadialogsbase.hxx> +#include <ooo/vba/XFileDialog.hpp> +#include "vbafiledialogselecteditems.hxx" + + +typedef cppu::ImplInheritanceHelper1< VbaDialogsBase, ov::XFileDialog > ScVbaFileDialog_BASE; + +class ScVbaFileDialog : public ScVbaFileDialog_BASE +{ +public: + + ScVbaFileDialog( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > &xContext, const css::uno::Reference< css::frame::XModel >& xModel ) ; + virtual ~ScVbaFileDialog() ; + + // XHelperInterface + virtual rtl::OUString& getServiceImplName(); + virtual css::uno::Sequence<rtl::OUString> getServiceNames(); + //XFileDialog + virtual css::uno::Reference< ov::XFileDialogSelectedItems > SAL_CALL getSelectedItems() throw (css::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL Show( ) throw (::com::sun::star::uno::RuntimeException) ; + +private: + css::uno::Sequence < rtl::OUString > m_sSelectedItems; + VbaFileDialogSelectedItems *m_pFileDialogSelectedItems; + VbaFileDialogSelectedObj m_FileDialogSelectedObj; +}; + +#endif diff --git a/sc/source/ui/vba/vbafiledialogselecteditems.cxx b/sc/source/ui/vba/vbafiledialogselecteditems.cxx new file mode 100644 index 000000000000..ee3adb03342f --- /dev/null +++ b/sc/source/ui/vba/vbafiledialogselecteditems.cxx @@ -0,0 +1,154 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright IBM Corporation 2009, 2010. + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "vbafiledialogselecteditems.hxx" + +using namespace ::com::sun::star; + +VbaFileDialogSelectedItems::VbaFileDialogSelectedItems( const css::uno::Reference< ov::XHelperInterface >& xParent, + const css::uno::Reference< css::uno::XComponentContext >& xContext, + const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess + ) + : FileDialogSelectedItems_BASE( xParent, xContext, xIndexAccess ) +{ +} + + +rtl::OUString& VbaFileDialogSelectedItems::getServiceImplName() +{ + static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("VbaFileDialogSelectedItems") ); + return sImplName; + +} +css::uno::Sequence<rtl::OUString> VbaFileDialogSelectedItems::getServiceNames() +{ + static uno::Sequence< rtl::OUString > aServiceNames; + if ( aServiceNames.getLength() == 0 ) + { + aServiceNames.realloc( 1 ); + aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.FileDialogSelectedItems" ) ); + } + return aServiceNames; + +} + +css::uno::Any VbaFileDialogSelectedItems::createCollectionObject( const css::uno::Any& aSource ) +{ + css::uno::Any aRet; + aRet = aSource; + return aRet; +} + + +css::uno::Type SAL_CALL +VbaFileDialogSelectedItems::getElementType() throw (css::uno::RuntimeException) +{ + return ooo::vba::XFileDialogSelectedItems::static_type(0); +} + +css::uno::Reference< css::container::XEnumeration > SAL_CALL +VbaFileDialogSelectedItems::createEnumeration() throw (css::uno::RuntimeException) +{ + css::uno::Reference< css::container::XEnumeration > xEnumRet(m_xIndexAccess, css::uno::UNO_QUERY); + return xEnumRet; +} + + +//VbaFileDialogSelectedObj +////////////////////////////////////////////////////////////////////////// + +VbaFileDialogSelectedObj::VbaFileDialogSelectedObj() +{ + m_nIndex = 0; +} + + +sal_Bool +VbaFileDialogSelectedObj::SetSelectedFile(css::uno::Sequence<rtl::OUString> &sFList) +{ + m_sFileList = sFList; + return sal_True; +} + +sal_Int32 SAL_CALL +VbaFileDialogSelectedObj::getCount() throw(::com::sun::star::uno::RuntimeException) +{ + sal_Int32 nListCnt = m_sFileList.getLength(); + return nListCnt; +} + +::com::sun::star::uno::Any SAL_CALL VbaFileDialogSelectedObj::getByIndex( sal_Int32 nIndex ) +throw(::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException) +{ + css::uno::Any aRet; + + if ( nIndex >= getCount() ) + { + throw css::lang::IndexOutOfBoundsException(); + } + + return uno::makeAny(m_sFileList[nIndex]); +} + +::com::sun::star::uno::Type SAL_CALL +VbaFileDialogSelectedObj::getElementType() +throw(::com::sun::star::uno::RuntimeException) +{ + return getCppuType((uno::Reference<com::sun::star::container::XIndexAccess>*)0); +} + +sal_Bool SAL_CALL VbaFileDialogSelectedObj::hasElements() +throw(::com::sun::star::uno::RuntimeException) +{ + return ( getCount() != 0 ); +} + +::sal_Bool SAL_CALL +VbaFileDialogSelectedObj::hasMoreElements( ) +throw (uno::RuntimeException) +{ + if (getCount() > m_nIndex) + { + return sal_True; + } + return sal_False; +} + +uno::Any SAL_CALL +VbaFileDialogSelectedObj::nextElement( ) +throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) +{ + if (!hasMoreElements()) + { + throw container::NoSuchElementException(); + } + + return uno::makeAny(m_sFileList[m_nIndex++]); +} diff --git a/sc/source/ui/vba/vbafiledialogselecteditems.hxx b/sc/source/ui/vba/vbafiledialogselecteditems.hxx new file mode 100644 index 000000000000..272e00ef2d30 --- /dev/null +++ b/sc/source/ui/vba/vbafiledialogselecteditems.hxx @@ -0,0 +1,87 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright IBM Corporation 2009, 2010. + * 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 _vbafiledialogselecteditems_hxx_ +#define _vbafiledialogselecteditems_hxx_ + +#include <ooo/vba/XFileDialogSelectedItems.hpp> +#include <vbahelper/vbacollectionimpl.hxx> +#include <cppuhelper/implbase1.hxx> +#include <com/sun/star/container/XIndexAccess.hpp> + +typedef CollTestImplHelper< ov::XFileDialogSelectedItems > FileDialogSelectedItems_BASE; + + +class VbaFileDialogSelectedItems : public FileDialogSelectedItems_BASE +{ +public: + VbaFileDialogSelectedItems( const css::uno::Reference< ov::XHelperInterface >& xParent, + const css::uno::Reference< css::uno::XComponentContext >& xContext, + const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess ); + + virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); + virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException); + virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException); + +protected: + virtual rtl::OUString& getServiceImplName(); + virtual css::uno::Sequence<rtl::OUString> getServiceNames(); +private: +}; + + +class VbaFileDialogSelectedObj : public cppu::WeakImplHelper2<css::container::XIndexAccess, css::container::XEnumeration> +{ +public: + VbaFileDialogSelectedObj(); + sal_Bool SetSelectedFile(css::uno::Sequence<rtl::OUString> &sFList); + //XIndexAccess + virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 nIndex ) + throw(::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + + // XElementAccess + virtual ::com::sun::star::uno::Type SAL_CALL getElementType() + throw(::com::sun::star::uno::RuntimeException); + + virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException); + + //XEnumeration + virtual ::sal_Bool SAL_CALL hasMoreElements( ) throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL nextElement( ) throw (css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException); + +protected: +private: + css::uno::Sequence<rtl::OUString> m_sFileList; + sal_Int32 m_nIndex; +}; + +#endif diff --git a/sc/source/ui/vba/vbafilesearch.cxx b/sc/source/ui/vba/vbafilesearch.cxx new file mode 100644 index 000000000000..9711a5316e4a --- /dev/null +++ b/sc/source/ui/vba/vbafilesearch.cxx @@ -0,0 +1,242 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright IBM Corporation 2009, 2010. + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "vbafilesearch.hxx" +#include "vbaapplication.hxx" +#include "vbafoundfiles.hxx" +#include <comphelper/processfactory.hxx> +#include <tools/urlobj.hxx> +#include <tools/wldcrd.hxx> +#include <com/sun/star/ucb/XSimpleFileAccess3.hpp> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/uno/Sequence.hxx> +#include <vector> +#include "unotools/viewoptions.hxx" +#include <osl/file.hxx> + +using namespace ::ooo::vba; +using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::ucb; +using namespace ::com::sun::star::lang; +using namespace comphelper; + +static Reference< XSimpleFileAccess3 > getFileAccess( void ) +{ + static Reference< XSimpleFileAccess3 > xSFI; + if( !xSFI.is() ) + { + Reference< XMultiServiceFactory > xSMgr = getProcessServiceFactory(); + if( xSMgr.is() ) + { + xSFI = Reference< XSimpleFileAccess3 >( xSMgr->createInstance + ( ::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ) ), UNO_QUERY ); + } + } + return xSFI; +} + +ScVbaFileSearch::ScVbaFileSearch( ScVbaApplication* pApp, const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext ) + : ScVbaFileSearchImpl_BASE( xParent, xContext ), m_pApplication( pApp ) +{ + NewSearch(); +} + +ScVbaFileSearch::~ScVbaFileSearch() +{ +} + +::rtl::OUString SAL_CALL ScVbaFileSearch::getFileName() throw (css::uno::RuntimeException) +{ + return m_sFileName; +} + +void SAL_CALL ScVbaFileSearch::setFileName(const ::rtl::OUString& _fileName ) throw (css::uno::RuntimeException) +{ + m_sFileName = _fileName; +} + +::rtl::OUString SAL_CALL ScVbaFileSearch::getLookIn() throw (css::uno::RuntimeException) +{ + return m_sLookIn; +} + +void SAL_CALL ScVbaFileSearch::setLookIn( const ::rtl::OUString& _lookIn ) throw (css::uno::RuntimeException) +{ + m_sLookIn = _lookIn; +} + +sal_Bool SAL_CALL ScVbaFileSearch::getSearchSubFolders() throw (css::uno::RuntimeException) +{ + return m_bSearchSubFolders; +} + +void SAL_CALL ScVbaFileSearch::setSearchSubFolders( sal_Bool _searchSubFolders ) throw (css::uno::RuntimeException) +{ + m_bSearchSubFolders = _searchSubFolders; +} + +sal_Bool SAL_CALL ScVbaFileSearch::getMatchTextExactly() throw (css::uno::RuntimeException) +{ + return m_bMatchTextExactly; +} + +void SAL_CALL ScVbaFileSearch::setMatchTextExactly( sal_Bool _matchTextExactly ) throw (css::uno::RuntimeException) +{ + m_bMatchTextExactly = _matchTextExactly; +} + +static bool IsWildCard( const ::rtl::OUString& fileName ) +{ + static sal_Char cWild1 = '*'; + static sal_Char cWild2 = '?'; + + return ( ( fileName.indexOf( cWild1 ) >= 0 ) + || ( fileName.indexOf( cWild2 ) >= 0 ) ); +} + +static void SearchWildCard(const WildCard& wildCard, const ::rtl::OUString& aDir, bool bSearchSubFolders, css::uno::Sequence< rtl::OUString >& aSearchedFiles) +{ + Reference< XSimpleFileAccess3 > xSFI = getFileAccess(); + Sequence< rtl::OUString > aDirSeq; + try + { + if ( xSFI.is() ) + { + aDirSeq = xSFI->getFolderContents( aDir, bSearchSubFolders ); + } + } + catch( css::uno::Exception& ) + { + } + sal_Int32 nLength = aDirSeq.getLength(); + for ( sal_Int32 i = 0; i < nLength; i++ ) + { + rtl::OUString aURLStr = aDirSeq[i]; + if ( xSFI->isFolder( aURLStr ) ) + { + if ( bSearchSubFolders ) + { + SearchWildCard( wildCard, aURLStr, true, aSearchedFiles ); + } + } + else + { + INetURLObject aFileURL( aURLStr ); + rtl::OUString aFileName = aFileURL.GetLastName( INetURLObject::DECODE_UNAMBIGUOUS ); + if ( wildCard.Matches( aFileName.toAsciiLowerCase() ) ) + { + sal_Int32 nFilesLength = aSearchedFiles.getLength(); + aSearchedFiles.realloc( nFilesLength + 1 ); + rtl::OUString sSystemPath; + ::osl::File::getSystemPathFromFileURL( aURLStr, sSystemPath ); + aSearchedFiles[nFilesLength] = sSystemPath; + } + } + } +} + +sal_Int32 SAL_CALL ScVbaFileSearch::Execute( ) throw (css::uno::RuntimeException) +{ + m_aSearchedFiles.realloc(0); + Reference< XSimpleFileAccess3 > xSFI = getFileAccess(); + if ( !xSFI.is() || !xSFI->isFolder( m_sLookIn ) ) + { + return 0; + } + + if ( m_sFileName == ::rtl::OUString::createFromAscii( "" ) ) + { + return 1; + } + + ::rtl::OUString aTempFileName = m_sFileName.toAsciiLowerCase(); + if ( IsWildCard( aTempFileName ) ) + { + bool bEndWithAsterisk = aTempFileName.endsWithAsciiL("*", 1); + bool bStartWithAsterisk = (aTempFileName.indexOf(::rtl::OUString::createFromAscii("*")) == 0); + if ( !bEndWithAsterisk && !bStartWithAsterisk ) + { + aTempFileName = ::rtl::OUString::createFromAscii("*") + aTempFileName + ::rtl::OUString::createFromAscii("*"); + } + } + else + { + aTempFileName = ::rtl::OUString::createFromAscii("*") + aTempFileName + ::rtl::OUString::createFromAscii("*"); + } + WildCard wildCard( aTempFileName ); + SearchWildCard( wildCard, m_sLookIn, m_bSearchSubFolders, m_aSearchedFiles ); + + return m_aSearchedFiles.getLength(); +} + +//liuchen 2009-11-5 set ScVbaApplication::getDefaultFilePath( ) as the InitPath for FileSearch + ::rtl::OUString ScVbaFileSearch::getInitPath() throw (css::uno::RuntimeException) +{ + String aPath; + + if (m_pApplication != NULL) + { + aPath = m_pApplication->getDefaultFilePath(); + } + + return aPath; +} + +void SAL_CALL ScVbaFileSearch::NewSearch( ) throw (css::uno::RuntimeException) +{ + m_sFileName = ::rtl::OUString::createFromAscii( "" ); + m_sLookIn = getInitPath(); + m_bSearchSubFolders = false; + m_bMatchTextExactly = false; + m_aSearchedFiles.realloc(0); +} + +Reference< XFoundFiles > SAL_CALL ScVbaFileSearch::getFoundFiles() throw (css::uno::RuntimeException) +{ + css::uno::Reference< ov::XFoundFiles > xFoundFiles = new VbaFoundFiles( + mxParent, mxContext, (css::container::XIndexAccess *) new VbaFoundFilesEnum(m_aSearchedFiles) ); + return xFoundFiles; +} + +rtl::OUString& ScVbaFileSearch::getServiceImplName() +{ + static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("VbaFileSearch") ); + return sImplName; +} + +css::uno::Sequence< rtl::OUString > ScVbaFileSearch::getServiceNames() +{ + static css::uno::Sequence< rtl::OUString > aServiceNames; + if ( aServiceNames.getLength() == 0 ) + { + aServiceNames.realloc( 1 ); + aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.FileSearch") ); + } + return aServiceNames; +} diff --git a/sc/source/ui/vba/vbafilesearch.hxx b/sc/source/ui/vba/vbafilesearch.hxx new file mode 100644 index 000000000000..e82f14a94699 --- /dev/null +++ b/sc/source/ui/vba/vbafilesearch.hxx @@ -0,0 +1,77 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright IBM Corporation 2009, 2010. + * 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_VBA_FILESEARCH_HXX +#define SC_VBA_FILESEARCH_HXX + +#include <ooo/vba/XFileSearch.hpp> +#include <cppuhelper/implbase1.hxx> +#include <vbahelper/vbahelperinterface.hxx> + +namespace css = ::com::sun::star; + +typedef InheritedHelperInterfaceImpl1< ooo::vba::XFileSearch > ScVbaFileSearchImpl_BASE; + +class ScVbaApplication; + +class ScVbaFileSearch : public ScVbaFileSearchImpl_BASE +{ +private: + rtl::OUString m_sFileName; + rtl::OUString m_sLookIn; + sal_Bool m_bSearchSubFolders; + sal_Bool m_bMatchTextExactly; + ScVbaApplication* m_pApplication; + css::uno::Sequence< rtl::OUString > m_aSearchedFiles; + + ::rtl::OUString getInitPath() throw (css::uno::RuntimeException); + +public: + ScVbaFileSearch( ScVbaApplication* pApp, const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext ); + virtual ~ScVbaFileSearch(); + + // Attributes + virtual ::rtl::OUString SAL_CALL getFileName() throw (css::uno::RuntimeException); + virtual void SAL_CALL setFileName(const ::rtl::OUString& _fileName ) throw (css::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getLookIn() throw (css::uno::RuntimeException); + virtual void SAL_CALL setLookIn(const ::rtl::OUString& _lookIn ) throw (css::uno::RuntimeException); + virtual sal_Bool SAL_CALL getSearchSubFolders() throw (css::uno::RuntimeException); + virtual void SAL_CALL setSearchSubFolders( sal_Bool _searchSubFolders ) throw (css::uno::RuntimeException); + virtual sal_Bool SAL_CALL getMatchTextExactly() throw (css::uno::RuntimeException); + virtual void SAL_CALL setMatchTextExactly( sal_Bool _matchTextExactly ) throw (css::uno::RuntimeException); + virtual css::uno::Reference< ::ooo::vba::XFoundFiles > SAL_CALL getFoundFiles() throw (css::uno::RuntimeException); + + virtual sal_Int32 SAL_CALL Execute( ) throw (css::uno::RuntimeException); + virtual void SAL_CALL NewSearch( ) throw (css::uno::RuntimeException); + + // XHelperInterface + virtual rtl::OUString& getServiceImplName(); + virtual css::uno::Sequence< rtl::OUString > getServiceNames(); +}; + +#endif /* SC_VBA_FILESEARCH_HXX */ diff --git a/sc/source/ui/vba/vbafont.cxx b/sc/source/ui/vba/vbafont.cxx index 5894d3ea8c71..68ade5207674 100644 --- a/sc/source/ui/vba/vbafont.cxx +++ b/sc/source/ui/vba/vbafont.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -499,3 +500,5 @@ ScVbaFont::getServiceNames() } return aServiceNames; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbaformat.cxx b/sc/source/ui/vba/vbaformat.cxx index 81e9e0ebe73b..53a3375b380d 100644 --- a/sc/source/ui/vba/vbaformat.cxx +++ b/sc/source/ui/vba/vbaformat.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -841,3 +842,4 @@ template class ScVbaFormat< excel::XStyle >; template class ScVbaFormat< excel::XRange >; +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbaformatcondition.cxx b/sc/source/ui/vba/vbaformatcondition.cxx index 99d8a579956a..deed22ab287e 100644 --- a/sc/source/ui/vba/vbaformatcondition.cxx +++ b/sc/source/ui/vba/vbaformatcondition.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -174,3 +175,5 @@ ScVbaFormatCondition::getServiceNames() } return aServiceNames; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbaformatconditions.cxx b/sc/source/ui/vba/vbaformatconditions.cxx index 8dd67843ec00..6eda5c654238 100644 --- a/sc/source/ui/vba/vbaformatconditions.cxx +++ b/sc/source/ui/vba/vbaformatconditions.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -299,3 +300,4 @@ ScVbaFormatConditions::getServiceNames() return aServiceNames; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbafoundfiles.cxx b/sc/source/ui/vba/vbafoundfiles.cxx new file mode 100644 index 000000000000..78e61e8b8601 --- /dev/null +++ b/sc/source/ui/vba/vbafoundfiles.cxx @@ -0,0 +1,143 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright IBM Corporation 2009, 2010. + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "vbafoundfiles.hxx" + +////////////////////////////////VbaFoundFilesEnum////////////////////////////////////////// +VbaFoundFilesEnum::VbaFoundFilesEnum() : m_nIndex(0) +{ + +} + +VbaFoundFilesEnum::VbaFoundFilesEnum( css::uno::Sequence<rtl::OUString>& sFileList ) : m_nIndex(0), m_sFileList(sFileList) +{ + +} + +VbaFoundFilesEnum::~VbaFoundFilesEnum() +{ + +} + +void VbaFoundFilesEnum::SetFileList( css::uno::Sequence<rtl::OUString>& sFileList ) +{ + m_nIndex = 0; + m_sFileList = sFileList; +} + +sal_Int32 SAL_CALL VbaFoundFilesEnum::getCount() throw (css::uno::RuntimeException) +{ + return m_sFileList.getLength(); +} + +css::uno::Any SAL_CALL VbaFoundFilesEnum::getByIndex( sal_Int32 nIndex ) + throw (css::lang::IndexOutOfBoundsException, css::lang::WrappedTargetException, css::uno::RuntimeException) +{ + if ( nIndex >= getCount() ) + { + throw css::lang::IndexOutOfBoundsException(); + } + + return css::uno::makeAny( m_sFileList[nIndex] ); +} + +css::uno::Type SAL_CALL VbaFoundFilesEnum::getElementType() throw (css::uno::RuntimeException) +{ + return getCppuType((css::uno::Reference< css::container::XIndexAccess >*)0); +} + +sal_Bool SAL_CALL VbaFoundFilesEnum::hasElements() throw (css::uno::RuntimeException) +{ + return ( getCount() != 0 ); +} + +sal_Bool SAL_CALL VbaFoundFilesEnum::hasMoreElements() throw (css::uno::RuntimeException) +{ + if ( getCount() > m_nIndex ) + { + return sal_True; + } + return sal_False; +} + +css::uno::Any SAL_CALL VbaFoundFilesEnum::nextElement() throw (css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException) +{ + if ( !hasMoreElements() ) + { + throw css::container::NoSuchElementException(); + } + + return css::uno::makeAny( m_sFileList[m_nIndex++] ); +} + +////////////////////////////////VbaFoundFiles////////////////////////////////////////// +VbaFoundFiles::VbaFoundFiles( const css::uno::Reference< ov::XHelperInterface >& xParent, + const css::uno::Reference< css::uno::XComponentContext >& xContext, + const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess + ) : VbaFoundFilesImpl_BASE( xParent, xContext, xIndexAccess ) +{ + +} + +VbaFoundFiles::~VbaFoundFiles() +{ + +} + +css::uno::Reference< css::container::XEnumeration > VbaFoundFiles::createEnumeration() throw (css::uno::RuntimeException) +{ + css::uno::Reference< css::container::XEnumeration > xEnumRet( m_xIndexAccess, css::uno::UNO_QUERY ); + return xEnumRet; +} + +css::uno::Any VbaFoundFiles::createCollectionObject( const css::uno::Any& aSource ) +{ + return aSource; +} + +css::uno::Type VbaFoundFiles::getElementType() throw (css::uno::RuntimeException) +{ + return ov::XFoundFiles::static_type(0); +} + +rtl::OUString& VbaFoundFiles::getServiceImplName() +{ + static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("VbaFoundFiles") ); + return sImplName; +} + +css::uno::Sequence< rtl::OUString > VbaFoundFiles::getServiceNames() +{ + static css::uno::Sequence< rtl::OUString > aServiceNames; + if ( aServiceNames.getLength() == 0 ) + { + aServiceNames.realloc( 1 ); + aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.FoundFiles") ); + } + return aServiceNames; +} diff --git a/sc/source/ui/vba/vbafoundfiles.hxx b/sc/source/ui/vba/vbafoundfiles.hxx new file mode 100644 index 000000000000..b02d3bb91526 --- /dev/null +++ b/sc/source/ui/vba/vbafoundfiles.hxx @@ -0,0 +1,88 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright IBM Corporation 2009, 2010. + * 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_VBA_FOUNDFILES_HXX +#define SC_VBA_FOUNDFILES_HXX + +#include <cppuhelper/implbase2.hxx> +#include <com/sun/star/container/XIndexAccess.hpp> +#include <ooo/vba/XFoundFiles.hpp> +#include <vbahelper/vbacollectionimpl.hxx> + +namespace css = ::com::sun::star; + +typedef CollTestImplHelper< ooo::vba::XFoundFiles > VbaFoundFilesImpl_BASE; + +class VbaFoundFilesEnum : public cppu::WeakImplHelper2< css::container::XIndexAccess, css::container::XEnumeration > +{ +private: + sal_Int32 m_nIndex; + css::uno::Sequence< rtl::OUString > m_sFileList; + +public: + VbaFoundFilesEnum(); + VbaFoundFilesEnum( css::uno::Sequence< rtl::OUString >& sFileList ); + ~VbaFoundFilesEnum(); + + void SetFileList( css::uno::Sequence< rtl::OUString >& sFileList ); + + // XIndexAccess + virtual sal_Int32 SAL_CALL getCount() throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, css::lang::WrappedTargetException, css::uno::RuntimeException); + + // XElementAccess + virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements() throw (css::uno::RuntimeException); + + // XEnumeration + virtual sal_Bool SAL_CALL hasMoreElements() throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL nextElement() throw (css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException); +}; + +class VbaFoundFiles : public VbaFoundFilesImpl_BASE +{ +private: + +public: + VbaFoundFiles( const css::uno::Reference< ov::XHelperInterface >& xParent, + const css::uno::Reference< css::uno::XComponentContext >& xContext, + const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess ); + virtual ~VbaFoundFiles(); + + virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); + + // XEnumerationAccess + virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException); + virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException); + + // XHelperInterface + virtual rtl::OUString& getServiceImplName(); + virtual css::uno::Sequence< rtl::OUString > getServiceNames(); +}; + +#endif /* SC_VBA_FOUNDFILES_HXX */ diff --git a/sc/source/ui/vba/vbaglobals.cxx b/sc/source/ui/vba/vbaglobals.cxx index 2f9f002d427d..e37a2bb933c0 100644 --- a/sc/source/ui/vba/vbaglobals.cxx +++ b/sc/source/ui/vba/vbaglobals.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -248,6 +249,12 @@ ScVbaGlobals::getDebug() throw (uno::RuntimeException) return uno::Any(); } +uno::Any SAL_CALL +ScVbaGlobals::MenuBars( const uno::Any& aIndex ) throw (uno::RuntimeException) +{ + return uno::Any( getApplication()->MenuBars(aIndex) ); +} + uno::Sequence< ::rtl::OUString > SAL_CALL ScVbaGlobals::getAvailableServiceNames( ) throw (uno::RuntimeException) { @@ -303,3 +310,4 @@ extern sdecl::ServiceDecl const serviceDecl( "ooo.vba.excel.Globals" ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbaglobals.hxx b/sc/source/ui/vba/vbaglobals.hxx index f22e5b19faa4..3108f5ab871c 100644 --- a/sc/source/ui/vba/vbaglobals.hxx +++ b/sc/source/ui/vba/vbaglobals.hxx @@ -84,6 +84,7 @@ typedef ::cppu::ImplInheritanceHelper1< VbaGlobalsBase, ov::excel::XGlobals > Sc virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Union( const css::uno::Reference< ov::excel::XRange >& Arg1, const css::uno::Reference< ov::excel::XRange >& Arg2, const css::uno::Any& Arg3, const css::uno::Any& Arg4, const css::uno::Any& Arg5, const css::uno::Any& Arg6, const css::uno::Any& Arg7, const css::uno::Any& Arg8, const css::uno::Any& Arg9, const css::uno::Any& Arg10, const css::uno::Any& Arg11, const css::uno::Any& Arg12, const css::uno::Any& Arg13, const css::uno::Any& Arg14, const css::uno::Any& Arg15, const css::uno::Any& Arg16, const css::uno::Any& Arg17, const css::uno::Any& Arg18, const css::uno::Any& Arg19, const css::uno::Any& Arg20, const css::uno::Any& Arg21, const css::uno::Any& Arg22, const css::uno::Any& Arg23, const css::uno::Any& Arg24, const css::uno::Any& Arg25, const css::uno::Any& Arg26, const css::uno::Any& Arg27, const css::uno::Any& Arg28, const css::uno::Any& Arg29, const css::uno::Any& Arg30 ) throw (css::script::BasicErrorException, css::uno::RuntimeException); virtual css::uno::Reference< ov::excel::XApplication > SAL_CALL getExcel() throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL getDebug() throw (css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL MenuBars( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); // XMultiServiceFactory diff --git a/sc/source/ui/vba/vbahelper.cxx b/sc/source/ui/vba/vbahelper.cxx index cc76b1e60125..62d71a08f4fc 100644 --- a/sc/source/ui/vba/vbahelper.cxx +++ b/sc/source/ui/vba/vbahelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -756,3 +757,5 @@ ScVbaCellRangeAccess::GetDataSet( ScCellRangeObj* pRangeObj ) } // vba } // ooo + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbahyperlink.cxx b/sc/source/ui/vba/vbahyperlink.cxx index e37df1e118b4..2f3c5703203f 100644 --- a/sc/source/ui/vba/vbahyperlink.cxx +++ b/sc/source/ui/vba/vbahyperlink.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -244,3 +245,5 @@ extern sdecl::ServiceDecl const serviceDecl( } // ============================================================================ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbahyperlinks.cxx b/sc/source/ui/vba/vbahyperlinks.cxx index 89a8109e6aa2..083607ff345d 100644 --- a/sc/source/ui/vba/vbahyperlinks.cxx +++ b/sc/source/ui/vba/vbahyperlinks.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -291,3 +292,5 @@ uno::Any ScVbaHyperlinks::createCollectionObject( const uno::Any& rSource ) VBAHELPER_IMPL_XHELPERINTERFACE( ScVbaHyperlinks, "ooo.vba.excel.Hyperlinks" ) // ============================================================================ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbainterior.cxx b/sc/source/ui/vba/vbainterior.cxx index face47767bdc..733f394fabd4 100644 --- a/sc/source/ui/vba/vbainterior.cxx +++ b/sc/source/ui/vba/vbainterior.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -415,3 +416,4 @@ ScVbaInterior::getServiceNames() return aServiceNames; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbamenu.cxx b/sc/source/ui/vba/vbamenu.cxx new file mode 100644 index 000000000000..237fd723a1b4 --- /dev/null +++ b/sc/source/ui/vba/vbamenu.cxx @@ -0,0 +1,84 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Novell Inc. + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Pei Feng Lin <pflin@novell.com> + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#include "vbamenu.hxx" +#include "vbamenuitems.hxx" + +using namespace com::sun::star; +using namespace ooo::vba; + +ScVbaMenu::ScVbaMenu( const uno::Reference< ov::XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext, const uno::Reference< XCommandBarControl >& xCommandBarControl ) throw( uno::RuntimeException ) : Menu_BASE( xParent, xContext ), m_xCommandBarControl( xCommandBarControl ) +{ +} + +::rtl::OUString SAL_CALL +ScVbaMenu::getCaption() throw ( uno::RuntimeException ) +{ + return m_xCommandBarControl->getCaption(); +} + +void SAL_CALL +ScVbaMenu::setCaption( const ::rtl::OUString& _caption ) throw (uno::RuntimeException) +{ + m_xCommandBarControl->setCaption( _caption ); +} + +void SAL_CALL +ScVbaMenu::Delete( ) throw (script::BasicErrorException, uno::RuntimeException) +{ + m_xCommandBarControl->Delete(); +} + +uno::Any SAL_CALL +ScVbaMenu::MenuItems( const uno::Any& aIndex ) throw (script::BasicErrorException, uno::RuntimeException) +{ + uno::Reference< XCommandBarControls > xCommandBarControls( m_xCommandBarControl->Controls( uno::Any() ), uno::UNO_QUERY_THROW ); + uno::Reference< excel::XMenuItems > xMenuItems( new ScVbaMenuItems( this, mxContext, xCommandBarControls ) ); + if( aIndex.hasValue() ) + { + return xMenuItems->Item( aIndex, uno::Any() ); + } + return uno::makeAny( xMenuItems ); +} + +rtl::OUString& +ScVbaMenu::getServiceImplName() +{ + static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaMenu") ); + return sImplName; +} +uno::Sequence<rtl::OUString> +ScVbaMenu::getServiceNames() +{ + static uno::Sequence< rtl::OUString > aServiceNames; + if ( aServiceNames.getLength() == 0 ) + { + aServiceNames.realloc( 1 ); + aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.Menu" ) ); + } + return aServiceNames; +} diff --git a/sc/source/ui/vba/vbamenu.hxx b/sc/source/ui/vba/vbamenu.hxx new file mode 100644 index 000000000000..a297c6d38317 --- /dev/null +++ b/sc/source/ui/vba/vbamenu.hxx @@ -0,0 +1,54 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Novell Inc. + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Pei Feng Lin <pflin@novell.com> + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ +#ifndef SC_VBA_MENU_HXX +#define SC_VBA_MENU_HXX + +#include <ooo/vba/excel/XMenu.hpp> +#include <ooo/vba/XCommandBarControl.hpp> +#include <vbahelper/vbahelperinterface.hxx> + +typedef InheritedHelperInterfaceImpl1< ov::excel::XMenu > Menu_BASE; + +class ScVbaMenu : public Menu_BASE +{ +private: + css::uno::Reference< ov::XCommandBarControl > m_xCommandBarControl; + +public: + ScVbaMenu( const css::uno::Reference< ov::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, const css::uno::Reference< ov::XCommandBarControl >& xCommandBarControl ) throw( css::uno::RuntimeException ); + + virtual ::rtl::OUString SAL_CALL getCaption() throw (css::uno::RuntimeException); + virtual void SAL_CALL setCaption( const ::rtl::OUString& _caption ) throw (css::uno::RuntimeException); + + virtual void SAL_CALL Delete( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL MenuItems( const css::uno::Any& aIndex ) throw (css::script::BasicErrorException, css::uno::RuntimeException); + + // XHelperInterface + virtual rtl::OUString& getServiceImplName(); + virtual css::uno::Sequence<rtl::OUString> getServiceNames(); +}; +#endif//SC_VBA_MENU_HXX diff --git a/sc/source/ui/vba/vbamenubar.cxx b/sc/source/ui/vba/vbamenubar.cxx new file mode 100644 index 000000000000..abf2c05a6f81 --- /dev/null +++ b/sc/source/ui/vba/vbamenubar.cxx @@ -0,0 +1,66 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Novell Inc. + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Pei Feng Lin <pflin@novell.com> + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ +#include "vbamenubar.hxx" +#include "vbamenus.hxx" +#include <ooo/vba/XCommandBarControls.hpp> + +using namespace com::sun::star; +using namespace ooo::vba; + +ScVbaMenuBar::ScVbaMenuBar( const uno::Reference< ov::XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext, const uno::Reference< XCommandBar >& xCommandBar ) throw( uno::RuntimeException ) : MenuBar_BASE( xParent, xContext ), m_xCommandBar( xCommandBar ) +{ +} + +uno::Any SAL_CALL +ScVbaMenuBar::Menus( const uno::Any& aIndex ) throw (script::BasicErrorException, uno::RuntimeException) +{ + uno::Reference< XCommandBarControls > xCommandBarControls( m_xCommandBar->Controls( uno::Any() ), uno::UNO_QUERY_THROW ); + uno::Reference< excel::XMenus > xMenus( new ScVbaMenus( this, mxContext, xCommandBarControls ) ); + if( aIndex.hasValue() ) + { + return xMenus->Item( aIndex, uno::Any() ); + } + return uno::makeAny( xMenus ); +} + +rtl::OUString& +ScVbaMenuBar::getServiceImplName() +{ + static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaMenuBar") ); + return sImplName; +} +uno::Sequence<rtl::OUString> +ScVbaMenuBar::getServiceNames() +{ + static uno::Sequence< rtl::OUString > aServiceNames; + if ( aServiceNames.getLength() == 0 ) + { + aServiceNames.realloc( 1 ); + aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.MenuBar" ) ); + } + return aServiceNames; +} diff --git a/sc/source/ui/vba/vbamenubar.hxx b/sc/source/ui/vba/vbamenubar.hxx new file mode 100644 index 000000000000..6ba8f360bd28 --- /dev/null +++ b/sc/source/ui/vba/vbamenubar.hxx @@ -0,0 +1,50 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Novell Inc. + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Pei Feng Lin <pflin@novell.com> + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ +#ifndef SC_VBA_MENUBAR_HXX +#define SC_VBA_MENUBAR_HXX + +#include <ooo/vba/excel/XMenuBar.hpp> +#include <ooo/vba/XCommandBar.hpp> +#include <vbahelper/vbahelperinterface.hxx> + +typedef InheritedHelperInterfaceImpl1< ov::excel::XMenuBar > MenuBar_BASE; + +class ScVbaMenuBar : public MenuBar_BASE +{ +private: + css::uno::Reference< ov::XCommandBar > m_xCommandBar; + +public: + ScVbaMenuBar( const css::uno::Reference< ov::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, const css::uno::Reference< ov::XCommandBar >& xCommandBar ) throw( css::uno::RuntimeException ); + + virtual css::uno::Any SAL_CALL Menus( const css::uno::Any& aIndex ) throw (css::script::BasicErrorException, css::uno::RuntimeException); + + // XHelperInterface + virtual rtl::OUString& getServiceImplName(); + virtual css::uno::Sequence<rtl::OUString> getServiceNames(); +}; +#endif//SC_VBA_MENUBAR_HXX diff --git a/sc/source/ui/vba/vbamenubars.cxx b/sc/source/ui/vba/vbamenubars.cxx new file mode 100644 index 000000000000..a13bb492575d --- /dev/null +++ b/sc/source/ui/vba/vbamenubars.cxx @@ -0,0 +1,137 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Novell Inc. + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Pei Feng Lin <pflin@novell.com> + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ +#include "vbamenubars.hxx" +#include "vbamenubar.hxx" +#include <ooo/vba/excel/XlSheetType.hpp> + +using namespace com::sun::star; +using namespace ooo::vba; + + +typedef ::cppu::WeakImplHelper1< container::XEnumeration > MenuBarEnumeration_BASE; + +class MenuBarEnumeration : public MenuBarEnumeration_BASE +{ + uno::Reference< XHelperInterface > m_xParent; + uno::Reference< uno::XComponentContext > m_xContext; + uno::Reference< container::XEnumeration > m_xEnumeration; +public: + MenuBarEnumeration( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XEnumeration >& xEnumeration) throw ( uno::RuntimeException ) : m_xParent( xParent ), m_xContext( xContext ), m_xEnumeration( xEnumeration ) + { + } + virtual sal_Bool SAL_CALL hasMoreElements() throw ( uno::RuntimeException ) + { + return m_xEnumeration->hasMoreElements(); + } + virtual uno::Any SAL_CALL nextElement() throw ( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException ) + { + // FIXME: should be add menubar + if( hasMoreElements() ) + { + uno::Reference< XCommandBar > xCommandBar( m_xEnumeration->nextElement(), uno::UNO_QUERY_THROW ); + uno::Reference< excel::XMenuBar > xMenuBar( new ScVbaMenuBar( m_xParent, m_xContext, xCommandBar ) ); + return uno::makeAny( xMenuBar ); + } + else + throw container::NoSuchElementException(); + return uno::Any(); + } +}; + +ScVbaMenuBars::ScVbaMenuBars( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< XCommandBars >& xCommandBars ) throw ( uno::RuntimeException ) : MenuBars_BASE( xParent, xContext, uno::Reference< container::XIndexAccess>() ), m_xCommandBars( xCommandBars ) +{ +} + +ScVbaMenuBars::~ScVbaMenuBars() +{ +} + +// XEnumerationAccess +uno::Type SAL_CALL +ScVbaMenuBars::getElementType() throw ( uno::RuntimeException ) +{ + return excel::XMenuBar::static_type( 0 ); +} + +uno::Reference< container::XEnumeration > +ScVbaMenuBars::createEnumeration() throw ( uno::RuntimeException ) +{ + uno::Reference< container::XEnumerationAccess > xEnumAccess( m_xCommandBars, uno::UNO_QUERY_THROW ); + return uno::Reference< container::XEnumeration >( new MenuBarEnumeration( this, mxContext, xEnumAccess->createEnumeration() ) ); +} + +uno::Any +ScVbaMenuBars::createCollectionObject( const uno::Any& aSource ) +{ + // make no sense + return aSource; +} + +sal_Int32 SAL_CALL +ScVbaMenuBars::getCount() throw(css::uno::RuntimeException) +{ + return m_xCommandBars->getCount(); +} + +// ScVbaCollectionBaseImpl +uno::Any SAL_CALL +ScVbaMenuBars::Item( const uno::Any& aIndex, const uno::Any& /*aIndex2*/ ) throw( uno::RuntimeException ) +{ + sal_Int16 nIndex = 0; + aIndex >>= nIndex; + if( nIndex == excel::XlSheetType::xlWorksheet ) + { + uno::Any aSource; + aSource <<= rtl::OUString::createFromAscii( "Worksheet Menu Bar" ); + uno::Reference< XCommandBar > xCommandBar( m_xCommandBars->Item( aSource, uno::Any() ), uno::UNO_QUERY_THROW ); + uno::Reference< excel::XMenuBar > xMenuBar( new ScVbaMenuBar( this, mxContext, xCommandBar ) ); + return uno::makeAny( xMenuBar ); + } + + throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() ); + + return uno::Any(); +} + +// XHelperInterface +rtl::OUString& +ScVbaMenuBars::getServiceImplName() +{ + static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaMenuBars") ); + return sImplName; +} +uno::Sequence<rtl::OUString> +ScVbaMenuBars::getServiceNames() +{ + static uno::Sequence< rtl::OUString > aServiceNames; + if ( aServiceNames.getLength() == 0 ) + { + aServiceNames.realloc( 1 ); + aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.MenuBars" ) ); + } + return aServiceNames; +} diff --git a/sc/source/ui/vba/vbamenubars.hxx b/sc/source/ui/vba/vbamenubars.hxx new file mode 100644 index 000000000000..44cf96e5b010 --- /dev/null +++ b/sc/source/ui/vba/vbamenubars.hxx @@ -0,0 +1,61 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Novell Inc. + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Pei Feng Lin <pflin@novell.com> + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ +#ifndef SC_VBA_MENUBARS_HXX +#define SC_VBA_MENUBARS_HXX + +#include <ooo/vba/excel/XMenuBars.hpp> +#include <ooo/vba/excel/XMenuBar.hpp> +#include <ooo/vba/XCommandBars.hpp> +#include <com/sun/star/container/XNameAccess.hpp> +#include <cppuhelper/implbase1.hxx> +#include <vbahelper/vbahelperinterface.hxx> +#include <vbahelper/vbacollectionimpl.hxx> + +typedef CollTestImplHelper< ov::excel::XMenuBars > MenuBars_BASE; + +class ScVbaMenuBars : public MenuBars_BASE +{ +private: + css::uno::Reference< ov::XCommandBars > m_xCommandBars; + +public: + ScVbaMenuBars( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< ov::XCommandBars >& xCommandBars ) throw (css::uno::RuntimeException); + virtual ~ScVbaMenuBars(); + + // XEnumerationAccess + virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException); + virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException); + virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); + + virtual sal_Int32 SAL_CALL getCount() throw(css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL Item( const css::uno::Any& aIndex, const css::uno::Any& /*aIndex2*/ ) throw( css::uno::RuntimeException); + // XHelperInterface + virtual rtl::OUString& getServiceImplName(); + virtual css::uno::Sequence<rtl::OUString> getServiceNames(); +}; + +#endif//SC_VBA_MENUBARS_HXX diff --git a/sc/source/ui/vba/vbamenuitem.cxx b/sc/source/ui/vba/vbamenuitem.cxx new file mode 100644 index 000000000000..42f276bc8bc9 --- /dev/null +++ b/sc/source/ui/vba/vbamenuitem.cxx @@ -0,0 +1,82 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Novell Inc. + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Pei Feng Lin <pflin@novell.com> + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ +#include "vbamenuitem.hxx" + +using namespace com::sun::star; +using namespace ooo::vba; + +ScVbaMenuItem::ScVbaMenuItem( const uno::Reference< ov::XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext, const uno::Reference< XCommandBarControl >& xCommandBarControl ) throw( uno::RuntimeException ) : MenuItem_BASE( xParent, xContext ), m_xCommandBarControl( xCommandBarControl ) +{ +} + +::rtl::OUString SAL_CALL +ScVbaMenuItem::getCaption() throw ( uno::RuntimeException ) +{ + return m_xCommandBarControl->getCaption(); +} + +void SAL_CALL +ScVbaMenuItem::setCaption( const ::rtl::OUString& _caption ) throw (uno::RuntimeException) +{ + m_xCommandBarControl->setCaption( _caption ); +} + +::rtl::OUString SAL_CALL +ScVbaMenuItem::getOnAction() throw ( uno::RuntimeException ) +{ + return m_xCommandBarControl->getOnAction(); +} + +void SAL_CALL +ScVbaMenuItem::setOnAction( const ::rtl::OUString& _onaction ) throw (uno::RuntimeException) +{ + m_xCommandBarControl->setOnAction( _onaction ); +} + +void SAL_CALL +ScVbaMenuItem::Delete( ) throw (script::BasicErrorException, uno::RuntimeException) +{ + m_xCommandBarControl->Delete(); +} + +rtl::OUString& +ScVbaMenuItem::getServiceImplName() +{ + static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaMenuItem") ); + return sImplName; +} +uno::Sequence<rtl::OUString> +ScVbaMenuItem::getServiceNames() +{ + static uno::Sequence< rtl::OUString > aServiceNames; + if ( aServiceNames.getLength() == 0 ) + { + aServiceNames.realloc( 1 ); + aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.MenuItem" ) ); + } + return aServiceNames; +} diff --git a/sc/source/ui/vba/vbamenuitem.hxx b/sc/source/ui/vba/vbamenuitem.hxx new file mode 100644 index 000000000000..eaccdbb6a113 --- /dev/null +++ b/sc/source/ui/vba/vbamenuitem.hxx @@ -0,0 +1,55 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Novell Inc. + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Pei Feng Lin <pflin@novell.com> + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ +#ifndef SC_VBA_MENUITEM_HXX +#define SC_VBA_MENUITEM_HXX + +#include <ooo/vba/excel/XMenuItem.hpp> +#include <ooo/vba/XCommandBarControl.hpp> +#include <vbahelper/vbahelperinterface.hxx> + +typedef InheritedHelperInterfaceImpl1< ov::excel::XMenuItem > MenuItem_BASE; + +class ScVbaMenuItem : public MenuItem_BASE +{ +private: + css::uno::Reference< ov::XCommandBarControl > m_xCommandBarControl; + +public: + ScVbaMenuItem( const css::uno::Reference< ov::XHelperInterface > xParent, const css::uno::Reference< css::uno::XComponentContext > xContext, const css::uno::Reference< ov::XCommandBarControl >& xCommandBarControl ) throw( css::uno::RuntimeException ); + + virtual ::rtl::OUString SAL_CALL getCaption() throw (css::uno::RuntimeException); + virtual void SAL_CALL setCaption( const ::rtl::OUString& _caption ) throw (css::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getOnAction() throw (css::uno::RuntimeException); + virtual void SAL_CALL setOnAction( const ::rtl::OUString& _onaction ) throw (css::uno::RuntimeException); + + virtual void SAL_CALL Delete( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); + + // XHelperInterface + virtual rtl::OUString& getServiceImplName(); + virtual css::uno::Sequence<rtl::OUString> getServiceNames(); +}; +#endif//SC_VBA_MENUITEM_HXX diff --git a/sc/source/ui/vba/vbamenuitems.cxx b/sc/source/ui/vba/vbamenuitems.cxx new file mode 100644 index 000000000000..f3a3f3efd4c0 --- /dev/null +++ b/sc/source/ui/vba/vbamenuitems.cxx @@ -0,0 +1,150 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Novell Inc. + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Pei Feng Lin <pflin@novell.com> + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ +#include "vbamenuitems.hxx" +#include "vbamenuitem.hxx" +#include "vbamenu.hxx" +#include <ooo/vba/office/MsoControlType.hpp> + +using namespace com::sun::star; +using namespace ooo::vba; + + +typedef ::cppu::WeakImplHelper1< container::XEnumeration > MenuEnumeration_BASE; + +class MenuEnumeration : public MenuEnumeration_BASE +{ + uno::Reference< XHelperInterface > m_xParent; + uno::Reference< uno::XComponentContext > m_xContext; + uno::Reference< container::XEnumeration > m_xEnumeration; +public: + MenuEnumeration( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XEnumeration >& xEnumeration) throw ( uno::RuntimeException ) : m_xParent( xParent ), m_xContext( xContext ), m_xEnumeration( xEnumeration ) + { + } + virtual sal_Bool SAL_CALL hasMoreElements() throw ( uno::RuntimeException ) + { + return m_xEnumeration->hasMoreElements(); + } + virtual uno::Any SAL_CALL nextElement() throw ( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException ) + { + // FIXME: should be add menu + if( hasMoreElements() ) + { + uno::Reference< XCommandBarControl > xCommandBarControl( m_xEnumeration->nextElement(), uno::UNO_QUERY_THROW ); + if( xCommandBarControl->getType() == office::MsoControlType::msoControlPopup ) + { + uno::Reference< excel::XMenu > xMenu( new ScVbaMenu( m_xParent, m_xContext, xCommandBarControl ) ); + return uno::makeAny( xMenu ); + } + else if( xCommandBarControl->getType() == office::MsoControlType::msoControlButton ) + { + uno::Reference< excel::XMenuItem > xMenuItem( new ScVbaMenuItem( m_xParent, m_xContext, xCommandBarControl ) ); + return uno::makeAny( xMenuItem ); + } + nextElement(); + } + else + throw container::NoSuchElementException(); + return uno::Any(); + } +}; + +ScVbaMenuItems::ScVbaMenuItems( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< XCommandBarControls >& xCommandBarControls ) throw ( uno::RuntimeException ) : MenuItems_BASE( xParent, xContext, uno::Reference< container::XIndexAccess>() ), m_xCommandBarControls( xCommandBarControls ) +{ +} + +// XEnumerationAccess +uno::Type SAL_CALL +ScVbaMenuItems::getElementType() throw ( uno::RuntimeException ) +{ + return excel::XMenuItem::static_type( 0 ); +} + +uno::Reference< container::XEnumeration > +ScVbaMenuItems::createEnumeration() throw ( uno::RuntimeException ) +{ + uno::Reference< container::XEnumerationAccess > xEnumAccess( m_xCommandBarControls, uno::UNO_QUERY_THROW ); + return uno::Reference< container::XEnumeration >( new MenuEnumeration( this, mxContext, xEnumAccess->createEnumeration() ) ); +} + +uno::Any +ScVbaMenuItems::createCollectionObject( const uno::Any& aSource ) +{ + // make no sense + return aSource; +} + +sal_Int32 SAL_CALL +ScVbaMenuItems::getCount() throw(css::uno::RuntimeException) +{ + // FIXME: should check if it is a popup menu + return m_xCommandBarControls->getCount(); +} + +// ScVbaCollectionBaseImpl +uno::Any SAL_CALL +ScVbaMenuItems::Item( const uno::Any& aIndex, const uno::Any& /*aIndex2*/ ) throw( uno::RuntimeException ) +{ + uno::Reference< XCommandBarControl > xCommandBarControl( m_xCommandBarControls->Item( aIndex, uno::Any() ), uno::UNO_QUERY_THROW ); + if( xCommandBarControl->getType() == office::MsoControlType::msoControlPopup ) + return uno::makeAny( uno::Reference< excel::XMenu > ( new ScVbaMenu( this, mxContext, xCommandBarControl ) ) ); + else if( xCommandBarControl->getType() == office::MsoControlType::msoControlButton ) + return uno::makeAny( uno::Reference< excel::XMenuItem > ( new ScVbaMenuItem( this, mxContext, xCommandBarControl ) ) ); + throw uno::RuntimeException(); +} + +uno::Reference< excel::XMenuItem > SAL_CALL ScVbaMenuItems::Add( const rtl::OUString& Caption, const css::uno::Any& OnAction, const css::uno::Any& /*ShortcutKey*/, const css::uno::Any& Before, const css::uno::Any& Restore, const css::uno::Any& /*StatusBar*/, const css::uno::Any& /*HelpFile*/, const css::uno::Any& /*HelpContextID*/ ) throw (css::script::BasicErrorException, css::uno::RuntimeException) +{ + sal_Int32 nType = office::MsoControlType::msoControlButton; + uno::Reference< XCommandBarControl > xCommandBarControl = m_xCommandBarControls->Add( uno::makeAny( nType ), uno::Any(), uno::Any(), Before, Restore ); + xCommandBarControl->setCaption( Caption ); + if( OnAction.hasValue() ) + { + rtl::OUString sAction; + OnAction >>= sAction; + xCommandBarControl->setOnAction( sAction ); + } + return uno::Reference< excel::XMenuItem >( new ScVbaMenuItem( this, mxContext, xCommandBarControl ) ); +} + +// XHelperInterface +rtl::OUString& +ScVbaMenuItems::getServiceImplName() +{ + static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaMenuItems") ); + return sImplName; +} +uno::Sequence<rtl::OUString> +ScVbaMenuItems::getServiceNames() +{ + static uno::Sequence< rtl::OUString > aServiceNames; + if ( aServiceNames.getLength() == 0 ) + { + aServiceNames.realloc( 1 ); + aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.MenuItems" ) ); + } + return aServiceNames; +} diff --git a/sc/source/ui/vba/vbamenuitems.hxx b/sc/source/ui/vba/vbamenuitems.hxx new file mode 100644 index 000000000000..17eee45a00e2 --- /dev/null +++ b/sc/source/ui/vba/vbamenuitems.hxx @@ -0,0 +1,60 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Novell Inc. + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Pei Feng Lin <pflin@novell.com> + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ +#ifndef SC_VBA_MENUITEMS_HXX +#define SC_VBA_MENUITEMS_HXX + +#include <ooo/vba/excel/XMenuItems.hpp> +#include <ooo/vba/excel/XMenuItem.hpp> +#include <ooo/vba/XCommandBarControls.hpp> +#include <vbahelper/vbahelperinterface.hxx> +#include <vbahelper/vbacollectionimpl.hxx> + +typedef CollTestImplHelper< ov::excel::XMenuItems > MenuItems_BASE; + +class ScVbaMenuItems : public MenuItems_BASE +{ +private: + css::uno::Reference< ov::XCommandBarControls > m_xCommandBarControls; + +public: + ScVbaMenuItems( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< ov::XCommandBarControls >& xCommandBarControls ) throw( css::uno::RuntimeException ); + + // XEnumerationAccess + virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException); + virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException); + virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); + + // Methods + virtual sal_Int32 SAL_CALL getCount() throw(css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index, const css::uno::Any& /*Index2*/ ) throw (css::uno::RuntimeException); + virtual css::uno::Reference< ov::excel::XMenuItem > SAL_CALL Add( const rtl::OUString& Caption, const css::uno::Any& OnAction, const css::uno::Any& ShortcutKey, const css::uno::Any& Before, const css::uno::Any& Restore, const css::uno::Any& StatusBar, const css::uno::Any& HelpFile, const css::uno::Any& HelpContextID ) throw (css::script::BasicErrorException, css::uno::RuntimeException); + // XHelperInterface + virtual rtl::OUString& getServiceImplName(); + virtual css::uno::Sequence<rtl::OUString> getServiceNames(); +}; + +#endif//SC_VBA_MENUITEMS_HXX diff --git a/sc/source/ui/vba/vbamenus.cxx b/sc/source/ui/vba/vbamenus.cxx new file mode 100644 index 000000000000..057f8229dbbb --- /dev/null +++ b/sc/source/ui/vba/vbamenus.cxx @@ -0,0 +1,136 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Novell Inc. + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Pei Feng Lin <pflin@novell.com> + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ +#include "vbamenus.hxx" +#include "vbamenu.hxx" +#include <ooo/vba/office/MsoControlType.hpp> + +using namespace com::sun::star; +using namespace ooo::vba; + + +typedef ::cppu::WeakImplHelper1< container::XEnumeration > MenuEnumeration_BASE; + +class MenuEnumeration : public MenuEnumeration_BASE +{ + uno::Reference< XHelperInterface > m_xParent; + uno::Reference< uno::XComponentContext > m_xContext; + uno::Reference< container::XEnumeration > m_xEnumeration; +public: + MenuEnumeration( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< container::XEnumeration >& xEnumeration) throw ( uno::RuntimeException ) : m_xParent( xParent ), m_xContext( xContext ), m_xEnumeration( xEnumeration ) + { + } + virtual sal_Bool SAL_CALL hasMoreElements() throw ( uno::RuntimeException ) + { + return m_xEnumeration->hasMoreElements(); + } + virtual uno::Any SAL_CALL nextElement() throw ( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException ) + { + // FIXME: should be add menu + if( hasMoreElements() ) + { + uno::Reference< XCommandBarControl > xCommandBarControl( m_xEnumeration->nextElement(), uno::UNO_QUERY_THROW ); + if( xCommandBarControl->getType() == office::MsoControlType::msoControlPopup ) + { + uno::Reference< excel::XMenu > xMenu( new ScVbaMenu( m_xParent, m_xContext, xCommandBarControl ) ); + return uno::makeAny( xMenu ); + } + nextElement(); + } + else + throw container::NoSuchElementException(); + return uno::Any(); + } +}; + +ScVbaMenus::ScVbaMenus( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< XCommandBarControls >& xCommandBarControls ) throw ( uno::RuntimeException ) : Menus_BASE( xParent, xContext, uno::Reference< container::XIndexAccess>() ), m_xCommandBarControls( xCommandBarControls ) +{ +} + +// XEnumerationAccess +uno::Type SAL_CALL +ScVbaMenus::getElementType() throw ( uno::RuntimeException ) +{ + return excel::XMenu::static_type( 0 ); +} + +uno::Reference< container::XEnumeration > +ScVbaMenus::createEnumeration() throw ( uno::RuntimeException ) +{ + uno::Reference< container::XEnumerationAccess > xEnumAccess( m_xCommandBarControls, uno::UNO_QUERY_THROW ); + return uno::Reference< container::XEnumeration >( new MenuEnumeration( this, mxContext, xEnumAccess->createEnumeration() ) ); +} + +uno::Any +ScVbaMenus::createCollectionObject( const uno::Any& aSource ) +{ + // make no sense + return aSource; +} + +sal_Int32 SAL_CALL +ScVbaMenus::getCount() throw(css::uno::RuntimeException) +{ + // FIXME: should check if it is a popup menu + return m_xCommandBarControls->getCount(); +} + +// ScVbaCollectionBaseImpl +uno::Any SAL_CALL +ScVbaMenus::Item( const uno::Any& aIndex, const uno::Any& /*aIndex2*/ ) throw( uno::RuntimeException ) +{ + uno::Reference< XCommandBarControl > xCommandBarControl( m_xCommandBarControls->Item( aIndex, uno::Any() ), uno::UNO_QUERY_THROW ); + if( xCommandBarControl->getType() != office::MsoControlType::msoControlPopup ) + throw uno::RuntimeException(); + return uno::makeAny( uno::Reference< excel::XMenu > ( new ScVbaMenu( this, mxContext, xCommandBarControl ) ) ); +} + +uno::Reference< excel::XMenu > SAL_CALL ScVbaMenus::Add( const rtl::OUString& Caption, const css::uno::Any& Before, const css::uno::Any& Restore ) throw (css::script::BasicErrorException, css::uno::RuntimeException) +{ + sal_Int32 nType = office::MsoControlType::msoControlPopup; + uno::Reference< XCommandBarControl > xCommandBarControl = m_xCommandBarControls->Add( uno::makeAny( nType ), uno::Any(), uno::Any(), Before, Restore ); + xCommandBarControl->setCaption( Caption ); + return uno::Reference< excel::XMenu >( new ScVbaMenu( this, mxContext, xCommandBarControl ) ); +} + +// XHelperInterface +rtl::OUString& +ScVbaMenus::getServiceImplName() +{ + static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaMenus") ); + return sImplName; +} +uno::Sequence<rtl::OUString> +ScVbaMenus::getServiceNames() +{ + static uno::Sequence< rtl::OUString > aServiceNames; + if ( aServiceNames.getLength() == 0 ) + { + aServiceNames.realloc( 1 ); + aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.Menus" ) ); + } + return aServiceNames; +} diff --git a/sc/source/ui/vba/vbamenus.hxx b/sc/source/ui/vba/vbamenus.hxx new file mode 100644 index 000000000000..4203cb19feac --- /dev/null +++ b/sc/source/ui/vba/vbamenus.hxx @@ -0,0 +1,60 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Novell Inc. + * Portions created by the Initial Developer are Copyright (C) 2010 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): Pei Feng Lin <pflin@novell.com> + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ +#ifndef SC_VBA_MENUS_HXX +#define SC_VBA_MENUS_HXX + +#include <ooo/vba/excel/XMenus.hpp> +#include <ooo/vba/excel/XMenu.hpp> +#include <ooo/vba/XCommandBarControls.hpp> +#include <vbahelper/vbahelperinterface.hxx> +#include <vbahelper/vbacollectionimpl.hxx> + +typedef CollTestImplHelper< ov::excel::XMenus > Menus_BASE; + +class ScVbaMenus : public Menus_BASE +{ +private: + css::uno::Reference< ov::XCommandBarControls > m_xCommandBarControls; + +public: + ScVbaMenus( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< ov::XCommandBarControls >& xCommandBarControls ) throw( css::uno::RuntimeException ); + + // XEnumerationAccess + virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException); + virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException); + virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); + + // Methods + virtual sal_Int32 SAL_CALL getCount() throw(css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index, const css::uno::Any& /*Index2*/ ) throw (css::uno::RuntimeException); + virtual css::uno::Reference< ov::excel::XMenu > SAL_CALL Add( const rtl::OUString& Caption, const css::uno::Any& Before, const css::uno::Any& Restore ) throw (css::script::BasicErrorException, css::uno::RuntimeException); + // XHelperInterface + virtual rtl::OUString& getServiceImplName(); + virtual css::uno::Sequence<rtl::OUString> getServiceNames(); +}; + +#endif//SC_VBA_MENUS_HXX diff --git a/sc/source/ui/vba/vbaname.cxx b/sc/source/ui/vba/vbaname.cxx index 464b167df250..71d42038f89b 100644 --- a/sc/source/ui/vba/vbaname.cxx +++ b/sc/source/ui/vba/vbaname.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -69,8 +70,8 @@ ScVbaName::getWorkSheet() throw (css::uno::RuntimeException) ScVbaName::getName() throw (css::uno::RuntimeException) { String sName; - sName += UniString( getWorkSheet()->getName()); - sName += String::CreateFromAscii("!"); + //sName += UniString( getWorkSheet()->getName()); //liuchen 2009-9-9 resolve the defect that the name get by macro code are not the same with that in UI (for example, if a name of "AA" is found in the UI "Define Names" dialog box, the result of get that name through macro code will be "Sheet1!AA") + //sName += String::CreateFromAscii("!"); sName += UniString ( mxNamedRange->getName() ); return ::rtl::OUString( sName ); } @@ -107,78 +108,41 @@ ScVbaName::setVisible( sal_Bool /*bVisible*/ ) throw (css::uno::RuntimeException ::rtl::OUString ScVbaName::getValue() throw (css::uno::RuntimeException) { - ::rtl::OUString sValue = mxNamedRange->getContent(); - ::rtl::OUString sSheetName = getWorkSheet()->getName(); - ::rtl::OUString sSegmentation = ::rtl::OUString::createFromAscii( ";" ); - ::rtl::OUString sNewSegmentation = ::rtl::OUString::createFromAscii( "," ); - ::rtl::OUString sResult; - sal_Int32 nFrom = 0; - sal_Int32 nTo = 0; - nTo = sValue.indexOf( sSegmentation, nFrom ); - while ( nTo != -1 ) - { - ::rtl::OUString sTmpValue = sValue.copy( nFrom, nTo - nFrom ); - if ( sTmpValue.toChar() == '$' ) - { - ::rtl::OUString sTmp = sTmpValue.copy( 1 ); - sTmp = sTmp.replaceAt(0, (sSheetName + ::rtl::OUString::createFromAscii(".")).getLength(), sSheetName + ::rtl::OUString::createFromAscii("!")); - sResult += sTmp; - sResult += sNewSegmentation; - } - nFrom = nTo + 1; - nTo = sValue.indexOf( sSegmentation, nFrom ); - } - ::rtl::OUString sTmpValue = sValue.copy( nFrom ); - if ( sTmpValue.toChar() == '$' ) + return getValue( formula::FormulaGrammar::GRAM_NATIVE_XL_A1 ); +} + +::rtl::OUString +ScVbaName::getValue(const formula::FormulaGrammar::Grammar eGrammar) throw (css::uno::RuntimeException) +{ + rtl::OUString sValue = mxNamedRange->getContent(); + ScDocShell* pDocShell = excel::getDocShell( mxModel ); + ScDocument* pDoc = pDocShell ? pDocShell->GetDocument() : NULL; + String aContent; + excel::CompileODFFormulaToExcel( pDoc, sValue, aContent, eGrammar ); + if ( aContent.Len() > 0 ) { - ::rtl::OUString sTmp = sTmpValue.copy(1); - sTmp = sTmp.replaceAt(0, (sSheetName + ::rtl::OUString::createFromAscii(".")).getLength(), sSheetName + ::rtl::OUString::createFromAscii("!")); - sResult += sTmp; + sValue = aContent; } - if (sResult.indexOf('=') != 0) + if ( sValue.indexOf('=') != 0 ) { - sResult = ::rtl::OUString::createFromAscii("=") + sResult; + sValue = rtl::OUString::createFromAscii("=") + sValue; } - return sResult; + return sValue; } void ScVbaName::setValue( const ::rtl::OUString & rValue ) throw (css::uno::RuntimeException) { - ::rtl::OUString sSheetName = getWorkSheet()->getName(); ::rtl::OUString sValue = rValue; - ::rtl::OUString sSegmentation = ::rtl::OUString::createFromAscii( "," ); - ::rtl::OUString sNewSegmentation = ::rtl::OUString::createFromAscii( ";" ); - ::rtl::OUString sResult; - sal_Int32 nFrom = 0; - sal_Int32 nTo = 0; - if (sValue.indexOf('=') == 0) + ScDocShell* pDocShell = excel::getDocShell( mxModel ); + ScDocument* pDoc = pDocShell ? pDocShell->GetDocument() : NULL; + String aContent; + excel::CompileExcelFormulaToODF( pDoc, sValue, aContent ); + if ( aContent.Len() > 0 ) { - ::rtl::OUString sTmp = sValue.copy(1); - sValue = sTmp; + sValue = aContent; } - nTo = sValue.indexOf( sSegmentation, nFrom ); - while ( nTo != -1 ) - { - ::rtl::OUString sTmpValue = sValue.copy( nFrom, nTo - nFrom ); - sTmpValue = sTmpValue.replaceAt(0, (sSheetName + ::rtl::OUString::createFromAscii("!")).getLength(), sSheetName + ::rtl::OUString::createFromAscii(".")); - if (sTmpValue.copy(0, sSheetName.getLength()).equals(sSheetName)) - { - sTmpValue = ::rtl::OUString::createFromAscii("$") + sTmpValue; - } - sTmpValue += sNewSegmentation; - sResult += sTmpValue; - nFrom = nTo + 1; - nTo = sValue.indexOf( sSegmentation, nFrom ); - } - ::rtl::OUString sTmpValue = sValue.copy( nFrom ); - sTmpValue = sTmpValue.replaceAt(0, (sSheetName + ::rtl::OUString::createFromAscii("!")).getLength(), sSheetName + ::rtl::OUString::createFromAscii(".")); - if (sTmpValue.copy(0, sSheetName.getLength()).equals(sSheetName)) - { - sTmpValue = ::rtl::OUString::createFromAscii("$") + sTmpValue; - } - sResult += sTmpValue; - mxNamedRange->setContent(sResult); + mxNamedRange->setContent( sValue ); } ::rtl::OUString @@ -208,7 +172,7 @@ ScVbaName::setRefersToLocal( const ::rtl::OUString & rRefersTo ) throw (css::uno ::rtl::OUString ScVbaName::getRefersToR1C1() throw (css::uno::RuntimeException) { - return getRefersTo(); + return getValue( formula::FormulaGrammar::GRAM_NATIVE_XL_R1C1 ); } void @@ -220,7 +184,7 @@ ScVbaName::setRefersToR1C1( const ::rtl::OUString & rRefersTo ) throw (css::uno: ::rtl::OUString ScVbaName::getRefersToR1C1Local() throw (css::uno::RuntimeException) { - return getRefersTo(); + return getValue( formula::FormulaGrammar::GRAM_NATIVE_XL_R1C1 ); } void @@ -267,3 +231,4 @@ ScVbaName::getServiceNames() return aServiceNames; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbaname.hxx b/sc/source/ui/vba/vbaname.hxx index 81b2555a4ce1..8e0aa3973aae 100644 --- a/sc/source/ui/vba/vbaname.hxx +++ b/sc/source/ui/vba/vbaname.hxx @@ -33,6 +33,8 @@ #include <vbahelper/vbahelperinterface.hxx> +#include <formula/grammar.hxx> + class ScDocument; typedef InheritedHelperInterfaceImpl1< ov::excel::XName > NameImpl_BASE; @@ -48,6 +50,8 @@ class ScVbaName : public NameImpl_BASE protected: virtual css::uno::Reference< css::frame::XModel > getModel() { return mxModel; } virtual css::uno::Reference< ov::excel::XWorksheet > getWorkSheet() throw (css::uno::RuntimeException); + // Get value by FormulaGrammar, such as FormulaGrammar::GRAM_NATIVE_XL_R1C1 + virtual ::rtl::OUString SAL_CALL getValue(const formula::FormulaGrammar::Grammar eGrammar) throw (css::uno::RuntimeException); public: ScVbaName( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::sheet::XNamedRange >& xName , const css::uno::Reference< css::sheet::XNamedRanges >& xNames , const css::uno::Reference< css::frame::XModel >& xModel ); diff --git a/sc/source/ui/vba/vbanames.cxx b/sc/source/ui/vba/vbanames.cxx index 9fd22bf89f7a..bee4fbb58856 100644 --- a/sc/source/ui/vba/vbanames.cxx +++ b/sc/source/ui/vba/vbanames.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -87,6 +88,33 @@ ScVbaNames::getScDocument() return pViewData->GetDocument(); } +void GetRangeOrRefersTo( const css::uno::Any& RefersTo, const uno::Reference< uno::XComponentContext >& xContext, css::uno::Reference< excel::XRange >& xRange, rtl::OUString& sRefersTo ) +{ + if ( RefersTo.getValueTypeClass() == uno::TypeClass_STRING ) + { + RefersTo >>= sRefersTo; + } + else if ( RefersTo.getValueTypeClass() == uno::TypeClass_INTERFACE ) + { + RefersTo >>= xRange; + } + else if ( RefersTo.hasValue() ) + { + uno::Reference< script::XTypeConverter > xConverter = getTypeConverter( xContext ); + try + { + if ( xConverter.is() ) + { + uno::Any aConverted = xConverter->convertTo( RefersTo, getCppuType((rtl::OUString*)0) ); + aConverted >>= sRefersTo; + } + } + catch( uno::Exception& ) + { + } + } +} + css::uno::Any ScVbaNames::Add( const css::uno::Any& Name , const css::uno::Any& RefersTo, @@ -100,8 +128,9 @@ ScVbaNames::Add( const css::uno::Any& Name , const css::uno::Any& RefersToR1C1, const css::uno::Any& RefersToR1C1Local ) throw (css::uno::RuntimeException) { - + rtl::OUString sSheetName; rtl::OUString sName; + rtl::OUString sRefersTo; uno::Reference< excel::XRange > xRange; if ( Name.hasValue() ) Name >>= sName; @@ -109,6 +138,12 @@ ScVbaNames::Add( const css::uno::Any& Name , NameLocal >>= sName; if ( sName.getLength() != 0 ) { + sal_Int32 nTokenIndex = sName.indexOf('!'); + if ( nTokenIndex >= 0 ) + { + sSheetName = sName.copy( 0, nTokenIndex ); + sName = sName.copy( nTokenIndex + 1 ); + } if ( !ScRangeData::IsNameValid( sName , getScDocument() ) ) { ::rtl::OUString sResult ; @@ -121,19 +156,22 @@ ScVbaNames::Add( const css::uno::Any& Name , sResult = sName.copy( nIndex ); sName = sResult ; if ( !ScRangeData::IsNameValid( sName , getScDocument() ) ) - throw uno::RuntimeException( rtl::OUString::createFromAscii("This Name is a valid ."), uno::Reference< uno::XInterface >() ); + throw uno::RuntimeException( rtl::OUString::createFromAscii("This Name is a invalid ."), uno::Reference< uno::XInterface >() ); } } if ( RefersTo.hasValue() || RefersToR1C1.hasValue() || RefersToR1C1Local.hasValue() ) { if ( RefersTo.hasValue() ) - RefersTo >>= xRange; + GetRangeOrRefersTo( RefersTo, mxContext, xRange, sRefersTo ); if ( RefersToR1C1.hasValue() ) - RefersToR1C1 >>= xRange; + GetRangeOrRefersTo( RefersToR1C1, mxContext, xRange, sRefersTo ); if ( RefersToR1C1Local.hasValue() ) - RefersToR1C1Local >>= xRange; + GetRangeOrRefersTo( RefersToR1C1Local, mxContext, xRange, sRefersTo ); } + String aContent; + table::CellAddress aPosition; + RangeType nType = RT_NAME; if ( xRange.is() ) { ScVbaRange* pRange = dynamic_cast< ScVbaRange* >( xRange.get() ); @@ -146,19 +184,36 @@ ScVbaNames::Add( const css::uno::Any& Name , ScAddress aPos( static_cast< SCCOL >( aAddr.StartColumn ) , static_cast< SCROW >( aAddr.StartRow ) , static_cast< SCTAB >(aAddr.Sheet ) ); uno::Any xAny2 ; String sRangeAdd = xRange->Address( xAny2, xAny2 , xAny2 , xAny2, xAny2 ); - String sTmp; - sTmp += String::CreateFromAscii("$"); - sTmp += UniString(xRange->getWorksheet()->getName()); - sTmp += String::CreateFromAscii("."); - sTmp += sRangeAdd; - if ( mxNames.is() ) + aContent += String::CreateFromAscii("$"); + aContent += UniString(xRange->getWorksheet()->getName()); + aContent += String::CreateFromAscii("."); + aContent += sRangeAdd; + aPosition = table::CellAddress( aAddr.Sheet , aAddr.StartColumn , aAddr.StartRow ); + } + else + { + ScDocShell* pDocShell = excel::getDocShell( mxModel ); + ScDocument* pDoc = pDocShell ? pDocShell->GetDocument() : NULL; + excel::CompileExcelFormulaToODF( pDoc, sRefersTo, aContent ); + if ( aContent.Len() == 0 ) + { + aContent = sRefersTo; + } + } + + uno::Reference< sheet::XNamedRange > xNewNamedRange; + if ( mxNames.is() ) + { + if ( mxNames->hasByName( sName ) ) { - RangeType nType = RT_NAME; - table::CellAddress aCellAddr( aAddr.Sheet , aAddr.StartColumn , aAddr.StartRow ); - if ( mxNames->hasByName( sName ) ) - mxNames->removeByName(sName); - mxNames->addNewByName( sName , rtl::OUString(sTmp) , aCellAddr , (sal_Int32)nType); + mxNames->removeByName( sName ); } + mxNames->addNewByName( sName, rtl::OUString( aContent ), aPosition, (sal_Int32) nType ); + xNewNamedRange = uno::Reference< sheet::XNamedRange >( mxNames->getByName( sName ), uno::UNO_QUERY ); + } + if ( xNewNamedRange.is() ) + { + return uno::makeAny( uno::Reference< excel::XName >( new ScVbaName( mxParent, mxContext, xNewNamedRange ,mxNames , mxModel ) ) ); } return css::uno::Any(); } @@ -204,3 +259,4 @@ ScVbaNames::getServiceNames() } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbaoleobject.cxx b/sc/source/ui/vba/vbaoleobject.cxx index a35ce4b3120f..ebf87bf5275d 100644 --- a/sc/source/ui/vba/vbaoleobject.cxx +++ b/sc/source/ui/vba/vbaoleobject.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -67,7 +68,7 @@ ScVbaOLEObject::ScVbaOLEObject( const uno::Reference< XHelperInterface >& xParen uno::Reference< uno::XInterface > SAL_CALL ScVbaOLEObject::getObject() throw (uno::RuntimeException) { - return uno::Reference< uno::XInterface >( m_xControlShape, uno::UNO_QUERY_THROW ); + return uno::Reference< uno::XInterface >( m_xControl, uno::UNO_QUERY_THROW ); } sal_Bool SAL_CALL @@ -162,3 +163,5 @@ ScVbaOLEObject::getServiceNames() } return aServiceNames; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbaoleobjects.cxx b/sc/source/ui/vba/vbaoleobjects.cxx index 69ba36cf8279..84cba7b96e92 100644 --- a/sc/source/ui/vba/vbaoleobjects.cxx +++ b/sc/source/ui/vba/vbaoleobjects.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -183,3 +184,5 @@ ScVbaOLEObjects::getServiceNames() } return aServiceNames; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbaoutline.cxx b/sc/source/ui/vba/vbaoutline.cxx index ee4c78c73151..b42d81052d15 100644 --- a/sc/source/ui/vba/vbaoutline.cxx +++ b/sc/source/ui/vba/vbaoutline.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -63,3 +64,5 @@ ScVbaOutline::getServiceNames() } return aServiceNames; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbapagebreak.cxx b/sc/source/ui/vba/vbapagebreak.cxx index 1103c10f54c8..8c28aada76f4 100644 --- a/sc/source/ui/vba/vbapagebreak.cxx +++ b/sc/source/ui/vba/vbapagebreak.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -170,3 +171,4 @@ ScVbaVPageBreak::getServiceNames() return aServiceNames; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbapagebreaks.cxx b/sc/source/ui/vba/vbapagebreaks.cxx index 25ccbb0f4cdc..e6c83ed618c7 100644 --- a/sc/source/ui/vba/vbapagebreaks.cxx +++ b/sc/source/ui/vba/vbapagebreaks.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -115,10 +116,13 @@ sal_Int32 SAL_CALL RangePageBreaks::getCount( ) throw (uno::RuntimeException) for( sal_Int32 i=0; i<nLength; i++ ) { sal_Int32 nPos = aTablePageBreakData[i].Position; - if( nPos > nUsedEnd ) - return nCount; - if( nPos >= nUsedStart ) + + // VBA. minz@cn.ibm.com. All page breaks before the used range should be counted. + // And the page break at the end of the used range also should be counted. + if( nPos <= nUsedEnd + 1 ) nCount++; + else + return nCount; } return nCount; @@ -144,26 +148,15 @@ uno::Any SAL_CALL RangePageBreaks::getByIndex( sal_Int32 Index ) throw (lang::In sheet::TablePageBreakData RangePageBreaks::getTablePageBreakData( sal_Int32 nAPIItemIndex ) throw ( script::BasicErrorException, uno::RuntimeException) { - sal_Int32 index = -1; sheet::TablePageBreakData aTablePageBreakData; uno::Reference< excel::XWorksheet > xWorksheet( mxParent, uno::UNO_QUERY_THROW ); uno::Reference< excel::XRange > xRange = xWorksheet->getUsedRange(); - sal_Int32 nUsedStart = getAPIStartofRange( xRange ); - sal_Int32 nUsedEnd = getAPIEndIndexofRange( xRange, nUsedStart ); uno::Sequence<sheet::TablePageBreakData> aTablePageBreakDataList = getAllPageBreaks(); sal_Int32 nLength = aTablePageBreakDataList.getLength(); - for( sal_Int32 i=0; i<nLength; i++ ) - { - aTablePageBreakData = aTablePageBreakDataList[i]; - sal_Int32 nPos = aTablePageBreakData.Position; - if( nPos >= nUsedStart ) - index++; - if( nPos > nUsedEnd ) - DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString()); - if( index == nAPIItemIndex ) - return aTablePageBreakData; - } + //VBA. minz@cn.ibm.com. No need to filter the page break. All page breaks before the used range are counted. + if ( nAPIItemIndex < nLength && nAPIItemIndex>=0 ) + aTablePageBreakData = aTablePageBreakDataList[nAPIItemIndex]; return aTablePageBreakData; } @@ -325,3 +318,4 @@ ScVbaVPageBreaks::getServiceNames() return aServiceNames; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbapagesetup.cxx b/sc/source/ui/vba/vbapagesetup.cxx index d660ddbbfd77..3b1a8ae9a3cd 100644 --- a/sc/source/ui/vba/vbapagesetup.cxx +++ b/sc/source/ui/vba/vbapagesetup.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -37,6 +38,9 @@ #include <ooo/vba/excel/XlPageOrientation.hpp> #include <ooo/vba/excel/XlOrder.hpp> #include <ooo/vba/excel/Constants.hpp> +#include <i18npool/paper.hxx> +#include <editeng/paperinf.hxx> +#include <ooo/vba/excel/XlPaperSize.hpp> using namespace ::com::sun::star; using namespace ::ooo::vba; @@ -624,3 +628,106 @@ ScVbaPageSetup::getServiceNames() } return aServiceNames; } + +//liuchen 2009-12-11 + +struct PaperSizeMap +{ + Paper ePaper; + sal_Int32 xlPaper; +}; + +static PaperSizeMap paperSizeMappings[] = +{ + { PAPER_A3, ooo::vba::excel::XlPaperSize::xlPaperA3 }, + { PAPER_A4, ooo::vba::excel::XlPaperSize::xlPaperA4 }, + { PAPER_A5, ooo::vba::excel::XlPaperSize::xlPaperA5 }, + { PAPER_B4_ISO, ooo::vba::excel::XlPaperSize::xlPaperB4 }, + { PAPER_B5_ISO, ooo::vba::excel::XlPaperSize::xlPaperB5 }, + { PAPER_LETTER, ooo::vba::excel::XlPaperSize::xlPaperLetter }, + { PAPER_LEGAL, ooo::vba::excel::XlPaperSize::xlPaperLegal }, + { PAPER_TABLOID, ooo::vba::excel::XlPaperSize::xlPaperTabloid }, + { PAPER_USER, ooo::vba::excel::XlPaperSize::xlPaperUser }, + { PAPER_B6_ISO, ooo::vba::excel::XlPaperSize::xlPaperEnvelopeB6 }, + { PAPER_ENV_C4, ooo::vba::excel::XlPaperSize::xlPaperEnvelopeC4 }, + { PAPER_ENV_C5, ooo::vba::excel::XlPaperSize::xlPaperEnvelopeC5 }, + { PAPER_ENV_C6, ooo::vba::excel::XlPaperSize::xlPaperEnvelopeC6 }, + { PAPER_ENV_C65, ooo::vba::excel::XlPaperSize::xlPaperEnvelopeC65 }, + { PAPER_ENV_DL, ooo::vba::excel::XlPaperSize::xlPaperEnvelopeDL }, + { PAPER_C, ooo::vba::excel::XlPaperSize::xlPaperCsheet }, + { PAPER_D, ooo::vba::excel::XlPaperSize::xlPaperDsheet }, + { PAPER_E, ooo::vba::excel::XlPaperSize::xlPaperEsheet }, + { PAPER_ENV_MONARCH, ooo::vba::excel::XlPaperSize::xlPaperEnvelopeMonarch }, + { PAPER_ENV_PERSONAL, ooo::vba::excel::XlPaperSize::xlPaperEnvelopePersonal }, + { PAPER_ENV_9, ooo::vba::excel::XlPaperSize::xlPaperEnvelope9 }, + { PAPER_ENV_10, ooo::vba::excel::XlPaperSize::xlPaperEnvelope10 }, + { PAPER_ENV_11, ooo::vba::excel::XlPaperSize::xlPaperEnvelope11 }, + { PAPER_ENV_12, ooo::vba::excel::XlPaperSize::xlPaperEnvelope12 } +}; + +static const int nMapSize = sizeof(paperSizeMappings) / sizeof(paperSizeMappings[0]); + +sal_Int32 PaperSizeOOoToExcel(Paper ePaper) +{ + sal_Int32 nPaperSize = ooo::vba::excel::XlPaperSize::xlPaperUser; + + for (int i = 0; i < nMapSize; i++) + { + if (ePaper == paperSizeMappings[i].ePaper) + { + nPaperSize = paperSizeMappings[i].xlPaper; + break; + } + } + + return nPaperSize; +} + +sal_Int32 SAL_CALL ScVbaPageSetup::getPaperSize() throw (css::uno::RuntimeException) +{ + com::sun::star::awt::Size size; + Paper ePaper = PAPER_USER; + + try + { + uno::Any aValue = mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Size"))); + aValue >>= size; + ePaper = SvxPaperInfo::GetSvxPaper( Size(size.Width, size.Height), MAP_100TH_MM, TRUE); + } + catch( uno::Exception& ) + { + } + + return PaperSizeOOoToExcel(ePaper); +} + +Paper PaperSizeExcelToOOo( sal_Int32 xlPaper) +{ + Paper ePaper = PAPER_USER; + + for (int i = 0; i < nMapSize; i++) + { + if (xlPaper == paperSizeMappings[i].xlPaper) + { + ePaper = paperSizeMappings[i].ePaper; + break; + } + } + + return ePaper; +} +void SAL_CALL ScVbaPageSetup::setPaperSize( sal_Int32 paperSize) throw (css::uno::RuntimeException) +{ + Paper ePaper = PaperSizeExcelToOOo( paperSize ); + + try + { + Size size1 = SvxPaperInfo::GetPaperSize( ePaper, MAP_100TH_MM ); + com::sun::star::awt::Size size(size1.Width(), size1.Height()); + mxPageProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Size")), uno::makeAny( size )); + } + catch( uno::Exception& ) + { + } +} +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbapagesetup.hxx b/sc/source/ui/vba/vbapagesetup.hxx index d2c001b225cf..f81ad5a7a29a 100644 --- a/sc/source/ui/vba/vbapagesetup.hxx +++ b/sc/source/ui/vba/vbapagesetup.hxx @@ -82,6 +82,8 @@ public: virtual void SAL_CALL setCenterHorizontally( sal_Bool centerHorizontally ) throw (css::uno::RuntimeException); virtual sal_Bool SAL_CALL getPrintHeadings() throw (css::uno::RuntimeException); virtual void SAL_CALL setPrintHeadings( sal_Bool printHeadings ) throw (css::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getPaperSize() throw (css::uno::RuntimeException); //liuchen 2009-12-11 + virtual void SAL_CALL setPaperSize( sal_Int32 paperSize ) throw (css::uno::RuntimeException); //liuchen 2009-12-11 // XHelperInterface virtual rtl::OUString& getServiceImplName(); diff --git a/sc/source/ui/vba/vbapalette.cxx b/sc/source/ui/vba/vbapalette.cxx index d49ea47b5e4f..209dd2d8e564 100644 --- a/sc/source/ui/vba/vbapalette.cxx +++ b/sc/source/ui/vba/vbapalette.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -111,3 +112,5 @@ ScVbaPalette::getPalette() const return new DefaultPalette(); return xIndex; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbapane.cxx b/sc/source/ui/vba/vbapane.cxx index 29d7a286b402..e034ffeead41 100644 --- a/sc/source/ui/vba/vbapane.cxx +++ b/sc/source/ui/vba/vbapane.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -204,3 +205,5 @@ ScVbaPane::LargeScroll( const uno::Any& Down, const uno::Any& Up, const uno::Any // XHelperInterface VBAHELPER_IMPL_XHELPERINTERFACE( ScVbaPane, "ooo.vba.excel.Pane" ) + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbapivotcache.cxx b/sc/source/ui/vba/vbapivotcache.cxx index 322b42368b48..7b2b4c6ddf61 100644 --- a/sc/source/ui/vba/vbapivotcache.cxx +++ b/sc/source/ui/vba/vbapivotcache.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -34,6 +35,17 @@ ScVbaPivotCache::ScVbaPivotCache( const uno::Reference< XHelperInterface >& xPar { } +sal_Int32 +ScVbaPivotCache::getMissingItemsLimit() throw (css::uno::RuntimeException) +{ + return -1; +} + +void +ScVbaPivotCache::setMissingItemsLimit( sal_Int32 /*aValue*/ ) throw ( css::uno::RuntimeException) +{ +} + void SAL_CALL ScVbaPivotCache::Refresh() throw (css::uno::RuntimeException) { @@ -58,3 +70,4 @@ ScVbaPivotCache::getServiceNames() return aServiceNames; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbapivotcache.hxx b/sc/source/ui/vba/vbapivotcache.hxx index dea3e35d18bd..3b88fe311f33 100644 --- a/sc/source/ui/vba/vbapivotcache.hxx +++ b/sc/source/ui/vba/vbapivotcache.hxx @@ -40,6 +40,10 @@ class ScVbaPivotCache : public PivotCacheImpl_BASE css::uno::Reference< css::sheet::XDataPilotTable > m_xTable; public: ScVbaPivotCache( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::sheet::XDataPilotTable >& xTable ); + + virtual ::sal_Int32 SAL_CALL getMissingItemsLimit() throw (css::uno::RuntimeException); + virtual void SAL_CALL setMissingItemsLimit( ::sal_Int32 aValue ) throw ( css::uno::RuntimeException); + virtual void SAL_CALL Refresh() throw (css::uno::RuntimeException); // XHelperInterface virtual rtl::OUString& getServiceImplName(); diff --git a/sc/source/ui/vba/vbapivottable.cxx b/sc/source/ui/vba/vbapivottable.cxx index e5d78602dcdd..cffd07eeb5e1 100644 --- a/sc/source/ui/vba/vbapivottable.cxx +++ b/sc/source/ui/vba/vbapivottable.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -61,3 +62,5 @@ ScVbaPivotTable::getServiceNames() } return aServiceNames; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbapivottables.cxx b/sc/source/ui/vba/vbapivottables.cxx index fcbf347a3cd4..b7e090d1a841 100644 --- a/sc/source/ui/vba/vbapivottables.cxx +++ b/sc/source/ui/vba/vbapivottables.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -92,3 +93,5 @@ ScVbaPivotTables::getServiceNames() } return sNames; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbapropvalue.cxx b/sc/source/ui/vba/vbapropvalue.cxx index ff821d17f479..2fdbd16195fe 100644 --- a/sc/source/ui/vba/vbapropvalue.cxx +++ b/sc/source/ui/vba/vbapropvalue.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -43,3 +44,5 @@ ScVbaPropValue::setValue( const css::uno::Any& _value ) throw (css::uno::Runtime { m_pListener->setValueEvent( _value ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbaquerytable.cxx b/sc/source/ui/vba/vbaquerytable.cxx new file mode 100644 index 000000000000..d08fd302b2a8 --- /dev/null +++ b/sc/source/ui/vba/vbaquerytable.cxx @@ -0,0 +1,87 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright IBM Corporation 2009, 2010. + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "vbaquerytable.hxx" +#include "document.hxx" +#include "docsh.hxx" +#include "sfx2/lnkbase.hxx" +#include "sfx2/linkmgr.hxx" +#include "arealink.hxx" +#include "vbarange.hxx" + +using namespace com::sun::star; + + +ScVbaQueryTable::ScVbaQueryTable(const css::uno::Reference< ov::XHelperInterface >& xParent, + const css::uno::Reference< css::uno::XComponentContext > & xContext, + ScDocument *pDocument , + ScVbaRange *pParent + ) +//:QueryTable_Base(xParent, xContext) +{ + m_pDocument = pDocument; + m_pParent = pParent; +} + +ScVbaQueryTable::~ScVbaQueryTable() +{ + +} + +::sal_Bool SAL_CALL +ScVbaQueryTable::Refresh( const ::com::sun::star::uno::Any& aBackgroundQuery ) throw (::com::sun::star::uno::RuntimeException) +{ + + //Get parent Info + sal_Int32 nRow = m_pParent->getRow(); + sal_Int32 nClm = m_pParent->getColumn(); + sal_Int16 nTab = m_pParent->getWorksheet()->getIndex() - 1; //The vba index begin from 1. + ScAddress crrRngAddr(nClm, nRow, nTab); + + //Get link info + sfx2::LinkManager *pLinkMng = m_pDocument->GetLinkManager(); + const ::sfx2::SvBaseLinks &rLinks = pLinkMng->GetLinks(); + USHORT nCount = rLinks.Count(); + + for (USHORT i=0; i<nCount; i++) + { + ::sfx2::SvBaseLink* pBase = *rLinks[i]; + if (pBase->ISA(ScAreaLink)) + { + + ScAreaLink *pAreaLink = (ScAreaLink *)pBase; + const ScRange &destRange = pAreaLink->GetDestArea(); + if (destRange.In(crrRngAddr)) + { + pBase->Update(); + } + } + } + + return sal_True; +} diff --git a/sc/source/ui/vba/vbaquerytable.hxx b/sc/source/ui/vba/vbaquerytable.hxx new file mode 100644 index 000000000000..bf3ef4da4aa7 --- /dev/null +++ b/sc/source/ui/vba/vbaquerytable.hxx @@ -0,0 +1,59 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright IBM Corporation 2009, 2010. + * 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_VBA_QUERYTABLE_HXX +#define SC_VBA_QUERYTABLE_HXX + + +#include <ooo/vba/excel/XQueryTable.hpp> +#include "vbahelper/vbahelperinterface.hxx" + +using namespace ::ooo::vba; +typedef ::cppu::WeakImplHelper1<excel::XQueryTable> QueryTable_Base; + +class ScDocument; +class ScVbaRange; + +class ScVbaQueryTable : public QueryTable_Base +{ +private: + ScDocument *m_pDocument; + ScVbaRange *m_pParent; +public: + ScVbaQueryTable(const css::uno::Reference< ov::XHelperInterface >& xParent, + const css::uno::Reference< css::uno::XComponentContext > & xContext, + ScDocument *pDocument = NULL, + ScVbaRange *pParent = NULL + ); + ~ScVbaQueryTable(); + virtual ::sal_Bool SAL_CALL Refresh( const ::com::sun::star::uno::Any& aBackgroundQuery ) + throw (::com::sun::star::uno::RuntimeException); + +}; + +#endif diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx index 0724541278fa..c9dce622bf36 100644 --- a/sc/source/ui/vba/vbarange.cxx +++ b/sc/source/ui/vba/vbarange.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -43,7 +44,6 @@ #include <com/sun/star/text/XTextRange.hpp> #include <com/sun/star/sheet/XCellRangeAddressable.hpp> #include <com/sun/star/table/CellRangeAddress.hpp> -#include <com/sun/star/table/CellAddress.hpp> #include <com/sun/star/sheet/XSpreadsheetView.hpp> #include <com/sun/star/sheet/XCellRangeReferrer.hpp> #include <com/sun/star/sheet/XSheetCellRange.hpp> @@ -51,6 +51,7 @@ #include <com/sun/star/sheet/XSheetCellCursor.hpp> #include <com/sun/star/sheet/XArrayFormulaRange.hpp> #include <com/sun/star/sheet/XNamedRange.hpp> +#include <com/sun/star/sheet/XNamedRanges.hpp> #include <com/sun/star/sheet/XPrintAreas.hpp> #include <com/sun/star/sheet/XCellRangesQuery.hpp> #include <com/sun/star/beans/XPropertySet.hpp> @@ -91,6 +92,15 @@ #include <com/sun/star/sheet/XSubTotalDescriptor.hpp> #include <com/sun/star/sheet/GeneralFunction.hdl> +#include <com/sun/star/sheet/XSheetAnnotationsSupplier.hpp> +#include <com/sun/star/sheet/XSheetAnnotations.hpp> + +#include <com/sun/star/sheet/XDataPilotTable.hpp> +#include <com/sun/star/sheet/XDataPilotTable2.hpp> +#include <com/sun/star/sheet/XDataPilotTablesSupplier.hpp> +#include <com/sun/star/sheet/DataPilotTablePositionData.hpp> +#include <com/sun/star/sheet/DataPilotTablePositionType.hpp> + #include <ooo/vba/excel/XlPasteSpecialOperation.hpp> #include <ooo/vba/excel/XlPasteType.hpp> #include <ooo/vba/excel/Constants.hpp> @@ -116,12 +126,15 @@ #include <ooo/vba/excel/XlSpecialCellsValue.hpp> #include <ooo/vba/excel/XlConsolidationFunction.hpp> #include <ooo/vba/excel/XlSearchDirection.hpp> +#include <ooo/vba/excel/XlColumnDataType.hpp> +#include <ooo/vba/excel/XlFilterAction.hpp> #include <scitems.hxx> #include <svl/srchitem.hxx> #include <cellsuno.hxx> #include <dbcolect.hxx> #include "docfunc.hxx" +#include <docuno.hxx> #include <sfx2/dispatch.hxx> #include <sfx2/app.hxx> @@ -132,6 +145,7 @@ #include <sc.hrc> #include <globstr.hrc> #include <unonames.hxx> +#include <tools/stream.hxx> #include "vbarange.hxx" #include "vbafont.hxx" @@ -143,8 +157,13 @@ #include "vbavalidation.hxx" #include "vbahyperlinks.hxx" +#include "vbapivottable.hxx" + +#include "asciiopt.hxx" +#include "impex.hxx" #include "tabvwsh.hxx" #include "rangelst.hxx" +#include "rangenam.hxx" #include "convuno.hxx" #include "compiler.hxx" #include "attrib.hxx" @@ -158,6 +177,8 @@ #include "vbaglobals.hxx" #include "vbastyle.hxx" +#include "vbaname.hxx" +#include "vbanames.hxx" #include <vector> #include <vbahelper/vbacollectionimpl.hxx> // begin test includes @@ -362,55 +383,6 @@ ScVbaRangeAreas::createCollectionObject( const uno::Any& aSource ) return lcl_makeRange( mxParent, mxContext, aSource, mbIsRows, mbIsColumns ); } -// assume that xIf is infact a ScCellRangesBase -ScDocShell* -getDocShellFromIf( const uno::Reference< uno::XInterface >& xIf ) throw ( uno::RuntimeException ) -{ - ScCellRangesBase* pUno = ScCellRangesBase::getImplementation( xIf ); - if ( !pUno ) - throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Failed to access underlying uno range object" ) ), uno::Reference< uno::XInterface >() ); - return pUno->GetDocShell(); -} - -ScDocShell* -getDocShellFromRange( const uno::Reference< table::XCellRange >& xRange ) throw ( uno::RuntimeException ) -{ - // need the ScCellRangesBase to get docshell - uno::Reference< uno::XInterface > xIf( xRange, uno::UNO_QUERY_THROW ); - return getDocShellFromIf(xIf ); -} - -ScDocShell* -getDocShellFromRanges( const uno::Reference< sheet::XSheetCellRangeContainer >& xRanges ) throw ( uno::RuntimeException ) -{ - // need the ScCellRangesBase to get docshell - uno::Reference< uno::XInterface > xIf( xRanges, uno::UNO_QUERY_THROW ); - return getDocShellFromIf(xIf ); -} - -uno::Reference< frame::XModel > getModelFromXIf( const uno::Reference< uno::XInterface >& xIf ) throw ( uno::RuntimeException ) -{ - ScDocShell* pDocShell = getDocShellFromIf(xIf ); - return pDocShell->GetModel(); -} - -uno::Reference< frame::XModel > getModelFromRange( const uno::Reference< table::XCellRange >& xRange ) throw ( uno::RuntimeException ) -{ - uno::Reference< uno::XInterface > xIf( xRange, uno::UNO_QUERY_THROW ); - return getModelFromXIf( xIf ); -} - -ScDocument* -getDocumentFromRange( const uno::Reference< table::XCellRange >& xRange ) -{ - ScDocShell* pDocShell = getDocShellFromRange( xRange ); - if ( !pDocShell ) - throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Failed to access underlying docshell from uno range object" ) ), uno::Reference< uno::XInterface >() ); - ScDocument* pDoc = pDocShell->GetDocument(); - return pDoc; -} - - ScDocument* ScVbaRange::getScDocument() throw (uno::RuntimeException) { @@ -418,9 +390,9 @@ ScVbaRange::getScDocument() throw (uno::RuntimeException) { uno::Reference< container::XIndexAccess > xIndex( mxRanges, uno::UNO_QUERY_THROW ); uno::Reference< table::XCellRange > xRange( xIndex->getByIndex( 0 ), uno::UNO_QUERY_THROW ); - return getDocumentFromRange( xRange ); + return excel::GetDocumentFromRange( xRange ); } - return getDocumentFromRange( mxRange ); + return excel::GetDocumentFromRange( mxRange ); } ScDocShell* @@ -430,9 +402,9 @@ ScVbaRange::getScDocShell() throw (uno::RuntimeException) { uno::Reference< container::XIndexAccess > xIndex( mxRanges, uno::UNO_QUERY_THROW ); uno::Reference< table::XCellRange > xRange( xIndex->getByIndex( 0 ), uno::UNO_QUERY_THROW ); - return getDocShellFromRange( xRange ); + return excel::GetDocShellFromRange( xRange ); } - return getDocShellFromRange( mxRange ); + return excel::GetDocShellFromRange( mxRange ); } /*static*/ ScVbaRange* ScVbaRange::getImplementation( const uno::Reference< excel::XRange >& rxRange ) @@ -478,7 +450,7 @@ class NumFormatHelper public: NumFormatHelper( const uno::Reference< table::XCellRange >& xRange ) { - mxSupplier.set( getModelFromRange( xRange ), uno::UNO_QUERY_THROW ); + mxSupplier.set( excel::GetModelFromRange( xRange ), uno::UNO_QUERY_THROW ); mxRangeProps.set( xRange, uno::UNO_QUERY_THROW); mxFormats = mxSupplier->getNumberFormats(); } @@ -743,7 +715,15 @@ CellValueSetter::processValue( const uno::Any& aValue, const uno::Reference< tab { double nDouble = 0.0; if ( aValue >>= nDouble ) + { xCell->setValue( nDouble ); + uno::Reference< table::XCellRange > xRange( xCell, uno::UNO_QUERY_THROW ); + NumFormatHelper cellNumFormat( xRange ); + if ( cellNumFormat.isBooleanType() ) + { + cellNumFormat.setNumberFormat( util::NumberFormat::NUMBER ); + } + } else isExtracted = false; break; @@ -837,9 +817,10 @@ protected: double aDblValue = 0.0; if ( aValue >>= sFormula ) { - // convert to CONV_OOO style formula string because XCell::setFormula - // always compile it in CONV_OOO style. Perhaps css.sheet.FormulaParser - // should be used in future to directly pass formula tokens. + // convert to GRAM_PODF_A1 style grammar because XCell::setFormula + // always compile it in that grammar. Perhaps + // css.sheet.FormulaParser should be used in future to directly + // pass formula tokens when that API stabilizes. if ( m_eGrammar != formula::FormulaGrammar::GRAM_PODF_A1 && ( sFormula.trim().indexOf('=') == 0 ) ) { uno::Reference< uno::XInterface > xIf( xCell, uno::UNO_QUERY_THROW ); @@ -1100,7 +1081,7 @@ public: }; bool -getCellRangesForAddress( USHORT& rResFlags, const rtl::OUString& sAddress, ScDocShell* pDocSh, ScRangeList& rCellRanges, formula::FormulaGrammar::AddressConvention& eConv ) +getCellRangesForAddress( USHORT& rResFlags, const rtl::OUString& sAddress, ScDocShell* pDocSh, ScRangeList& rCellRanges, formula::FormulaGrammar::AddressConvention& eConv, char cDelimiter = 0 ) { ScDocument* pDoc = NULL; @@ -1109,7 +1090,7 @@ getCellRangesForAddress( USHORT& rResFlags, const rtl::OUString& sAddress, ScDoc pDoc = pDocSh->GetDocument(); String aString(sAddress); USHORT nMask = SCA_VALID; - rResFlags = rCellRanges.Parse( sAddress, pDoc, nMask, eConv, 0 ); + rResFlags = rCellRanges.Parse( sAddress, pDoc, nMask, eConv, cDelimiter ); if ( rResFlags & SCA_VALID ) { return true; @@ -1144,6 +1125,25 @@ bool getScRangeListForAddress( const rtl::OUString& sName, ScDocShell* pDocSh, S formula::FormulaGrammar::AddressConvention eConv = aConv; // spaces are illegal ( but the user of course can enter them ) rtl::OUString sAddress = (*it).trim(); + // if a local name ( on the active sheet ) exists this will + // take precedence over a global with the same name + if ( !xNameAccess->hasByName( sAddress ) && pDocSh ) + { + // try a local name + ScDocument* pDoc = pDocSh->GetDocument(); + SCTAB nCurTab = pDocSh->GetCurTab(); + if ( pDoc ) + { + NameToNameMap* pMap = pDoc->GetLocalNameMap( nCurTab ); + if ( pMap ) + { + NameToNameMap::iterator itTmp = pMap->find( sAddress ); + if ( itTmp != pMap->end() ) // found a mapping + sAddress = itTmp->second; + } + } + } + char aChar = 0; if ( xNameAccess->hasByName( sAddress ) ) { uno::Reference< sheet::XNamedRange > xNamed( xNameAccess->getByName( sAddress ), uno::UNO_QUERY_THROW ); @@ -1151,10 +1151,11 @@ bool getScRangeListForAddress( const rtl::OUString& sName, ScDocShell* pDocSh, S // As the address comes from OOO, the addressing // style is may not be XL_A1 eConv = pDocSh->GetDocument()->GetAddressConvention(); + aChar = ';'; } USHORT nFlags = 0; - if ( !getCellRangesForAddress( nFlags, sAddress, pDocSh, aCellRanges, eConv ) ) + if ( !getCellRangesForAddress( nFlags, sAddress, pDocSh, aCellRanges, eConv, aChar ) ) return false; bool bTabFromReferrer = !( nFlags & SCA_TAB_3D ); @@ -1248,7 +1249,7 @@ uno::Reference< sheet::XSheetCellRangeContainer > lclExpandToMerged( const uno:: ScUnoConversion::FillScRange( aScRange, aRangeAddr ); aScRanges.Append( aScRange ); } - return new ScCellRangesObj( getDocShellFromRanges( rxCellRanges ), aScRanges ); + return new ScCellRangesObj( excel::GetDocShellFromRanges( rxCellRanges ), aScRanges ); } void lclExpandAndMerge( const uno::Reference< table::XCellRange >& rxCellRange, bool bMerge ) throw (uno::RuntimeException) @@ -1294,7 +1295,7 @@ util::TriState lclGetMergedState( const uno::Reference< table::XCellRange >& rxC of a merged range is part of this range are not covered. */ ScRange aScRange; ScUnoConversion::FillScRange( aScRange, aRangeAddr ); - bool bHasMerged = getDocumentFromRange( rxCellRange )->HasAttrib( aScRange, HASATTR_MERGED | HASATTR_OVERLAPPED ); + bool bHasMerged = excel::GetDocumentFromRange( rxCellRange )->HasAttrib( aScRange, HASATTR_MERGED | HASATTR_OVERLAPPED ); return bHasMerged ? util::TriState_INDETERMINATE : util::TriState_NO; } @@ -1311,6 +1312,28 @@ ScVbaRange::getRangeObjectForName( return getRangeForName( xContext, sRangeName, pDocSh, refAddr, eConv ); } +table::CellAddress ScVbaRange::getLeftUpperCellAddress() +{ + table::CellAddress aCellAddress; + uno::Reference< table::XCellRange > xCellRange = mxRange; + if ( mxRanges.is() && m_Areas.is() && m_Areas->getCount() > 1 ) + { + uno::Reference< container::XIndexAccess > xIndex( mxRanges, uno::UNO_QUERY ); + if ( xIndex.is() && xIndex->getCount() > 0 ) + { + xCellRange.set( xIndex->getByIndex( 0 ), uno::UNO_QUERY ); + } + } + if ( xCellRange.is() ) + { + uno::Reference< sheet::XCellAddressable > xCellAddr( xCellRange->getCellByPosition( 0, 0 ), uno::UNO_QUERY ); + if ( xCellAddr.is() ) + { + aCellAddress = xCellAddr->getCellAddress(); + } + } + return aCellAddress; +} table::CellRangeAddress getCellRangeAddressForVBARange( const uno::Any& aParam, ScDocShell* pDocSh, formula::FormulaGrammar::AddressConvention aConv = formula::FormulaGrammar::CONV_XL_A1) throw ( uno::RuntimeException ) { @@ -1338,7 +1361,14 @@ table::CellRangeAddress getCellRangeAddressForVBARange( const uno::Any& aParam, uno::Reference< excel::XRange > xRange; aParam >>= xRange; if ( xRange.is() ) + { + ScVbaRange* pRange = dynamic_cast< ScVbaRange* >( xRange.get() ); + if ( pRange && pDocSh && pRange->getScDocument() != pDocSh->GetDocument() ) + { + throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Invalid range" ) ), uno::Reference< uno::XInterface >() ); + } xRange->getCellRange() >>= xRangeParam; + } break; } default: @@ -1351,7 +1381,7 @@ 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 ); - ScDocument* pDoc = getDocumentFromRange(xRange); + ScDocument* pDoc = excel::GetDocumentFromRange(xRange); if ( !pDoc ) throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Failed to access document from shell" ) ), uno::Reference< uno::XInterface >() ); ScVbaPalette aPalette( pDoc->GetDocumentShell() ); @@ -1359,8 +1389,21 @@ lcl_setupBorders( const uno::Reference< excel::XRange >& xParentRange, const uno return borders; } +void lcl_NotifyRangeChanges( const uno::Reference< frame::XModel >& xModel, ScCellRangesBase* pUnoRangesBase ) +{ + if ( xModel.is() && pUnoRangesBase ) + { + ScModelObj* pModelObj = ScModelObj::getImplementation( xModel ); + const ScRangeList& aCellRanges = pUnoRangesBase->GetRangeList(); + if ( pModelObj && pModelObj->HasChangesListeners() ) + { + pModelObj->NotifyChanges( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "cell-change" ) ), aCellRanges ); + } + } +} + ScVbaRange::ScVbaRange( uno::Sequence< uno::Any> const & args, - uno::Reference< uno::XComponentContext> const & xContext ) throw ( lang::IllegalArgumentException ) : ScVbaRange_BASE( getXSomethingFromArgs< XHelperInterface >( args, 0 ), xContext, getXSomethingFromArgs< beans::XPropertySet >( args, 1, false ), getModelFromXIf( getXSomethingFromArgs< uno::XInterface >( args, 1 ) ), true ), mbIsRows( sal_False ), mbIsColumns( sal_False ) + uno::Reference< uno::XComponentContext> const & xContext ) throw ( lang::IllegalArgumentException ) : ScVbaRange_BASE( getXSomethingFromArgs< XHelperInterface >( args, 0 ), xContext, getXSomethingFromArgs< beans::XPropertySet >( args, 1, false ), excel::GetModelFromRange( getXSomethingFromArgs< uno::XInterface >( args, 1 ) ), true ), mbIsRows( sal_False ), mbIsColumns( sal_False ) { mxRange.set( mxPropertySet, uno::UNO_QUERY ); mxRanges.set( mxPropertySet, uno::UNO_QUERY ); @@ -1377,7 +1420,7 @@ ScVbaRange::ScVbaRange( uno::Sequence< uno::Any> const & args, } ScVbaRange::ScVbaRange( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< table::XCellRange >& xRange, sal_Bool bIsRows, sal_Bool bIsColumns ) throw( lang::IllegalArgumentException ) -: ScVbaRange_BASE( xParent, xContext, uno::Reference< beans::XPropertySet >( xRange, uno::UNO_QUERY_THROW ), getModelFromRange( xRange), true ), mxRange( xRange ), +: ScVbaRange_BASE( xParent, xContext, uno::Reference< beans::XPropertySet >( xRange, uno::UNO_QUERY_THROW ), excel::GetModelFromRange( xRange), true ), mxRange( xRange ), mbIsRows( bIsRows ), mbIsColumns( bIsColumns ) { @@ -1392,7 +1435,7 @@ ScVbaRange::ScVbaRange( const uno::Reference< XHelperInterface >& xParent, const } ScVbaRange::ScVbaRange( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< sheet::XSheetCellRangeContainer >& xRanges, sal_Bool bIsRows, sal_Bool bIsColumns ) throw ( lang::IllegalArgumentException ) -: ScVbaRange_BASE( xParent, xContext, uno::Reference< beans::XPropertySet >( xRanges, uno::UNO_QUERY_THROW ), getModelFromXIf( uno::Reference< uno::XInterface >( xRanges, uno::UNO_QUERY_THROW ) ), true ), mxRanges( xRanges ),mbIsRows( bIsRows ), mbIsColumns( bIsColumns ) +: ScVbaRange_BASE( xParent, xContext, uno::Reference< beans::XPropertySet >( xRanges, uno::UNO_QUERY_THROW ), excel::GetModelFromRange( uno::Reference< uno::XInterface >( xRanges, uno::UNO_QUERY_THROW ) ), true ), mxRanges( xRanges ),mbIsRows( bIsRows ), mbIsColumns( bIsColumns ) { uno::Reference< container::XIndexAccess > xIndex( mxRanges, uno::UNO_QUERY_THROW ); @@ -1431,7 +1474,53 @@ ScVbaRange::visitArray( ArrayVisitor& visitor ) } } +uno::Any SAL_CALL ScVbaRange::getName() throw (uno::RuntimeException) +{ + uno::Reference< excel::XName > xName; + ScDocShell* pDocShell = getScDocShell(); + uno::Reference< frame::XModel > xModel = pDocShell ? pDocShell->GetModel() : NULL; + if ( !xModel.is() ) + { + throw uno::RuntimeException( rtl::OUString::createFromAscii( "Invalid document" ), uno::Reference< uno::XInterface >() ); + } + uno::Reference< beans::XPropertySet > xPropertySet( xModel, uno::UNO_QUERY_THROW ); + uno::Reference< sheet::XNamedRanges > xNamedRanges( xPropertySet->getPropertyValue( rtl::OUString::createFromAscii("NamedRanges")) , uno::UNO_QUERY_THROW ); + + uno::Reference< excel::XNames > xNames( new ScVbaNames( uno::Reference< XHelperInterface >(), mxContext , xNamedRanges , xModel ) ); + sal_Int32 nCount = xNames->getCount(); + ScCellRangesBase* pUnoRangesBase = getCellRangesBase(); + if ( pUnoRangesBase && nCount > 0 ) + { + ScRangeList aRangeList = pUnoRangesBase->GetRangeList(); + for ( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++ ) + { + uno::Reference< excel::XName > xTmpName( xNames->Item( uno::makeAny( nIndex + 1 ), uno::Any() ), uno::UNO_QUERY ); + if ( xTmpName.is() ) + { + try + { + uno::Reference< excel::XRange > xRange = xTmpName->getRefersToRange(); + if ( xRange.is() ) + { + ScVbaRange* pRange = dynamic_cast< ScVbaRange* >( xRange.get() ); + ScCellRangesBase* pCurRangesBase = pRange ? pRange->getCellRangesBase() : NULL; + if ( pCurRangesBase && aRangeList == pCurRangesBase->GetRangeList() ) + { + xName = xTmpName; + break; + } + } + } + catch (const uno::Exception&) + { + } + } + } + } + + return uno::makeAny( xName ); +} uno::Any ScVbaRange::getValue( ValueGetter& valueGetter) throw (uno::RuntimeException) @@ -1521,6 +1610,9 @@ ScVbaRange::setValue( const uno::Any &aValue ) throw (uno::RuntimeException) } CellValueSetter valueSetter( aValue ); setValue( aValue, valueSetter ); + + // Fires the range change event. + lcl_NotifyRangeChanges( getScDocShell()->GetModel(), getCellRangesBase() ); } void @@ -1529,6 +1621,9 @@ ScVbaRange::Clear() throw (uno::RuntimeException) using namespace ::com::sun::star::sheet::CellFlags; sal_Int32 nFlags = VALUE | DATETIME | STRING | FORMULA | HARDATTR | EDITATTR | FORMATTED; ClearContents( nFlags ); + + // Fires the range change event. + lcl_NotifyRangeChanges( getScDocShell()->GetModel(), getCellRangesBase() ); } //helper ClearContent @@ -1569,6 +1664,9 @@ ScVbaRange::ClearContents() throw (uno::RuntimeException) sheet::CellFlags::STRING | sheet::CellFlags::DATETIME | sheet::CellFlags::FORMULA ); ClearContents( nClearFlags ); + + // Fires the range change event. + lcl_NotifyRangeChanges( getScDocShell()->GetModel(), getCellRangesBase() ); } void @@ -1577,6 +1675,9 @@ ScVbaRange::ClearFormats() throw (uno::RuntimeException) //FIXME: need to check if we need to combine sheet::CellFlags::FORMATTED sal_Int32 nClearFlags = sheet::CellFlags::HARDATTR | sheet::CellFlags::FORMATTED | sheet::CellFlags::EDITATTR; ClearContents( nClearFlags ); + + // Fires the range change event. + lcl_NotifyRangeChanges( getScDocShell()->GetModel(), getCellRangesBase() ); } void @@ -1592,6 +1693,9 @@ ScVbaRange::setFormulaValue( const uno::Any& rFormula, formula::FormulaGrammar:: } CellFormulaValueSetter formulaValueSetter( rFormula, getScDocument(), eGram ); setValue( rFormula, formulaValueSetter ); + + // Fires the range change event. + lcl_NotifyRangeChanges( getScDocShell()->GetModel(), getCellRangesBase() ); } uno::Any @@ -1751,6 +1855,9 @@ ScVbaRange::fillSeries( sheet::FillDirection nFillDirection, sheet::FillMode nFi uno::Reference< sheet::XCellSeries > xCellSeries(mxRange, uno::UNO_QUERY_THROW ); xCellSeries->fillSeries( nFillDirection, nFillMode, nFillDateMode, fStep, fEndValue ); + + // Fires the range change event. + lcl_NotifyRangeChanges( getScDocShell()->GetModel(), getCellRangesBase() ); } void @@ -1890,7 +1997,16 @@ ScVbaRange::getFormulaArray() throw (uno::RuntimeException) uno::Reference< sheet::XCellRangeFormula> xCellRangeFormula( mxRange, uno::UNO_QUERY_THROW ); uno::Reference< script::XTypeConverter > xConverter = getTypeConverter( mxContext ); uno::Any aMatrix; - aMatrix = xConverter->convertTo( uno::makeAny( xCellRangeFormula->getFormulaArray() ) , getCppuType((uno::Sequence< uno::Sequence< uno::Any > >*)0) ) ; + + //VBA, minz@cn.ibm.com + uno::Sequence< uno::Sequence<rtl::OUString> > aFmArray = xCellRangeFormula->getFormulaArray(); + if( aFmArray.getLength() ) + { + if( aFmArray.getLength() == 1 && aFmArray[0].getLength() == 1 ) + aMatrix <<= aFmArray[0][0]; + else + aMatrix = xConverter->convertTo( uno::makeAny( xCellRangeFormula->getFormulaArray() ) , getCppuType((uno::Sequence< uno::Sequence< uno::Any > >*)0) ) ; + } return aMatrix; } @@ -2061,29 +2177,65 @@ ScVbaRange::Cells( const uno::Any &nRowIndex, const uno::Any &nColumnIndex ) thr // set in the Any, we should convert as appropriate // #FIXME - perhaps worth turning this into some sort of // convertion routine e.g. bSuccess = getValueFromAny( nRow, nRowIndex, getCppuType((sal_Int32*)0) ) - if ( nRowIndex.hasValue() && !( nRowIndex >>= nRow ) ) + uno::Any aRowIndexAny = nRowIndex; + if ( aRowIndexAny.getValueTypeClass() == uno::TypeClass_INTERFACE ) { - uno::Reference< script::XTypeConverter > xConverter = getTypeConverter( mxContext ); - uno::Any aConverted; try { - aConverted = xConverter->convertTo( nRowIndex, getCppuType((sal_Int32*)0) ); - bIsIndex = ( aConverted >>= nRow ); + aRowIndexAny = getDefaultPropByIntrospection( aRowIndexAny ); } - catch( uno::Exception& ) {} // silence any errors + catch( uno::Exception& ) {} } - if ( bIsColumnIndex && !( nColumnIndex >>= nColumn ) ) + else if ( aRowIndexAny.hasValue() && !( aRowIndexAny >>= nRow ) ) { uno::Reference< script::XTypeConverter > xConverter = getTypeConverter( mxContext ); uno::Any aConverted; try { - aConverted = xConverter->convertTo( nColumnIndex, getCppuType((sal_Int32*)0) ); - bIsColumnIndex = ( aConverted >>= nColumn ); + aConverted = xConverter->convertTo( aRowIndexAny, getCppuType((sal_Int32*)0) ); + bIsIndex = ( aConverted >>= nRow ); } catch( uno::Exception& ) {} // silence any errors } + uno::Any aColumnAny = nColumnIndex; + + if ( bIsColumnIndex ) + { + // Column index can be a col address e.g Cells( 1, "B" ) etc. + rtl::OUString sCol; + if ( nColumnIndex >>= sCol ) + { + ScAddress::Details dDetails( formula::FormulaGrammar::CONV_XL_A1, 0, 0 ); + ScRange tmpRange; + USHORT flags = tmpRange.ParseCols( sCol, excel::GetDocumentFromRange( mxRange ), dDetails ); + if ( ( flags & 0x200 ) != 0x200 ) + throw uno::RuntimeException(); + nColumn = tmpRange.aStart.Col() + 1; + } + else + { + if ( aColumnAny.getValueTypeClass() == uno::TypeClass_INTERFACE ) + { + try + { + aColumnAny = getDefaultPropByIntrospection( aColumnAny ); + } + catch( uno::Exception& ) {} + } + if ( !( aColumnAny >>= nColumn ) ) + { + uno::Reference< script::XTypeConverter > xConverter = getTypeConverter( mxContext ); + uno::Any aConverted; + try + { + aConverted = xConverter->convertTo( aColumnAny, getCppuType((sal_Int32*)0) ); + bIsColumnIndex = ( aConverted >>= nColumn ); + } + catch( uno::Exception& ) {} // silence any errors + } + } + } RangeHelper thisRange( mxRange ); table::CellRangeAddress thisRangeAddress = thisRange.getCellRangeAddressable()->getRangeAddress(); uno::Reference< table::XCellRange > xSheetRange = thisRange.getCellRangeFromSheet(); @@ -2245,7 +2397,7 @@ ScVbaRange::Rows(const uno::Any& aIndex ) throw (uno::RuntimeException) { ScAddress::Details dDetails( formula::FormulaGrammar::CONV_XL_A1, 0, 0 ); ScRange tmpRange; - tmpRange.ParseRows( sAddress, getDocumentFromRange( mxRange ), dDetails ); + tmpRange.ParseRows( sAddress, excel::GetDocumentFromRange( mxRange ), dDetails ); nStartRow = tmpRange.aStart.Row(); nEndRow = tmpRange.aEnd.Row(); @@ -2292,7 +2444,7 @@ ScVbaRange::Columns(const uno::Any& aIndex ) throw (uno::RuntimeException) { ScAddress::Details dDetails( formula::FormulaGrammar::CONV_XL_A1, 0, 0 ); ScRange tmpRange; - tmpRange.ParseCols( sAddress, getDocumentFromRange( mxRange ), dDetails ); + tmpRange.ParseCols( sAddress, excel::GetDocumentFromRange( mxRange ), dDetails ); nStartCol = tmpRange.aStart.Col(); nEndCol = tmpRange.aEnd.Col(); @@ -2395,9 +2547,11 @@ ScVbaRange::Copy(const ::uno::Any& Destination) throw (uno::RuntimeException) } else { - uno::Reference< frame::XModel > xModel = getModelFromRange( mxRange ); - Select(); - excel::implnCopy( xModel ); + ScRange aRange; + RangeHelper thisRange( mxRange ); + ScUnoConversion::FillScRange( aRange, thisRange.getCellRangeAddressable()->getRangeAddress() ); + uno::Reference< frame::XModel > xModel = excel::GetModelFromRange( mxRange ); + excel::implnCopyRange( xModel, aRange ); } } @@ -2419,8 +2573,9 @@ ScVbaRange::Cut(const ::uno::Any& Destination) throw (uno::RuntimeException) uno::Reference< sheet::XCellRangeAddressable > xSource( mxRange, uno::UNO_QUERY); xMover->moveRange( xDestination->getCellAddress(), xSource->getRangeAddress() ); } - { - uno::Reference< frame::XModel > xModel = getModelFromRange( mxRange ); + //VBA, minz@cn.ibm.com. + else { + uno::Reference< frame::XModel > xModel = excel::GetModelFromRange( mxRange ); Select(); excel::implnCut( xModel ); } @@ -2740,8 +2895,6 @@ ScVbaRange::PasteSpecial( const uno::Any& Paste, const uno::Any& Operation, cons uno::Reference< frame::XModel > xModel( ( pShell ? pShell->GetModel() : NULL ), uno::UNO_QUERY_THROW ); uno::Reference< view::XSelectionSupplier > xSelection( xModel->getCurrentController(), uno::UNO_QUERY_THROW ); - // save old selection - uno::Reference< uno::XInterface > xSel( xModel->getCurrentSelection() ); // select this range xSelection->select( uno::makeAny( mxRange ) ); // set up defaults @@ -2762,8 +2915,6 @@ ScVbaRange::PasteSpecial( const uno::Any& Paste, const uno::Any& Operation, cons USHORT nFlags = getPasteFlags(nPaste); USHORT nFormulaBits = getPasteFormulaBits(nOperation); excel::implnPasteSpecial(pShell->GetModel(), nFlags,nFormulaBits,bSkipBlanks,bTranspose); - // restore selection - xSelection->select( uno::makeAny( xSel ) ); } uno::Reference< excel::XRange > @@ -2984,7 +3135,16 @@ ScVbaRange::Replace( const ::rtl::OUString& What, const ::rtl::OUString& Replace // OOo.org afaik uno::Reference< util::XSearchDescriptor > xSearch( xDescriptor, uno::UNO_QUERY ); + // Find all cells that being replaced, used to fire the range changed event. + uno::Reference< container::XIndexAccess > xIndexAccess = xReplace->findAll( xSearch ); xReplace->replaceAll( xSearch ); + + if ( xIndexAccess.is() && xIndexAccess->getCount() > 0 ) + { + // Fires the range change event. + ScCellRangesBase* pScCellRangesBase = ScCellRangesBase::getImplementation( xIndexAccess ); //liuchen 2010-01-05 + lcl_NotifyRangeChanges( getScDocShell()->GetModel(), pScCellRangesBase ); //liuchen 2010-01-05 the original convert method will fail in SUSE + } } return sal_True; // always } @@ -3135,6 +3295,13 @@ ScVbaRange::Find( const uno::Any& What, const uno::Any& After, const uno::Any& L uno::Reference< uno::XInterface > xInterface = xStartCell.is() ? xSearch->findNext( xStartCell, xDescriptor) : xSearch->findFirst( xDescriptor ); uno::Reference< table::XCellRange > xCellRange( xInterface, uno::UNO_QUERY ); + // if we are searching from a starting cell and failed to find a match + // then try from the begining + if ( !xCellRange.is() && xStartCell.is() ) + { + xInterface = xSearch->findFirst( xDescriptor ); + xCellRange.set( xInterface, uno::UNO_QUERY ); + } if ( xCellRange.is() ) { uno::Reference< excel::XRange > xResultRange = new ScVbaRange( mxParent, mxContext, xCellRange ); @@ -3428,76 +3595,45 @@ ScVbaRange::End( ::sal_Int32 Direction ) throw (uno::RuntimeException) return xRange->End( Direction ); } + table::CellAddress aAddress = getLeftUpperCellAddress(); + SCTAB nTab = aAddress.Sheet; + SCCOL nCurX = aAddress.Column; + SCROW nCurY = aAddress.Row; + SCCOL nNewX = nCurX; + SCROW nNewY = nCurY; - // #FIXME #TODO - // euch! found my orig implementation sucked, so - // trying this even suckier one ( really need to use/expose code in - // around ScTabView::MoveCursorArea(), thats the bit that calcutes - // where the cursor should go ) - // Main problem with this method is the ultra hacky attempt to preserve - // the ActiveCell, there should be no need to go to these extreems - - // Save ActiveCell pos ( to restore later ) - uno::Any aDft; - uno::Reference< excel::XApplication > xApplication( Application(), uno::UNO_QUERY_THROW ); - rtl::OUString sActiveCell = xApplication->getActiveCell()->Address(aDft, aDft, aDft, aDft, aDft ); - - // position current cell upper left of this range - Cells( uno::makeAny( (sal_Int32) 1 ), uno::makeAny( (sal_Int32) 1 ) )->Select(); + ScDocShell* pDocShell = getScDocShell(); + ScDocument* pDoc = pDocShell->GetDocument(); - uno::Reference< frame::XModel > xModel = getModelFromRange( mxRange ); + SCsCOL nMoveX = 0; + SCsROW nMoveY = 0; + switch ( Direction ) + { + case excel::XlDirection::xlDown: + nMoveY = 1; + break; + case excel::XlDirection::xlUp: + nMoveY = -1; + break; + case excel::XlDirection::xlToLeft: + nMoveX = -1; + break; + case excel::XlDirection::xlToRight: + nMoveX = 1; + break; + default: + throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Invalid Direction" ) ), uno::Reference< uno::XInterface >() ); + } - SfxViewFrame* pViewFrame = excel::getViewFrame( xModel ); - if ( pViewFrame ) + if ( pDoc ) { - SfxAllItemSet aArgs( SFX_APP()->GetPool() ); - // Hoping this will make sure this slot is called - // synchronously - SfxBoolItem sfxAsync( SID_ASYNCHRON, sal_False ); - aArgs.Put( sfxAsync, sfxAsync.Which() ); - SfxDispatcher* pDispatcher = pViewFrame->GetDispatcher(); - - USHORT nSID = 0; - - switch( Direction ) - { - case excel::XlDirection::xlDown: - nSID = SID_CURSORBLKDOWN; - break; - case excel::XlDirection::xlUp: - nSID = SID_CURSORBLKUP; - break; - case excel::XlDirection::xlToLeft: - nSID = SID_CURSORBLKLEFT; - break; - case excel::XlDirection::xlToRight: - nSID = SID_CURSORBLKRIGHT; - break; - default: - throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ": Invalid ColumnIndex" ) ), uno::Reference< uno::XInterface >() ); - } - if ( pDispatcher ) - { - pDispatcher->Execute( nSID, (SfxCallMode)SFX_CALLMODE_SYNCHRON, aArgs ); - } + pDoc->FindAreaPos( nNewX, nNewY, nTab, nMoveX, nMoveY ); } - // result is the ActiveCell - rtl::OUString sMoved = xApplication->getActiveCell()->Address(aDft, aDft, aDft, aDft, aDft ); - - // restore old ActiveCell - uno::Any aVoid; - - uno::Reference< excel::XRange > xOldActiveCell( xApplication->getActiveSheet()->Range( uno::makeAny( sActiveCell ), aVoid ), uno::UNO_QUERY_THROW ); - xOldActiveCell->Select(); - - uno::Reference< excel::XRange > resultCell; - - resultCell.set( xApplication->getActiveSheet()->Range( uno::makeAny( sMoved ), aVoid ), uno::UNO_QUERY_THROW ); - - // return result - - return resultCell; + ScRange aNewRange( (SCCOL)nNewX, (SCROW)nNewY, nTab, (SCCOL)nNewX, (SCROW)nNewY, nTab ); + uno::Reference< table::XCellRange > xCellRange( new ScCellRangeObj( getScDocShell(), aNewRange ) ); + uno::Reference< excel::XRange > xResultRange = new ScVbaRange( mxParent, mxContext, xCellRange ); + return xResultRange; } bool @@ -3515,7 +3651,7 @@ ScVbaRange::characters( const uno::Any& Start, const uno::Any& Length ) throw (u if ( !isSingleCellRange() ) throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Can't create Characters property for multicell range ") ), uno::Reference< uno::XInterface >() ); uno::Reference< text::XSimpleText > xSimple(mxRange->getCellByPosition(0,0) , uno::UNO_QUERY_THROW ); - ScDocument* pDoc = getDocumentFromRange(mxRange); + ScDocument* pDoc = excel::GetDocumentFromRange(mxRange); if ( !pDoc ) throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Failed to access document from shell" ) ), uno::Reference< uno::XInterface >() ); @@ -3632,7 +3768,7 @@ ScVbaRange::getCalcColWidth( const table::CellRangeAddress& rAddress) throw (uno double ScVbaRange::getCalcRowHeight( const table::CellRangeAddress& rAddress ) throw (uno::RuntimeException) { - ScDocument* pDoc = getDocumentFromRange( mxRange ); + ScDocument* pDoc = excel::GetDocumentFromRange( mxRange ); USHORT nWidth = pDoc->GetOriginalHeight( rAddress.StartRow, rAddress.Sheet ); double nPoints = lcl_TwipsToPoints( nWidth ); nPoints = lcl_Round2DecPlaces( nPoints ); @@ -3894,7 +4030,7 @@ ScVbaRange::setRowHeight( const uno::Any& _rowheight) throw (uno::RuntimeExcepti table::CellRangeAddress thisAddress = thisRange.getCellRangeAddressable()->getRangeAddress(); USHORT nTwips = lcl_pointsToTwips( nHeight ); - ScDocShell* pDocShell = getDocShellFromRange( mxRange ); + ScDocShell* pDocShell = excel::GetDocShellFromRange( mxRange ); ScDocFunc aFunc(*pDocShell); SCCOLROW nRowArr[2]; nRowArr[0] = thisAddress.StartRow; @@ -3907,7 +4043,7 @@ uno::Any SAL_CALL ScVbaRange::getPageBreak() throw (uno::RuntimeException) { sal_Int32 nPageBreak = excel::XlPageBreak::xlPageBreakNone; - ScDocShell* pShell = getDocShellFromRange( mxRange ); + ScDocShell* pShell = excel::GetDocShellFromRange( mxRange ); if ( pShell ) { RangeHelper thisRange( mxRange ); @@ -3920,7 +4056,7 @@ ScVbaRange::getPageBreak() throw (uno::RuntimeException) uno::Reference< frame::XModel > xModel = pShell->GetModel(); if ( xModel.is() ) { - ScDocument* pDoc = getDocumentFromRange( mxRange ); + ScDocument* pDoc = excel::GetDocumentFromRange( mxRange ); ScBreakType nBreak = BREAK_NONE; if ( !bColumn ) @@ -3945,7 +4081,7 @@ ScVbaRange::setPageBreak( const uno::Any& _pagebreak) throw (uno::RuntimeExcepti sal_Int32 nPageBreak = 0; _pagebreak >>= nPageBreak; - ScDocShell* pShell = getDocShellFromRange( mxRange ); + ScDocShell* pShell = excel::GetDocShellFromRange( mxRange ); if ( pShell ) { RangeHelper thisRange( mxRange ); @@ -4039,7 +4175,7 @@ ScVbaRange::getWorksheet() throw (uno::RuntimeException) uno::Reference< container::XIndexAccess > xIndex( mxRanges, uno::UNO_QUERY_THROW ); xRange.set( xIndex->getByIndex( 0 ), uno::UNO_QUERY_THROW ); } - ScDocShell* pDocShell = getDocShellFromRange(xRange); + ScDocShell* pDocShell = excel::GetDocShellFromRange(xRange); RangeHelper rHelper(xRange); // parent should be Thisworkbook xSheet.set( new ScVbaWorksheet( uno::Reference< XHelperInterface >(), mxContext,rHelper.getSpreadSheet(),pDocShell->GetModel()) ); @@ -4094,63 +4230,44 @@ ScVbaRange::ApplicationRange( const uno::Reference< uno::XComponentContext >& xC } } } - uno::Reference< sheet::XSpreadsheetView > xView( getCurrentExcelDoc(xContext)->getCurrentController(), uno::UNO_QUERY ); - uno::Reference< table::XCellRange > xSheetRange( xView->getActiveSheet(), uno::UNO_QUERY_THROW ); - ScVbaRange* pRange = new ScVbaRange( excel::getUnoSheetModuleObj( xSheetRange ), xContext, xSheetRange ); - uno::Reference< excel::XRange > xVbSheetRange( pRange ); - return pRange->Range( Cell1, Cell2, true ); -} -uno::Reference< sheet::XDatabaseRanges > -lcl_GetDataBaseRanges( ScDocShell* pShell ) throw ( uno::RuntimeException ) -{ - uno::Reference< frame::XModel > xModel; - if ( pShell ) - xModel.set( pShell->GetModel(), uno::UNO_QUERY_THROW ); - uno::Reference< beans::XPropertySet > xModelProps( xModel, uno::UNO_QUERY_THROW ); - uno::Reference< sheet::XDatabaseRanges > xDBRanges( xModelProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("DatabaseRanges") ) ), uno::UNO_QUERY_THROW ); - return xDBRanges; -} -// returns the XDatabaseRange for the autofilter on sheet (nSheet) -// also populates sName with the name of range -uno::Reference< sheet::XDatabaseRange > -lcl_GetAutoFiltRange( ScDocShell* pShell, sal_Int16 nSheet, rtl::OUString& sName ) -{ - uno::Reference< container::XIndexAccess > xIndexAccess( lcl_GetDataBaseRanges( pShell ), uno::UNO_QUERY_THROW ); - uno::Reference< sheet::XDatabaseRange > xDataBaseRange; - table::CellRangeAddress dbAddress; - for ( sal_Int32 index=0; index < xIndexAccess->getCount(); ++index ) - { - uno::Reference< sheet::XDatabaseRange > xDBRange( xIndexAccess->getByIndex( index ), uno::UNO_QUERY_THROW ); - uno::Reference< container::XNamed > xNamed( xDBRange, uno::UNO_QUERY_THROW ); - // autofilters work weirdly with openoffice, unnamed is the default - // named range which is used to create an autofilter, but - // its also possible that another name could be used - // this also causes problems when an autofilter is created on - // another sheet - // ( but.. you can use any named range ) - dbAddress = xDBRange->getDataArea(); - if ( dbAddress.Sheet == nSheet ) - { - sal_Bool bHasAuto = sal_False; - uno::Reference< beans::XPropertySet > xProps( xDBRange, uno::UNO_QUERY_THROW ); - xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("AutoFilter") ) ) >>= bHasAuto; - if ( bHasAuto ) - { - sName = xNamed->getName(); - xDataBaseRange=xDBRange; - break; - } + // Add these codes for supporting shortcut: Application.Range(Range1, Range2), Range1 or Range2 is not the range of current active sheet. + // If Range1 and Range2 are not in current active sheet, we should not use the active sheet, but use the sheet of Range1 and Range2. + // If Range1 and Range2 are not in the same sheet, we throw an exception. + uno::Reference< sheet::XSpreadsheet > xSpreadsheet; + uno::Reference< excel::XRange > xRange1( Cell1, uno::UNO_QUERY ), xRange2( Cell2, uno::UNO_QUERY ); + if ( xRange1.is() ) + { + RangeHelper thisRange( xRange1->getCellRange() ); + xSpreadsheet = thisRange.getSpreadSheet(); + } + else if ( xRange2.is() ) + { + RangeHelper thisRange( xRange2->getCellRange() ); + xSpreadsheet = thisRange.getSpreadSheet(); + } + if ( !xSpreadsheet.is() ) + { + uno::Reference< frame::XModel > xModel = getCurrentExcelDoc( xContext ); + if ( xModel.is() ) + { + uno::Reference< sheet::XSpreadsheetView > xView( xModel->getCurrentController(), uno::UNO_QUERY_THROW ); + xSpreadsheet = xView->getActiveSheet(); } } - return xDataBaseRange; + + uno::Reference< table::XCellRange > xSheetRange( xSpreadsheet, uno::UNO_QUERY_THROW ); + ScVbaRange* pRange = new ScVbaRange( excel::getUnoSheetModuleObj( xSheetRange ), xContext, xSheetRange ); + + uno::Reference< excel::XRange > xVbSheetRange( pRange ); + return pRange->Range( Cell1, Cell2, true ); } // Helper functions for AutoFilter ScDBData* lcl_GetDBData_Impl( ScDocShell* pDocShell, sal_Int16 nSheet ) { rtl::OUString sName; - lcl_GetAutoFiltRange( pDocShell, nSheet, sName ); + excel::GetAutoFiltRange( pDocShell, nSheet, sName ); OSL_TRACE("lcl_GetDBData_Impl got autofilter range %s for sheet %d", rtl::OUStringToOString( sName, RTL_TEXTENCODING_UTF8 ).getStr() , nSheet ); ScDBData* pRet = NULL; @@ -4317,7 +4434,7 @@ ScVbaRange::AutoFilter( const uno::Any& Field, const uno::Any& Criteria1, const ScDocShell* pShell = getScDocShell(); sal_Bool bHasAuto = sal_False; rtl::OUString sAutofiltRangeName; - uno::Reference< sheet::XDatabaseRange > xDataBaseRange = lcl_GetAutoFiltRange( pShell, nSheet, sAutofiltRangeName ); + uno::Reference< sheet::XDatabaseRange > xDataBaseRange = excel::GetAutoFiltRange( pShell, nSheet, sAutofiltRangeName ); if ( xDataBaseRange.is() ) bHasAuto = true; @@ -4350,7 +4467,7 @@ ScVbaRange::AutoFilter( const uno::Any& Field, const uno::Any& Criteria1, const autoFiltAddress = multiCellRange.getCellRangeAddressable()->getRangeAddress(); } - uno::Reference< sheet::XDatabaseRanges > xDBRanges = lcl_GetDataBaseRanges( pShell ); + uno::Reference< sheet::XDatabaseRanges > xDBRanges = excel::GetDataBaseRanges( pShell ); if ( xDBRanges.is() ) { rtl::OUString sGenName( RTL_CONSTASCII_USTRINGPARAM("VBA_Autofilter_") ); @@ -4403,8 +4520,21 @@ ScVbaRange::AutoFilter( const uno::Any& Field, const uno::Any& Criteria1, const // Use the normal uno api, sometimes e.g. when you want to use ALL as the filter // we can't use refresh as the uno interface doesn't have a concept of ALL // in this case we just call the core calc functionality - - bool bAll = false;; - if ( ( Field >>= nField ) ) + bool bAll = false; + uno::Reference< script::XTypeConverter > xConverter = getTypeConverter( mxContext ); + bool bIsValidFieldValue = ( Field >>= nField ); + if ( !bIsValidFieldValue && xConverter.is() ) + { + try + { + uno::Any aConverted = xConverter->convertTo( Field, getCppuType( (sal_Int32*)0 ) ); + bIsValidFieldValue = ( aConverted >>= nField ); + } + catch( const uno::Exception& ex ) + { + } + } + if ( bIsValidFieldValue ) { uno::Reference< sheet::XSheetFilterDescriptor2 > xDesc( xDataBaseRange->getFilterDescriptor(), uno::UNO_QUERY ); @@ -4435,7 +4565,19 @@ ScVbaRange::AutoFilter( const uno::Any& Field, const uno::Any& Criteria1, const bAll = true; // not sure what the relationship between Criteria1 and Operator is, // e.g. can you have a Operator without a Criteria ? in openoffice it - if ( Operator.hasValue() && ( Operator >>= nOperator ) ) + bool bIsValidOpValue = ( Operator.hasValue() && ( Operator >>= nOperator ) ); + if ( Operator.hasValue() && !bIsValidOpValue && xConverter.is() ) + { + try + { + uno::Any aConverted = xConverter->convertTo( Operator, getCppuType( (sal_Int32*)0 ) ); + bIsValidOpValue = ( aConverted >>= nOperator ); + } + catch( const uno::Exception& ex ) + { + } + } + if ( bIsValidOpValue ) { // if its a bottom/top Ten(Percent/Value) and there // is no value specified for critera1 set it to 10 @@ -4583,7 +4725,7 @@ ScVbaRange::Insert( const uno::Any& Shift, const uno::Any& CopyOrigin ) throw (u { // After the insert ( this range ) actually has moved ScRange aRange( static_cast< SCCOL >( thisAddress.StartColumn ), static_cast< SCROW >( thisAddress.StartRow ), static_cast< SCTAB >( thisAddress.Sheet ), static_cast< SCCOL >( thisAddress.EndColumn ), static_cast< SCROW >( thisAddress.EndRow ), static_cast< SCTAB >( thisAddress.Sheet ) ); - uno::Reference< table::XCellRange > xRange( new ScCellRangeObj( getDocShellFromRange( mxRange ) , aRange ) ); + uno::Reference< table::XCellRange > xRange( new ScCellRangeObj( excel::GetDocShellFromRange( mxRange ) , aRange ) ); uno::Reference< excel::XRange > xVbaRange( new ScVbaRange( mxParent, mxContext, xRange, mbIsRows, mbIsColumns ) ); xVbaRange->PasteSpecial( uno::Any(), uno::Any(), uno::Any(), uno::Any() ); } @@ -4607,7 +4749,7 @@ ScVbaRange::Autofit() throw (uno::RuntimeException) if ( !( mbIsColumns || mbIsRows ) ) DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString()); - ScDocShell* pDocShell = getDocShellFromRange( mxRange ); + ScDocShell* pDocShell = excel::GetDocShellFromRange( mxRange ); if ( pDocShell ) { RangeHelper thisRange( mxRange ); @@ -4639,8 +4781,8 @@ ScVbaRange::Autofit() throw (uno::RuntimeException) ***************************************************************************************/ void SAL_CALL ScVbaRange::TextToColumns( const css::uno::Any& Destination, const css::uno::Any& DataType, const css::uno::Any& TextQualifier, - const css::uno::Any& ConsecutinveDelimiter, const css::uno::Any& Tab, const css::uno::Any& Semicolon, const css::uno::Any& Comma, - const css::uno::Any& Space, const css::uno::Any& Other, const css::uno::Any& OtherChar, const css::uno::Any& /*FieldInfo*/, + const css::uno::Any& ConsecutiveDelimiter, const css::uno::Any& Tab, const css::uno::Any& Semicolon, const css::uno::Any& Comma, + const css::uno::Any& Space, const css::uno::Any& Other, const css::uno::Any& OtherChar, const css::uno::Any& FieldInfo, const css::uno::Any& DecimalSeparator, const css::uno::Any& ThousandsSeparator, const css::uno::Any& /*TrailingMinusNumbers*/ ) throw (css::uno::RuntimeException) { uno::Reference< excel::XRange > xRange; @@ -4677,13 +4819,13 @@ ScVbaRange::TextToColumns( const css::uno::Any& Destination, const css::uno::Any OSL_TRACE("set TextQualifier\n"); } - sal_Bool bConsecutinveDelimiter = sal_False; - if( ConsecutinveDelimiter.hasValue() ) + sal_Bool bConsecutiveDelimiter = sal_False; + if( ConsecutiveDelimiter.hasValue() ) { - if( !( ConsecutinveDelimiter >>= bConsecutinveDelimiter ) ) - throw uno::RuntimeException( rtl::OUString::createFromAscii( "ConsecutinveDelimiter parameter should be a boolean" ), + if( !( ConsecutiveDelimiter >>= bConsecutiveDelimiter ) ) + throw uno::RuntimeException( rtl::OUString::createFromAscii( "ConsecutiveDelimiter parameter should be a boolean" ), uno::Reference< uno::XInterface >() ); - OSL_TRACE("set ConsecutinveDelimiter\n"); + OSL_TRACE("set ConsecutiveDelimiter\n"); } sal_Bool bTab = sal_False; @@ -4735,7 +4877,13 @@ ScVbaRange::TextToColumns( const css::uno::Any& Destination, const css::uno::Any throw uno::RuntimeException( rtl::OUString::createFromAscii( "Other parameter should be a True" ), uno::Reference< uno::XInterface >() ); } - //TODO* FieldInfo Optional Variant. An array containing parse information for the individual columns of data. The interpretation depends on the value of DataType. When the data is delimited, this argument is an array of two-element arrays, with each two-element array specifying the conversion options for a particular column. The first element is the column number (1-based), and the second element is one of the xlColumnDataType constants specifying how the column is parsed. + // FieldInfo, Optional Variant. An array containing parse information for the individual columns of data. + // The interpretation depends on the value of DataType. When the data is delimited, this argument is an array + // of two-element arrays, with each two-element array specifying the conversion options for a particular column. + // The first element is the column number (1-based), and the second element is one of the xlColumnDataType + // constants specifying how the column is parsed. + uno::Sequence< uno::Sequence< uno::Any > > sFieldInfo; + FieldInfo >>= sFieldInfo; rtl::OUString sDecimalSeparator; if( DecimalSeparator.hasValue() ) @@ -4753,7 +4901,106 @@ ScVbaRange::TextToColumns( const css::uno::Any& Destination, const css::uno::Any uno::Reference< uno::XInterface >() ); OSL_TRACE("set ThousandsSpeparator\n" ); } - //TODO* TrailingMinusNumbers Optional Variant. Numbers that begin with a minus character. + //TODO* TrailingMinusNumbers Optional Variant. Numbers that begin with a minus character. + + // Get the destination range's left-upper cell address. + ScVbaRange* pDestVbaRange = dynamic_cast< ScVbaRange* >( xRange.get() ); + ScAddress aScDestAddress; + if ( pDestVbaRange ) + { + ScUnoConversion::FillScAddress( aScDestAddress, pDestVbaRange->getLeftUpperCellAddress() ); + } + + // Parse the value of parameter FieldInfo. + USHORT nCount = 0, nRealCount = 0; + xub_StrLen* pColumns = NULL; + BYTE* pFormats = NULL; + if ( sFieldInfo.getLength() > 0 ) + { + nCount = sFieldInfo.getLength(); + pColumns = new xub_StrLen[nCount]; + pFormats = new BYTE[nCount]; + USHORT nFormat = 1; + uno::Reference< script::XTypeConverter > xConverter = getTypeConverter( mxContext ); + for ( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++ ) + { + if ( sFieldInfo[nIndex].getLength() >= 2 ) + { + nFormat = 1; + try + { + uno::Any aConverted = xConverter->convertTo( sFieldInfo[nIndex][0], getCppuType((xub_StrLen*)0) ); + aConverted >>= pColumns[nRealCount]; + aConverted = xConverter->convertTo( sFieldInfo[nIndex][1], getCppuType((USHORT*)0) ); + aConverted >>= nFormat; + } + catch( const uno::Exception& ) + { + } + pFormats[nRealCount++] = nFormat; + } + } + } + + sal_Unicode cTextQualifier = '"'; + cTextQualifier = xlTextQualifier == excel::XlTextQualifier::xlTextQualifierNone ? '\0' : cTextQualifier; + cTextQualifier = xlTextQualifier == excel::XlTextQualifier::xlTextQualifierSingleQuote ? '\'' : cTextQualifier; + + // Get field delimiters. + String rFieldDelimiters; + if ( bTab ) rFieldDelimiters += '\t'; + if ( bSemicolon ) rFieldDelimiters += ';'; + if ( bComma ) rFieldDelimiters += ','; + if ( bSpace ) rFieldDelimiters += ' '; + if ( bOther ) rFieldDelimiters += *sOtherChar.getStr(); + + // Get the text in current range to SvMemoryStream. + ScRange aSrcScRange; + ScCellRangesBase* pSrcCellRangesBase = getCellRangesBase(); + if ( pSrcCellRangesBase ) + { + ScRangeList aRangeList = pSrcCellRangesBase->GetRangeList(); + if ( aRangeList.First() ) + { + aSrcScRange = *aRangeList.First(); + } + } + ScImportExport aExport( getScDocument(), aSrcScRange ); + aExport.SetDelimiter( static_cast< sal_Unicode >( 0 ) ); + SvMemoryStream aStream; + aStream.SetStreamCharSet( RTL_TEXTENCODING_UNICODE ); + ScImportExport::SetNoEndianSwap( aStream ); + aExport.ExportStream( aStream, String(), FORMAT_STRING ); + aStream.Seek( 0 ); + + // Set ScAsciiOptions according to the input parameters. + ScAsciiOptions aOptions; + aOptions.SetFixedLen( !bDilimited ); + aOptions.SetStartRow( 0 ); + aOptions.SetColInfo( nRealCount, pColumns, pFormats ); + if ( bDilimited ) + { + aOptions.SetFieldSeps( rFieldDelimiters ); + aOptions.SetMergeSeps( bConsecutiveDelimiter ); + aOptions.SetTextSep( cTextQualifier ); + } + + // Split the String in to columns. + if ( pDestVbaRange && pDestVbaRange->getScDocument() ) + { + ScImportExport aImport( pDestVbaRange->getScDocument(), aScDestAddress ); + aImport.SetExtOptions( aOptions ); + aImport.SetApi( false ); + aImport.ImportStream( aStream, String(), FORMAT_STRING ); + } + if ( pColumns ) + { + DELETEZ( pColumns ); + } + if ( pFormats ) + { + DELETEZ( pFormats ); + } } uno::Any SAL_CALL @@ -4898,7 +5145,7 @@ uno::Any ScVbaRange::getShowDetail() throw ( css::uno::RuntimeException) (thisAddress.StartColumn == thisAddress.EndColumn && thisAddress.EndColumn == aOutlineAddress.EndColumn )) { sal_Bool bColumn =thisAddress.StartRow == thisAddress.EndRow ? sal_False:sal_True; - ScDocument* pDoc = getDocumentFromRange( mxRange ); + ScDocument* pDoc = excel::GetDocumentFromRange( mxRange ); ScOutlineTable* pOutlineTable = pDoc->GetOutlineTable(static_cast<SCTAB>(thisAddress.Sheet), sal_True); const ScOutlineArray* pOutlineArray = bColumn ? pOutlineTable->GetColArray(): pOutlineTable->GetRowArray(); if( pOutlineArray ) @@ -4954,6 +5201,24 @@ void ScVbaRange::setShowDetail(const uno::Any& aShowDetail) throw ( css::uno::Ru } } +//09-09-16 add by limingl +::com::sun::star::uno::Reference< ::ooo::vba::excel::XQueryTable > SAL_CALL +ScVbaRange::getQueryTable() throw (::com::sun::star::uno::RuntimeException) +{ + /* + if (m_pQueryTable == NULL) + { + m_pQueryTable = new ScVbaQueryTable(mxParent ,mxContext, getScDocument(), this); //add by limingl + } + //*/ + if (!m_xQueryTable.is()) + { + m_xQueryTable = new ScVbaQueryTable(mxParent ,mxContext, getScDocument(), this); //add by limingl + } + + return m_xQueryTable; +} +//end add uno::Reference< excel::XRange > SAL_CALL ScVbaRange::MergeArea() throw (script::BasicErrorException, uno::RuntimeException) { @@ -4983,6 +5248,118 @@ ScVbaRange::MergeArea() throw (script::BasicErrorException, uno::RuntimeExceptio return new ScVbaRange( mxParent, mxContext, mxRange ); } +//2008-08-25 add by limingl +//The recordset's member: Recordset.Fields.Item will get a Field obj. +//Field.value is the column value. +::sal_Int32 SAL_CALL +ScVbaRange::CopyFromRecordset( const ::com::sun::star::uno::Any& Data, const ::com::sun::star::uno::Any& MaxRows, const ::com::sun::star::uno::Any& MaxColumns ) +throw (::com::sun::star::script::BasicErrorException, ::com::sun::star::uno::RuntimeException) +{ + uno::Sequence< uno::Any > aParams; + uno::Sequence< uno::Any > aFieldsParams(1); + uno::Sequence< sal_Int16 > aOutParamIndex; + uno::Sequence< uno::Any > aOutParam; + uno::Reference< uno::XInterface > xIntRes; + uno::Reference< uno::XInterface > xIntFields; + uno::Reference< uno::XInterface > xIntFld; + uno::Any aRet; + uno::Any aPar; + uno::Any aCrrCol; + uno::Any aCrrRow; + sal_Int16 nCrrCol = 0; + sal_Int32 nCrrRow = 0; + sal_Int32 nCol; + sal_Int32 nMaxRows = 0; + sal_Int32 nMaxColumns = 0; + sal_Bool bEof; +// sal_Bool bColName = sal_True; + long lColCnt = 0; + if (MaxColumns.hasValue()) + { + MaxColumns >>= nMaxColumns; + } + + long lMaxCol = nMaxColumns; + + if (MaxRows.hasValue()) + { + MaxRows >>= nMaxRows; + } + + + Data >>= xIntRes; + uno::Reference< script::XInvocation > xInvRes(xIntRes, uno::UNO_QUERY_THROW); + rtl::OUString oMoveNext = rtl::OUString::createFromAscii("MoveNext") ; + rtl::OUString oEof = rtl::OUString::createFromAscii("EOF") ; + rtl::OUString oFields = rtl::OUString::createFromAscii("Fields") ; + + if( !xInvRes->hasMethod(oMoveNext)) + { + return -1; + } + + //Get columns count + aRet = xInvRes->getValue(oFields); + aRet >>= xIntFields; + uno::Reference< script::XInvocation > xInvFields(xIntFields, uno::UNO_QUERY_THROW); + aRet = xInvFields->getValue( rtl::OUString::createFromAscii("Count")) ; + aRet >>= lColCnt; + + //Set the assign column number + if (lMaxCol != 0) + { + if (lColCnt > lMaxCol) + { + lColCnt = lMaxCol; + } + } + + aCrrRow <<= nCrrRow; + aCrrCol <<= nCrrCol; + + + //Get start position + uno::Reference< excel::XRange > xRngStartRow = Rows(uno::Any(sal_Int32(1)) ); + uno::Reference< excel::XRange > xRngPos = xRngStartRow->Columns( uno::Any(sal_Int32(1)) ); + + while(1) + {//travel recordset + //get every column + for (long l = 0; l < lColCnt ; l++) + { + nCol = l; + aPar <<= nCol; + //get every field + aRet = xInvFields->invoke( rtl::OUString::createFromAscii("Item"), uno::Sequence< uno::Any >(&aPar,1) , aOutParamIndex,aOutParam); + aRet >>= xIntFld; + uno::Reference< script::XInvocation > xInvFld(xIntFld, uno::UNO_QUERY_THROW); //Get the Field obj + + //set the field value + aRet = xInvFld->getValue( rtl::OUString::createFromAscii("Value") ); + uno::Reference< excel::XRange > xRngToFill = xRngPos->Offset(aCrrRow,aCrrCol ); + + xRngToFill->setValue(aRet); + nCrrCol++; + aCrrCol <<= nCrrCol; + } + + aRet = xInvRes->invoke(oMoveNext, aParams,aOutParamIndex,aOutParam ); + aRet = xInvRes->getValue(oEof); + aRet >>= bEof; + if (bEof || ( nCrrRow >= nMaxRows && nMaxRows != 0) ) + {//Arrive the end of recordset + break; + } + + nCrrRow++; + aCrrRow <<= nCrrRow; + nCrrCol = 0; + aCrrCol <<= nCrrCol; + } + + return 0; +} +//end add void SAL_CALL ScVbaRange::PrintOut( const uno::Any& From, const uno::Any& To, const uno::Any& Copies, const uno::Any& Preview, const uno::Any& ActivePrinter, const uno::Any& PrintToFile, const uno::Any& Collate, const uno::Any& PrToFileName ) throw (uno::RuntimeException) { @@ -5001,7 +5378,7 @@ ScVbaRange::PrintOut( const uno::Any& From, const uno::Any& To, const uno::Any& { ScVbaRange* pRange = getImplementation( xRange ); // initialise the doc shell and the printareas - pShell = getDocShellFromRange( pRange->mxRange ); + pShell = excel::GetDocShellFromRange( pRange->mxRange ); xPrintAreas.set( thisRange.getSpreadSheet(), uno::UNO_QUERY_THROW ); } printAreas[ index - 1 ] = rangeAddress; @@ -5087,7 +5464,7 @@ ScVbaRange::AutoFill( const uno::Reference< excel::XRange >& Destination, const } } } - ScDocShell* pDocSh= getDocShellFromRange( mxRange ); + ScDocShell* pDocSh= excel::GetDocShellFromRange( mxRange ); FillCmd eCmd = FILL_AUTO; FillDateCmd eDateCmd = FILL_DAY; @@ -5210,13 +5587,8 @@ ScVbaRange::AutoOutline( ) throw (script::BasicErrorException, uno::RuntimeExce RangeHelper thisRange( mxRange ); table::CellRangeAddress thisAddress = thisRange.getCellRangeAddressable()->getRangeAddress(); - if ( isSingleCellRange() || mbIsRows ) - { - uno::Reference< sheet::XSheetOutline > xSheetOutline( thisRange.getSpreadSheet(), uno::UNO_QUERY_THROW ); - xSheetOutline->autoOutline( thisAddress ); - } - else - DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString()); + uno::Reference< sheet::XSheetOutline > xSheetOutline( thisRange.getSpreadSheet(), uno::UNO_QUERY_THROW ); + xSheetOutline->autoOutline( thisAddress ); } void SAL_CALL @@ -5243,9 +5615,9 @@ ScVbaRange::groupUnGroup( bool bUnGroup ) throw ( script::BasicErrorException, u { if ( m_Areas->getCount() > 1 ) DebugHelper::exception(SbERR_METHOD_FAILED, STR_ERRORMESSAGE_APPLIESTOSINGLERANGEONLY); - table::TableOrientation nOrient = table::TableOrientation_ROWS; - if ( mbIsColumns ) - nOrient = table::TableOrientation_COLUMNS; + table::TableOrientation nOrient = table::TableOrientation_COLUMNS; + if ( mbIsRows ) + nOrient = table::TableOrientation_ROWS; RangeHelper thisRange( mxRange ); table::CellRangeAddress thisAddress = thisRange.getCellRangeAddressable()->getRangeAddress(); uno::Reference< sheet::XSheetOutline > xSheetOutline( thisRange.getSpreadSheet(), uno::UNO_QUERY_THROW ); @@ -5404,6 +5776,7 @@ ScVbaRange::SpecialCells( const uno::Any& _oType, const uno::Any& _oValue) throw bool bIsSingleCell = isSingleCellRange(); bool bIsMultiArea = ( m_Areas->getCount() > 1 ); ScVbaRange* pRangeToUse = this; + uno::Reference< excel::XRange > xUsedRange( getWorksheet()->getUsedRange() ); sal_Int32 nType = 0; if ( !( _oType >>= nType ) ) DebugHelper::exception(SbERR_BAD_PARAMETER, rtl::OUString() ); @@ -5464,7 +5837,6 @@ ScVbaRange::SpecialCells( const uno::Any& _oType, const uno::Any& _oValue) throw } else if ( bIsSingleCell ) { - uno::Reference< excel::XRange > xUsedRange = getWorksheet()->getUsedRange(); pRangeToUse = static_cast< ScVbaRange* >( xUsedRange.get() ); } @@ -5639,6 +6011,183 @@ ScVbaRange::Subtotal( ::sal_Int32 _nGroupBy, ::sal_Int32 _nFunction, const uno:: } } +uno::Any SAL_CALL ScVbaRange::AdvancedFilter( sal_Int32 Action, const uno::Any& CriteriaRange, + const uno::Any& CopyToRange, const uno::Any& Unique ) throw (script::BasicErrorException, uno::RuntimeException) +{ + uno::Any aRet; + aRet <<= sal_True; + + uno::Reference< script::XTypeConverter > xConverter = getTypeConverter( mxContext ); + ScDocument* pDoc = getScDocument(); + if ( !pDoc ) + { + throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Failed to access document from range" ) ), uno::Reference< uno::XInterface >() ); + } + + // Action + if ( Action != excel::XlFilterAction::xlFilterInPlace && Action != excel::XlFilterAction::xlFilterCopy ) + { + throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Invalid input parameter" ) ), uno::Reference< uno::XInterface >() ); + } + if ( m_Areas->getCount() > 1 ) + { + throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Invalid range" ) ), uno::Reference< uno::XInterface >() ); + } + + sal_Bool bCopyOut = ( Action != excel::XlFilterAction::xlFilterInPlace ); + uno::Reference< sheet::XSheetFilterDescriptor > xFilterDesc; + uno::Reference< sheet::XSheetFilterable > xSheetFilter( mxRange, uno::UNO_QUERY_THROW ); + + // CriteriaRange + String aBuiltInCriteria; // Excel Built-In Filter Criteria. + ScRangeData* pData = NULL; + table::CellRangeAddress refParentAddr; + uno::Any aCriteriaRange = CriteriaRange; + formula::FormulaGrammar::AddressConvention aConv = formula::FormulaGrammar::CONV_XL_A1; + if ( aCriteriaRange.hasValue() && aCriteriaRange.getValueTypeClass() == uno::TypeClass_STRING ) + { + rtl::OUString rRangeString; + aCriteriaRange >>= rRangeString; + aConv = excel::IsR1C1ReferFormat( pDoc, rRangeString ) ? formula::FormulaGrammar::CONV_XL_R1C1 : aConv; + } + else + { + // Get Excel BuiltIn Filter Criteria. + ScRangeName* pRangeNames = pDoc->GetRangeName(); + const USHORT nCount = pRangeNames ? pRangeNames->GetCount() : 0; + for ( USHORT index = 0; index < nCount; index++ ) + { + pData = ( ScRangeData* )( pRangeNames->At( index ) ); + if ( pData && pData->HasType( RT_CRITERIA ) ) + { + pData->GetSymbol( aBuiltInCriteria, formula::FormulaGrammar::GRAM_NATIVE_XL_A1 ); + break; + } + } + aCriteriaRange = aBuiltInCriteria.Len() > 0 ? uno::makeAny( rtl::OUString( aBuiltInCriteria ) ) : aCriteriaRange; + } + if ( aCriteriaRange.hasValue() ) + { + table::CellRangeAddress criteriaRangeAddress = getCellRangeAddressForVBARange( aCriteriaRange, getScDocShell(), aConv ); + ScRange refRange; + ScUnoConversion::FillScRange( refRange, criteriaRangeAddress ); + uno::Reference< table::XCellRange > xRange( new ScCellRangeObj( getScDocShell(), refRange ) ); + uno::Reference< sheet::XSheetFilterableEx > xCriteria( xRange, uno::UNO_QUERY ); + if ( xCriteria.is() ) + { + xFilterDesc = xCriteria->createFilterDescriptorByObject( xSheetFilter ); + } + } + else if ( mxRange.is() ) + { + uno::Reference< sheet::XSheetFilterableEx > xCriteria( mxRange, uno::UNO_QUERY ); + if ( xCriteria.is() ) + { + xFilterDesc = xCriteria->createFilterDescriptorByObject( xSheetFilter ); + } + } + + uno::Reference< beans::XPropertySet > xPropertySet( xFilterDesc, uno::UNO_QUERY ); + if ( xPropertySet.is() ) + { + xPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_COPYOUT ) ), uno::makeAny( bCopyOut ) ); + } + + // CopyToRange + if ( bCopyOut && CopyToRange.hasValue() && xPropertySet.is() ) + { + formula::FormulaGrammar::AddressConvention aTmpConv = formula::FormulaGrammar::CONV_XL_A1; + if ( CopyToRange.getValueTypeClass() == uno::TypeClass_STRING ) + { + rtl::OUString rRangeString; + CopyToRange >>= rRangeString; + aTmpConv = excel::IsR1C1ReferFormat( pDoc, rRangeString ) ? formula::FormulaGrammar::CONV_XL_R1C1 : aConv; + } + ScRange refRange; + ScUnoConversion::FillScRange( refRange, getCellRangeAddressForVBARange( CopyToRange, getScDocShell(), aTmpConv ) ); + uno::Reference< table::XCellRange > xRange( new ScCellRangeObj( getScDocShell(), refRange ) ); + uno::Reference< sheet::XCellAddressable > xCellAddr( xRange->getCellByPosition( 0, 0 ), uno::UNO_QUERY_THROW ); + xPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_OUTPOS ) ), uno::makeAny( xCellAddr->getCellAddress() ) ); + } + + // Unique + if ( xPropertySet.is() ) + { + sal_Bool bUnique = sal_False; + uno::Any aUnique; + try + { + aUnique <<= bUnique; + aUnique = ( xConverter.is() && Unique.hasValue() ) ? xConverter->convertTo( Unique, getCppuType( ( sal_Bool* ) 0 ) ) : aUnique; + } + catch( const uno::Exception& ) + { + } + xPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_SKIPDUP ) ), aUnique ); + } + + // Do filter. + if ( xFilterDesc.is() ) + { + xSheetFilter->filter( xFilterDesc ); + } + + return aRet; +} + +//Add by minz@cn.ibm.com. Range.PivotTable. +//Returns a PivotTable object that represents the PivotTable report containing the upper-left corner of the specified range. +uno::Reference< excel::XPivotTable > +ScVbaRange::PivotTable() throw (uno::RuntimeException) +{ + uno::Reference< excel::XPivotTable > xDestPVTable; + + uno::Reference< sheet::XSpreadsheet > xSheet; + if ( mxRange.is() ) + { + RangeHelper thisRange( mxRange ); + xSheet = thisRange.getSpreadSheet(); + } + else if ( mxRanges.is() ) + { + uno::Reference< container::XIndexAccess > xIndex( mxRanges, uno::UNO_QUERY_THROW ); + uno::Reference< table::XCellRange > xRange( xIndex->getByIndex( 0 ), uno::UNO_QUERY_THROW ); + RangeHelper thisRange( xRange ); + xSheet = thisRange.getSpreadSheet(); + } + +// RangeHelper thisRange( mxRange ); +// uno::Reference< sheet::XSpreadsheet > xSheet = thisRange.getSpreadSheet(); + uno::Reference< sheet::XDataPilotTablesSupplier > xTables(xSheet, uno::UNO_QUERY_THROW ) ; + uno::Reference< container::XIndexAccess > xIndexAccess( xTables->getDataPilotTables(), uno::UNO_QUERY_THROW ); + if ( xIndexAccess.is() ) + { + //get the upper-left cell address + table::CellAddress aAddress = getLeftUpperCellAddress(); + + sal_Int32 nCount = xIndexAccess->getCount(); + for (sal_Int32 i=0; i < nCount; i++) + { + uno::Reference< sheet::XDataPilotTable > xDPTable(xIndexAccess->getByIndex(i), uno::UNO_QUERY); + uno::Reference< sheet::XDataPilotTable2 > xDPTable2(xDPTable, uno::UNO_QUERY); + + //check if the cell is in the pivot table + sheet::DataPilotTablePositionData posData = xDPTable2->getPositionData(aAddress); + table::CellRangeAddress aCellRangeAddress = xDPTable->getOutputRange(); + ScRange aScRange( aCellRangeAddress.StartColumn, aCellRangeAddress.StartRow, aCellRangeAddress.Sheet, + aCellRangeAddress.EndColumn, aCellRangeAddress.EndRow, aCellRangeAddress.Sheet ); + ScAddress aPos( aAddress.Column, aAddress.Row, aAddress.Sheet ); + if( !(posData.PositionType == sheet::DataPilotTablePositionType::NOT_IN_TABLE) || aScRange.In( aPos ) ) + { + xDestPVTable = new ScVbaPivotTable( mxContext, xDPTable ); + break; + } + } + } + return xDestPVTable; +} + + rtl::OUString& ScVbaRange::getServiceImplName() { @@ -5658,6 +6207,25 @@ ScVbaRange::getServiceNames() return aServiceNames; } +sal_Bool SAL_CALL +ScVbaRange::hasError() throw (uno::RuntimeException) +{ + double dResult = sal_False; + uno::Reference< excel::XApplication > xApplication( Application(), uno::UNO_QUERY_THROW ); + uno::Reference< script::XInvocation > xInvoc( xApplication->WorksheetFunction(), uno::UNO_QUERY_THROW ); + + static rtl::OUString FunctionName( RTL_CONSTASCII_USTRINGPARAM("IsError" ) ); + uno::Sequence< uno::Any > Params(1); + uno::Reference< excel::XRange > aRange( this ); + Params[0] = uno::makeAny( aRange ); + uno::Sequence< sal_Int16 > OutParamIndex; + uno::Sequence< uno::Any > OutParam; + xInvoc->invoke( FunctionName, Params, OutParamIndex, OutParam ) >>= dResult; + if ( dResult > 0.0 ) + return sal_True; + return sal_False; +} + namespace range { namespace sdecl = comphelper::service_decl; @@ -5667,3 +6235,5 @@ extern sdecl::ServiceDecl const serviceDecl( "SvVbaRange", "ooo.vba.excel.Range" ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbarange.hxx b/sc/source/ui/vba/vbarange.hxx index 84a65e7e2af5..ac745ef42279 100644 --- a/sc/source/ui/vba/vbarange.hxx +++ b/sc/source/ui/vba/vbarange.hxx @@ -35,6 +35,7 @@ #include <ooo/vba/excel/XFont.hpp> #include <ooo/vba/excel/XComment.hpp> #include <ooo/vba/XCollection.hpp> +#include <ooo/vba/excel/XPivotTable.hpp> #include <ooo/vba/excel/XlPasteType.hdl> #include <ooo/vba/excel/XlPasteSpecialOperation.hdl> @@ -49,6 +50,8 @@ #include <com/sun/star/sheet/FillDirection.hpp> #include <com/sun/star/sheet/XSpreadsheet.hpp> #include <com/sun/star/sheet/XSheetCellRangeContainer.hpp> +#include <com/sun/star/table/CellAddress.hpp> +#include "vbaquerytable.hxx" //09-09-18 add by limingl #include "vbaformat.hxx" #include <formula/grammar.hxx> @@ -97,6 +100,7 @@ class ScVbaRange : public ScVbaRange_BASE sal_Bool mbIsRows; sal_Bool mbIsColumns; css::uno::Reference< ov::excel::XValidation > m_xValidation; + css::uno::Reference<excel::XQueryTable> m_xQueryTable; //09-09-16 add by limingl double getCalcColWidth( const css::table::CellRangeAddress& ) throw (css::uno::RuntimeException); double getCalcRowHeight( const css::table::CellRangeAddress& ) throw (css::uno::RuntimeException); void visitArray( ArrayVisitor& vistor ); @@ -146,8 +150,10 @@ public: const css::uno::Reference< css::uno::XComponentContext >& xContext, const rtl::OUString& sRangeName, ScDocShell* pDocSh, formula::FormulaGrammar::AddressConvention eConv = formula::FormulaGrammar::CONV_XL_A1 ) throw ( css::uno::RuntimeException ); + css::table::CellAddress getLeftUpperCellAddress(); // Attributes + virtual css::uno::Any SAL_CALL getName() throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL getValue() throw (css::uno::RuntimeException); virtual void SAL_CALL setValue( const css::uno::Any& aValue ) throw ( css::uno::RuntimeException); virtual css::uno::Any SAL_CALL getFormula() throw (css::uno::RuntimeException); @@ -188,6 +194,7 @@ public: virtual css::uno::Any SAL_CALL getPrefixCharacter() throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL getShowDetail() throw (css::uno::RuntimeException); virtual void SAL_CALL setShowDetail(const css::uno::Any& aShowDetail) throw (css::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::ooo::vba::excel::XQueryTable > SAL_CALL getQueryTable() throw (::com::sun::star::uno::RuntimeException); //09-09-16 add by limingl // Methods sal_Bool IsRows() { return mbIsRows; } sal_Bool IsColumns() { return mbIsColumns; } @@ -238,7 +245,7 @@ public: virtual css::uno::Any SAL_CALL BorderAround( const css::uno::Any& LineStyle, const css::uno::Any& Weight, const css::uno::Any& ColorIndex, const css::uno::Any& Color ) throw (css::uno::RuntimeException); virtual void SAL_CALL TextToColumns( const css::uno::Any& Destination, const css::uno::Any& DataType, const css::uno::Any& TextQualifier, - const css::uno::Any& ConsecutinveDelimiter, const css::uno::Any& Tab, const css::uno::Any& Semicolon, const css::uno::Any& Comma, + const css::uno::Any& ConsecutiveDelimiter, const css::uno::Any& Tab, const css::uno::Any& Semicolon, const css::uno::Any& Comma, const css::uno::Any& Space, const css::uno::Any& Other, const css::uno::Any& OtherChar, const css::uno::Any& FieldInfo, const css::uno::Any& DecimalSeparator, const css::uno::Any& ThousandsSeparator, const css::uno::Any& TrailingMinusNumbers ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL Hyperlinks( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); @@ -263,6 +270,11 @@ public: virtual void SAL_CALL RemoveSubtotal( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); virtual css::uno::Reference< ov::excel::XRange > SAL_CALL MergeArea() throw (css::script::BasicErrorException, css::uno::RuntimeException); virtual void SAL_CALL Subtotal( ::sal_Int32 GroupBy, ::sal_Int32 Function, const css::uno::Sequence< ::sal_Int32 >& TotalList, const css::uno::Any& Replace, const css::uno::Any& PageBreaks, const css::uno::Any& SummaryBelowData ) throw (css::script::BasicErrorException, css::uno::RuntimeException); + virtual css::uno::Any SAL_CALL AdvancedFilter( ::sal_Int32 Action, const css::uno::Any& CriteriaRange, const css::uno::Any& CopyToRange, const css::uno::Any& Unique ) throw (css::script::BasicErrorException, css::uno::RuntimeException); + + virtual css::uno::Reference< ov::excel::XPivotTable > SAL_CALL PivotTable( ) throw (css::uno::RuntimeException); + + virtual ::sal_Int32 SAL_CALL CopyFromRecordset( const ::com::sun::star::uno::Any& Data, const ::com::sun::star::uno::Any& MaxRows, const ::com::sun::star::uno::Any& MaxColumns ) throw (::com::sun::star::script::BasicErrorException, ::com::sun::star::uno::RuntimeException); //2008-08-25 add by limingl // XEnumerationAccess virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException); // XElementAccess @@ -288,6 +300,8 @@ public: static css::uno::Reference< ov::excel::XRange > ApplicationRange( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Any &Cell1, const css::uno::Any &Cell2 ) throw (css::uno::RuntimeException); virtual sal_Bool SAL_CALL GoalSeek( const css::uno::Any& Goal, const css::uno::Reference< ov::excel::XRange >& ChangingCell ) throw (css::uno::RuntimeException); virtual css::uno::Reference< ov::excel::XRange > SAL_CALL SpecialCells( const css::uno::Any& _oType, const css::uno::Any& _oValue) throw ( css::script::BasicErrorException ); + // XErrorQuery + virtual ::sal_Bool SAL_CALL hasError( ) throw (css::uno::RuntimeException); // XHelperInterface virtual rtl::OUString& getServiceImplName(); virtual css::uno::Sequence<rtl::OUString> getServiceNames(); diff --git a/sc/source/ui/vba/vbaseriescollection.cxx b/sc/source/ui/vba/vbaseriescollection.cxx index 8caa746beff0..1ccb7bda8f7f 100644 --- a/sc/source/ui/vba/vbaseriescollection.cxx +++ b/sc/source/ui/vba/vbaseriescollection.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -78,3 +79,4 @@ ScVbaSeriesCollection::getServiceNames() return sNames; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbasheetobject.cxx b/sc/source/ui/vba/vbasheetobject.cxx index 4bd0f1d60547..652c8e4f87b1 100644 --- a/sc/source/ui/vba/vbasheetobject.cxx +++ b/sc/source/ui/vba/vbasheetobject.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -515,3 +516,5 @@ void ScVbaButton::implSetDefaultProperties() throw (uno::RuntimeException) } // ============================================================================ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbasheetobjects.cxx b/sc/source/ui/vba/vbasheetobjects.cxx index ced94db5ba76..3847209989f9 100644 --- a/sc/source/ui/vba/vbasheetobjects.cxx +++ b/sc/source/ui/vba/vbasheetobjects.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -532,3 +533,5 @@ ScVbaButtons::ScVbaButtons( VBAHELPER_IMPL_XHELPERINTERFACE( ScVbaButtons, "ooo.vba.excel.Buttons" ) // ============================================================================ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbastyle.cxx b/sc/source/ui/vba/vbastyle.cxx index b99b2e783101..83d72dd99c05 100644 --- a/sc/source/ui/vba/vbastyle.cxx +++ b/sc/source/ui/vba/vbastyle.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -184,3 +185,5 @@ ScVbaStyle::getServiceNames() } return aServiceNames; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbastyles.cxx b/sc/source/ui/vba/vbastyles.cxx index c323e2b3f6f6..b07d98e81b80 100644 --- a/sc/source/ui/vba/vbastyles.cxx +++ b/sc/source/ui/vba/vbastyles.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -180,3 +181,5 @@ ScVbaStyles::getServiceNames() } return aServiceNames; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbatextboxshape.cxx b/sc/source/ui/vba/vbatextboxshape.cxx index 0ef9e0f7393b..b5502fac9aa8 100644 --- a/sc/source/ui/vba/vbatextboxshape.cxx +++ b/sc/source/ui/vba/vbatextboxshape.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -64,3 +65,5 @@ ScVbaTextBoxShape::characters( const uno::Any& Start, const uno::Any& Length ) t ScVbaPalette aPalette( pDoc->GetDocumentShell() ); return new ScVbaCharacters( this, mxContext, aPalette, xSimple, Start, Length, sal_True ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbatextframe.cxx b/sc/source/ui/vba/vbatextframe.cxx index b06777526c1f..dffbed8b511f 100644 --- a/sc/source/ui/vba/vbatextframe.cxx +++ b/sc/source/ui/vba/vbatextframe.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -76,3 +77,5 @@ extern sdecl::ServiceDecl const serviceDecl( "ScVbaTextFrame", "ooo.vba.excel.TextFrame" ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbavalidation.cxx b/sc/source/ui/vba/vbavalidation.cxx index e2a768549e11..36662c87c598 100644 --- a/sc/source/ui/vba/vbavalidation.cxx +++ b/sc/source/ui/vba/vbavalidation.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -25,6 +26,7 @@ * ************************************************************************/ #include "vbavalidation.hxx" +#include "vbaformatcondition.hxx" #include <com/sun/star/sheet/XSheetCondition.hpp> #include <com/sun/star/sheet/ValidationType.hpp> #include <com/sun/star/sheet/ValidationAlertStyle.hpp> @@ -225,8 +227,10 @@ ScVbaValidation::Delete( ) throw (uno::RuntimeException) lcl_setValidationProps( m_xRange, xProps ); } + +// Fix the defect that validatation cannot work when the input should be limited between a lower bound and an upper bound void SAL_CALL -ScVbaValidation::Add( const uno::Any& Type, const uno::Any& AlertStyle, const uno::Any& /*Operator*/, const uno::Any& Formula1, const uno::Any& Formula2 ) throw (uno::RuntimeException) +ScVbaValidation::Add( const uno::Any& Type, const uno::Any& AlertStyle, const uno::Any& Operator, const uno::Any& Formula1, const uno::Any& Formula2 ) throw (uno::RuntimeException) { uno::Reference< beans::XPropertySet > xProps( lcl_getValidationProps( m_xRange ) ); uno::Reference< sheet::XSheetCondition > xCond( xProps, uno::UNO_QUERY_THROW ); @@ -291,6 +295,13 @@ ScVbaValidation::Add( const uno::Any& Type, const uno::Any& AlertStyle, const un xProps->setPropertyValue( ALERTSTYLE, uno::makeAny( eStyle ) ); + //2009-11-11 fix the defect that validatation cannot work when the input should be limited between a lower bound and an upper bound + if ( Operator.hasValue() ) + { + css::sheet::ConditionOperator conOperator = ScVbaFormatCondition::retrieveAPIOperator( Operator ); + xCond->setOperator( conOperator ); + } + //2009-11-11 if ( sFormula1.getLength() ) xCond->setFormula1( sFormula1 ); if ( sFormula2.getLength() ) @@ -331,3 +342,5 @@ ScVbaValidation::getServiceNames() } return aServiceNames; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbawindow.cxx b/sc/source/ui/vba/vbawindow.cxx index 10dad39341b7..a31d348ff7c8 100644 --- a/sc/source/ui/vba/vbawindow.cxx +++ b/sc/source/ui/vba/vbawindow.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -856,3 +857,5 @@ extern sdecl::ServiceDecl const serviceDecl( "ScVbaWindow", "ooo.vba.excel.Window" ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbawindows.cxx b/sc/source/ui/vba/vbawindows.cxx index e21ca2c53090..f7a3e6acb589 100644 --- a/sc/source/ui/vba/vbawindows.cxx +++ b/sc/source/ui/vba/vbawindows.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -257,3 +258,5 @@ ScVbaWindows::getServiceNames() } return sNames; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbaworkbook.cxx b/sc/source/ui/vba/vbaworkbook.cxx index 28469c4685a2..3e9fa27443cb 100644 --- a/sc/source/ui/vba/vbaworkbook.cxx +++ b/sc/source/ui/vba/vbaworkbook.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -36,6 +37,7 @@ #include <com/sun/star/frame/XFrame.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <ooo/vba/excel/XlFileFormat.hpp> +#include <ooo/vba/excel/XApplication.hpp> //liuchen 2009-12-16 #include "scextopt.hxx" #include "vbaworksheet.hxx" @@ -125,7 +127,7 @@ ScVbaWorkbook::Colors( const ::uno::Any& Index ) throw (::script::BasicErrorExce } ::sal_Int32 SAL_CALL -ScVbaWorkbook::FileFormat( ) throw (::script::BasicErrorException, ::uno::RuntimeException) +ScVbaWorkbook::getFileFormat( ) throw (::uno::RuntimeException) { sal_Int32 aFileFormat = 0; rtl::OUString aFilterName; @@ -185,6 +187,24 @@ ScVbaWorkbook::FileFormat( ) throw (::script::BasicErrorException, ::uno::Runti return aFileFormat; } +//VBA by minz@cn.ibm.com. Convert Excel fileformat to OO file filter +::rtl::OUString ScVbaWorkbook::convertFileFormat(sal_Int32 aFileFormat) +{ + rtl::OUString aFilterName; + + switch(aFileFormat) + { + case excel::XlFileFormat::xlCSV: + aFilterName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Text - txt - csv (StarCalc)" ) ); + break; + case excel::XlFileFormat::xlExcel9795: + aFilterName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MS Excel 97" ) ); + break; + } + + return aFilterName; +} + void ScVbaWorkbook::init() { @@ -264,6 +284,12 @@ ScVbaWorkbook::Activate() throw (uno::RuntimeException) VbaDocumentBase::Activate(); } +void +ScVbaWorkbook::Protect( const uno::Any &aPassword ) throw (uno::RuntimeException) +{ + VbaDocumentBase::Protect( aPassword ); +} + ::sal_Bool ScVbaWorkbook::getProtectStructure() throw (uno::RuntimeException) { @@ -299,6 +325,50 @@ ScVbaWorkbook::SaveCopyAs( const rtl::OUString& sFileName ) throw ( uno::Runtime xStor->storeToURL( aURL, storeProps ); } +//VBA by minz@cn.ibm.com. Add Workbook.SaveAs. +void +ScVbaWorkbook::SaveAs( const rtl::OUString& FileName, const uno::Any& FileFormat, const uno::Any& /*CreateBackup*/ ) throw ( uno::RuntimeException) +{ + rtl::OUString aURL; + osl::FileBase::getFileURLFromSystemPath( FileName, aURL ); + //liuchen 2009-12-16 if the input parameter "FileName" takes the form as "MyFile", we need to get the current directory and combine the current directory and the file name + INetURLObject aFileNameURL( aURL ); + aURL = aFileNameURL.GetMainURL( INetURLObject::NO_DECODE ); + if ( aURL.getLength() == 0 ) + { + uno::Reference< excel::XApplication > xApplication ( Application(),uno::UNO_QUERY_THROW ); + rtl::OUString aPathStr = xApplication->getDefaultFilePath(); + rtl::OUString aPathURLStr; + osl::FileBase::getFileURLFromSystemPath( aPathStr, aPathURLStr ); + INetURLObject aPathURL( aPathURLStr ); + aPathURL.Append( FileName ); + aURL = aPathURL.GetMainURL( INetURLObject::NO_DECODE ); + } + //liuchen 2009-12-16 + uno::Reference< frame::XStorable > xStor( getModel(), uno::UNO_QUERY_THROW ); + + sal_Int32 aFileFormat = excel::XlFileFormat::xlExcel9795; + FileFormat >>= aFileFormat; + + if ( FileName.indexOf('.') == -1 ) + { + if ( aFileFormat == excel::XlFileFormat::xlExcel9795 ) + { + aURL = aURL + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".xls" ) ); + } + else if ( aFileFormat == excel::XlFileFormat::xlCSV ) + { + aURL = aURL + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".csv" ) ); + } + } + + uno::Sequence< beans::PropertyValue > storeProps(1); + storeProps[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FilterName" ) ); + storeProps[0].Value <<= convertFileFormat(aFileFormat); + + xStor->storeAsURL( aURL, storeProps ); +} + css::uno::Any SAL_CALL ScVbaWorkbook::Styles( const::uno::Any& Item ) throw (uno::RuntimeException) { @@ -361,3 +431,5 @@ extern sdecl::ServiceDecl const serviceDecl( "ScVbaWorkbook", "ooo.vba.excel.Workbook" ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbaworkbook.hxx b/sc/source/ui/vba/vbaworkbook.hxx index 4aff58078403..a5ccea180dd3 100644 --- a/sc/source/ui/vba/vbaworkbook.hxx +++ b/sc/source/ui/vba/vbaworkbook.hxx @@ -41,6 +41,8 @@ class ScVbaWorkbook : public ScVbaWorkbook_BASE static css::uno::Sequence< sal_Int32 > ColorData; void initColorData( const css::uno::Sequence< sal_Int32 >& sColors ); void init(); + + ::rtl::OUString convertFileFormat(sal_Int32 aFileFormat); protected: ScVbaWorkbook( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext); @@ -61,20 +63,25 @@ public: virtual css::uno::Any SAL_CALL Sheets( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL Windows( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); virtual void SAL_CALL Activate() throw (css::uno::RuntimeException); + virtual void SAL_CALL Protect( const css::uno::Any & aPassword ) throw (css::uno::RuntimeException); // Amelia Wang virtual css::uno::Any SAL_CALL Names( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL Styles( const css::uno::Any& Item ) throw (css::uno::RuntimeException); virtual void SAL_CALL ResetColors( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); virtual css::uno::Any SAL_CALL Colors( const css::uno::Any& Index ) throw (css::script::BasicErrorException, css::uno::RuntimeException); - virtual ::sal_Int32 SAL_CALL FileFormat( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getFileFormat( ) throw (css::uno::RuntimeException); virtual void SAL_CALL SaveCopyAs( const rtl::OUString& Filename ) throw ( css::uno::RuntimeException); + virtual void SAL_CALL SaveAs( const rtl::OUString& FileName, const css::uno::Any& FileFormat, const css::uno::Any& CreateBackup ) throw (css::uno::RuntimeException); + // code name virtual ::rtl::OUString SAL_CALL getCodeName() throw ( css::uno::RuntimeException); // XHelperInterface virtual rtl::OUString& getServiceImplName(); virtual css::uno::Sequence<rtl::OUString> getServiceNames(); + + virtual css::uno::Reference< css::frame::XModel > getDocModel() { return mxModel; } }; #endif /* SC_VBA_WORKBOOK_HXX */ diff --git a/sc/source/ui/vba/vbaworkbooks.cxx b/sc/source/ui/vba/vbaworkbooks.cxx index 7efee1505dcb..67de260af9aa 100644 --- a/sc/source/ui/vba/vbaworkbooks.cxx +++ b/sc/source/ui/vba/vbaworkbooks.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -365,3 +366,5 @@ ScVbaWorkbooks::getServiceNames() } return sNames; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbaworksheet.cxx b/sc/source/ui/vba/vbaworksheet.cxx index d76aa7bd612e..ca00ef9ee495 100644 --- a/sc/source/ui/vba/vbaworksheet.cxx +++ b/sc/source/ui/vba/vbaworksheet.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -63,6 +64,7 @@ #include <ooo/vba/excel/XlEnableSelection.hpp> #include <ooo/vba/excel/XWorkbook.hpp> #include <ooo/vba/XControlProvider.hpp> +#include <ooo/vba/excel/XlSheetVisibility.hpp> #include <comphelper/processfactory.hxx> #include <vbahelper/vbashapes.hxx> @@ -80,7 +82,7 @@ #include "cellsuno.hxx" #include "drwlayer.hxx" - +#include "tabprotection.hxx" #include "scextopt.hxx" #include "vbaoutline.hxx" #include "vbarange.hxx" @@ -94,6 +96,7 @@ #include "vbaworksheets.hxx" #include "vbahyperlinks.hxx" #include "vbasheetobjects.hxx" +#include "viewuno.hxx" //liuchen 2009-9-2 #define STANDARDWIDTH 2267 #define STANDARDHEIGHT 427 @@ -221,7 +224,7 @@ ScVbaWorksheet::setName(const ::rtl::OUString &rName ) throw (uno::RuntimeExcept xNamed->setName( rName ); } -sal_Bool +::sal_Int32 ScVbaWorksheet::getVisible() throw (uno::RuntimeException) { uno::Reference< beans::XPropertySet > xProps( getSheet(), uno::UNO_QUERY_THROW ); @@ -229,13 +232,33 @@ ScVbaWorksheet::getVisible() throw (uno::RuntimeException) (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsVisible" ) ) ); sal_Bool bRet = false; aValue >>= bRet; - return bRet; + if ( bRet ) + { + return excel::XlSheetVisibility::xlSheetVisible; + } + else + { + return excel::XlSheetVisibility::xlSheetHidden; + } } void -ScVbaWorksheet::setVisible( sal_Bool bVisible ) throw (uno::RuntimeException) +ScVbaWorksheet::setVisible( ::sal_Int32 _Visible ) throw (uno::RuntimeException) { uno::Reference< beans::XPropertySet > xProps( getSheet(), uno::UNO_QUERY_THROW ); + + //VBA by minz@cn.ibm.com. + sal_Bool bVisible = true; + switch( _Visible ) + { + case excel::XlSheetVisibility::xlSheetHidden: + case excel::XlSheetVisibility::xlSheetVeryHidden: + bVisible = false; + break; + case excel::XlSheetVisibility::xlSheetVisible: + bVisible = true; + break; + } uno::Any aValue( bVisible ); xProps->setPropertyValue (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsVisible" ) ), aValue); @@ -427,6 +450,18 @@ ScVbaWorksheet::getProtectContents()throw (uno::RuntimeException) sal_Bool ScVbaWorksheet::getProtectDrawingObjects() throw (uno::RuntimeException) { + SCTAB nTab = 0; + rtl::OUString aSheetName = getName(); + uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( getModel(), uno::UNO_QUERY_THROW ); + bool bSheetExists = ScVbaWorksheets::nameExists (xSpreadDoc, aSheetName, nTab); + if ( bSheetExists ) + { + uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_QUERY_THROW ); + ScDocument* pDoc = excel::getDocShell( xModel )->GetDocument(); + ScTableProtection* pProtect = pDoc->GetTabProtection(nTab); + if ( pProtect ) + return pProtect->isOptionEnabled( ScTableProtection::OBJECTS ); + } return sal_False; } @@ -444,10 +479,30 @@ ScVbaWorksheet::Activate() throw (uno::RuntimeException) xSpreadsheet->setActiveSheet(getSheet()); } +//liuchen 2009-9-2, support expand (but not replace) the active sheet void -ScVbaWorksheet::Select() throw (uno::RuntimeException) +ScVbaWorksheet::Select(const css::uno::Any& aReplace) throw (uno::RuntimeException) { - Activate(); + sal_Bool bReplace = true; + if (aReplace.hasValue() && aReplace.getValueTypeClass() == uno::TypeClass_BOOLEAN) + { + aReplace >>= bReplace; + } + + uno::Reference< sheet::XSpreadsheetView > xSpreadsheet( + getModel()->getCurrentController(), uno::UNO_QUERY_THROW ); + ScTabViewObj* pTabView = static_cast< ScTabViewObj* >( xSpreadsheet.get() ); + + if (bReplace) + { + pTabView->selectSheet(getSheet(), false); + } + else + { + uno::Reference< sheet::XSpreadsheet > xOldActiveSheet = pTabView->getActiveSheet(); + pTabView->selectSheet(getSheet(), true); + pTabView->selectSheet(xOldActiveSheet, true); + } } void @@ -509,18 +564,42 @@ ScVbaWorksheet::Copy( const uno::Any& Before, const uno::Any& After ) throw (uno return; } - uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( getModel(), uno::UNO_QUERY ); + ScVbaWorksheet* pDestSheet = static_cast< ScVbaWorksheet* >(xSheet.get()); + uno::Reference <sheet::XSpreadsheetDocument> xDestDoc( pDestSheet->getModel(), uno::UNO_QUERY ); + uno::Reference <sheet::XSpreadsheetDocument> xSrcDoc( getModel(), uno::UNO_QUERY ); + SCTAB nDest = 0; + SCTAB nSrc = 0; rtl::OUString aSheetName = xSheet->getName(); - if ( ScVbaWorksheets::nameExists (xSpreadDoc, aSheetName, nDest ) ) + bool bSameDoc = ( pDestSheet->getModel() == getModel() ); + bool bDestSheetExists = ScVbaWorksheets::nameExists (xDestDoc, aSheetName, nDest ); + bool bSheetExists = ScVbaWorksheets::nameExists (xSrcDoc, aCurrSheetName, nSrc ); + + // set sheet name to be newSheet name + aSheetName = aCurrSheetName; + SCTAB nDummy=0; + if ( bSheetExists && bDestSheetExists ) { sal_Bool bAfter = After.hasValue(); if(bAfter) nDest++; - uno::Reference<sheet::XSpreadsheets> xSheets = xSpreadDoc->getSheets(); - getNewSpreadsheetName(aSheetName,aCurrSheetName,xSpreadDoc); - xSheets->copyByName(aCurrSheetName,aSheetName,nDest); + uno::Reference<sheet::XSpreadsheets> xSheets = xDestDoc->getSheets(); + if ( bSameDoc || ScVbaWorksheets::nameExists( xDestDoc, aCurrSheetName, nDummy ) ) + getNewSpreadsheetName(aSheetName,aCurrSheetName,xDestDoc); + if ( bSameDoc ) + xSheets->copyByName(aCurrSheetName,aSheetName,nDest); + else + { + ScDocShell* pDestDocShell = excel::getDocShell( pDestSheet->getModel() ); + ScDocShell* pSrcDocShell = excel::getDocShell( getModel() ); + if ( pDestDocShell && pSrcDocShell ) + pDestDocShell->TransferTab( *pSrcDocShell, static_cast<SCTAB>(nSrc), static_cast<SCTAB>(nDest), TRUE, TRUE ); + } } + // active the new sheet + uno::Reference< excel::XApplication > xApplication( Application(), uno::UNO_QUERY_THROW ); + uno::Reference< excel::XWorksheet > xNewSheet( xApplication->Worksheets( uno::makeAny( aSheetName ) ), uno::UNO_QUERY_THROW ); + xNewSheet->Activate(); } @@ -572,13 +651,25 @@ ScVbaWorksheet::getSheetAtOffset(SCTAB offset) throw (uno::RuntimeException) uno::Reference< excel::XWorksheet > ScVbaWorksheet::getNext() throw (uno::RuntimeException) { - return getSheetAtOffset(static_cast<SCTAB>(1)); + //VBA, minz@cn.ibm.com. catch the exception for index out of bound + try{ + return getSheetAtOffset(static_cast<SCTAB>(1)); + }catch( lang::IndexOutOfBoundsException& /*e*/ ) + { + return NULL; + } } uno::Reference< excel::XWorksheet > ScVbaWorksheet::getPrevious() throw (uno::RuntimeException) { - return getSheetAtOffset(-1); + //VBA, minz@cn.ibm.com. catch the exception for index out of bound + try{ + return getSheetAtOffset(-1); + }catch( lang::IndexOutOfBoundsException& /*e*/ ) + { + return NULL; + } } @@ -662,7 +753,7 @@ ScVbaWorksheet::ChartObjects( const uno::Any& Index ) throw (uno::RuntimeExcepti uno::Reference< table::XTableChartsSupplier > xChartSupplier( getSheet(), uno::UNO_QUERY_THROW ); uno::Reference< table::XTableCharts > xTableCharts = xChartSupplier->getCharts(); - uno::Reference< drawing::XDrawPageSupplier > xDrawPageSupplier( mxSheet, uno::UNO_QUERY_THROW ); + uno::Reference< drawing::XDrawPageSupplier > xDrawPageSupplier( getSheet(), uno::UNO_QUERY_THROW ); //VBA, minz@cn.ibm.com. mxCharts = new ScVbaChartObjects( this, mxContext, xTableCharts, xDrawPageSupplier ); } if ( Index.hasValue() ) @@ -981,7 +1072,7 @@ ScVbaWorksheet::getCodeName() throw (css::uno::RuntimeException) sal_Int16 ScVbaWorksheet::getSheetID() throw (uno::RuntimeException) { - uno::Reference< sheet::XCellRangeAddressable > xAddressable( mxSheet, uno::UNO_QUERY_THROW ); + uno::Reference< sheet::XCellRangeAddressable > xAddressable( getSheet(), uno::UNO_QUERY_THROW ); //VBA. minz@cn.ibm.com. if ActiveSheet, mxSheet is null. return xAddressable->getRangeAddress().Sheet; } @@ -1017,3 +1108,5 @@ extern sdecl::ServiceDecl const serviceDecl( "ScVbaWorksheet", "ooo.vba.excel.Worksheet" ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbaworksheet.hxx b/sc/source/ui/vba/vbaworksheet.hxx index 78bcc2503a49..adcfd4af16fa 100644 --- a/sc/source/ui/vba/vbaworksheet.hxx +++ b/sc/source/ui/vba/vbaworksheet.hxx @@ -42,6 +42,7 @@ #include <ooo/vba/excel/XPageSetup.hpp> #include <ooo/vba/excel/XHPageBreaks.hpp> #include <ooo/vba/excel/XVPageBreaks.hpp> +#include <com/sun/star/container/XNamed.hpp> #include <vbahelper/vbahelperinterface.hxx> #include "address.hxx" @@ -91,8 +92,8 @@ public: // Attributes virtual ::rtl::OUString SAL_CALL getName() throw (css::uno::RuntimeException); virtual void SAL_CALL setName( const ::rtl::OUString &rName ) throw (css::uno::RuntimeException); - virtual sal_Bool SAL_CALL getVisible() throw (css::uno::RuntimeException); - virtual void SAL_CALL setVisible( sal_Bool bVisible ) throw (css::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getVisible() throw (css::uno::RuntimeException); + virtual void SAL_CALL setVisible( ::sal_Int32 _Visible ) throw (css::uno::RuntimeException); virtual ::sal_Int32 SAL_CALL getStandardWidth() throw (css::uno::RuntimeException); virtual ::sal_Int32 SAL_CALL getStandardHeight() throw (css::uno::RuntimeException); virtual ::sal_Bool SAL_CALL getProtectionMode() throw (css::uno::RuntimeException); @@ -115,7 +116,7 @@ public: // Methods virtual void SAL_CALL Activate() throw (css::uno::RuntimeException); - virtual void SAL_CALL Select() throw (css::uno::RuntimeException); + virtual void SAL_CALL Select(const css::uno::Any& aReplace) throw (css::uno::RuntimeException); //liuchen 2009-9-2, add the input parameter to support expand selection virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Range( const css::uno::Any& Cell1, const css::uno::Any& Cell2 ) throw (css::uno::RuntimeException); virtual void SAL_CALL Move( const css::uno::Any& Before, const css::uno::Any& After ) throw (css::uno::RuntimeException) ; virtual void SAL_CALL Copy( const css::uno::Any& Before, const css::uno::Any& After ) throw (css::uno::RuntimeException); diff --git a/sc/source/ui/vba/vbaworksheets.cxx b/sc/source/ui/vba/vbaworksheets.cxx index 7fa5196a6b04..cb345950958b 100644 --- a/sc/source/ui/vba/vbaworksheets.cxx +++ b/sc/source/ui/vba/vbaworksheets.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -499,3 +500,5 @@ ScVbaWorksheets::getServiceNames() } return false; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/vba/vbawsfunction.cxx b/sc/source/ui/vba/vbawsfunction.cxx index 60daa7303f2e..b87ec852b9a5 100644 --- a/sc/source/ui/vba/vbawsfunction.cxx +++ b/sc/source/ui/vba/vbawsfunction.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -60,6 +61,18 @@ void lclConvertDoubleToBoolean( uno::Any& rAny ) } } +void lclConvertBooleanToDouble( uno::Any& rAny ) +{ + sal_Bool bValue( sal_False ); + if ( rAny >>= bValue ) + { + if ( bValue ) + rAny <<= double( 1.0 ); + else + rAny <<= double( 0.0 ); + } +} + } // namespace ScVbaWSFunction::ScVbaWSFunction( const uno::Reference< XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext ) : @@ -84,9 +97,57 @@ ScVbaWSFunction::invoke(const rtl::OUString& FunctionName, const uno::Sequence< uno::Any* pArrayEnd = pArray + aParamTemp.getLength(); for( ; pArray < pArrayEnd; ++pArray ) { - uno::Reference< excel::XRange > myRange( *pArray, uno::UNO_QUERY ); - if( myRange.is() ) - *pArray = myRange->getCellRange(); + switch( pArray->getValueType().getTypeClass() ) + { + case uno::TypeClass_BOOLEAN: + lclConvertBooleanToDouble( *pArray ); + break; + case uno::TypeClass_INTERFACE: + { + uno::Reference< excel::XRange > myRange( *pArray, uno::UNO_QUERY ); + if( myRange.is() ) + *pArray = myRange->getCellRange(); + } + break; + case uno::TypeClass_SEQUENCE: + { + // the sheet.FunctionAccess service doesn't deal with Sequences, only Sequences of Sequence + uno::Type aType = pArray->getValueType(); + if ( aType.equals( getCppuType( (uno::Sequence<sal_Int16>*)0 ) ) ) + { + uno::Sequence< uno::Sequence< sal_Int16 > > aTmp(1); + (*pArray) >>= aTmp[ 0 ]; + (*pArray) <<= aTmp; + } + else if ( aType.equals( getCppuType( (uno::Sequence<sal_Int32>*)0 ) ) ) + { + uno::Sequence< uno::Sequence< sal_Int32 > > aTmp(1); + (*pArray) >>= aTmp[ 0 ]; + (*pArray) <<= aTmp; + } + else if ( aType.equals( getCppuType( (uno::Sequence<double>*)0 ) ) ) + { + uno::Sequence< uno::Sequence< double > > aTmp(1); + (*pArray) >>= aTmp[ 0 ]; + (*pArray) <<= aTmp; + } + else if ( aType.equals( getCppuType( (uno::Sequence<rtl::OUString>*)0 ) ) ) + { + uno::Sequence< uno::Sequence< rtl::OUString > > aTmp(1); + (*pArray) >>= aTmp[ 0 ]; + (*pArray) <<= aTmp; + } + else if ( aType.equals( getCppuType( (uno::Sequence<uno::Any>*)0 ) ) ) + { + uno::Sequence< uno::Sequence<uno::Any > > aTmp(1); + (*pArray) >>= aTmp[ 0 ]; + (*pArray) <<= aTmp; + } + } + break; + default: + break; + } OSL_TRACE("Param[%d] is %s", (int)(pArray - aParamTemp.getConstArray()), rtl::OUStringToOString( comphelper::anyToString( *pArray ), RTL_TEXTENCODING_UTF8 ).getStr() ); } } @@ -257,3 +318,5 @@ ScVbaWSFunction::getServiceNames() } return aServiceNames; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/auditsh.cxx b/sc/source/ui/view/auditsh.cxx index 2c80c154759d..115055b2f136 100644 --- a/sc/source/ui/view/auditsh.cxx +++ b/sc/source/ui/view/auditsh.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -153,3 +154,4 @@ void ScAuditingShell::GetState( SfxItemSet& rSet ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/cellmergeoption.cxx b/sc/source/ui/view/cellmergeoption.cxx index da531966cb19..ff5220ec907e 100644 --- a/sc/source/ui/view/cellmergeoption.cxx +++ b/sc/source/ui/view/cellmergeoption.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -72,3 +73,5 @@ ScRange ScCellMergeOption::getFirstSingleRange() const return getSingleRange(nTab); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx index c880a29f8067..7cfa50a4e686 100644 --- a/sc/source/ui/view/cellsh.cxx +++ b/sc/source/ui/view/cellsh.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1003,3 +1004,4 @@ void ScCellShell::GetState(SfxItemSet &rSet) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index de05496a12d8..750d3648631e 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -2193,3 +2194,5 @@ void ScCellShell::PasteFromClipboard( ScViewData* pViewData, ScTabViewShell* pTa } pTabViewShell->CellContentChanged(); // => PasteFromSystem() ??? } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx index 2e318a920898..c619e34309fe 100644 --- a/sc/source/ui/view/cellsh2.cxx +++ b/sc/source/ui/view/cellsh2.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -334,6 +335,20 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) } break; + case SID_DATA_FORM: + { + ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); + DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001 + + AbstractScDataFormDlg* pDlg = pFact->CreateScDataFormDlg( pTabViewShell->GetDialogParent(),RID_SCDLG_DATAFORM, pTabViewShell); + DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001 + + pDlg->Execute(); + + rReq.Done(); + } + break; + case SID_SUBTOTALS: { const SfxItemSet* pArgs = rReq.GetArgs(); @@ -1401,3 +1416,4 @@ void __EXPORT ScCellShell::GetDBState( SfxItemSet& rSet ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx index bd74d7794e65..a57835fdf54d 100644 --- a/sc/source/ui/view/cellsh3.cxx +++ b/sc/source/ui/view/cellsh3.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -928,3 +929,4 @@ void ScCellShell::Execute( SfxRequest& rReq ) } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/cellsh4.cxx b/sc/source/ui/view/cellsh4.cxx index bd4708805a7d..f5c4e70ae98a 100644 --- a/sc/source/ui/view/cellsh4.cxx +++ b/sc/source/ui/view/cellsh4.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -452,3 +453,4 @@ void ScCellShell::ExecutePage( SfxRequest& rReq ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/colrowba.cxx b/sc/source/ui/view/colrowba.cxx index f2322f6de317..c94e08803594 100644 --- a/sc/source/ui/view/colrowba.cxx +++ b/sc/source/ui/view/colrowba.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -415,3 +416,4 @@ BOOL ScRowBar::IsMirrored() // overloaded only for rows } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/dbfunc.cxx b/sc/source/ui/view/dbfunc.cxx index b1969fbcdf70..299a7d665c2d 100644 --- a/sc/source/ui/view/dbfunc.cxx +++ b/sc/source/ui/view/dbfunc.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -511,3 +512,4 @@ BOOL ScDBFunc::ImportData( const ScImportParam& rParam, BOOL bRecord ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/dbfunc2.cxx b/sc/source/ui/view/dbfunc2.cxx index 54ddde9b7710..f789daea996d 100644 --- a/sc/source/ui/view/dbfunc2.cxx +++ b/sc/source/ui/view/dbfunc2.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -75,3 +76,4 @@ void ScDBFunc::UpdateCharts( BOOL bAllCharts ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx index 9004c5fc486f..2c2df72120fa 100644 --- a/sc/source/ui/view/dbfunc3.cxx +++ b/sc/source/ui/view/dbfunc3.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -2369,3 +2370,5 @@ void ScDBFunc::RepeatDB( BOOL bRecord ) else // "Keine Operationen auszufuehren" ErrorMessage(STR_MSSG_REPEATDB_0); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/dbfunc4.cxx b/sc/source/ui/view/dbfunc4.cxx index 870622293e37..a96dc2970875 100644 --- a/sc/source/ui/view/dbfunc4.cxx +++ b/sc/source/ui/view/dbfunc4.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -100,3 +101,4 @@ USHORT ScDBFunc::DoUpdateCharts( const ScAddress& rPos, ScDocument* pDoc, BOOL b +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/drawattr.cxx b/sc/source/ui/view/drawattr.cxx index fa7872617c03..36615b14525d 100644 --- a/sc/source/ui/view/drawattr.cxx +++ b/sc/source/ui/view/drawattr.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -80,3 +81,4 @@ SfxPoolItem* __EXPORT SvxDrawToolItem::Create( SvStream& rStream, USHORT nVer ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/drawutil.cxx b/sc/source/ui/view/drawutil.cxx index ba250767c169..4270170e099a 100644 --- a/sc/source/ui/view/drawutil.cxx +++ b/sc/source/ui/view/drawutil.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -114,3 +115,4 @@ void ScDrawUtil::CalcScale( ScDocument* pDoc, SCTAB nTab, +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/drawvie2.cxx b/sc/source/ui/view/drawvie2.cxx index c760ce86a3d7..c047fcdbd6fe 100644 --- a/sc/source/ui/view/drawvie2.cxx +++ b/sc/source/ui/view/drawvie2.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -60,3 +61,4 @@ void ScDrawView::VCRemoveWin( Window* /* pWin */ ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/drawvie3.cxx b/sc/source/ui/view/drawvie3.cxx index ffa1efe28654..3ef141f2c526 100644 --- a/sc/source/ui/view/drawvie3.cxx +++ b/sc/source/ui/view/drawvie3.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -180,3 +181,4 @@ void ScDrawView::UpdateIMap( SdrObject* pObj ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/drawvie4.cxx b/sc/source/ui/view/drawvie4.cxx index 3a28096d2853..c88274d65dab 100644 --- a/sc/source/ui/view/drawvie4.cxx +++ b/sc/source/ui/view/drawvie4.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -392,3 +393,4 @@ void ScDrawView::SetMarkedOriginalSize() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx index 8a30a1ce9d39..d47136d8fc51 100644 --- a/sc/source/ui/view/drawview.cxx +++ b/sc/source/ui/view/drawview.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -805,3 +806,5 @@ void ScDrawView::MarkDropObj( SdrObject* pObj ) } } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx index e282cbef2881..01e5b5a9a3b1 100644 --- a/sc/source/ui/view/editsh.cxx +++ b/sc/source/ui/view/editsh.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1198,3 +1199,4 @@ void ScEditShell::ExecuteTrans( SfxRequest& rReq ) } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx index 0e5e7ebb71b9..6b71dbc61514 100644 --- a/sc/source/ui/view/formatsh.cxx +++ b/sc/source/ui/view/formatsh.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -2269,3 +2270,5 @@ short ScFormatShell::GetCurrentNumberFormatType() } return nType; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/galwrap.cxx b/sc/source/ui/view/galwrap.cxx index 1d92cb5f303a..2e5f8f831bad 100644 --- a/sc/source/ui/view/galwrap.cxx +++ b/sc/source/ui/view/galwrap.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -77,3 +78,4 @@ String GalleryGetFilterName() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/gridmerg.cxx b/sc/source/ui/view/gridmerg.cxx index 5a1f501e38ca..31dba191b2fd 100644 --- a/sc/source/ui/view/gridmerg.cxx +++ b/sc/source/ui/view/gridmerg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -172,3 +173,4 @@ void ScGridMerger::Flush() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 4fe8b2435e66..3d11b21e26ec 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -5856,3 +5857,5 @@ void ScGridWindow::flushOverlayManager() // --------------------------------------------------------------------------- // eof + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx index 3574426f731b..4aa2b1476759 100644 --- a/sc/source/ui/view/gridwin2.cxx +++ b/sc/source/ui/view/gridwin2.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -144,7 +145,8 @@ bool ScGridWindow::DoAutoFilterButton( SCCOL nCol, SCROW nRow, const MouseEvent& // Check if the mouse cursor is clicking on the popup arrow box. mpFilterButton.reset(new ScDPFieldButton(this, &GetSettings().GetStyleSettings(), &pViewData->GetZoomX(), &pViewData->GetZoomY(), pDoc)); - mpFilterButton->setBoundingBox(aScrPos, aScrSize); + mpFilterButton->setBoundingBox(aScrPos, aScrSize, bLayoutRTL); + mpFilterButton->setPopupLeft(bLayoutRTL); // #i114944# AutoFilter button is left-aligned in RTL Point aPopupPos; Size aPopupSize; mpFilterButton->getPopupBoundingBox(aPopupPos, aPopupSize); @@ -367,6 +369,8 @@ void ScGridWindow::DPTestMouse( const MouseEvent& rMEvt, BOOL bMove ) bool ScGridWindow::DPTestFieldPopupArrow(const MouseEvent& rMEvt, const ScAddress& rPos, ScDPObject* pDPObj) { + BOOL bLayoutRTL = pViewData->GetDocument()->IsLayoutRTL( pViewData->GetTabNo() ); + // Get the geometry of the cell. Point aScrPos = pViewData->GetScrPos(rPos.Col(), rPos.Row(), eWhich); long nSizeX, nSizeY; @@ -375,7 +379,8 @@ bool ScGridWindow::DPTestFieldPopupArrow(const MouseEvent& rMEvt, const ScAddres // Check if the mouse cursor is clicking on the popup arrow box. ScDPFieldButton aBtn(this, &GetSettings().GetStyleSettings()); - aBtn.setBoundingBox(aScrPos, aScrSize); + aBtn.setBoundingBox(aScrPos, aScrSize, bLayoutRTL); + aBtn.setPopupLeft(false); // DataPilot popup is always right-aligned for now Point aPopupPos; Size aPopupSize; aBtn.getPopupBoundingBox(aPopupPos, aPopupSize); @@ -516,9 +521,16 @@ void ScGridWindow::DPLaunchFieldPopupMenu( } } + BOOL bLayoutRTL = pViewData->GetDocument()->IsLayoutRTL( pViewData->GetTabNo() ); + Rectangle aCellRect(rScrPos, rScrSize); const Size& rPopupSize = mpDPFieldPopup->getWindowSize(); - if (rScrSize.getWidth() > rPopupSize.getWidth()) + if (bLayoutRTL) + { + // RTL: rScrPos is logical-left (visual right) position, always right-align with that + aCellRect.SetPos(Point(rScrPos.X() - rPopupSize.Width() + 1, rScrPos.Y())); + } + else if (rScrSize.getWidth() > rPopupSize.getWidth()) { // If the cell width is larger than the popup window width, launch it // right-aligned with the cell. @@ -1044,3 +1056,4 @@ void ScGridWindow::PagebreakMove( const MouseEvent& rMEvt, BOOL bUp ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/gridwin3.cxx b/sc/source/ui/view/gridwin3.cxx index f16c2fe1ada7..9d220008907e 100644 --- a/sc/source/ui/view/gridwin3.cxx +++ b/sc/source/ui/view/gridwin3.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -441,3 +442,4 @@ void ScGridWindow::DrawMarkDropObj( SdrObject* pObj ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index c596e7e62c79..f86f79a1d25a 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1275,7 +1276,8 @@ void ScGridWindow::DrawButtons( SCCOL nX1, SCROW /*nY1*/, SCCOL nX2, SCROW /*nY2 pViewData->GetMergeSizePixel( nCol, nRow, nSizeX, nSizeY ); Point aScrPos = pViewData->GetScrPos( nCol, nRow, eWhich ); - aCellBtn.setBoundingBox(aScrPos, Size(nSizeX-1, nSizeY-1)); + aCellBtn.setBoundingBox(aScrPos, Size(nSizeX-1, nSizeY-1), bLayoutRTL); + aCellBtn.setPopupLeft(bLayoutRTL); // #i114944# AutoFilter button is left-aligned in RTL aCellBtn.setDrawBaseButton(false); aCellBtn.setDrawPopupButton(true); aCellBtn.setHasHiddenMember(bArrowState); @@ -1299,17 +1301,13 @@ void ScGridWindow::DrawButtons( SCCOL nX1, SCROW /*nY1*/, SCCOL nX2, SCROW /*nY2 pViewData->GetMergeSizePixel( nCol, nRow, nSizeX, nSizeY ); long nPosX = aScrPos.X(); long nPosY = aScrPos.Y(); - if ( bLayoutRTL ) - { - // overwrite the right, not left (visually) grid as long as the - // left/right colors of the button borders aren't mirrored. - nPosX -= nSizeX - 2; - } + // bLayoutRTL is handled in setBoundingBox String aStr; pDoc->GetString(nCol, nRow, nTab, aStr); aCellBtn.setText(aStr); - aCellBtn.setBoundingBox(Point(nPosX, nPosY), Size(nSizeX-1, nSizeY-1)); + aCellBtn.setBoundingBox(Point(nPosX, nPosY), Size(nSizeX-1, nSizeY-1), bLayoutRTL); + aCellBtn.setPopupLeft(false); // DataPilot popup is always right-aligned for now aCellBtn.setDrawBaseButton(true); aCellBtn.setDrawPopupButton(pInfo->bPopupButton); aCellBtn.setHasHiddenMember(pInfo->bFilterActive); @@ -1984,3 +1982,4 @@ void ScGridWindow::DataChanged( const DataChangedEvent& rDCEvt ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/gridwin5.cxx b/sc/source/ui/view/gridwin5.cxx index 4a9dbbaf98b6..1e4c09fd8c6b 100644 --- a/sc/source/ui/view/gridwin5.cxx +++ b/sc/source/ui/view/gridwin5.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -343,14 +344,12 @@ void ScGridWindow::RequestHelp(const HelpEvent& rHEvt) if ( pDrView->PickObj(aMDPos, pDrView->getHitTolLog(), pHit, pPV, SDRSEARCH_DEEP ) ) pObj = pHit; } -#ifdef ISSUE66550_HLINK_FOR_SHAPES ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj ); if ( pInfo && (pInfo->GetHlink().getLength() > 0) ) { aPixRect = LogicToPixel(aVEvt.pObj->GetLogicRect()); aHelpText = pInfo->GetHlink(); } -#endif } } } @@ -437,3 +436,5 @@ com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > return xAccessible; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/hdrcont.cxx b/sc/source/ui/view/hdrcont.cxx index 25f3c1c8f10a..f4a9fd4ddac2 100644 --- a/sc/source/ui/view/hdrcont.cxx +++ b/sc/source/ui/view/hdrcont.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1044,3 +1045,4 @@ void ScHeaderControl::SetMarking( BOOL /* bSet */ ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/hintwin.cxx b/sc/source/ui/view/hintwin.cxx index 568923f42838..301ba616e769 100644 --- a/sc/source/ui/view/hintwin.cxx +++ b/sc/source/ui/view/hintwin.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -106,3 +107,5 @@ void __EXPORT ScHintWindow::Paint( const Rectangle& /* rRect */ ) aLineStart.Y() += nTextHeight; } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/imapwrap.cxx b/sc/source/ui/view/imapwrap.cxx index b2f4fb714775..88e78ccf1ee6 100644 --- a/sc/source/ui/view/imapwrap.cxx +++ b/sc/source/ui/view/imapwrap.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -74,3 +75,4 @@ const ImageMap& ScIMapDlgGetMap( SvxIMapDlg* pDlg ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/invmerge.cxx b/sc/source/ui/view/invmerge.cxx index a895dc5faec0..cb913677e962 100644 --- a/sc/source/ui/view/invmerge.cxx +++ b/sc/source/ui/view/invmerge.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -190,3 +191,4 @@ void ScInvertMerger::AddRect( const Rectangle& rRect ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/notemark.cxx b/sc/source/ui/view/notemark.cxx index 065ba5899817..3ab921f8956e 100644 --- a/sc/source/ui/view/notemark.cxx +++ b/sc/source/ui/view/notemark.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -198,3 +199,4 @@ void ScNoteMarker::InvalidateWin() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/olinewin.cxx b/sc/source/ui/view/olinewin.cxx index b1e82fd9217f..9fd8e497d3b7 100644 --- a/sc/source/ui/view/olinewin.cxx +++ b/sc/source/ui/view/olinewin.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1043,3 +1044,4 @@ void ScOutlineWindow::KeyInput( const KeyEvent& rKEvt ) // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/olkact.cxx b/sc/source/ui/view/olkact.cxx index 248777f4e473..a5f63f5a15bd 100644 --- a/sc/source/ui/view/olkact.cxx +++ b/sc/source/ui/view/olkact.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -280,3 +281,4 @@ void DeActivateOlk( ScViewData* /* pViewData */ ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx index 38622bf18752..2cf8bab95e61 100644 --- a/sc/source/ui/view/output.cxx +++ b/sc/source/ui/view/output.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -2479,3 +2480,4 @@ void ScOutputData::DrawClipMarks() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index 74724b45b5be..32e3c6d9e0ab 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -1,3 +1,4 @@ +/* -*- 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 @@ #include <math.h> //! Autofilter-Breite mit column.cxx zusammenfassen -#define DROPDOWN_BITMAP_SIZE 17 +#define DROPDOWN_BITMAP_SIZE 18 #define DRAWTEXT_MAX 32767 @@ -1306,7 +1307,8 @@ void ScOutputData::GetOutputArea( SCCOL nX, SCSIZE nArrY, long nPosX, long nPosY ( static_cast<const ScMergeFlagAttr&>(rPattern.GetItem(ATTR_MERGE_FLAG)).GetValue() & SC_MF_AUTO ) && ( !bBreak || pRefDevice == pFmtDevice ) ) { - long nFilter = Min( nMergeSizeY, (long) DROPDOWN_BITMAP_SIZE ); + // filter drop-down width is now independent from row height + const long nFilter = DROPDOWN_BITMAP_SIZE; BOOL bFit = ( nNeeded + nFilter <= nMergeSizeX ); if ( bFit || bCellIsValue ) { @@ -3731,20 +3733,11 @@ void ScOutputData::DrawRotated(BOOL bPixelToLogic) eOrient!=SVX_ORIENTATION_STACKED && pInfo && pInfo->bAutoFilter) { - if (pRowInfo[nArrY].nHeight < DROPDOWN_BITMAP_SIZE) - { - if (bPixelToLogic) - nAvailWidth -= pRefDevice->PixelToLogic(Size(0,pRowInfo[nArrY].nHeight)).Height(); - else - nAvailWidth -= pRowInfo[nArrY].nHeight; - } + // filter drop-down width is now independent from row height + if (bPixelToLogic) + nAvailWidth -= pRefDevice->PixelToLogic(Size(0,DROPDOWN_BITMAP_SIZE)).Height(); else - { - if (bPixelToLogic) - nAvailWidth -= pRefDevice->PixelToLogic(Size(0,DROPDOWN_BITMAP_SIZE)).Height(); - else - nAvailWidth -= DROPDOWN_BITMAP_SIZE; - } + nAvailWidth -= DROPDOWN_BITMAP_SIZE; long nComp = nEngineWidth; if (nAvailWidth<nComp) nAvailWidth=nComp; } @@ -3917,3 +3910,4 @@ void ScOutputData::DrawRotated(BOOL bPixelToLogic) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/output3.cxx b/sc/source/ui/view/output3.cxx index 2c368937e156..b5bb920fb209 100644 --- a/sc/source/ui/view/output3.cxx +++ b/sc/source/ui/view/output3.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -274,3 +275,4 @@ void ScOutputData::DrawingSingle(const sal_uInt16 nLayer) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/overlayobject.cxx b/sc/source/ui/view/overlayobject.cxx index 7f44f451188f..a477f30576b1 100644 --- a/sc/source/ui/view/overlayobject.cxx +++ b/sc/source/ui/view/overlayobject.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -102,3 +103,5 @@ Primitive2DSequence ScOverlayDashedBorder::createOverlayObjectPrimitive2DSequenc return drawinglayer::primitive2d::Primitive2DSequence(&aReference, 1); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/pfuncache.cxx b/sc/source/ui/view/pfuncache.cxx index 6a206ef3eb13..569e9bf876ad 100644 --- a/sc/source/ui/view/pfuncache.cxx +++ b/sc/source/ui/view/pfuncache.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -194,3 +195,4 @@ long ScPrintFuncCache::GetDisplayStart( SCTAB nTab ) const } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/pgbrksh.cxx b/sc/source/ui/view/pgbrksh.cxx index 0e792b2bb279..e1d493dd3f24 100644 --- a/sc/source/ui/view/pgbrksh.cxx +++ b/sc/source/ui/view/pgbrksh.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -83,3 +84,4 @@ ScPageBreakShell::~ScPageBreakShell() } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/pivotsh.cxx b/sc/source/ui/view/pivotsh.cxx index d52759f5353e..f23082e1a041 100644 --- a/sc/source/ui/view/pivotsh.cxx +++ b/sc/source/ui/view/pivotsh.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -198,3 +199,4 @@ ScDPObject* ScPivotShell::GetCurrDPObject() rViewData.GetCurX(), rViewData.GetCurY(), rViewData.GetTabNo() ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx index 3ab6dc140484..8a504720ea0a 100644 --- a/sc/source/ui/view/preview.cxx +++ b/sc/source/ui/view/preview.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1611,3 +1612,5 @@ void ScPreview::DrawInvert( long nDragPos, USHORT nFlags ) } } //Issue51656 Add resizeable margin on page preview from maoyg + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/prevloc.cxx b/sc/source/ui/view/prevloc.cxx index 9ddb63a6a6d4..22e24170fba0 100644 --- a/sc/source/ui/view/prevloc.cxx +++ b/sc/source/ui/view/prevloc.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -752,3 +753,4 @@ BOOL ScPreviewLocationData::GetMainCellRange( ScRange& rRange, Rectangle& rPixRe return FALSE; // not found } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx index d12c5492f883..ec316617e20e 100644 --- a/sc/source/ui/view/prevwsh.cxx +++ b/sc/source/ui/view/prevwsh.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1232,3 +1233,4 @@ ScDocument* ScPreviewShell::GetDocument() } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/prevwsh2.cxx b/sc/source/ui/view/prevwsh2.cxx index 07af90f797aa..6677798f9dcf 100644 --- a/sc/source/ui/view/prevwsh2.cxx +++ b/sc/source/ui/view/prevwsh2.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -355,3 +356,4 @@ void __EXPORT ScPreviewShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx index 92434a17d12d..8180c1b8ea1e 100644 --- a/sc/source/ui/view/printfun.cxx +++ b/sc/source/ui/view/printfun.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -3200,3 +3201,4 @@ ScJobSetup::ScJobSetup( SfxPrinter* pPrinter ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/reffact.cxx b/sc/source/ui/view/reffact.cxx index 0d5d64964f5c..21d66c5a39be 100644 --- a/sc/source/ui/view/reffact.cxx +++ b/sc/source/ui/view/reffact.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -432,3 +433,5 @@ ScValidityRefChildWin::~ScValidityRefChildWin() pWindow = NULL; } //-->Added by PengYunQuan for Validity Cell Range Picker + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/scextopt.cxx b/sc/source/ui/view/scextopt.cxx index fe5a91f54bd4..c9af56f00d33 100644 --- a/sc/source/ui/view/scextopt.cxx +++ b/sc/source/ui/view/scextopt.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -223,3 +224,4 @@ void ScExtDocOptions::SetCodeName( SCTAB nTab, const String& rCodeName ) // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/select.cxx b/sc/source/ui/view/select.cxx index 72ee0fdaadfa..292e155c132b 100644 --- a/sc/source/ui/view/select.cxx +++ b/sc/source/ui/view/select.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -890,3 +891,4 @@ ScHeaderSelectionEngine::ScHeaderSelectionEngine( Window* pWindow, ScHeaderFunct +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/selectionstate.cxx b/sc/source/ui/view/selectionstate.cxx index 0edd50a0b825..3412dd53f03a 100644 --- a/sc/source/ui/view/selectionstate.cxx +++ b/sc/source/ui/view/selectionstate.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -87,3 +88,4 @@ bool operator==( const ScSelectionState& rL, const ScSelectionState& rR ) // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/spelldialog.cxx b/sc/source/ui/view/spelldialog.cxx index ee13ee9fbf90..f2100ba6d918 100644 --- a/sc/source/ui/view/spelldialog.cxx +++ b/sc/source/ui/view/spelldialog.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -277,3 +278,4 @@ bool ScSpellDialogChildWindow::IsSelectionChanged() // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/spelleng.cxx b/sc/source/ui/view/spelleng.cxx index ac6288028dfc..457395fd9deb 100644 --- a/sc/source/ui/view/spelleng.cxx +++ b/sc/source/ui/view/spelleng.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -456,3 +457,4 @@ bool ScTextConversionEngine::NeedsConversion() // ============================================================================ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/tabcont.cxx b/sc/source/ui/view/tabcont.cxx index 1048c903ec4a..daea22b78027 100644 --- a/sc/source/ui/view/tabcont.cxx +++ b/sc/source/ui/view/tabcont.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -54,8 +55,9 @@ //================================================================== ScTabControl::ScTabControl( Window* pParent, ScViewData* pData ) : - TabBar( pParent, WinBits( WB_BORDER | WB_3DLOOK | WB_SCROLL | WB_INSERTTAB | - WB_RANGESELECT | WB_MULTISELECT | WB_DRAG | WB_SIZEABLE ) ), + TabBar( pParent, + WinBits(WB_BORDER | WB_3DLOOK | WB_SCROLL | WB_RANGESELECT | + WB_MULTISELECT | WB_DRAG | WB_SIZEABLE) ), DropTargetHelper( this ), DragSourceHelper( this ), pViewData( pData ), @@ -94,6 +96,7 @@ ScTabControl::ScTabControl( Window* pParent, ScViewData* pData ) : SetSplitHdl( LINK( pViewData->GetView(), ScTabView, TabBarResize ) ); EnableEditMode(); + UpdateInputContext(); } ScTabControl::~ScTabControl() @@ -297,6 +300,17 @@ void ScTabControl::Select() } } +void ScTabControl::UpdateInputContext() +{ + ScDocument* pDoc = pViewData->GetDocument(); + WinBits nStyle = GetStyle(); + if (pDoc->GetDocumentShell()->IsReadOnly()) + // no insert sheet tab for readonly doc. + SetStyle((nStyle & ~WB_INSERTTAB)); + else + SetStyle((nStyle | WB_INSERTTAB)); +} + void ScTabControl::UpdateStatus() { ScDocument* pDoc = pViewData->GetDocument(); @@ -648,3 +662,4 @@ void ScTabControl::Mirror() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/tabpopsh.cxx b/sc/source/ui/view/tabpopsh.cxx index f5033d5d0df5..bb610ada84c0 100644 --- a/sc/source/ui/view/tabpopsh.cxx +++ b/sc/source/ui/view/tabpopsh.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -70,3 +71,5 @@ void ScTabPopShell::DummyExec( SfxRequest& rReq ) void ScTabPopShell::DummyState( SfxItemSet& rSet ) { } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/tabsplit.cxx b/sc/source/ui/view/tabsplit.cxx index 0f72e0e73d02..7babaad6d154 100644 --- a/sc/source/ui/view/tabsplit.cxx +++ b/sc/source/ui/view/tabsplit.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -103,3 +104,4 @@ void ScTabSplitter::SetFixed(BOOL bSet) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index 9fe3800e0ef8..d988338eb62a 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -2490,3 +2491,4 @@ void ScTabView::EnableRefInput(BOOL bFlag) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx index ce068e0ef6b2..91e5cc3cc96a 100644 --- a/sc/source/ui/view/tabview2.cxx +++ b/sc/source/ui/view/tabview2.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1280,3 +1281,4 @@ void ScTabView::UpdatePageBreakData( BOOL bForcePaint ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index 983113760bb9..bffd30928982 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1419,9 +1420,11 @@ void ScTabView::MarkRange( const ScRange& rRange, BOOL bSetCursor, BOOL bContinu { SCCOL nAlignX = rRange.aStart.Col(); SCROW nAlignY = rRange.aStart.Row(); - if ( rRange.aStart.Col() == 0 && rRange.aEnd.Col() == MAXCOL ) + bool bCol = ( rRange.aStart.Col() == 0 && rRange.aEnd.Col() == MAXCOL ) && !aViewData.GetDocument()->IsInVBAMode(); + bool bRow = ( rRange.aStart.Row() == 0 && rRange.aEnd.Row() == MAXROW ); + if ( bCol ) nAlignX = aViewData.GetPosX(WhichH(aViewData.GetActivePart())); - if ( rRange.aStart.Row() == 0 && rRange.aEnd.Row() == MAXROW ) + if ( bRow ) nAlignY = aViewData.GetPosY(WhichV(aViewData.GetActivePart())); AlignToCursor( nAlignX, nAlignY, SC_FOLLOW_JUMP ); } @@ -1535,6 +1538,7 @@ void ScTabView::SetTabNo( SCTAB nTab, BOOL bNew, BOOL bExtendSelection ) // nicht InputEnterHandler wegen Referenzeingabe ! ScDocument* pDoc = aViewData.GetDocument(); + pDoc->MakeTable( nTab ); // Update pending row heights before switching the sheet, so Reschedule from the progress bar @@ -2610,6 +2614,9 @@ void ScTabView::UpdateInputContext() ScGridWindow* pWin = pGridWin[aViewData.GetActivePart()]; if (pWin) pWin->UpdateInputContext(); + + if (pTabControl) + pTabControl->UpdateInputContext(); } // GetGridWidth - Breite eines Ausgabebereichs (fuer ViewData) @@ -2709,3 +2716,4 @@ void ScTabView::CheckNeedsRepaint() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/tabview4.cxx b/sc/source/ui/view/tabview4.cxx index 00652e2f76d2..13ef6ca977b0 100644 --- a/sc/source/ui/view/tabview4.cxx +++ b/sc/source/ui/view/tabview4.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -563,3 +564,4 @@ void ScTabView::InterpretVisible() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/tabview5.cxx b/sc/source/ui/view/tabview5.cxx index c19efabad2f3..b23d252248b2 100644 --- a/sc/source/ui/view/tabview5.cxx +++ b/sc/source/ui/view/tabview5.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -712,3 +713,4 @@ void ScTabView::ResetBrushDocument() } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/tabvwsh.cxx b/sc/source/ui/view/tabvwsh.cxx index 2fc2bba072d9..d5e166d121a7 100644 --- a/sc/source/ui/view/tabvwsh.cxx +++ b/sc/source/ui/view/tabvwsh.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -115,3 +116,5 @@ IMPL_LINK( ScTabViewShell, HtmlOptionsHdl, void*, EMPTYARG ) GetViewFrame()->GetBindings().Invalidate(SID_DRAW_TEXT_MARQUEE); return 0; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/tabvwsh2.cxx b/sc/source/ui/view/tabvwsh2.cxx index 26e040ede0b0..81a011516cbd 100644 --- a/sc/source/ui/view/tabvwsh2.cxx +++ b/sc/source/ui/view/tabvwsh2.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -478,3 +479,4 @@ BOOL ScTabViewShell::SelectObject( const String& rName ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx index 5f98cf3e1cb1..7eb78c81d003 100644 --- a/sc/source/ui/view/tabvwsh3.cxx +++ b/sc/source/ui/view/tabvwsh3.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1233,3 +1234,4 @@ void ScTabViewShell::Execute( SfxRequest& rReq ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx index 7b944a32efe0..56e51c591466 100644 --- a/sc/source/ui/view/tabvwsh4.cxx +++ b/sc/source/ui/view/tabvwsh4.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1762,6 +1763,13 @@ void ScTabViewShell::Construct( BYTE nForceDesignMode ) if ( pDocSh->GetCreateMode() != SFX_CREATE_MODE_EMBEDDED ) { SCTAB nInitTabCount = 3; //! konfigurierbar !!! + // Get the customized initial tab count, we only can set the count by VBA API currently. + const ScAppOptions& rAppOpt = SC_MOD()->GetAppOptions(); + SCTAB nNewTabCount = rAppOpt.GetTabCountInNewSpreadsheet(); + if ( nNewTabCount >= 1 && nNewTabCount <= MAXTAB ) + { + nInitTabCount = nNewTabCount; + } for (SCTAB i=1; i<nInitTabCount; i++) pDoc->MakeTable(i,false); } @@ -2049,3 +2057,4 @@ void ScTabViewShell::GetTbxState( SfxItemSet& rSet ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/tabvwsh5.cxx b/sc/source/ui/view/tabvwsh5.cxx index 1a3dd6928a17..c6cb9d5cfb37 100644 --- a/sc/source/ui/view/tabvwsh5.cxx +++ b/sc/source/ui/view/tabvwsh5.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -426,3 +427,4 @@ void ScTabViewShell::UpdateNumberFormatter( +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/tabvwsh8.cxx b/sc/source/ui/view/tabvwsh8.cxx index b3612fa0c6f2..2f4ca5c72bab 100644 --- a/sc/source/ui/view/tabvwsh8.cxx +++ b/sc/source/ui/view/tabvwsh8.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -102,3 +103,4 @@ void ScTabViewShell::UIDeactivated( SfxInPlaceClient* pClient ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/tabvwsh9.cxx b/sc/source/ui/view/tabvwsh9.cxx index 30f9c50fd925..3984465f1f50 100644 --- a/sc/source/ui/view/tabvwsh9.cxx +++ b/sc/source/ui/view/tabvwsh9.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -293,3 +294,4 @@ void ScTabViewShell::GetImageMapState( SfxItemSet& rSet ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx index c7f75d161b54..aaa55a4ad596 100644 --- a/sc/source/ui/view/tabvwsha.cxx +++ b/sc/source/ui/view/tabvwsha.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -890,3 +891,4 @@ void ScTabViewShell::GetDrawOptState( SfxItemSet& rSet ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx index 8f4a203ea14d..f650b0bb68cd 100644 --- a/sc/source/ui/view/tabvwshb.cxx +++ b/sc/source/ui/view/tabvwshb.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -498,3 +499,4 @@ void ScTabViewShell::GetDrawInsState(SfxItemSet &rSet) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx index 3b0ee60ef4e8..9bd1efdcd521 100644 --- a/sc/source/ui/view/tabvwshc.cxx +++ b/sc/source/ui/view/tabvwshc.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -331,3 +332,4 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog( +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/tabvwshd.cxx b/sc/source/ui/view/tabvwshd.cxx index 4ef5186a25a0..45875808926f 100644 --- a/sc/source/ui/view/tabvwshd.cxx +++ b/sc/source/ui/view/tabvwshd.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -98,3 +99,4 @@ Window* ScTabViewShell::GetDialogParent() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/tabvwshe.cxx b/sc/source/ui/view/tabvwshe.cxx index c0af39226c3f..07be1e04f39f 100644 --- a/sc/source/ui/view/tabvwshe.cxx +++ b/sc/source/ui/view/tabvwshe.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -339,3 +340,4 @@ void ScTabViewShell::ExecSearch( SfxRequest& rReq ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx index 5e0630b366f4..f9cd0eb20637 100644 --- a/sc/source/ui/view/tabvwshf.cxx +++ b/sc/source/ui/view/tabvwshf.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -964,3 +965,4 @@ void ScTabViewShell::GetStateTable( SfxItemSet& rSet ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/tabvwshg.cxx b/sc/source/ui/view/tabvwshg.cxx index b30b07c43cb9..f7aac8b56da4 100644 --- a/sc/source/ui/view/tabvwshg.cxx +++ b/sc/source/ui/view/tabvwshg.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -138,3 +139,4 @@ void ScTabViewShell::InsertURLButton( const String& rName, const String& rURL, +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/tabvwshh.cxx b/sc/source/ui/view/tabvwshh.cxx index 480514741bae..c462c48abe9c 100644 --- a/sc/source/ui/view/tabvwshh.cxx +++ b/sc/source/ui/view/tabvwshh.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -291,3 +292,4 @@ bool ScTabViewShell::ExecuteRetypePassDlg(ScPasswordHash eDesiredHash) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index c36bcd51271c..4ffb4d6db889 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -3113,3 +3114,5 @@ void ScViewData::AddPixelsWhileBackward( long & rScrY, long nEndPixels, ++nRow; rPosY = nRow; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx index c2b8cf77a420..49f93c43ffac 100644 --- a/sc/source/ui/view/viewfun2.cxx +++ b/sc/source/ui/view/viewfun2.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -52,6 +53,11 @@ #include <vcl/sound.hxx> #include <vcl/waitobj.hxx> +#include <basic/sbstar.hxx> +#include <com/sun/star/container/XNameContainer.hpp> +#include <com/sun/star/script/XLibraryContainer.hpp> +using namespace com::sun::star; + #include "viewfunc.hxx" #include "sc.hrc" @@ -2200,6 +2206,8 @@ BOOL ScViewFunc::DeleteTables(const SvShorts &TheTabs, BOOL bRecord ) WaitObject aWait( GetFrameWin() ); if (bRecord && !pDoc->IsUndoEnabled()) bRecord = FALSE; + if ( bVbaEnabled ) + bRecord = FALSE; while ( nNewTab > 0 && !pDoc->IsVisible( nNewTab ) ) --nNewTab; @@ -2307,6 +2315,7 @@ BOOL ScViewFunc::DeleteTables(const SvShorts &TheTabs, BOOL bRecord ) pDocSh->PostPaintExtras(); pDocSh->SetDocumentModified(); + SfxApplication* pSfxApp = SFX_APP(); // Navigator pSfxApp->Broadcast( SfxSimpleHint( SC_HINT_TABLES_CHANGED ) ); pSfxApp->Broadcast( SfxSimpleHint( SC_HINT_DBAREAS_CHANGED ) ); @@ -2451,8 +2460,8 @@ void ScViewFunc::ImportTables( ScDocShell* pSrcShell, { SCTAB nSrcTab = pSrcTabs[i]; SCTAB nDestTab1=nTab+i; - ULONG nErrVal = pDoc->TransferTab( pSrcDoc, nSrcTab, nDestTab1, - FALSE ); // no insert + ULONG nErrVal = pDocSh->TransferTab( *pSrcShell, nSrcTab, nDestTab1, + FALSE, FALSE ); // no insert switch (nErrVal) { @@ -2470,25 +2479,6 @@ void ScViewFunc::ImportTables( ScDocShell* pSrcShell, break; } - // TransferTab doesn't copy drawing objects with bInsertNew=FALSE - if ( !bError ) - pDoc->TransferDrawPage( pSrcDoc, nSrcTab, nDestTab1 ); - - if(!bError &&pSrcDoc->IsScenario(nSrcTab)) - { - String aComment; - Color aColor; - USHORT nFlags; - - pSrcDoc->GetScenarioData(nSrcTab, aComment,aColor, nFlags); - pDoc->SetScenario( nDestTab1,TRUE); - pDoc->SetScenarioData( nTab+i,aComment,aColor,nFlags); - BOOL bActive = pSrcDoc->IsActiveScenario(nSrcTab ); - pDoc->SetActiveScenario( nDestTab1, bActive ); - BOOL bVisible=pSrcDoc->IsVisible(nSrcTab); - pDoc->SetVisible(nDestTab1,bVisible ); - - } } if (bLink) @@ -2672,33 +2662,7 @@ void ScViewFunc::MoveTable( USHORT nDestDocNo, SCTAB nDestTab, BOOL bCopy ) nDestTab1 = nDestTab; for(USHORT i=0;i<TheTabs.Count();i++) { - nErrVal = pDestDoc->TransferTab( pDoc, TheTabs[i], nDestTab1, - FALSE ); // no insert - - // TransferTab doesn't copy drawing objects with bInsertNew=FALSE - if ( nErrVal > 0 ) - pDestDoc->TransferDrawPage( pDoc, TheTabs[i], nDestTab1 ); - - if(nErrVal>0 && pDoc->IsScenario(TheTabs[i])) - { - String aComment; - Color aColor; - USHORT nFlags; - - pDoc->GetScenarioData(TheTabs[i], aComment,aColor, nFlags); - pDestDoc->SetScenario(nDestTab1,TRUE); - pDestDoc->SetScenarioData(nDestTab1,aComment,aColor,nFlags); - BOOL bActive = pDoc->IsActiveScenario(TheTabs[i]); - pDestDoc->SetActiveScenario(nDestTab1, bActive ); - - BOOL bVisible=pDoc->IsVisible(TheTabs[i]); - pDestDoc->SetVisible(nDestTab1,bVisible ); - - } - - if ( nErrVal > 0 && pDoc->IsTabProtected( TheTabs[i] ) ) - pDestDoc->SetTabProtection(nDestTab1, pDoc->GetTabProtection(TheTabs[i])); - + nErrVal = pDestShell->TransferTab( *pDocShell, static_cast<SCTAB>(TheTabs[i]), static_cast<SCTAB>(nDestTab1), FALSE, FALSE ); nDestTab1++; } } @@ -3192,3 +3156,4 @@ void ScViewFunc::SetValidation( const ScValidationData& rNew ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx index 24fab9ac2eba..184d4cba65c3 100644 --- a/sc/source/ui/view/viewfun3.cxx +++ b/sc/source/ui/view/viewfun3.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -210,6 +211,7 @@ #include "drwtrans.hxx" #include "docuno.hxx" #include "clipparam.hxx" +#include "undodat.hxx" // Amelia Wang using namespace com::sun::star; @@ -506,6 +508,76 @@ BOOL ScViewFunc::CopyToClip( ScDocument* pClipDoc, BOOL bCut, BOOL bApi, BOOL bI return bDone; } +// Copy the content of the Range into clipboard. Adding this method for VBA API: Range.Copy(). +BOOL ScViewFunc::CopyToClip( ScDocument* pClipDoc, const ScRange& rRange, BOOL bCut, BOOL bApi, BOOL bIncludeObjects, BOOL bStopEdit ) +{ + BOOL bDone = FALSE; + if ( bStopEdit ) + UpdateInputLine(); + + ScRange aRange = rRange; + ScDocument* pDoc = GetViewData()->GetDocument(); + if ( pDoc && !pDoc->HasSelectedBlockMatrixFragment( aRange.aStart.Col(), aRange.aStart.Row(), aRange.aEnd.Col(), aRange.aEnd.Row(), aRange.aStart.Tab() ) ) + { + BOOL bSysClip = FALSE; + if ( !pClipDoc ) + { + // Create one (deleted by ScTransferObj). + pClipDoc = new ScDocument( SCDOCMODE_CLIP ); + bSysClip = TRUE; + } + if ( !bCut ) + { + ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack(); + if ( pChangeTrack ) + pChangeTrack->ResetLastCut(); + } + + if ( bSysClip && bIncludeObjects ) + { + BOOL bAnyOle = pDoc->HasOLEObjectsInArea( aRange ); + // Update ScGlobal::pDrawClipDocShellRef. + ScDrawLayer::SetGlobalDrawPersist( ScTransferObj::SetDrawClipDoc( bAnyOle ) ); + } + + ScClipParam aClipParam( aRange, bCut ); + pDoc->CopyToClip4VBA( aClipParam, pClipDoc, false, bIncludeObjects ); + if ( bSysClip ) + { + ScDrawLayer::SetGlobalDrawPersist(NULL); + ScGlobal::SetClipDocName( pDoc->GetDocumentShell()->GetTitle( SFX_TITLE_FULLNAME ) ); + } + pClipDoc->ExtendMerge( aRange, TRUE ); + + if ( bSysClip ) + { + ScDocShell* pDocSh = GetViewData()->GetDocShell(); + TransferableObjectDescriptor aObjDesc; + pDocSh->FillTransferableObjectDescriptor( aObjDesc ); + aObjDesc.maDisplayName = pDocSh->GetMedium()->GetURLObject().GetURLNoPass(); + + ScTransferObj* pTransferObj = new ScTransferObj( pClipDoc, aObjDesc ); + uno::Reference<datatransfer::XTransferable> xTransferable( pTransferObj ); + if ( ScGlobal::pDrawClipDocShellRef ) + { + SfxObjectShellRef aPersistRef( &(*ScGlobal::pDrawClipDocShellRef) ); + pTransferObj->SetDrawPersist( aPersistRef ); + } + pTransferObj->CopyToClipboard( GetActiveWin() ); + SC_MOD()->SetClipObject( pTransferObj, NULL ); + } + + bDone = TRUE; + } + else + { + if ( !bApi ) + ErrorMessage(STR_MATRIXFRAGMENTERR); + } + + return bDone; +} + ScTransferObj* ScViewFunc::CopyToTransferable() { ScRange aRange; @@ -1784,6 +1856,86 @@ BOOL ScViewFunc::LinkBlock( const ScRange& rSource, const ScAddress& rDestPos, B return TRUE; } +void ScViewFunc::DataFormPutData( SCROW nCurrentRow , + SCROW nStartRow , SCCOL nStartCol , + SCROW nEndRow , SCCOL nEndCol , + Edit** pEdits , + sal_uInt16 aColLength ) +{ + ScDocument* pDoc = GetViewData()->GetDocument(); + ScDocShell* pDocSh = GetViewData()->GetDocShell(); + ScMarkData& rMark = GetViewData()->GetMarkData(); + ScDocShellModificator aModificator( *pDocSh ); + SfxUndoManager* pUndoMgr = pDocSh->GetUndoManager(); + if ( pDoc ) + { + const BOOL bRecord( pDoc->IsUndoEnabled()); + ScDocument* pUndoDoc = NULL; + ScDocument* pRedoDoc = NULL; + ScDocument* pRefUndoDoc = NULL; + ScRefUndoData* pUndoData = NULL; + SCTAB nTab = GetViewData()->GetTabNo(); + SCTAB nStartTab = nTab; + SCTAB nEndTab = nTab; + + { + ScChangeTrack* pChangeTrack = pDoc->GetChangeTrack(); + if ( pChangeTrack ) + pChangeTrack->ResetLastCut(); // kein CutMode mehr + } + ScRange aUserRange( nStartCol, nCurrentRow, nStartTab, nEndCol, nCurrentRow, nEndTab ); + BOOL bColInfo = ( nStartRow==0 && nEndRow==MAXROW ); + BOOL bRowInfo = ( nStartCol==0 && nEndCol==MAXCOL ); + SCCOL nUndoEndCol = nStartCol+aColLength-1; + SCROW nUndoEndRow = nCurrentRow; + USHORT nUndoFlags = IDF_NONE; + + if ( bRecord ) + { + pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); + pUndoDoc->InitUndoSelected( pDoc , rMark , bColInfo , bRowInfo ); + pDoc->CopyToDocument( aUserRange , 1 , FALSE , pUndoDoc ); + } + USHORT nExtFlags = 0; + pDocSh->UpdatePaintExt( nExtFlags, nStartCol, nStartRow, nStartTab , nEndCol, nEndRow, nEndTab ); // content before the change + //rMark.SetMarkArea( aUserRange ); + pDoc->BeginDrawUndo(); + + for(sal_uInt16 i = 0; i < aColLength; i++) + { + if (pEdits[i]) + { + String aFieldName=pEdits[i]->GetText(); + pDoc->SetString( nStartCol + i, nCurrentRow, nTab, aFieldName ); + } + } + //pDoc->ExtendMergeSel( nStartCol, nStartRow, nEndCol, nEndRow, rMark, TRUE ); // Refresh + pDocSh->UpdatePaintExt( nExtFlags, nStartCol, nCurrentRow, nStartTab, nEndCol, nCurrentRow, nEndTab ); // content after the change + SfxUndoAction* pUndo = new ScUndoDataForm( pDocSh, + nStartCol, nCurrentRow, nStartTab, + nUndoEndCol, nUndoEndRow, nEndTab, rMark, + pUndoDoc, pRedoDoc, nUndoFlags, + pUndoData, NULL, NULL, NULL, + FALSE ); // FALSE = Redo data not yet copied + pUndoMgr->AddUndoAction( new ScUndoWrapper( pUndo ), TRUE ); + + USHORT nPaint = PAINT_GRID; + if (bColInfo) + { + nPaint |= PAINT_TOP; + nUndoEndCol = MAXCOL; // nur zum Zeichnen ! + } + if (bRowInfo) + { + nPaint |= PAINT_LEFT; + nUndoEndRow = MAXROW; // nur zum Zeichnen ! + } + pDocSh->PostPaint( nStartCol, nCurrentRow, nStartTab, + nUndoEndCol, nUndoEndRow, nEndTab, nPaint, nExtFlags ); + pDocSh->UpdateOle(GetViewData()); + } +} +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/viewfun4.cxx b/sc/source/ui/view/viewfun4.cxx index 164075c0afb1..52fe04459ad8 100644 --- a/sc/source/ui/view/viewfun4.cxx +++ b/sc/source/ui/view/viewfun4.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -826,3 +827,4 @@ BOOL ScViewFunc::HasBookmarkAtCursor( SvxHyperlinkItem* pContent ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx index dc4e96bbbf34..08d2e633a241 100644 --- a/sc/source/ui/view/viewfun5.cxx +++ b/sc/source/ui/view/viewfun5.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -747,3 +748,4 @@ BOOL ScViewFunc::PasteDDE( const uno::Reference<datatransfer::XTransferable>& rx } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/viewfun6.cxx b/sc/source/ui/view/viewfun6.cxx index eaa55f50a0e2..3aaae4e10f0d 100644 --- a/sc/source/ui/view/viewfun6.cxx +++ b/sc/source/ui/view/viewfun6.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -358,3 +359,5 @@ void ScViewFunc::EditNote() } } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/viewfun7.cxx b/sc/source/ui/view/viewfun7.cxx index afa06ddfee3e..b01c7c53da35 100644 --- a/sc/source/ui/view/viewfun7.cxx +++ b/sc/source/ui/view/viewfun7.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -452,3 +453,4 @@ BOOL ScViewFunc::ApplyGraphicToObject( SdrObject* pPickObj, const Graphic& rGrap } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index 840bfda2131e..2997b71822e5 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -3031,3 +3032,4 @@ void ScViewFunc::InsertNameList() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/viewutil.cxx b/sc/source/ui/view/viewutil.cxx index 6c2d804f72ee..050fb131bfae 100644 --- a/sc/source/ui/view/viewutil.cxx +++ b/sc/source/ui/view/viewutil.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -638,3 +639,4 @@ void ScUpdateRect::GetContDiff( SCCOL& rX1, SCROW& rY1, SCCOL& rX2, SCROW& rY2 ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/waitoff.cxx b/sc/source/ui/view/waitoff.cxx index 2e3c3e8476af..a3c768e85418 100644 --- a/sc/source/ui/view/waitoff.cxx +++ b/sc/source/ui/view/waitoff.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -68,3 +69,4 @@ ScWaitCursorOff::~ScWaitCursorOff() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/uiconfig/scalc/menubar/menubar.xml b/sc/uiconfig/scalc/menubar/menubar.xml index ed16e94b9552..539bee7d0d1c 100644 --- a/sc/uiconfig/scalc/menubar/menubar.xml +++ b/sc/uiconfig/scalc/menubar/menubar.xml @@ -404,6 +404,7 @@ <menu:menuitem menu:id=".uno:DataFilterHideAutoFilter"/> </menu:menupopup> </menu:menu> + <menu:menuitem menu:id=".uno:DataForm"/> <menu:menuitem menu:id=".uno:DataSubTotals"/> <menu:menuitem menu:id=".uno:Validation"/> <menu:menuseparator/> diff --git a/sc/util/makefile.mk b/sc/util/makefile.mk index 980d271ae7c0..71c05abaaf34 100644 --- a/sc/util/makefile.mk +++ b/sc/util/makefile.mk @@ -1,7 +1,7 @@ #************************************************************************* # # 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 @@ -96,7 +96,7 @@ SHL1STDLIBS= \ $(AVMEDIALIB) \ $(FORLIB) \ $(FORUILIB) - + SHL1LIBS=$(LIB3TARGET) $(LIB4TARGET) SHL1DEF=$(MISC)$/$(SHL1TARGET).def @@ -273,6 +273,7 @@ LIB8OBJFILES = \ $(SLO)$/filldlg.obj \ $(SLO)$/delcodlg.obj \ $(SLO)$/delcldlg.obj \ + $(SLO)$/datafdlg.obj \ $(SLO)$/dapitype.obj \ $(SLO)$/dapidata.obj \ $(SLO)$/crdlg.obj \ @@ -316,7 +317,8 @@ SHL9STDLIBS= \ $(VCLLIB) \ $(TKLIB) \ $(MSFILTERLIB) \ - $(FORLIB) + $(FORLIB) \ + $(UNOTOOLSLIB) SHL9DEPN=$(SHL1TARGETN) $(SHL8TARGETN) SHL9LIBS=$(SLB)$/$(TARGET_VBA).lib @@ -328,7 +330,7 @@ SHL9LIBS=$(SLB)$/$(TARGET_VBA).lib .ENDIF .ENDIF - + # --- Targets ------------------------------------------------------------- diff --git a/sc/util/scfilt.map b/sc/util/scfilt.map index 642b8db15088..ea169e176103 100644 --- a/sc/util/scfilt.map +++ b/sc/util/scfilt.map @@ -1,6 +1,9 @@ UDK_3_0_0 { global: ScFilterCreate; + component_getImplementationEnvironment; + component_writeInfo; + component_getFactory; local: *; }; diff --git a/sc/workben/addin.cxx b/sc/workben/addin.cxx index 68424abfc9c0..190b70569c36 100644 --- a/sc/workben/addin.cxx +++ b/sc/workben/addin.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -593,3 +594,4 @@ sal_Bool SAL_CALL ScTestAddIn::supportsService( const ::rtl::OUString& ServiceNa +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/workben/result.cxx b/sc/workben/result.cxx index 9198692357e6..9ef0a54dfb64 100644 --- a/sc/workben/result.cxx +++ b/sc/workben/result.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -131,3 +132,4 @@ void SAL_CALL ScAddInResult::removeResultListener( const ::com::sun::star::uno:: +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/workben/test.cxx b/sc/workben/test.cxx index 4caa49e3adcd..01b7587bda08 100644 --- a/sc/workben/test.cxx +++ b/sc/workben/test.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -2039,3 +2040,4 @@ IMPL_LINK(MyWindow, ViewHdl, PushButton*, EMPTYARG) return 0; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scaddins/source/analysis/analysis.cxx b/scaddins/source/analysis/analysis.cxx index 0d206d0286dd..050feef7dc8b 100644 --- a/scaddins/source/analysis/analysis.cxx +++ b/scaddins/source/analysis/analysis.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1310,3 +1311,4 @@ double SAL_CALL AnalysisAddIn::getConvert( double f, const STRING& aFU, const ST } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scaddins/source/analysis/analysishelper.cxx b/scaddins/source/analysis/analysishelper.cxx index d47c02a4e961..03894c0d21ed 100644 --- a/scaddins/source/analysis/analysishelper.cxx +++ b/scaddins/source/analysis/analysishelper.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -2986,3 +2987,4 @@ sal_Int32 ScaAnyConverter::getInt32( //----------------------------------------------------------------------------- +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scaddins/source/analysis/bessel.cxx b/scaddins/source/analysis/bessel.cxx index f853b49eb443..49ec7c322d83 100644 --- a/scaddins/source/analysis/bessel.cxx +++ b/scaddins/source/analysis/bessel.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -498,3 +499,4 @@ double BesselY( double fNum, sal_Int32 nOrder ) throw( IllegalArgumentException, } // namespace analysis } // namespace sca +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scaddins/source/analysis/financial.cxx b/scaddins/source/analysis/financial.cxx index fd5731d008a0..feff9c611367 100644 --- a/scaddins/source/analysis/financial.cxx +++ b/scaddins/source/analysis/financial.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -665,3 +666,4 @@ double SAL_CALL AnalysisAddIn::getFvschedule( double fPrinc, const SEQSEQ( doubl } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/scaddins/source/datefunc/datefunc.cxx b/scaddins/source/datefunc/datefunc.cxx index 2155c386a19e..3ae28745a32f 100644 --- a/scaddins/source/datefunc/datefunc.cxx +++ b/scaddins/source/datefunc/datefunc.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -996,3 +997,4 @@ OUString SAL_CALL ScaDateAddIn::getRot13( const OUString& aSrcString ) throw( un //------------------------------------------------------------------ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sccomp/source/solver/solver.cxx b/sccomp/source/solver/solver.cxx index 6c04f79d7cf5..ce81f14cce69 100644 --- a/sccomp/source/solver/solver.cxx +++ b/sccomp/source/solver/solver.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -655,3 +656,4 @@ extern "C" } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |