framework/source/loadenv/loadenv.cxx |    2 +
 sc/source/ui/unoobj/scdetect.cxx     |    8 ++--
 sfx2/inc/sfx2/docfilt.hxx            |   64 ++++++++++++++++++-----------------
 sfx2/source/bastyp/fltfnc.cxx        |    4 +-
 sfx2/source/dialog/filedlghelper.cxx |    2 -
 sfx2/source/doc/docfilt.cxx          |   60 ++++++++++++++++++--------------
 sfx2/source/doc/objcont.cxx          |    2 -
 starmath/source/document.cxx         |    2 -
 sw/source/core/doc/docglbl.cxx       |    2 -
 sw/source/ui/app/docsh.cxx           |    2 -
 sw/source/ui/dbui/dbmgr.cxx          |    2 -
 11 files changed, 80 insertions(+), 70 deletions(-)

New commits:
commit b2288e8282bce091c5a31b85e3fe75666140dcda
Author: Kohei Yoshida <kohei.yosh...@gmail.com>
Date:   Tue Apr 9 13:00:25 2013 -0400

    Get the whole thing to build after the SfxFilter interface change.
    
    Change-Id: I62122e298f1434aa9e44c8f3fdfb7f710513617d

diff --git a/framework/source/loadenv/loadenv.cxx 
b/framework/source/loadenv/loadenv.cxx
index 33956f1..86646d5 100644
--- a/framework/source/loadenv/loadenv.cxx
+++ b/framework/source/loadenv/loadenv.cxx
@@ -744,6 +744,7 @@ bool queryOrcusTypeAndFilter(const 
uno::Sequence<beans::PropertyValue>& rDescrip
         rFilter = "gnumeric";
         return true;
     }
+#if 0
     else if (aURL.endsWith(".xlsx"))
     {
         rType = "generic_Text";
@@ -756,6 +757,7 @@ bool queryOrcusTypeAndFilter(const 
uno::Sequence<beans::PropertyValue>& rDescrip
         rFilter = "ods";
         return true;
     }
+#endif
 
     return false;
 }
diff --git a/sc/source/ui/unoobj/scdetect.cxx b/sc/source/ui/unoobj/scdetect.cxx
index e40be82..6d8a7dc 100644
--- a/sc/source/ui/unoobj/scdetect.cxx
+++ b/sc/source/ui/unoobj/scdetect.cxx
@@ -432,9 +432,9 @@ OUString SAL_CALL ScFilterDetect::detect( 
uno::Sequence<beans::PropertyValue>& l
                 SvStream* pStream = aMedium.GetInStream();
                 const SfxFilter* pPreselectedFilter = pFilter;
                 bool bCsvSelected = (pPreselectedFilter &&
-                        pPreselectedFilter->GetFilterName().EqualsAscii( 
pFilterAscii ));
+                        
pPreselectedFilter->GetFilterName().equalsAscii(pFilterAscii));
                 bool bExcelSelected = (pPreselectedFilter &&
-                        (pPreselectedFilter->GetName().SearchAscii("Excel") != 
STRING_NOTFOUND));
+                        (pPreselectedFilter->GetName().indexOf("Excel") >= 0));
                 bool bIsXLS = (bExcelSelected || (bCsvSelected && 
!aPreselectedFilterName.Len()));
                 pFilter = 0;
                 if ( pStream )
@@ -671,7 +671,7 @@ OUString SAL_CALL ScFilterDetect::detect( 
uno::Sequence<beans::PropertyValue>& l
                                     pFilter = aMatcher.GetFilter4FilterName( 
OUString(pFilterAscii) );
                                 bFakeXLS = true;
                             }
-                            else if ( 
pPreselectedFilter->GetName().EqualsAscii(pFilterDBase) && lcl_MayBeDBase( rStr 
) )
+                            else if ( 
pPreselectedFilter->GetName().equalsAscii(pFilterDBase) && lcl_MayBeDBase( rStr 
) )
                                 pFilter = pPreselectedFilter;
                             else if ( bCsvSelected && bMaybeText )
                                 pFilter = pPreselectedFilter;
@@ -686,7 +686,7 @@ OUString SAL_CALL ScFilterDetect::detect( 
uno::Sequence<beans::PropertyValue>& l
                                 // "foo <br> bar" with a preselected CSV
                                 // filter. So keep this detection to the end.
 
-                                if ( 
pPreselectedFilter->GetName().EqualsAscii(pFilterHtml) )
+                                if 
(pPreselectedFilter->GetName().equalsAscii(pFilterHtml))
                                 {
                                     pFilter = pPreselectedFilter;
                                 }
diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index 37e0b4d..0e2aa3e 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -970,7 +970,7 @@ sal_Bool SmDocShell::ConvertTo( SfxMedium &rMedium )
             aEquation.SetFlat(sal_True);
             bRet = aEquation.Export(rMedium);
         }
-        else if( pFlt->GetFilterName().EqualsAscii("MathType 3.x"))
+        else if (pFlt->GetFilterName().equalsAscii("MathType 3.x"))
             bRet = WriteAsMathType3( rMedium );
     }
     return bRet;
diff --git a/sw/source/core/doc/docglbl.cxx b/sw/source/core/doc/docglbl.cxx
index ddac41e..5c0eb98 100644
--- a/sw/source/core/doc/docglbl.cxx
+++ b/sw/source/core/doc/docglbl.cxx
@@ -214,7 +214,7 @@ bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& 
rPath, bool bOutline, c
     GetIDocumentUndoRedo().DoUndo(false);
     SetRedlineMode_intern( (RedlineMode_t)(GetRedlineMode() & 
~nsRedlineMode_t::REDLINE_ON));
 
-    String sExt( pFilter->GetSuffixes().GetToken(0, ',') );
+    String sExt = pFilter->GetSuffixes().getToken(0, ',');
     if( !sExt.Len() )
         sExt.AssignAscii( "sxw" );
     if( '.' != sExt.GetChar( 0 ) )
diff --git a/sw/source/ui/app/docsh.cxx b/sw/source/ui/app/docsh.cxx
index e961da1..3a3194a 100644
--- a/sw/source/ui/app/docsh.cxx
+++ b/sw/source/ui/app/docsh.cxx
@@ -193,7 +193,7 @@ Reader* SwDocShell::StartConvertFrom(SfxMedium& rMedium, 
SwReader** ppRdr,
     SFX_ITEMSET_ARG( rMedium.GetItemSet(), pUpdateDocItem, SfxUInt16Item, 
SID_UPDATEDOCMODE, sal_False);
     nUpdateDocMode = pUpdateDocItem ? pUpdateDocItem->GetValue() : 
document::UpdateDocMode::NO_UPDATE;
 
-    if( pFlt->GetDefaultTemplate().Len() )
+    if (!pFlt->GetDefaultTemplate().isEmpty())
         pRead->SetTemplateName( pFlt->GetDefaultTemplate() );
 
     if( pRead == ReadAscii && 0 != rMedium.GetInStream() &&
diff --git a/sw/source/ui/dbui/dbmgr.cxx b/sw/source/ui/dbui/dbmgr.cxx
index c7ce039..51db9f3 100644
--- a/sw/source/ui/dbui/dbmgr.cxx
+++ b/sw/source/ui/dbui/dbmgr.cxx
@@ -1140,7 +1140,7 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* 
pSourceShell,
 
                                 //convert fields to text if we are exporting 
to PDF
                                 //this prevents a second merge while updating 
the fields in SwXTextDocument::getRendererCount()
-                                if( pStoreToFilter && 
pStoreToFilter->GetFilterName().EqualsAscii("writer_pdf_Export"))
+                                if( pStoreToFilter && 
pStoreToFilter->GetFilterName().equalsAscii("writer_pdf_Export"))
                                     rWorkShell.ConvertFieldsToText();
                                 xWorkDocSh->DoSaveAs(*pDstMed);
                                 xWorkDocSh->DoSaveCompleted(pDstMed);
commit 3443d47a62820e611aaab523f1e405bbb1557f5a
Author: Kohei Yoshida <kohei.yosh...@gmail.com>
Date:   Tue Apr 9 12:22:06 2013 -0400

    String cleanup inside SfxFilter.
    
    Change-Id: I647b9e4de54fdcfadcf17ac7e161b245f3dea546

diff --git a/sfx2/inc/sfx2/docfilt.hxx b/sfx2/inc/sfx2/docfilt.hxx
index 18ccfc8..8400e5a 100644
--- a/sfx2/inc/sfx2/docfilt.hxx
+++ b/sfx2/inc/sfx2/docfilt.hxx
@@ -42,30 +42,32 @@ class SFX2_DLLPUBLIC SfxFilter
 friend class SfxFilterContainer;
 
     WildCard        aWildCard;
-    sal_uIntPtr     lFormat;
-    String          aTypeName;
-    OUString   aUserData;
+
+    OUString aTypeName;
+    OUString aUserData;
+    OUString aServiceName;
+    OUString aMimeType;
+    OUString aFilterName;
+    OUString aPattern;
+    OUString aUIName;
+    OUString aDefaultTemplate;
+
     SfxFilterFlags  nFormatType;
-    sal_uInt16      nDocIcon;
-    OUString   aServiceName;
-    OUString   aMimeType;
-    String          aFilterName;
-    String          aPattern;
     sal_uIntPtr     nVersion;
-    String          aUIName;
-    String          aDefaultTemplate;
+    sal_uIntPtr     lFormat;
+    sal_uInt16      nDocIcon;
 
 public:
-                    SfxFilter( const String &rName,
-                               const String &rWildCard,
-                               SfxFilterFlags nFormatType,
-                               sal_uInt32 lFormat,
-                               const String &rTypeName,
-                               sal_uInt16 nDocIcon,
-                               const String &rMimeType,
-                               const String &rUserData,
-                               const String& rServiceName );
-                    ~SfxFilter();
+    SfxFilter( const OUString &rName,
+               const OUString &rWildCard,
+               SfxFilterFlags nFormatType,
+               sal_uInt32 lFormat,
+               const OUString &rTypeName,
+               sal_uInt16 nDocIcon,
+               const OUString &rMimeType,
+               const OUString &rUserData,
+               const OUString& rServiceName );
+    ~SfxFilter();
 
     bool IsAllowedAsTemplate() const { return nFormatType & 
SFX_FILTER_TEMPLATE; }
     bool IsOwnFormat() const { return nFormatType & SFX_FILTER_OWN; }
@@ -75,26 +77,26 @@ public:
     bool CanExport() const { return nFormatType & SFX_FILTER_EXPORT; }
     bool IsInternal() const { return nFormatType & SFX_FILTER_INTERNAL; }
     SfxFilterFlags  GetFilterFlags() const  { return nFormatType; }
-    const String&   GetFilterName() const { return aFilterName; }
+    const OUString& GetFilterName() const { return aFilterName; }
     const OUString& GetMimeType() const { return aMimeType; }
-    const String&   GetName() const { return  aFilterName; }
+    const OUString& GetName() const { return  aFilterName; }
     const WildCard& GetWildcard() const { return aWildCard; }
-    const String&   GetRealTypeName() const { return aTypeName; }
+    const OUString& GetRealTypeName() const { return aTypeName; }
     sal_uIntPtr         GetFormat() const { return lFormat; }
-    const String&   GetTypeName() const { return aTypeName; }
-    const String&   GetUIName() const { return aUIName; }
+    const OUString& GetTypeName() const { return aTypeName; }
+    const OUString& GetUIName() const { return aUIName; }
     sal_uInt16          GetDocIconId() const { return nDocIcon; }
     const OUString& GetUserData() const { return aUserData; }
-    const String&   GetDefaultTemplate() const { return aDefaultTemplate; }
+    const OUString& GetDefaultTemplate() const { return aDefaultTemplate; }
     void            SetDefaultTemplate( const String& rStr ) { 
aDefaultTemplate = rStr; }
-    sal_Bool            UsesStorage() const { return GetFormat() != 0; }
-    void            SetURLPattern( const String& rStr ) { aPattern = rStr; 
aPattern.ToLowerAscii(); }
-    String          GetURLPattern() const { return aPattern; }
+    bool            UsesStorage() const { return GetFormat() != 0; }
+    void SetURLPattern( const OUString& rStr );
+    OUString GetURLPattern() const { return aPattern; }
     void            SetUIName( const String& rName ) { aUIName = rName; }
     void            SetVersion( sal_uIntPtr nVersionP ) { nVersion = 
nVersionP; }
     sal_uIntPtr           GetVersion() const { return nVersion; }
-    String          GetSuffixes() const;
-    String          GetDefaultExtension() const;
+    OUString GetSuffixes() const;
+    OUString GetDefaultExtension() const;
     const OUString& GetServiceName() const { return aServiceName; }
 
     static const SfxFilter* GetDefaultFilter( const String& rName );
diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx
index 83181be..78b3607 100644
--- a/sfx2/source/bastyp/fltfnc.cxx
+++ b/sfx2/source/bastyp/fltfnc.cxx
@@ -809,7 +809,7 @@ const SfxFilter* SfxFilterMatcher::GetFilter4FilterName( 
const String& rName, Sf
                 {
                     const SfxFilter* pFilter = (*pFilterArr)[i];
                     SfxFilterFlags nFlags = pFilter->GetFilterFlags();
-                    if ( (nFlags & nMust) == nMust && !(nFlags & nDont ) && 
pFilter->GetFilterName().CompareIgnoreCaseToAscii( aName ) == COMPARE_EQUAL )
+                    if ((nFlags & nMust) == nMust && !(nFlags & nDont) && 
pFilter->GetFilterName().equalsIgnoreAsciiCase(aName))
                         return pFilter;
                 }
             }
@@ -826,7 +826,7 @@ const SfxFilter* SfxFilterMatcher::GetFilter4FilterName( 
const String& rName, Sf
     {
         const SfxFilter* pFilter = (*pList)[i];
         SfxFilterFlags nFlags = pFilter->GetFilterFlags();
-        if ( (nFlags & nMust) == nMust && !(nFlags & nDont ) && 
pFilter->GetFilterName().CompareIgnoreCaseToAscii( aName ) == COMPARE_EQUAL )
+        if ( (nFlags & nMust) == nMust && !(nFlags & nDont ) && 
pFilter->GetFilterName().equalsIgnoreAsciiCase(aName))
             return pFilter;
     }
 
diff --git a/sfx2/source/dialog/filedlghelper.cxx 
b/sfx2/source/dialog/filedlghelper.cxx
index ee8da3d..88fd6aa 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -1636,7 +1636,7 @@ void FileDialogHelper_Impl::getRealFilter( String& 
_rFilter ) const
     {
         const SfxFilter* pFilter =
             mpMatcher->GetFilter4UIName( _rFilter, m_nMustFlags, m_nDontFlags 
);
-        _rFilter = pFilter ? pFilter->GetFilterName() : _rFilter.Erase();
+        _rFilter = pFilter ? String(pFilter->GetFilterName()) : 
_rFilter.Erase();
     }
 }
 
diff --git a/sfx2/source/doc/docfilt.cxx b/sfx2/source/doc/docfilt.cxx
index a6ed5aa..ce95b9b 100644
--- a/sfx2/source/doc/docfilt.cxx
+++ b/sfx2/source/doc/docfilt.cxx
@@ -40,67 +40,73 @@ using namespace ::com::sun::star;
 
 DBG_NAME(SfxFilter)
 
-SfxFilter::SfxFilter(  const String &rName,
-                       const String &rWildCard,
-                       SfxFilterFlags nType,
-                       sal_uInt32 lFmt,
-                       const String &rTypNm,
-                       sal_uInt16 nIcon,
-                       const String &rMimeType,
-                       const String &rUsrDat,
-                       const String &rServiceName ):
+SfxFilter::SfxFilter( const OUString &rName,
+                      const OUString &rWildCard,
+                      SfxFilterFlags nType,
+                      sal_uInt32 lFmt,
+                      const OUString &rTypNm,
+                      sal_uInt16 nIcon,
+                      const OUString &rMimeType,
+                      const OUString &rUsrDat,
+                      const OUString &rServiceName ):
     aWildCard(rWildCard, ';'),
-    lFormat(lFmt),
     aTypeName(rTypNm),
     aUserData(rUsrDat),
+    aServiceName(rServiceName),
+    aMimeType(rMimeType),
+    aFilterName(rName),
+    aUIName(aFilterName),
     nFormatType(nType),
-    nDocIcon(nIcon),
-    aServiceName( rServiceName ),
-    aMimeType( rMimeType ),
-    aFilterName( rName )
+    nVersion(SOFFICE_FILEFORMAT_50),
+    lFormat(lFmt),
+    nDocIcon(nIcon)
 {
-    String aExts = GetWildcard().getGlob();
-    String aShort, aLong;
-    String aRet;
+    OUString aExts = GetWildcard().getGlob();
+    OUString aShort, aLong;
+    OUString aRet;
     sal_uInt16 nMaxLength = USHRT_MAX;
     OUString aTest;
     sal_uInt16 nPos = 0;
-    while( ( aRet = aExts.GetToken( nPos++, ';' ) ).Len() )
+    while (!(aRet = aExts.getToken(nPos++, ';')).isEmpty() )
     {
         aTest = aRet;
         aTest = aTest.replaceFirst( "*." , "" );
         if( aTest.getLength() <= nMaxLength )
         {
-            if( aShort.Len() ) aShort += ';';
+            if (!aShort.isEmpty())
+                aShort += ";";
             aShort += aRet;
         }
         else
         {
-            if( aLong.Len() ) aLong += ';';
+            if (!aLong.isEmpty())
+                aLong += ";";
             aLong += aRet;
         }
     }
-    if( aShort.Len() && aLong.Len() )
+    if (!aShort.isEmpty() && !aLong.isEmpty())
     {
-        aShort += ';';
+        aShort += ";";
         aShort += aLong;
     }
     aWildCard.setGlob(aShort);
-
-    nVersion = SOFFICE_FILEFORMAT_50;
-    aUIName = aFilterName;
 }
 
 SfxFilter::~SfxFilter()
 {
 }
 
-String SfxFilter::GetDefaultExtension() const
+OUString SfxFilter::GetDefaultExtension() const
 {
     return comphelper::string::getToken(GetWildcard().getGlob(), 0, ';');
 }
 
-String SfxFilter::GetSuffixes() const
+void SfxFilter::SetURLPattern( const OUString& rStr )
+{
+    aPattern = rStr.toAsciiLowerCase();
+}
+
+OUString SfxFilter::GetSuffixes() const
 {
     String aRet = GetWildcard().getGlob();
     while( aRet.SearchAndReplaceAscii( "*.", String() ) != STRING_NOTFOUND ) ;
diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx
index e6722b7..a03879c 100644
--- a/sfx2/source/doc/objcont.cxx
+++ b/sfx2/source/doc/objcont.cxx
@@ -807,7 +807,7 @@ void SfxObjectShell::UpdateFromTemplate_Impl(  )
 sal_Bool SfxObjectShell::IsHelpDocument() const
 {
     const SfxFilter* pFilter = GetMedium()->GetFilter();
-    return ( pFilter && 
pFilter->GetFilterName().CompareToAscii("writer_web_HTML_help") == 
COMPARE_EQUAL );
+    return (pFilter && pFilter->GetFilterName() == "writer_web_HTML_help");
 }
 
 void SfxObjectShell::ResetFromTemplate( const String& rTemplateName, const 
String& rFileName )
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to