summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-08-28 21:27:43 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-08-29 09:56:07 +0100
commit11de7bc8c8091a434b046cb8377b5d9d06ca97a5 (patch)
treeeca8801eb186340413c24cb1024787e33a319d14
parent3be40d96b7a14fb515f9f1b477cabcf96e6d469c (diff)
deconfuse this api somewhat
-rw-r--r--sfx2/source/bastyp/fltfnc.cxx8
-rw-r--r--sfx2/source/doc/docfilt.cxx2
-rw-r--r--svtools/source/dialogs/filedlg2.cxx10
-rw-r--r--tools/inc/tools/wldcrd.hxx27
-rw-r--r--tools/source/fsys/tdir.cxx8
5 files changed, 21 insertions, 34 deletions
diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx
index 3ab7ea6ca7b3..0b500f10e6bc 100644
--- a/sfx2/source/bastyp/fltfnc.cxx
+++ b/sfx2/source/bastyp/fltfnc.cxx
@@ -833,9 +833,13 @@ const SfxFilter* SfxFilterMatcher::GetFilter4FilterName( const String& rName, Sf
IMPL_STATIC_LINK( SfxFilterMatcher, MaybeFileHdl_Impl, String*, pString )
{
const SfxFilter* pFilter = pThis->GetFilter4Extension( *pString, SFX_FILTER_IMPORT );
- if( pFilter && !pFilter->GetWildcard().Matches( String() ) &&
- pFilter->GetWildcard() != DEFINE_CONST_UNICODE("*.*") && pFilter->GetWildcard() != '*' )
+ if (pFilter && !pFilter->GetWildcard().Matches( String() ) &&
+ !pFilter->GetWildcard().Matches(DEFINE_CONST_UNICODE("*.*")) &&
+ !pFilter->GetWildcard().Matches('*')
+ )
+ {
return sal_True;
+ }
return sal_False;
}
diff --git a/sfx2/source/doc/docfilt.cxx b/sfx2/source/doc/docfilt.cxx
index b8a8274740c6..68a79030bcfe 100644
--- a/sfx2/source/doc/docfilt.cxx
+++ b/sfx2/source/doc/docfilt.cxx
@@ -99,7 +99,7 @@ SfxFilter::SfxFilter( const String &rName,
aShort += ';';
aShort += aLong;
}
- aWildCard = aShort;
+ aWildCard.setGlob(aShort);
nVersion = SOFFICE_FILEFORMAT_50;
aUIName = aFilterName;
diff --git a/svtools/source/dialogs/filedlg2.cxx b/svtools/source/dialogs/filedlg2.cxx
index 7323ce91e428..4723344fa7ed 100644
--- a/svtools/source/dialogs/filedlg2.cxx
+++ b/svtools/source/dialogs/filedlg2.cxx
@@ -904,7 +904,7 @@ IMPL_LINK( ImpFileDialog, DblClickHdl, ListBox *, pBox )
// Neue Maske setzen, und Listboxen updaten
size_t nCurPos = pTypeList->GetSelectEntryPos();
if( nCurPos+1 > aFilterList.size() )
- aMask = UniString::CreateFromAscii( ALLFILES );
+ aMask.setGlob(UniString::CreateFromAscii( ALLFILES ));
else
{
UniString aFilterListMask = aFilterList[ nCurPos ]->aMask;
@@ -943,7 +943,7 @@ IMPL_LINK( ImpFileDialog, ClickHdl, Button*, pBtn )
// -> abschneiden und merken
if( FileStat( aFile ).GetKind() & (FSYS_KIND_FILE | FSYS_KIND_WILD) || !aFile.Exists() )
{
- aMask = aFile.CutName();
+ aMask.setGlob(aFile.CutName());
}
// Neue Maske und neues Verzeichnis setzen, und Listboxen updaten
@@ -1147,7 +1147,7 @@ void ImpFileDialog::SetPath( UniString const & rPath )
// -> abschneiden und merken
if( FileStat( aFile ).GetKind() & (FSYS_KIND_FILE | FSYS_KIND_WILD) || !aFile.Exists() )
{
- aMask = aFile.CutName();
+ aMask.setGlob(aFile.CutName());
// Neue Maske und neues Verzeichnis setzen, und Listboxen updaten
if( pDirList )
@@ -1232,10 +1232,10 @@ void ImpFileDialog::PreExecute()
aMask = WildCard( aFilterListMask, ';' );
}
else
- aMask = UniString::CreateFromAscii( ALLFILES );
+ aMask.setGlob(UniString::CreateFromAscii( ALLFILES ));
}
else
- aMask = UniString::CreateFromAscii( ALLFILES );
+ aMask.setGlob(UniString::CreateFromAscii( ALLFILES ));
// Neue Maske setzen
if( pEdit->GetText().Len() == 0 )
diff --git a/tools/inc/tools/wldcrd.hxx b/tools/inc/tools/wldcrd.hxx
index 3be67481c623..bf741741579c 100644
--- a/tools/inc/tools/wldcrd.hxx
+++ b/tools/inc/tools/wldcrd.hxx
@@ -29,7 +29,6 @@
#define _WLDCRD_HXX
#include "tools/toolsdllapi.h"
-#include <tools/solar.h>
#include <tools/string.hxx>
#include <osl/thread.h>
@@ -63,30 +62,14 @@ public:
return rtl::OStringToOUString(aWildString, osl_getThreadTextEncoding());
}
- sal_Bool Matches( const String& rStr ) const;
-
- sal_Bool operator ==( const String& rString ) const
- { return Matches( rString ); }
- sal_Bool operator !=( const String& rString ) const
- { return !( Matches( rString ) ); }
+ void setGlob(const rtl::OUString& rString)
+ {
+ aWildString = rtl::OUStringToOString(rString, osl_getThreadTextEncoding());
+ }
- WildCard& operator =( const String& rString );
- WildCard& operator =( const WildCard& rWildCard );
+ sal_Bool Matches( const String& rStr ) const;
};
-inline WildCard& WildCard::operator=( const String& rString )
-{
- aWildString = rtl::OUStringToOString(rString, osl_getThreadTextEncoding());
- return *this;
-}
-
-inline WildCard& WildCard::operator=( const WildCard& rWildCard )
-{
- aWildString = rWildCard.aWildString;
- cSepSymbol = rWildCard.cSepSymbol;
- return *this;
-}
-
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/source/fsys/tdir.cxx b/tools/source/fsys/tdir.cxx
index e1057787a3d5..bfdd404f762c 100644
--- a/tools/source/fsys/tdir.cxx
+++ b/tools/source/fsys/tdir.cxx
@@ -250,20 +250,20 @@ void Dir::Construct( DirEntryKind nKindFlags )
ByteString aTempName( GetName(), osl_getThreadTextEncoding() );
if ( aTempName.Search( "*" ) != STRING_NOTFOUND ||
aTempName.Search( "?" ) != STRING_NOTFOUND )
-#if defined( WNT )
{
+#if defined( WNT )
ByteString aTStr(CutName(), osl_getThreadTextEncoding());
char* pBuffer = new char[aTStr.Len()+1];
strcpy( pBuffer, aTStr.GetBuffer() );
CharLowerBuff( pBuffer, aTStr.Len() );
aNameMask = WildCard( String(pBuffer, osl_getThreadTextEncoding()), ';' );
delete [] pBuffer;
- }
#else
- aNameMask = WildCard( CutName(), ';' );
+ aNameMask = WildCard( CutName(), ';' );
+ }
#endif
else
- aNameMask = String("*", osl_getThreadTextEncoding());
+ aNameMask.setGlob(String("*", osl_getThreadTextEncoding()));
}
/*************************************************************************