50#include <com/sun/star/awt/FontDescriptor.hpp>
51#include <com/sun/star/table/BorderLine2.hpp>
52#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
53#include <com/sun/star/lang/XServiceInfo.hpp>
54#include <com/sun/star/beans/XPropertySet.hpp>
55#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
56#include <com/sun/star/frame/XDispatchProvider.hpp>
57#include <com/sun/star/frame/XFrame.hpp>
58#include <svx/strings.hrc>
59#include <svx/svxids.hrc>
63#include <editeng/editids.hrc>
89#include <editeng/editrids.hrc>
97#include <officecfg/Office/Common.hxx>
101#include <bitmaps.hlst>
108#include <editeng/editeng.hxx>
110#define MAX_MRU_FONTNAME_ENTRIES 5
112#define COMBO_WIDTH_IN_CHARS 18
114#define MAX_MRU_CURRENCIES 5
116#define INVALID_CURRENCY sal_uInt16(-2)
135 , scriptType(scrptType)
141class SvxStyleBox_Base
144 SvxStyleBox_Base(std::unique_ptr<weld::ComboBox> xWidget, OUString rCommand,
SfxStyleFamily eFamily,
145 const Reference<XFrame>& _xFrame, OUString aClearFormatKey,
148 virtual ~SvxStyleBox_Base()
154 void SetDefaultStyle(
const OUString& rDefault ) { sDefaultStyle = rDefault; }
156 int get_count()
const {
return m_xWidget->get_count(); }
158 OUString get_active_text()
const {
return m_xWidget->get_active_text(); }
160 void append_text(
const OUString& rStr)
166 void insert_separator(
int pos,
const OUString& rId)
171 void set_active_or_entry_text(
const OUString& rText)
173 const int nFound =
m_xWidget->find_text(rText);
180 void set_active(
int nActive)
198 m_nMaxUserDrawFontWidth = 0;
206 virtual bool DoKeyInput(
const KeyEvent& rKEvt);
209 std::optional<SvxFont> m_oFont;
210 std::optional<SvxFont> m_oCJKFont;
211 std::optional<SvxFont> m_oCTLFont;
224 void Select(
bool bNonTravelSelect);
231 std::unique_ptr<weld::Builder> m_xMenuBuilder;
232 std::unique_ptr<weld::Menu> m_xMenu;
233 std::unique_ptr<weld::ComboBox>
m_xWidget;
236 int m_nMaxUserDrawFontWidth;
237 int m_nLastItemWithMenu;
241 OUString aClearFormatKey;
243 OUString sDefaultStyle;
247 static Color TestColorsVisible(
const Color &FontCol,
const Color &BackCol);
250 DECL_LINK(MenuSelectHdl,
const OUString&,
void);
255 ,
public SvxStyleBox_Base
259 const Reference< XFrame >& _xFrame,
const OUString& rClearFormatKey,
const OUString& rMoreKey,
bool bInSpecialMode,
SvxStyleToolBoxControl& rCtrl);
261 virtual ~SvxStyleBox_Impl()
override
266 virtual void dispose()
override
270 m_xMenuBuilder.reset();
274 virtual bool DoKeyInput(
const KeyEvent& rKEvt)
override;
279 void SetOptimalSize();
282class SvxFontNameBox_Impl;
283class SvxFontNameBox_Base;
285class SvxFontNameToolBoxControl final :
public cppu::ImplInheritanceHelper<svt::ToolboxController,
286 css::lang::XServiceInfo>
289 SvxFontNameToolBoxControl();
292 virtual void SAL_CALL statusChanged(
const css::frame::FeatureStateEvent& rEvent )
override;
295 virtual css::uno::Reference<css::awt::XWindow> SAL_CALL createItemWindow(
const css::uno::Reference<css::awt::XWindow>& rParent)
override;
298 virtual void SAL_CALL
dispose()
override;
307 std::unique_ptr<SvxFontNameBox_Base> m_xWeldBox;
308 SvxFontNameBox_Base* m_pBox;
314 SvxFontNameBox_Base& m_rBox;
316 virtual void setProperty(
const css::uno::Any &rProperty)
override;
325class SvxFontNameBox_Base
329 FontOptionsListener m_aWYSIWYG;
330 FontOptionsListener m_aHistory;
333 SvxFontNameToolBoxControl& m_rCtrl;
337 ::std::unique_ptr<FontList> m_aOwnFontList;
342 bool mbCheckingUnknownFont;
344 void ReleaseFocus_Impl();
346 void Select(
bool bNonTravelSelect);
350 Sequence< PropertyValue > aArgs;
351 const Reference<XDispatchProvider> xProvider(
m_xFrame, UNO_QUERY);
355 bool CheckFontIsAvailable(std::u16string_view fontname);
356 void CheckAndMarkUnknownFont();
359 SvxFontNameBox_Base(std::unique_ptr<weld::ComboBox> xWidget,
const Reference<XFrame>& rFrame,
360 SvxFontNameToolBoxControl& rCtrl);
361 virtual ~SvxFontNameBox_Base()
367 void Update(
const css::awt::FontDescriptor* pFontDesc );
368 sal_uInt16 GetListCount()
const {
return nFtCount; }
376 void SetOwnFontList(::std::unique_ptr<FontList> && _aOwnFontList) { m_aOwnFontList = std::move(_aOwnFontList); }
378 virtual void set_sensitive(
bool bSensitive)
383 void set_active_or_entry_text(
const OUString& rText);
385 void statusChanged_Impl(
const css::frame::FeatureStateEvent& rEvent);
387 virtual bool DoKeyInput(
const KeyEvent& rKEvt);
389 void EnableControls();
399void FontOptionsListener::setProperty(
const css::uno::Any &rProperty)
402 m_rBox.EnableControls();
406 ,
public SvxFontNameBox_Base
417 void SetOptimalSize();
419 virtual bool DoKeyInput(
const KeyEvent& rKEvt)
override;
423 const Reference<XFrame>& rFrame, SvxFontNameToolBoxControl& rCtrl);
425 virtual void dispose()
override
431 virtual ~SvxFontNameBox_Impl()
override
436 virtual Reference< css::accessibility::XAccessible >
CreateAccessible()
override;
438 virtual void set_sensitive(
bool bSensitive)
override
450class SvxFrmValueSet_Impl final :
public ValueSet
453 sal_uInt16 nModifier;
462 SvxFrmValueSet_Impl()
467 sal_uInt16 GetModifier()
const {
return nModifier;}
474class SvxFrameToolBoxControl;
480 std::unique_ptr<SvxFrmValueSet_Impl> mxFrameSet;
481 std::unique_ptr<weld::CustomWeld> mxFrameSetWin;
482 std::vector<std::pair<BitmapEx, OUString>> aImgVec;
486 void InitImageList();
487 void CalcSizeValueSet();
490 void SetDiagonalDownBorder(
const SvxLineItem& dDownLineItem);
491 void SetDiagonalUpBorder(
const SvxLineItem& dUpLineItem);
494 SvxFrameWindow_Impl(SvxFrameToolBoxControl* pControl,
weld::Widget* pParent);
497 mxFrameSet->GrabFocus();
500 virtual void statusChanged(
const css::frame::FeatureStateEvent& rEvent )
override;
506 explicit SvxFrameToolBoxControl(
const css::uno::Reference< css::uno::XComponentContext >& rContext );
509 virtual void SAL_CALL initialize(
const css::uno::Sequence< css::uno::Any >& rArguments )
override;
515 virtual void SAL_CALL execute(sal_Int16 nKeyModifier)
override;
521 class LineListBox final :
public ValueSet
534 return UpdateEntries( nOldWidth );
537 void SetNone(
const OUString& sNone )
545 ColorFunc pColor1Fn = &sameColor,
546 ColorFunc pColor2Fn = &sameColor,
547 ColorDistFunc pColorDistFn = &sameDistColor);
553 void SetSourceUnit(
FieldUnit eNewUnit ) { eSourceUnit = eNewUnit; }
555 const Color& GetColor()
const {
return aColor; }
564 void UpdatePaintLineColor();
567 sal_Int32 GetStylePos( sal_Int32 nListPos,
tools::Long nWidth );
569 const Color& GetPaintColor()
const
574 Color GetColorLine1( sal_Int32 nPos );
575 Color GetColorLine2( sal_Int32 nPos );
576 Color GetColorDist( sal_Int32 nPos );
578 LineListBox(
const LineListBox& ) =
delete;
579 LineListBox&
operator =(
const LineListBox& ) =
delete;
581 std::vector<std::unique_ptr<ImpLineListData>> m_vLineList;
594 size_t nPos = GetSelectItemPos();
595 if (nPos != VALUESET_ITEM_NOTFOUND)
597 if (!m_sNone.isEmpty())
599 nStyle = GetEntryStyle( nPos );
609 auto nMinWidth = GetDrawingArea()->get_ref_device().approximate_digit_width() *
COMBO_WIDTH_IN_CHARS;
610 Size aSize(nMinWidth, aTxtSize.Height());
611 aSize.AdjustWidth( -(aTxtSize.Width()) );
612 aSize.AdjustWidth( -6 );
615 if ( eSourceUnit == FieldUnit::POINT )
623 aSize = aVirDev->PixelToLogic( aSize );
625 sal_uInt32
n1 = nLine1;
626 sal_uInt32
n2 = nLine2;
638 if ( nVirHeight > aSize.Height() )
639 aSize.setHeight( nVirHeight );
641 if ( aSize.Width() <= 0 )
644 Size aVirSize = aVirDev->LogicToPixel( aSize );
645 if ( aVirDev->GetOutputSizePixel() != aVirSize )
646 aVirDev->SetOutputSizePixel( aVirSize );
647 aVirDev->SetFillColor( aColorDist );
650 aVirDev->SetFillColor( aColor1 );
652 double y1 = double( n1 ) / 2;
657 double y2 =
n1 + nDist + double( n2 ) / 2;
658 aVirDev->SetFillColor( aColor2 );
661 rBmp = aVirDev->GetBitmapEx(
Point(),
Size( aSize.Width(), n1+nDist+n2 ) );
664 LineListBox::LineListBox()
668 , aColor(
Application::GetSettings().GetStyleSettings().GetWindowTextColor())
672 aVirDev->SetLineColor();
673 aVirDev->SetMapMode(
MapMode( MapUnit::MapTwip ) );
685 UpdatePaintLineColor();
688 sal_Int32 LineListBox::GetStylePos( sal_Int32 nListPos,
tools::Long nWidth )
691 if (!m_sNone.isEmpty())
696 size_t nCount = m_vLineList.size();
697 while ( nPos == -1 && i < nCount )
699 auto&
pData = m_vLineList[
i ];
700 if (
pData->GetMinWidth() <= nWidth )
703 nPos =
static_cast<sal_Int32
>(
i);
712 void LineListBox::InsertEntry(
714 ColorFunc pColor1Fn, ColorFunc pColor2Fn, ColorDistFunc pColorDistFn )
717 rWidthImpl, nStyle, nMinWidth, pColor1Fn, pColor2Fn, pColorDistFn));
723 return pData ?
pData->GetStyle() : SvxBorderLineStyle::NONE;
726 void LineListBox::UpdatePaintLineColor()
731 bool bRet = aNewCol != maPaintCol;
734 maPaintCol = aNewCol;
741 UpdatePaintLineColor( );
743 sal_Int32 nSelEntry = GetSelectItemPos();
744 sal_Int32 nTypePos = GetStylePos( nSelEntry, nOldWidth );
752 if (!m_sNone.isEmpty())
753 InsertItem(nId++,
Image(), m_sNone);
756 sal_uInt16
nCount = m_vLineList.size( );
759 auto&
pData = m_vLineList[
n ];
760 if (
pData->GetMinWidth() <= m_nWidth )
763 ImpGetLine(
pData->GetLine1ForWidth( m_nWidth ),
764 pData->GetLine2ForWidth( m_nWidth ),
765 pData->GetDistForWidth( m_nWidth ),
766 GetColorLine1( GetItemCount( ) ),
767 GetColorLine2( GetItemCount( ) ),
768 GetColorDist( GetItemCount( ) ),
769 pData->GetStyle(), aBmp );
779 else if ( n == nTypePos )
790 Color LineListBox::GetColorLine1( sal_Int32 nPos )
792 sal_Int32 nStyle = GetStylePos( nPos, m_nWidth );
794 return GetPaintColor( );
795 auto&
pData = m_vLineList[ nStyle ];
796 return pData->GetColorLine1( GetColor( ) );
799 Color LineListBox::GetColorLine2( sal_Int32 nPos )
801 sal_Int32 nStyle = GetStylePos( nPos, m_nWidth );
803 return GetPaintColor( );
804 auto&
pData = m_vLineList[ nStyle ];
805 return pData->GetColorLine2( GetColor( ) );
808 Color LineListBox::GetColorDist( sal_Int32 nPos )
812 sal_Int32 nStyle = GetStylePos( nPos, m_nWidth );
815 auto&
pData = m_vLineList[ nStyle ];
816 return pData->GetColorDist( GetColor( ), rResult );
826 std::unique_ptr<LineListBox> m_xLineStyleLb;
827 std::unique_ptr<weld::CustomWeld> m_xLineStyleLbWin;
833 SvxLineWindow_Impl(SvxFrameToolBoxControl* pControl,
weld::Widget* pParent);
836 m_xLineStyleLb->GrabFocus();
849 const OUString& rCommand,
859#define BUTTON_PADDING 10
860#define ITEM_HEIGHT 30
862SvxStyleBox_Base::SvxStyleBox_Base(std::unique_ptr<weld::ComboBox> xWidget,
865 const Reference< XFrame >& _xFrame,
866 OUString _aClearFormatKey,
870 , m_xMenuBuilder(
Application::CreateBuilder(nullptr,
"svx/ui/stylemenu.ui"))
871 , m_xMenu(m_xMenuBuilder->weld_menu(
"menu"))
873 , eStyleFamily( eFamily )
874 , m_nMaxUserDrawFontWidth(0)
875 , m_nLastItemWithMenu(-1)
879 , aClearFormatKey(
std::move( _aClearFormatKey ))
880 , aMoreKey(
std::move( _aMoreKey ))
881 , bInSpecialMode( bInSpec )
883 m_xWidget->connect_changed(
LINK(
this, SvxStyleBox_Base, SelectHdl));
884 m_xWidget->connect_key_press(
LINK(
this, SvxStyleBox_Base, KeyInputHdl));
885 m_xWidget->connect_entry_activate(
LINK(
this, SvxStyleBox_Base, ActivateHdl));
886 m_xWidget->connect_focus_out(
LINK(
this, SvxStyleBox_Base, FocusOutHdl));
887 m_xWidget->connect_get_property_tree(
LINK(
this, SvxStyleBox_Base, DumpAsPropertyTreeHdl));
890 m_xMenu->connect_activate(
LINK(
this, SvxStyleBox_Base, MenuSelectHdl));
892 m_xWidget->connect_custom_get_size(
LINK(
this, SvxStyleBox_Base, CustomGetSizeHdl));
893 m_xWidget->connect_custom_render(
LINK(
this, SvxStyleBox_Base, CustomRenderHdl));
901 CalcOptimalExtraUserWidth(rArg);
905SvxStyleBox_Impl::SvxStyleBox_Impl(
vcl::Window* pParent,
906 const OUString& rCommand,
908 const Reference< XFrame >& _xFrame,
909 const OUString& rClearFormatKey,
910 const OUString& rMoreKey,
913 , SvxStyleBox_Base(m_xBuilder->weld_combo_box(
"applystyle"), rCommand, eFamily, _xFrame,
914 rClearFormatKey, rMoreKey, bInSpec, rCtrl)
918 set_id(
"applystyle");
922void SvxStyleBox_Base::ReleaseFocus()
930 m_xFrame->getContainerWindow()->setFocus();
933IMPL_LINK(SvxStyleBox_Base, MenuSelectHdl,
const OUString&, rMenuIdent,
void)
935 if (m_nLastItemWithMenu < 0 || m_nLastItemWithMenu >=
m_xWidget->get_count())
938 OUString sEntry =
m_xWidget->get_text(m_nLastItemWithMenu);
943 sal_Int16( eStyleFamily )) };
945 const Reference<XDispatchProvider> xProvider(
m_xFrame, UNO_QUERY);
946 if (rMenuIdent ==
"update")
950 else if (rMenuIdent ==
"edit")
959 DBG_ASSERT( pViewFrm,
"SvxStyleBox_Base::Select(): no viewframe" );
968 Select(rCombo.changed_by_direct_pick());
977void SvxStyleBox_Base::Select(
bool bNonTravelSelect)
979 if (!bNonTravelSelect)
982 OUString aSearchEntry(
m_xWidget->get_active_text());
983 bool bDoIt =
true, bClear =
false;
986 if( aSearchEntry == aClearFormatKey &&
m_xWidget->get_active() == 0 )
988 aSearchEntry = sDefaultStyle;
991 Sequence< PropertyValue > aEmptyVals;
992 const Reference<XDispatchProvider> xProvider(m_xFrame, UNO_QUERY);
995 else if (aSearchEntry == aMoreKey &&
m_xWidget->get_active() == (
m_xWidget->get_count() - 1))
999 set_active_or_entry_text(
m_xWidget->get_saved_value());
1012 bool bCreateNew =
false;
1016 pStyle = pPool->
First(eStyleFamily);
1017 while ( pStyle && pStyle->
GetName() != aSearchEntry )
1018 pStyle = pPool->
Next();
1037 set_active_or_entry_text(aSearchEntry);
1040 Sequence< PropertyValue > aArgs( 2 );
1041 auto pArgs = aArgs.getArray();
1042 pArgs[0].Value <<= aSearchEntry;
1043 pArgs[1].Name =
"Family";
1044 pArgs[1].Value <<= sal_Int16( eStyleFamily );
1046 const Reference<XDispatchProvider> xProvider(m_xFrame, UNO_QUERY);
1049 pArgs[0].Name =
"Param";
1054 pArgs[0].Name =
"Template";
1061 eStyleFamily = eNewFamily;
1067 set_active_or_entry_text(
m_xWidget->get_saved_value());
1072 return DoKeyInput(rKEvt);
1075bool SvxStyleBox_Base::DoKeyInput(
const KeyEvent& rKEvt)
1077 bool bHandled =
false;
1088 set_active_or_entry_text(
m_xWidget->get_saved_value());
1089 if (!m_rCtrl.IsInSidebar())
1100bool SvxStyleBox_Impl::DoKeyInput(
const KeyEvent& rKEvt)
1102 return SvxStyleBox_Base::DoKeyInput(rKEvt) || ChildKeyInput(rKEvt);
1107 if ( (rDCEvt.
GetType() == DataChangedEventType::SETTINGS) &&
1108 (rDCEvt.
GetFlags() & AllSettingsFlags::STYLE) )
1116void SvxStyleBox_Impl::SetOptimalSize()
1124 SetSizePixel(get_preferred_size());
1129std::vector<ScriptInfo> CheckScript(
const OUString &rStyleName)
1131 assert(!rStyleName.isEmpty());
1133 std::vector<ScriptInfo> aScriptChanges;
1136 aEditEngine.SetText(rStyleName);
1138 auto aScript = aEditEngine.GetScriptType({ 0, 0, 0, 0 });
1139 for (sal_Int32 i = 1;
i <= rStyleName.getLength();
i++)
1141 auto aNextScript = aEditEngine.GetScriptType({ 0,
i, 0,
i });
1142 if (aNextScript != aScript || i == rStyleName.getLength())
1143 aScriptChanges.emplace_back(aScript, i);
1144 aScript = aNextScript;
1147 return aScriptChanges;
1151tools::Rectangle SvxStyleBox_Base::CalcBoundRect(
vcl::RenderContext& rRenderContext,
const OUString &rStyleName, std::vector<ScriptInfo>& rScriptChanges,
double fRatio)
1156 sal_uInt16 nIdx = 0;
1157 sal_Int32 nStart = 0;
1159 size_t nCnt = rScriptChanges.size();
1163 nEnd = rScriptChanges[nIdx].changePos;
1164 aScript = rScriptChanges[nIdx].scriptType;
1168 nEnd = rStyleName.getLength();
1169 aScript = SvtScriptType::LATIN;
1174 auto oFont = (aScript == SvtScriptType::ASIAN) ?
1176 ((aScript == SvtScriptType::COMPLEX) ?
1183 rRenderContext.
SetFont(*oFont);
1188 Size aPixelSize(aFont.GetFontSize());
1189 aPixelSize.setWidth(aPixelSize.Width() * fRatio);
1190 aPixelSize.setHeight(aPixelSize.Height() * fRatio);
1191 aFont.SetFontSize(aPixelSize);
1192 rRenderContext.
SetFont(aFont);
1196 rRenderContext.
GetTextBoundRect(aRect, rStyleName, nStart, nStart, nEnd - nStart);
1197 aTextRect = aTextRect.
Union(aRect);
1201 rRenderContext.
Pop();
1203 if (nIdx >= rScriptChanges.size())
1206 rScriptChanges[nIdx++].textWidth = nWidth;
1208 if (nEnd < rStyleName.getLength() && nIdx < nCnt)
1211 nEnd = rScriptChanges[nIdx].changePos;
1212 aScript = rScriptChanges[nIdx].scriptType;
1227 const int nLeftDistance = 8;
1230 aPos.AdjustX(nLeftDistance );
1239 sal_uInt16 nIdx = 0;
1240 sal_Int32 nStart = 0;
1242 size_t nCnt = rScriptChanges.size();
1246 nEnd = rScriptChanges[nIdx].changePos;
1247 aScript = rScriptChanges[nIdx].scriptType;
1251 nEnd = rStyleName.getLength();
1252 aScript = SvtScriptType::LATIN;
1258 auto oFont = (aScript == SvtScriptType::ASIAN) ?
1260 ((aScript == SvtScriptType::COMPLEX) ?
1267 rRenderContext.
SetFont(*oFont);
1272 Size aPixelSize(aFont.GetFontSize());
1273 aPixelSize.setWidth(aPixelSize.Width() * fRatio);
1274 aPixelSize.setHeight(aPixelSize.Height() * fRatio);
1275 aFont.SetFontSize(aPixelSize);
1276 rRenderContext.
SetFont(aFont);
1279 rRenderContext.
DrawText(aPos, rStyleName, nStart, nEnd - nStart);
1281 rRenderContext.
Pop();
1283 aPos.AdjustX(rScriptChanges[nIdx++].textWidth * fRatio);
1284 if (nEnd < rStyleName.getLength() && nIdx < nCnt)
1287 nEnd = rScriptChanges[nIdx].changePos;
1288 aScript = rScriptChanges[nIdx].scriptType;
1308 rFont.SetFamilyName(rFontItem.GetFamilyName());
1309 rFont.SetStyleName(rFontItem.GetStyleName());
1323 Size aFontSize(0, rFontHeightItem.GetHeight());
1325 rFont.SetFontSize(aPixelSize);
1338 rFont.SetItalic(rItem.GetPosture());
1344 rFont.SetWeight(rItem.GetWeight());
1348void SvxStyleBox_Base::SetupEntry(
vcl::RenderContext& rRenderContext, sal_Int32 nItem,
const tools::Rectangle& rRect, std::u16string_view rStyleName,
bool bIsNotSelected)
1351 if (!bIsNotSelected)
1357 if (!bIsNotSelected)
1359 if (nItem == 0 || nItem ==
m_xWidget->get_count() - 1)
1360 m_xWidget->set_item_menu(OUString::number(nItem),
nullptr);
1363 m_nLastItemWithMenu = nItem;
1364 m_xWidget->set_item_menu(OUString::number(nItem), m_xMenu.get());
1368 if (nItem <= 0 || nItem >=
m_xWidget->get_count() - 1)
1380 while (pStyle && pStyle->
GetName() != rStyleName)
1381 pStyle = pPool->
Next();
1387 if (!pItemSet)
return;
1393 SetFontStyle(*pItemSet, SID_ATTR_CHAR_POSTURE, SID_ATTR_CHAR_WEIGHT, aFont);
1394 SetFontStyle(*pItemSet, SID_ATTR_CHAR_CJK_POSTURE, SID_ATTR_CHAR_CJK_WEIGHT, aCJKFont);
1395 SetFontStyle(*pItemSet, SID_ATTR_CHAR_CTL_POSTURE, SID_ATTR_CHAR_CTL_WEIGHT, aCTLFont);
1397 const SfxPoolItem *pItem = pItemSet->GetItem( SID_ATTR_CHAR_CONTOUR );
1401 aFont.SetOutline(aVal);
1402 aCJKFont.SetOutline(aVal);
1403 aCTLFont.SetOutline(aVal);
1406 pItem = pItemSet->GetItem( SID_ATTR_CHAR_SHADOWED );
1410 aFont.SetShadow(aVal);
1411 aCJKFont.SetShadow(aVal);
1412 aCTLFont.SetShadow(aVal);
1415 pItem = pItemSet->GetItem( SID_ATTR_CHAR_RELIEF );
1419 aFont.SetRelief(aVal);
1420 aCJKFont.SetRelief(aVal);
1421 aCTLFont.SetRelief(aVal);
1424 pItem = pItemSet->GetItem( SID_ATTR_CHAR_UNDERLINE );
1428 aFont.SetUnderline(aVal);
1429 aCJKFont.SetUnderline(aVal);
1430 aCTLFont.SetUnderline(aVal);
1433 pItem = pItemSet->GetItem( SID_ATTR_CHAR_OVERLINE );
1437 aFont.SetOverline(aVal);
1438 aCJKFont.SetOverline(aVal);
1439 aCTLFont.SetOverline(aVal);
1442 pItem = pItemSet->GetItem( SID_ATTR_CHAR_STRIKEOUT );
1446 aFont.SetStrikeout(aVal);
1447 aCJKFont.SetStrikeout(aVal);
1448 aCTLFont.SetStrikeout(aVal);
1451 pItem = pItemSet->GetItem( SID_ATTR_CHAR_CASEMAP );
1460 pItem = pItemSet->GetItem( SID_ATTR_CHAR_EMPHASISMARK );
1464 aFont.SetEmphasisMark(aVal);
1465 aCJKFont.SetEmphasisMark(aVal);
1466 aCTLFont.SetEmphasisMark(aVal);
1472 pItem = pItemSet->GetItem( SID_ATTR_CHAR_COLOR );
1474 if ( (
nullptr != pItem) && bIsNotSelected)
1481 if ( (
nullptr != pItem) && bIsNotSelected)
1486 case drawing::FillStyle_SOLID:
1490 if (
nullptr != pItem )
1491 aBackCol =
static_cast< const XFillColorItem*
>( pItem )->GetColorValue();
1493 if ( aBackCol != COL_AUTO )
1506 if( (aFontCol != COL_AUTO) || (aBackCol !=
COL_AUTO) )
1507 aFontCol = TestColorsVisible(aFontCol, (aBackCol != COL_AUTO) ? aBackCol : rRenderContext.
GetBackground().
GetColor());
1510 if ( aFontCol != COL_AUTO )
1513 if (
SetFont(*pItemSet, SID_ATTR_CHAR_FONT, aFont) &&
1514 SetFontSize(rRenderContext, *pItemSet, SID_ATTR_CHAR_FONTHEIGHT, aFont))
1517 if (
SetFont(*pItemSet, SID_ATTR_CHAR_CJK_FONT, aCJKFont) &&
1518 SetFontSize(rRenderContext, *pItemSet, SID_ATTR_CHAR_CJK_FONTHEIGHT, aCJKFont))
1519 m_oCJKFont = aCJKFont;
1521 if (
SetFont(*pItemSet, SID_ATTR_CHAR_CTL_FONT, aCTLFont) &&
1522 SetFontSize(rRenderContext, *pItemSet, SID_ATTR_CHAR_CTL_FONTHEIGHT, aCTLFont))
1523 m_oCTLFont = aCTLFont;
1529 const ::tools::Rectangle& rRect = std::get<1>(aPayload);
1530 bool bSelected = std::get<2>(aPayload);
1531 const OUString& rId = std::get<3>(aPayload);
1533 sal_uInt32
nIndex = rId.toUInt32();
1539 SetupEntry(rRenderContext,
nIndex, rRect, aStyleName, !bSelected);
1540 auto aScriptChanges = CheckScript(aStyleName);
1541 auto aTextRect = CalcBoundRect(rRenderContext, aStyleName, aScriptChanges);
1542 UserDrawEntry(rRenderContext, rRect, aTextRect, aStyleName, aScriptChanges);
1544 rRenderContext.
Pop();
1549 if (m_nMaxUserDrawFontWidth)
1553 sal_Int32 nEntryCount =
m_xWidget->get_count();
1554 for (sal_Int32 i = 0;
i < nEntryCount; ++
i)
1556 OUString sStyleName(get_text(i));
1562 nMaxNormalFontWidth = std::max(nWidth, nMaxNormalFontWidth);
1565 m_nMaxUserDrawFontWidth = nMaxNormalFontWidth;
1566 for (sal_Int32 i = 1;
i < nEntryCount-1; ++
i)
1568 OUString sStyleName(get_text(i));
1570 if (sStyleName.isEmpty())
1575 auto aScriptChanges = CheckScript(sStyleName);
1576 tools::Rectangle aTextRectForActualFont = CalcBoundRect(rRenderContext, sStyleName, aScriptChanges);
1580 double fRatio =
static_cast<double>(
ITEM_HEIGHT) / aTextRectForActualFont.
Bottom();
1581 aTextRectForActualFont = CalcBoundRect(rRenderContext, sStyleName, aScriptChanges, fRatio);
1583 rRenderContext.
Pop();
1587 m_nMaxUserDrawFontWidth = std::max(nWidth, m_nMaxUserDrawFontWidth);
1596Color SvxStyleBox_Base::TestColorsVisible(
const Color &FontCol,
const Color &BackCol)
1600 Color retCol = FontCol;
1605 if((lumi > 120) && (lumi < 140))
1620 auto entriesNode = rJsonWriter.startNode(
"entries");
1621 for (
int i = 0, nEntryCount =
m_xWidget->get_count();
i < nEntryCount; ++
i)
1623 auto entryNode = rJsonWriter.startNode(
"");
1629 rJsonWriter.put(
"selectedCount",
static_cast<sal_Int32
>(nActive == -1 ? 0 : 1));
1632 auto selectedNode = rJsonWriter.startNode(
"selectedEntries");
1635 auto node = rJsonWriter.startNode(
"");
1636 rJsonWriter.put(
"",
static_cast<sal_Int32
>(nActive));
1640 rJsonWriter.put(
"command",
".uno:StyleApply");
1645 bool bChanged =
false;
1655 *ppFontList = aFontList.get();
1656 pBox->SetOwnFontList(std::move(aFontList));
1660 if ( pFontListItem )
1663 DBG_ASSERT( pNewFontList,
"Doc-FontList not available!" );
1666 if ( !*ppFontList && pNewFontList )
1669 *ppFontList = pNewFontList;
1679 ( ( *ppFontList != pNewFontList ) ||
1684 *ppFontList = pNewFontList;
1688 pBox->set_sensitive(
true);
1690 else if ( pBox && ( pDocSh || !ppFontList ))
1699 pBox->set_sensitive(
false);
1703 if ( pBox && bChanged )
1706 pBox->Fill( *ppFontList );
1713SvxFontNameBox_Base::SvxFontNameBox_Base(std::unique_ptr<weld::ComboBox> xWidget,
1714 const Reference<XFrame>& rFrame,
1715 SvxFontNameToolBoxControl& rCtrl)
1717 , m_aWYSIWYG(
m_xListener,
"ShowFontBoxWYSIWYG", *this)
1721 , pFontList(nullptr)
1725 , mbCheckingUnknownFont(false)
1729 m_xWidget->connect_changed(
LINK(
this, SvxFontNameBox_Base, SelectHdl));
1730 m_xWidget->connect_key_press(
LINK(
this, SvxFontNameBox_Base, KeyInputHdl));
1731 m_xWidget->connect_entry_activate(
LINK(
this, SvxFontNameBox_Base, ActivateHdl));
1732 m_xWidget->connect_focus_in(
LINK(
this, SvxFontNameBox_Base, FocusInHdl));
1733 m_xWidget->connect_focus_out(
LINK(
this, SvxFontNameBox_Base, FocusOutHdl));
1734 m_xWidget->connect_get_property_tree(
LINK(
this, SvxFontNameBox_Base, DumpAsPropertyTreeHdl));
1739SvxFontNameBox_Impl::SvxFontNameBox_Impl(
vcl::Window* pParent,
const Reference<XFrame>& rFrame,
1740 SvxFontNameToolBoxControl& rCtrl)
1742 , SvxFontNameBox_Base(m_xBuilder->weld_combo_box(
"fontnamecombobox"), rFrame, rCtrl)
1744 set_id(
"fontnamecombobox");
1748void SvxFontNameBox_Base::FillList()
1753 int nStartPos, nEndPos;
1754 m_xWidget->get_entry_selection_bounds(nStartPos, nEndPos);
1759 m_xWidget->select_entry_region(nStartPos, nEndPos);
1762bool SvxFontNameBox_Base::CheckFontIsAvailable(std::u16string_view fontname)
1765 return pFontList && pFontList->IsAvailable(fontname);
1768void SvxFontNameBox_Base::CheckAndMarkUnknownFont()
1770 if (mbCheckingUnknownFont)
1772 mbCheckingUnknownFont =
true;
1773 OUString fontname =
m_xWidget->get_active_text();
1776 if (fontname.isEmpty() || CheckFontIsAvailable(fontname))
1794 mbCheckingUnknownFont =
false;
1797void SvxFontNameBox_Base::Update(
const css::awt::FontDescriptor* pFontDesc )
1801 aCurFont.SetFamilyName ( pFontDesc->Name );
1802 aCurFont.SetFamily (
FontFamily( pFontDesc->Family ) );
1803 aCurFont.SetStyleName ( pFontDesc->StyleName );
1804 aCurFont.SetPitch (
FontPitch( pFontDesc->Pitch ) );
1805 aCurFont.SetCharSet ( rtl_TextEncoding( pFontDesc->CharSet ) );
1807 OUString aCurName = aCurFont.GetFamilyName();
1808 OUString aText =
m_xWidget->get_active_text();
1809 if (aText != aCurName)
1810 set_active_or_entry_text(aCurName);
1813void SvxFontNameBox_Base::set_active_or_entry_text(
const OUString& rText)
1815 m_xWidget->set_active_or_entry_text(rText);
1816 CheckAndMarkUnknownFont();
1826 return DoKeyInput(rKEvt);
1829bool SvxFontNameBox_Base::DoKeyInput(
const KeyEvent& rKEvt)
1831 bool bHandled =
false;
1843 set_active_or_entry_text(
m_xWidget->get_saved_value());
1844 if (!m_rCtrl.IsInSidebar())
1846 ReleaseFocus_Impl();
1856bool SvxFontNameBox_Impl::DoKeyInput(
const KeyEvent& rKEvt)
1858 return SvxFontNameBox_Base::DoKeyInput(rKEvt) || ChildKeyInput(rKEvt);
1865 set_active_or_entry_text(
m_xWidget->get_saved_value());
1871void SvxFontNameBox_Impl::SetOptimalSize()
1879 SetSizePixel(get_preferred_size());
1884 if ( (rDCEvt.
GetType() == DataChangedEventType::SETTINGS) &&
1885 (rDCEvt.
GetFlags() & AllSettingsFlags::STYLE) )
1889 else if ( ( rDCEvt.
GetType() == DataChangedEventType::FONTS ) ||
1890 ( rDCEvt.
GetType() == DataChangedEventType::DISPLAY ) )
1898void SvxFontNameBox_Base::ReleaseFocus_Impl()
1906 m_xFrame->getContainerWindow()->setFocus();
1909void SvxFontNameBox_Base::EnableControls()
1911 bool bEnableMRU = m_aHistory.get();
1914 bool bNewWYSIWYG = m_aWYSIWYG.get();
1915 bool bOldWYSIWYG =
m_xWidget->IsWYSIWYGEnabled();
1917 if (
m_xWidget->get_max_mru_count() != nEntries || bNewWYSIWYG != bOldWYSIWYG)
1920 pFontList =
nullptr;
1925 if (bNewWYSIWYG != bOldWYSIWYG)
1931 Select(rCombo.changed_by_direct_pick());
1940void SvxFontNameBox_Base::Select(
bool bNonTravelSelect)
1942 Sequence< PropertyValue > aArgs( 1 );
1943 auto pArgs = aArgs.getArray();
1944 std::unique_ptr<SvxFontItem> pFontItem;
1948 aCurFont.GetWeight(),
1949 aCurFont.GetItalic() ) );
1950 aCurFont = aFontMetric;
1952 pFontItem.reset(
new SvxFontItem( aFontMetric.GetFamilyType(),
1953 aFontMetric.GetFamilyName(),
1954 aFontMetric.GetStyleName(),
1955 aFontMetric.GetPitch(),
1956 aFontMetric.GetCharSet(),
1957 SID_ATTR_CHAR_FONT ) );
1960 pFontItem->QueryValue( a );
1964 const Reference<XDispatchProvider> xProvider(m_xFrame, UNO_QUERY);
1965 if (bNonTravelSelect)
1967 CheckAndMarkUnknownFont();
1971 ReleaseFocus_Impl();
1975 pArgs[0].Name =
"CharFontName";
1983 pArgs[0].Name =
"CharPreviewFontName";
1992 auto entriesNode = rJsonWriter.startNode(
"entries");
1993 for (
int i = 0, nEntryCount =
m_xWidget->get_count();
i < nEntryCount; ++
i)
1995 auto entryNode = rJsonWriter.startNode(
"");
2000 int nSelectedEntry =
m_xWidget->get_active();
2001 rJsonWriter.put(
"selectedCount",
static_cast<sal_Int32
>(nSelectedEntry == -1 ? 0 : 1));
2004 auto selectedNode = rJsonWriter.startNode(
"selectedEntries");
2005 if (nSelectedEntry != -1)
2007 auto entryNode = rJsonWriter.startNode(
"");
2008 rJsonWriter.put(
"",
m_xWidget->get_text(nSelectedEntry));
2012 rJsonWriter.put(
"command",
".uno:CharFontName");
2016 std::shared_ptr<PaletteManager> xPaletteManager,
2019 const Reference< XFrame >& rFrame,
2023 :
WeldToolbarPopup(rFrame, rMenuButton.get_widget(),
"svx/ui/colorwindow.ui",
"palette_popup_window")
2024 , theSlotId(nSlotId)
2025 , maCommand(
std::move(rCommand))
2026 , maMenuButton(rMenuButton)
2027 , mxPaletteManager(
std::move(xPaletteManager))
2028 , mrColorStatus(rColorStatus)
2029 , maTopLevelParentFunction(
std::move(aTopLevelParentFunction))
2030 , maColorSelectFunction(
std::move(aColorSelectFunction))
2031 , mxColorSet(new
SvxColorValueSet(m_xBuilder->weld_scrolled_window(
"colorsetwin", true)))
2033 , mxPaletteListBox(m_xBuilder->weld_combo_box(
"palette_listbox"))
2034 , mxButtonAutoColor(m_xBuilder->weld_button(
"auto_color_button"))
2035 , mxButtonNoneColor(m_xBuilder->weld_button(
"none_color_button"))
2036 , mxButtonPicker(m_xBuilder->weld_button(
"color_picker_button"))
2037 , mxAutomaticSeparator(m_xBuilder->weld_widget(
"separator4"))
2038 , mxColorSetWin(new
weld::CustomWeld(*m_xBuilder,
"colorset", *mxColorSet))
2039 , mxRecentColorSetWin(new
weld::CustomWeld(*m_xBuilder,
"recent_colorset", *mxRecentColorSet))
2040 , mpDefaultButton(nullptr)
2047 case SID_ATTR_CHAR_COLOR_BACKGROUND:
2048 case SID_BACKGROUND_COLOR:
2049 case SID_ATTR_CHAR_BACK_COLOR:
2050 case SID_TABLE_CELL_BACKGROUND_COLOR:
2055 case SID_AUTHOR_COLOR:
2060 case SID_BMPMASK_COLOR:
2065 case SID_ATTR_CHAR_COLOR:
2066 case SID_ATTR_CHAR_COLOR2:
2067 case SID_EXTRUSION_3D_COLOR:
2072 case SID_FM_CTL_PROPERTIES:
2088 for (
const auto& rPalette : aPaletteList)
2091 OUString aPaletteName( officecfg::Office::Common::UserColors::PaletteName::get() );
2094 if (nSelectedEntry != -1)
2117 if (
maCommand ==
".uno:FrameLineColor" )
2145 return { aColor, sColorName };
2153 OUString sColorName;
2156 case SID_ATTR_CHAR_COLOR_BACKGROUND:
2157 case SID_BACKGROUND_COLOR:
2158 case SID_ATTR_CHAR_BACK_COLOR:
2159 case SID_TABLE_CELL_BACKGROUND_COLOR:
2161 sColorName =
SvxResId(RID_SVXSTR_NOFILL);
2163 case SID_AUTHOR_COLOR:
2165 sColorName =
SvxResId(RID_SVXSTR_BY_AUTHOR);
2167 case SID_BMPMASK_COLOR:
2169 sColorName =
SvxResId(RID_SVXSTR_TRANSPARENT);
2171 case SID_FM_CTL_PROPERTIES:
2173 sColorName =
SvxResId(RID_SVXSTR_DEFAULT);
2175 case SID_ATTR_CHAR_COLOR:
2176 case SID_ATTR_CHAR_COLOR2:
2177 case SID_EXTRUSION_3D_COLOR:
2180 sColorName =
EditResId(RID_SVXSTR_AUTOMATIC);
2184 return {aColor, sColorName};
2203 return GetNoneColor();
2209 NamedColor aNamedColor = GetSelectEntryColor(pColorSet);
2211 if (pColorSet != mxRecentColorSet.get())
2213 mxPaletteManager->AddRecentColor(aNamedColor.
m_aColor, aNamedColor.
m_aName);
2214 if (!maMenuButton.get_active())
2215 mxPaletteManager->ReloadRecentColorSet(*mxRecentColorSet);
2218 mxPaletteManager->SetSplitButtonColor(aNamedColor);
2223 OUString sCommand(maCommand);
2225 bool bThemePaletteSelected = mxPaletteManager->IsThemePaletteSelected();
2226 sal_uInt16 nSelectedItemId = pColorSet->GetSelectedItemId();
2228 if (bThemePaletteSelected)
2230 sal_uInt16 nThemeIndex;
2231 sal_uInt16 nEffectIndex;
2235 mxPaletteManager->GetLumModOff(nThemeIndex, nEffectIndex, aNamedColor.
m_nLumMod, aNamedColor.
m_nLumOff);
2239 maMenuButton.set_inactive();
2240 aColorSelectFunction(sCommand, aNamedColor);
2245 int nPos = mxPaletteListBox->get_active();
2246 mxPaletteManager->SetPalette(
nPos );
2247 mxPaletteManager->ReloadColorSet(*mxColorSet);
2248 mxColorSet->layoutToGivenHeight(mxColorSet->GetOutputSizePixel().Height(), mxPaletteManager->GetColorCount());
2258 NamedColor aNamedColor = &rButton == mxButtonAutoColor.get() ? GetAutoColor() : GetNoneColor();
2260 mxColorSet->SetNoSelection();
2261 mxRecentColorSet->SetNoSelection();
2262 mpDefaultButton = &rButton;
2264 mxPaletteManager->SetSplitButtonColor(aNamedColor);
2269 OUString sCommand(maCommand);
2271 maMenuButton.set_inactive();
2273 aColorSelectFunction(sCommand, aNamedColor);
2279 auto nColor = GetSelectEntryColor().m_aColor;
2280 auto pParentWindow = maTopLevelParentFunction();
2281 OUString sCommand = maCommand;
2282 std::shared_ptr<PaletteManager> xPaletteManager(mxPaletteManager);
2284 maMenuButton.set_inactive();
2286 xPaletteManager->PopupColorPicker(pParentWindow, sCommand, nColor);
2307 if (rEvent.FeatureURL.Complete ==
".uno:ColorTableState")
2363 const OUString& rColorName = rNamedColor.
m_aName;
2372 OUString sColorName =
"#" + rColor.
AsRGBHexString().toAsciiUpperCase();
2386 css::table::BorderLine2 aTable;
2388 if ( rEvent.State >>= aTable )
2390 SvxBorderLine aLine;
2392 if ( !aLine.isEmpty() )
2393 aColor = aLine.GetColor();
2396 rEvent.State >>= aColor;
2398 if ( rEvent.FeatureURL.Path ==
"BorderTLBR" )
2400 else if ( rEvent.FeatureURL.Path ==
"BorderBLTR" )
2428SvxFrameWindow_Impl::SvxFrameWindow_Impl(SvxFrameToolBoxControl* pControl,
weld::Widget* pParent)
2429 :
WeldToolbarPopup(pControl->getFrameInterface(), pParent,
"svx/ui/floatingframeborder.ui",
"FloatingFrameBorder")
2430 , mxControl(pControl)
2431 , mxFrameSet(new SvxFrmValueSet_Impl)
2432 , mxFrameSetWin(new
weld::CustomWeld(*m_xBuilder,
"valueset", *mxFrameSet))
2433 , bParagraphMode(false)
2434 , m_bIsWriter(false)
2438 if (Reference<lang::XServiceInfo> xSI{
m_xFrame->getController()->getModel(), UNO_QUERY })
2439 m_bIsWriter = xSI->supportsService(
"com.sun.star.text.TextDocument");
2441 mxFrameSet->SetStyle(WB_ITEMBORDER | WB_DOUBLEBORDER | WB_3DLOOK | WB_NO_DIRECTSELECT);
2442 AddStatusListener(
".uno:BorderReducedMode");
2459 for ( i=1;
i < (m_bIsWriter ? 9 : 11);
i++ )
2460 mxFrameSet->InsertItem(i,
Image(aImgVec[i-1].first), aImgVec[
i-1].second);
2463 if ( !bParagraphMode )
2466 for ( i = (m_bIsWriter ? 9 : 11);
i < (m_bIsWriter ? 13 : 16);
i++ )
2467 mxFrameSet->InsertItem(i,
Image(aImgVec[i-1].first), aImgVec[
i-1].second);
2470 sal_uInt16 colCount = m_bIsWriter ? 4 : 5;
2471 mxFrameSet->SetColCount( colCount );
2472 mxFrameSet->SetSelectHdl(
LINK(
this, SvxFrameWindow_Impl, SelectHdl ) );
2476 mxFrameSet->SetAccessibleName(
SvxResId(RID_SVXSTR_FRAME) );
2481enum class FrmValidFlags {
2503 SvxBoxItem aBorderOuter( SID_ATTR_BORDER_OUTER );
2505 SvxBorderLine theDefLine;
2509 SvxLineItem dDownLineItem(SID_ATTR_BORDER_DIAG_TLBR);
2513 SvxLineItem dUpLineItem(SID_ATTR_BORDER_DIAG_BLTR);
2515 bool bIsDiagonalBorder =
false;
2517 SvxBorderLine *pLeft =
nullptr,
2521 sal_uInt16 nSel = mxFrameSet->GetSelectedItemId();
2522 sal_uInt16 nModifier = mxFrameSet->GetModifier();
2523 FrmValidFlags nValidFlags = FrmValidFlags::NONE;
2536 if (nSel > 8) { nSel += 2; }
2537 else if (nSel > 4) { nSel++; }
2542 case 1: nValidFlags |= FrmValidFlags::AllMask;
2544 dDownLineItem.
SetLine(
nullptr);
2546 SetDiagonalDownBorder(dDownLineItem);
2547 SetDiagonalUpBorder(dUpLineItem);
2549 case 2: pLeft = &theDefLine;
2550 nValidFlags |= FrmValidFlags::Left;
2552 case 3: pRight = &theDefLine;
2553 nValidFlags |= FrmValidFlags::Right;
2555 case 4: pLeft = pRight = &theDefLine;
2556 nValidFlags |= FrmValidFlags::Right|FrmValidFlags::Left;
2558 case 5: dDownLineItem.
SetLine(&dDownBorderLine);
2559 SetDiagonalDownBorder(dDownLineItem);
2560 bIsDiagonalBorder =
true;
2562 case 6: pTop = &theDefLine;
2563 nValidFlags |= FrmValidFlags::Top;
2565 case 7: pBottom = &theDefLine;
2566 nValidFlags |= FrmValidFlags::Bottom;
2568 case 8: pTop = pBottom = &theDefLine;
2569 nValidFlags |= FrmValidFlags::Bottom|FrmValidFlags::Top;
2571 case 9: pLeft = pRight = pTop = pBottom = &theDefLine;
2572 nValidFlags |= FrmValidFlags::Left | FrmValidFlags::Right | FrmValidFlags::Top | FrmValidFlags::Bottom;
2575 dUpLineItem.
SetLine(&dUpBorderLine);
2576 SetDiagonalUpBorder(dUpLineItem);
2577 bIsDiagonalBorder =
true;
2582 pTop = pBottom = &theDefLine;
2583 aBorderInner.
SetLine( &theDefLine, SvxBoxInfoItemLine::HORI );
2584 aBorderInner.
SetLine(
nullptr, SvxBoxInfoItemLine::VERT );
2585 nValidFlags |= FrmValidFlags::HInner|FrmValidFlags::Top|FrmValidFlags::Bottom;
2589 pLeft = pRight = pTop = pBottom = &theDefLine;
2590 aBorderInner.
SetLine( &theDefLine, SvxBoxInfoItemLine::HORI );
2591 aBorderInner.
SetLine(
nullptr, SvxBoxInfoItemLine::VERT );
2592 nValidFlags |= FrmValidFlags::Right|FrmValidFlags::Left|FrmValidFlags::HInner|FrmValidFlags::Top|FrmValidFlags::Bottom;
2596 pLeft = pRight = pTop = pBottom = &theDefLine;
2597 aBorderInner.
SetLine(
nullptr, SvxBoxInfoItemLine::HORI );
2598 aBorderInner.
SetLine( &theDefLine, SvxBoxInfoItemLine::VERT );
2599 nValidFlags |= FrmValidFlags::Right|FrmValidFlags::Left|FrmValidFlags::VInner|FrmValidFlags::Top|FrmValidFlags::Bottom;
2603 pLeft = pRight = pTop = pBottom = &theDefLine;
2604 aBorderInner.
SetLine( &theDefLine, SvxBoxInfoItemLine::HORI );
2605 aBorderInner.
SetLine( &theDefLine, SvxBoxInfoItemLine::VERT );
2606 nValidFlags |= FrmValidFlags::AllMask;
2611 dDownLineItem.
SetLine(&dDownBorderLine);
2612 dUpLineItem.
SetLine(&dUpBorderLine);
2614 SetDiagonalDownBorder(dDownLineItem);
2615 SetDiagonalUpBorder(dUpLineItem);
2616 bIsDiagonalBorder =
true;
2625 if (!bIsDiagonalBorder)
2627 aBorderOuter.
SetLine( pLeft, SvxBoxItemLine::LEFT );
2628 aBorderOuter.
SetLine( pRight, SvxBoxItemLine::RIGHT );
2629 aBorderOuter.
SetLine( pTop, SvxBoxItemLine::TOP );
2630 aBorderOuter.
SetLine( pBottom, SvxBoxItemLine::BOTTOM );
2633 nValidFlags |= FrmValidFlags::AllMask;
2634 aBorderInner.
SetValid( SvxBoxInfoItemValidFlags::TOP,
bool(nValidFlags&FrmValidFlags::Top ));
2635 aBorderInner.
SetValid( SvxBoxInfoItemValidFlags::BOTTOM,
bool(nValidFlags&FrmValidFlags::Bottom ));
2636 aBorderInner.
SetValid( SvxBoxInfoItemValidFlags::LEFT,
bool(nValidFlags&FrmValidFlags::Left));
2637 aBorderInner.
SetValid( SvxBoxInfoItemValidFlags::RIGHT,
bool(nValidFlags&FrmValidFlags::Right ));
2638 aBorderInner.
SetValid( SvxBoxInfoItemValidFlags::HORI,
bool(nValidFlags&FrmValidFlags::HInner ));
2639 aBorderInner.
SetValid( SvxBoxInfoItemValidFlags::VERT,
bool(nValidFlags&FrmValidFlags::VInner));
2640 aBorderInner.
SetValid( SvxBoxInfoItemValidFlags::DISTANCE );
2641 aBorderInner.
SetValid( SvxBoxInfoItemValidFlags::DISABLE,
false );
2649 mxControl->dispatchCommand(
".uno:SetBorderStyle", aArgs );
2658 mxFrameSet->SetNoSelection();
2661 mxControl->EndPopupMode();
2664void SvxFrameWindow_Impl::SetDiagonalDownBorder(
const SvxLineItem& dDownLineItem)
2671 mxControl->dispatchCommand(
".uno:BorderTLBR", aArgs);
2674void SvxFrameWindow_Impl::SetDiagonalUpBorder(
const SvxLineItem& dUpLineItem)
2681 mxControl->dispatchCommand(
".uno:BorderBLTR", aArgs);
2684void SvxFrameWindow_Impl::statusChanged(
const css::frame::FeatureStateEvent& rEvent )
2686 if ( rEvent.FeatureURL.Complete !=
".uno:BorderReducedMode" )
2690 if ( !(rEvent.State >>= bValue) )
2693 bParagraphMode = bValue;
2695 if(!mxFrameSet->GetItemCount())
2699 bool bTableMode = ( mxFrameSet->GetItemCount() ==
static_cast<size_t>(m_bIsWriter ? 12 : 15) );
2700 bool bResize =
false;
2702 if ( bTableMode && bParagraphMode )
2704 for ( sal_uInt16 i = (m_bIsWriter ? 9 : 11);
i < (m_bIsWriter ? 13 : 16);
i++ )
2705 mxFrameSet->RemoveItem(i);
2708 else if ( !bTableMode && !bParagraphMode )
2710 for ( sal_uInt16 i = (m_bIsWriter ? 9 : 11);
i < (m_bIsWriter ? 13 : 16);
i++ )
2711 mxFrameSet->InsertItem(i,
Image(aImgVec[i-1].first), aImgVec[
i-1].second);
2721void SvxFrameWindow_Impl::CalcSizeValueSet()
2726 Size aSize = mxFrameSet->CalcWindowSizePixel( aItemSize );
2728 mxFrameSet->SetOutputSizePixel(aSize);
2731void SvxFrameWindow_Impl::InitImageList()
2745 {
BitmapEx(RID_SVXBMP_FRAME6),
SvxResId(RID_SVXSTR_PARA_PRESET_ONLYTBOTTOM)},
2747 {
BitmapEx(RID_SVXBMP_FRAME8),
SvxResId(RID_SVXSTR_TABLE_PRESET_ONLYOUTER)},
2749 {
BitmapEx(RID_SVXBMP_FRAME9),
SvxResId(RID_SVXSTR_PARA_PRESET_TOPBOTTOMHORI)},
2750 {
BitmapEx(RID_SVXBMP_FRAME10),
SvxResId(RID_SVXSTR_TABLE_PRESET_OUTERHORI)},
2751 {
BitmapEx(RID_SVXBMP_FRAME11),
SvxResId(RID_SVXSTR_TABLE_PRESET_OUTERVERI)},
2765 {
BitmapEx(RID_SVXBMP_FRAME14),
SvxResId(RID_SVXSTR_PARA_PRESET_DIAGONALDOWN)},
2768 {
BitmapEx(RID_SVXBMP_FRAME6),
SvxResId(RID_SVXSTR_PARA_PRESET_ONLYTBOTTOM)},
2770 {
BitmapEx(RID_SVXBMP_FRAME8),
SvxResId(RID_SVXSTR_TABLE_PRESET_ONLYOUTER)},
2771 {
BitmapEx(RID_SVXBMP_FRAME13),
SvxResId(RID_SVXSTR_PARA_PRESET_DIAGONALUP)},
2773 {
BitmapEx(RID_SVXBMP_FRAME9),
SvxResId(RID_SVXSTR_PARA_PRESET_TOPBOTTOMHORI)},
2774 {
BitmapEx(RID_SVXBMP_FRAME10),
SvxResId(RID_SVXSTR_TABLE_PRESET_OUTERHORI)},
2775 {
BitmapEx(RID_SVXBMP_FRAME11),
SvxResId(RID_SVXSTR_TABLE_PRESET_OUTERVERI)},
2776 {
BitmapEx(RID_SVXBMP_FRAME12),
SvxResId(RID_SVXSTR_TABLE_PRESET_OUTERALL)},
2777 {
BitmapEx(RID_SVXBMP_FRAME15),
SvxResId(RID_SVXSTR_PARA_PRESET_CRISSCROSS)}
2784 return SvxBorderLine::threeDMediumColor( aMain );
2787SvxLineWindow_Impl::SvxLineWindow_Impl(SvxFrameToolBoxControl* pControl,
weld::Widget* pParent)
2788 :
WeldToolbarPopup(pControl->getFrameInterface(), pParent,
"svx/ui/floatingframeborder.ui",
"FloatingFrameBorder")
2790 , m_xLineStyleLb(new LineListBox)
2791 , m_xLineStyleLbWin(new
weld::CustomWeld(*m_xBuilder,
"valueset", *m_xLineStyleLb))
2792 , m_bIsWriter(false)
2796 Reference< lang::XServiceInfo > xServices(
m_xFrame->getController()->getModel(), UNO_QUERY_THROW);
2797 m_bIsWriter = xServices->supportsService(
"com.sun.star.text.TextDocument");
2799 catch(
const uno::Exception& )
2803 m_xLineStyleLb->SetStyle(
WinBits(WB_FLATVALUESET | WB_ITEMBORDER | WB_3DLOOK | WB_NO_DIRECTSELECT | WB_TABSTOP) );
2805 m_xLineStyleLb->SetSourceUnit( FieldUnit::TWIP );
2809 m_xLineStyleLb->InsertEntry( SvxBorderLine::getWidthImpl( SvxBorderLineStyle::SOLID ), SvxBorderLineStyle::SOLID );
2810 m_xLineStyleLb->InsertEntry( SvxBorderLine::getWidthImpl( SvxBorderLineStyle::DOTTED ), SvxBorderLineStyle::DOTTED );
2811 m_xLineStyleLb->InsertEntry( SvxBorderLine::getWidthImpl( SvxBorderLineStyle::DASHED ), SvxBorderLineStyle::DASHED );
2814 m_xLineStyleLb->InsertEntry( SvxBorderLine::getWidthImpl( SvxBorderLineStyle::DOUBLE ), SvxBorderLineStyle::DOUBLE );
2815 m_xLineStyleLb->InsertEntry( SvxBorderLine::getWidthImpl( SvxBorderLineStyle::THINTHICK_SMALLGAP ), SvxBorderLineStyle::THINTHICK_SMALLGAP, 20 );
2816 m_xLineStyleLb->InsertEntry( SvxBorderLine::getWidthImpl( SvxBorderLineStyle::THINTHICK_MEDIUMGAP ), SvxBorderLineStyle::THINTHICK_MEDIUMGAP );
2817 m_xLineStyleLb->InsertEntry( SvxBorderLine::getWidthImpl( SvxBorderLineStyle::THINTHICK_LARGEGAP ), SvxBorderLineStyle::THINTHICK_LARGEGAP );
2818 m_xLineStyleLb->InsertEntry( SvxBorderLine::getWidthImpl( SvxBorderLineStyle::THICKTHIN_SMALLGAP ), SvxBorderLineStyle::THICKTHIN_SMALLGAP, 20 );
2819 m_xLineStyleLb->InsertEntry( SvxBorderLine::getWidthImpl( SvxBorderLineStyle::THICKTHIN_MEDIUMGAP ), SvxBorderLineStyle::THICKTHIN_MEDIUMGAP );
2820 m_xLineStyleLb->InsertEntry( SvxBorderLine::getWidthImpl( SvxBorderLineStyle::THICKTHIN_LARGEGAP ), SvxBorderLineStyle::THICKTHIN_LARGEGAP );
2823 m_xLineStyleLb->InsertEntry( SvxBorderLine::getWidthImpl( SvxBorderLineStyle::EMBOSSED ), SvxBorderLineStyle::EMBOSSED, 15,
2824 &SvxBorderLine::threeDLightColor, &SvxBorderLine::threeDDarkColor,
2826 m_xLineStyleLb->InsertEntry( SvxBorderLine::getWidthImpl( SvxBorderLineStyle::ENGRAVED ), SvxBorderLineStyle::ENGRAVED, 15,
2827 &SvxBorderLine::threeDDarkColor, &SvxBorderLine::threeDLightColor,
2831 m_xLineStyleLb->InsertEntry( SvxBorderLine::getWidthImpl( SvxBorderLineStyle::OUTSET ), SvxBorderLineStyle::OUTSET, 10,
2832 &SvxBorderLine::lightColor, &SvxBorderLine::darkColor );
2833 m_xLineStyleLb->InsertEntry( SvxBorderLine::getWidthImpl( SvxBorderLineStyle::INSET ), SvxBorderLineStyle::INSET, 10,
2834 &SvxBorderLine::darkColor, &SvxBorderLine::lightColor );
2835 Size aSize = m_xLineStyleLb->SetWidth( 20 );
2837 m_xLineStyleLb->SetSelectHdl(
LINK(
this, SvxLineWindow_Impl, SelectHdl ) );
2843 aSize = m_xLineStyleLb->CalcWindowSizePixel(aSize);
2844 m_xLineStyleLb->GetDrawingArea()->set_size_request(aSize.
Width(), aSize.
Height());
2845 m_xLineStyleLb->SetOutputSizePixel(aSize);
2853 if ( m_xLineStyleLb->GetSelectItemPos( ) > 0 )
2856 aTmp.SetBorderLineStyle( nStyle );
2867 m_xControl->dispatchCommand(
".uno:LineStyle", aArgs );
2873 const Reference< XDispatchProvider >& rDispatchProvider,
2875 const OUString& rCommand,
2887 case SID_STYLE_FAMILY1:
2888 case SID_STYLE_FAMILY2:
2889 case SID_STYLE_FAMILY3:
2890 case SID_STYLE_FAMILY4:
2891 case SID_STYLE_FAMILY5:
2893 const sal_uInt16 nIdx =
GetId() - SID_STYLE_FAMILY_START;
2895 if ( SfxItemState::DEFAULT == eState )
2899 DBG_ASSERT( pStateItem !=
nullptr,
"SfxTemplateItem expected" );
2938 Reference< style::XStyleFamiliesSupplier > xStylesSupplier(
xModel, UNO_QUERY_THROW );
2939 Reference< lang::XServiceInfo > xServices(
xModel, UNO_QUERY_THROW );
2940 bSpecModeWriter = xServices->supportsService(
"com.sun.star.text.TextDocument");
2943 Reference<container::XNameAccess> xParaStyles;
2944 xStylesSupplier->getStyleFamilies()->getByName(
"ParagraphStyles") >>=
2946 static const std::vector<OUString> aWriterStyles =
2959 for(
const OUString& aStyle: aWriterStyles )
2963 Reference< beans::XPropertySet > xStyle;
2964 xParaStyles->getByName( aStyle ) >>= xStyle;
2966 xStyle->getPropertyValue(
"DisplayName") >>=
sName;
2967 if( !
sName.isEmpty() )
2969 std::pair<OUString, OUString>(aStyle,
sName) );
2971 catch(
const uno::Exception& )
2978 "com.sun.star.sheet.SpreadsheetDocument")))
2980 static const char* aCalcStyles[] =
2990 Reference<container::XNameAccess> xCellStyles;
2991 xStylesSupplier->getStyleFamilies()->getByName(
"CellStyles") >>= xCellStyles;
2992 for(
const char* pCalcStyle : aCalcStyles)
2996 const OUString sStyleName( OUString::createFromAscii( pCalcStyle ) );
2997 if( xCellStyles->hasByName( sStyleName ) )
2999 Reference< beans::XPropertySet > xStyle( xCellStyles->getByName( sStyleName), UNO_QUERY_THROW );
3001 xStyle->getPropertyValue(
"DisplayName") >>=
sName;
3002 if( !
sName.isEmpty() )
3004 std::pair<OUString, OUString>(sStyleName,
sName) );
3007 catch(
const uno::Exception& )
3012 catch(
const uno::Exception& )
3014 OSL_FAIL(
"error while initializing style names");
3028 ".uno:TemplateFamily5"
3033 , pStyleSheetPool(nullptr)
3034 , nActFamily(0xffff)
3056 pImpl->InitializeStyles(
m_xFrame->getController()->getModel());
3057 Reference< XDispatchProvider > xDispatchProvider(
m_xFrame->getController(), UNO_QUERY );
3061 SID_STYLE_FAMILY_START +
i,
3074 pImpl->m_xVclBox.disposeAndClear();
3075 pImpl->m_xWeldBox.reset();
3076 pImpl->m_pBox =
nullptr;
3082 pBoundItem->UnBind();
3108 return "com.sun.star.comp.svx.StyleToolBoxControl";
3118 return {
"com.sun.star.frame.ToolbarController" };
3121extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
3123 css::uno::XComponentContext*,
3124 css::uno::Sequence<css::uno::Any>
const & )
3132 pBoundItem->ReBind();
3138 switch (
nActFamily-1 + SID_STYLE_FAMILY_START )
3140 case SID_STYLE_FAMILY1:
return SfxStyleFamily::Char;
3141 case SID_STYLE_FAMILY2:
return SfxStyleFamily::Para;
3142 case SID_STYLE_FAMILY3:
return SfxStyleFamily::Frame;
3143 case SID_STYLE_FAMILY4:
return SfxStyleFamily::Page;
3144 case SID_STYLE_FAMILY5:
return SfxStyleFamily::Pseudo;
3146 OSL_FAIL(
"unknown style family" );
3149 return SfxStyleFamily::Para;
3154 SvxStyleBox_Base* pBox =
pImpl->m_pBox;
3164 bool bDoFill =
false;
3167 sal_uInt16
nCount = xIter->Count();
3170 pStyle = xIter->First();
3173 if (
nCount != pBox->get_count() )
3180 while ( pStyle && !bDoFill )
3182 bDoFill = ( pBox->get_text(
i) != pStyle->
GetName() );
3183 pStyle = xIter->Next();
3191 OUString aStrSel(pBox->get_active_text());
3195 std::vector<OUString> aStyles;
3198 pStyle = xIter->Next();
3201 aStyles.push_back(pStyle->
GetName());
3202 pStyle = xIter->Next();
3205 if (
pImpl->bSpecModeWriter ||
pImpl->bSpecModeCalc)
3207 pBox->append_text(
pImpl->aClearForm);
3208 pBox->insert_separator(1,
"separator");
3211 for(
const auto &rStyle :
pImpl->aDefaultStyles )
3213 if ( aStyles.size() + pBox->get_count() > 12)
3216 if (std::find(aStyles.begin(), aStyles.end(), rStyle.second) >= aStyles.end())
3217 pBox->append_text(rStyle.second);
3220 std::sort(aStyles.begin(), aStyles.end());
3222 for (
const auto& rStyle : aStyles)
3223 pBox->append_text(rStyle);
3226 pBox->append_text(
pImpl->aMore);
3229 pBox->set_active_or_entry_text(aStrSel);
3230 pBox->SetFamily( eFamily );
3235 SvxStyleBox_Base* pBox =
pImpl->m_pBox;
3241 OUString aStrSel(pBox->get_active_text());
3243 if ( !rStyleName.isEmpty() )
3245 OUString aNewStyle = rStyleName;
3247 auto aFound = std::find_if(
pImpl->aDefaultStyles.begin(),
pImpl->aDefaultStyles.end(),
3248 [rStyleName] (
auto it) { return it.first == rStyleName || it.second == rStyleName; }
3251 if (aFound !=
pImpl->aDefaultStyles.end())
3252 aNewStyle = aFound->second;
3254 if ( aNewStyle != aStrSel )
3255 pBox->set_active_or_entry_text( aNewStyle );
3258 pBox->set_active(-1);
3318 m_pToolbar->set_item_sensitive(m_aCommandURL, rEvent.IsEnabled);
3323 if (!getToolboxId(
nId, &pToolBox ) )
3328 if (rEvent.IsEnabled)
3334 uno::Reference< awt::XWindow > xItemWindow;
3344 pImpl->m_xWeldBox.reset(
new SvxStyleBox_Base(std::move(xWidget),
3346 SfxStyleFamily::Para,
3350 pImpl->bSpecModeWriter ||
pImpl->bSpecModeCalc, *
this));
3362 SfxStyleFamily::Para,
3366 pImpl->bSpecModeWriter ||
pImpl->bSpecModeCalc, *
this);
3372 if (
pImpl->m_pBox && !
pImpl->aDefaultStyles.empty())
3373 pImpl->m_pBox->SetDefaultStyle(
pImpl->aDefaultStyles[0].second);
3378SvxFontNameToolBoxControl::SvxFontNameToolBoxControl()
3383void SvxFontNameBox_Base::statusChanged_Impl(
const css::frame::FeatureStateEvent& rEvent )
3385 if ( !rEvent.IsEnabled )
3387 set_sensitive(
false);
3392 set_sensitive(
true);
3394 css::awt::FontDescriptor aFontDesc;
3395 if ( rEvent.State >>= aFontDesc )
3400 set_active_or_entry_text(
"");
3406void SvxFontNameToolBoxControl::statusChanged(
const css::frame::FeatureStateEvent& rEvent )
3409 m_pBox->statusChanged_Impl(rEvent);
3412 m_pToolbar->set_item_sensitive(m_aCommandURL, rEvent.IsEnabled);
3417 if (!getToolboxId( nId, &pToolBox ) )
3419 pToolBox->
EnableItem( nId, rEvent.IsEnabled );
3423css::uno::Reference<css::awt::XWindow> SvxFontNameToolBoxControl::createItemWindow(
const css::uno::Reference<css::awt::XWindow>& rParent)
3425 uno::Reference< awt::XWindow > xItemWindow;
3435 m_xWeldBox.reset(
new SvxFontNameBox_Base(std::move(xWidget), m_xFrame, *
this));
3436 m_pBox = m_xWeldBox.get();
3445 m_pBox = m_xVclBox.get();
3453void SvxFontNameToolBoxControl::dispose()
3455 ToolboxController::dispose();
3458 m_xVclBox.disposeAndClear();
3463OUString SvxFontNameToolBoxControl::getImplementationName()
3465 return "com.sun.star.comp.svx.FontNameToolBoxControl";
3468sal_Bool SvxFontNameToolBoxControl::supportsService(
const OUString& rServiceName )
3473css::uno::Sequence< OUString > SvxFontNameToolBoxControl::getSupportedServiceNames()
3475 return {
"com.sun.star.frame.ToolbarController" };
3478extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
3480 css::uno::XComponentContext*,
3481 css::uno::Sequence<css::uno::Any>
const & )
3483 return cppu::acquire(
new SvxFontNameToolBoxControl() );
3487 ImplInheritanceHelper( rContext, nullptr, OUString() ),
3488 m_bSplitButton(true),
3496sal_uInt16 MapCommandToSlotId(
const OUString& rCommand)
3498 if (rCommand ==
".uno:Color")
3499 return SID_ATTR_CHAR_COLOR;
3500 else if (rCommand ==
".uno:FontColor")
3501 return SID_ATTR_CHAR_COLOR2;
3502 else if (rCommand ==
".uno:BackColor")
3503 return SID_ATTR_CHAR_COLOR_BACKGROUND;
3504 else if (rCommand ==
".uno:CharBackColor")
3505 return SID_ATTR_CHAR_BACK_COLOR;
3506 else if (rCommand ==
".uno:BackgroundColor")
3507 return SID_BACKGROUND_COLOR;
3508 else if (rCommand ==
".uno:TableCellBackgroundColor")
3509 return SID_TABLE_CELL_BACKGROUND_COLOR;
3510 else if (rCommand ==
".uno:Extrusion3DColor")
3511 return SID_EXTRUSION_3D_COLOR;
3512 else if (rCommand ==
".uno:XLineColor")
3513 return SID_ATTR_LINE_COLOR;
3514 else if (rCommand ==
".uno:FillColor")
3515 return SID_ATTR_FILL_COLOR;
3516 else if (rCommand ==
".uno:FrameLineColor")
3517 return SID_FRAME_LINECOLOR;
3519 SAL_WARN(
"svx.tbxcrtls",
"Unknown color command: " << rCommand);
3527 PopupWindowController::initialize( rArguments );
3529 m_nSlotId = MapCommandToSlotId( m_aCommandURL );
3544 m_pToolbar->set_item_popover(m_aCommandURL, mxPopoverContainer->getTopLevel());
3551 if (getToolboxId(
nId, &pToolBox))
3560 PopupWindowController::update();
3564 case SID_ATTR_CHAR_COLOR2:
3565 addStatusListener(
".uno:CharColorExt");
3568 case SID_ATTR_CHAR_BACK_COLOR:
3569 case SID_ATTR_CHAR_COLOR_BACKGROUND:
3570 addStatusListener(
".uno:CharBackgroundExt");
3573 case SID_FRAME_LINECOLOR:
3574 addStatusListener(
".uno:BorderTLBR");
3575 addStatusListener(
".uno:BorderBLTR");
3604 const css::uno::Reference<css::awt::XWindow> xParent =
m_xFrame->getContainerWindow();
3612 auto xPopover = std::make_unique<ColorWindow>(
3629 if (!getToolboxId(
nId, &pToolBox))
3634 auto xPopover = std::make_unique<ColorWindow>(
3645 std::move(xPopover),
true);
3649 mxInterimPopover->SetText(aWindowTitle);
3651 mxInterimPopover->Show();
3653 return mxInterimPopover;
3660 if (!getToolboxId(
nId, &pToolBox) && !m_pToolbar)
3663 if ( rEvent.FeatureURL.Complete == m_aCommandURL )
3666 m_pToolbar->set_item_sensitive(m_aCommandURL, rEvent.IsEnabled);
3677 else if ( rEvent.State >>= bValue )
3680 m_pToolbar->set_item_active(m_aCommandURL, bValue);
3693 m_pToolbar->set_menu_item_active(m_aCommandURL, !m_pToolbar->get_menu_item_active(m_aCommandURL));
3698 createPopupWindow();
3708 case SID_ATTR_CHAR_COLOR2 :
3714 { m_aCommandURL.copy(5), css::uno::Any(aColor) }
3747 return "com.sun.star.comp.svx.ColorToolBoxControl";
3752 return {
"com.sun.star.frame.ToolbarController" };
3755extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
3757 css::uno::XComponentContext* rContext,
3758 css::uno::Sequence<css::uno::Any>
const & )
3763SvxFrameToolBoxControl::SvxFrameToolBoxControl(
const css::uno::Reference< css::uno::XComponentContext >& rContext )
3764 :
svt::PopupWindowController( rContext, nullptr, OUString() )
3768void SAL_CALL SvxFrameToolBoxControl::execute(sal_Int16 )
3773 m_pToolbar->set_menu_item_active(m_aCommandURL, !m_pToolbar->get_menu_item_active(m_aCommandURL));
3778 createPopupWindow();
3782void SvxFrameToolBoxControl::initialize(
const css::uno::Sequence< css::uno::Any >& rArguments )
3784 svt::PopupWindowController::initialize( rArguments );
3789 m_pToolbar->set_item_popover(m_aCommandURL, mxPopoverContainer->getTopLevel());
3794 if (getToolboxId(nId, &pToolBox))
3798std::unique_ptr<WeldToolbarPopup> SvxFrameToolBoxControl::weldPopupWindow()
3800 if ( m_aCommandURL ==
".uno:LineStyle" )
3801 return std::make_unique<SvxLineWindow_Impl>(
this, m_pToolbar);
3802 return std::make_unique<SvxFrameWindow_Impl>(
this, m_pToolbar);
3807 if ( m_aCommandURL ==
".uno:LineStyle" )
3810 std::make_unique<SvxLineWindow_Impl>(
this, pParent->
GetFrameWeld()),
true);
3812 mxInterimPopover->Show();
3814 mxInterimPopover->SetText(
SvxResId(RID_SVXSTR_FRAME_STYLE));
3816 return mxInterimPopover;
3820 std::make_unique<SvxFrameWindow_Impl>(
this, pParent->
GetFrameWeld()),
true);
3822 mxInterimPopover->Show();
3824 mxInterimPopover->SetText(
SvxResId(RID_SVXSTR_FRAME));
3826 return mxInterimPopover;
3829OUString SvxFrameToolBoxControl::getImplementationName()
3831 return "com.sun.star.comp.svx.FrameToolBoxControl";
3834css::uno::Sequence< OUString > SvxFrameToolBoxControl::getSupportedServiceNames()
3836 return {
"com.sun.star.frame.ToolbarController" };
3839extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
3841 css::uno::XComponentContext* rContext,
3842 css::uno::Sequence<css::uno::Any>
const & )
3844 return cppu::acquire(
new SvxFrameToolBoxControl( rContext ) );
3847SvxCurrencyToolBoxControl::SvxCurrencyToolBoxControl(
const css::uno::Reference<css::uno::XComponentContext>& rContext ) :
3848 PopupWindowController( rContext, nullptr, OUString() ),
3849 m_eLanguage(
Application::GetSettings().GetLanguageTag().getLanguageType() ),
3854SvxCurrencyToolBoxControl::~SvxCurrencyToolBoxControl() {}
3863 std::unique_ptr<weld::Label>
m_xLabel;
3864 std::unique_ptr<weld::TreeView> m_xCurrencyLb;
3865 std::unique_ptr<weld::Button> m_xOkBtn;
3866 OUString& m_rSelectedFormat;
3869 std::vector<OUString> m_aFormatEntries;
3877 SvxCurrencyList_Impl(SvxCurrencyToolBoxControl* pControl,
weld::Widget* pParent, OUString& rSelectedFormat,
LanguageType& eSelectedLanguage)
3878 :
WeldToolbarPopup(pControl->getFrameInterface(), pParent,
"svx/ui/currencywindow.ui",
"CurrencyWindow")
3880 ,
m_xLabel(m_xBuilder->weld_label(
"label"))
3881 , m_xCurrencyLb(m_xBuilder->weld_tree_view(
"currency"))
3882 , m_xOkBtn(m_xBuilder->weld_button(
"ok"))
3883 , m_rSelectedFormat(rSelectedFormat)
3884 , m_eSelectedLanguage(eSelectedLanguage)
3887 sal_uInt16 nLen = rCurrencyTable.
size();
3890 m_eFormatLanguage = aFormatter.GetLanguage();
3892 const SvxCurrencyToolBoxControl::SvxCurrencyVect_t &rCurrencies = pControl->GetCurrencySymbols( );
3895 sal_Int32 nSelectedPos = -1;
3899 OUString sLongestString;
3901 m_xCurrencyLb->freeze();
3902 for(
const SvxCurrencyToolBoxControl::SvxCurrencyData& curr : rCurrencies )
3904 const OUString& rItem = curr.m_label;
3905 sal_uInt16 rCurrencyIndex = rCurrencies[
nCount ].m_currencyIdx;
3907 if ( rCurrencyIndex < nLen )
3909 m_xCurrencyLb->append_text(rItem);
3911 if (rItem.getLength() > sLongestString.getLength())
3912 sLongestString = rItem;
3914 bIsSymbol =
nPos >= nLen;
3916 sal_uInt16 nDefaultFormat;
3917 const NfCurrencyEntry& rCurrencyEntry = rCurrencyTable[ rCurrencyIndex ];
3918 if (rCurrencyIndex == 0)
3923 NfCurrencyEntry aCurrencyEntry( rCurrencyEntry);
3925 nDefaultFormat = aFormatter.GetCurrencyFormatStrings( aStringsDtor, aCurrencyEntry, bIsSymbol);
3929 nDefaultFormat = aFormatter.GetCurrencyFormatStrings( aStringsDtor, rCurrencyEntry, bIsSymbol);
3931 const OUString& rFormatStr = aStringsDtor[ nDefaultFormat ];
3932 m_aFormatEntries.push_back( rFormatStr );
3933 if( rFormatStr == m_rSelectedFormat )
3934 nSelectedPos =
nPos;
3939 m_xCurrencyLb->thaw();
3941 m_xCurrencyLb->set_selection_mode(SelectionMode::Multiple);
3942 m_xCurrencyLb->connect_row_activated(
LINK(
this, SvxCurrencyList_Impl, RowActivatedHdl ) );
3944 m_xCurrencyLb->select( nSelectedPos );
3945 m_xOkBtn->connect_clicked(
LINK(
this, SvxCurrencyList_Impl, OKHdl));
3949 m_xCurrencyLb->insert_text(0, sLongestString);
3950 m_xCurrencyLb->set_size_request(m_xCurrencyLb->get_preferred_size().Width(), m_xCurrencyLb->get_height_rows(12));
3951 m_xCurrencyLb->remove(0);
3955 void SvxCurrencyList_Impl::GrabFocus()
3957 m_xCurrencyLb->grab_focus();
3962 RowActivatedHdl(*m_xCurrencyLb);
3972 int nSelected = m_xCurrencyLb->get_selected_index();
3973 if (nSelected == -1)
3976 m_xCurrencyLb->set_selection_mode(SelectionMode::Single);
3978 m_rSelectedFormat = m_aFormatEntries[nSelected];
3979 m_eSelectedLanguage = m_eFormatLanguage;
3983 m_xCurrencyLb->scroll_to_row(0);
3991void SvxCurrencyToolBoxControl::initialize(
const css::uno::Sequence< css::uno::Any >& rArguments )
3993 PopupWindowController::initialize(rArguments);
3998 m_pToolbar->set_item_popover(m_aCommandURL, mxPopoverContainer->getTopLevel());
4004 if (getToolboxId(nId, &pToolBox) && pToolBox->
GetItemCommand(nId) == m_aCommandURL)
4008const SvxCurrencyToolBoxControl::SvxCurrencyVect_t &SvxCurrencyToolBoxControl::GetCurrencySymbols( ) {
4009 inner_GetCurrencySymbols(
true, m_currencies, m_mru_currencies );
4010 return m_currencies;
4013void SvxCurrencyToolBoxControl::addMruCurrency(sal_Int16 currencyPosition) {
4014 if (currencyPosition == 1)
4017 const SvxCurrencyData& curr = m_currencies[currencyPosition];
4018 auto currencyIter = std::find( m_mru_currencies.begin(), m_mru_currencies.end(), curr );
4020 if ( currencyIter != m_mru_currencies.end() )
4021 m_mru_currencies.erase( currencyIter );
4023 m_mru_currencies.insert( m_mru_currencies.begin(), curr );
4028std::unique_ptr<WeldToolbarPopup> SvxCurrencyToolBoxControl::weldPopupWindow()
4030 return std::make_unique<SvxCurrencyList_Impl>(
this, m_pToolbar, m_aFormatString, m_eLanguage);
4036 std::make_unique<SvxCurrencyList_Impl>(
this, pParent->
GetFrameWeld(), m_aFormatString, m_eLanguage));
4038 mxInterimPopover->Show();
4040 return mxInterimPopover;
4043void SvxCurrencyToolBoxControl::execute( sal_Int16 nSelectModifier )
4045 sal_uInt32 nFormatKey;
4046 if (m_aFormatString.isEmpty())
4050 if ( nSelectModifier > 0 )
4054 uno::Reference< util::XNumberFormatsSupplier > xRef(
m_xFrame->getController()->getModel(), uno::UNO_QUERY );
4055 uno::Reference< util::XNumberFormats > rxNumberFormats( xRef->getNumberFormats(), uno::UNO_SET_THROW );
4057 nFormatKey = rxNumberFormats->queryKey( m_aFormatString, aLocale,
false );
4058 if ( nFormatKey == NUMBERFORMAT_ENTRY_NOT_FOUND )
4059 nFormatKey = rxNumberFormats->addNew( m_aFormatString, aLocale );
4060 addMruCurrency(nSelectModifier);
4062 catch(
const uno::Exception& )
4064 nFormatKey = m_nFormatKey;
4068 nFormatKey = m_nFormatKey;
4071 if( nFormatKey != NUMBERFORMAT_ENTRY_NOT_FOUND )
4076 m_nFormatKey = nFormatKey;
4079 PopupWindowController::execute( nSelectModifier );
4082OUString SvxCurrencyToolBoxControl::getImplementationName()
4084 return "com.sun.star.comp.svx.CurrencyToolBoxControl";
4087css::uno::Sequence<OUString> SvxCurrencyToolBoxControl::getSupportedServiceNames()
4089 return {
"com.sun.star.frame.ToolbarController" };
4092extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
4094 css::uno::XComponentContext* rContext,
4095 css::uno::Sequence<css::uno::Any>
const & )
4097 return cppu::acquire(
new SvxCurrencyToolBoxControl( rContext ) );
4100Reference< css::accessibility::XAccessible > SvxFontNameBox_Impl::CreateAccessible()
4107sal_uInt16
const SvxCurrencyToolBoxControl::SvxCurrencyData::InvalidCurrency =
INVALID_CURRENCY;
4109SvxCurrencyToolBoxControl::SvxCurrencyData::SvxCurrencyData(
4110 sal_uInt16 currencyIdx,
4113 m_currencyIdx(currencyIdx),
4114 m_onlyIsoCode(onlyIsoCode)
4117bool SvxCurrencyToolBoxControl::SvxCurrencyData::operator == (
const SvxCurrencyData& other)
const
4120 (m_currencyIdx == other.m_currencyIdx) &&
4121 (m_onlyIsoCode == other.m_onlyIsoCode);
4125void SvxCurrencyToolBoxControl::GetCurrencySymbols( std::vector<OUString>& rList,
bool bFlag,
4126 std::vector<sal_uInt16>& rCurrencyList )
4128 SvxCurrencyVect_t currencies, mru_currencies;
4130 inner_GetCurrencySymbols(bFlag, currencies, mru_currencies);
4132 rList.resize(currencies.size());
4133 rCurrencyList.resize(currencies.size());
4135 for (
size_t j = 0; j < currencies.size(); j++) {
4136 rList[j] = std::move(currencies[j].m_label);
4137 rCurrencyList[j] = currencies[j].m_currencyIdx;
4142void SvxCurrencyToolBoxControl::inner_GetCurrencySymbols(
4144 SvxCurrencyVect_t &pCurrencies,
4145 SvxCurrencyVect_t &p_mru_currencies)
4151 pCurrencies.resize( p_mru_currencies.size() + 1);
4152 std::fill( pCurrencies.begin() + 1, pCurrencies.end(), SvxCurrencyData() );
4155 auto addCurrency = [&pCurrencies, &p_mru_currencies]
4156 (SvxCurrencyData& curr,
size_t position = SIZE_MAX)
4158 auto mruIter = std::find(p_mru_currencies.begin(), p_mru_currencies.end(), curr);
4160 if (mruIter == p_mru_currencies.end()) {
4161 if (position == SIZE_MAX)
4162 pCurrencies.push_back( std::move(curr) );
4164 pCurrencies.insert( pCurrencies.begin() + position, std::move(curr) );
4167 size_t index = mruIter - p_mru_currencies.begin();
4168 pCurrencies[
index] = std::move(curr);
4172 SvxCurrencyData aCurr( sal_uInt16(-1) );
4177 pCurrencies[0] = aCurr;
4179 aCurr.m_currencyIdx = 0;
4180 addCurrency( aCurr );
4183 sal_uInt16 nStart = pCurrencies.size();
4185 CollatorWrapper aCollator( ::comphelper::getProcessComponentContext() );
4188 static constexpr OUStringLiteral aTwoSpace(u
" ");
4191 for( sal_uInt16 i = 1;
i <
nCount; ++
i )
4193 SvxCurrencyData curr( i );
4195 curr.m_label += aTwoSpace;
4197 curr.m_label += aTwoSpace;
4201 SvxCurrencyVect_t::size_type j = nStart;
4202 for( ; j < pCurrencies.size(); ++j )
4203 if ( aCollator.compareString( curr.m_label, pCurrencies[j].m_label ) < 0 )
4206 addCurrency( curr, j );
4212 size_t nCont = pCurrencies.size();
4214 for ( sal_uInt16 i = 1;
i <
nCount; ++
i )
4216 bool bInsert =
true;
4217 SvxCurrencyData curr( i,
true );
4221 for ( ; j < pCurrencies.size() && bInsert; ++j )
4223 if( pCurrencies[j].m_label == curr.m_label )
4225 else if ( aCollator.compareString( curr.m_label, pCurrencies[j].m_label ) < 0 )
4229 addCurrency( curr, j );
4232 for (
int j = p_mru_currencies.size() - 1; j > 0; j-- )
4233 if ( pCurrencies[j].m_currencyIdx == SvxCurrencyData::InvalidCurrency )
4234 pCurrencies.erase( pCurrencies.begin() + j );
4238 : mpControl(pControl)
4243 [[maybe_unused]]
const OUString& ,
const NamedColor& rColor)
4271 : m_xButton(
std::move(pControl))
4272 , m_aColorWrapper(this)
4273 , m_aAutoDisplayColor(
Application::GetSettings().GetStyleSettings().GetDialogColor())
4275 , m_bShowNoneButton(false)
4276 , m_aTopLevelParentFunction(
std::move(aTopLevelParentFunction))
4293 if (rButton.get_active())
4316 css::uno::Reference<css::frame::XFrame>
xFrame(pFrame ? pFrame->
GetFrameInterface() : uno::Reference<css::frame::XFrame>());
4377 auto nColorTextWidth =
m_xButton->get_pixel_size(rEntry.
GetName()).Width();
4378 if (nColorTextWidth > nMaxStandardColorTextWidth)
4380 nMaxStandardColorTextWidth = nColorTextWidth;
4385 return m_xButton->get_preferred_size().Width();
4390 m_xButton->set_size_request(nWidth, -1);
4400 xDevice->SetOutputSize(aImageSize);
4405 const Color aG(0xef, 0xef, 0xef);
4406 int nMinDim = std::min(aImageSize.
Width(), aImageSize.
Height()) + 1;
4407 int nCheckSize = nMinDim / 3;
4408 xDevice->DrawCheckered(aRect.
TopLeft(), aRect.
GetSize(), std::min(nCheckSize, 8), aW, aG);
4409 xDevice->SetFillColor();
4416 xDevice->SetFillColor(rColor.
m_aColor);
4420 xDevice->DrawRect(aRect);
4427 : m_pMenuButton(pMenuButton)
4428 , m_pToolbar(nullptr)
4429 , m_pControl(nullptr)
4435 : m_pMenuButton(nullptr)
4436 , m_pToolbar(pToolbar)
4437 , m_aIdent(
std::move(aIdent))
4438 , m_pControl(nullptr)
4444 : m_pMenuButton(nullptr)
4445 , m_pToolbar(nullptr)
4446 , m_pControl(pControl)
4447 , m_xToolBox(pToolbar)
std::function< void(const OUString &, const NamedColor &)> ColorSelectFunction
PropertiesInfo aProperties
css::uno::Reference< css::lang::XComponent > m_xFrame
const StyleSettings & GetStyleSettings() const
static weld::Window * GetFrameWeld(const css::uno::Reference< css::awt::XWindow > &rWindow)
static OutputDevice * GetDefaultDevice()
static const AllSettings & GetSettings()
static ImplSVEvent * PostUserEvent(const Link< void *, void > &rLink, void *pCaller=nullptr, bool bReferenceLink=false)
const Size & GetSizePixel() const
std::unique_ptr< ColorWindow > m_xColorWindow
void ShowPreview(const NamedColor &rColor)
std::unique_ptr< weld::MenuButton > m_xButton
ColorListBox(std::unique_ptr< weld::MenuButton > pControl, TopLevelParentFunction aTopLevelParentFunction, const ColorListBox *pCache=nullptr)
void EnsurePaletteManager()
void Selected(const NamedColor &rNamedColor)
Link< ColorListBox &, void > m_aSelectedLink
int CalcBestWidthRequest()
NamedColor m_aSelectedColor
void LockWidthRequest(int nWidthRequest)
ColorStatus m_aColorStatus
void SelectEntry(const NamedColor &rColor)
ListBoxColorWrapper m_aColorWrapper
TopLevelParentFunction m_aTopLevelParentFunction
ColorWindow * getColorWindow() const
Color m_aAutoDisplayColor
void SetSlotId(sal_uInt16 nSlotId, bool bShowNoneButton=false)
std::shared_ptr< PaletteManager > m_xPaletteManager
void statusChanged(const css::frame::FeatureStateEvent &rEvent)
static bool SelectValueSetEntry(SvxColorValueSet *pColorSet, const Color &rColor)
std::unique_ptr< weld::Button > mxButtonAutoColor
std::shared_ptr< PaletteManager > mxPaletteManager
std::unique_ptr< SvxColorValueSet > mxRecentColorSet
virtual ~ColorWindow() override
weld::Button * mpDefaultButton
void SelectEntry(const NamedColor &rColor)
std::unique_ptr< weld::ComboBox > mxPaletteListBox
static NamedColor GetSelectEntryColor(ValueSet const *pColorSet)
bool IsNoSelection() const
ColorStatus & mrColorStatus
ColorWindow(OUString rCommand, std::shared_ptr< PaletteManager > xPaletteManager, ColorStatus &rColorStatus, sal_uInt16 nSlotId, const css::uno::Reference< css::frame::XFrame > &rFrame, const MenuOrToolMenuButton &rMenuButton, TopLevelParentFunction aTopLevelParentFunction, ColorSelectFunction aColorSelectFunction)
const sal_uInt16 theSlotId
virtual void GrabFocus() override
std::unique_ptr< SvxColorValueSet > mxColorSet
virtual void statusChanged(const css::frame::FeatureStateEvent &rEvent) override
std::unique_ptr< weld::Widget > mxAutomaticSeparator
std::unique_ptr< weld::Button > mxButtonPicker
NamedColor GetAutoColor() const
std::unique_ptr< weld::Button > mxButtonNoneColor
NamedColor GetSelectEntryColor() const
sal_uInt8 GetLuminance() const
void DecreaseContrast(sal_uInt8 cContDec)
void DecreaseLuminance(sal_uInt8 cLumDec)
bool IsFullyTransparent() const
OUString AsRGBHexString() const
DataChangedEventType GetType() const
AllSettingsFlags GetFlags() const
size_t GetFontNameCount() const
virtual void dispose() override
virtual void GetFocus() override
const vcl::KeyCode & GetKeyCode() const
LanguageType getLanguageType(bool bResolveSystem=true) const
static css::lang::Locale convertToLocale(LanguageType nLangID, bool bResolveSystem=true)
ListBoxColorWrapper(ColorListBox *pControl)
void operator()(const OUString &rCommand, const NamedColor &rColor)
sal_uInt16 GetModifier() const
float approximate_digit_width() const
const vcl::Font & GetFont() const
float GetDPIScaleFactor() const
void SetFont(const vcl::Font &rNewFont)
void DrawRect(const tools::Rectangle &rRect)
const Wallpaper & GetBackground() const
bool GetTextBoundRect(tools::Rectangle &rRect, const OUString &rStr, sal_Int32 nBase=0, sal_Int32 nIndex=0, sal_Int32 nLen=-1, sal_uLong nLayoutWidth=0, KernArraySpan aDXArray=KernArraySpan(), o3tl::span< const sal_Bool > pKashidaArray={}, const SalLayoutGlyphs *pGlyphs=nullptr) const
tools::Long GetTextWidth(const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, vcl::text::TextLayoutCache const *=nullptr, SalLayoutGlyphs const *const pLayoutCache=nullptr) const
void SetTextColor(const Color &rColor)
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
void Push(vcl::PushFlags nFlags=vcl::PushFlags::ALL)
tools::Long GetTextHeight() const
void DrawText(const Point &rStartPt, const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, std::vector< tools::Rectangle > *pVector=nullptr, OUString *pDisplayText=nullptr, const SalLayoutGlyphs *pLayoutCache=nullptr)
static bool GetThemeAndEffectIndex(sal_uInt16 nItemId, sal_uInt16 &rThemeIndex, sal_uInt16 &rEffectIndex)
const css::uno::Reference< css::frame::XFrame > & GetFrameInterface() const
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const
SfxItemPool * GetPool() const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
virtual SfxStyleSheetBasePool * GetStyleSheetPool()
MapUnit GetMapUnit() const
static SAL_WARN_UNUSED_RESULT SfxObjectShell * Current()
const SfxPoolItem * GetItem(sal_uInt16 nSlotId) const
virtual void StateChangedAtStatusListener(SfxItemState eState, const SfxPoolItem *pState) override
SvxStyleToolBoxControl & rControl
SfxStyleControllerItem_Impl(const Reference< XDispatchProvider > &rDispatchProvider, sal_uInt16 nSlotId, const OUString &rCommand, SvxStyleToolBoxControl &rTbxCtl)
SfxStyleSheetBase * First(SfxStyleFamily eFamily, SfxStyleSearchBits eMask=SfxStyleSearchBits::All)
virtual std::unique_ptr< SfxStyleSheetIterator > CreateIterator(SfxStyleFamily, SfxStyleSearchBits nMask=SfxStyleSearchBits::All)
SfxStyleSheetBase * Next()
const OUString & GetName() const
virtual std::optional< SfxItemSet > GetItemSetForPreview()
const OUString & GetStyleName() const
static SAL_WARN_UNUSED_RESULT SfxViewFrame * Current()
SfxFrame & GetFrame() const
void ShowChildWindow(sal_uInt16, bool bVisible=true)
constexpr tools::Long getHeight() const
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
constexpr tools::Long getWidth() const
void setWidth(tools::Long nWidth)
tools::Long AdjustWidth(tools::Long n)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
const Color & GetWindowColor() const
const Color & GetDialogTextColor() const
const Color & GetFieldColor() const
const Color & GetLabelTextColor() const
const Color & GetHighlightTextColor() const
const Color & GetDisableColor() const
const Size & GetListBoxPreviewDefaultPixelSize() const
static OUString GetLanguageString(const LanguageType eType)
static OUString GetLineStyleName(SvxBorderLineStyle eStyle)
static const sal_Int16 Thin
static const sal_Int16 Hairline
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
void SetValid(SvxBoxInfoItemValidFlags nValid, bool bValid=true)
void SetLine(const editeng::SvxBorderLine *pNew, SvxBoxInfoItemLine nLine)
static bool LineToSvxLine(const css::table::BorderLine &rLine, editeng::SvxBorderLine &rSvxLine, bool bConvert)
void SetLine(const editeng::SvxBorderLine *pNew, SvxBoxItemLine nLine)
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
const Color & GetValue() const
static sal_uInt32 getColumnCount()
static constexpr sal_uInt32 getMaxRowCount()
const FontList * GetFontList() const
void SetCaseMap(const SvxCaseMap eNew)
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
void SetLine(const editeng::SvxBorderLine *pNew)
static css::uno::Reference< css::awt::XWindow > GetInterface(vcl::Window *pWindow)
static vcl::Window * GetWindow(const css::uno::Reference< css::awt::XWindow > &rxWindow)
size_t GetItemCount() const
OUString GetItemText(sal_uInt16 nItemId) const
void SelectItem(sal_uInt16 nItemId)
sal_uInt16 GetSelectedItemId() const
virtual bool MouseButtonUp(const MouseEvent &rMEvt) override
ValueSet(std::unique_ptr< weld::ScrolledWindow > pScrolledWindow)
Color GetItemColor(sal_uInt16 nItemId) const
ValueSet & operator=(const ValueSet &)=delete
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea) override
reference_type * get() const
static VclPtr< reference_type > Create(Arg &&... arg)
const Color & GetColor() const
static XColorListRef CreateStdColorList()
const OUString & GetName() const
virtual void setProperty(const css::uno::Any &aProperty) override
std::unique_ptr< weld::Label > m_xLabel
void SetItalic(FontItalic)
sal_uInt16 GetCode() const
void Disable(bool bChild=true)
void Enable(bool bEnable=true, bool bChild=true)
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible()
virtual void DataChanged(const DataChangedEvent &rDCEvt)
weld::Window * GetFrameWeld() const
virtual std::unique_ptr< ComboBox > weld_combo_box(const OUString &id)=0
std::tuple< vcl::RenderContext &, const tools::Rectangle &, bool, const OUString & > render_args
virtual OutputDevice & get_ref_device()=0
virtual bool get_active() const=0
virtual void set_active(bool active)=0
constexpr ::Color COL_WHITE(0xFF, 0xFF, 0xFF)
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
std::function< weld::Window *()> TopLevelParentFunction
#define DBG_ASSERT(sCon, aError)
OUString SvxResId(TranslateId aId)
DECL_LINK(CheckNameHdl, SvxNameDialog &, bool)
OUString EditResId(TranslateId aId)
constexpr OUStringLiteral HID_STYLE_LISTBOX
constexpr OUStringLiteral HID_POPUP_LINE
constexpr OUStringLiteral HID_POPUP_COLOR_CTRL
constexpr OUStringLiteral HID_POPUP_COLOR
constexpr OUStringLiteral HID_POPUP_FRAME
constexpr sal_uInt16 KEY_ESCAPE
constexpr sal_uInt16 KEY_TAB
constexpr sal_uInt16 KEY_SHIFT
SVT_DLLPUBLIC OUString ApplyLreOrRleEmbedding(const OUString &rText)
#define LINK(Instance, Class, Member)
#define DECL_STATIC_LINK(Class, Member, ArgType, RetType)
#define SAL_WARN(area, stream)
std::unique_ptr< sal_Int32[]> pData
void Clear(EHistoryType eHistory)
LanguageType GetLanguage(SfxItemSet const &aSet, sal_uInt16 nLangWhichId)
enum SAL_DLLPUBLIC_RTTI FillStyle
const LanguageTag & getLocale()
class SvxPropertySetInfoPool
bool dispatchCommand(const OUString &rCommand, const uno::Reference< css::frame::XFrame > &rFrame, const css::uno::Sequence< css::beans::PropertyValue > &rArguments, const uno::Reference< css::frame::XDispatchResultListener > &rListener)
css::uno::Sequence< css::beans::PropertyValue > InitPropertySequence(::std::initializer_list< ::std::pair< OUString, css::uno::Any > > vInit)
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
css::uno::Sequence< OUString > getSupportedServiceNames()
OUString getImplementationName()
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
void Create(SvxOrientationItem &rItem, SvStream &rStrm, sal_uInt16)
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
std::basic_string_view< charT, traits > trim(std::basic_string_view< charT, traits > str)
sal_Int16 GetCaseMap(sal_Int32 nToken)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
Sequence< beans::PropertyValue > GetCommandProperties(const OUString &rsCommandName, const OUString &rsModuleName)
OUString GetLabelForCommand(const css::uno::Sequence< css::beans::PropertyValue > &rProperties)
Reference< XNameAccess > m_xContainer
Reference< XFrame > xFrame
Reference< XModel > xModel
IMPL_LINK(SvxStyleBox_Base, CustomGetSizeHdl, OutputDevice &, rArg, Size)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_svx_StyleToolBoxControl_get_implementation(css::uno::XComponentContext *, css::uno::Sequence< css::uno::Any > const &)
static const char * StyleSlotToStyleCommand[MAX_FAMILIES]
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_svx_FontNameToolBoxControl_get_implementation(css::uno::XComponentContext *, css::uno::Sequence< css::uno::Any > const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_svx_FrameToolBoxControl_get_implementation(css::uno::XComponentContext *rContext, css::uno::Sequence< css::uno::Any > const &)
#define MAX_MRU_CURRENCIES
static bool GetWhich(const SfxItemSet &rSet, sal_uInt16 nSlot, sal_uInt16 &rWhich)
IMPL_STATIC_LINK_NOARG(SvxStyleBox_Base, ShowMoreHdl, void *, void)
#define MAX_MRU_FONTNAME_ENTRIES
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_svx_ColorToolBoxControl_get_implementation(css::uno::XComponentContext *rContext, css::uno::Sequence< css::uno::Any > const &)
static void SetFontStyle(const SfxItemSet &rSet, sal_uInt16 nPosture, sal_uInt16 nWeight, SvxFont &rFont)
static bool lcl_GetDocFontList(const FontList **ppFontList, SvxFontNameBox_Base *pBox)
static bool SetFont(const SfxItemSet &rSet, sal_uInt16 nSlot, SvxFont &rFont)
static Color lcl_mediumColor(Color aMain, Color)
#define COMBO_WIDTH_IN_CHARS
static bool SetFontSize(vcl::RenderContext &rRenderContext, const SfxItemSet &rSet, sal_uInt16 nSlot, SvxFont &rFont)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_svx_CurrencyToolBoxControl_get_implementation(css::uno::XComponentContext *rContext, css::uno::Sequence< css::uno::Any > const &)
IMPL_LINK_NOARG(SvxStyleBox_Base, ActivateHdl, weld::ComboBox &, bool)
constexpr OUStringLiteral sNone
#define WB_NO_DIRECTSELECT
constexpr TypedWhichId< XFillColorItem > XATTR_FILLCOLOR(XATTR_FILL_FIRST+1)
constexpr TypedWhichId< XFillStyleItem > XATTR_FILLSTYLE(XATTR_FILL_FIRST)
std::vector< OUString > NfWSStringsDtor
constexpr sal_uInt32 NUMBERFORMAT_ENTRY_NOT_FOUND