diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-12-28 14:08:33 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-01-05 09:18:15 +0000 |
commit | f80d46233150d36183ec3e03708f9f6290c8c339 (patch) | |
tree | 6711eae57d7fe77f005c6be2987b4457f4598872 | |
parent | catch by const ref (diff) | |
download | core-f80d46233150d36183ec3e03708f9f6290c8c339.tar.gz core-f80d46233150d36183ec3e03708f9f6290c8c339.zip |
callcatcher: drop some unused methods
18 files changed, 26 insertions, 1421 deletions
diff --git a/comphelper/inc/comphelper/sequenceashashmap.hxx b/comphelper/inc/comphelper/sequenceashashmap.hxx index e809d6a78f78..2762d39156f8 100644 --- a/comphelper/inc/comphelper/sequenceashashmap.hxx +++ b/comphelper/inc/comphelper/sequenceashashmap.hxx @@ -45,15 +45,6 @@ #include <com/sun/star/beans/IllegalTypeException.hpp> #include "comphelper/comphelperdllapi.h" -// see method dbg_dumpToFile() below! -#if OSL_DEBUG_LEVEL > 1 - #ifndef _RTL_USTRBUF_HXX_ - #include <rtl/ustrbuf.hxx> - #endif - - #include <stdio.h> -#endif - //_______________________________________________ // namespace @@ -203,24 +194,6 @@ class COMPHELPER_DLLPUBLIC SequenceAsHashMap : public SequenceAsHashMapBase const ::com::sun::star::uno::Any getAsConstAny(::sal_Bool bAsPropertyValue) const; //--------------------------------------- - /** @short return this map instance as a - sequence< Any >, which can be - used in const environments only. - - @descr Its made const to prevent using of the - return value directly as an in/out parameter! - usage: myMethod(stlDequeAdapter.getAsAnyList()); - - @param bAsPropertyValue - switch between using of PropertyValue or NamedValue as - value type. - - @return A const sequence which elements of Any, which - contains all items of this map. - */ - const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > getAsConstAnyList(::sal_Bool bAsPropertyValue) const; - - //--------------------------------------- /** @short return this map instance to as a NamedValue sequence, which can be used in const environments only. @@ -350,29 +323,6 @@ class COMPHELPER_DLLPUBLIC SequenceAsHashMap : public SequenceAsHashMapBase the map containing all items for the update. */ void update(const SequenceAsHashMap& rSource); - - //--------------------------------------- - /** @short can be used to generate a file dump of - the current content of this instance. - - @descr Because the content of STL container - cant be analyzed easy, such dump function - seem to be usefull. - Of course its available in debug versions - only. - - @param pFileName - a system file name. - (doesnt matter if relativ or absolute) - - @param pComment - used to mark the dump inside the same log file. - Can be usefull to analyze changes of this - hash map due to the parts of an operation. - */ - #if OSL_DEBUG_LEVEL > 1 - void dbg_dumpToFile(const char* pFileName, const char* pComment) const; - #endif }; } // namespace comphelper diff --git a/comphelper/source/misc/sequenceashashmap.cxx b/comphelper/source/misc/sequenceashashmap.cxx index de2715b33e45..9c7a4cd81a6e 100644 --- a/comphelper/source/misc/sequenceashashmap.cxx +++ b/comphelper/source/misc/sequenceashashmap.cxx @@ -243,41 +243,6 @@ const css::uno::Any SequenceAsHashMap::getAsConstAny(::sal_Bool bAsPropertyValue } /*----------------------------------------------- - 30.07.2007 14:10 ------------------------------------------------*/ -const css::uno::Sequence< css::uno::Any > SequenceAsHashMap::getAsConstAnyList(::sal_Bool bAsPropertyValueList) const -{ - ::sal_Int32 i = 0; - ::sal_Int32 c = (::sal_Int32)size(); - css::uno::Sequence< css::uno::Any > lDestination(c); - css::uno::Any* pDestination = lDestination.getArray(); - - for (const_iterator pThis = begin(); - pThis != end() ; - ++pThis ) - { - if (bAsPropertyValueList) - { - css::beans::PropertyValue aProp; - aProp.Name = pThis->first; - aProp.Value = pThis->second; - pDestination[i] = css::uno::makeAny(aProp); - } - else - { - css::beans::NamedValue aProp; - aProp.Name = pThis->first; - aProp.Value = pThis->second; - pDestination[i] = css::uno::makeAny(aProp); - } - - ++i; - } - - return lDestination; -} - -/*----------------------------------------------- 04.11.2003 08:30 -----------------------------------------------*/ const css::uno::Sequence< css::beans::NamedValue > SequenceAsHashMap::getAsConstNamedValueList() const @@ -339,63 +304,6 @@ void SequenceAsHashMap::update(const SequenceAsHashMap& rUpdate) } } -/*----------------------------------------------- - 04.11.2003 08:30 ------------------------------------------------*/ -#if OSL_DEBUG_LEVEL > 1 -void SequenceAsHashMap::dbg_dumpToFile(const char* pFileName, - const char* pComment ) const -{ - if (!pFileName || !pComment) - return; - - FILE* pFile = fopen(pFileName, "a"); - if (!pFile) - return; - - ::rtl::OUStringBuffer sBuffer(1000); - sBuffer.appendAscii("\n----------------------------------------\n"); - sBuffer.appendAscii(pComment ); - sBuffer.appendAscii("\n----------------------------------------\n"); - sal_Int32 i = 0; - for (const_iterator pIt = begin(); - pIt != end() ; - ++pIt ) - { - sBuffer.appendAscii("[" ); - sBuffer.append (i++ ); - sBuffer.appendAscii("] " ); - sBuffer.appendAscii("\"" ); - sBuffer.append (pIt->first); - sBuffer.appendAscii("\" = \"" ); - - ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xv; - ::rtl::OUString sv; - sal_Int32 nv; - sal_Bool bv; - - if (pIt->second >>= sv) - sBuffer.append(sv); - else - if (pIt->second >>= nv) - sBuffer.append(nv); - else - if (pIt->second >>= bv) - sBuffer.appendAscii(bv ? "true" : "false"); - else - if (pIt->second >>= xv) - sBuffer.appendAscii(xv.is() ? "object" : "null"); - else - sBuffer.appendAscii("???"); - - sBuffer.appendAscii("\"\n"); - } - - fprintf(pFile, ::rtl::OUStringToOString(sBuffer.makeStringAndClear(), RTL_TEXTENCODING_UTF8).getStr()); - fclose(pFile); -} -#endif // OSL_DEBUG_LEVEL > 1 - } // namespace comphelper /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx b/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx index 6373bb7ec954..33a2f3d8c62e 100644 --- a/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx +++ b/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx @@ -109,32 +109,4 @@ IniParser::IniParser(OUString const & rIniName) throw(com::sun::star::io::IOExce #endif } -#if OSL_DEBUG_LEVEL > 1 -void IniParser::Dump() -{ - IniSectionMap::iterator iBegin = mAllSection.begin(); - IniSectionMap::iterator iEnd = mAllSection.end(); - for(;iBegin != iEnd;iBegin++) - { - ini_Section *aSection = &(*iBegin).second; - OString sec_name_tmp = OUStringToOString(aSection->sName, RTL_TEXTENCODING_ASCII_US); - for(NameValueList::iterator itor=aSection->lList.begin(); - itor != aSection->lList.end(); - itor++) - { - struct ini_NameValue * aValue = &(*itor); - OString name_tmp = OUStringToOString(aValue->sName, RTL_TEXTENCODING_ASCII_US); - OString value_tmp = OUStringToOString(aValue->sValue, RTL_TEXTENCODING_UTF8); - OSL_TRACE( - " section=%s name=%s value=%s\n", - sec_name_tmp.getStr(), - name_tmp.getStr(), - value_tmp.getStr() ); - - } - } - -} -#endif - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.hxx b/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.hxx index 3064bea2bffd..6acf6741bb24 100644 --- a/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.hxx +++ b/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.hxx @@ -75,11 +75,7 @@ class IniParser IniSectionMap mAllSection; public: IniSectionMap * getAllSection(){return &mAllSection;}; - IniParser(OUString const & rIniName) throw(com::sun::star::io::IOException ); -#if OSL_DEBUG_LEVEL > 1 - void Dump(); -#endif - + IniParser(OUString const & rIniName) throw(com::sun::star::io::IOException); }; #endif diff --git a/filter/source/xsltdialog/xmlfileview.cxx b/filter/source/xsltdialog/xmlfileview.cxx index c38dfc932c18..29f724d49701 100644 --- a/filter/source/xsltdialog/xmlfileview.cxx +++ b/filter/source/xsltdialog/xmlfileview.cxx @@ -79,162 +79,6 @@ struct SwTextPortion typedef std::deque<SwTextPortion> SwTextPortions; -class XMLErrorHandler : public ::cppu::WeakImplHelper1< XErrorHandler > -{ -public: - XMLErrorHandler( XMLSourceFileDialog* pParent, ListBox& rListBox ); - - // Methods - virtual void SAL_CALL error( const Any& aSAXParseException ) throw (SAXException, RuntimeException); - virtual void SAL_CALL fatalError( const Any& aSAXParseException ) throw (SAXException, RuntimeException); - virtual void SAL_CALL warning( const Any& aSAXParseException ) throw (SAXException, RuntimeException); - -private: - XMLSourceFileDialog* mpParent; - ListBox& mrListBox; -}; - -XMLErrorHandler::XMLErrorHandler( XMLSourceFileDialog* pParent, ListBox& rListBox ) -: mpParent( pParent ), - mrListBox( rListBox ) -{ -} - -// XMLErrorHandler -void SAL_CALL XMLErrorHandler::error( const Any& aSAXParseException ) throw (SAXException, RuntimeException) -{ - ::SolarMutexGuard aGuard; - - SAXParseException e; - if( aSAXParseException >>= e ) - { - String sErr( String::CreateFromInt32( e.LineNumber ) ); - sErr += String( RTL_CONSTASCII_USTRINGPARAM( " : " ) ); - sErr += String( e.Message ); - sal_uInt16 nEntry = mrListBox.InsertEntry( sErr ); - mrListBox.SetEntryData( nEntry, (void*)(sal_IntPtr)e.LineNumber ); - } -} - -void SAL_CALL XMLErrorHandler::fatalError( const Any& aSAXParseException ) throw (SAXException, RuntimeException) -{ - ::SolarMutexGuard aGuard; - - SAXParseException e; - if( aSAXParseException >>= e ) - { - String sErr( String::CreateFromInt32( e.LineNumber ) ); - sErr += String( RTL_CONSTASCII_USTRINGPARAM( " : " ) ); - sErr += String( e.Message ); - sal_uInt16 nEntry = mrListBox.InsertEntry( sErr ); - mrListBox.SetEntryData( nEntry, (void*)(sal_IntPtr)e.LineNumber ); - } -} - -void SAL_CALL XMLErrorHandler::warning( const Any& /* aSAXParseException */ ) throw (SAXException, RuntimeException) -{ -} - - -XMLFileWindow::XMLFileWindow( Window* pParent ) : - Window( pParent, WB_BORDER|WB_CLIPCHILDREN ), - pTextEngine(0), - pOutWin(0), - pHScrollbar(0), - pVScrollbar(0), - nCurTextWidth(0), - nStartLine(USHRT_MAX), - eSourceEncoding(osl_getThreadTextEncoding()), - bHighlighting(false) -{ - CreateTextEngine(); -} - -XMLFileWindow::~XMLFileWindow() -{ - if ( pTextEngine ) - { - EndListening( *pTextEngine ); - pTextEngine->RemoveView( pTextView ); - - delete pHScrollbar; - delete pVScrollbar; - - delete pTextView; - delete pTextEngine; - } - delete pOutWin; -} - -void XMLFileWindow::DataChanged( const DataChangedEvent& rDCEvt ) -{ - Window::DataChanged( rDCEvt ); - - switch ( rDCEvt.GetType() ) - { - case DATACHANGED_SETTINGS: - // ScrollBars neu anordnen bzw. Resize ausloesen, da sich - // ScrollBar-Groesse geaendert haben kann. Dazu muss dann im - // Resize-Handler aber auch die Groesse der ScrollBars aus - // den Settings abgefragt werden. - if( rDCEvt.GetFlags() & SETTINGS_STYLE ) - Resize(); - break; - } -} - -void XMLFileWindow::Resize() -{ - // ScrollBars, etc. passiert in Adjust... - if ( pTextView ) - { - long nVisY = pTextView->GetStartDocPos().Y(); - pTextView->ShowCursor(); - Size aOutSz( GetOutputSizePixel() ); - long nMaxVisAreaStart = pTextView->GetTextEngine()->GetTextHeight() - aOutSz.Height(); - if ( nMaxVisAreaStart < 0 ) - nMaxVisAreaStart = 0; - if ( pTextView->GetStartDocPos().Y() > nMaxVisAreaStart ) - { - Point aStartDocPos( pTextView->GetStartDocPos() ); - aStartDocPos.Y() = nMaxVisAreaStart; - pTextView->SetStartDocPos( aStartDocPos ); - pTextView->ShowCursor(); - } - long nScrollStd = GetSettings().GetStyleSettings().GetScrollBarSize(); - Size aScrollSz(aOutSz.Width() - nScrollStd, nScrollStd ); - Point aScrollPos(0, aOutSz.Height() - nScrollStd); - - pHScrollbar->SetPosSizePixel( aScrollPos, aScrollSz); - - aScrollSz.Width() = aScrollSz.Height(); - aScrollSz.Height() = aOutSz.Height() - aScrollSz.Height(); - aScrollPos = Point(aOutSz.Width() - nScrollStd, 0); - - pVScrollbar->SetPosSizePixel( aScrollPos, aScrollSz); - aOutSz.Width() -= nScrollStd; - aOutSz.Height() -= nScrollStd; - pOutWin->SetOutputSizePixel(aOutSz); - InitScrollBars(); - - // Zeile im ersten Resize setzen - if(USHRT_MAX != nStartLine) - { - if(nStartLine < pTextEngine->GetParagraphCount()) - { - TextSelection aSel(TextPaM( nStartLine, 0 ), TextPaM( nStartLine, 0x0 )); - pTextView->SetSelection(aSel); - pTextView->ShowCursor(); - } - nStartLine = USHRT_MAX; - } - - if ( nVisY != pTextView->GetStartDocPos().Y() ) - InvalidateWindow(); - } - -} - void TextViewOutWin::DataChanged( const DataChangedEvent& rDCEvt ) { Window::DataChanged( rDCEvt ); @@ -279,24 +123,16 @@ void TextViewOutWin::Command( const CommandEvent& rCEvt ) switch(rCEvt.GetCommand()) { case COMMAND_CONTEXTMENU: - break; case COMMAND_WHEEL: case COMMAND_STARTAUTOSCROLL: case COMMAND_AUTOSCROLL: - { - const CommandWheelData* pWData = rCEvt.GetWheelData(); - if( !pWData || COMMAND_WHEEL_ZOOM != pWData->GetMode() ) - { - ((XMLFileWindow*)GetParent())->HandleWheelCommand( rCEvt ); - } - } break; default: if ( pTextView ) pTextView->Command( rCEvt ); - else - Window::Command(rCEvt); + else + Window::Command(rCEvt); } } @@ -311,348 +147,6 @@ void TextViewOutWin::Paint( const Rectangle& rRect ) pTextView->Paint( rRect ); } -void XMLFileWindow::CreateTextEngine() -{ - const Color &rCol = GetSettings().GetStyleSettings().GetWindowColor(); - pOutWin = new TextViewOutWin(this, 0); - pOutWin->SetBackground(Wallpaper(rCol)); - pOutWin->SetPointer(Pointer(POINTER_TEXT)); - pOutWin->Show(); - - //Scrollbars anlegen - pHScrollbar = new ScrollBar(this, WB_3DLOOK |WB_HSCROLL|WB_DRAG); - pHScrollbar->SetScrollHdl(LINK(this, XMLFileWindow, ScrollHdl)); - pHScrollbar->Show(); - - pVScrollbar = new ScrollBar(this, WB_3DLOOK |WB_VSCROLL|WB_DRAG); - pVScrollbar->SetScrollHdl(LINK(this, XMLFileWindow, ScrollHdl)); - pHScrollbar->EnableDrag(); - pVScrollbar->Show(); - - pTextEngine = new TextEngine; - pTextView = new TextView( pTextEngine, pOutWin ); - pTextView->SetAutoIndentMode(sal_True); - pOutWin->SetTextView(pTextView); - - pTextEngine->SetUpdateMode( sal_False ); - pTextEngine->InsertView( pTextView ); - - Font aFont; - aFont.SetTransparent( sal_False ); - aFont.SetFillColor( rCol ); - SetPointFont( aFont ); - aFont = GetFont(); - aFont.SetFillColor( rCol ); - pOutWin->SetFont( aFont ); - pTextEngine->SetFont( aFont ); - - aSyntaxIdleTimer.SetTimeout( SYNTAX_HIGHLIGHT_TIMEOUT ); - aSyntaxIdleTimer.SetTimeoutHdl( LINK( this, XMLFileWindow, SyntaxTimerHdl ) ); - - pTextEngine->EnableUndo( sal_False ); - pTextEngine->SetUpdateMode( sal_True ); - - pTextView->HideCursor(); - - InitScrollBars(); - StartListening( *pTextEngine ); -} - -void XMLFileWindow::SetScrollBarRanges() -{ - pHScrollbar->SetRange( Range( 0, nCurTextWidth-1 ) ); - pVScrollbar->SetRange( Range(0, pTextEngine->GetTextHeight()-1) ); -} - -void XMLFileWindow::InitScrollBars() -{ - SetScrollBarRanges(); - - Size aOutSz( pOutWin->GetOutputSizePixel() ); - pVScrollbar->SetVisibleSize( aOutSz.Height() ); - pVScrollbar->SetPageSize( aOutSz.Height() * 8 / 10 ); - pVScrollbar->SetLineSize( pOutWin->GetTextHeight() ); - pVScrollbar->SetThumbPos( pTextView->GetStartDocPos().Y() ); - pHScrollbar->SetVisibleSize( aOutSz.Width() ); - pHScrollbar->SetPageSize( aOutSz.Width() * 8 / 10 ); - pHScrollbar->SetLineSize( pOutWin->GetTextWidth( 'x' ) ); - pHScrollbar->SetThumbPos( pTextView->GetStartDocPos().X() ); - -} - -IMPL_LINK(XMLFileWindow, ScrollHdl, ScrollBar*, pScroll) -{ - if(pScroll == pVScrollbar) - { - long nDiff = pTextView->GetStartDocPos().Y() - pScroll->GetThumbPos(); - GetTextView()->Scroll( 0, nDiff ); - pTextView->ShowCursor( sal_False, sal_True ); - pScroll->SetThumbPos( pTextView->GetStartDocPos().Y() ); - } - else - { - long nDiff = pTextView->GetStartDocPos().X() - pScroll->GetThumbPos(); - GetTextView()->Scroll( nDiff, 0 ); - pTextView->ShowCursor( sal_False, sal_True ); - pScroll->SetThumbPos( pTextView->GetStartDocPos().X() ); - } - return 0; -} - -void XMLFileWindow::Notify( SfxBroadcaster& /* rBC */, const SfxHint& rHint ) -{ - if ( rHint.ISA( TextHint ) ) - { - const TextHint& rTextHint = (const TextHint&)rHint; - if( rTextHint.GetId() == TEXT_HINT_VIEWSCROLLED ) - { - pHScrollbar->SetThumbPos( pTextView->GetStartDocPos().X() ); - pVScrollbar->SetThumbPos( pTextView->GetStartDocPos().Y() ); - } - else if( rTextHint.GetId() == TEXT_HINT_TEXTHEIGHTCHANGED ) - { - if ( (long)pTextEngine->GetTextHeight() < pOutWin->GetOutputSizePixel().Height() ) - pTextView->Scroll( 0, pTextView->GetStartDocPos().Y() ); - pVScrollbar->SetThumbPos( pTextView->GetStartDocPos().Y() ); - SetScrollBarRanges(); - } - else if( rTextHint.GetId() == TEXT_HINT_FORMATPARA ) - { - DoDelayedSyntaxHighlight( (sal_uInt16)rTextHint.GetValue() ); - } - } -} - -void XMLFileWindow::InvalidateWindow() -{ - pOutWin->Invalidate(); - Window::Invalidate(); - -} - -void XMLFileWindow::Command( const CommandEvent& rCEvt ) -{ - switch(rCEvt.GetCommand()) - { - case COMMAND_WHEEL: - case COMMAND_STARTAUTOSCROLL: - case COMMAND_AUTOSCROLL: - { - const CommandWheelData* pWData = rCEvt.GetWheelData(); - if( !pWData || COMMAND_WHEEL_ZOOM != pWData->GetMode() ) - HandleScrollCommand( rCEvt, pHScrollbar, pVScrollbar ); - } - break; - default: - Window::Command(rCEvt); - } -} - -void XMLFileWindow::HandleWheelCommand( const CommandEvent& rCEvt ) -{ - pTextView->Command(rCEvt); - HandleScrollCommand( rCEvt, pHScrollbar, pVScrollbar ); -} - -void XMLFileWindow::GetFocus() -{ - pOutWin->GrabFocus(); -} - -void XMLFileWindow::ShowWindow( const rtl::OUString& rFileName ) -{ - String aFileName( rFileName ); - SvFileStream aStream( aFileName, STREAM_READ ); - - // since the xml files we load are utf-8 encoded, we need to set - // this encoding at the SvFileStream, else the TextEngine will - // use its default encoding which is not UTF8 - const sal_Char *pCharSet = rtl_getBestMimeCharsetFromTextEncoding( RTL_TEXTENCODING_UTF8 ); - rtl_TextEncoding eDestEnc = rtl_getTextEncodingFromMimeCharset( pCharSet ); - aStream.SetStreamCharSet( eDestEnc ); - - if( Read( aStream ) ) - { - long nPrevTextWidth = nCurTextWidth; - nCurTextWidth = pTextEngine->CalcTextWidth() + 25; // kleine Toleranz - if ( nCurTextWidth != nPrevTextWidth ) - SetScrollBarRanges(); - - TextPaM aPaM( pTextView->CursorStartOfDoc() ); - TextSelection aSelection( aPaM, aPaM ); - pTextView->SetSelection( aSelection, true ); - - Window::Show(); - } -} - -void XMLFileWindow::showLine( sal_Int32 nLine ) -{ - TextPaM aPaM( pTextView->CursorStartOfDoc() ); - while( nLine-- ) - aPaM = pTextView->CursorDown( aPaM ); - - TextSelection aSelection( pTextView->CursorEndOfLine( aPaM ), aPaM ); - pTextView->SetSelection( aSelection, true ); -} - - -XMLSourceFileDialog::XMLSourceFileDialog( Window* pParent, ResMgr& rResMgr, const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rxMSF ) -: WorkWindow( pParent, ResId( DLG_XML_SOURCE_FILE_DIALOG, rResMgr ) ), - mnOutputHeight( LogicToPixel( Size( 80, 80 ), MAP_APPFONT ).Height() ), - mxMSF( rxMSF ), - mrResMgr( rResMgr ), - maLBOutput( this ), - maPBValidate( this, ResId( PB_VALIDATE, rResMgr ) ) -{ - - FreeResource(); - - maPBValidate.SetClickHdl(LINK( this, XMLSourceFileDialog, ClickHdl_Impl ) ); - maLBOutput.SetSelectHdl(LINK(this, XMLSourceFileDialog, SelectHdl_Impl ) ); - mpTextWindow = new XMLFileWindow( this ); - mpTextWindow->SetHelpId( HID_XML_FILTER_OUTPUT_WINDOW ); - maLBOutput.SetHelpId( HID_XML_FILTER_TEST_VALIDATE_OUPUT ); - - Resize(); -} - -XMLSourceFileDialog::~XMLSourceFileDialog() -{ - if( !maFileURL.isEmpty() ) - osl::File::remove( maFileURL ); - - delete mpTextWindow; -} - -void XMLSourceFileDialog::ShowWindow( const rtl::OUString& rFileName, const filter_info_impl* pFilterInfo ) -{ - EnterWait(); - if( !maFileURL.isEmpty() ) - { - osl::File::remove( maFileURL ); - delete mpTextWindow; - mpTextWindow = new XMLFileWindow( this ); - maLBOutput.Hide(); - maLBOutput.Clear(); - maPBValidate.Enable(sal_True); - Resize(); - } - - mpFilterInfo = pFilterInfo; - maFileURL = rFileName; - mpTextWindow->ShowWindow( rFileName ); - WorkWindow::Show(); - LeaveWait(); -} - -void XMLSourceFileDialog::Resize() -{ - bool bOutputVisible = maLBOutput.IsVisible() != 0; - - Point aSpacing( LogicToPixel( Point( 6, 6 ), MAP_APPFONT ) ); - Size aButton( maPBValidate.GetSizePixel() ); - - Size aDialogSize( GetOutputSizePixel() ); - Size aOutputSize( aDialogSize.Width(), bOutputVisible ? mnOutputHeight : 0 ); - - Point aTextWindowPos( 0, 2* aSpacing.Y() + aButton.Height() ); - Size aTextWindowSize( aDialogSize.Width(), aDialogSize.Height() - aTextWindowPos.Y() - aOutputSize.Height() ); - - mpTextWindow->SetPosSizePixel( aTextWindowPos, aTextWindowSize ); - - if( bOutputVisible ) - { - Point aOutputPos( 0, aTextWindowPos.Y() + aTextWindowSize.Height() ); - maLBOutput.SetPosSizePixel( aOutputPos, aOutputSize ); - } -} - - -IMPL_LINK(XMLSourceFileDialog, SelectHdl_Impl, ListBox *, pListBox ) -{ - sal_uInt16 nEntry = pListBox->GetSelectEntryPos(); - if( LISTBOX_ENTRY_NOTFOUND != nEntry ) - { - int nLine = (int)(sal_IntPtr)pListBox->GetEntryData(nEntry); - if( -1 != nLine ) - { - if( nLine > 0 ) - nLine--; - - showLine( nLine ); - } - } - return 0; -} - -IMPL_LINK(XMLSourceFileDialog, ClickHdl_Impl, PushButton *, /* pButton */ ) -{ - onValidate(); - return 0; -} - -void XMLSourceFileDialog::onValidate() -{ - EnterWait(); - - maLBOutput.Show(); - maPBValidate.Enable(sal_False); - Resize(); - - try - { - Reference< XImportFilter > xImporter( mxMSF->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.documentconversion.XSLTValidate" )) ), UNO_QUERY ); - if( xImporter.is() ) - { - osl::File aInputFile( maFileURL ); - /* osl::File::RC rc = */ aInputFile.open( osl_File_OpenFlag_Read ); - - Reference< XInputStream > xIS( new comphelper::OSLInputStreamWrapper( aInputFile ) ); - - Sequence< PropertyValue > aSourceData(3); - aSourceData[0].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "InputStream" ) ); - aSourceData[0].Value <<= xIS; - - aSourceData[1].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "FileName" ) ); - aSourceData[1].Value <<= maFileURL; - - aSourceData[2].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "ErrorHandler" ) ); - Reference< XErrorHandler > xHandle( new XMLErrorHandler( this, maLBOutput ) ); - aSourceData[2].Value <<= xHandle; - - Reference< XDocumentHandler > xWriter( mxMSF->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.xml.sax.Writer" ) ) ), UNO_QUERY ); - Reference< XOutputStream > xOS( mxMSF->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.io.Pipe" ) ) ), UNO_QUERY ); - Reference< XActiveDataSource > xDocSrc( xWriter, UNO_QUERY ); - xDocSrc->setOutputStream( xOS ); - - Sequence< OUString > aFilterUserData( mpFilterInfo->getFilterUserData() ); - xImporter->importer( aSourceData, xWriter, aFilterUserData ); - } - } - catch(const Exception& e) - { - String sErr( e.Message ); - sal_uInt16 nEntry = maLBOutput.InsertEntry( sErr ); - maLBOutput.SetEntryData( nEntry, (void*)-1 ); - } - - if( 0 == maLBOutput.GetEntryCount() ) - { - String sErr( RESID( STR_NO_ERRORS_FOUND ) ); - sal_uInt16 nEntry = maLBOutput.InsertEntry( sErr ); - maLBOutput.SetEntryData( nEntry, (void*)-1 ); - } - - LeaveWait(); -} - -void XMLSourceFileDialog::showLine( sal_Int32 nLine ) -{ - mpTextWindow->showLine( nLine ); -} - - /////////////////////////////////////////////////////////////////////// void lcl_Highlight(const String& rSource, SwTextPortions& aPortionList) @@ -790,173 +284,4 @@ void lcl_Highlight(const String& rSource, SwTextPortions& aPortionList) } } -void XMLFileWindow::DoDelayedSyntaxHighlight( sal_uInt16 nPara ) -{ - if ( !bHighlighting ) - { - aSyntaxLineTable.Insert( nPara, (void*)(sal_uInt16)1 ); - aSyntaxIdleTimer.Start(); - } -} - -void XMLFileWindow::ImpDoHighlight( const String& rSource, sal_uInt16 nLineOff ) -{ - SwTextPortions aPortionList; - lcl_Highlight(rSource, aPortionList); - - size_t nCount = aPortionList.size(); - if ( !nCount ) - return; - - SwTextPortion& rLast = aPortionList[nCount-1]; - if ( rLast.nStart > rLast.nEnd ) // Nur bis Bug von MD behoeben - { - nCount--; - aPortionList.pop_back(); - if ( !nCount ) - return; - } - - // Evtl. Optimieren: - // Wenn haufig gleiche Farbe, dazwischen Blank ohne Farbe, - // ggf. zusammenfassen, oder zumindest das Blank, - // damit weniger Attribute - sal_Bool bOptimizeHighlight = sal_True; // war in der BasicIDE static - if ( bOptimizeHighlight ) - { - // Es muessen nur die Blanks und Tabs mit attributiert werden. - // Wenn zwei gleiche Attribute hintereinander eingestellt werden, - // optimiert das die TextEngine. - sal_uInt16 nLastEnd = 0; - for ( size_t i = 0; i < nCount; i++ ) - { - SwTextPortion& r = aPortionList[i]; - DBG_ASSERT( r.nLine == aPortionList[0].nLine, "doch mehrere Zeilen ?" ); - if ( r.nStart > r.nEnd ) // Nur bis Bug von MD behoeben - continue; - - if ( r.nStart > nLastEnd ) - { - // Kann ich mich drauf verlassen, dass alle ausser - // Blank und Tab gehighlightet wird ?! - r.nStart = nLastEnd; - } - nLastEnd = r.nEnd+1; - if ( ( i == (nCount-1) ) && ( r.nEnd < rSource.Len() ) ) - r.nEnd = rSource.Len(); - } - } - - svtools::ColorConfig aConfig; - for ( size_t i = 0; i < aPortionList.size(); i++ ) - { - SwTextPortion& r = aPortionList[i]; - if ( r.nStart > r.nEnd ) // Nur bis Bug von MD behoeben - continue; - if(r.eType != svtools::HTMLSGML && - r.eType != svtools::HTMLCOMMENT && - r.eType != svtools::HTMLKEYWORD && - r.eType != svtools::HTMLUNKNOWN) - r.eType = (svtools::ColorConfigEntry)svtools::HTMLUNKNOWN; - Color aColor((ColorData)aConfig.GetColorValue((svtools::ColorConfigEntry)r.eType).nColor); - sal_uInt16 nLine = nLineOff+r.nLine; // - pTextEngine->SetAttrib( TextAttribFontColor( aColor ), nLine, r.nStart, r.nEnd+1 ); - } -} - -IMPL_LINK( XMLFileWindow, SyntaxTimerHdl, Timer *, pTimer ) -{ - Time aSyntaxCheckStart( Time::SYSTEM ); - DBG_ASSERT( pTextView, "Noch keine View, aber Syntax-Highlight ?!" ); - pTextEngine->SetUpdateMode( sal_False ); - - bHighlighting = sal_True; - sal_uInt16 nLine; - sal_uInt16 nCount = 0; - // zuerst wird der Bereich um dem Cursor bearbeitet - TextSelection aSel = pTextView->GetSelection(); - sal_uInt16 nCur = (sal_uInt16)aSel.GetStart().GetPara(); - if(nCur > 40) - nCur -= 40; - else - nCur = 0; - if(aSyntaxLineTable.Count()) - for(sal_uInt16 i = 0; i < 80 && nCount < 40; i++, nCur++) - { - void * p = aSyntaxLineTable.Get(nCur); - if(p) - { - DoSyntaxHighlight( nCur ); - aSyntaxLineTable.Remove( nCur ); - nCount++; - if(!aSyntaxLineTable.Count()) - break; - if((Time( Time::SYSTEM ).GetTime() - aSyntaxCheckStart.GetTime()) > MAX_HIGHLIGHTTIME ) - { - pTimer->SetTimeout( 2 * SYNTAX_HIGHLIGHT_TIMEOUT ); - break; - } - } - } - - // wenn dann noch etwas frei ist, wird von Beginn an weitergearbeitet - void* p = aSyntaxLineTable.First(); - while ( p && nCount < MAX_SYNTAX_HIGHLIGHT) - { - nLine = (sal_uInt16)aSyntaxLineTable.GetCurKey(); - DoSyntaxHighlight( nLine ); - sal_uInt16 nC = (sal_uInt16)aSyntaxLineTable.GetCurKey(); - p = aSyntaxLineTable.Next(); - aSyntaxLineTable.Remove(nC); - nCount ++; - if(Time( Time::SYSTEM ).GetTime() - aSyntaxCheckStart.GetTime() > MAX_HIGHLIGHTTIME) - { - pTimer->SetTimeout( 2 * SYNTAX_HIGHLIGHT_TIMEOUT ); - break; - } - } - // os: #43050# hier wird ein TextView-Problem umpopelt: - // waehrend des Highlightings funktionierte das Scrolling nicht - TextView* pTmp = pTextEngine->GetActiveView(); - pTextEngine->SetActiveView(0); - pTextEngine->SetUpdateMode( sal_True ); - pTextEngine->SetActiveView(pTmp); - pTextView->ShowCursor(sal_False, sal_False); - - if(aSyntaxLineTable.Count() && !pTimer->IsActive()) - pTimer->Start(); - // SyntaxTimerHdl wird gerufen, wenn Text-Aenderung - // => gute Gelegenheit, Textbreite zu ermitteln! - long nPrevTextWidth = nCurTextWidth; - nCurTextWidth = pTextEngine->CalcTextWidth() + 25; // kleine Toleranz - if ( nCurTextWidth != nPrevTextWidth ) - SetScrollBarRanges(); - bHighlighting = sal_False; - - return 0; -} - -void XMLFileWindow::DoSyntaxHighlight( sal_uInt16 nPara ) -{ - // Durch das DelayedSyntaxHighlight kann es passieren, - // dass die Zeile nicht mehr existiert! - if ( nPara < pTextEngine->GetParagraphCount() ) - { - pTextEngine->RemoveAttribs( nPara ); - String aSource( pTextEngine->GetText( nPara ) ); - pTextEngine->SetUpdateMode( sal_False ); - ImpDoHighlight( aSource, nPara ); - // os: #43050# hier wird ein TextView-Problem umpopelt: - // waehrend des Highlightings funktionierte das Scrolling nicht - TextView* pTmp = pTextEngine->GetActiveView(); - pTmp->SetAutoScroll(sal_False); - pTextEngine->SetActiveView(0); - pTextEngine->SetUpdateMode( sal_True ); - pTextEngine->SetActiveView(pTmp); - // Bug 72887 show the cursor - pTmp->SetAutoScroll(sal_True); - pTmp->ShowCursor( sal_False/*pTmp->IsAutoScroll()*/ ); - } -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/filter/source/xsltdialog/xmlfileview.hxx b/filter/source/xsltdialog/xmlfileview.hxx index 5edd09615754..4ff36a4b4f17 100644 --- a/filter/source/xsltdialog/xmlfileview.hxx +++ b/filter/source/xsltdialog/xmlfileview.hxx @@ -41,7 +41,6 @@ #include <vcl/lstbox.hxx> class ScrollBar; -class XMLFileWindow; class TextEngine; class TextView; class DataChangedEvent; @@ -68,106 +67,6 @@ public: }; -//------------------------------------------------------------ - -class XMLFileWindow : public Window, public SfxListener -{ - using Window::Notify; - -private: - TextView* pTextView; - TextEngine* pTextEngine; - - TextViewOutWin* pOutWin; - ScrollBar *pHScrollbar, - *pVScrollbar; - - long nCurTextWidth; - sal_uInt16 nStartLine; - rtl_TextEncoding eSourceEncoding; - - Timer aSyntaxIdleTimer; - Table aSyntaxLineTable; - - bool bHighlighting; -protected: - DECL_LINK( SyntaxTimerHdl, Timer * ); - void ImpDoHighlight( const String& rSource, sal_uInt16 nLineOff ); - - virtual void Resize(); - virtual void DataChanged( const DataChangedEvent& ); - virtual void GetFocus(); - - void CreateTextEngine(); - - virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); - - DECL_LINK(ScrollHdl, ScrollBar*); - - void DoDelayedSyntaxHighlight( sal_uInt16 nPara ); - - void DoSyntaxHighlight( sal_uInt16 nPara ); - -public: - XMLFileWindow( Window* pParent ); - ~XMLFileWindow(); - - void SetScrollBarRanges(); - void InitScrollBars(); - sal_uLong Read( SvStream& rInput) { return pTextEngine->Read(rInput); } - - void ShowWindow( const rtl::OUString& rFileName ); - - TextView* GetTextView() { return pTextView; } - TextEngine* GetTextEngine() { return pTextEngine; } - - TextViewOutWin* GetOutWin() { return pOutWin; } - void InvalidateWindow(); - - void CreateScrollbars(); - - void SetStartLine(sal_uInt16 nLine) {nStartLine = nLine;} - - virtual void Command( const CommandEvent& rCEvt ); - void HandleWheelCommand( const CommandEvent& rCEvt ); - - TextView* getTextView() { return pTextView; } - - void showLine( sal_Int32 nLine ); -}; - -class XMLSourceFileDialog : public WorkWindow -{ - -public: - XMLSourceFileDialog( Window* pParent, ResMgr& rResMgr, const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rxMSF ); - virtual ~XMLSourceFileDialog(); - - void ShowWindow( const rtl::OUString& rFileName, const filter_info_impl* pFilterInfo ); - - virtual void Resize(); - - DECL_LINK(ClickHdl_Impl, PushButton * ); - DECL_LINK(SelectHdl_Impl, ListBox * ); - - void showLine( sal_Int32 nLine ); - - sal_Int32 mnOutputHeight; -private: - void onValidate(); - - const filter_info_impl* mpFilterInfo; - rtl::OUString maFileURL; - - com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > mxMSF; - ResMgr& mrResMgr; - - XMLFileWindow* mpTextWindow; - ListBox maLBOutput; -// Control maCtrlSourceView; - PushButton maPBValidate; -}; - #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx index 4a04257e2efa..f9c081eb32c7 100644 --- a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx +++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx @@ -1489,35 +1489,6 @@ IMPL_LINK( XMLFilterListBox, TabBoxScrollHdl_Impl, SvTabListBox*, /* pList */ ) // ----------------------------------------------------------------------- -IMPL_LINK( XMLFilterListBox, HeaderSelect_Impl, HeaderBar*, pBar ) -{ - if ( pBar && pBar->GetCurItemId() != ITEMID_NAME ) - return 0; - - HeaderBarItemBits nBits = mpHeaderBar->GetItemBits(ITEMID_TYPE); - sal_Bool bUp = ( ( nBits & HIB_UPARROW ) == HIB_UPARROW ); - SvSortMode eMode = SortAscending; - - if ( bUp ) - { - nBits &= ~HIB_UPARROW; - nBits |= HIB_DOWNARROW; - eMode = SortDescending; - } - else - { - nBits &= ~HIB_DOWNARROW; - nBits |= HIB_UPARROW; - } - mpHeaderBar->SetItemBits( ITEMID_NAME, nBits ); - SvTreeList* pMod = GetModel(); - pMod->SetSortMode( eMode ); - pMod->Resort(); - return 1; -} - -// ----------------------------------------------------------------------- - IMPL_LINK( XMLFilterListBox, HeaderEndDrag_Impl, HeaderBar*, pBar ) { if ( pBar && !pBar->GetCurItemId() ) diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx index 5ef336d806ad..e28d05a989ec 100644 --- a/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx +++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx @@ -68,7 +68,6 @@ private: HeaderBar* mpHeaderBar; DECL_LINK( TabBoxScrollHdl_Impl, SvTabListBox* ); - DECL_LINK( HeaderSelect_Impl, HeaderBar* ); DECL_LINK( HeaderEndDrag_Impl, HeaderBar* ); String getEntryString( const filter_info_impl* pInfo ) const; diff --git a/filter/source/xsltdialog/xmlfiltertabdialog.cxx b/filter/source/xsltdialog/xmlfiltertabdialog.cxx index 242ef898ced6..8279fa2cf46e 100644 --- a/filter/source/xsltdialog/xmlfiltertabdialog.cxx +++ b/filter/source/xsltdialog/xmlfiltertabdialog.cxx @@ -336,14 +336,6 @@ filter_info_impl* XMLFilterTabDialog::getNewFilterInfo() const // ----------------------------------------------------------------------- -IMPL_LINK( XMLFilterTabDialog, CancelHdl, Button*, /* pButton */ ) -{ - Close(); - return 0; -} - -// ----------------------------------------------------------------------- - IMPL_LINK( XMLFilterTabDialog, OkHdl, Button *, EMPTYARG ) { if( onOk() ) diff --git a/filter/source/xsltdialog/xmlfiltertabdialog.hxx b/filter/source/xsltdialog/xmlfiltertabdialog.hxx index ad8d889a5da0..06386f8f93e2 100644 --- a/filter/source/xsltdialog/xmlfiltertabdialog.hxx +++ b/filter/source/xsltdialog/xmlfiltertabdialog.hxx @@ -58,7 +58,6 @@ private: DECL_LINK( ActivatePageHdl, TabControl * ); DECL_LINK( DeactivatePageHdl, TabControl * ); DECL_LINK( OkHdl, Button * ); - DECL_LINK( CancelHdl, Button * ); ResMgr& mrResMgr; diff --git a/filter/source/xsltdialog/xmlfiltertestdialog.cxx b/filter/source/xsltdialog/xmlfiltertestdialog.cxx index 0c341aadddbc..9e8638078ef8 100644 --- a/filter/source/xsltdialog/xmlfiltertestdialog.cxx +++ b/filter/source/xsltdialog/xmlfiltertestdialog.cxx @@ -569,11 +569,6 @@ void XMLFilterTestDialog::displayXMLFile( const OUString& rURL ) { ::com::sun::star::uno::Reference< com::sun::star::system::XSystemShellExecute > xSystemShellExecute(comphelper::getProcessServiceFactory()->createInstance(DEFINE_CONST_UNICODE("com.sun.star.system.SystemShellExecute") ), com::sun::star::uno::UNO_QUERY_THROW ); xSystemShellExecute->execute( rURL, rtl::OUString(), com::sun::star::system::SystemShellExecuteFlags::DEFAULTS ); - -// if( NULL == mpSourceDLG ) -// mpSourceDLG = new XMLSourceFileDialog( NULL, mrResMgr, mxMSF ); -// -// mpSourceDLG->ShowWindow( rURL, mpFilterInfo); } void XMLFilterTestDialog::onImportBrowse() diff --git a/filter/source/xsltdialog/xmlfiltertestdialog.hxx b/filter/source/xsltdialog/xmlfiltertestdialog.hxx index 04457b9215d5..a374ea1fbc9e 100644 --- a/filter/source/xsltdialog/xmlfiltertestdialog.hxx +++ b/filter/source/xsltdialog/xmlfiltertestdialog.hxx @@ -38,7 +38,6 @@ #include <svl/poolitem.hxx> class filter_info_impl; -class XMLSourceFileDialog; class XMLFilterTestDialog : public ModalDialog { diff --git a/sax/source/tools/fastserializer.cxx b/sax/source/tools/fastserializer.cxx index 68e2f5ebfac5..ebd0467caade 100644 --- a/sax/source/tools/fastserializer.cxx +++ b/sax/source/tools/fastserializer.cxx @@ -320,11 +320,6 @@ namespace sax_fastparser { return seq; } - OUString FastSaxSerializer::getImplementationName_Static() - { - return OUString(RTL_CONSTASCII_USTRINGPARAM( SERIALIZER_IMPLEMENTATION_NAME )); - } - Sequence< OUString > FastSaxSerializer::getSupportedServiceNames_Static(void) { Sequence<OUString> aRet(1); @@ -346,23 +341,6 @@ namespace sax_fastparser { } } -#if DEBUG - void FastSaxSerializer::printMarkStack( ) - { - ::std::stack< boost::shared_ptr< ForMerge > > aCopy( maMarkStack ); - int nSize = aCopy.size(); - int i = 0; - while ( !aCopy.empty() ) - { - std::cerr << nSize - i << "\n"; - aCopy.top( )->print( ); - std::cerr << "\n"; - aCopy.pop( ); - i++; - } - } -#endif - void FastSaxSerializer::mergeTopMarks( sax_fastparser::MergeMarksEnum eMergeType ) { if ( maMarkStack.empty() ) diff --git a/sax/source/tools/fastserializer.hxx b/sax/source/tools/fastserializer.hxx index 961875194a20..57126cbf8585 100644 --- a/sax/source/tools/fastserializer.hxx +++ b/sax/source/tools/fastserializer.hxx @@ -61,7 +61,6 @@ public: // The implementation details static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void); - static ::rtl::OUString getImplementationName_Static(); // XFastSerializer virtual void SAL_CALL startDocument( ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException); @@ -183,10 +182,6 @@ private: void sort(); }; -#if DEBUG - void printMarkStack( ); -#endif - ::std::stack< boost::shared_ptr< ForMerge > > maMarkStack; void writeFastAttributeList( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ); diff --git a/svtools/source/config/helpopt.cxx b/svtools/source/config/helpopt.cxx index a871975f9b1d..a72926e6ce41 100644 --- a/svtools/source/config/helpopt.cxx +++ b/svtools/source/config/helpopt.cxx @@ -95,9 +95,6 @@ public: void SetHelpAgentRetryLimit( sal_Int32 _nTrials ) { nHelpAgentRetryLimit = _nTrials; SetModified(); } sal_Int32 GetHelpAgentRetryLimit( ) const { return nHelpAgentRetryLimit; } - sal_Int32 getAgentIgnoreURLCounter( const ::rtl::OUString& _rURL ); - void decAgentIgnoreURLCounter( const ::rtl::OUString& _rURL ); - void resetAgentIgnoreURLCounter( const ::rtl::OUString& _rURL ); void resetAgentIgnoreURLCounter(); void SetWelcomeScreen( sal_Bool b ) { bWelcomeScreen = b; SetModified(); } @@ -558,51 +555,6 @@ SvtHelpOptions::SvtHelpOptions() // ----------------------------------------------------------------------- -sal_Int32 SvtHelpOptions_Impl::getAgentIgnoreURLCounter( const ::rtl::OUString& _rURL ) -{ - ::osl::MutexGuard aGuard(aIgnoreCounterSafety); - ConstMapString2IntIterator aMapPos = aURLIgnoreCounters.find(_rURL); - if (aURLIgnoreCounters.end() == aMapPos) - return GetHelpAgentRetryLimit(); - return aMapPos->second; -} - -// ----------------------------------------------------------------------- - -void SvtHelpOptions_Impl::decAgentIgnoreURLCounter( const ::rtl::OUString& _rURL ) -{ - ::osl::MutexGuard aGuard(aIgnoreCounterSafety); - MapString2IntIterator aMapPos = aURLIgnoreCounters.find(_rURL); - if (aURLIgnoreCounters.end() == aMapPos) - { // nothing known about this URL 'til now - sal_Int32 nLimit = GetHelpAgentRetryLimit(); - sal_Int32 nIgnoreAgain = nLimit > 0 ? nLimit - 1 : 0; - aURLIgnoreCounters[_rURL] = nIgnoreAgain; - } - else - { - sal_Int32& rCounter = aMapPos->second; - if (rCounter) - --rCounter; - } - SetModified(); -} - -// ----------------------------------------------------------------------- - -void SvtHelpOptions_Impl::resetAgentIgnoreURLCounter( const ::rtl::OUString& _rURL ) -{ - ::osl::MutexGuard aGuard(aIgnoreCounterSafety); - MapString2IntIterator aMapPos = aURLIgnoreCounters.find(_rURL); - if (aURLIgnoreCounters.end() != aMapPos) - { - aURLIgnoreCounters.erase(aMapPos); - SetModified(); - } -} - -// ----------------------------------------------------------------------- - void SvtHelpOptions_Impl::resetAgentIgnoreURLCounter() { ::osl::MutexGuard aGuard(aIgnoreCounterSafety); diff --git a/unusedcode.easy b/unusedcode.easy index cbee2de03423..afa55f544416 100644 --- a/unusedcode.easy +++ b/unusedcode.easy @@ -71,10 +71,6 @@ DdeTopic::RemoveItem(DdeItem const&) DffPropSet::SetPropertyValue(unsigned int, unsigned int) const Dialog::Dialog(Window*, ResId const&) DirEntry::GetDevice() const -EECharAttribArray::Insert(EECharAttribArray const*, unsigned short, unsigned short, unsigned short) -EECharAttribArray::Replace(EECharAttrib const&, unsigned short) -EECharAttribArray::Replace(EECharAttrib const*, unsigned short, unsigned short) -EECharAttribArray::_ForEach(unsigned short, unsigned short, unsigned char (*)(EECharAttrib const&, void*), void*) EditView::GetSelectionMode() const EditView::SetCursor(Cursor const&) EditView::SetPointer(Pointer const&) @@ -566,9 +562,6 @@ SvtGraphicStroke::setMiterLimit(double) SvtGraphicStroke::setStartArrow(PolyPolygon const&) SvtGraphicStroke::setStrokeWidth(double) SvtGraphicStroke::setTransparency(double) -SvtHelpOptions::decAgentIgnoreURLCounter(rtl::OUString const&) -SvtHelpOptions::getAgentIgnoreURLCounter(rtl::OUString const&) -SvtHelpOptions::resetAgentIgnoreURLCounter(rtl::OUString const&) SvtIconChoiceCtrl::SvtIconChoiceCtrl(Window*, ResId const&) SvtIconWindow_Impl::GetSelectedIconText() const SvtListenerIter::First(void* (*)()) @@ -845,6 +838,7 @@ SwpHtStart::Insert(SwTxtAttr const**, unsigned short) SwpHtStart::Insert(SwpHtStart const*, unsigned short, unsigned short) SwpHtStart::Remove(SwTxtAttr const*&, unsigned short) SystemChildWindow::SystemChildWindow(Window*, ResId const&) +SystemChildWindow::SystemChildWindow(Window*, long, SystemWindowData*, unsigned char) TB::NeedsPositioning() TESortedPositions::Insert(TESortedPositions const*, unsigned short, unsigned short) TESortedPositions::Insert(unsigned long const&, unsigned short&) @@ -928,8 +922,7 @@ XMLErrors::AddRecord(int, com::sun::star::uno::Sequence<rtl::OUString> const&) XMLErrors::AddRecord(int, com::sun::star::uno::Sequence<rtl::OUString> const&, rtl::OUString const&) XMLFamilyDataList_Impl::GetPos(XMLFamilyData_Impl const*) const XMLFamilyDataList_Impl::Remove(XMLFamilyData_Impl*) -XMLFilterListBox::LinkStubHeaderSelect_Impl(void*, void*) -XMLFilterTabDialog::LinkStubCancelHdl(void*, void*) +XMLFilterTabPageXSLT::LinkStubToggleXSLTImplHdl(void*, void*) XMLFontAutoStylePoolNames_Impl::GetPos(rtl::OUString const*) const XMLFontAutoStylePoolNames_Impl::Remove(rtl::OUString*) XMLFontAutoStylePool_Impl::GetPos(XMLFontAutoStylePoolEntry_Impl const*) const @@ -1591,7 +1584,6 @@ comphelper::PropertySetHelper::PropertySetHelper() comphelper::PropertySetHelper::setInfo(comphelper::PropertySetInfo*) comphelper::PropertySetInfo::add(comphelper::PropertyMapEntry*, int) comphelper::ResourceBasedEventLogger::ResourceBasedEventLogger(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, rtl::OUString const&, rtl::OUString const&) -comphelper::SequenceAsHashMap::getAsConstAnyList(unsigned char) const comphelper::ServiceInfoHelper::concatSequences(com::sun::star::uno::Sequence<rtl::OUString> const&, com::sun::star::uno::Sequence<rtl::OUString> const&) comphelper::findProperty(com::sun::star::beans::Property&, com::sun::star::uno::Sequence<com::sun::star::beans::Property>&, rtl::OUString const&) comphelper::string::isalnumAsciiString(rtl::OUString const&) @@ -1707,10 +1699,6 @@ framework::ShareableMutex::getShareableOslMutex() framework::TabWindow::impl_createFactory(com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory> const&) framework::UIConfigElementWrapperBase::dispose() framework::UIElementWrapperBase::dispose() -graphite2::Segment::append(graphite2::Segment const&) -graphite2::Slot::update(int, int, graphite2::Position&) -graphite2::TtfUtil::GetNameInfo(void const*, int, int, int, int, unsigned long&, unsigned long&) -graphite2::TtfUtil::GlyfLookup(unsigned short, void const*, void const*, unsigned long, unsigned long, void const*) jfw_plugin::VendorBase::createInstance() jfw_plugin::VendorBase::getJavaExePaths(int*) jvmaccess::ClassPath::doLoadClass(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, void*, rtl::OUString const&, rtl::OUString const&) @@ -1752,7 +1740,6 @@ oox::ContainerHelper::insertByIndex(com::sun::star::uno::Reference<com::sun::sta oox::GraphicHelper::convertScreenPixelToHmm(com::sun::star::awt::Point const&) const oox::ObjectContainer::getObject(rtl::OUString const&) const oox::PropertyMap::dump() -oox::PropertyMap::dumpCode() oox::PropertyMap::getProperty(int) const oox::PropertySet::getProperties(com::sun::star::uno::Sequence<com::sun::star::uno::Any>&, com::sun::star::uno::Sequence<rtl::OUString> const&) const oox::core::FilterBase::getComponentFactory() const @@ -1903,7 +1890,6 @@ sax::Converter::clearUndefinedChars(rtl::OUString&, rtl::OUString const&) sax::Converter::convertAny(com::sun::star::uno::Any&, rtl::OUString const&, rtl::OUString const&) sax::Converter::convertDouble(double&, rtl::OUString const&, short) sax::Converter::convertNumber64(rtl::OUStringBuffer&, long) -sax_fastparser::FastSaxSerializer::getImplementationName_Static() sax_fastparser::FastSerializerHelper::endElement(char const*) sax_fastparser::FastSerializerHelper::singleElement(char const*, ...) sax_fastparser::FastSerializerHelper::singleElement(char const*, com::sun::star::uno::Reference<com::sun::star::xml::sax::XFastAttributeList>) @@ -1973,7 +1959,6 @@ sdr::table::TableLayouter::getRowStart(int) const sdr::table::TableLayouter::setColumnWidth(int, int) sdr::table::TableLayouter::setRowHeight(int, int) sfx2::TaskPaneWrapper::GetChildWindowId() -slideshow::internal::DrawShapeSubsetting::hasSubsetShapes() const slideshow::internal::DrawShapeSubsetting::reset(slideshow::internal::DocTreeNode const&, boost::shared_ptr<GDIMetaFile> const&) std::__cxx1998::map<rtl::OUString, OutputStorageWrapper_Impl*, OUStringLess, std::allocator<std::pair<rtl::OUString const, OutputStorageWrapper_Impl*> > >::~map() std::__cxx1998::map<rtl::OUString, binfilter::OutputStorageWrapper_Impl*, binfilter::OUStringLess, std::allocator<std::pair<rtl::OUString const, binfilter::OutputStorageWrapper_Impl*> > >::~map() @@ -2032,7 +2017,6 @@ vcl::PDFExtOutDevData::SetOutlineItemParent(int, int) vcl::PDFExtOutDevData::SetOutlineItemText(int, rtl::OUString const&) vcl::PDFWriter::DrawPixel(Polygon const&, Color const*) vcl::PDFWriterImpl::drawPolyPolygon(PolyPolygon const&, int, bool) -vcl::PDFWriterImpl::writeG4Stream(BitmapReadAccess*) vcl::unx::GtkPrintWrapper::print_operation_set_has_selection(_GtkPrintOperation*, int) const vcl::unx::GtkPrintWrapper::print_operation_set_support_selection(_GtkPrintOperation*, int) const void ScCompressedArrayIterator<int, unsigned short>::Follow<unsigned char>(ScCompressedArrayIterator<int, unsigned char> const&) @@ -2040,5 +2024,3 @@ writerfilter::LoggedResourcesHelper::setPrefix(std::basic_string<char, std::char writerfilter::PropertiesProtocol::PropertiesProtocol(writerfilter::Properties*, boost::shared_ptr<writerfilter::TagLogger>) writerfilter::StreamProtocol::StreamProtocol(writerfilter::Stream*, boost::shared_ptr<writerfilter::TagLogger>) writerfilter::TableProtocol::TableProtocol(writerfilter::Table*, boost::shared_ptr<writerfilter::TagLogger>) -writerfilter::ooxml::OOXMLParserState::getContextCount() const -writerfilter::propertysetToString(com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> const&) diff --git a/writerfilter/inc/resourcemodel/util.hxx b/writerfilter/inc/resourcemodel/util.hxx index 45746b6f10f9..444c2f936ead 100644 --- a/writerfilter/inc/resourcemodel/util.hxx +++ b/writerfilter/inc/resourcemodel/util.hxx @@ -41,9 +41,6 @@ namespace writerfilter string WRITERFILTER_RESOURCEMODEL_DLLPUBLIC xmlify(const string & str); #if OSL_DEBUG_LEVEL > 1 - string WRITERFILTER_RESOURCEMODEL_DLLPUBLIC propertysetToString - (uno::Reference<beans::XPropertySet> const & rProps); - string WRITERFILTER_RESOURCEMODEL_DLLPUBLIC toString(uno::Reference< text::XTextRange > textRange); string WRITERFILTER_RESOURCEMODEL_DLLPUBLIC toString(const string & rString); #endif diff --git a/writerfilter/source/resourcemodel/util.cxx b/writerfilter/source/resourcemodel/util.cxx index f36a5797920c..a71a74b6ef66 100644 --- a/writerfilter/source/resourcemodel/util.cxx +++ b/writerfilter/source/resourcemodel/util.cxx @@ -65,342 +65,38 @@ void logger(string prefix, string message) logger_stream().flush(); } - string xmlify(const string & str) - { - string result = ""; - char sBuffer[16]; - - for (string::const_iterator aIt = str.begin(); aIt != str.end(); ++aIt) - { - char c = *aIt; - - if (isprint(c) && c != '\"') - { - if (c == '<') - result += "<"; - else if (c == '>') - result += ">"; - else if (c == '&') - result += "&"; - else - result += c; - } - else - { - snprintf(sBuffer, sizeof(sBuffer), "\\%03d", c); - result += sBuffer; - } - } - - return result; - } - -#if OSL_DEBUG_LEVEL > 1 -string propertysetToString(uno::Reference<beans::XPropertySet> const & xPropSet) +string xmlify(const string & str) { - string sResult; - - static int nAttribNames = 9; - static string sPropertyAttribNames[9] = - { - "MAYBEVOID", - "BOUND", - "CONSTRAINED", - "TRANSIENT", - "READONLY", - "MAYBEAMBIGUOUS", - "MAYBEDEFAULT", - "REMOVEABLE", - "OPTIONAL" - }; - - static const ::rtl::OUString sMetaFile(RTL_CONSTASCII_USTRINGPARAM("MetaFile")); - - uno::Reference<beans::XPropertySetInfo> xPropSetInfo - (xPropSet->getPropertySetInfo()); + string result = ""; + char sBuffer[16]; - if (xPropSetInfo.is()) + for (string::const_iterator aIt = str.begin(); aIt != str.end(); ++aIt) { - uno::Sequence<beans::Property> aProps(xPropSetInfo->getProperties()); + char c = *aIt; - sResult +="<propertyset>"; - - for (sal_Int32 n = 0; n < aProps.getLength(); n++) + if (isprint(c) && c != '\"') { - ::rtl::OUString sPropName(aProps[n].Name); - - if (xPropSetInfo->hasPropertyByName(sPropName)) - { - bool bPropertyFound = true; - uno::Any aAny; - try - { - if (sPropName == sMetaFile) - bPropertyFound = false; - else - xPropSet->getPropertyValue(sPropName) >>= aAny; - } - catch (beans::UnknownPropertyException) - { - bPropertyFound = false; - } - - if (bPropertyFound) - { - sResult += "<property name=\""; - sResult += OUStringToOString - (sPropName, RTL_TEXTENCODING_ASCII_US).getStr(); - sResult +="\" type=\""; - - ::rtl::OUString sPropType(aProps[n].Type.getTypeName()); - sResult += OUStringToOString - (sPropType, RTL_TEXTENCODING_ASCII_US).getStr(); - - sResult += "\" attribs=\""; - - sal_uInt16 nMask = 1; - bool bFirstAttrib = true; - sal_uInt16 nAttribs = aProps[n].Attributes; - for (int i = 0; i < nAttribNames; i++) - { - if ((nAttribs & nMask) != 0) - { - if (bFirstAttrib) - bFirstAttrib = false; - else - sResult += "|"; - - sResult += sPropertyAttribNames[i]; - } - - nMask <<= 1; - } - - sResult += "\">"; - - char buffer[256]; - if (sPropType == - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM - ("byte"))) - { - sal_Int8 nValue = 0; - aAny >>= nValue; - - snprintf(buffer, sizeof(buffer), "%d", nValue); - sResult += buffer; - } - if (sPropType == - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM - ("short"))) - { - sal_Int16 nValue = 0; - aAny >>= nValue; - - snprintf(buffer, sizeof(buffer), "%d", nValue); - sResult += buffer; - } - else if (sPropType == - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM - ("long"))) - { - sal_Int32 nValue = 0; - aAny >>= nValue; - - snprintf(buffer, sizeof(buffer), "%" SAL_PRIdINT32, nValue); - sResult += buffer; - } - else if (sPropType == - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM - ("float"))) - { - float nValue = 0.0; - aAny >>= nValue; - - snprintf(buffer, sizeof(buffer), "%f", nValue); - sResult += buffer; - } - else if (sPropType == - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM - ("double"))) - { - double nValue = 0.0; - aAny >>= nValue; - - snprintf(buffer, sizeof(buffer), "%lf", nValue); - sResult += buffer; - } - else if (sPropType == - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM - ("boolean"))) - { - sal_Bool nValue = sal_False; - aAny >>= nValue; - - if (nValue) - sResult += "true"; - else - sResult += "false"; - } - else if (sPropType == - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM - ("string"))) - { - ::rtl::OUString sValue; - aAny >>= sValue; - - sResult += OUStringToOString - (sValue, RTL_TEXTENCODING_ASCII_US).getStr(); - } - else if (sPropType == - ::rtl::OUString - (RTL_CONSTASCII_USTRINGPARAM - ("com.sun.star.text.TextContentAnchorType"))) - { - text::TextContentAnchorType nValue; - aAny >>= nValue; - - switch (nValue) - { - case text::TextContentAnchorType_AT_PARAGRAPH: - sResult += "AT_PARAGRAPH"; - break; - case text::TextContentAnchorType_AS_CHARACTER: - sResult += "AS_CHARACTER"; - break; - case text::TextContentAnchorType_AT_PAGE: - sResult += "AT_PAGE"; - break; - case text::TextContentAnchorType_AT_FRAME: - sResult += "AT_FRAME"; - break; - case text::TextContentAnchorType_AT_CHARACTER: - sResult += "AT_CHARACTER"; - break; - case text::TextContentAnchorType_MAKE_FIXED_SIZE: - sResult += "MAKE_FIXED_SIZE"; - break; - default: - break; - } - } - else if (sPropType == - ::rtl::OUString - (RTL_CONSTASCII_USTRINGPARAM - ("com.sun.star.awt.Point"))) - { - awt::Point aPoint; - aAny >>= aPoint; - - snprintf(buffer, sizeof(buffer), "(%" SAL_PRIdINT32 ", %" SAL_PRIdINT32 ")", aPoint.X, - aPoint.Y); - - sResult += buffer; - } - else if (sPropType == - ::rtl::OUString - (RTL_CONSTASCII_USTRINGPARAM - ("com.sun.star.awt.Rectangle"))) - { - awt::Rectangle aRect; - aAny >>= aRect; - - snprintf(buffer, sizeof(buffer), "(%" SAL_PRIdINT32 ", %" SAL_PRIdINT32 ", %" SAL_PRIdINT32 ", %" SAL_PRIdINT32 ")", - aRect.X, aRect.Y, aRect.Width, aRect.Height); - sResult += buffer; - } - else if (sPropType == - ::rtl::OUString - (RTL_CONSTASCII_USTRINGPARAM - ("com.sun.star.drawing.FillStyle"))) - { - drawing::FillStyle nValue; - aAny >>= nValue; - - switch (nValue) - { - case drawing::FillStyle_NONE: - sResult += "NONE"; - break; - case drawing::FillStyle_SOLID: - sResult += "SOLID"; - break; - case drawing::FillStyle_GRADIENT: - sResult += "GRADIENT"; - break; - case drawing::FillStyle_HATCH: - sResult += "HATCH"; - break; - case drawing::FillStyle_BITMAP: - sResult += "BITMAP"; - break; - case drawing::FillStyle_MAKE_FIXED_SIZE: - sResult += "MAKE_FIXED_SIZE"; - break; - } - } - else if (sPropType == - ::rtl::OUString - (RTL_CONSTASCII_USTRINGPARAM - ("com.sun.star.drawing.BitmapMode"))) - { - drawing::BitmapMode nValue; - aAny >>= nValue; - - switch (nValue) - { - case drawing::BitmapMode_REPEAT: - sResult += "REPEAT"; - break; - case drawing::BitmapMode_STRETCH: - sResult += "STRETCH"; - break; - case drawing::BitmapMode_NO_REPEAT: - sResult += "NO_REPEAT"; - break; - case drawing::BitmapMode_MAKE_FIXED_SIZE: - sResult += "MAKE_FIXED_SIZE"; - break; - } - } - else if (sPropType == - ::rtl::OUString - (RTL_CONSTASCII_USTRINGPARAM - ("com.sun.star.drawing.HomogenMatrix3"))) - { - drawing::HomogenMatrix3 aMatrix; - aAny >>= aMatrix; - - snprintf(buffer, sizeof(buffer), - "((%f %f %f)(%f %f %f)(%f %f %f))", - aMatrix.Line1.Column1, - aMatrix.Line1.Column2, - aMatrix.Line1.Column3, - aMatrix.Line2.Column1, - aMatrix.Line2.Column2, - aMatrix.Line2.Column3, - aMatrix.Line3.Column1, - aMatrix.Line3.Column2, - aMatrix.Line3.Column3); - sResult += buffer; - } - - sResult += "</property>"; - } - } + if (c == '<') + result += "<"; + else if (c == '>') + result += ">"; + else if (c == '&') + result += "&"; else - { - sResult += "<unknown-property>"; - sResult += OUStringToOString - (sPropName, RTL_TEXTENCODING_ASCII_US).getStr(); - sResult += "</unknown-property>"; - } + result += c; + } + else + { + snprintf(sBuffer, sizeof(sBuffer), "\\%03d", c); + result += sBuffer; } - sResult += "</propertyset>"; } - return sResult; + return result; } +#if OSL_DEBUG_LEVEL > 1 + string toString(uno::Reference< text::XTextRange > textRange) { string result; |