summaryrefslogtreecommitdiff
path: root/svx/source/engine3d
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2016-11-05 13:28:17 -0500
committerNorbert Thiebaud <nthiebaud@gmail.com>2016-11-05 13:42:40 -0500
commitdb380aab1063e8a5e40111c40ee9f7921aa82601 (patch)
treef5057dfb205a7d7409251742888dfeaf4bfbee61 /svx/source/engine3d
parentee2144aafc5b4be14630f723be9a2bb674671412 (diff)
Reverts a commit series that cripple windows ci.
Revert "SvxShadowTabPage::Construct was removed" f9a2c1c12ecad833c63b894c89d6008907477eb5. Revert "replace OColorPopup with SvxColorWindow" f300754bb1c6a347c92bb9548be7a65237176542. Revert "drop AutoColorInvalid/SID_ATTR_AUTO_COLOR_INVALID" 347c2c334589b18cc62af292674bb3df1dd54b71. Revert "replace last ColorLB use with a listbox of colors" 604b35bf55351751a396e34dcca3f85e75860fd5. Revert "simplify, its just a vector of colors" 351a97ce6bda3075677b59fa1387ba3d1ab17d7a. Revert "replace user draw with an Image of the color" df738e0f8ceedb4bad756960be14d9c41adc165d. Revert "strip down to the used pieces" commit 08d6cd788f2584ce10ab8fa10665245e953c59d9. Revert "move now combined ColorLB to location of last user" a19b18ad7c9eb0197c10e6d7e451ec4542e4bc9e. Revert "fold ColorListBox and ColorLB together" a989a0b1f2b425f05b58d0e44ce2de31c842ed65. Revert "move ColorListBox beside sole thing that uses it" 760a198e697f3070a5e0e029e4eff7be220eb9cd. Revert "extensions leaks out details of Color Selector, patch it up" 8bea644d6117a49405e6426dc97214220fc869d1. Revert "inherit FillAttrLB from ListBox not ColorListBox" d2ce812f1d3a7a2aad89ca0bd11948b63d2db7b0. Revert "unify color selectors" 43bc3031483d172eccd72c3804e2d4fc2ef37de4.
Diffstat (limited to 'svx/source/engine3d')
-rw-r--r--svx/source/engine3d/float3d.cxx191
-rw-r--r--svx/source/engine3d/float3d.src15
2 files changed, 116 insertions, 90 deletions
diff --git a/svx/source/engine3d/float3d.cxx b/svx/source/engine3d/float3d.cxx
index 80d065df7a22..b5ed0de3e87a 100644
--- a/svx/source/engine3d/float3d.cxx
+++ b/svx/source/engine3d/float3d.cxx
@@ -24,7 +24,6 @@
#include <svtools/colrdlg.hxx>
#include <vcl/msgbox.hxx>
#include <sfx2/viewsh.hxx>
-#include <svx/colorbox.hxx>
#include <svx/xflclit.hxx>
#include <svx/svdmodel.hxx>
#include <svx/globl3d.hxx>
@@ -274,20 +273,19 @@ Svx3DWin::Svx3DWin(SfxBindings* pInBindings, SfxChildWindow *pCW, vcl::Window* p
Link<ListBox&,void> aLink2 = LINK( this, Svx3DWin, SelectHdl );
- Link<SvxColorListBox&,void> aLink4 = LINK( this, Svx3DWin, SelectColorHdl );
m_pLbMatFavorites->SetSelectHdl( aLink2 );
- m_pLbMatColor->SetSelectHdl( aLink4 );
- m_pLbMatEmission->SetSelectHdl( aLink4 );
- m_pLbMatSpecular->SetSelectHdl( aLink4 );
- m_pLbLight1->SetSelectHdl( aLink4 );
- m_pLbLight2->SetSelectHdl( aLink4 );
- m_pLbLight3->SetSelectHdl( aLink4 );
- m_pLbLight4->SetSelectHdl( aLink4 );
- m_pLbLight5->SetSelectHdl( aLink4 );
- m_pLbLight6->SetSelectHdl( aLink4 );
- m_pLbLight7->SetSelectHdl( aLink4 );
- m_pLbLight8->SetSelectHdl( aLink4 );
- m_pLbAmbientlight->SetSelectHdl( aLink4 );
+ m_pLbMatColor->SetSelectHdl( aLink2 );
+ m_pLbMatEmission->SetSelectHdl( aLink2 );
+ m_pLbMatSpecular->SetSelectHdl( aLink2 );
+ m_pLbLight1->SetSelectHdl( aLink2 );
+ m_pLbLight2->SetSelectHdl( aLink2 );
+ m_pLbLight3->SetSelectHdl( aLink2 );
+ m_pLbLight4->SetSelectHdl( aLink2 );
+ m_pLbLight5->SetSelectHdl( aLink2 );
+ m_pLbLight6->SetSelectHdl( aLink2 );
+ m_pLbLight7->SetSelectHdl( aLink2 );
+ m_pLbLight8->SetSelectHdl( aLink2 );
+ m_pLbAmbientlight->SetSelectHdl( aLink2 );
m_pLbShademode->SetSelectHdl( aLink2 );
Link<Edit&,void> aLink3 = LINK( this, Svx3DWin, ModifyHdl );
@@ -943,7 +941,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
if( eState != SfxItemState::DONTCARE )
{
aColor = static_cast<const SvxColorItem&>(rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_1)).GetValue();
- SvxColorListBox* pLb = m_pLbLight1;
+ ColorLB* pLb = m_pLbLight1;
if( aColor != pLb->GetSelectEntryColor() )
{
LBSelectColor( pLb, aColor );
@@ -952,7 +950,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
}
else
{
- if (!m_pLbLight1->IsNoSelection())
+ if( m_pLbLight1->GetSelectEntryCount() != 0 )
{
m_pLbLight1->SetNoSelection();
bUpdate = true;
@@ -992,7 +990,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
if( eState != SfxItemState::DONTCARE )
{
aColor = static_cast<const SvxColorItem&>(rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_2)).GetValue();
- SvxColorListBox* pLb = m_pLbLight2;
+ ColorLB* pLb = m_pLbLight2;
if( aColor != pLb->GetSelectEntryColor() )
{
LBSelectColor( pLb, aColor );
@@ -1001,7 +999,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
}
else
{
- if (!m_pLbLight2->IsNoSelection())
+ if( m_pLbLight2->GetSelectEntryCount() != 0 )
{
m_pLbLight2->SetNoSelection();
bUpdate = true;
@@ -1041,7 +1039,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
if( eState != SfxItemState::DONTCARE )
{
aColor = static_cast<const SvxColorItem&>(rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_3)).GetValue();
- SvxColorListBox* pLb = m_pLbLight3;
+ ColorLB* pLb = m_pLbLight3;
if( aColor != pLb->GetSelectEntryColor() )
{
LBSelectColor( pLb, aColor );
@@ -1050,7 +1048,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
}
else
{
- if (!m_pLbLight3->IsNoSelection())
+ if( m_pLbLight3->GetSelectEntryCount() != 0 )
{
m_pLbLight3->SetNoSelection();
bUpdate = true;
@@ -1090,7 +1088,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
if( eState != SfxItemState::DONTCARE )
{
aColor = static_cast<const SvxColorItem&>(rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_4)).GetValue();
- SvxColorListBox* pLb = m_pLbLight4;
+ ColorLB* pLb = m_pLbLight4;
if( aColor != pLb->GetSelectEntryColor() )
{
LBSelectColor( pLb, aColor );
@@ -1099,7 +1097,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
}
else
{
- if (!m_pLbLight4->IsNoSelection())
+ if( m_pLbLight4->GetSelectEntryCount() != 0 )
{
m_pLbLight4->SetNoSelection();
bUpdate = true;
@@ -1139,7 +1137,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
if( eState != SfxItemState::DONTCARE )
{
aColor = static_cast<const SvxColorItem&>(rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_5)).GetValue();
- SvxColorListBox* pLb = m_pLbLight5;
+ ColorLB* pLb = m_pLbLight5;
if( aColor != pLb->GetSelectEntryColor() )
{
LBSelectColor( pLb, aColor );
@@ -1148,7 +1146,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
}
else
{
- if (!m_pLbLight5->IsNoSelection())
+ if( m_pLbLight5->GetSelectEntryCount() != 0 )
{
m_pLbLight5->SetNoSelection();
bUpdate = true;
@@ -1188,7 +1186,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
if( eState != SfxItemState::DONTCARE )
{
aColor = static_cast<const SvxColorItem&>(rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_6)).GetValue();
- SvxColorListBox* pLb = m_pLbLight6;
+ ColorLB* pLb = m_pLbLight6;
if( aColor != pLb->GetSelectEntryColor() )
{
LBSelectColor( pLb, aColor );
@@ -1197,7 +1195,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
}
else
{
- if (!m_pLbLight6->IsNoSelection())
+ if( m_pLbLight6->GetSelectEntryCount() != 0 )
{
m_pLbLight6->SetNoSelection();
bUpdate = true;
@@ -1237,7 +1235,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
if( eState != SfxItemState::DONTCARE )
{
aColor = static_cast<const SvxColorItem&>(rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_7)).GetValue();
- SvxColorListBox* pLb = m_pLbLight7;
+ ColorLB* pLb = m_pLbLight7;
if( aColor != pLb->GetSelectEntryColor() )
{
LBSelectColor( pLb, aColor );
@@ -1246,7 +1244,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
}
else
{
- if (!m_pLbLight7->IsNoSelection())
+ if( m_pLbLight7->GetSelectEntryCount() != 0 )
{
m_pLbLight7->SetNoSelection();
bUpdate = true;
@@ -1286,7 +1284,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
if( eState != SfxItemState::DONTCARE )
{
aColor = static_cast<const SvxColorItem&>(rAttrs.Get(SDRATTR_3DSCENE_LIGHTCOLOR_8)).GetValue();
- SvxColorListBox* pLb = m_pLbLight8;
+ ColorLB* pLb = m_pLbLight8;
if( aColor != pLb->GetSelectEntryColor() )
{
LBSelectColor( pLb, aColor );
@@ -1295,7 +1293,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
}
else
{
- if (!m_pLbLight8->IsNoSelection())
+ if( m_pLbLight8->GetSelectEntryCount() != 0 )
{
m_pLbLight8->SetNoSelection();
bUpdate = true;
@@ -1335,7 +1333,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
if( eState != SfxItemState::DONTCARE )
{
aColor = static_cast<const SvxColorItem&>(rAttrs.Get(SDRATTR_3DSCENE_AMBIENTCOLOR)).GetValue();
- SvxColorListBox* pLb = m_pLbAmbientlight;
+ ColorLB* pLb = m_pLbAmbientlight;
if( aColor != pLb->GetSelectEntryColor() )
{
LBSelectColor( pLb, aColor );
@@ -1344,7 +1342,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
}
else
{
- if (!m_pLbAmbientlight->IsNoSelection())
+ if( m_pLbAmbientlight->GetSelectEntryCount() != 0 )
{
m_pLbAmbientlight->SetNoSelection();
bUpdate = true;
@@ -1495,7 +1493,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
if( eState != SfxItemState::DONTCARE )
{
aColor = static_cast<const XFillColorItem&>(rAttrs.Get(XATTR_FILLCOLOR)).GetColorValue();
- SvxColorListBox* pLb = m_pLbMatColor;
+ ColorLB* pLb = m_pLbMatColor;
if( aColor != pLb->GetSelectEntryColor() )
{
LBSelectColor( pLb, aColor );
@@ -1504,7 +1502,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
}
else
{
- if (!m_pLbMatColor->IsNoSelection())
+ if( m_pLbMatColor->GetSelectEntryCount() != 0 )
{
m_pLbMatColor->SetNoSelection();
bUpdate = true;
@@ -1516,7 +1514,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
if( eState != SfxItemState::DONTCARE )
{
aColor = static_cast<const SvxColorItem&>(rAttrs.Get(SDRATTR_3DOBJ_MAT_EMISSION)).GetValue();
- SvxColorListBox* pLb = m_pLbMatEmission;
+ ColorLB* pLb = m_pLbMatEmission;
if( aColor != pLb->GetSelectEntryColor() )
{
LBSelectColor( pLb, aColor );
@@ -1525,7 +1523,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
}
else
{
- if (!m_pLbMatEmission->IsNoSelection())
+ if( m_pLbMatEmission->GetSelectEntryCount() != 0 )
{
m_pLbMatEmission->SetNoSelection();
bUpdate = true;
@@ -1537,7 +1535,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
if( eState != SfxItemState::DONTCARE )
{
aColor = static_cast<const SvxColorItem&>(rAttrs.Get(SDRATTR_3DOBJ_MAT_SPECULAR)).GetValue();
- SvxColorListBox* pLb = m_pLbMatSpecular;
+ ColorLB* pLb = m_pLbMatSpecular;
if( aColor != pLb->GetSelectEntryColor() )
{
LBSelectColor( pLb, aColor );
@@ -1546,7 +1544,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
}
else
{
- if (!m_pLbMatSpecular->IsNoSelection())
+ if( m_pLbMatSpecular->GetSelectEntryCount() != 0 )
{
m_pLbMatSpecular->SetNoSelection();
bUpdate = true;
@@ -1854,7 +1852,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
const SfxItemSet aLightItemSet(m_pCtlLightPreview->GetSvx3DLightControl().Get3DAttributes());
// Light 1 color
- if (!m_pLbLight1->IsNoSelection())
+ if( m_pLbLight1->GetSelectEntryCount() )
{
aColor = m_pLbLight1->GetSelectEntryColor();
rAttrs.Put(makeSvx3DLightcolor1Item(aColor));
@@ -1879,7 +1877,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
// Light 2 color
- if (!m_pLbLight2->IsNoSelection())
+ if( m_pLbLight2->GetSelectEntryCount() )
{
aColor = m_pLbLight2->GetSelectEntryColor();
rAttrs.Put(makeSvx3DLightcolor2Item(aColor));
@@ -1903,7 +1901,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTON_2);
// Light 3 color
- if (!m_pLbLight3->IsNoSelection())
+ if( m_pLbLight3->GetSelectEntryCount() )
{
aColor = m_pLbLight3->GetSelectEntryColor();
rAttrs.Put(makeSvx3DLightcolor3Item(aColor));
@@ -1927,7 +1925,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTON_3);
// Light 4 color
- if (!m_pLbLight4->IsNoSelection())
+ if( m_pLbLight4->GetSelectEntryCount() )
{
aColor = m_pLbLight4->GetSelectEntryColor();
rAttrs.Put(makeSvx3DLightcolor4Item(aColor));
@@ -1951,7 +1949,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTON_4);
// Light 5 color
- if (!m_pLbLight5->IsNoSelection())
+ if( m_pLbLight5->GetSelectEntryCount() )
{
aColor = m_pLbLight5->GetSelectEntryColor();
rAttrs.Put(makeSvx3DLightcolor5Item(aColor));
@@ -1975,7 +1973,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTON_5);
// Light 6 color
- if (!m_pLbLight6->IsNoSelection())
+ if( m_pLbLight6->GetSelectEntryCount() )
{
aColor = m_pLbLight6->GetSelectEntryColor();
rAttrs.Put(makeSvx3DLightcolor6Item(aColor));
@@ -1999,7 +1997,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTON_6);
// Light 7 color
- if (!m_pLbLight7->IsNoSelection())
+ if( m_pLbLight7->GetSelectEntryCount() )
{
aColor = m_pLbLight7->GetSelectEntryColor();
rAttrs.Put(makeSvx3DLightcolor7Item(aColor));
@@ -2023,7 +2021,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTON_7);
// Light 8 color
- if (!m_pLbLight8->IsNoSelection())
+ if( m_pLbLight8->GetSelectEntryCount() )
{
aColor = m_pLbLight8->GetSelectEntryColor();
rAttrs.Put(makeSvx3DLightcolor8Item(aColor));
@@ -2047,7 +2045,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
rAttrs.InvalidateItem(SDRATTR_3DSCENE_LIGHTON_8);
// Ambient light
- if (!m_pLbAmbientlight->IsNoSelection())
+ if( m_pLbAmbientlight->GetSelectEntryCount() )
{
aColor = m_pLbAmbientlight->GetSelectEntryColor();
rAttrs.Put(makeSvx3DAmbientcolorItem(aColor));
@@ -2123,7 +2121,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
// Material
// Object color
- if (!m_pLbMatColor->IsNoSelection())
+ if( m_pLbMatColor->GetSelectEntryCount() )
{
aColor = m_pLbMatColor->GetSelectEntryColor();
rAttrs.Put( XFillColorItem( "", aColor) );
@@ -2134,7 +2132,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
}
// luminous color
- if (!m_pLbMatEmission->IsNoSelection())
+ if( m_pLbMatEmission->GetSelectEntryCount() )
{
aColor = m_pLbMatEmission->GetSelectEntryColor();
rAttrs.Put(makeSvx3DMaterialEmissionItem(aColor));
@@ -2143,7 +2141,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
rAttrs.InvalidateItem(SDRATTR_3DOBJ_MAT_EMISSION);
// Specular
- if (!m_pLbMatSpecular->IsNoSelection())
+ if( m_pLbMatSpecular->GetSelectEntryCount() )
{
aColor = m_pLbMatSpecular->GetSelectEntryColor();
rAttrs.Put(makeSvx3DMaterialSpecularItem(aColor));
@@ -2304,7 +2302,7 @@ IMPL_LINK( Svx3DWin, ClickViewTypeHdl, Button*, pBtn, void )
{
m_pFLLight->Show();
- SvxColorListBox* pLb = GetLbByButton();
+ ColorLB* pLb = GetLbByButton();
if( pLb )
pLb->Show();
@@ -2390,7 +2388,7 @@ IMPL_LINK( Svx3DWin, ClickHdl, Button *, pButton, void )
pBtn == m_pBtnLight8 )
{
// Lighting
- SvxColorListBox* pLb = GetLbByButton( pBtn );
+ ColorLB* pLb = GetLbByButton( pBtn );
pLb->Show();
if( pBtn->IsChecked() )
@@ -2515,7 +2513,7 @@ IMPL_LINK( Svx3DWin, ClickHdl, Button *, pButton, void )
IMPL_LINK( Svx3DWin, ClickColorHdl, Button *, pBtn, void)
{
SvColorDialog aColorDlg( this );
- SvxColorListBox* pLb;
+ ColorLB* pLb;
if( pBtn == m_pBtnLightColor )
pLb = GetLbByButton();
@@ -2534,11 +2532,12 @@ IMPL_LINK( Svx3DWin, ClickColorHdl, Button *, pBtn, void)
if( aColorDlg.Execute() == RET_OK )
{
aColor = aColorDlg.GetColor();
- LBSelectColor(pLb, aColor);
- SelectColorHdl(*pLb);
+ if( LBSelectColor( pLb, aColor ) )
+ SelectHdl( *pLb );
}
}
+
IMPL_LINK( Svx3DWin, SelectHdl, ListBox&, rListBox, void )
{
bool bUpdatePreview = false;
@@ -2605,20 +2604,9 @@ IMPL_LINK( Svx3DWin, SelectHdl, ListBox&, rListBox, void )
bUpdatePreview = true;
}
- else if (&rListBox == m_pLbShademode)
- bUpdatePreview = true;
-
- if( bUpdatePreview )
- UpdatePreview();
-}
-
-IMPL_LINK( Svx3DWin, SelectColorHdl, SvxColorListBox&, rListBox, void )
-{
- bool bUpdatePreview = false;
-
- if( &rListBox == m_pLbMatColor ||
- &rListBox == m_pLbMatEmission ||
- &rListBox == m_pLbMatSpecular )
+ else if( &rListBox == m_pLbMatColor ||
+ &rListBox == m_pLbMatEmission ||
+ &rListBox == m_pLbMatSpecular )
{
m_pLbMatFavorites->SelectEntryPos( 0 );
bUpdatePreview = true;
@@ -2639,6 +2627,8 @@ IMPL_LINK( Svx3DWin, SelectColorHdl, SvxColorListBox&, rListBox, void )
{
bUpdatePreview = true;
}
+ else if (&rListBox == m_pLbShademode)
+ bUpdatePreview = true;
if( bUpdatePreview )
UpdatePreview();
@@ -2675,7 +2665,7 @@ IMPL_LINK( Svx3DWin, ModifyHdl, Edit&, rField, void )
void Svx3DWin::ClickLight(PushButton& rBtn)
{
sal_uInt16 nLightSource = GetLightSource( &rBtn );
- SvxColorListBox* pLb = GetLbByButton( &rBtn );
+ ColorLB* pLb = GetLbByButton( &rBtn );
Color aColor( pLb->GetSelectEntryColor() );
SfxItemSet aLightItemSet(m_pCtlLightPreview->GetSvx3DLightControl().Get3DAttributes());
const bool bOnOff(GetUILightState( static_cast<const ImageButton&>(rBtn) ));
@@ -2766,29 +2756,36 @@ IMPL_LINK_NOARG(Svx3DWin, ChangeSelectionCallbackHdl, SvxLightCtl3D*, void)
}
}
-namespace
-{
- OUString lcl_makeColorName(const Color& rColor)
- {
- OUString aStr = SVX_RESSTR(RID_SVXFLOAT3D_FIX_R) +
- OUString::number(rColor.GetRed()) +
- " " +
- SVX_RESSTR(RID_SVXFLOAT3D_FIX_G) +
- OUString::number(rColor.GetGreen()) +
- " " +
- SVX_RESSTR(RID_SVXFLOAT3D_FIX_B) +
- OUString::number(rColor.GetBlue());
- return aStr;
- }
-}
// Method to ensure that the LB is also associated with a color
-void Svx3DWin::LBSelectColor( SvxColorListBox* pLb, const Color& rColor )
+// returns true if color was added
+
+bool Svx3DWin::LBSelectColor( ColorLB* pLb, const Color& rColor )
{
+ bool bRet = false;
+
pLb->SetNoSelection();
- pLb->SelectEntry(std::make_pair(rColor, lcl_makeColorName(rColor)));
+ pLb->SelectEntry( rColor );
+ if( pLb->GetSelectEntryCount() == 0 )
+ {
+ OUString aStr(SVX_RESSTR(RID_SVXFLOAT3D_FIX_R));
+
+ aStr += OUString::number((sal_Int32)rColor.GetRed());
+ aStr += " ";
+ aStr += SVX_RESSTR(RID_SVXFLOAT3D_FIX_G);
+ aStr += OUString::number((sal_Int32)rColor.GetGreen());
+ aStr += " ";
+ aStr += SVX_RESSTR(RID_SVXFLOAT3D_FIX_B);
+ aStr += OUString::number((sal_Int32)rColor.GetBlue());
+
+ const sal_Int32 nPos = pLb->InsertEntry( rColor, aStr );
+ pLb->SelectEntryPos( nPos );
+ bRet = true;
+ }
+ return bRet;
}
+
void Svx3DWin::UpdatePreview()
{
if( pModel == nullptr )
@@ -2811,8 +2808,22 @@ void Svx3DWin::DocumentReload()
mpRemember2DAttributes = nullptr;
}
-void Svx3DWin::InitColorLB()
+
+void Svx3DWin::InitColorLB( const SdrModel* pDoc )
{
+ m_pLbLight1->Fill( pDoc->GetColorList() );
+ m_pLbLight2->CopyEntries( *m_pLbLight1 );
+ m_pLbLight3->CopyEntries( *m_pLbLight1 );
+ m_pLbLight4->CopyEntries( *m_pLbLight1 );
+ m_pLbLight5->CopyEntries( *m_pLbLight1 );
+ m_pLbLight6->CopyEntries( *m_pLbLight1 );
+ m_pLbLight7->CopyEntries( *m_pLbLight1 );
+ m_pLbLight8->CopyEntries( *m_pLbLight1 );
+ m_pLbAmbientlight->CopyEntries( *m_pLbLight1 );
+ m_pLbMatColor->CopyEntries( *m_pLbLight1 );
+ m_pLbMatEmission->CopyEntries( *m_pLbLight1 );
+ m_pLbMatSpecular->CopyEntries( *m_pLbLight1 );
+
// First...
Color aColWhite( COL_WHITE );
Color aColBlack( COL_BLACK );
@@ -2877,9 +2888,9 @@ sal_uInt16 Svx3DWin::GetLightSource( const PushButton* pBtn )
};
-SvxColorListBox* Svx3DWin::GetLbByButton( const PushButton* pBtn )
+ColorLB* Svx3DWin::GetLbByButton( const PushButton* pBtn )
{
- SvxColorListBox* pLb = nullptr;
+ ColorLB* pLb = nullptr;
if( pBtn == nullptr )
{
diff --git a/svx/source/engine3d/float3d.src b/svx/source/engine3d/float3d.src
index 43a48855ae25..734117060173 100644
--- a/svx/source/engine3d/float3d.src
+++ b/svx/source/engine3d/float3d.src
@@ -41,6 +41,21 @@ String RID_SVXFLOAT3D_FAVORITE
Text [ en-US ] = "Favorite";
};
+String RID_SVXFLOAT3D_FIX_X
+{
+ Text [ en-US ] = "X";
+};
+
+String RID_SVXFLOAT3D_FIX_Y
+{
+ Text [ en-US ] = "Y";
+};
+
+String RID_SVXFLOAT3D_FIX_Z
+{
+ Text [ en-US ] = "Z";
+};
+
String RID_SVXFLOAT3D_FIX_R
{
Text [ en-US ] = "R:";