diff options
author | Kayo Hamid <revol.code@yahoo.com> | 2010-11-30 16:44:46 +0100 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2010-11-30 16:44:46 +0100 |
commit | 1f6aa8f2a8352cc5cc3ef8981afa278a9759c379 (patch) | |
tree | e04367b885eeeaec41c59e30c9f41670b5ac966e /sw/source/ui/vba | |
parent | 276c2a21860c78ff370b2b6c2212dc46ec3d9080 (diff) |
clean code at writer
Diffstat (limited to 'sw/source/ui/vba')
-rw-r--r-- | sw/source/ui/vba/vbaautotextentry.cxx | 3 | ||||
-rw-r--r-- | sw/source/ui/vba/vbabookmarks.cxx | 3 | ||||
-rw-r--r-- | sw/source/ui/vba/vbaborders.cxx | 5 | ||||
-rw-r--r-- | sw/source/ui/vba/vbacolumn.cxx | 35 | ||||
-rw-r--r-- | sw/source/ui/vba/vbadocument.cxx | 1 | ||||
-rw-r--r-- | sw/source/ui/vba/vbadocumentproperties.cxx | 1 | ||||
-rw-r--r-- | sw/source/ui/vba/vbafield.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/vba/vbalisthelper.cxx | 1 | ||||
-rw-r--r-- | sw/source/ui/vba/vbapagesetup.cxx | 1 | ||||
-rw-r--r-- | sw/source/ui/vba/vbaparagraph.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/vba/vbaselection.cxx | 5 | ||||
-rw-r--r-- | sw/source/ui/vba/vbastyles.cxx | 1 | ||||
-rw-r--r-- | sw/source/ui/vba/vbatablehelper.cxx | 9 | ||||
-rw-r--r-- | sw/source/ui/vba/vbatables.cxx | 6 | ||||
-rw-r--r-- | sw/source/ui/vba/vbatablesofcontents.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/vba/vbatemplate.cxx | 1 | ||||
-rw-r--r-- | sw/source/ui/vba/vbaview.cxx | 3 |
17 files changed, 1 insertions, 80 deletions
diff --git a/sw/source/ui/vba/vbaautotextentry.cxx b/sw/source/ui/vba/vbaautotextentry.cxx index bece42209ba8..8ad0f0f45673 100644 --- a/sw/source/ui/vba/vbaautotextentry.cxx +++ b/sw/source/ui/vba/vbaautotextentry.cxx @@ -78,7 +78,6 @@ uno::Reference< word::XRange > SAL_CALL SwVbaAutoTextEntry::Insert( const uno::R } } xEndMarker->setString( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("") ) ); // remove marker - //xTC->gotoRange( xEndMarker, sal_True ); xTC = xText->createTextCursorByRange( xEndMarker->getEnd() ); pWhere->setXTextCursor( xTC ); } @@ -118,8 +117,6 @@ SwVbaAutoTextEntries::getElementType() throw (uno::RuntimeException) uno::Reference< container::XEnumeration > SwVbaAutoTextEntries::createEnumeration() throw (uno::RuntimeException) { - //uno::Reference< container::XEnumerationAccess > xEnumerationAccess( m_xIndexAccess, uno::UNO_QUERY_THROW ); - //return xEnumerationAccess->createEnumeration(); throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() ); } diff --git a/sw/source/ui/vba/vbabookmarks.cxx b/sw/source/ui/vba/vbabookmarks.cxx index d199728b0209..2990feaf9487 100644 --- a/sw/source/ui/vba/vbabookmarks.cxx +++ b/sw/source/ui/vba/vbabookmarks.cxx @@ -118,8 +118,6 @@ SwVbaBookmarks::SwVbaBookmarks( const uno::Reference< XHelperInterface >& xParen { mxBookmarksSupplier.set( mxModel, uno::UNO_QUERY_THROW ); uno::Reference< text::XTextDocument > xDocument( mxModel, uno::UNO_QUERY_THROW ); - // use view cursor to insert bookmark, or it will fail if insert bookmark in table - //mxText = word::getXTextViewCursor( mxModel )->getText(); } // XEnumerationAccess uno::Type @@ -175,7 +173,6 @@ SwVbaBookmarks::Add( const rtl::OUString& rName, const uno::Any& rRange ) throw } // remove the exist bookmark - // rtl::OUString aName = rName.toAsciiLowerCase(); rtl::OUString aName = rName; if( m_xNameAccess->hasByName( aName ) ) removeBookmarkByName( aName ); diff --git a/sw/source/ui/vba/vbaborders.cxx b/sw/source/ui/vba/vbaborders.cxx index 0170eb88c20e..26d5a6bf18be 100644 --- a/sw/source/ui/vba/vbaborders.cxx +++ b/sw/source/ui/vba/vbaborders.cxx @@ -350,11 +350,6 @@ SwVbaBorders::getItemByIntIndex( const sal_Int32 nIndex ) throw (uno::RuntimeEx sal_Bool SAL_CALL SwVbaBorders::getShadow() throw (uno::RuntimeException) { - /* - table::ShadowFormat aShadowFormat; - m_xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ShadowFormat") ) ) >>= aShadowFormat; - return ( aShadowFormat.Location != table::ShadowLocation_NONE ); - */ // always return False for table border in MS Word return sal_False; } diff --git a/sw/source/ui/vba/vbacolumn.cxx b/sw/source/ui/vba/vbacolumn.cxx index f3cc4238aa5c..9a945f33a191 100644 --- a/sw/source/ui/vba/vbacolumn.cxx +++ b/sw/source/ui/vba/vbacolumn.cxx @@ -111,15 +111,6 @@ void SwVbaColumn::calculateRelativeColumnWidth( const double* pAbsWidth, double* sal_Int32 SAL_CALL SwVbaColumn::getWidth( ) throw ( css::uno::RuntimeException ) { - /* uno::Reference< beans::XPropertySet > xTableProps( mxTextTable, uno::UNO_QUERY_THROW ); - uno::Sequence< text::TableColumnSeparator > aSeparators; - xTableProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("TableColumnSeparators") ) ) >>= aSeparators; - sal_Int32 nTableWidth = SwVbaTable::getTableWidth( xTableProps ); - sal_Int32 nColCont = aSeparators.getLength() + 1; - double dAbsColWidth[ nColCont ]; - calculateAbsoluteColumnWidth( nTableWidth, aSeparators, dAbsColWidth ); - return Millimeter::getInPoints( (sal_Int32)( dAbsColWidth[ mnIndex ] ) ); - */ SwVbaTableHelper aTableHelper( mxTextTable ); return aTableHelper.GetColWidth( mnIndex ); } @@ -127,32 +118,6 @@ SwVbaColumn::getWidth( ) throw ( css::uno::RuntimeException ) void SAL_CALL SwVbaColumn::setWidth( sal_Int32 _width ) throw ( css::uno::RuntimeException ) { -/* uno::Reference< beans::XPropertySet > xTableProps( mxTextTable, uno::UNO_QUERY_THROW ); - uno::Sequence< text::TableColumnSeparator > aSeparators; - xTableProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("TableColumnSeparators") ) ) >>= aSeparators; - sal_Int32 nTableWidth = SwVbaTable::getTableWidth( xTableProps ); - sal_Int32 nColCont = aSeparators.getLength() + 1; - double dAbsColWidth[ nColCont ]; - calculateAbsoluteColumnWidth( nTableWidth, aSeparators, dAbsColWidth ); - dAbsColWidth[ mnIndex ] = Millimeter::getInHundredthsOfOneMillimeter( _width ); - double tableWidth = 0.0; - for( sal_Int32 i = 0; i < nColCont; i++ ) - { - tableWidth += dAbsColWidth[i]; - } - - double dRelColWidth[ nColCont ]; - calculateRelativeColumnWidth( dAbsColWidth, dRelColWidth, nColCont); - - text::TableColumnSeparator* pArray = aSeparators.getArray(); - for( sal_Int32 i = 0; i < nColCont - 1; i++ ) - { - pArray[i].Position = (sal_Int16)(dRelColWidth[i]); - } - - xTableProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("TableColumnSeparators") ), uno::makeAny( aSeparators ) ); - SwVbaTable::setTableWidth( xTableProps, (sal_Int32)( tableWidth ) ); - */ SwVbaTableHelper aTableHelper( mxTextTable ); aTableHelper.SetColWidth( _width, mnIndex ); diff --git a/sw/source/ui/vba/vbadocument.cxx b/sw/source/ui/vba/vbadocument.cxx index 30d41900019b..8b8eb4440a72 100644 --- a/sw/source/ui/vba/vbadocument.cxx +++ b/sw/source/ui/vba/vbadocument.cxx @@ -210,7 +210,6 @@ uno::Any SAL_CALL SwVbaDocument::Shapes( const uno::Any& index ) throw (uno::RuntimeException) { uno::Reference< drawing::XDrawPageSupplier > xDrawPageSupplier( getModel(), uno::UNO_QUERY_THROW ); - //uno::Reference< drawing::XShapes > xShapes( xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY_THROW ); uno::Reference< container::XIndexAccess > xIndexAccess( xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY_THROW ); uno::Reference< frame::XModel > xModel( mxTextDocument, uno::UNO_QUERY_THROW ); uno::Reference< XCollection > xCol( new ScVbaShapes( this, mxContext, xIndexAccess, xModel ) ); diff --git a/sw/source/ui/vba/vbadocumentproperties.cxx b/sw/source/ui/vba/vbadocumentproperties.cxx index 428d5f3ca98c..1b97e6cf383e 100644 --- a/sw/source/ui/vba/vbadocumentproperties.cxx +++ b/sw/source/ui/vba/vbadocumentproperties.cxx @@ -136,7 +136,6 @@ public: { // Characters, ParagraphCount & WordCount are available from // the model ( and addtionally these also update the statics object ) - //return mxProps->getPropertyValue( rPropName ); return mxModelProps->getPropertyValue( rPropName ); } catch( uno::Exception& ) diff --git a/sw/source/ui/vba/vbafield.cxx b/sw/source/ui/vba/vbafield.cxx index c92dd11cd09b..9f7f3da8f9bb 100644 --- a/sw/source/ui/vba/vbafield.cxx +++ b/sw/source/ui/vba/vbafield.cxx @@ -126,13 +126,11 @@ _ReadFieldParams::_ReadFieldParams( const String& _rData ) nFnd = nNext; nSavPtr = nNext; aFieldName = aData.Copy( 0, nFnd ); -// cLastChar = aData.GetChar( nSavPtr ); } _ReadFieldParams::~_ReadFieldParams() { -// aData.SetChar( nSavPtr, cLastChar ); } diff --git a/sw/source/ui/vba/vbalisthelper.cxx b/sw/source/ui/vba/vbalisthelper.cxx index ef35be98833c..75e4266a9bc7 100644 --- a/sw/source/ui/vba/vbalisthelper.cxx +++ b/sw/source/ui/vba/vbalisthelper.cxx @@ -119,7 +119,6 @@ void SwVbaListHelper::Init() throw( css::uno::RuntimeException ) // insert this style into style family, or the property NumberingRules doesn't exist. mxStyleFamily->insertByName( msStyleName, uno::makeAny( mxStyleProps ) ); mxStyleProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("NumberingRules") ) ) >>= mxNumberingRules; - //mxNumberingRules.set( xDocMSF->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.NumberingRules") ) ), uno::UNO_QUERY_THROW ); CreateListTemplate(); diff --git a/sw/source/ui/vba/vbapagesetup.cxx b/sw/source/ui/vba/vbapagesetup.cxx index 7a1519bb2578..5af4ec6799ae 100644 --- a/sw/source/ui/vba/vbapagesetup.cxx +++ b/sw/source/ui/vba/vbapagesetup.cxx @@ -237,7 +237,6 @@ rtl::OUString SwVbaPageSetup::getStyleOfFirstPage() throw (uno::RuntimeException sal_Int32 wdSectionStart = word::WdSectionStart::wdSectionNewPage; uno::Reference< container::XNamed > xNamed( mxPageProps, uno::UNO_QUERY_THROW ); rtl::OUString sStyleName = xNamed->getName(); - //mxPageProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Name") ) ) >>= sStyleName; if( sStyleName.equalsAscii("Left Page") ) wdSectionStart = word::WdSectionStart::wdSectionEvenPage; else if( sStyleName.equalsAscii("Right Page") ) diff --git a/sw/source/ui/vba/vbaparagraph.cxx b/sw/source/ui/vba/vbaparagraph.cxx index df6fec751ab9..1861f316cf87 100644 --- a/sw/source/ui/vba/vbaparagraph.cxx +++ b/sw/source/ui/vba/vbaparagraph.cxx @@ -82,8 +82,6 @@ SwVbaParagraph::getServiceNames() return aServiceNames; } - -//typedef ::cppu::WeakImplHelper1< container::XEnumeration > ParagraphEnumeration_BASE; typedef ::cppu::WeakImplHelper2< container::XIndexAccess, container::XEnumerationAccess > ParagraphCollectionHelper_BASE; class ParagraphCollectionHelper : public ParagraphCollectionHelper_BASE diff --git a/sw/source/ui/vba/vbaselection.cxx b/sw/source/ui/vba/vbaselection.cxx index 04f7e3fdaf44..1507d3fc0e56 100644 --- a/sw/source/ui/vba/vbaselection.cxx +++ b/sw/source/ui/vba/vbaselection.cxx @@ -576,7 +576,6 @@ uno::Reference< word::XRange > SAL_CALL SwVbaSelection::GoTo( const uno::Any& _w uno::Reference< word::XApplication > xApplication( Application(), uno::UNO_QUERY_THROW ); uno::Reference< word::XBookmark > xBookmark( xApplication->getActiveDocument()->Bookmarks(_name), uno::UNO_QUERY_THROW ); xBookmark->Select(); - //return uno::Reference< word::XRange >( xBookmark->Range(), uno::UNO_QUERY_THROW ); break; } case word::WdGoToItem::wdGoToPage: @@ -683,8 +682,6 @@ void SAL_CALL SwVbaSelection::setLanguageID( ::sal_Int32 _languageid ) throw (un uno::Any SAL_CALL SwVbaSelection::Information( sal_Int32 _type ) throw (uno::RuntimeException) { uno::Any result; - //uno::Reference< view::XSelectionSupplier > xSel( mxModel->getCurrentController(), uno::UNO_QUERY_THROW ); - //uno::Any aSelectedObject = xSel->getSelection(); switch( _type ) { case word::WdInformation::wdActiveEndPageNumber: @@ -781,8 +778,6 @@ uno::Any SAL_CALL SwVbaSelection::Information( sal_Int32 _type ) throw (uno::Run default: throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Not implemented") ), uno::Reference< uno::XInterface >() ); } - // This method fails to restore the previouse selection - //xSel->select( aSelectedObject ); return result; } diff --git a/sw/source/ui/vba/vbastyles.cxx b/sw/source/ui/vba/vbastyles.cxx index 7d17e98e2ffa..06d9d52c8d5b 100644 --- a/sw/source/ui/vba/vbastyles.cxx +++ b/sw/source/ui/vba/vbastyles.cxx @@ -326,7 +326,6 @@ SwVbaStyles::Item( const uno::Any& Index1, const uno::Any& Index2 ) throw (uno:: rtl::OUString aStyleName = rtl::OUString::createFromAscii( pTable->pOOoStyleName ); if( aStyleName.getLength() > 0 ) { - //rtl::OUString aStyleType = SwVbaStyle::getOOoStyleTypeFromMSWord( pTable->wdStyleType ); rtl::OUString aStyleType; switch( pTable->wdStyleType ) { diff --git a/sw/source/ui/vba/vbatablehelper.cxx b/sw/source/ui/vba/vbatablehelper.cxx index 2fa13bc98673..452ba5024daf 100644 --- a/sw/source/ui/vba/vbatablehelper.cxx +++ b/sw/source/ui/vba/vbatablehelper.cxx @@ -190,11 +190,6 @@ void SwVbaTableHelper::InitTabCols( SwTabCols& rCols, const SwTableBox *pStart, rCols.SetLeft ( 0 ); rCols.SetRight ( UNO_TABLE_COLUMN_SUM ); rCols.SetRightMax( UNO_TABLE_COLUMN_SUM ); - - //if( !pDoc ) - // { - // pDoc = word::getDocShell( getCurrentDocument() )->GetDoc(); - // } pTable->GetTabCols( rCols, pStart, sal_False, sal_False ); } @@ -272,14 +267,11 @@ void SwVbaTableHelper::SetColWidth( sal_Int32 _width, sal_Int32 nCol, sal_Int32 SwTabCols aOldCols; InitTabCols( aOldCols, pStart, bCurRowOnly ); - //BOOL bCurRowOnly = FALSE; SwTwips nWidth = 0; SwTabCols aCols( aOldCols ); if ( aCols.Count() > 0 ) { - // if(aCols.Count() != GetColCount( aCols )) - // bCurRowOnly = TRUE; nWidth = GetColWidth( aCols, nCol); int nDiff = (int)(nNewWidth - nWidth); @@ -302,7 +294,6 @@ void SwVbaTableHelper::SetColWidth( sal_Int32 _width, sal_Int32 nCol, sal_Int32 else aCols.SetRight( Min( (long)nNewWidth, aCols.GetRightMax()) ); - //pDoc->SetTabCols(*pTable, aCols, aOldCols, pStartBox, bCurRowOnly ); pTable->SetTabCols(aCols, aOldCols, pStart, bCurRowOnly ); } diff --git a/sw/source/ui/vba/vbatables.cxx b/sw/source/ui/vba/vbatables.cxx index ab7ab7c67766..77e3a464f665 100644 --- a/sw/source/ui/vba/vbatables.cxx +++ b/sw/source/ui/vba/vbatables.cxx @@ -161,11 +161,7 @@ SwVbaTables::Add( const uno::Reference< word::XRange >& Range, const uno::Any& N uno::Reference< text::XTextTable > xTable; xTable.set( xMsf->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextTable")) ), uno::UNO_QUERY_THROW ); -/* - comphelper::ComponentContext aCtx( xMsf ); - if ( !aCtx.createComponent( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextTable") ), xTable ) ); - throw uno::RuntimeException(); // #FIXME better exception?? -*/ + xTable->initialize( nRows, nCols ); uno::Reference< text::XText > xText = xTextRange->getText(); uno::Reference< text::XTextContent > xContext( xTable, uno::UNO_QUERY_THROW ); diff --git a/sw/source/ui/vba/vbatablesofcontents.cxx b/sw/source/ui/vba/vbatablesofcontents.cxx index 93f665939a55..00123c9459dd 100644 --- a/sw/source/ui/vba/vbatablesofcontents.cxx +++ b/sw/source/ui/vba/vbatablesofcontents.cxx @@ -143,8 +143,6 @@ SwVbaTablesOfContents::Add( const uno::Reference< word::XRange >& Range, const u xToc->setUseFields( bUseFields ); sal_Bool bUseOutlineLevels = sal_True; - //if( UseOutlineLevels.hasValue() ) - // UseOutlineLevels >>= bUseOutlineLevels; xToc->setUseOutlineLevels( bUseOutlineLevels ); SwVbaRange* pVbaRange = dynamic_cast<SwVbaRange*>( Range.get() ); diff --git a/sw/source/ui/vba/vbatemplate.cxx b/sw/source/ui/vba/vbatemplate.cxx index 6ac677ed5146..6216b853ee3e 100644 --- a/sw/source/ui/vba/vbatemplate.cxx +++ b/sw/source/ui/vba/vbatemplate.cxx @@ -118,7 +118,6 @@ SwVbaTemplate::AutoTextEntries( const uno::Any& index ) throw (uno::RuntimeExcep else { throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Auto Text Entry doesn't exist") ), uno::Reference< uno::XInterface >() ); - //xGroup.set( xAutoTextContainer->insertNewByName( sGroup ), uno::UNO_QUERY_THROW ); } uno::Reference< XCollection > xCol( new SwVbaAutoTextEntries( this, mxContext, xGroup ) ); diff --git a/sw/source/ui/vba/vbaview.cxx b/sw/source/ui/vba/vbaview.cxx index 044884af3e71..169695f81e94 100644 --- a/sw/source/ui/vba/vbaview.cxx +++ b/sw/source/ui/vba/vbaview.cxx @@ -130,9 +130,6 @@ SwVbaView::setSeekView( ::sal_Int32 _seekview ) throw (css::uno::RuntimeExceptio // document, so we can jump back to this position, if the macro sets // the ViewMode back to wdSeekMainDocument - // if( _seekview == getSeekView() ) - // return; - word::gotoSelectedObjectAnchor( mxModel ); switch( _seekview ) { |