[Libreoffice-commits] .: 3 commits - bin/get-bugzilla-attachments-by-mimetype cui/source sc/source sd/source unusedcode.easy vcl/unx

Caolán McNamara caolan at kemper.freedesktop.org
Tue Apr 17 01:50:10 PDT 2012


 bin/get-bugzilla-attachments-by-mimetype                     |   16 -
 cui/source/options/optinet2.cxx                              |    8 
 sc/source/filter/inc/addressconverter.hxx                    |   18 -
 sc/source/filter/inc/richstring.hxx                          |    1 
 sc/source/filter/inc/stylesbuffer.hxx                        |    3 
 sc/source/filter/oox/addressconverter.cxx                    |  170 -----------
 sc/source/filter/oox/richstring.cxx                          |   20 -
 sc/source/filter/oox/stylesbuffer.cxx                        |   14 
 sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx |   25 -
 unusedcode.easy                                              |    2 
 vcl/unx/generic/app/wmadaptor.cxx                            |    6 
 11 files changed, 16 insertions(+), 267 deletions(-)

New commits:
commit 605c51cebbcf352d52595a0b28288ebc9dcfbdbb
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Apr 17 09:49:07 2012 +0100

    attachmentid should be stable across mime-type changes

diff --git a/bin/get-bugzilla-attachments-by-mimetype b/bin/get-bugzilla-attachments-by-mimetype
index 7316f0a..b9488b9 100755
--- a/bin/get-bugzilla-attachments-by-mimetype
+++ b/bin/get-bugzilla-attachments-by-mimetype
@@ -66,8 +66,9 @@ def get_from_bug_url_via_xml(url, mimetype, prefix, suffix):
         sock = urlopen_retry(url+"&ctype=xml")
         dom = minidom.parse(sock)
         sock.close()
-        attachmentid=1
+        attachmentid=0
         for attachment in dom.getElementsByTagName('attachment'):
+            attachmentid += 1
             print " mimetype is",
             for node in attachment.childNodes:
                 if node.nodeName == 'type':
@@ -82,7 +83,6 @@ def get_from_bug_url_via_xml(url, mimetype, prefix, suffix):
                     f.write(base64.b64decode(node.firstChild.nodeValue))
                     f.close()
                     break
-            attachmentid += 1
 
 def get_novell_bug_via_xml(url, mimetype, prefix, suffix):
     id = url.rsplit('=', 2)[1]
@@ -94,20 +94,24 @@ def get_novell_bug_via_xml(url, mimetype, prefix, suffix):
         sock = urlopen_retry(url+"&ctype=xml")
         dom = minidom.parse(sock)
         sock.close()
-        attachmentid=1
+        attachmentid=0
         for comment in dom.getElementsByTagName('thetext'):
             commentText = comment.firstChild.nodeValue
             match = re.search(r".*Created an attachment \(id=([0-9]+)\)", commentText)
             if not match:
                 continue
 
+            attachmentid += 1
+
             realAttachmentId = match.group(1)
             handle = urlopen_retry(novellattach + realAttachmentId)
             if not handle:
                 print "attachment %s is not accessible", realAttachmentId
                 continue 
+            print " mimetype is",
 
             remoteMime = handle.info().gettype()
+            print remoteMime,
             if remoteMime != mimetype:
                 print "skipping"
                 continue
@@ -117,8 +121,6 @@ def get_novell_bug_via_xml(url, mimetype, prefix, suffix):
             f = open(download, 'w')
             f.write(handle.read())
             f.close()
-            break
-            attachmentid += 1
 
 def get_through_rpc_query(rpcurl, showurl, mimetype, prefix, suffix):
     try:
@@ -175,8 +177,9 @@ def get_launchpad_bugs(prefix):
         bug = bugtask.bug
         id = str(bug.id)
         print "parsing ", id, "status:", bugtask.status, "title:", bug.title[:50]
-        attachmentid = 1
+        attachmentid = 0
         for attachment in bug.attachments:
+            attachmentid += 1
             handle = attachment.data.open()
             if not handle.content_type in mimetypes:
                 #print "skipping"
@@ -200,7 +203,6 @@ def get_launchpad_bugs(prefix):
             f = open(download, "w")
             f.write(handle.read())
             f.close()
-            attachmentid += 1
 
 freedesktop = 'http://bugs.freedesktop.org/buglist.cgi'
 abisource = 'http://bugzilla.abisource.com/buglist.cgi' #added for abiword
commit 18825a4d596f69793ee11e643f6ea34317a880c9
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Apr 17 00:47:00 2012 +0100

    callcatcher: update unused code list

diff --git a/sc/source/filter/inc/addressconverter.hxx b/sc/source/filter/inc/addressconverter.hxx
index 3f77269..261752c 100644
--- a/sc/source/filter/inc/addressconverter.hxx
+++ b/sc/source/filter/inc/addressconverter.hxx
@@ -247,24 +247,6 @@ public:
                             sal_Int32 nStart = 0,
                             sal_Int32 nLength = SAL_MAX_INT32 );
 
-    /** Tries to parse an encoded name of an external link target in BIFF
-        documents, e.g. from EXTERNSHEET or SUPBOOK records.
-
-        @param orClassName  (out-parameter) DDE server name or OLE class name.
-        @param orTargetUrl  (out-parameter) Target URL, DDE topic or OLE object name.
-        @param orSheetName  (out-parameter) Sheet name in target document.
-        @param rBiffEncoded  Encoded name of the external link target.
-        @param bFromDConRec  True = path from DCONREF/DCONNAME/DCONBINAME records, false = other records.
-
-        @return  Type of the decoded target.
-      */
-    BiffTargetType      parseBiffTargetUrl(
-                            ::rtl::OUString& orClassName,
-                            ::rtl::OUString& orTargetUrl,
-                            ::rtl::OUString& orSheetName,
-                            const ::rtl::OUString& rBiffTargetUrl,
-                            bool bFromDConRec = false );
-
     // ------------------------------------------------------------------------
 
     /** Returns the biggest valid cell address in the own Calc document. */
diff --git a/sc/source/filter/inc/richstring.hxx b/sc/source/filter/inc/richstring.hxx
index 7871af8..af42f64 100644
--- a/sc/source/filter/inc/richstring.hxx
+++ b/sc/source/filter/inc/richstring.hxx
@@ -118,7 +118,6 @@ struct FontPortionModel
                             mnPos( nPos ), mnFontId( nFontId ) {}
 
     void                read( SequenceInputStream& rStrm );
-    void                read( BiffInputStream& rStrm, BiffFontPortionMode eMode );
 };
 
 // ----------------------------------------------------------------------------
diff --git a/sc/source/filter/inc/stylesbuffer.hxx b/sc/source/filter/inc/stylesbuffer.hxx
index fb6c7ea..6be78e6 100644
--- a/sc/source/filter/inc/stylesbuffer.hxx
+++ b/sc/source/filter/inc/stylesbuffer.hxx
@@ -782,9 +782,6 @@ public:
     /** Imports the DXF record from the passed stream. */
     void                importDxf( SequenceInputStream& rStrm );
 
-    /** Imports font, border, and fill settings from the CFRULE record. */
-    void                importCfRule( BiffInputStream& rStrm, sal_uInt32 nFlags );
-
     /** Final processing after import of all style settings. */
     void                finalizeImport();
 
diff --git a/sc/source/filter/oox/addressconverter.cxx b/sc/source/filter/oox/addressconverter.cxx
index ef7c0fa..9f1f6f1 100644
--- a/sc/source/filter/oox/addressconverter.cxx
+++ b/sc/source/filter/oox/addressconverter.cxx
@@ -297,176 +297,6 @@ bool lclAppendUrlChar( OUStringBuffer& orUrl, sal_Unicode cChar, bool bEncodeSpe
 
 } // namespace
 
-BiffTargetType AddressConverter::parseBiffTargetUrl(
-        OUString& orClassName, OUString& orTargetUrl, OUString& orSheetName,
-        const OUString& rBiffTargetUrl, bool bFromDConRec )
-{
-    OUStringBuffer aTargetUrl;
-    OUStringBuffer aSheetName;
-    // default target type: some URL with/without sheet name, may be overridden below
-    BiffTargetType eTargetType = BIFF_TARGETTYPE_URL;
-    const ControlCharacters& rCChars = bFromDConRec ? maDConChars : maLinkChars;
-
-    enum
-    {
-        STATE_START,
-        STATE_ENCODED_PATH_START,       /// Start of encoded file path.
-        STATE_ENCODED_PATH,             /// Inside encoded file path.
-        STATE_ENCODED_DRIVE,            /// DOS drive letter or start of UNC path.
-        STATE_ENCODED_URL,              /// Encoded URL, e.g. http links.
-        STATE_UNENCODED,                /// Unencoded URL, could be DDE or OLE.
-        STATE_DDE_OLE,                  /// Second part of DDE or OLE link.
-        STATE_FILENAME,                 /// File name enclosed in brackets.
-        STATE_SHEETNAME,                /// Sheet name following enclosed file name.
-        STATE_UNSUPPORTED,              /// Unsupported special paths.
-        STATE_ERROR
-    }
-    eState = STATE_START;
-
-    const sal_Unicode* pcChar = rBiffTargetUrl.getStr();
-    const sal_Unicode* pcEnd = pcChar + rBiffTargetUrl.getLength();
-    for( ; (eState != STATE_ERROR) && (pcChar < pcEnd); ++pcChar )
-    {
-        sal_Unicode cChar = *pcChar;
-        switch( eState )
-        {
-            case STATE_START:
-                if( (cChar == rCChars.mcThisWorkbook) || (cChar == rCChars.mcThisSheet) || (cChar == rCChars.mcSameSheet) )
-                {
-                    if( pcChar + 1 < pcEnd )
-                        eState = STATE_ERROR;
-                    if( cChar == rCChars.mcSameSheet )
-                        eTargetType = BIFF_TARGETTYPE_SAMESHEET;
-                }
-                else if( cChar == rCChars.mcExternal )
-                    eState = (pcChar + 1 < pcEnd) ? STATE_ENCODED_PATH_START : STATE_ERROR;
-                else if( cChar == rCChars.mcInternal )
-                    eState = (pcChar + 1 < pcEnd) ? STATE_SHEETNAME : STATE_ERROR;
-                else
-                    eState = lclAppendUrlChar( aTargetUrl, cChar, true ) ? STATE_UNENCODED : STATE_ERROR;
-            break;
-
-            case STATE_ENCODED_PATH_START:
-                if( cChar == BIFF_URL_DRIVE )
-                    eState = STATE_ENCODED_DRIVE;
-                else if( cChar == BIFF_URL_ROOT )
-                {
-                    aTargetUrl.append( sal_Unicode( '/' ) );
-                    eState = STATE_ENCODED_PATH;
-                }
-                else if( cChar == BIFF_URL_PARENT )
-                    aTargetUrl.appendAscii( "../" );
-                else if( cChar == BIFF_URL_RAW )
-                    eState = STATE_ENCODED_URL;
-                else if( cChar == BIFF_URL_INSTALL )
-                    eState = STATE_UNSUPPORTED;
-                else if( cChar == BIFF_URL_INSTALL2 )
-                    eState = STATE_UNSUPPORTED;
-                else if( cChar == BIFF_URL_LIBRARY )
-                {
-                    eState = STATE_ENCODED_PATH;
-                    eTargetType = BIFF_TARGETTYPE_LIBRARY;
-                }
-                else if( (getBiff() == BIFF4) && (cChar == BIFF4_URL_SHEET) )
-                    eState = STATE_SHEETNAME;
-                else if( cChar == '[' )
-                    eState = STATE_FILENAME;
-                else if( lclAppendUrlChar( aTargetUrl, cChar, true ) )
-                    eState = STATE_ENCODED_PATH;
-                else
-                    eState = STATE_ERROR;
-            break;
-
-            case STATE_ENCODED_PATH:
-                if( cChar == BIFF_URL_SUBDIR )
-                    aTargetUrl.append( sal_Unicode( '/' ) );
-                else if( cChar == '[' )
-                    eState = STATE_FILENAME;
-                else if( !lclAppendUrlChar( aTargetUrl, cChar, true ) )
-                    eState = STATE_ERROR;
-            break;
-
-            case STATE_ENCODED_DRIVE:
-                if( cChar == BIFF_URL_UNC )
-                {
-                    aTargetUrl.appendAscii( "file://" );
-                    eState = STATE_ENCODED_PATH;
-                }
-                else
-                {
-                    aTargetUrl.appendAscii( "file:///" );
-                    eState = lclAppendUrlChar( aTargetUrl, cChar, false ) ? STATE_ENCODED_PATH : STATE_ERROR;
-                    aTargetUrl.appendAscii( ":/" );
-                }
-            break;
-
-            case STATE_ENCODED_URL:
-            {
-                sal_Int32 nLength = cChar;
-                if( nLength + 1 == pcEnd - pcChar )
-                    aTargetUrl.append( pcChar + 1, nLength );
-                else
-                    eState = STATE_ERROR;
-            }
-            break;
-
-            case STATE_UNENCODED:
-                if( cChar == BIFF_URL_SUBDIR )
-                {
-                    orClassName = aTargetUrl.makeStringAndClear();
-                    eState = bFromDConRec ? STATE_ERROR : STATE_DDE_OLE;
-                    eTargetType = BIFF_TARGETTYPE_DDE_OLE;
-                }
-                else if( cChar == '[' )
-                    eState = STATE_FILENAME;
-                else if( !lclAppendUrlChar( aTargetUrl, cChar, true ) )
-                    eState = STATE_ERROR;
-            break;
-
-            case STATE_DDE_OLE:
-                if( !lclAppendUrlChar( aTargetUrl, cChar, true ) )
-                    eState = STATE_ERROR;
-            break;
-
-            case STATE_FILENAME:
-                if( cChar == ']' )
-                    eState = STATE_SHEETNAME;
-                else if( !lclAppendUrlChar( aTargetUrl, cChar, true ) )
-                    eState = STATE_ERROR;
-            break;
-
-            case STATE_SHEETNAME:
-                if( !lclAppendUrlChar( aSheetName, cChar, false ) )
-                    eState = STATE_ERROR;
-            break;
-
-            case STATE_UNSUPPORTED:
-                pcChar = pcEnd - 1;
-            break;
-
-            case STATE_ERROR:
-            break;
-        }
-    }
-
-    OSL_ENSURE( (eState != STATE_ERROR) && (pcChar == pcEnd),
-        OStringBuffer( "AddressConverter::parseBiffTargetUrl - parser error in target \"" ).
-        append( OUStringToOString( rBiffTargetUrl, RTL_TEXTENCODING_UTF8 ) ).append( '"' ).getStr() );
-    bool bParserOk = (eState != STATE_ERROR) && (eState != STATE_UNSUPPORTED) && (pcChar == pcEnd);
-
-    if( bParserOk )
-    {
-        orTargetUrl = aTargetUrl.makeStringAndClear();
-        orSheetName = aSheetName.makeStringAndClear();
-    }
-    else
-    {
-        orClassName = orTargetUrl = orSheetName = OUString();
-    }
-
-    return bParserOk ? eTargetType : BIFF_TARGETTYPE_UNKNOWN;
-}
-
 // ----------------------------------------------------------------------------
 
 bool AddressConverter::checkCol( sal_Int32 nCol, bool bTrackOverflow )
diff --git a/sc/source/filter/oox/richstring.cxx b/sc/source/filter/oox/richstring.cxx
index 51f3f6b..bcc62f9 100644
--- a/sc/source/filter/oox/richstring.cxx
+++ b/sc/source/filter/oox/richstring.cxx
@@ -140,26 +140,6 @@ void FontPortionModel::read( SequenceInputStream& rStrm )
     mnFontId = rStrm.readuInt16();
 }
 
-void FontPortionModel::read( BiffInputStream& rStrm, BiffFontPortionMode eMode )
-{
-    switch( eMode )
-    {
-        case BIFF_FONTPORTION_8BIT:
-            mnPos = rStrm.readuInt8();
-            mnFontId = rStrm.readuInt8();
-        break;
-        case BIFF_FONTPORTION_16BIT:
-            mnPos = rStrm.readuInt16();
-            mnFontId = rStrm.readuInt16();
-        break;
-        case BIFF_FONTPORTION_OBJ:
-            mnPos = rStrm.readuInt16();
-            mnFontId = rStrm.readuInt16();
-            rStrm.skip( 4 );
-        break;
-    }
-}
-
 // ----------------------------------------------------------------------------
 
 void FontPortionModelList::appendPortion( const FontPortionModel& rPortion )
diff --git a/sc/source/filter/oox/stylesbuffer.cxx b/sc/source/filter/oox/stylesbuffer.cxx
index c5f5559..62d2508 100644
--- a/sc/source/filter/oox/stylesbuffer.cxx
+++ b/sc/source/filter/oox/stylesbuffer.cxx
@@ -2581,20 +2581,6 @@ void Dxf::importDxf( SequenceInputStream& rStrm )
     mxNumFmt = getStyles().createNumFmt( nNumFmtId, aFmtCode );
 }
 
-void Dxf::importCfRule( BiffInputStream& rStrm, sal_uInt32 nFlags )
-{
-    if( getFlag( nFlags, BIFF_CFRULE_FONTBLOCK ) )
-        createFont()->importCfRule( rStrm );
-    if( getFlag( nFlags, BIFF_CFRULE_ALIGNBLOCK ) )
-        rStrm.skip( 8 );
-    if( getFlag( nFlags, BIFF_CFRULE_BORDERBLOCK ) )
-        createBorder()->importCfRule( rStrm, nFlags );
-    if( getFlag( nFlags, BIFF_CFRULE_FILLBLOCK ) )
-        createFill()->importCfRule( rStrm, nFlags );
-    if( getFlag( nFlags, BIFF_CFRULE_PROTBLOCK ) )
-        rStrm.skip( 2 );
-}
-
 void Dxf::finalizeImport()
 {
     if( mxFont.get() )
diff --git a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx
index 54aa95b..2a48a7c 100644
--- a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx
@@ -146,11 +146,6 @@ private:
     */
     sal_uInt32 EncodeMouseEvent (const MouseEvent& rEvent) const;
 
-    /** Compute a numerical code that describes a key event and that can
-        be used for fast look up of the appropriate reaction.
-    */
-    sal_uInt32 EncodeKeyEvent (const KeyEvent& rEvent) const;
-
     /** Compute a numerical code that describes the current state like
         whether the selection rectangle is visible or whether the page under
         the mouse or the one that has the focus is selected.
@@ -1010,26 +1005,6 @@ sal_uInt32 SelectionFunction::EventDescriptor::EncodeMouseEvent (
     return nEventCode;
 }
 
-
-
-
-sal_uInt32 SelectionFunction::EventDescriptor::EncodeKeyEvent (const KeyEvent& rEvent) const
-{
-    // The key code in the lower 16 bit.
-    sal_uInt32 nEventCode (rEvent.GetKeyCode().GetCode());
-
-    // Detect pressed modifier keys.
-    if (rEvent.GetKeyCode().IsShift())
-        nEventCode |= SHIFT_MODIFIER;
-    if (rEvent.GetKeyCode().IsMod1())
-        nEventCode |= CONTROL_MODIFIER;
-
-    return nEventCode;
-}
-
-
-
-
 sal_uInt32 SelectionFunction::EventDescriptor::EncodeState (void) const
 {
     sal_uInt32 nEventCode (0);
diff --git a/unusedcode.easy b/unusedcode.easy
index de2277b..7f3bb6c 100755
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -129,7 +129,6 @@ SrchAttrItemList::Replace(SearchAttrItem const&, unsigned short)
 SrchAttrItemList::Replace(SearchAttrItem const*, unsigned short, unsigned short)
 SrchAttrItemList::_ForEach(unsigned short, unsigned short, unsigned char (*)(SearchAttrItem const&, void*), void*)
 StgCache::Pos2Page(int)
-StgHeader::SetClassId(ClsId const&)
 SvLBoxButton::Check(SvLBox*, SvLBoxEntry*, unsigned char)
 SvLBoxButtonData::SvLBoxButtonData()
 SvLBoxEntryArr::DeleteAndDestroy(unsigned short, unsigned short)
@@ -718,7 +717,6 @@ connectivity::SQLError::getSQLState(int) const
 connectivity::file::OStatement_Base::reset()
 connectivity::file::OStatement_Base::setWarning(com::sun::star::sdbc::SQLWarning const&)
 connectivity::mozab::MQueryHelper::next()
-connectivity::mozab::OCatalog::getDot()
 connectivity::mozab::OResultSet::initializeRow(rtl::Reference<connectivity::ODeleteVector<connectivity::ORowSetValue> >&, int)
 connectivity::sdbcx::OGroup::OGroup(rtl::OUString const&, unsigned char)
 connectivity::sdbcx::OGroup::OGroup(unsigned char)
commit fa4d647b480e9d855515cc3577b8a60ab615802a
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Apr 16 23:24:01 2012 +0100

    String::ToInt32->rtl::OUString::toInt32

diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx
index 24d6a00..81fc6f1 100644
--- a/cui/source/options/optinet2.cxx
+++ b/cui/source/options/optinet2.cxx
@@ -144,9 +144,9 @@ void SvxNoSpaceEdit::Modify()
 
     if ( bOnlyNumeric )
     {
-        XubString aValue = GetText();
+        rtl::OUString aValue = GetText();
 
-        if ( !comphelper::string::isdigitAsciiString(aValue) || (long)aValue.ToInt32() > USHRT_MAX )
+        if ( !comphelper::string::isdigitAsciiString(aValue) || (long)aValue.toInt32() > USHRT_MAX )
             // der H�chstwert einer Portnummer ist USHRT_MAX
             ErrorBox( this, CUI_RES( RID_SVXERR_OPT_PROXYPORTS ) ).Execute();
     }
@@ -596,9 +596,9 @@ IMPL_LINK( SvxProxyTabPage, ProxyHdl_Impl, ListBox *, pBox )
 
 IMPL_LINK( SvxProxyTabPage, LoseFocusHdl_Impl, Edit *, pEdit )
 {
-    XubString aValue = pEdit->GetText();
+    rtl::OUString aValue = pEdit->GetText();
 
-    if ( !comphelper::string::isdigitAsciiString(aValue) || (long)aValue.ToInt32() > USHRT_MAX )
+    if ( !comphelper::string::isdigitAsciiString(aValue) || (long)aValue.toInt32() > USHRT_MAX )
         pEdit->SetText( '0' );
     return 0;
 }
diff --git a/vcl/unx/generic/app/wmadaptor.cxx b/vcl/unx/generic/app/wmadaptor.cxx
index 8145ef7..8b9b278 100644
--- a/vcl/unx/generic/app/wmadaptor.cxx
+++ b/vcl/unx/generic/app/wmadaptor.cxx
@@ -858,9 +858,9 @@ bool WMAdaptor::getNetWmName()
                                         && nItems != 0
                                         )
                                     {
-                                        String aMetaVersion( (sal_Char*)pProperty, nItems, RTL_TEXTENCODING_UTF8 );
-                                        nVersionMajor = aMetaVersion.GetToken( 0, '.' ).ToInt32();
-                                        nVersionMinor = aMetaVersion.GetToken( 1, '.' ).ToInt32();
+                                        rtl::OUString aMetaVersion( (sal_Char*)pProperty, nItems, RTL_TEXTENCODING_UTF8 );
+                                        nVersionMajor = aMetaVersion.getToken(0, '.').toInt32();
+                                        nVersionMinor = aMetaVersion.getToken(1, '.').toInt32();
                                     }
                                     if( pProperty )
                                     {


More information about the Libreoffice-commits mailing list