summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorKrisztian Pinter <pin.terminator@gmail.com>2014-06-16 21:52:12 +0200
committerKrisztian Pinter <pin.terminator@gmail.com>2014-07-25 17:09:07 +0200
commitef6521a1833bf1f1a12da8ad012783be112dbf3a (patch)
tree46332f06961988a710c0b6a8983a7a5c2ac39489 /svx
parent0497864bd4f603605997938d504ef9598623e713 (diff)
Add writer document font colors to color palettes
Change-Id: If3fedc45586eee068c40e92da87d5d550a456a64
Diffstat (limited to 'svx')
-rw-r--r--svx/source/tbxctrls/colorwindow.hxx1
-rw-r--r--svx/source/tbxctrls/tbcontrl.cxx15
2 files changed, 15 insertions, 1 deletions
diff --git a/svx/source/tbxctrls/colorwindow.hxx b/svx/source/tbxctrls/colorwindow.hxx
index 3aad292a7071..6ed74f31c115 100644
--- a/svx/source/tbxctrls/colorwindow.hxx
+++ b/svx/source/tbxctrls/colorwindow.hxx
@@ -41,6 +41,7 @@ class SvxColorWindow_Impl : public SfxPopupWindow
private:
const sal_uInt16 theSlotId;
SvxColorValueSet aColorSet;
+ SvxColorValueSet aDocColorSet;
OUString maCommand;
Link maSelectedLink;
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 5728791bf83e..c802aa6c5777 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -1025,7 +1025,8 @@ SvxColorWindow_Impl::SvxColorWindow_Impl( const OUString& rCommand,
Window* pParentWindow ):
SfxPopupWindow( nSlotId, rFrame, pParentWindow, WinBits( WB_STDPOPUP | WB_OWNERDRAWDECORATION ) ),
theSlotId( nSlotId ),
- aColorSet( this, WinBits( WB_ITEMBORDER | WB_NAMEFIELD | WB_3DLOOK | WB_NO_DIRECTSELECT) ),
+ aColorSet ( this, WinBits( WB_ITEMBORDER | WB_NAMEFIELD | WB_3DLOOK | WB_NO_DIRECTSELECT) ),
+ aDocColorSet( this, WinBits( WB_ITEMBORDER | WB_NAMEFIELD | WB_3DLOOK | WB_NO_DIRECTSELECT) ),
maCommand( rCommand )
{
@@ -1034,8 +1035,20 @@ SvxColorWindow_Impl::SvxColorWindow_Impl( const OUString& rCommand,
XColorListRef pColorList;
if ( pDocSh )
+ {
if ( 0 != ( pItem = pDocSh->GetItem( SID_COLOR_TABLE ) ) )
pColorList = ( (SvxColorListItem*)pItem )->GetColorList();
+//-------- Add doc colors to palette
+ XColorEntry* pEntry;
+ std::vector<Color> aColors = pDocSh->GetDocColors();
+ for( unsigned int i = 0; i < aColors.size(); ++i )
+ {
+ pEntry = new XColorEntry( aColors[i],
+ "Document Color " + OUString::number(i) );
+ pColorList->Insert( pEntry, pColorList->Count() );
+ }
+//---------
+ }
if ( !pColorList.is() )
pColorList = XColorList::CreateStdColorList();