[Libreoffice-commits] .: 3 commits - connectivity/source sc/source sw/qa sw/source tools/inc tools/source unusedcode.easy vcl/inc vcl/source

Caolán McNamara caolan at kemper.freedesktop.org
Mon Aug 13 02:54:29 PDT 2012


 connectivity/source/commontools/TSortIndex.cxx |    4 -
 connectivity/source/inc/TKeyValue.hxx          |    1 
 sc/source/filter/xml/xmlexprt.cxx              |    6 -
 sc/source/filter/xml/xmlexprt.hxx              |    1 
 sw/qa/core/data/txt/pass/CVE-2009-2473-1.txt   |    1 
 sw/qa/core/data/txt/pass/CVE-2009-2473-2.txt   |    1 
 sw/qa/core/data/txt/pass/UTF-8-test.txt        |binary
 sw/qa/core/filters-test.cxx                    |   23 +++++-
 sw/source/ui/dialog/ascfldlg.cxx               |   95 ++++++++++---------------
 tools/inc/impcont.hxx                          |    2 
 tools/source/memtools/contnr.cxx               |   38 ----------
 unusedcode.easy                                |   14 ++-
 vcl/inc/vcl/spin.hxx                           |    1 
 vcl/source/control/spinbtn.cxx                 |   12 ---
 14 files changed, 71 insertions(+), 128 deletions(-)

New commits:
commit c8218367a0f52206591a5048848fa5292405b6c3
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Aug 13 10:53:21 2012 +0100

    callcatcher: update list
    
    Change-Id: If9b76e5282c22a479ff709174fbc8ee4d3c337cc

diff --git a/connectivity/source/commontools/TSortIndex.cxx b/connectivity/source/commontools/TSortIndex.cxx
index 6af714a..a0fc738 100644
--- a/connectivity/source/commontools/TSortIndex.cxx
+++ b/connectivity/source/commontools/TSortIndex.cxx
@@ -135,10 +135,6 @@ void OSortIndex::Freeze()
 }
 
 // -----------------------------------------------------------------------------
-OKeyValue::OKeyValue()
-{
-}
-// -----------------------------------------------------------------------------
 OKeyValue::OKeyValue(sal_Int32 nVal)
 : m_nValue(nVal)
 {
diff --git a/connectivity/source/inc/TKeyValue.hxx b/connectivity/source/inc/TKeyValue.hxx
index 9e07815..b1df68b 100644
--- a/connectivity/source/inc/TKeyValue.hxx
+++ b/connectivity/source/inc/TKeyValue.hxx
@@ -31,7 +31,6 @@ namespace connectivity
         sal_Int32 m_nValue;
 
     protected:
-        OKeyValue();
         OKeyValue(sal_Int32 nVal);
     public:
 
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index 3e22e75..a3c769d 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -599,12 +599,6 @@ sal_Int32 ScXMLExport::GetNumberFormatStyleIndex(sal_Int32 nNumFmt) const
     return itr->second;
 }
 
-bool ScXMLExport::HasDrawPages(uno::Reference <sheet::XSpreadsheetDocument>& xDoc)
-{
-    uno::Reference <beans::XPropertySet> xDocProps( xDoc, uno::UNO_QUERY );
-    return (xDocProps.is() && ::cppu::any2bool( xDocProps->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNO_HASDRAWPAGES))) ));
-}
-
 namespace {
 
 /**
diff --git a/sc/source/filter/xml/xmlexprt.hxx b/sc/source/filter/xml/xmlexprt.hxx
index dd7f8da..f04e548 100644
--- a/sc/source/filter/xml/xmlexprt.hxx
+++ b/sc/source/filter/xml/xmlexprt.hxx
@@ -131,7 +131,6 @@ class ScXMLExport : public SvXMLExport
     bool                        mbShowProgress;
 
     sal_Int32       GetNumberFormatStyleIndex(sal_Int32 nNumFmt) const;
-    bool            HasDrawPages(com::sun::star::uno::Reference <com::sun::star::sheet::XSpreadsheetDocument>& xDoc);
     void            CollectSharedData(sal_Int32& nTableCount, sal_Int32& nShapesCount);
     void            CollectShapesAutoStyles(const sal_Int32 nTableCount);
     void            WriteTablesView(const com::sun::star::uno::Any& aTableView);
diff --git a/tools/inc/impcont.hxx b/tools/inc/impcont.hxx
index 455555b..87c3653 100644
--- a/tools/inc/impcont.hxx
+++ b/tools/inc/impcont.hxx
@@ -60,8 +60,6 @@ public:
     void**          GetObjectPtr( sal_uInt16 nIndex );
     void*           GetObject( sal_uInt16 nIndex ) const;
 
-    void            SetSize( sal_uInt16 nNewSize );
-
     sal_uInt16          GetSize() const               { return nCount; }
     sal_uInt16          Count() const                 { return nCount; }
     void            SetPrevBlock( CBlock* p )     { pPrev = p;     }
diff --git a/tools/source/memtools/contnr.cxx b/tools/source/memtools/contnr.cxx
index 0b7c0d1..b3232a2 100644
--- a/tools/source/memtools/contnr.cxx
+++ b/tools/source/memtools/contnr.cxx
@@ -419,44 +419,6 @@ inline void** CBlock::GetObjectPtr( sal_uInt16 nIndex )
     return &(pNodes[nIndex]);
 }
 
-/*************************************************************************
-|*
-|*    CBlock::SetSize()
-|*
-|*    Beschreibung      Aendert die Groesse des Blocks
-|*
-*************************************************************************/
-
-void CBlock::SetSize( sal_uInt16 nNewSize )
-{
-    DBG_CHKTHIS( CBlock, DbgCheckCBlock );
-    DBG_ASSERT( nNewSize, "CBlock::SetSize(): nNewSize == 0" );
-
-    // Unterscheidet sich die Groesse
-    if ( nNewSize != nCount )
-    {
-        // Array erweitern
-        void** pNewNodes = new PVOID[nNewSize];
-
-        // Alte Tabelle in die Neue kopieren
-        if ( nNewSize < nCount )
-            memcpy( pNewNodes, pNodes, nNewSize*sizeof(PVOID) );
-        else
-        {
-            memcpy( pNewNodes, pNodes, nCount*sizeof(PVOID) );
-
-            // Array mit 0 initialisieren
-            memset( pNewNodes+nCount, 0, (nNewSize-nCount)*sizeof(PVOID) );
-        }
-
-        // Altes Array loeschen und neue Werte setzen
-        nSize  = nNewSize;
-        nCount = nSize;
-        delete[] pNodes;
-        pNodes = pNewNodes;
-    }
-}
-
 //------------------------------------------------------------------------
 
 /*************************************************************************
diff --git a/unusedcode.easy b/unusedcode.easy
index d647416..2efaa7e 100755
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -7,10 +7,8 @@ ScVbaFormat<ooo::vba::excel::XRange>::setNumberFormat(com::sun::star::lang::Loca
 ScVbaFormat<ooo::vba::excel::XStyle>::getAddIndent()
 ScVbaFormat<ooo::vba::excel::XStyle>::setAddIndent(com::sun::star::uno::Any const&)
 ScVbaFormat<ooo::vba::excel::XStyle>::setNumberFormat(com::sun::star::lang::Locale, rtl::OUString const&)
-ScXMLExport::HasDrawPages(com::sun::star::uno::Reference<com::sun::star::sheet::XSpreadsheetDocument>&)
 SecurityEnvironment_NssImpl::getImplementation(com::sun::star::uno::Reference<com::sun::star::uno::XInterface>)
 SotStorage::GetProperty(String const&, String const&, com::sun::star::uno::Any&)
-SpinButton::SpinButton(Window*, ResId const&)
 StgCache::Pos2Page(int)
 SvtSlideSorterBarOptions::AddListenerLink(Link const&)
 SvtSlideSorterBarOptions::RemoveListenerLink(Link const&)
@@ -82,7 +80,6 @@ cmis::Content::exchangeIdentity(com::sun::star::uno::Reference<com::sun::star::u
 comphelper::detail::ConfigurationWrapper::getGroupReadWrite(boost::shared_ptr<comphelper::ConfigurationChanges> const&, rtl::OUString const&) const
 comphelper::detail::ConfigurationWrapper::getLocalizedPropertyValue(rtl::OUString const&) const
 comphelper::detail::ConfigurationWrapper::setLocalizedPropertyValue(boost::shared_ptr<comphelper::ConfigurationChanges> const&, rtl::OUString const&, com::sun::star::uno::Any const&) const
-connectivity::OKeyValue::OKeyValue()
 connectivity::file::OStatement_Base::reset()
 connectivity::mozab::MQueryHelper::next()
 connectivity::sdbcx::OGroup::OGroup(rtl::OUString const&, unsigned char)
@@ -93,10 +90,19 @@ formula::FormulaTokenIterator::First()
 jfw_plugin::VendorBase::createInstance()
 oox::drawingml::TextParagraphProperties::dump() const
 oox::xls::BiffDrawingObjectBase::BiffDrawingObjectBase(oox::xls::WorksheetHelper const&)
+sd::ClientBox::GetMinOutputSizePixel() const
+sd::ClientBox::RemoveUnlocked()
+sd::ClientBox::SetScrollHdl(Link const&)
+sd::ClientBox::checkEntries()
+sd::ClientBox::checkIndex(int) const
+sd::ClientBox::prepareChecking()
+sd::ClientBox::removeEntry(sd::ClientInfo const&)
+sd::ClientBox::updateEntry(sd::ClientInfo const&)
+sd::Communicator::getTransmitter()
 sd::ImagePreparer::notesToHtml(unsigned int)
 sd::LeftDrawPaneShell::RegisterInterface(SfxModule*)
 sd::LeftImpressPaneShell::RegisterInterface(SfxModule*)
-sd::RemoteServer::pairClient()
+sd::RemoteServer::connectClient(sd::ClientInfo*, rtl::OUString)
 sd::ToolPanelPaneShell::RegisterInterface(SfxModule*)
 sd::ViewShellBase::RegisterFactory(unsigned short)
 std::__cxx1998::vector<SfxFilter*, std::allocator<SfxFilter*> >::~vector()
diff --git a/vcl/inc/vcl/spin.hxx b/vcl/inc/vcl/spin.hxx
index b419788..3966034 100644
--- a/vcl/inc/vcl/spin.hxx
+++ b/vcl/inc/vcl/spin.hxx
@@ -57,7 +57,6 @@ private:
 
 public:
                     SpinButton( Window* pParent, WinBits nStyle = 0 );
-                    SpinButton( Window* pParent, const ResId& rResId );
                     ~SpinButton();
 
     virtual void    Up();
diff --git a/vcl/source/control/spinbtn.cxx b/vcl/source/control/spinbtn.cxx
index d08938f..6483ef5 100644
--- a/vcl/source/control/spinbtn.cxx
+++ b/vcl/source/control/spinbtn.cxx
@@ -69,18 +69,6 @@ SpinButton::SpinButton( Window* pParent, WinBits nStyle )
 
 // -----------------------------------------------------------------------
 
-SpinButton::SpinButton( Window* pParent, const ResId& rResId )
-    :Control( WINDOW_SPINBUTTON )
-    ,mbUpperIsFocused( sal_False )
-{
-    rResId.SetRT( RSC_SPINBUTTON );
-    ImplInit( pParent, ImplInitRes( rResId ) );
-    ImplLoadRes( rResId );
-    Resize();
-}
-
-// -----------------------------------------------------------------------
-
 SpinButton::~SpinButton()
 {
 }
commit 24e0e7ca6207a45fc45b67a1355a9d855955a2a8
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Aug 13 10:36:42 2012 +0100

    add cppunit tests to guard against .txt import regressions
    
    i.e. aac04652fda01b0299e17087b151f07d6115e894 cockup
    
    Change-Id: I858a6895678266cdc714962c04bb24bf5769d656

diff --git a/sw/qa/core/data/txt/fail/.gitignore b/sw/qa/core/data/txt/fail/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/sw/qa/core/data/txt/indeterminate/.gitignore b/sw/qa/core/data/txt/indeterminate/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/sw/qa/core/data/txt/pass/.gitignore b/sw/qa/core/data/txt/pass/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/sw/qa/core/data/txt/pass/CVE-2009-2473-1.txt b/sw/qa/core/data/txt/pass/CVE-2009-2473-1.txt
new file mode 100644
index 0000000..3bb3ebd
--- /dev/null
+++ b/sw/qa/core/data/txt/pass/CVE-2009-2473-1.txt
@@ -0,0 +1 @@
+IXØ
\ No newline at end of file
diff --git a/sw/qa/core/data/txt/pass/CVE-2009-2473-2.txt b/sw/qa/core/data/txt/pass/CVE-2009-2473-2.txt
new file mode 100644
index 0000000..85fc478
--- /dev/null
+++ b/sw/qa/core/data/txt/pass/CVE-2009-2473-2.txt
@@ -0,0 +1 @@
+ujªÁBgÌoù·óåÞXÌà >Afàã
\ No newline at end of file
diff --git a/sw/qa/core/data/txt/pass/UTF-8-test.txt b/sw/qa/core/data/txt/pass/UTF-8-test.txt
new file mode 100644
index 0000000..abd16f7
Binary files /dev/null and b/sw/qa/core/data/txt/pass/UTF-8-test.txt differ
diff --git a/sw/qa/core/filters-test.cxx b/sw/qa/core/filters-test.cxx
index 2257d2f..4df9b07 100644
--- a/sw/qa/core/filters-test.cxx
+++ b/sw/qa/core/filters-test.cxx
@@ -38,8 +38,12 @@
 #include <sfx2/docfilt.hxx>
 #include <sfx2/docfile.hxx>
 #include <sfx2/sfxmodelfactory.hxx>
+#include <sfx2/sfxsids.hrc>
+
+#include <svl/stritem.hxx>
 
 #include "init.hxx"
+#include "iodetect.hxx"
 #include "swtypes.hxx"
 #include "doc.hxx"
 #include "docsh.hxx"
@@ -83,6 +87,13 @@ bool SwFiltersTest::load(const rtl::OUString &rFilter, const rtl::OUString &rURL
     SwDocShellRef xDocShRef = new SwDocShell;
     SfxMedium* pSrcMed = new SfxMedium(rURL, STREAM_STD_READ);
     pSrcMed->SetFilter(pFilter);
+
+    if (rUserData == FILTER_TEXT_DLG)
+    {
+        pSrcMed->GetItemSet()->Put(
+            SfxStringItem(SID_FILE_FILTEROPTIONS, rtl::OUString("UTF8,LF,Liberation Mono,en-US")));
+    }
+
     bool bLoaded = xDocShRef->DoLoad(pSrcMed);
     if (xDocShRef.Is())
         xDocShRef->DoClose();
@@ -91,13 +102,17 @@ bool SwFiltersTest::load(const rtl::OUString &rFilter, const rtl::OUString &rURL
 
 void SwFiltersTest::testCVEs()
 {
-    testDir(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Staroffice XML (Writer)")),
+    testDir(rtl::OUString("Staroffice XML (Writer)"),
             getURLFromSrc("/sw/qa/core/data/xml/"),
-            rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CXML")));
+            rtl::OUString(FILTER_XML));
 
-    testDir(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MS Word 97")),
+    testDir(rtl::OUString("MS Word 97"),
             getURLFromSrc("/sw/qa/core/data/ww8/"),
-            rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CWW8")));
+            rtl::OUString(FILTER_WW8));
+
+    testDir(rtl::OUString("Text (encoded)"),
+            getURLFromSrc("/sw/qa/core/data/txt/"),
+            rtl::OUString(FILTER_TEXT_DLG));
 }
 
 void SwFiltersTest::setUp()
commit d5c9e77296056aa5e29a26bd3d8fb01e28dabde2
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Aug 13 09:59:06 2012 +0100

    Default ascii import dialog to fixed text font the the detected language
    
    For the Ascii import dialog detect the language first and base the default
    fonts off that as the default fixed width font for that language
    
    Change-Id: I6e81c7c38900a441076dc591c070b99a2184e081

diff --git a/sw/source/ui/dialog/ascfldlg.cxx b/sw/source/ui/dialog/ascfldlg.cxx
index 595375a..399f807 100644
--- a/sw/source/ui/dialog/ascfldlg.cxx
+++ b/sw/source/ui/dialog/ascfldlg.cxx
@@ -149,11 +149,44 @@ SwAsciiFilterDlg::SwAsciiFilterDlg( Window* pParent, SwDocShell& rDocSh,
             }
         }
 
+        sal_uInt16 nAppScriptType = GetI18NScriptTypeOfLanguage( (sal_uInt16)GetAppLanguage() );
         SwDoc* pDoc = rDocSh.GetDoc();
 
-        sal_uInt16 nAppScriptType = GetI18NScriptTypeOfLanguage( (sal_uInt16)GetAppLanguage() );
+        // initialise language
         {
-            sal_Bool bDelPrinter = sal_False;
+            if( !aOpt.GetLanguage() )
+            {
+                if(pDoc)
+                {
+                    sal_uInt16 nWhich = GetWhichOfScript( RES_CHRATR_LANGUAGE, nAppScriptType);
+                    aOpt.SetLanguage( ((SvxLanguageItem&)pDoc->
+                                GetDefault( nWhich )).GetLanguage());
+                }
+                else
+                {
+                    SvtLinguOptions aLinguOpt;
+                    SvtLinguConfig().GetOptions( aLinguOpt );
+                    switch(nAppScriptType)
+                    {
+                        case SCRIPTTYPE_ASIAN:
+                            aOpt.SetLanguage(MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CJK, SCRIPTTYPE_ASIAN));
+                        break;
+                        case SCRIPTTYPE_COMPLEX:
+                            aOpt.SetLanguage(MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CTL, SCRIPTTYPE_COMPLEX));
+                        break;
+                        //SCRIPTTYPE_LATIN:
+                        default:
+                            aOpt.SetLanguage(MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage, SCRIPTTYPE_LATIN));
+                    }
+                }
+            }
+
+            aLanguageLB.SetLanguageList( LANG_LIST_ALL, sal_True, sal_False );
+            aLanguageLB.SelectLanguage( aOpt.GetLanguage() );
+        }
+
+        {
+            bool bDelPrinter = false;
             SfxPrinter* pPrt = pDoc ? pDoc->getPrinter(false) : 0;
             if( !pPrt )
             {
@@ -162,10 +195,9 @@ SwAsciiFilterDlg::SwAsciiFilterDlg( Window* pParent, SwDocShell& rDocSh,
                             SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC,
                             0 );
                 pPrt = new SfxPrinter( pSet );
-                bDelPrinter = sal_True;
+                bDelPrinter = true;
             }
 
-
             // get the set of disctinct available family names
             std::set< String > aFontNames;
             int nFontNames = pPrt->GetDevFontCount();
@@ -184,65 +216,18 @@ SwAsciiFilterDlg::SwAsciiFilterDlg( Window* pParent, SwDocShell& rDocSh,
 
             if( !aOpt.GetFontName().Len() )
             {
-                if(pDoc)
-                {
-                    sal_uInt16 nFontRes = RES_CHRATR_FONT;
-                    if(SCRIPTTYPE_ASIAN == nAppScriptType)
-                        nFontRes = RES_CHRATR_CJK_FONT;
-                    else if(SCRIPTTYPE_COMPLEX == nAppScriptType)
-                        nFontRes = RES_CHRATR_CTL_FONT;
-
-                    aOpt.SetFontName( ((SvxFontItem&)pDoc->GetDefault(
-                                    nFontRes )).GetFamilyName() );
-                }
-                else
-                {
-                    sal_uInt16 nFontType = FONT_STANDARD;
-                    if(SCRIPTTYPE_ASIAN == nAppScriptType)
-                        nFontType = FONT_STANDARD_CJK;
-                    else if(SCRIPTTYPE_COMPLEX == nAppScriptType)
-                        nFontType = FONT_STANDARD_CTL;
-                    aOpt.SetFontName(SW_MOD()->GetStdFontConfig()->GetFontFor(nFontType));
-                }
+                LanguageType eLang = aOpt.GetLanguage();
+                Font aTmpFont(OutputDevice::GetDefaultFont(DEFAULTFONT_FIXED, eLang, DEFAULTFONT_FLAGS_ONLYONE, pPrt));
+                aOpt.SetFontName(aTmpFont.GetName());
             }
+
             aFontLB.SelectEntry( aOpt.GetFontName() );
 
             if( bDelPrinter )
                 delete pPrt;
         }
 
-        // initialise language
-        {
-            if( !aOpt.GetLanguage() )
-            {
-                if(pDoc)
-                {
-                    sal_uInt16 nWhich = GetWhichOfScript( RES_CHRATR_LANGUAGE, nAppScriptType);
-                    aOpt.SetLanguage( ((SvxLanguageItem&)pDoc->
-                                GetDefault( nWhich )).GetLanguage());
-                }
-                else
-                {
-                    SvtLinguOptions aLinguOpt;
-                    SvtLinguConfig().GetOptions( aLinguOpt );
-                    switch(nAppScriptType)
-                    {
-                        case SCRIPTTYPE_ASIAN:
-                            aOpt.SetLanguage(MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CJK, SCRIPTTYPE_ASIAN));
-                        break;
-                        case SCRIPTTYPE_COMPLEX:
-                            aOpt.SetLanguage(MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage_CTL, SCRIPTTYPE_COMPLEX));
-                        break;
-                        //SCRIPTTYPE_LATIN:
-                        default:
-                            aOpt.SetLanguage(MsLangId::resolveSystemLanguageByScriptType(aLinguOpt.nDefaultLanguage, SCRIPTTYPE_LATIN));
-                    }
-                }
-            }
 
-            aLanguageLB.SetLanguageList( LANG_LIST_ALL, sal_True, sal_False );
-            aLanguageLB.SelectLanguage( aOpt.GetLanguage() );
-        }
     }
     else
     {


More information about the Libreoffice-commits mailing list