Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
a2500801
Kaydet (Commit)
a2500801
authored
Ock 01, 2013
tarafından
Jan Holesovsky
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Personas: Read the bitmaps in StyleSettings.
Change-Id: I52b67c82f69059a7d2babf1b49e59f27062cc02c
üst
0c22f3ea
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
118 additions
and
5 deletions
+118
-5
personalization.cxx
cui/source/options/personalization.cxx
+2
-2
settings.hxx
vcl/inc/vcl/settings.hxx
+9
-0
settings.cxx
vcl/source/app/settings.cxx
+107
-3
No files found.
cui/source/options/personalization.cxx
Dosyayı görüntüle @
a2500801
...
@@ -146,7 +146,7 @@ sal_Bool SvxPersonalizationTabPage::FillItemSet( SfxItemSet & )
...
@@ -146,7 +146,7 @@ sal_Bool SvxPersonalizationTabPage::FillItemSet( SfxItemSet & )
aPersona
=
"own"
;
aPersona
=
"own"
;
bool
bModified
=
false
;
bool
bModified
=
false
;
uno
::
Reference
<
uno
::
XComponentContext
>
xContext
=
comphelper
::
getProcessComponentContext
(
);
uno
::
Reference
<
uno
::
XComponentContext
>
xContext
(
comphelper
::
getProcessComponentContext
()
);
if
(
xContext
.
is
()
&&
if
(
xContext
.
is
()
&&
(
aBackground
!=
officecfg
::
Office
::
Common
::
Misc
::
BackgroundImage
::
get
(
xContext
)
||
(
aBackground
!=
officecfg
::
Office
::
Common
::
Misc
::
BackgroundImage
::
get
(
xContext
)
||
m_aBackgroundURL
!=
officecfg
::
Office
::
Common
::
Misc
::
BackgroundImageURL
::
get
(
xContext
)
||
m_aBackgroundURL
!=
officecfg
::
Office
::
Common
::
Misc
::
BackgroundImageURL
::
get
(
xContext
)
||
...
@@ -171,7 +171,7 @@ sal_Bool SvxPersonalizationTabPage::FillItemSet( SfxItemSet & )
...
@@ -171,7 +171,7 @@ sal_Bool SvxPersonalizationTabPage::FillItemSet( SfxItemSet & )
void
SvxPersonalizationTabPage
::
Reset
(
const
SfxItemSet
&
)
void
SvxPersonalizationTabPage
::
Reset
(
const
SfxItemSet
&
)
{
{
uno
::
Reference
<
uno
::
XComponentContext
>
xContext
=
comphelper
::
getProcessComponentContext
(
);
uno
::
Reference
<
uno
::
XComponentContext
>
xContext
(
comphelper
::
getProcessComponentContext
()
);
// background image
// background image
OUString
aBackground
(
"default"
);
OUString
aBackground
(
"default"
);
...
...
vcl/inc/vcl/settings.hxx
Dosyayı görüntüle @
a2500801
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
#include <i18npool/languagetag.hxx>
#include <i18npool/languagetag.hxx>
#include <unotools/syslocale.hxx>
#include <unotools/syslocale.hxx>
class
BitmapEx
;
class
CollatorWrapper
;
class
CollatorWrapper
;
class
LocaleDataWrapper
;
class
LocaleDataWrapper
;
...
@@ -347,6 +348,11 @@ private:
...
@@ -347,6 +348,11 @@ private:
DialogStyle
maDialogStyle
;
DialogStyle
maDialogStyle
;
FrameStyle
maFrameStyle
;
FrameStyle
maFrameStyle
;
const
void
*
mpFontOptions
;
const
void
*
mpFontOptions
;
OUString
maPersonaHeaderFooter
;
///< Cache the settings to detect changes.
BitmapEx
*
mpPersonaHeaderBitmap
;
///< Cache the header bitmap.
BitmapEx
*
mpPersonaFooterBitmap
;
///< Cache the footer bitmap.
};
};
#define DEFAULT_WORKSPACE_GRADIENT_START_COLOR Color( 0xa3, 0xae, 0xb8 )
#define DEFAULT_WORKSPACE_GRADIENT_START_COLOR Color( 0xa3, 0xae, 0xb8 )
...
@@ -860,6 +866,9 @@ public:
...
@@ -860,6 +866,9 @@ public:
void
SetFrameStyle
(
const
FrameStyle
&
rStyle
)
void
SetFrameStyle
(
const
FrameStyle
&
rStyle
)
{
CopyData
();
mpData
->
maFrameStyle
=
rStyle
;
}
{
CopyData
();
mpData
->
maFrameStyle
=
rStyle
;
}
const
BitmapEx
*
GetPersonaHeader
()
const
;
const
BitmapEx
*
GetPersonaFooter
()
const
;
void
SetStandardStyles
();
void
SetStandardStyles
();
const
StyleSettings
&
operator
=
(
const
StyleSettings
&
rSet
);
const
StyleSettings
&
operator
=
(
const
StyleSettings
&
rSet
);
...
...
vcl/source/app/settings.cxx
Dosyayı görüntüle @
a2500801
...
@@ -17,9 +17,13 @@
...
@@ -17,9 +17,13 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
*/
#include <officecfg/Office/Common.hxx>
#include <svsys.h>
#include <svsys.h>
#include "comphelper/processfactory.hxx"
#include "comphelper/processfactory.hxx"
#include <rtl/bootstrap.hxx>
#include "tools/debug.hxx"
#include "tools/debug.hxx"
#include <vcl/graphicfilter.hxx>
#include "i18npool/mslangid.hxx"
#include "i18npool/mslangid.hxx"
#include "i18npool/languagetag.hxx"
#include "i18npool/languagetag.hxx"
...
@@ -38,7 +42,7 @@
...
@@ -38,7 +42,7 @@
#include "unotools/confignode.hxx"
#include "unotools/confignode.hxx"
#include "unotools/syslocaleoptions.hxx"
#include "unotools/syslocaleoptions.hxx"
using
::
rtl
::
OUString
;
using
namespace
::
com
::
sun
::
star
;
#include "svdata.hxx"
#include "svdata.hxx"
#include "impimagetree.hxx"
#include "impimagetree.hxx"
...
@@ -198,7 +202,10 @@ sal_Bool MouseSettings::operator ==( const MouseSettings& rSet ) const
...
@@ -198,7 +202,10 @@ sal_Bool MouseSettings::operator ==( const MouseSettings& rSet ) const
// =======================================================================
// =======================================================================
ImplStyleData
::
ImplStyleData
()
ImplStyleData
::
ImplStyleData
()
:
maPersonaHeaderFooter
(),
mpPersonaHeaderBitmap
(
NULL
),
mpPersonaFooterBitmap
(
NULL
)
{
{
mnRefCount
=
1
;
mnRefCount
=
1
;
mnScrollBarSize
=
16
;
mnScrollBarSize
=
16
;
...
@@ -296,7 +303,10 @@ ImplStyleData::ImplStyleData( const ImplStyleData& rData ) :
...
@@ -296,7 +303,10 @@ ImplStyleData::ImplStyleData( const ImplStyleData& rData ) :
maGroupFont
(
rData
.
maGroupFont
),
maGroupFont
(
rData
.
maGroupFont
),
maWorkspaceGradient
(
rData
.
maWorkspaceGradient
),
maWorkspaceGradient
(
rData
.
maWorkspaceGradient
),
maDialogStyle
(
rData
.
maDialogStyle
),
maDialogStyle
(
rData
.
maDialogStyle
),
maFrameStyle
(
rData
.
maFrameStyle
)
maFrameStyle
(
rData
.
maFrameStyle
),
maPersonaHeaderFooter
(
rData
.
maPersonaHeaderFooter
),
mpPersonaHeaderBitmap
(
NULL
),
mpPersonaFooterBitmap
(
NULL
)
{
{
mnRefCount
=
1
;
mnRefCount
=
1
;
mnBorderSize
=
rData
.
mnBorderSize
;
mnBorderSize
=
rData
.
mnBorderSize
;
...
@@ -677,6 +687,100 @@ sal_Bool StyleSettings::GetUseImagesInMenus() const
...
@@ -677,6 +687,100 @@ sal_Bool StyleSettings::GetUseImagesInMenus() const
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
static
BitmapEx
*
readBitmapEx
(
const
OUString
&
rPath
)
{
OUString
aPath
(
rPath
);
rtl
::
Bootstrap
::
expandMacros
(
aPath
);
// import the image
Graphic
aGraphic
;
if
(
GraphicFilter
::
LoadGraphic
(
aPath
,
String
(),
aGraphic
)
!=
GRFILTER_OK
)
return
NULL
;
const
BitmapEx
&
rBitmap
(
aGraphic
.
GetBitmapEx
()
);
if
(
rBitmap
.
IsEmpty
()
)
return
NULL
;
return
new
BitmapEx
(
rBitmap
);
}
enum
WhichPersona
{
PERSONA_HEADER
,
PERSONA_FOOTER
};
/** Update the setting of the Persona header / footer in ImplStyleData */
static
void
setupPersonaHeaderFooter
(
WhichPersona
eWhich
,
OUString
&
rHeaderFooter
,
BitmapEx
*&
pHeaderFooterBitmap
)
{
uno
::
Reference
<
uno
::
XComponentContext
>
xContext
(
comphelper
::
getProcessComponentContext
()
);
if
(
!
xContext
.
is
()
)
return
;
// read from the configuration
OUString
aPersona
(
officecfg
::
Office
::
Common
::
Misc
::
Persona
::
get
(
xContext
)
);
OUString
aPersonaSettings
(
officecfg
::
Office
::
Common
::
Misc
::
PersonaSettings
::
get
(
xContext
)
);
// have the settings changed?
OUString
aOldValue
(
aPersona
+
";"
+
aPersonaSettings
);
if
(
rHeaderFooter
==
aOldValue
)
return
;
rHeaderFooter
=
aOldValue
;
// now read the new values and setup bitmaps
OUString
aHeader
,
aFooter
;
if
(
aPersona
==
"own"
)
{
sal_Int32
nIndex
=
0
;
aHeader
=
aPersonaSettings
.
getToken
(
0
,
';'
,
nIndex
);
if
(
nIndex
>
0
)
aFooter
=
aPersonaSettings
.
getToken
(
0
,
';'
,
nIndex
);
}
else
if
(
aPersona
==
"default"
)
{
aHeader
=
"header.jpg"
;
aFooter
=
"footer.jpg"
;
}
OUString
aName
;
switch
(
eWhich
)
{
case
PERSONA_HEADER
:
aName
=
aHeader
;
break
;
case
PERSONA_FOOTER
:
aName
=
aFooter
;
break
;
}
delete
pHeaderFooterBitmap
;
pHeaderFooterBitmap
=
NULL
;
if
(
!
aName
.
isEmpty
()
)
{
// try the gallery first, then edition, and the program path if
// everything else fails
OUString
gallery
=
"${$BRAND_BASE_DIR/program/"
SAL_CONFIGFILE
(
"bootstrap"
)
"::UserInstallation}"
;
rtl
::
Bootstrap
::
expandMacros
(
gallery
);
gallery
+=
"/user/gallery/personas/"
;
if
(
aPersona
==
"own"
)
pHeaderFooterBitmap
=
readBitmapEx
(
gallery
+
aName
);
if
(
!
pHeaderFooterBitmap
)
pHeaderFooterBitmap
=
readBitmapEx
(
"$BRAND_BASE_DIR/program/edition/"
+
aName
);
if
(
!
pHeaderFooterBitmap
)
pHeaderFooterBitmap
=
readBitmapEx
(
"$BRAND_BASE_DIR/program/"
+
aName
);
}
}
const
BitmapEx
*
StyleSettings
::
GetPersonaHeader
()
const
{
setupPersonaHeaderFooter
(
PERSONA_HEADER
,
mpData
->
maPersonaHeaderFooter
,
mpData
->
mpPersonaHeaderBitmap
);
return
mpData
->
mpPersonaHeaderBitmap
;
}
const
BitmapEx
*
StyleSettings
::
GetPersonaFooter
()
const
{
setupPersonaHeaderFooter
(
PERSONA_FOOTER
,
mpData
->
maPersonaHeaderFooter
,
mpData
->
mpPersonaFooterBitmap
);
return
mpData
->
mpPersonaFooterBitmap
;
}
// -----------------------------------------------------------------------
void
StyleSettings
::
SetStandardStyles
()
void
StyleSettings
::
SetStandardStyles
()
{
{
CopyData
();
CopyData
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment