diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-02-08 13:53:20 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-02-09 21:04:10 +0100 |
commit | b4f38d8b788018b3f88421d72bb82ad3bdeef9e2 (patch) | |
tree | ac428f55c596a8cef2c466e0a4bd7e8507768230 /sc/source/ui/vba | |
parent | 21d1d0d2340d40f646c5e3f413a33b45ab89675f (diff) |
loplugin:indentation in sc
Change-Id: Ieafabbafde456edba5adbe1fd587c32f04aedb98
Reviewed-on: https://gerrit.libreoffice.org/67562
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/vba')
-rw-r--r-- | sc/source/ui/vba/vbaapplication.cxx | 38 | ||||
-rw-r--r-- | sc/source/ui/vba/vbachart.cxx | 18 | ||||
-rw-r--r-- | sc/source/ui/vba/vbacomment.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/vba/vbaformatcondition.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/vba/vbaoleobjects.cxx | 12 | ||||
-rw-r--r-- | sc/source/ui/vba/vbarange.cxx | 266 | ||||
-rw-r--r-- | sc/source/ui/vba/vbavalidation.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/vba/vbaworksheet.cxx | 22 | ||||
-rw-r--r-- | sc/source/ui/vba/vbaworksheets.cxx | 8 |
9 files changed, 185 insertions, 185 deletions
diff --git a/sc/source/ui/vba/vbaapplication.cxx b/sc/source/ui/vba/vbaapplication.cxx index 2ae5b7b208fd..e58b643a076d 100644 --- a/sc/source/ui/vba/vbaapplication.cxx +++ b/sc/source/ui/vba/vbaapplication.cxx @@ -298,28 +298,28 @@ ScVbaApplication::getSelection() // if ScVbaShape::getType( xShape ) == office::MsoShapeType::msoAutoShape // and the uno object implements the com.sun.star.drawing.Text service // return a textboxshape object - sal_Int32 nType = ScVbaShape::getType( xShape ); - if ( nType == office::MsoShapeType::msoAutoShape ) - { - // TODO Oval with text box - if( ScVbaShape::getAutoShapeType( xShape ) == office::MsoAutoShapeType::msoShapeOval ) + sal_Int32 nType = ScVbaShape::getType( xShape ); + if ( nType == office::MsoShapeType::msoAutoShape ) { - return uno::makeAny( uno::Reference< msforms::XOval >(new ScVbaOvalShape( mxContext, xShape, xShapes, xModel ) ) ); - } + // TODO Oval with text box + if( ScVbaShape::getAutoShapeType( xShape ) == office::MsoAutoShapeType::msoShapeOval ) + { + return uno::makeAny( uno::Reference< msforms::XOval >(new ScVbaOvalShape( mxContext, xShape, xShapes, xModel ) ) ); + } - uno::Reference< lang::XServiceInfo > xShapeServiceInfo( xShape, uno::UNO_QUERY_THROW ); - if ( xShapeServiceInfo->supportsService("com.sun.star.drawing.Text") ) + uno::Reference< lang::XServiceInfo > xShapeServiceInfo( xShape, uno::UNO_QUERY_THROW ); + if ( xShapeServiceInfo->supportsService("com.sun.star.drawing.Text") ) + { + return uno::makeAny( uno::Reference< msforms::XTextBoxShape >( + new ScVbaTextBoxShape( mxContext, xShape, xShapes, xModel ) ) ); + } + } + else if ( nType == office::MsoShapeType::msoLine ) { - return uno::makeAny( uno::Reference< msforms::XTextBoxShape >( - new ScVbaTextBoxShape( mxContext, xShape, xShapes, xModel ) ) ); + return uno::makeAny( uno::Reference< msforms::XLine >( new ScVbaLineShape( + mxContext, xShape, xShapes, xModel ) ) ); } - } - else if ( nType == office::MsoShapeType::msoLine ) - { - return uno::makeAny( uno::Reference< msforms::XLine >( new ScVbaLineShape( - mxContext, xShape, xShapes, xModel ) ) ); - } return uno::makeAny( uno::Reference< msforms::XShape >(new ScVbaShape( this, mxContext, xShape, xShapes, xModel, ScVbaShape::getType( xShape ) ) ) ); } else if( xServiceInfo->supportsService("com.sun.star.sheet.SheetCellRange") || @@ -715,7 +715,7 @@ ScVbaApplication::setCursor( sal_Int32 _cursor ) { try { - uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW ); + uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW ); switch( _cursor ) { case excel::XlMousePointer::xlNorthwestArrow: @@ -928,7 +928,7 @@ OUString ScVbaApplication::getOfficePath( const OUString& _sPathType ) try { OUString sUrl; - xProps->getPropertyValue( _sPathType ) >>= sUrl; + xProps->getPropertyValue( _sPathType ) >>= sUrl; // if it's a list of paths then use the last one sal_Int32 nIndex = sUrl.lastIndexOf( ';' ) ; diff --git a/sc/source/ui/vba/vbachart.cxx b/sc/source/ui/vba/vbachart.cxx index 27605af57ea4..efda917eada2 100644 --- a/sc/source/ui/vba/vbachart.cxx +++ b/sc/source/ui/vba/vbachart.cxx @@ -222,10 +222,10 @@ ScVbaChart::getChartType() void SAL_CALL ScVbaChart::setChartType( ::sal_Int32 _nChartType ) { -try -{ - switch (_nChartType) + try { + switch (_nChartType) + { case xlColumnClustered: case xlColumnStacked: case xlColumnStacked100: @@ -339,10 +339,10 @@ try break; default: throw script::BasicErrorException( OUString(), uno::Reference< uno::XInterface >(), sal_uInt32(ERRCODE_BASIC_CONVERSION), OUString() ); - } + } - switch (_nChartType) - { + switch (_nChartType) + { case xlLineMarkers: case xlLineMarkersStacked: case xlLineMarkersStacked100: @@ -360,10 +360,10 @@ try mxDiagramPropertySet->setPropertyValue(SYMBOLTYPE, uno::makeAny(chart::ChartSymbolType::NONE)); } break; - } + } - switch (_nChartType) - { + switch (_nChartType) + { case xlConeCol: case xlPyramidCol: case xlCylinderCol: diff --git a/sc/source/ui/vba/vbacomment.cxx b/sc/source/ui/vba/vbacomment.cxx index 0370a45719fb..57b67993abc2 100644 --- a/sc/source/ui/vba/vbacomment.cxx +++ b/sc/source/ui/vba/vbacomment.cxx @@ -96,7 +96,7 @@ ScVbaComment::getAnnotationIndex() } SAL_INFO("sc.ui", "returning index is " << aIndex); - return aIndex; + return aIndex; } uno::Reference< excel::XComment > diff --git a/sc/source/ui/vba/vbaformatcondition.cxx b/sc/source/ui/vba/vbaformatcondition.cxx index dcedad96775b..ed885a16fa01 100644 --- a/sc/source/ui/vba/vbaformatcondition.cxx +++ b/sc/source/ui/vba/vbaformatcondition.cxx @@ -56,7 +56,7 @@ ScVbaFormatCondition::Delete( ) { ScVbaFormatConditions* pFormatConditions = lcl_getScVbaFormatConditionsPtr( moFormatConditions ); pFormatConditions->removeFormatCondition(msStyleName, true); - notifyRange(); + notifyRange(); } void SAL_CALL diff --git a/sc/source/ui/vba/vbaoleobjects.cxx b/sc/source/ui/vba/vbaoleobjects.cxx index 299f2f7e89ba..b01cab778d5f 100644 --- a/sc/source/ui/vba/vbaoleobjects.cxx +++ b/sc/source/ui/vba/vbaoleobjects.cxx @@ -43,7 +43,7 @@ public: sal_Int32 nLen = xIndexAccess->getCount(); for ( sal_Int32 index = 0; index < nLen; ++index ) { - uno::Reference< drawing::XControlShape > xControlShape( xIndexAccess->getByIndex( index), uno::UNO_QUERY); + uno::Reference< drawing::XControlShape > xControlShape( xIndexAccess->getByIndex( index), uno::UNO_QUERY); if ( xControlShape.is() ) vObjects.push_back( xControlShape ); } @@ -94,12 +94,12 @@ public: virtual uno::Any SAL_CALL nextElement( ) override { - if ( nIndex < m_xIndexAccess->getCount() ) - { - uno::Reference< drawing::XControlShape > xControlShape ( m_xIndexAccess->getByIndex( nIndex++ ), uno::UNO_QUERY_THROW ); + if ( nIndex < m_xIndexAccess->getCount() ) + { + uno::Reference< drawing::XControlShape > xControlShape ( m_xIndexAccess->getByIndex( nIndex++ ), uno::UNO_QUERY_THROW ); return uno::makeAny( uno::Reference< ov::excel::XOLEObject >( new ScVbaOLEObject( m_xParent, m_xContext, xControlShape ) ) ); - } - throw container::NoSuchElementException(); + } + throw container::NoSuchElementException(); } }; diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx index dee057079db0..fba198b5ba55 100644 --- a/sc/source/ui/vba/vbarange.cxx +++ b/sc/source/ui/vba/vbarange.cxx @@ -588,7 +588,7 @@ public: if ( xTypes.is() ) { sal_Int32 nNewIndex = xTypes->getStandardFormat( nType, aLocale ); - mxRangeProps->setPropertyValue( "NumberFormat", uno::makeAny( nNewIndex ) ); + mxRangeProps->setPropertyValue( "NumberFormat", uno::makeAny( nNewIndex ) ); } } @@ -1414,7 +1414,7 @@ lcl_setupBorders( const uno::Reference< excel::XRange >& xParentRange, const uno uno::Reference< XHelperInterface > xParent( xParentRange, uno::UNO_QUERY_THROW ); ScDocument& rDoc = getDocumentFromRange(xRange); ScVbaPalette aPalette( rDoc.GetDocumentShell() ); - uno::Reference< XCollection > borders( new ScVbaBorders( xParent, xContext, xRange, aPalette ) ); + uno::Reference< XCollection > borders( new ScVbaBorders( xParent, xContext, xRange, aPalette ) ); return borders; } @@ -2042,7 +2042,7 @@ ScVbaRange::Address( const uno::Any& RowAbsolute, const uno::Any& ColumnAbsolut // Multi-Area Range OUStringBuffer sAddress; uno::Reference< XCollection > xCollection( m_Areas, uno::UNO_QUERY_THROW ); - uno::Any aExternalCopy = External; + uno::Any aExternalCopy = External; for ( sal_Int32 index = 1; index <= xCollection->getCount(); ++index ) { uno::Reference< excel::XRange > xRange( xCollection->Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW ); @@ -2295,14 +2295,14 @@ ScVbaRange::Activate() RangeHelper thisRange( xCellRange ); uno::Reference< sheet::XCellRangeAddressable > xThisRangeAddress = thisRange.getCellRangeAddressable(); table::CellRangeAddress thisRangeAddress = xThisRangeAddress->getRangeAddress(); - uno::Reference< frame::XModel > xModel; - ScDocShell* pShell = getScDocShell(); + uno::Reference< frame::XModel > xModel; + ScDocShell* pShell = getScDocShell(); - if ( pShell ) - xModel = pShell->GetModel(); + if ( pShell ) + xModel = pShell->GetModel(); - if ( !xModel.is() ) - throw uno::RuntimeException(); + if ( !xModel.is() ) + throw uno::RuntimeException(); // get current selection uno::Reference< sheet::XCellRangeAddressable > xRange( xModel->getCurrentSelection(), ::uno::UNO_QUERY); @@ -2641,8 +2641,8 @@ ScVbaRange::getWrapText() uno::Any aResult; for ( sal_Int32 index=1; index <= nItems; ++index ) { - uno::Reference< excel::XRange > xRange( m_Areas->Item( uno::makeAny(index), uno::Any() ), uno::UNO_QUERY_THROW ); - if ( index > 1 ) + uno::Reference< excel::XRange > xRange( m_Areas->Item( uno::makeAny(index), uno::Any() ), uno::UNO_QUERY_THROW ); + if ( index > 1 ) if ( aResult != xRange->getWrapText() ) return aNULL(); aResult = xRange->getWrapText(); @@ -2664,7 +2664,7 @@ ScVbaRange::getWrapText() uno::Reference< excel::XInterior > ScVbaRange::Interior( ) { uno::Reference< beans::XPropertySet > xProps( mxRange, uno::UNO_QUERY_THROW ); - return new ScVbaInterior ( this, mxContext, xProps, &getScDocument() ); + return new ScVbaInterior ( this, mxContext, xProps, &getScDocument() ); } uno::Reference< excel::XRange > ScVbaRange::Range( const uno::Any &Cell1, const uno::Any &Cell2 ) @@ -3310,7 +3310,7 @@ const OUString& sPropName ) const beans::PropertyValue* pProp = props.getConstArray(); sal_Int32 nItems = props.getLength(); - sal_Int32 count=0; + sal_Int32 count=0; for ( ; count < nItems; ++count, ++pProp ) if ( pProp->Name == sPropName ) return count; @@ -3670,10 +3670,10 @@ ScVbaRange::Delete( const uno::Any& Shift ) } } else - { + { bool bFullRow = ( thisAddress.StartColumn == 0 && thisAddress.EndColumn == MAXCOL ); - sal_Int32 nCols = thisAddress.EndColumn - thisAddress.StartColumn; - sal_Int32 nRows = thisAddress.EndRow - thisAddress.StartRow; + sal_Int32 nCols = thisAddress.EndColumn - thisAddress.StartColumn; + sal_Int32 nRows = thisAddress.EndRow - thisAddress.StartRow; if ( mbIsRows || bFullRow || ( nCols >= nRows ) ) mode = sheet::CellDeleteMode_UP; else @@ -3704,12 +3704,12 @@ ScVbaRange::createEnumeration() { uno::Reference< table::XColumnRowRange > xColumnRowRange(mxRange, uno::UNO_QUERY ); uno::Reference< excel::XRange > xRange( m_Areas->Item( uno::makeAny( sal_Int32(1) ), uno::Any() ), uno::UNO_QUERY_THROW ); - sal_Int32 nElems = 0; + sal_Int32 nElems = 0; if ( mbIsColumns ) nElems = xColumnRowRange->getColumns()->getCount(); else nElems = xColumnRowRange->getRows()->getCount(); - return new ColumnsRowEnumeration( xRange, nElems ); + return new ColumnsRowEnumeration( xRange, nElems ); } return new CellsEnumeration( mxParent, mxContext, m_Areas ); @@ -3934,7 +3934,7 @@ ScVbaRange::getRowHeight() sal_Int32 nStartRow = thisAddress.StartRow; sal_Int32 nEndRow = thisAddress.EndRow; - sal_uInt16 nRowTwips = 0; + sal_uInt16 nRowTwips = 0; // #TODO probably possible to use the SfxItemSet (and see if // SfxItemState::DONTCARE is set) to improve performance // #CHECKME looks like this is general behaviour not just row Range specific @@ -3970,7 +3970,7 @@ ScVbaRange::setRowHeight( const uno::Any& _rowheight) return; } double nHeight = 0; // Incoming height is in points - _rowheight >>= nHeight; + _rowheight >>= nHeight; nHeight = lcl_Round2DecPlaces( nHeight ); RangeHelper thisRange( mxRange ); table::CellRangeAddress thisAddress = thisRange.getCellRangeAddressable()->getRangeAddress(); @@ -4064,7 +4064,7 @@ ScVbaRange::getHeight() double nHeight = 0; for ( sal_Int32 index=0; index<nElems; ++index ) { - uno::Reference< sheet::XCellRangeAddressable > xAddressable( xIndexAccess->getByIndex( index ), uno::UNO_QUERY_THROW ); + uno::Reference< sheet::XCellRangeAddressable > xAddressable( xIndexAccess->getByIndex( index ), uno::UNO_QUERY_THROW ); nHeight += getCalcRowHeight(xAddressable->getRangeAddress() ); } return uno::makeAny( nHeight ); @@ -4170,7 +4170,7 @@ ScVbaRange::getWorksheet() ScDocShell* pDocShell = getDocShellFromRange(xRange); RangeHelper rHelper(xRange); // parent should be Thisworkbook - xSheet.set( new ScVbaWorksheet( uno::Reference< XHelperInterface >(), mxContext,rHelper.getSpreadSheet(),pDocShell->GetModel()) ); + xSheet.set( new ScVbaWorksheet( uno::Reference< XHelperInterface >(), mxContext,rHelper.getSpreadSheet(),pDocShell->GetModel()) ); } return xSheet; } @@ -4486,137 +4486,137 @@ ScVbaRange::AutoFilter( const uno::Any& aField, const uno::Any& Criteria1, const bool bAll = false; uno::Sequence< sheet::TableFilterField2 > sTabFilts; uno::Reference< beans::XPropertySet > xDescProps( xDesc, uno::UNO_QUERY_THROW ); - if ( Criteria1.hasValue() ) - { - sTabFilts.realloc( 1 ); - sTabFilts[0].Operator = sheet::FilterOperator2::EQUAL;// sensible default - if ( !bCritHasNumericValue ) + if ( Criteria1.hasValue() ) { - Criteria1 >>= sCriteria1; - if ( sCriteria1.isEmpty() ) + sTabFilts.realloc( 1 ); + sTabFilts[0].Operator = sheet::FilterOperator2::EQUAL;// sensible default + if ( !bCritHasNumericValue ) { - uno::Sequence< OUString > aCriteria1; - Criteria1 >>= aCriteria1; - sal_uInt16 nLength = aCriteria1.getLength(); - if ( nLength ) + Criteria1 >>= sCriteria1; + if ( sCriteria1.isEmpty() ) { - // When sequence is provided for Criteria1 don't care about Criteria2 - bAcceptCriteria2 = false; - - sTabFilts.realloc( nLength ); - for ( sal_uInt16 i = 0; i < nLength; ++i ) + uno::Sequence< OUString > aCriteria1; + Criteria1 >>= aCriteria1; + sal_uInt16 nLength = aCriteria1.getLength(); + if ( nLength ) { - lcl_setTableFieldsFromCriteria( aCriteria1[i], xDescProps, sTabFilts[i] ); - sTabFilts[i].Connection = sheet::FilterConnection_OR; - sTabFilts[i].Field = (nField - 1); + // When sequence is provided for Criteria1 don't care about Criteria2 + bAcceptCriteria2 = false; + + sTabFilts.realloc( nLength ); + for ( sal_uInt16 i = 0; i < nLength; ++i ) + { + lcl_setTableFieldsFromCriteria( aCriteria1[i], xDescProps, sTabFilts[i] ); + sTabFilts[i].Connection = sheet::FilterConnection_OR; + sTabFilts[i].Field = (nField - 1); + } } + else + bAll = true; } else - bAll = true; + { + sTabFilts[0].IsNumeric = bCritHasNumericValue; + if ( bHasCritValue && !sCriteria1.isEmpty() ) + lcl_setTableFieldsFromCriteria( sCriteria1, xDescProps, sTabFilts[0] ); + else + bAll = true; + } } - else + else // numeric { - sTabFilts[0].IsNumeric = bCritHasNumericValue; - if ( bHasCritValue && !sCriteria1.isEmpty() ) - lcl_setTableFieldsFromCriteria( sCriteria1, xDescProps, sTabFilts[0] ); - else - bAll = true; + sTabFilts[0].IsNumeric = true; + sTabFilts[0].NumericValue = nCriteria1; } } - else // numeric - { - sTabFilts[0].IsNumeric = true; - sTabFilts[0].NumericValue = nCriteria1; - } - } - else // no value specified - 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 ) ) - { - // if it's a bottom/top Ten(Percent/Value) and there - // is no value specified for criteria1 set it to 10 - if ( !bCritHasNumericValue && sCriteria1.isEmpty() && ( nOperator != excel::XlAutoFilterOperator::xlOr ) && ( nOperator != excel::XlAutoFilterOperator::xlAnd ) ) - { - sTabFilts[0].IsNumeric = true; - sTabFilts[0].NumericValue = 10; - bAll = false; - } - switch ( nOperator ) + else // no value specified + 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 ) ) { - case excel::XlAutoFilterOperator::xlBottom10Items: - sTabFilts[0].Operator = sheet::FilterOperator2::BOTTOM_VALUES; - break; - case excel::XlAutoFilterOperator::xlBottom10Percent: - sTabFilts[0].Operator = sheet::FilterOperator2::BOTTOM_PERCENT; - break; - case excel::XlAutoFilterOperator::xlTop10Items: - sTabFilts[0].Operator = sheet::FilterOperator2::TOP_VALUES; - break; - case excel::XlAutoFilterOperator::xlTop10Percent: - sTabFilts[0].Operator = sheet::FilterOperator2::TOP_PERCENT; - break; - case excel::XlAutoFilterOperator::xlOr: - nConn = sheet::FilterConnection_OR; - break; - case excel::XlAutoFilterOperator::xlAnd: - nConn = sheet::FilterConnection_AND; - break; - default: - throw uno::RuntimeException("UnknownOption" ); - - } + // if it's a bottom/top Ten(Percent/Value) and there + // is no value specified for criteria1 set it to 10 + if ( !bCritHasNumericValue && sCriteria1.isEmpty() && ( nOperator != excel::XlAutoFilterOperator::xlOr ) && ( nOperator != excel::XlAutoFilterOperator::xlAnd ) ) + { + sTabFilts[0].IsNumeric = true; + sTabFilts[0].NumericValue = 10; + bAll = false; + } + switch ( nOperator ) + { + case excel::XlAutoFilterOperator::xlBottom10Items: + sTabFilts[0].Operator = sheet::FilterOperator2::BOTTOM_VALUES; + break; + case excel::XlAutoFilterOperator::xlBottom10Percent: + sTabFilts[0].Operator = sheet::FilterOperator2::BOTTOM_PERCENT; + break; + case excel::XlAutoFilterOperator::xlTop10Items: + sTabFilts[0].Operator = sheet::FilterOperator2::TOP_VALUES; + break; + case excel::XlAutoFilterOperator::xlTop10Percent: + sTabFilts[0].Operator = sheet::FilterOperator2::TOP_PERCENT; + break; + case excel::XlAutoFilterOperator::xlOr: + nConn = sheet::FilterConnection_OR; + break; + case excel::XlAutoFilterOperator::xlAnd: + nConn = sheet::FilterConnection_AND; + break; + default: + throw uno::RuntimeException("UnknownOption" ); - } - if ( !bAll && bAcceptCriteria2 ) - { - sTabFilts[0].Connection = sheet::FilterConnection_AND; - sTabFilts[0].Field = (nField - 1); + } - OUString sCriteria2; - uno::Sequence< OUString > aCriteria2; - if ( Criteria2.hasValue() ) // there is a Criteria2 + } + if ( !bAll && bAcceptCriteria2 ) { - sTabFilts.realloc(2); - sTabFilts[1].Field = sTabFilts[0].Field; - sTabFilts[1].Connection = nConn; + sTabFilts[0].Connection = sheet::FilterConnection_AND; + sTabFilts[0].Field = (nField - 1); - if ( Criteria2 >>= sCriteria2 ) + OUString sCriteria2; + uno::Sequence< OUString > aCriteria2; + if ( Criteria2.hasValue() ) // there is a Criteria2 { - if ( !sCriteria2.isEmpty() ) + sTabFilts.realloc(2); + sTabFilts[1].Field = sTabFilts[0].Field; + sTabFilts[1].Connection = nConn; + + if ( Criteria2 >>= sCriteria2 ) { - uno::Reference< beans::XPropertySet > xProps; - lcl_setTableFieldsFromCriteria( sCriteria2, xProps, sTabFilts[1] ); - sTabFilts[1].IsNumeric = false; + if ( !sCriteria2.isEmpty() ) + { + uno::Reference< beans::XPropertySet > xProps; + lcl_setTableFieldsFromCriteria( sCriteria2, xProps, sTabFilts[1] ); + sTabFilts[1].IsNumeric = false; + } } - } - else if ( Criteria2 >>= aCriteria2 ) - { - sal_uInt16 nLength = aCriteria2.getLength(); - if ( nLength ) + else if ( Criteria2 >>= aCriteria2 ) { - // For compatibility use only the last value form the sequence - lcl_setTableFieldsFromCriteria( aCriteria2[nLength - 1], xDescProps, sTabFilts[1] ); + sal_uInt16 nLength = aCriteria2.getLength(); + if ( nLength ) + { + // For compatibility use only the last value form the sequence + lcl_setTableFieldsFromCriteria( aCriteria2[nLength - 1], xDescProps, sTabFilts[1] ); + } + } + else // numeric + { + Criteria2 >>= sTabFilts[1].NumericValue; + sTabFilts[1].IsNumeric = true; + sTabFilts[1].Operator = sheet::FilterOperator2::EQUAL; } - } - else // numeric - { - Criteria2 >>= sTabFilts[1].NumericValue; - sTabFilts[1].IsNumeric = true; - sTabFilts[1].Operator = sheet::FilterOperator2::EQUAL; } } - } - xDesc->setFilterFields2( sTabFilts ); - if ( !bAll ) - { - xDataBaseRange->refresh(); - } - else - // was 0 based now seems to be 1 - lcl_SetAllQueryForField( pShell, nField, nSheet ); + xDesc->setFilterFields2( sTabFilts ); + if ( !bAll ) + { + xDataBaseRange->refresh(); + } + else + // was 0 based now seems to be 1 + lcl_SetAllQueryForField( pShell, nField, nSheet ); } } else @@ -4714,11 +4714,11 @@ ScVbaRange::Autofit() // if the range is a not a row or column range autofit will // throw an error - if ( !( mbIsColumns || mbIsRows ) ) + if ( !( mbIsColumns || mbIsRows ) ) DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString()); - ScDocShell* pDocShell = getDocShellFromRange( mxRange ); - if ( pDocShell ) - { + ScDocShell* pDocShell = getDocShellFromRange( mxRange ); + if ( pDocShell ) + { RangeHelper thisRange( mxRange ); table::CellRangeAddress thisAddress = thisRange.getCellRangeAddressable()->getRangeAddress(); diff --git a/sc/source/ui/vba/vbavalidation.cxx b/sc/source/ui/vba/vbavalidation.cxx index 15b36154d1f4..c9f166435325 100644 --- a/sc/source/ui/vba/vbavalidation.cxx +++ b/sc/source/ui/vba/vbavalidation.cxx @@ -316,7 +316,7 @@ ScVbaValidation::getFormula1() OUString SAL_CALL ScVbaValidation::getFormula2() { - uno::Reference< sheet::XSheetCondition > xCond( lcl_getValidationProps( m_xRange ), uno::UNO_QUERY_THROW ); + uno::Reference< sheet::XSheetCondition > xCond( lcl_getValidationProps( m_xRange ), uno::UNO_QUERY_THROW ); return xCond->getFormula2(); } diff --git a/sc/source/ui/vba/vbaworksheet.cxx b/sc/source/ui/vba/vbaworksheet.cxx index a4b1d184b5a2..ff602c6dbda8 100644 --- a/sc/source/ui/vba/vbaworksheet.cxx +++ b/sc/source/ui/vba/vbaworksheet.cxx @@ -426,7 +426,7 @@ void SAL_CALL ScVbaWorksheet::setAutoFilterMode( sal_Bool bAutoFilterMode ) uno::Reference< excel::XRange > ScVbaWorksheet::getUsedRange() { - uno::Reference< sheet::XSheetCellRange > xSheetCellRange(getSheet(), uno::UNO_QUERY_THROW ); + uno::Reference< sheet::XSheetCellRange > xSheetCellRange(getSheet(), uno::UNO_QUERY_THROW ); uno::Reference< sheet::XSheetCellCursor > xSheetCellCursor( getSheet()->createCursorByRange( xSheetCellRange ), uno::UNO_QUERY_THROW ); uno::Reference<sheet::XUsedAreaCursor> xUsedCursor(xSheetCellCursor,uno::UNO_QUERY_THROW); xUsedCursor->gotoStartOfUsedArea( false ); @@ -453,9 +453,9 @@ ScVbaWorksheet::HPageBreaks( const uno::Any& aIndex ) { uno::Reference< sheet::XSheetPageBreak > xSheetPageBreak(getSheet(),uno::UNO_QUERY_THROW); uno::Reference< excel::XHPageBreaks > xHPageBreaks( new ScVbaHPageBreaks( this, mxContext, xSheetPageBreak)); - if ( aIndex.hasValue() ) - return xHPageBreaks->Item( aIndex, uno::Any()); - return uno::makeAny( xHPageBreaks ); + if ( aIndex.hasValue() ) + return xHPageBreaks->Item( aIndex, uno::Any()); + return uno::makeAny( xHPageBreaks ); } uno::Any @@ -541,7 +541,7 @@ ScVbaWorksheet::Move( const uno::Any& Before, const uno::Any& After ) { uno::Reference< sheet::XSheetCellCursor > xSheetCellCursor = getSheet()->createCursor( ); uno::Reference<sheet::XUsedAreaCursor> xUsedCursor(xSheetCellCursor,uno::UNO_QUERY_THROW); - uno::Reference< table::XCellRange > xRange1( xSheetCellCursor, uno::UNO_QUERY); + uno::Reference< table::XCellRange > xRange1( xSheetCellCursor, uno::UNO_QUERY); // #FIXME needs worksheet as parent uno::Reference<excel::XRange> xRange = new ScVbaRange( this, mxContext, xRange1); if (xRange.is()) @@ -805,10 +805,10 @@ ScVbaWorksheet::Shapes( const uno::Any& aIndex ) uno::Reference< drawing::XShapes > xShapes( xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY_THROW ); uno::Reference< container::XIndexAccess > xIndexAccess( xShapes, uno::UNO_QUERY_THROW ); - uno::Reference< msforms::XShapes> xVbaShapes( new ScVbaShapes( this, mxContext, xIndexAccess, getModel() ) ); - if ( aIndex.hasValue() ) - return xVbaShapes->Item( aIndex, uno::Any() ); - return uno::makeAny( xVbaShapes ); + uno::Reference< msforms::XShapes> xVbaShapes( new ScVbaShapes( this, mxContext, xIndexAccess, getModel() ) ); + if ( aIndex.hasValue() ) + return xVbaShapes->Item( aIndex, uno::Any() ); + return uno::makeAny( xVbaShapes ); } uno::Any @@ -946,7 +946,7 @@ ScVbaWorksheet::getFormControls() uno::Reference< sheet::XSpreadsheet > xSpreadsheet( getSheet(), uno::UNO_QUERY_THROW ); uno::Reference< drawing::XDrawPageSupplier > xDrawPageSupplier( xSpreadsheet, uno::UNO_QUERY_THROW ); uno::Reference< form::XFormsSupplier > xFormSupplier( xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY_THROW ); - uno::Reference< container::XIndexAccess > xIndexAccess( xFormSupplier->getForms(), uno::UNO_QUERY_THROW ); + uno::Reference< container::XIndexAccess > xIndexAccess( xFormSupplier->getForms(), uno::UNO_QUERY_THROW ); // get the www-standard container ( maybe we should access the // 'www-standard' by name rather than index, this seems an // implementation detail @@ -1012,7 +1012,7 @@ void SAL_CALL ScVbaWorksheet::setEnableCalculation( sal_Bool bEnableCalculation ) { uno::Reference <sheet::XCalculatable> xCalculatable(getModel(), uno::UNO_QUERY_THROW); - xCalculatable->enableAutomaticCalculation( bEnableCalculation); + xCalculatable->enableAutomaticCalculation( bEnableCalculation); } sal_Bool SAL_CALL ScVbaWorksheet::getEnableCalculation( ) diff --git a/sc/source/ui/vba/vbaworksheets.cxx b/sc/source/ui/vba/vbaworksheets.cxx index 9c23794c19a4..bd4c5e132747 100644 --- a/sc/source/ui/vba/vbaworksheets.cxx +++ b/sc/source/ui/vba/vbaworksheets.cxx @@ -250,9 +250,9 @@ ScVbaWorksheets::Add( const uno::Any& Before, const uno::Any& After, aStringSheet = xApplication->getActiveWorkbook()->getActiveSheet()->getName(); bBefore = true; } - nCount = static_cast< SCTAB >( m_xIndexAccess->getCount() ); - for (SCTAB i=0; i < nCount; i++) - { + nCount = static_cast< SCTAB >( m_xIndexAccess->getCount() ); + for (SCTAB i=0; i < nCount; i++) + { uno::Reference< sheet::XSpreadsheet > xSheet(m_xIndexAccess->getByIndex(i), uno::UNO_QUERY); uno::Reference< container::XNamed > xNamed( xSheet, uno::UNO_QUERY_THROW ); if (xNamed->getName() == aStringSheet) @@ -260,7 +260,7 @@ ScVbaWorksheets::Add( const uno::Any& Before, const uno::Any& After, nSheetIndex = i; break; } - } + } if(!bBefore) nSheetIndex++; |