svx: prefix members of GalleryThemeEntry

See tdf#94879 for motivation.

Change-Id: I6a551ab7cb6d6a0595d93703d6a99e5d9e6b2abc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182416
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
This commit is contained in:
Miklos Vajna
2025-03-03 08:07:40 +01:00
parent 35d9ec3e59
commit 509b6d19d4
2 changed files with 31 additions and 31 deletions

View File

@@ -41,11 +41,11 @@ class SVXCORE_DLLPUBLIC GalleryThemeEntry
private: private:
std::unique_ptr<GalleryFileStorageEntry> mpGalleryStorageEngineEntry; std::unique_ptr<GalleryFileStorageEntry> mpGalleryStorageEngineEntry;
OUString aName; OUString maName;
sal_uInt32 nId; sal_uInt32 mnId;
bool bReadOnly; bool mbReadOnly;
bool bModified; bool mbModified;
bool bThemeNameFromResource; bool mbThemeNameFromResource;
public: public:
GalleryThemeEntry( bool bCreateUniqueURL, GalleryThemeEntry( bool bCreateUniqueURL,
@@ -61,20 +61,20 @@ public:
std::unique_ptr<GalleryFileStorage> createGalleryStorageEngine(GalleryObjectCollection& mrGalleryObjectCollection); std::unique_ptr<GalleryFileStorage> createGalleryStorageEngine(GalleryObjectCollection& mrGalleryObjectCollection);
const OUString& GetThemeName() const { return aName; } const OUString& GetThemeName() const { return maName; }
bool IsReadOnly() const { return bReadOnly; } bool IsReadOnly() const { return mbReadOnly; }
bool IsDefault() const; bool IsDefault() const;
bool IsHidden() const { return aName.match("private://gallery/hidden/"); } bool IsHidden() const { return maName.match("private://gallery/hidden/"); }
bool IsModified() const { return bModified; } bool IsModified() const { return mbModified; }
void SetModified( bool bSet ) { bModified = ( bSet && !IsReadOnly() ); } void SetModified( bool bSet ) { mbModified = ( bSet && !IsReadOnly() ); }
void SetName( const OUString& rNewName ); void SetName( const OUString& rNewName );
bool IsNameFromResource() const { return bThemeNameFromResource; } bool IsNameFromResource() const { return mbThemeNameFromResource; }
sal_uInt32 GetId() const { return nId; } sal_uInt32 GetId() const { return mnId; }
void SetId( sal_uInt32 nNewId, bool bResetThemeName ); void SetId( sal_uInt32 nNewId, bool bResetThemeName );

View File

@@ -112,9 +112,9 @@ GalleryThemeEntry::GalleryThemeEntry( bool bCreateUniqueURL,
const INetURLObject& rBaseURL, const OUString& rName, const INetURLObject& rBaseURL, const OUString& rName,
bool _bReadOnly, bool _bNewFile, bool _bReadOnly, bool _bNewFile,
sal_uInt32 _nId, bool _bThemeNameFromResource ) : sal_uInt32 _nId, bool _bThemeNameFromResource ) :
nId ( _nId ), mnId ( _nId ),
bReadOnly ( _bReadOnly ), mbReadOnly ( _bReadOnly ),
bThemeNameFromResource ( _bThemeNameFromResource ) mbThemeNameFromResource ( _bThemeNameFromResource )
{ {
INetURLObject aURL( rBaseURL ); INetURLObject aURL( rBaseURL );
DBG_ASSERT( aURL.GetProtocol() != INetProtocol::NotValid, "invalid URL" ); DBG_ASSERT( aURL.GetProtocol() != INetProtocol::NotValid, "invalid URL" );
@@ -129,38 +129,38 @@ GalleryThemeEntry::GalleryThemeEntry( bool bCreateUniqueURL,
SetModified( _bNewFile ); SetModified( _bNewFile );
aName = mpGalleryStorageEngineEntry->ReadStrFromIni( u"name" ); maName = mpGalleryStorageEngineEntry->ReadStrFromIni( u"name" );
// This is awful - we shouldn't use these resources if we // This is awful - we shouldn't use these resources if we
// possibly can avoid them // possibly can avoid them
if( aName.isEmpty() && nId && bThemeNameFromResource ) if( maName.isEmpty() && mnId && mbThemeNameFromResource )
{ {
//some of these are supposed to *not* be localized //some of these are supposed to *not* be localized
//so catch them before looking up the resource //so catch them before looking up the resource
for (size_t i = 0; i < SAL_N_ELEMENTS(aUnlocalized); ++i) for (size_t i = 0; i < SAL_N_ELEMENTS(aUnlocalized); ++i)
{ {
if (aUnlocalized[i].first == nId) if (aUnlocalized[i].first == mnId)
{ {
aName = aUnlocalized[i].second; maName = aUnlocalized[i].second;
break; break;
} }
} }
//look up the rest of the ids in string resources //look up the rest of the ids in string resources
if (aName.isEmpty()) if (maName.isEmpty())
{ {
for (size_t i = 0; i < SAL_N_ELEMENTS(aLocalized); ++i) for (size_t i = 0; i < SAL_N_ELEMENTS(aLocalized); ++i)
{ {
if (aLocalized[i].first == nId) if (aLocalized[i].first == mnId)
{ {
aName = SvxResId(aLocalized[i].second); maName = SvxResId(aLocalized[i].second);
break; break;
} }
} }
} }
} }
if( aName.isEmpty() ) if( maName.isEmpty() )
aName = rName; maName = rName;
} }
GalleryThemeEntry::~GalleryThemeEntry() GalleryThemeEntry::~GalleryThemeEntry()
@@ -178,7 +178,7 @@ GalleryTheme* GalleryThemeEntry::createGalleryTheme(Gallery* pGallery)
std::unique_ptr<GalleryFileStorage> GalleryThemeEntry::createGalleryStorageEngine(GalleryObjectCollection& mrGalleryObjectCollection) std::unique_ptr<GalleryFileStorage> GalleryThemeEntry::createGalleryStorageEngine(GalleryObjectCollection& mrGalleryObjectCollection)
{ {
return mpGalleryStorageEngineEntry->createGalleryStorageEngine(mrGalleryObjectCollection, bReadOnly); return mpGalleryStorageEngineEntry->createGalleryStorageEngine(mrGalleryObjectCollection, mbReadOnly);
} }
void GalleryTheme::InsertAllThemes(weld::ComboBox& rListBox) void GalleryTheme::InsertAllThemes(weld::ComboBox& rListBox)
@@ -192,19 +192,19 @@ void GalleryTheme::InsertAllThemes(weld::ComboBox& rListBox)
void GalleryThemeEntry::SetName( const OUString& rNewName ) void GalleryThemeEntry::SetName( const OUString& rNewName )
{ {
if( aName != rNewName ) if( maName != rNewName )
{ {
aName = rNewName; maName = rNewName;
SetModified( true ); SetModified( true );
bThemeNameFromResource = false; mbThemeNameFromResource = false;
} }
} }
void GalleryThemeEntry::SetId( sal_uInt32 nNewId, bool bResetThemeName ) void GalleryThemeEntry::SetId( sal_uInt32 nNewId, bool bResetThemeName )
{ {
nId = nNewId; mnId = nNewId;
SetModified( true ); SetModified( true );
bThemeNameFromResource = ( nId && bResetThemeName ); mbThemeNameFromResource = ( mnId && bResetThemeName );
} }
void GalleryThemeEntry::removeTheme() void GalleryThemeEntry::removeTheme()
@@ -721,7 +721,7 @@ void Gallery::ReleaseTheme( GalleryTheme* pTheme, SfxListener& rListener )
bool GalleryThemeEntry::IsDefault() const bool GalleryThemeEntry::IsDefault() const
{ {
return nId > 0 && nId != GALLERY_THEME_MYTHEME; return mnId > 0 && mnId != GALLERY_THEME_MYTHEME;
} }
GalleryStorageLocations& GalleryThemeEntry::getGalleryStorageLocations() const GalleryStorageLocations& GalleryThemeEntry::getGalleryStorageLocations() const