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>
100#include <bitmaps.hlst>
107#include <editeng/editeng.hxx>
109#define MAX_MRU_FONTNAME_ENTRIES 5
111#define COMBO_WIDTH_IN_CHARS 18
130 , scriptType(scrptType)
136class SvxStyleBox_Base
139 SvxStyleBox_Base(std::unique_ptr<weld::ComboBox> xWidget, OUString rCommand,
SfxStyleFamily eFamily,
140 const Reference<XDispatchProvider>& rDispatchProvider,
141 const Reference<XFrame>& _xFrame, OUString aClearFormatKey,
144 virtual ~SvxStyleBox_Base()
150 void SetDefaultStyle(
const OUString& rDefault ) { sDefaultStyle = rDefault; }
152 int get_count()
const {
return m_xWidget->get_count(); }
154 OUString get_active_text()
const {
return m_xWidget->get_active_text(); }
156 void append_text(
const OUString& rStr)
162 void insert_separator(
int pos,
const OUString& rId)
167 void set_active_or_entry_text(
const OUString& rText)
169 const int nFound =
m_xWidget->find_text(rText);
176 void set_active(
int nActive)
194 m_nMaxUserDrawFontWidth = 0;
202 virtual bool DoKeyInput(
const KeyEvent& rKEvt);
205 std::optional<SvxFont> m_oFont;
206 std::optional<SvxFont> m_oCJKFont;
207 std::optional<SvxFont> m_oCTLFont;
220 void Select(
bool bNonTravelSelect);
227 std::unique_ptr<weld::Builder> m_xMenuBuilder;
228 std::unique_ptr<weld::Menu> m_xMenu;
229 std::unique_ptr<weld::ComboBox>
m_xWidget;
232 int m_nMaxUserDrawFontWidth;
233 int m_nLastItemWithMenu;
235 Reference< XDispatchProvider > m_xDispatchProvider;
238 OUString aClearFormatKey;
240 OUString sDefaultStyle;
244 static Color TestColorsVisible(
const Color &FontCol,
const Color &BackCol);
247 DECL_LINK(MenuSelectHdl,
const OString&,
void);
252 ,
public SvxStyleBox_Base
255 SvxStyleBox_Impl(
vcl::Window* pParent,
const OUString& rCommand,
SfxStyleFamily eFamily,
const Reference< XDispatchProvider >& rDispatchProvider,
256 const Reference< XFrame >& _xFrame,
const OUString& rClearFormatKey,
const OUString& rMoreKey,
bool bInSpecialMode,
SvxStyleToolBoxControl& rCtrl);
258 virtual ~SvxStyleBox_Impl()
override
263 virtual void dispose()
override
267 m_xMenuBuilder.reset();
271 virtual bool DoKeyInput(
const KeyEvent& rKEvt)
override;
276 void SetOptimalSize();
279class SvxFontNameBox_Impl;
280class SvxFontNameBox_Base;
282class SvxFontNameToolBoxControl final :
public cppu::ImplInheritanceHelper<svt::ToolboxController,
283 css::lang::XServiceInfo>
286 SvxFontNameToolBoxControl();
289 virtual void SAL_CALL statusChanged(
const css::frame::FeatureStateEvent& rEvent )
override;
292 virtual css::uno::Reference<css::awt::XWindow> SAL_CALL createItemWindow(
const css::uno::Reference<css::awt::XWindow>& rParent)
override;
295 virtual void SAL_CALL
dispose()
override;
304 std::unique_ptr<SvxFontNameBox_Base> m_xWeldBox;
305 SvxFontNameBox_Base* m_pBox;
311 SvxFontNameBox_Base& m_rBox;
313 virtual void setProperty(
const css::uno::Any &rProperty)
override;
322class SvxFontNameBox_Base
326 FontOptionsListener m_aWYSIWYG;
327 FontOptionsListener m_aHistory;
330 SvxFontNameToolBoxControl& m_rCtrl;
334 ::std::unique_ptr<FontList> m_aOwnFontList;
338 Reference< XDispatchProvider > m_xDispatchProvider;
340 bool mbCheckingUnknownFont;
342 void ReleaseFocus_Impl();
344 void Select(
bool bNonTravelSelect);
348 Sequence< PropertyValue > aArgs;
350 ".uno:CharEndPreviewFontName",
353 void CheckAndMarkUnknownFont();
356 SvxFontNameBox_Base(std::unique_ptr<weld::ComboBox> xWidget,
const Reference<XDispatchProvider>& rDispatchProvider,
357 const Reference<XFrame>& rFrame, SvxFontNameToolBoxControl& rCtrl);
358 virtual ~SvxFontNameBox_Base()
364 void Update(
const css::awt::FontDescriptor* pFontDesc );
365 sal_uInt16 GetListCount()
const {
return nFtCount; }
373 void SetOwnFontList(::std::unique_ptr<FontList> && _aOwnFontList) { m_aOwnFontList = std::move(_aOwnFontList); }
375 virtual void set_sensitive(
bool bSensitive)
380 void set_active_or_entry_text(
const OUString& rText);
382 void statusChanged_Impl(
const css::frame::FeatureStateEvent& rEvent);
384 virtual bool DoKeyInput(
const KeyEvent& rKEvt);
386 void EnableControls();
396void FontOptionsListener::setProperty(
const css::uno::Any &rProperty)
399 m_rBox.EnableControls();
403 ,
public SvxFontNameBox_Base
414 void SetOptimalSize();
416 virtual bool DoKeyInput(
const KeyEvent& rKEvt)
override;
419 SvxFontNameBox_Impl(
vcl::Window* pParent,
const Reference<XDispatchProvider>& rDispatchProvider,
420 const Reference<XFrame>& rFrame, SvxFontNameToolBoxControl& rCtrl);
422 virtual void dispose()
override
428 virtual ~SvxFontNameBox_Impl()
override
433 virtual Reference< css::accessibility::XAccessible >
CreateAccessible()
override;
435 virtual void set_sensitive(
bool bSensitive)
override
447class SvxFrmValueSet_Impl final :
public ValueSet
450 sal_uInt16 nModifier;
459 SvxFrmValueSet_Impl()
464 sal_uInt16 GetModifier()
const {
return nModifier;}
471class SvxFrameToolBoxControl;
477 std::unique_ptr<SvxFrmValueSet_Impl> mxFrameSet;
478 std::unique_ptr<weld::CustomWeld> mxFrameSetWin;
479 std::vector<std::pair<BitmapEx, OUString>> aImgVec;
483 void InitImageList();
484 void CalcSizeValueSet();
487 void SetDiagonalDownBorder(
const SvxLineItem& dDownLineItem);
488 void SetDiagonalUpBorder(
const SvxLineItem& dUpLineItem);
491 SvxFrameWindow_Impl(SvxFrameToolBoxControl* pControl,
weld::Widget* pParent);
494 mxFrameSet->GrabFocus();
497 virtual void statusChanged(
const css::frame::FeatureStateEvent& rEvent )
override;
503 explicit SvxFrameToolBoxControl(
const css::uno::Reference< css::uno::XComponentContext >& rContext );
506 virtual void SAL_CALL initialize(
const css::uno::Sequence< css::uno::Any >& rArguments )
override;
512 virtual void SAL_CALL execute(sal_Int16 nKeyModifier)
override;
518 class LineListBox final :
public ValueSet
531 return UpdateEntries( nOldWidth );
534 void SetNone(
const OUString& sNone )
542 ColorFunc pColor1Fn = &sameColor,
543 ColorFunc pColor2Fn = &sameColor,
544 ColorDistFunc pColorDistFn = &sameDistColor);
550 void SetSourceUnit(
FieldUnit eNewUnit ) { eSourceUnit = eNewUnit; }
552 const Color& GetColor()
const {
return aColor; }
561 void UpdatePaintLineColor();
564 sal_Int32 GetStylePos( sal_Int32 nListPos,
tools::Long nWidth );
566 const Color& GetPaintColor()
const
571 Color GetColorLine1( sal_Int32 nPos );
572 Color GetColorLine2( sal_Int32 nPos );
573 Color GetColorDist( sal_Int32 nPos );
575 LineListBox(
const LineListBox& ) =
delete;
576 LineListBox&
operator =(
const LineListBox& ) =
delete;
578 std::vector<std::unique_ptr<ImpLineListData>> m_vLineList;
591 size_t nPos = GetSelectItemPos();
592 if (nPos != VALUESET_ITEM_NOTFOUND)
594 if (!m_sNone.isEmpty())
596 nStyle = GetEntryStyle( nPos );
606 auto nMinWidth = GetDrawingArea()->get_ref_device().approximate_digit_width() *
COMBO_WIDTH_IN_CHARS;
607 Size aSize(nMinWidth, aTxtSize.Height());
608 aSize.AdjustWidth( -(aTxtSize.Width()) );
609 aSize.AdjustWidth( -6 );
612 if ( eSourceUnit == FieldUnit::POINT )
620 aSize = aVirDev->PixelToLogic( aSize );
622 sal_uInt32
n1 = nLine1;
623 sal_uInt32
n2 = nLine2;
635 if ( nVirHeight > aSize.Height() )
636 aSize.setHeight( nVirHeight );
638 if ( aSize.Width() <= 0 )
641 Size aVirSize = aVirDev->LogicToPixel( aSize );
642 if ( aVirDev->GetOutputSizePixel() != aVirSize )
643 aVirDev->SetOutputSizePixel( aVirSize );
644 aVirDev->SetFillColor( aColorDist );
647 aVirDev->SetFillColor( aColor1 );
649 double y1 = double( n1 ) / 2;
654 double y2 =
n1 + nDist + double( n2 ) / 2;
655 aVirDev->SetFillColor( aColor2 );
658 rBmp = aVirDev->GetBitmapEx(
Point(),
Size( aSize.Width(), n1+nDist+n2 ) );
661 LineListBox::LineListBox()
665 , aColor(
Application::GetSettings().GetStyleSettings().GetWindowTextColor())
669 aVirDev->SetLineColor();
670 aVirDev->SetMapMode(
MapMode( MapUnit::MapTwip ) );
682 UpdatePaintLineColor();
685 sal_Int32 LineListBox::GetStylePos( sal_Int32 nListPos,
tools::Long nWidth )
688 if (!m_sNone.isEmpty())
693 size_t nCount = m_vLineList.size();
694 while ( nPos == -1 && i < nCount )
696 auto&
pData = m_vLineList[
i ];
697 if (
pData->GetMinWidth() <= nWidth )
700 nPos =
static_cast<sal_Int32
>(
i);
709 void LineListBox::InsertEntry(
711 ColorFunc pColor1Fn, ColorFunc pColor2Fn, ColorDistFunc pColorDistFn )
714 rWidthImpl, nStyle, nMinWidth, pColor1Fn, pColor2Fn, pColorDistFn));
720 return pData ?
pData->GetStyle() : SvxBorderLineStyle::NONE;
723 void LineListBox::UpdatePaintLineColor()
728 bool bRet = aNewCol != maPaintCol;
731 maPaintCol = aNewCol;
738 UpdatePaintLineColor( );
740 sal_Int32 nSelEntry = GetSelectItemPos();
741 sal_Int32 nTypePos = GetStylePos( nSelEntry, nOldWidth );
749 if (!m_sNone.isEmpty())
750 InsertItem(nId++,
Image(), m_sNone);
753 sal_uInt16
nCount = m_vLineList.size( );
756 auto&
pData = m_vLineList[
n ];
757 if (
pData->GetMinWidth() <= m_nWidth )
760 ImpGetLine(
pData->GetLine1ForWidth( m_nWidth ),
761 pData->GetLine2ForWidth( m_nWidth ),
762 pData->GetDistForWidth( m_nWidth ),
763 GetColorLine1( GetItemCount( ) ),
764 GetColorLine2( GetItemCount( ) ),
765 GetColorDist( GetItemCount( ) ),
766 pData->GetStyle(), aBmp );
776 else if ( n == nTypePos )
787 Color LineListBox::GetColorLine1( sal_Int32 nPos )
789 sal_Int32 nStyle = GetStylePos( nPos, m_nWidth );
791 return GetPaintColor( );
792 auto&
pData = m_vLineList[ nStyle ];
793 return pData->GetColorLine1( GetColor( ) );
796 Color LineListBox::GetColorLine2( sal_Int32 nPos )
798 sal_Int32 nStyle = GetStylePos( nPos, m_nWidth );
800 return GetPaintColor( );
801 auto&
pData = m_vLineList[ nStyle ];
802 return pData->GetColorLine2( GetColor( ) );
805 Color LineListBox::GetColorDist( sal_Int32 nPos )
809 sal_Int32 nStyle = GetStylePos( nPos, m_nWidth );
812 auto&
pData = m_vLineList[ nStyle ];
813 return pData->GetColorDist( GetColor( ), rResult );
823 std::unique_ptr<LineListBox> m_xLineStyleLb;
824 std::unique_ptr<weld::CustomWeld> m_xLineStyleLbWin;
830 SvxLineWindow_Impl(SvxFrameToolBoxControl* pControl,
weld::Widget* pParent);
833 m_xLineStyleLb->GrabFocus();
846 const OUString& rCommand,
856#define BUTTON_PADDING 10
857#define ITEM_HEIGHT 30
859SvxStyleBox_Base::SvxStyleBox_Base(std::unique_ptr<weld::ComboBox> xWidget,
862 const Reference< XDispatchProvider >& rDispatchProvider,
863 const Reference< XFrame >& _xFrame,
864 OUString _aClearFormatKey,
868 , m_xMenuBuilder(
Application::CreateBuilder(nullptr,
"svx/ui/stylemenu.ui"))
869 , m_xMenu(m_xMenuBuilder->weld_menu(
"menu"))
871 , eStyleFamily( eFamily )
872 , m_nMaxUserDrawFontWidth(0)
873 , m_nLastItemWithMenu(-1)
875 , m_xDispatchProvider( rDispatchProvider )
878 , aClearFormatKey(
std::move( _aClearFormatKey ))
879 , aMoreKey(
std::move( _aMoreKey ))
880 , bInSpecialMode( bInSpec )
882 m_xWidget->connect_changed(
LINK(
this, SvxStyleBox_Base, SelectHdl));
883 m_xWidget->connect_key_press(
LINK(
this, SvxStyleBox_Base, KeyInputHdl));
884 m_xWidget->connect_entry_activate(
LINK(
this, SvxStyleBox_Base, ActivateHdl));
885 m_xWidget->connect_focus_out(
LINK(
this, SvxStyleBox_Base, FocusOutHdl));
886 m_xWidget->connect_get_property_tree(
LINK(
this, SvxStyleBox_Base, DumpAsPropertyTreeHdl));
889 m_xMenu->connect_activate(
LINK(
this, SvxStyleBox_Base, MenuSelectHdl));
891 m_xWidget->connect_custom_get_size(
LINK(
this, SvxStyleBox_Base, CustomGetSizeHdl));
892 m_xWidget->connect_custom_render(
LINK(
this, SvxStyleBox_Base, CustomRenderHdl));
900 CalcOptimalExtraUserWidth(rArg);
904SvxStyleBox_Impl::SvxStyleBox_Impl(
vcl::Window* pParent,
905 const OUString& rCommand,
907 const Reference< XDispatchProvider >& rDispatchProvider,
908 const Reference< XFrame >& _xFrame,
909 const OUString& rClearFormatKey,
910 const OUString& rMoreKey,
913 , SvxStyleBox_Base(m_xBuilder->weld_combo_box(
"applystyle"), rCommand, eFamily,
914 rDispatchProvider, _xFrame, rClearFormatKey, rMoreKey, bInSpec, rCtrl)
918 set_id(
"applystyle");
922void SvxStyleBox_Base::ReleaseFocus()
930 m_xFrame->getContainerWindow()->setFocus();
933IMPL_LINK(SvxStyleBox_Base, MenuSelectHdl,
const OString&, 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 if (rMenuIdent ==
"update")
948 ".uno:StyleUpdateByExample", aArgs );
950 else if (rMenuIdent ==
"edit")
953 ".uno:EditStyle", aArgs );
960 DBG_ASSERT( pViewFrm,
"SvxStyleBox_Base::Select(): no viewframe" );
969 Select(rCombo.changed_by_direct_pick());
978void SvxStyleBox_Base::Select(
bool bNonTravelSelect)
980 if (!bNonTravelSelect)
983 OUString aSearchEntry(
m_xWidget->get_active_text());
984 bool bDoIt =
true, bClear =
false;
987 if( aSearchEntry == aClearFormatKey &&
m_xWidget->get_active() == 0 )
989 aSearchEntry = sDefaultStyle;
992 Sequence< PropertyValue > aEmptyVals;
996 else if (aSearchEntry == aMoreKey &&
m_xWidget->get_active() == (
m_xWidget->get_count() - 1))
1000 set_active_or_entry_text(
m_xWidget->get_saved_value());
1010 bool bCreateNew =
false;
1014 pStyle = pPool->
First(eStyleFamily);
1015 while ( pStyle && pStyle->
GetName() != aSearchEntry )
1016 pStyle = pPool->
Next();
1035 set_active_or_entry_text(aSearchEntry);
1038 Sequence< PropertyValue > aArgs( 2 );
1039 auto pArgs = aArgs.getArray();
1040 pArgs[0].Value <<= aSearchEntry;
1041 pArgs[1].Name =
"Family";
1042 pArgs[1].Value <<= sal_Int16( eStyleFamily );
1045 pArgs[0].Name =
"Param";
1050 pArgs[0].Name =
"Template";
1057 eStyleFamily = eNewFamily;
1063 set_active_or_entry_text(
m_xWidget->get_saved_value());
1068 return DoKeyInput(rKEvt);
1071bool SvxStyleBox_Base::DoKeyInput(
const KeyEvent& rKEvt)
1073 bool bHandled =
false;
1084 set_active_or_entry_text(
m_xWidget->get_saved_value());
1085 if (!m_rCtrl.IsInSidebar())
1096bool SvxStyleBox_Impl::DoKeyInput(
const KeyEvent& rKEvt)
1098 return SvxStyleBox_Base::DoKeyInput(rKEvt) || ChildKeyInput(rKEvt);
1103 if ( (rDCEvt.
GetType() == DataChangedEventType::SETTINGS) &&
1104 (rDCEvt.
GetFlags() & AllSettingsFlags::STYLE) )
1112void SvxStyleBox_Impl::SetOptimalSize()
1120 SetSizePixel(get_preferred_size());
1125std::vector<ScriptInfo> CheckScript(
const OUString &rStyleName)
1127 assert(!rStyleName.isEmpty());
1129 std::vector<ScriptInfo> aScriptChanges;
1132 aEditEngine.SetText(rStyleName);
1134 auto aScript = aEditEngine.GetScriptType({ 0, 0, 0, 0 });
1135 for (sal_Int32 i = 1;
i <= rStyleName.getLength();
i++)
1137 auto aNextScript = aEditEngine.GetScriptType({ 0,
i, 0,
i });
1138 if (aNextScript != aScript || i == rStyleName.getLength())
1139 aScriptChanges.emplace_back(aScript, i);
1140 aScript = aNextScript;
1143 return aScriptChanges;
1147tools::Rectangle SvxStyleBox_Base::CalcBoundRect(
vcl::RenderContext& rRenderContext,
const OUString &rStyleName, std::vector<ScriptInfo>& rScriptChanges,
double fRatio)
1152 sal_uInt16 nIdx = 0;
1153 sal_Int32 nStart = 0;
1155 size_t nCnt = rScriptChanges.size();
1159 nEnd = rScriptChanges[nIdx].changePos;
1160 aScript = rScriptChanges[nIdx].scriptType;
1164 nEnd = rStyleName.getLength();
1165 aScript = SvtScriptType::LATIN;
1170 auto oFont = (aScript == SvtScriptType::ASIAN) ?
1172 ((aScript == SvtScriptType::COMPLEX) ?
1179 rRenderContext.
SetFont(*oFont);
1184 Size aPixelSize(aFont.GetFontSize());
1185 aPixelSize.setWidth(aPixelSize.Width() * fRatio);
1186 aPixelSize.setHeight(aPixelSize.Height() * fRatio);
1187 aFont.SetFontSize(aPixelSize);
1188 rRenderContext.
SetFont(aFont);
1192 rRenderContext.
GetTextBoundRect(aRect, rStyleName, nStart, nStart, nEnd - nStart);
1193 aTextRect = aTextRect.
Union(aRect);
1197 rRenderContext.
Pop();
1199 if (nIdx >= rScriptChanges.size())
1202 rScriptChanges[nIdx++].textWidth = nWidth;
1204 if (nEnd < rStyleName.getLength() && nIdx < nCnt)
1207 nEnd = rScriptChanges[nIdx].changePos;
1208 aScript = rScriptChanges[nIdx].scriptType;
1223 const int nLeftDistance = 8;
1226 aPos.AdjustX(nLeftDistance );
1235 sal_uInt16 nIdx = 0;
1236 sal_Int32 nStart = 0;
1238 size_t nCnt = rScriptChanges.size();
1242 nEnd = rScriptChanges[nIdx].changePos;
1243 aScript = rScriptChanges[nIdx].scriptType;
1247 nEnd = rStyleName.getLength();
1248 aScript = SvtScriptType::LATIN;
1254 auto oFont = (aScript == SvtScriptType::ASIAN) ?
1256 ((aScript == SvtScriptType::COMPLEX) ?
1263 rRenderContext.
SetFont(*oFont);
1268 Size aPixelSize(aFont.GetFontSize());
1269 aPixelSize.setWidth(aPixelSize.Width() * fRatio);
1270 aPixelSize.setHeight(aPixelSize.Height() * fRatio);
1271 aFont.SetFontSize(aPixelSize);
1272 rRenderContext.
SetFont(aFont);
1275 rRenderContext.
DrawText(aPos, rStyleName, nStart, nEnd - nStart);
1277 rRenderContext.
Pop();
1279 aPos.AdjustX(rScriptChanges[nIdx++].textWidth * fRatio);
1280 if (nEnd < rStyleName.getLength() && nIdx < nCnt)
1283 nEnd = rScriptChanges[nIdx].changePos;
1284 aScript = rScriptChanges[nIdx].scriptType;
1304 rFont.SetFamilyName(rFontItem.GetFamilyName());
1305 rFont.SetStyleName(rFontItem.GetStyleName());
1318 Size aFontSize(0, rFontHeightItem.GetHeight());
1320 rFont.SetFontSize(aPixelSize);
1332 rFont.SetItalic(rItem.GetPosture());
1338 rFont.SetWeight(rItem.GetWeight());
1342void SvxStyleBox_Base::SetupEntry(
vcl::RenderContext& rRenderContext, sal_Int32 nItem,
const tools::Rectangle& rRect, std::u16string_view rStyleName,
bool bIsNotSelected)
1345 if (!bIsNotSelected)
1351 if (!bIsNotSelected)
1353 if (nItem == 0 || nItem ==
m_xWidget->get_count() - 1)
1354 m_xWidget->set_item_menu(OString::number(nItem),
nullptr);
1357 m_nLastItemWithMenu = nItem;
1358 m_xWidget->set_item_menu(OString::number(nItem), m_xMenu.get());
1362 if (nItem <= 0 || nItem >=
m_xWidget->get_count() - 1)
1374 while (pStyle && pStyle->
GetName() != rStyleName)
1375 pStyle = pPool->
Next();
1381 if (!pItemSet)
return;
1387 SetFontStyle(*pItemSet, SID_ATTR_CHAR_POSTURE, SID_ATTR_CHAR_WEIGHT, aFont);
1388 SetFontStyle(*pItemSet, SID_ATTR_CHAR_CJK_POSTURE, SID_ATTR_CHAR_CJK_WEIGHT, aCJKFont);
1389 SetFontStyle(*pItemSet, SID_ATTR_CHAR_CTL_POSTURE, SID_ATTR_CHAR_CTL_WEIGHT, aCTLFont);
1391 const SfxPoolItem *pItem = pItemSet->GetItem( SID_ATTR_CHAR_CONTOUR );
1395 aFont.SetOutline(aVal);
1396 aCJKFont.SetOutline(aVal);
1397 aCTLFont.SetOutline(aVal);
1400 pItem = pItemSet->GetItem( SID_ATTR_CHAR_SHADOWED );
1404 aFont.SetShadow(aVal);
1405 aCJKFont.SetShadow(aVal);
1406 aCTLFont.SetShadow(aVal);
1409 pItem = pItemSet->GetItem( SID_ATTR_CHAR_RELIEF );
1413 aFont.SetRelief(aVal);
1414 aCJKFont.SetRelief(aVal);
1415 aCTLFont.SetRelief(aVal);
1418 pItem = pItemSet->GetItem( SID_ATTR_CHAR_UNDERLINE );
1422 aFont.SetUnderline(aVal);
1423 aCJKFont.SetUnderline(aVal);
1424 aCTLFont.SetUnderline(aVal);
1427 pItem = pItemSet->GetItem( SID_ATTR_CHAR_OVERLINE );
1431 aFont.SetOverline(aVal);
1432 aCJKFont.SetOverline(aVal);
1433 aCTLFont.SetOverline(aVal);
1436 pItem = pItemSet->GetItem( SID_ATTR_CHAR_STRIKEOUT );
1440 aFont.SetStrikeout(aVal);
1441 aCJKFont.SetStrikeout(aVal);
1442 aCTLFont.SetStrikeout(aVal);
1445 pItem = pItemSet->GetItem( SID_ATTR_CHAR_CASEMAP );
1454 pItem = pItemSet->GetItem( SID_ATTR_CHAR_EMPHASISMARK );
1458 aFont.SetEmphasisMark(aVal);
1459 aCJKFont.SetEmphasisMark(aVal);
1460 aCTLFont.SetEmphasisMark(aVal);
1466 pItem = pItemSet->GetItem( SID_ATTR_CHAR_COLOR );
1468 if ( (
nullptr != pItem) && bIsNotSelected)
1475 if ( (
nullptr != pItem) && bIsNotSelected)
1480 case drawing::FillStyle_SOLID:
1484 if (
nullptr != pItem )
1485 aBackCol =
static_cast< const XFillColorItem*
>( pItem )->GetColorValue();
1487 if ( aBackCol != COL_AUTO )
1500 if( (aFontCol != COL_AUTO) || (aBackCol !=
COL_AUTO) )
1501 aFontCol = TestColorsVisible(aFontCol, (aBackCol != COL_AUTO) ? aBackCol : rRenderContext.
GetBackground().
GetColor());
1504 if ( aFontCol != COL_AUTO )
1507 if (
SetFont(*pItemSet, SID_ATTR_CHAR_FONT, aFont) &&
1508 SetFontSize(rRenderContext, *pItemSet, SID_ATTR_CHAR_FONTHEIGHT, aFont))
1511 if (
SetFont(*pItemSet, SID_ATTR_CHAR_CJK_FONT, aCJKFont) &&
1512 SetFontSize(rRenderContext, *pItemSet, SID_ATTR_CHAR_CJK_FONTHEIGHT, aCJKFont))
1513 m_oCJKFont = aCJKFont;
1515 if (
SetFont(*pItemSet, SID_ATTR_CHAR_CTL_FONT, aCTLFont) &&
1516 SetFontSize(rRenderContext, *pItemSet, SID_ATTR_CHAR_CTL_FONTHEIGHT, aCTLFont))
1517 m_oCTLFont = aCTLFont;
1523 const ::tools::Rectangle& rRect = std::get<1>(aPayload);
1524 bool bSelected = std::get<2>(aPayload);
1525 const OUString& rId = std::get<3>(aPayload);
1527 sal_uInt32
nIndex = rId.toUInt32();
1533 SetupEntry(rRenderContext,
nIndex, rRect, aStyleName, !bSelected);
1534 auto aScriptChanges = CheckScript(aStyleName);
1535 auto aTextRect = CalcBoundRect(rRenderContext, aStyleName, aScriptChanges);
1536 UserDrawEntry(rRenderContext, rRect, aTextRect, aStyleName, aScriptChanges);
1538 rRenderContext.
Pop();
1543 if (m_nMaxUserDrawFontWidth)
1547 sal_Int32 nEntryCount =
m_xWidget->get_count();
1548 for (sal_Int32 i = 0;
i < nEntryCount; ++
i)
1550 OUString sStyleName(get_text(i));
1556 nMaxNormalFontWidth = std::max(nWidth, nMaxNormalFontWidth);
1559 m_nMaxUserDrawFontWidth = nMaxNormalFontWidth;
1560 for (sal_Int32 i = 1;
i < nEntryCount-1; ++
i)
1562 OUString sStyleName(get_text(i));
1564 if (sStyleName.isEmpty())
1569 auto aScriptChanges = CheckScript(sStyleName);
1570 tools::Rectangle aTextRectForActualFont = CalcBoundRect(rRenderContext, sStyleName, aScriptChanges);
1574 double fRatio =
static_cast<double>(
ITEM_HEIGHT) / aTextRectForActualFont.
Bottom();
1575 aTextRectForActualFont = CalcBoundRect(rRenderContext, sStyleName, aScriptChanges, fRatio);
1577 rRenderContext.
Pop();
1581 m_nMaxUserDrawFontWidth = std::max(nWidth, m_nMaxUserDrawFontWidth);
1590Color SvxStyleBox_Base::TestColorsVisible(
const Color &FontCol,
const Color &BackCol)
1594 Color retCol = FontCol;
1599 if((lumi > 120) && (lumi < 140))
1611 auto entriesNode = rJsonWriter.startNode(
"entries");
1612 for (
int i = 0, nEntryCount =
m_xWidget->get_count();
i < nEntryCount; ++
i)
1614 auto entryNode = rJsonWriter.startNode(
"");
1620 rJsonWriter.put(
"selectedCount",
static_cast<sal_Int32
>(nActive == -1 ? 0 : 1));
1623 auto selectedNode = rJsonWriter.startNode(
"selectedEntries");
1626 auto node = rJsonWriter.startNode(
"");
1627 rJsonWriter.put(
"",
static_cast<sal_Int32
>(nActive));
1631 rJsonWriter.put(
"command",
".uno:StyleApply");
1636 bool bChanged =
false;
1646 *ppFontList = aFontList.get();
1647 pBox->SetOwnFontList(std::move(aFontList));
1651 if ( pFontListItem )
1654 DBG_ASSERT( pNewFontList,
"Doc-FontList not available!" );
1657 if ( !*ppFontList && pNewFontList )
1660 *ppFontList = pNewFontList;
1670 ( ( *ppFontList != pNewFontList ) ||
1675 *ppFontList = pNewFontList;
1679 pBox->set_sensitive(
true);
1681 else if ( pBox && ( pDocSh || !ppFontList ))
1690 pBox->set_sensitive(
false);
1694 if ( pBox && bChanged )
1697 pBox->Fill( *ppFontList );
1704SvxFontNameBox_Base::SvxFontNameBox_Base(std::unique_ptr<weld::ComboBox> xWidget,
1705 const Reference<XDispatchProvider>& rDispatchProvider,
1706 const Reference<XFrame>& rFrame,
1707 SvxFontNameToolBoxControl& rCtrl)
1709 , m_aWYSIWYG(
m_xListener,
"ShowFontBoxWYSIWYG", *this)
1713 , pFontList(nullptr)
1716 , m_xDispatchProvider(rDispatchProvider)
1718 , mbCheckingUnknownFont(false)
1722 m_xWidget->connect_changed(
LINK(
this, SvxFontNameBox_Base, SelectHdl));
1723 m_xWidget->connect_key_press(
LINK(
this, SvxFontNameBox_Base, KeyInputHdl));
1724 m_xWidget->connect_entry_activate(
LINK(
this, SvxFontNameBox_Base, ActivateHdl));
1725 m_xWidget->connect_focus_in(
LINK(
this, SvxFontNameBox_Base, FocusInHdl));
1726 m_xWidget->connect_focus_out(
LINK(
this, SvxFontNameBox_Base, FocusOutHdl));
1727 m_xWidget->connect_get_property_tree(
LINK(
this, SvxFontNameBox_Base, DumpAsPropertyTreeHdl));
1732SvxFontNameBox_Impl::SvxFontNameBox_Impl(
vcl::Window* pParent,
const Reference<XDispatchProvider>& rDispatchProvider,
1733 const Reference<XFrame>& rFrame, SvxFontNameToolBoxControl& rCtrl)
1735 , SvxFontNameBox_Base(m_xBuilder->weld_combo_box(
"fontnamecombobox"), rDispatchProvider, rFrame, rCtrl)
1737 set_id(
"fontnamecombobox");
1741void SvxFontNameBox_Base::FillList()
1746 int nStartPos, nEndPos;
1747 m_xWidget->get_entry_selection_bounds(nStartPos, nEndPos);
1752 m_xWidget->select_entry_region(nStartPos, nEndPos);
1755void SvxFontNameBox_Base::CheckAndMarkUnknownFont()
1757 if (mbCheckingUnknownFont)
1759 mbCheckingUnknownFont =
true;
1760 OUString fontname =
m_xWidget->get_active_text();
1764 if( pFontList !=
nullptr && pFontList->IsAvailable( fontname ))
1782 mbCheckingUnknownFont =
false;
1785void SvxFontNameBox_Base::Update(
const css::awt::FontDescriptor* pFontDesc )
1789 aCurFont.SetFamilyName ( pFontDesc->Name );
1790 aCurFont.SetFamily (
FontFamily( pFontDesc->Family ) );
1791 aCurFont.SetStyleName ( pFontDesc->StyleName );
1792 aCurFont.SetPitch (
FontPitch( pFontDesc->Pitch ) );
1793 aCurFont.SetCharSet ( rtl_TextEncoding( pFontDesc->CharSet ) );
1795 OUString aCurName = aCurFont.GetFamilyName();
1796 OUString aText =
m_xWidget->get_active_text();
1797 if (aText != aCurName)
1798 set_active_or_entry_text(aCurName);
1801void SvxFontNameBox_Base::set_active_or_entry_text(
const OUString& rText)
1803 m_xWidget->set_active_or_entry_text(rText);
1804 CheckAndMarkUnknownFont();
1814 return DoKeyInput(rKEvt);
1817bool SvxFontNameBox_Base::DoKeyInput(
const KeyEvent& rKEvt)
1819 bool bHandled =
false;
1831 set_active_or_entry_text(
m_xWidget->get_saved_value());
1832 if (!m_rCtrl.IsInSidebar())
1834 ReleaseFocus_Impl();
1844bool SvxFontNameBox_Impl::DoKeyInput(
const KeyEvent& rKEvt)
1846 return SvxFontNameBox_Base::DoKeyInput(rKEvt) || ChildKeyInput(rKEvt);
1853 set_active_or_entry_text(
m_xWidget->get_saved_value());
1859void SvxFontNameBox_Impl::SetOptimalSize()
1867 SetSizePixel(get_preferred_size());
1872 if ( (rDCEvt.
GetType() == DataChangedEventType::SETTINGS) &&
1873 (rDCEvt.
GetFlags() & AllSettingsFlags::STYLE) )
1877 else if ( ( rDCEvt.
GetType() == DataChangedEventType::FONTS ) ||
1878 ( rDCEvt.
GetType() == DataChangedEventType::DISPLAY ) )
1886void SvxFontNameBox_Base::ReleaseFocus_Impl()
1894 m_xFrame->getContainerWindow()->setFocus();
1897void SvxFontNameBox_Base::EnableControls()
1899 bool bEnableMRU = m_aHistory.get();
1902 bool bNewWYSIWYG = m_aWYSIWYG.get();
1903 bool bOldWYSIWYG =
m_xWidget->IsWYSIWYGEnabled();
1905 if (
m_xWidget->get_max_mru_count() != nEntries || bNewWYSIWYG != bOldWYSIWYG)
1908 pFontList =
nullptr;
1913 if (bNewWYSIWYG != bOldWYSIWYG)
1919 Select(rCombo.changed_by_direct_pick());
1928void SvxFontNameBox_Base::Select(
bool bNonTravelSelect)
1930 Sequence< PropertyValue > aArgs( 1 );
1931 auto pArgs = aArgs.getArray();
1932 std::unique_ptr<SvxFontItem> pFontItem;
1936 aCurFont.GetWeight(),
1937 aCurFont.GetItalic() ) );
1938 aCurFont = aFontMetric;
1940 pFontItem.reset(
new SvxFontItem( aFontMetric.GetFamilyType(),
1941 aFontMetric.GetFamilyName(),
1942 aFontMetric.GetStyleName(),
1943 aFontMetric.GetPitch(),
1944 aFontMetric.GetCharSet(),
1945 SID_ATTR_CHAR_FONT ) );
1948 pFontItem->QueryValue( a );
1952 if (bNonTravelSelect)
1954 CheckAndMarkUnknownFont();
1958 ReleaseFocus_Impl();
1962 pArgs[0].Name =
"CharFontName";
1964 ".uno:CharFontName",
1972 pArgs[0].Name =
"CharPreviewFontName";
1974 ".uno:CharPreviewFontName",
1983 auto entriesNode = rJsonWriter.startNode(
"entries");
1984 for (
int i = 0, nEntryCount =
m_xWidget->get_count();
i < nEntryCount; ++
i)
1986 auto entryNode = rJsonWriter.startNode(
"");
1991 int nSelectedEntry =
m_xWidget->get_active();
1992 rJsonWriter.put(
"selectedCount",
static_cast<sal_Int32
>(nSelectedEntry == -1 ? 0 : 1));
1995 auto selectedNode = rJsonWriter.startNode(
"selectedEntries");
1996 if (nSelectedEntry != -1)
1998 auto entryNode = rJsonWriter.startNode(
"");
1999 rJsonWriter.put(
"",
m_xWidget->get_text(nSelectedEntry));
2003 rJsonWriter.put(
"command",
".uno:CharFontName");
2007 std::shared_ptr<PaletteManager> xPaletteManager,
2010 const Reference< XFrame >& rFrame,
2014 :
WeldToolbarPopup(rFrame, rMenuButton.get_widget(),
"svx/ui/colorwindow.ui",
"palette_popup_window")
2015 , theSlotId(nSlotId)
2016 , maCommand(
std::move(rCommand))
2017 , maMenuButton(rMenuButton)
2018 , mxPaletteManager(
std::move(xPaletteManager))
2019 , mrColorStatus(rColorStatus)
2020 , maTopLevelParentFunction(
std::move(aTopLevelParentFunction))
2021 , maColorSelectFunction(
std::move(aColorSelectFunction))
2022 , mxColorSet(new
SvxColorValueSet(m_xBuilder->weld_scrolled_window(
"colorsetwin", true)))
2024 , mxPaletteListBox(m_xBuilder->weld_combo_box(
"palette_listbox"))
2025 , mxButtonAutoColor(m_xBuilder->weld_button(
"auto_color_button"))
2026 , mxButtonNoneColor(m_xBuilder->weld_button(
"none_color_button"))
2027 , mxButtonPicker(m_xBuilder->weld_button(
"color_picker_button"))
2028 , mxAutomaticSeparator(m_xBuilder->weld_widget(
"separator4"))
2029 , mxColorSetWin(new
weld::CustomWeld(*m_xBuilder,
"colorset", *mxColorSet))
2030 , mxRecentColorSetWin(new
weld::CustomWeld(*m_xBuilder,
"recent_colorset", *mxRecentColorSet))
2031 , mpDefaultButton(nullptr)
2038 case SID_ATTR_CHAR_COLOR_BACKGROUND:
2039 case SID_BACKGROUND_COLOR:
2040 case SID_ATTR_CHAR_BACK_COLOR:
2041 case SID_TABLE_CELL_BACKGROUND_COLOR:
2046 case SID_AUTHOR_COLOR:
2051 case SID_BMPMASK_COLOR:
2056 case SID_ATTR_CHAR_COLOR:
2057 case SID_ATTR_CHAR_COLOR2:
2058 case SID_EXTRUSION_3D_COLOR:
2063 case SID_FM_CTL_PROPERTIES:
2079 for (
const auto& rPalette : aPaletteList)
2082 OUString aPaletteName( officecfg::Office::Common::UserColors::PaletteName::get() );
2085 if (nSelectedEntry != -1)
2108 if (
maCommand ==
".uno:FrameLineColor" )
2136 return std::make_pair(aColor, sColorName);
2144 OUString sColorName;
2147 case SID_ATTR_CHAR_COLOR_BACKGROUND:
2148 case SID_BACKGROUND_COLOR:
2149 case SID_ATTR_CHAR_BACK_COLOR:
2150 case SID_TABLE_CELL_BACKGROUND_COLOR:
2152 sColorName =
SvxResId(RID_SVXSTR_NOFILL);
2154 case SID_AUTHOR_COLOR:
2156 sColorName =
SvxResId(RID_SVXSTR_BY_AUTHOR);
2158 case SID_BMPMASK_COLOR:
2160 sColorName =
SvxResId(RID_SVXSTR_TRANSPARENT);
2162 case SID_FM_CTL_PROPERTIES:
2164 sColorName =
SvxResId(RID_SVXSTR_DEFAULT);
2166 case SID_ATTR_CHAR_COLOR:
2167 case SID_ATTR_CHAR_COLOR2:
2168 case SID_EXTRUSION_3D_COLOR:
2171 sColorName =
EditResId(RID_SVXSTR_AUTOMATIC);
2175 return std::make_pair(aColor, sColorName);
2192 return GetNoneColor();
2198 NamedColor aNamedColor = GetSelectEntryColor(pColorSet);
2200 if (pColorSet != mxRecentColorSet.get())
2202 mxPaletteManager->AddRecentColor(aNamedColor.first, aNamedColor.second);
2203 if (!maMenuButton.get_active())
2204 mxPaletteManager->ReloadRecentColorSet(*mxRecentColorSet);
2207 maSelectedLink.Call(aNamedColor);
2212 OUString sCommand(maCommand);
2214 bool bThemePaletteSelected = mxPaletteManager->IsThemePaletteSelected();
2215 sal_uInt16 nSelectedItemId = pColorSet->GetSelectedItemId();
2217 maMenuButton.set_inactive();
2220 if (bThemePaletteSelected)
2223 aNamedThemedColor.m_nLumMod,
2224 aNamedThemedColor.m_nLumOff);
2226 aColorSelectFunction(sCommand, aNamedThemedColor);
2231 int nPos = mxPaletteListBox->get_active();
2232 mxPaletteManager->SetPalette(
nPos );
2233 mxPaletteManager->ReloadColorSet(*mxColorSet);
2234 mxColorSet->layoutToGivenHeight(mxColorSet->GetOutputSizePixel().Height(), mxPaletteManager->GetColorCount());
2244 NamedColor aNamedColor = &rButton == mxButtonAutoColor.get() ? GetAutoColor() : GetNoneColor();
2246 mxColorSet->SetNoSelection();
2247 mxRecentColorSet->SetNoSelection();
2248 mpDefaultButton = &rButton;
2250 maSelectedLink.Call(aNamedColor);
2255 OUString sCommand(maCommand);
2257 maMenuButton.set_inactive();
2265 auto nColor = GetSelectEntryColor().first;
2266 auto pParentWindow = maTopLevelParentFunction();
2267 OUString sCommand = maCommand;
2268 std::shared_ptr<PaletteManager> xPaletteManager(mxPaletteManager);
2270 maMenuButton.set_inactive();
2272 xPaletteManager->PopupColorPicker(pParentWindow, sCommand, nColor);
2293 if (rEvent.FeatureURL.Complete ==
".uno:ColorTableState")
2325 const Color &rColor = rNamedColor.first;
2349 const OUString& rColorName = rNamedColor.second;
2358 OUString sColorName =
"#" + rColor.
AsRGBHexString().toAsciiUpperCase();
2372 css::table::BorderLine2 aTable;
2374 if ( rEvent.State >>= aTable )
2376 SvxBorderLine aLine;
2378 if ( !aLine.isEmpty() )
2379 aColor = aLine.GetColor();
2382 rEvent.State >>= aColor;
2384 if ( rEvent.FeatureURL.Path ==
"BorderTLBR" )
2386 else if ( rEvent.FeatureURL.Path ==
"BorderBLTR" )
2414SvxFrameWindow_Impl::SvxFrameWindow_Impl(SvxFrameToolBoxControl* pControl,
weld::Widget* pParent)
2415 :
WeldToolbarPopup(pControl->getFrameInterface(), pParent,
"svx/ui/floatingframeborder.ui",
"FloatingFrameBorder")
2416 , mxControl(pControl)
2417 , mxFrameSet(new SvxFrmValueSet_Impl)
2418 , mxFrameSetWin(new
weld::CustomWeld(*m_xBuilder,
"valueset", *mxFrameSet))
2419 , bParagraphMode(false)
2420 , m_bIsWriter(false)
2424 if (Reference<lang::XServiceInfo> xSI{
m_xFrame->getController()->getModel(), UNO_QUERY })
2425 m_bIsWriter = xSI->supportsService(
"com.sun.star.text.TextDocument");
2427 mxFrameSet->SetStyle(WB_ITEMBORDER | WB_DOUBLEBORDER | WB_3DLOOK | WB_NO_DIRECTSELECT);
2428 AddStatusListener(
".uno:BorderReducedMode");
2445 for ( i=1;
i < (m_bIsWriter ? 9 : 11);
i++ )
2446 mxFrameSet->InsertItem(i,
Image(aImgVec[i-1].first), aImgVec[
i-1].second);
2449 if ( !bParagraphMode )
2452 for ( i = (m_bIsWriter ? 9 : 11);
i < (m_bIsWriter ? 13 : 16);
i++ )
2453 mxFrameSet->InsertItem(i,
Image(aImgVec[i-1].first), aImgVec[
i-1].second);
2456 sal_uInt16 colCount = m_bIsWriter ? 4 : 5;
2457 mxFrameSet->SetColCount( colCount );
2458 mxFrameSet->SetSelectHdl(
LINK(
this, SvxFrameWindow_Impl, SelectHdl ) );
2462 mxFrameSet->SetAccessibleName(
SvxResId(RID_SVXSTR_FRAME) );
2467enum class FrmValidFlags {
2489 SvxBoxItem aBorderOuter( SID_ATTR_BORDER_OUTER );
2491 SvxBorderLine theDefLine;
2495 SvxLineItem dDownLineItem(SID_ATTR_BORDER_DIAG_TLBR);
2499 SvxLineItem dUpLineItem(SID_ATTR_BORDER_DIAG_BLTR);
2501 bool bIsDiagonalBorder =
false;
2503 SvxBorderLine *pLeft =
nullptr,
2507 sal_uInt16 nSel = mxFrameSet->GetSelectedItemId();
2508 sal_uInt16 nModifier = mxFrameSet->GetModifier();
2509 FrmValidFlags nValidFlags = FrmValidFlags::NONE;
2522 if (nSel > 8) { nSel += 2; }
2523 else if (nSel > 4) { nSel++; }
2528 case 1: nValidFlags |= FrmValidFlags::AllMask;
2530 dDownLineItem.
SetLine(
nullptr);
2532 SetDiagonalDownBorder(dDownLineItem);
2533 SetDiagonalUpBorder(dUpLineItem);
2535 case 2: pLeft = &theDefLine;
2536 nValidFlags |= FrmValidFlags::Left;
2538 case 3: pRight = &theDefLine;
2539 nValidFlags |= FrmValidFlags::Right;
2541 case 4: pLeft = pRight = &theDefLine;
2542 nValidFlags |= FrmValidFlags::Right|FrmValidFlags::Left;
2544 case 5: dDownLineItem.
SetLine(&dDownBorderLine);
2545 SetDiagonalDownBorder(dDownLineItem);
2546 bIsDiagonalBorder =
true;
2548 case 6: pTop = &theDefLine;
2549 nValidFlags |= FrmValidFlags::Top;
2551 case 7: pBottom = &theDefLine;
2552 nValidFlags |= FrmValidFlags::Bottom;
2554 case 8: pTop = pBottom = &theDefLine;
2555 nValidFlags |= FrmValidFlags::Bottom|FrmValidFlags::Top;
2557 case 9: pLeft = pRight = pTop = pBottom = &theDefLine;
2558 nValidFlags |= FrmValidFlags::Left | FrmValidFlags::Right | FrmValidFlags::Top | FrmValidFlags::Bottom;
2561 dUpLineItem.
SetLine(&dUpBorderLine);
2562 SetDiagonalUpBorder(dUpLineItem);
2563 bIsDiagonalBorder =
true;
2568 pTop = pBottom = &theDefLine;
2569 aBorderInner.
SetLine( &theDefLine, SvxBoxInfoItemLine::HORI );
2570 aBorderInner.
SetLine(
nullptr, SvxBoxInfoItemLine::VERT );
2571 nValidFlags |= FrmValidFlags::HInner|FrmValidFlags::Top|FrmValidFlags::Bottom;
2575 pLeft = pRight = pTop = pBottom = &theDefLine;
2576 aBorderInner.
SetLine( &theDefLine, SvxBoxInfoItemLine::HORI );
2577 aBorderInner.
SetLine(
nullptr, SvxBoxInfoItemLine::VERT );
2578 nValidFlags |= FrmValidFlags::Right|FrmValidFlags::Left|FrmValidFlags::HInner|FrmValidFlags::Top|FrmValidFlags::Bottom;
2582 pLeft = pRight = pTop = pBottom = &theDefLine;
2583 aBorderInner.
SetLine(
nullptr, SvxBoxInfoItemLine::HORI );
2584 aBorderInner.
SetLine( &theDefLine, SvxBoxInfoItemLine::VERT );
2585 nValidFlags |= FrmValidFlags::Right|FrmValidFlags::Left|FrmValidFlags::VInner|FrmValidFlags::Top|FrmValidFlags::Bottom;
2589 pLeft = pRight = pTop = pBottom = &theDefLine;
2590 aBorderInner.
SetLine( &theDefLine, SvxBoxInfoItemLine::HORI );
2591 aBorderInner.
SetLine( &theDefLine, SvxBoxInfoItemLine::VERT );
2592 nValidFlags |= FrmValidFlags::AllMask;
2597 dDownLineItem.
SetLine(&dDownBorderLine);
2598 dUpLineItem.
SetLine(&dUpBorderLine);
2600 SetDiagonalDownBorder(dDownLineItem);
2601 SetDiagonalUpBorder(dUpLineItem);
2602 bIsDiagonalBorder =
true;
2611 if (!bIsDiagonalBorder)
2613 aBorderOuter.
SetLine( pLeft, SvxBoxItemLine::LEFT );
2614 aBorderOuter.
SetLine( pRight, SvxBoxItemLine::RIGHT );
2615 aBorderOuter.
SetLine( pTop, SvxBoxItemLine::TOP );
2616 aBorderOuter.
SetLine( pBottom, SvxBoxItemLine::BOTTOM );
2619 nValidFlags |= FrmValidFlags::AllMask;
2620 aBorderInner.
SetValid( SvxBoxInfoItemValidFlags::TOP,
bool(nValidFlags&FrmValidFlags::Top ));
2621 aBorderInner.
SetValid( SvxBoxInfoItemValidFlags::BOTTOM,
bool(nValidFlags&FrmValidFlags::Bottom ));
2622 aBorderInner.
SetValid( SvxBoxInfoItemValidFlags::LEFT,
bool(nValidFlags&FrmValidFlags::Left));
2623 aBorderInner.
SetValid( SvxBoxInfoItemValidFlags::RIGHT,
bool(nValidFlags&FrmValidFlags::Right ));
2624 aBorderInner.
SetValid( SvxBoxInfoItemValidFlags::HORI,
bool(nValidFlags&FrmValidFlags::HInner ));
2625 aBorderInner.
SetValid( SvxBoxInfoItemValidFlags::VERT,
bool(nValidFlags&FrmValidFlags::VInner));
2626 aBorderInner.
SetValid( SvxBoxInfoItemValidFlags::DISTANCE );
2627 aBorderInner.
SetValid( SvxBoxInfoItemValidFlags::DISABLE,
false );
2635 mxControl->dispatchCommand(
".uno:SetBorderStyle", aArgs );
2644 mxFrameSet->SetNoSelection();
2647 mxControl->EndPopupMode();
2650void SvxFrameWindow_Impl::SetDiagonalDownBorder(
const SvxLineItem& dDownLineItem)
2657 mxControl->dispatchCommand(
".uno:BorderTLBR", aArgs);
2660void SvxFrameWindow_Impl::SetDiagonalUpBorder(
const SvxLineItem& dUpLineItem)
2667 mxControl->dispatchCommand(
".uno:BorderBLTR", aArgs);
2670void SvxFrameWindow_Impl::statusChanged(
const css::frame::FeatureStateEvent& rEvent )
2672 if ( rEvent.FeatureURL.Complete !=
".uno:BorderReducedMode" )
2676 if ( !(rEvent.State >>= bValue) )
2679 bParagraphMode = bValue;
2681 if(!mxFrameSet->GetItemCount())
2685 bool bTableMode = ( mxFrameSet->GetItemCount() ==
static_cast<size_t>(m_bIsWriter ? 12 : 15) );
2686 bool bResize =
false;
2688 if ( bTableMode && bParagraphMode )
2690 for ( sal_uInt16 i = (m_bIsWriter ? 9 : 11);
i < (m_bIsWriter ? 13 : 16);
i++ )
2691 mxFrameSet->RemoveItem(i);
2694 else if ( !bTableMode && !bParagraphMode )
2696 for ( sal_uInt16 i = (m_bIsWriter ? 9 : 11);
i < (m_bIsWriter ? 13 : 16);
i++ )
2697 mxFrameSet->InsertItem(i,
Image(aImgVec[i-1].first), aImgVec[
i-1].second);
2707void SvxFrameWindow_Impl::CalcSizeValueSet()
2712 Size aSize = mxFrameSet->CalcWindowSizePixel( aItemSize );
2714 mxFrameSet->SetOutputSizePixel(aSize);
2717void SvxFrameWindow_Impl::InitImageList()
2731 {
BitmapEx(RID_SVXBMP_FRAME6),
SvxResId(RID_SVXSTR_PARA_PRESET_ONLYTBOTTOM)},
2733 {
BitmapEx(RID_SVXBMP_FRAME8),
SvxResId(RID_SVXSTR_TABLE_PRESET_ONLYOUTER)},
2735 {
BitmapEx(RID_SVXBMP_FRAME9),
SvxResId(RID_SVXSTR_PARA_PRESET_TOPBOTTOMHORI)},
2736 {
BitmapEx(RID_SVXBMP_FRAME10),
SvxResId(RID_SVXSTR_TABLE_PRESET_OUTERHORI)},
2737 {
BitmapEx(RID_SVXBMP_FRAME11),
SvxResId(RID_SVXSTR_TABLE_PRESET_OUTERVERI)},
2751 {
BitmapEx(RID_SVXBMP_FRAME14),
SvxResId(RID_SVXSTR_PARA_PRESET_DIAGONALDOWN)},
2754 {
BitmapEx(RID_SVXBMP_FRAME6),
SvxResId(RID_SVXSTR_PARA_PRESET_ONLYTBOTTOM)},
2756 {
BitmapEx(RID_SVXBMP_FRAME8),
SvxResId(RID_SVXSTR_TABLE_PRESET_ONLYOUTER)},
2757 {
BitmapEx(RID_SVXBMP_FRAME13),
SvxResId(RID_SVXSTR_PARA_PRESET_DIAGONALUP)},
2759 {
BitmapEx(RID_SVXBMP_FRAME9),
SvxResId(RID_SVXSTR_PARA_PRESET_TOPBOTTOMHORI)},
2760 {
BitmapEx(RID_SVXBMP_FRAME10),
SvxResId(RID_SVXSTR_TABLE_PRESET_OUTERHORI)},
2761 {
BitmapEx(RID_SVXBMP_FRAME11),
SvxResId(RID_SVXSTR_TABLE_PRESET_OUTERVERI)},
2762 {
BitmapEx(RID_SVXBMP_FRAME12),
SvxResId(RID_SVXSTR_TABLE_PRESET_OUTERALL)},
2763 {
BitmapEx(RID_SVXBMP_FRAME15),
SvxResId(RID_SVXSTR_PARA_PRESET_CRISSCROSS)}
2770 return SvxBorderLine::threeDMediumColor( aMain );
2773SvxLineWindow_Impl::SvxLineWindow_Impl(SvxFrameToolBoxControl* pControl,
weld::Widget* pParent)
2774 :
WeldToolbarPopup(pControl->getFrameInterface(), pParent,
"svx/ui/floatingframeborder.ui",
"FloatingFrameBorder")
2776 , m_xLineStyleLb(new LineListBox)
2777 , m_xLineStyleLbWin(new
weld::CustomWeld(*m_xBuilder,
"valueset", *m_xLineStyleLb))
2778 , m_bIsWriter(false)
2782 Reference< lang::XServiceInfo > xServices(
m_xFrame->getController()->getModel(), UNO_QUERY_THROW);
2783 m_bIsWriter = xServices->supportsService(
"com.sun.star.text.TextDocument");
2785 catch(
const uno::Exception& )
2789 m_xLineStyleLb->SetStyle(
WinBits(WB_FLATVALUESET | WB_ITEMBORDER | WB_3DLOOK | WB_NO_DIRECTSELECT | WB_TABSTOP) );
2791 m_xLineStyleLb->SetSourceUnit( FieldUnit::TWIP );
2795 m_xLineStyleLb->InsertEntry( SvxBorderLine::getWidthImpl( SvxBorderLineStyle::SOLID ), SvxBorderLineStyle::SOLID );
2796 m_xLineStyleLb->InsertEntry( SvxBorderLine::getWidthImpl( SvxBorderLineStyle::DOTTED ), SvxBorderLineStyle::DOTTED );
2797 m_xLineStyleLb->InsertEntry( SvxBorderLine::getWidthImpl( SvxBorderLineStyle::DASHED ), SvxBorderLineStyle::DASHED );
2800 m_xLineStyleLb->InsertEntry( SvxBorderLine::getWidthImpl( SvxBorderLineStyle::DOUBLE ), SvxBorderLineStyle::DOUBLE );
2801 m_xLineStyleLb->InsertEntry( SvxBorderLine::getWidthImpl( SvxBorderLineStyle::THINTHICK_SMALLGAP ), SvxBorderLineStyle::THINTHICK_SMALLGAP, 20 );
2802 m_xLineStyleLb->InsertEntry( SvxBorderLine::getWidthImpl( SvxBorderLineStyle::THINTHICK_MEDIUMGAP ), SvxBorderLineStyle::THINTHICK_MEDIUMGAP );
2803 m_xLineStyleLb->InsertEntry( SvxBorderLine::getWidthImpl( SvxBorderLineStyle::THINTHICK_LARGEGAP ), SvxBorderLineStyle::THINTHICK_LARGEGAP );
2804 m_xLineStyleLb->InsertEntry( SvxBorderLine::getWidthImpl( SvxBorderLineStyle::THICKTHIN_SMALLGAP ), SvxBorderLineStyle::THICKTHIN_SMALLGAP, 20 );
2805 m_xLineStyleLb->InsertEntry( SvxBorderLine::getWidthImpl( SvxBorderLineStyle::THICKTHIN_MEDIUMGAP ), SvxBorderLineStyle::THICKTHIN_MEDIUMGAP );
2806 m_xLineStyleLb->InsertEntry( SvxBorderLine::getWidthImpl( SvxBorderLineStyle::THICKTHIN_LARGEGAP ), SvxBorderLineStyle::THICKTHIN_LARGEGAP );
2809 m_xLineStyleLb->InsertEntry( SvxBorderLine::getWidthImpl( SvxBorderLineStyle::EMBOSSED ), SvxBorderLineStyle::EMBOSSED, 15,
2810 &SvxBorderLine::threeDLightColor, &SvxBorderLine::threeDDarkColor,
2812 m_xLineStyleLb->InsertEntry( SvxBorderLine::getWidthImpl( SvxBorderLineStyle::ENGRAVED ), SvxBorderLineStyle::ENGRAVED, 15,
2813 &SvxBorderLine::threeDDarkColor, &SvxBorderLine::threeDLightColor,
2817 m_xLineStyleLb->InsertEntry( SvxBorderLine::getWidthImpl( SvxBorderLineStyle::OUTSET ), SvxBorderLineStyle::OUTSET, 10,
2818 &SvxBorderLine::lightColor, &SvxBorderLine::darkColor );
2819 m_xLineStyleLb->InsertEntry( SvxBorderLine::getWidthImpl( SvxBorderLineStyle::INSET ), SvxBorderLineStyle::INSET, 10,
2820 &SvxBorderLine::darkColor, &SvxBorderLine::lightColor );
2821 Size aSize = m_xLineStyleLb->SetWidth( 20 );
2823 m_xLineStyleLb->SetSelectHdl(
LINK(
this, SvxLineWindow_Impl, SelectHdl ) );
2829 aSize = m_xLineStyleLb->CalcWindowSizePixel(aSize);
2830 m_xLineStyleLb->GetDrawingArea()->set_size_request(aSize.
Width(), aSize.
Height());
2831 m_xLineStyleLb->SetOutputSizePixel(aSize);
2839 if ( m_xLineStyleLb->GetSelectItemPos( ) > 0 )
2842 aTmp.SetBorderLineStyle( nStyle );
2853 m_xControl->dispatchCommand(
".uno:LineStyle", aArgs );
2859 const Reference< XDispatchProvider >& rDispatchProvider,
2861 const OUString& rCommand,
2873 case SID_STYLE_FAMILY1:
2874 case SID_STYLE_FAMILY2:
2875 case SID_STYLE_FAMILY3:
2876 case SID_STYLE_FAMILY4:
2877 case SID_STYLE_FAMILY5:
2879 const sal_uInt16 nIdx =
GetId() - SID_STYLE_FAMILY_START;
2881 if ( SfxItemState::DEFAULT == eState )
2885 DBG_ASSERT( pStateItem !=
nullptr,
"SfxTemplateItem expected" );
2924 Reference< style::XStyleFamiliesSupplier > xStylesSupplier(
xModel, UNO_QUERY_THROW );
2925 Reference< lang::XServiceInfo > xServices(
xModel, UNO_QUERY_THROW );
2926 bSpecModeWriter = xServices->supportsService(
"com.sun.star.text.TextDocument");
2929 Reference<container::XNameAccess> xParaStyles;
2930 xStylesSupplier->getStyleFamilies()->getByName(
"ParagraphStyles") >>=
2932 static const std::vector<OUString> aWriterStyles =
2945 for(
const OUString& aStyle: aWriterStyles )
2949 Reference< beans::XPropertySet > xStyle;
2950 xParaStyles->getByName( aStyle ) >>= xStyle;
2952 xStyle->getPropertyValue(
"DisplayName") >>=
sName;
2953 if( !
sName.isEmpty() )
2955 std::pair<OUString, OUString>(aStyle,
sName) );
2957 catch(
const uno::Exception& )
2964 "com.sun.star.sheet.SpreadsheetDocument")))
2966 static const char* aCalcStyles[] =
2976 Reference<container::XNameAccess> xCellStyles;
2977 xStylesSupplier->getStyleFamilies()->getByName(
"CellStyles") >>= xCellStyles;
2978 for(
const char* pCalcStyle : aCalcStyles)
2982 const OUString sStyleName( OUString::createFromAscii( pCalcStyle ) );
2983 if( xCellStyles->hasByName( sStyleName ) )
2985 Reference< beans::XPropertySet > xStyle( xCellStyles->getByName( sStyleName), UNO_QUERY_THROW );
2987 xStyle->getPropertyValue(
"DisplayName") >>=
sName;
2988 if( !
sName.isEmpty() )
2990 std::pair<OUString, OUString>(sStyleName,
sName) );
2993 catch(
const uno::Exception& )
2998 catch(
const uno::Exception& )
3000 OSL_FAIL(
"error while initializing style names");
3014 ".uno:TemplateFamily5"
3019 , pStyleSheetPool(nullptr)
3020 , nActFamily(0xffff)
3042 pImpl->InitializeStyles(
m_xFrame->getController()->getModel());
3043 Reference< XDispatchProvider > xDispatchProvider(
m_xFrame->getController(), UNO_QUERY );
3047 SID_STYLE_FAMILY_START +
i,
3060 pImpl->m_xVclBox.disposeAndClear();
3061 pImpl->m_xWeldBox.reset();
3062 pImpl->m_pBox =
nullptr;
3068 pBoundItem->UnBind();
3094 return "com.sun.star.comp.svx.StyleToolBoxControl";
3104 return {
"com.sun.star.frame.ToolbarController" };
3107extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
3109 css::uno::XComponentContext*,
3110 css::uno::Sequence<css::uno::Any>
const & )
3118 pBoundItem->ReBind();
3124 switch (
nActFamily-1 + SID_STYLE_FAMILY_START )
3126 case SID_STYLE_FAMILY1:
return SfxStyleFamily::Char;
3127 case SID_STYLE_FAMILY2:
return SfxStyleFamily::Para;
3128 case SID_STYLE_FAMILY3:
return SfxStyleFamily::Frame;
3129 case SID_STYLE_FAMILY4:
return SfxStyleFamily::Page;
3130 case SID_STYLE_FAMILY5:
return SfxStyleFamily::Pseudo;
3132 OSL_FAIL(
"unknown style family" );
3135 return SfxStyleFamily::Para;
3140 SvxStyleBox_Base* pBox =
pImpl->m_pBox;
3150 bool bDoFill =
false;
3153 sal_uInt16
nCount = xIter->Count();
3156 pStyle = xIter->First();
3159 if (
nCount != pBox->get_count() )
3166 while ( pStyle && !bDoFill )
3168 bDoFill = ( pBox->get_text(
i) != pStyle->
GetName() );
3169 pStyle = xIter->Next();
3177 OUString aStrSel(pBox->get_active_text());
3181 std::vector<OUString> aStyles;
3184 pStyle = xIter->Next();
3187 aStyles.push_back(pStyle->
GetName());
3188 pStyle = xIter->Next();
3191 if (
pImpl->bSpecModeWriter ||
pImpl->bSpecModeCalc)
3193 pBox->append_text(
pImpl->aClearForm);
3194 pBox->insert_separator(1,
"separator");
3197 for(
const auto &rStyle :
pImpl->aDefaultStyles )
3199 if ( aStyles.size() + pBox->get_count() > 12)
3202 if (std::find(aStyles.begin(), aStyles.end(), rStyle.second) >= aStyles.end())
3203 pBox->append_text(rStyle.second);
3206 std::sort(aStyles.begin(), aStyles.end());
3208 for (
const auto& rStyle : aStyles)
3209 pBox->append_text(rStyle);
3212 pBox->append_text(
pImpl->aMore);
3215 pBox->set_active_or_entry_text(aStrSel);
3216 pBox->SetFamily( eFamily );
3221 SvxStyleBox_Base* pBox =
pImpl->m_pBox;
3227 OUString aStrSel(pBox->get_active_text());
3229 if ( !rStyleName.isEmpty() )
3231 OUString aNewStyle = rStyleName;
3233 auto aFound = std::find_if(
pImpl->aDefaultStyles.begin(),
pImpl->aDefaultStyles.end(),
3234 [rStyleName] (
auto it) { return it.first == rStyleName || it.second == rStyleName; }
3237 if (aFound !=
pImpl->aDefaultStyles.end())
3238 aNewStyle = aFound->second;
3240 if ( aNewStyle != aStrSel )
3241 pBox->set_active_or_entry_text( aNewStyle );
3244 pBox->set_active(-1);
3304 m_pToolbar->set_item_sensitive(m_aCommandURL.toUtf8(), rEvent.IsEnabled);
3309 if (!getToolboxId(
nId, &pToolBox ) )
3314 if (rEvent.IsEnabled)
3320 uno::Reference< awt::XWindow > xItemWindow;
3330 pImpl->m_xWeldBox.reset(
new SvxStyleBox_Base(std::move(xWidget),
3332 SfxStyleFamily::Para,
3333 Reference< XDispatchProvider >(
m_xFrame->getController(), UNO_QUERY ),
3337 pImpl->bSpecModeWriter ||
pImpl->bSpecModeCalc, *
this));
3349 SfxStyleFamily::Para,
3350 Reference< XDispatchProvider >(
m_xFrame->getController(), UNO_QUERY ),
3354 pImpl->bSpecModeWriter ||
pImpl->bSpecModeCalc, *
this);
3360 if (
pImpl->m_pBox && !
pImpl->aDefaultStyles.empty())
3361 pImpl->m_pBox->SetDefaultStyle(
pImpl->aDefaultStyles[0].second);
3366SvxFontNameToolBoxControl::SvxFontNameToolBoxControl()
3371void SvxFontNameBox_Base::statusChanged_Impl(
const css::frame::FeatureStateEvent& rEvent )
3373 if ( !rEvent.IsEnabled )
3375 set_sensitive(
false);
3380 set_sensitive(
true);
3382 css::awt::FontDescriptor aFontDesc;
3383 if ( rEvent.State >>= aFontDesc )
3388 set_active_or_entry_text(
"");
3394void SvxFontNameToolBoxControl::statusChanged(
const css::frame::FeatureStateEvent& rEvent )
3397 m_pBox->statusChanged_Impl(rEvent);
3400 m_pToolbar->set_item_sensitive(m_aCommandURL.toUtf8(), rEvent.IsEnabled);
3405 if (!getToolboxId( nId, &pToolBox ) )
3407 pToolBox->
EnableItem( nId, rEvent.IsEnabled );
3411css::uno::Reference<css::awt::XWindow> SvxFontNameToolBoxControl::createItemWindow(
const css::uno::Reference<css::awt::XWindow>& rParent)
3413 uno::Reference< awt::XWindow > xItemWindow;
3423 m_xWeldBox.reset(
new SvxFontNameBox_Base(std::move(xWidget),
3424 Reference<XDispatchProvider>(
m_xFrame->getController(), UNO_QUERY),
3426 m_pBox = m_xWeldBox.get();
3435 Reference<XDispatchProvider>(
m_xFrame->getController(), UNO_QUERY),
3437 m_pBox = m_xVclBox.get();
3445void SvxFontNameToolBoxControl::dispose()
3447 ToolboxController::dispose();
3450 m_xVclBox.disposeAndClear();
3455OUString SvxFontNameToolBoxControl::getImplementationName()
3457 return "com.sun.star.comp.svx.FontNameToolBoxControl";
3460sal_Bool SvxFontNameToolBoxControl::supportsService(
const OUString& rServiceName )
3465css::uno::Sequence< OUString > SvxFontNameToolBoxControl::getSupportedServiceNames()
3467 return {
"com.sun.star.frame.ToolbarController" };
3470extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
3472 css::uno::XComponentContext*,
3473 css::uno::Sequence<css::uno::Any>
const & )
3475 return cppu::acquire(
new SvxFontNameToolBoxControl() );
3479 ImplInheritanceHelper( rContext, nullptr, OUString() ),
3480 m_bSplitButton(true),
3488sal_uInt16 MapCommandToSlotId(
const OUString& rCommand)
3490 if (rCommand ==
".uno:Color")
3491 return SID_ATTR_CHAR_COLOR;
3492 else if (rCommand ==
".uno:FontColor")
3493 return SID_ATTR_CHAR_COLOR2;
3494 else if (rCommand ==
".uno:BackColor")
3495 return SID_ATTR_CHAR_COLOR_BACKGROUND;
3496 else if (rCommand ==
".uno:CharBackColor")
3497 return SID_ATTR_CHAR_BACK_COLOR;
3498 else if (rCommand ==
".uno:BackgroundColor")
3499 return SID_BACKGROUND_COLOR;
3500 else if (rCommand ==
".uno:TableCellBackgroundColor")
3501 return SID_TABLE_CELL_BACKGROUND_COLOR;
3502 else if (rCommand ==
".uno:Extrusion3DColor")
3503 return SID_EXTRUSION_3D_COLOR;
3504 else if (rCommand ==
".uno:XLineColor")
3505 return SID_ATTR_LINE_COLOR;
3506 else if (rCommand ==
".uno:FillColor")
3507 return SID_ATTR_FILL_COLOR;
3508 else if (rCommand ==
".uno:FrameLineColor")
3509 return SID_FRAME_LINECOLOR;
3511 SAL_WARN(
"svx.tbxcrtls",
"Unknown color command: " << rCommand);
3519 PopupWindowController::initialize( rArguments );
3521 m_nSlotId = MapCommandToSlotId( m_aCommandURL );
3533 OString aId(m_aCommandURL.toUtf8());
3538 m_pToolbar->set_item_popover(aId, mxPopoverContainer->getTopLevel());
3545 if (getToolboxId(
nId, &pToolBox))
3554 PopupWindowController::update();
3558 case SID_ATTR_CHAR_COLOR2:
3559 addStatusListener(
".uno:CharColorExt");
3562 case SID_ATTR_CHAR_BACK_COLOR:
3563 case SID_ATTR_CHAR_COLOR_BACKGROUND:
3564 addStatusListener(
".uno:CharBackgroundExt");
3567 case SID_FRAME_LINECOLOR:
3568 addStatusListener(
".uno:BorderTLBR");
3569 addStatusListener(
".uno:BorderBLTR");
3598 const css::uno::Reference<css::awt::XWindow> xParent =
m_xFrame->getContainerWindow();
3606 const OString aId(m_aCommandURL.toUtf8());
3608 auto xPopover = std::make_unique<ColorWindow>(
3628 if (!getToolboxId(
nId, &pToolBox))
3633 auto xPopover = std::make_unique<ColorWindow>(
3647 std::move(xPopover),
true);
3651 mxInterimPopover->SetText(aWindowTitle);
3653 mxInterimPopover->Show();
3655 return mxInterimPopover;
3660 m_xBtnUpdater->Update(rColor);
3667 if (!getToolboxId(
nId, &pToolBox) && !m_pToolbar)
3670 if ( rEvent.FeatureURL.Complete == m_aCommandURL )
3673 m_pToolbar->set_item_sensitive(m_aCommandURL.toUtf8(), rEvent.IsEnabled);
3684 else if ( rEvent.State >>= bValue )
3687 m_pToolbar->set_item_active(m_aCommandURL.toUtf8(), bValue);
3700 const OString aId(m_aCommandURL.toUtf8());
3701 m_pToolbar->set_menu_item_active(aId, !m_pToolbar->get_menu_item_active(aId));
3706 createPopupWindow();
3716 case SID_ATTR_CHAR_COLOR2 :
3722 { m_aCommandURL.copy(5), css::uno::Any(aColor) }
3755 return "com.sun.star.comp.svx.ColorToolBoxControl";
3760 return {
"com.sun.star.frame.ToolbarController" };
3763extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
3765 css::uno::XComponentContext* rContext,
3766 css::uno::Sequence<css::uno::Any>
const & )
3771SvxFrameToolBoxControl::SvxFrameToolBoxControl(
const css::uno::Reference< css::uno::XComponentContext >& rContext )
3772 :
svt::PopupWindowController( rContext, nullptr, OUString() )
3776void SAL_CALL SvxFrameToolBoxControl::execute(sal_Int16 )
3781 const OString aId(m_aCommandURL.toUtf8());
3782 m_pToolbar->set_menu_item_active(aId, !m_pToolbar->get_menu_item_active(aId));
3787 createPopupWindow();
3791void SvxFrameToolBoxControl::initialize(
const css::uno::Sequence< css::uno::Any >& rArguments )
3793 svt::PopupWindowController::initialize( rArguments );
3798 m_pToolbar->set_item_popover(m_aCommandURL.toUtf8(), mxPopoverContainer->getTopLevel());
3803 if (getToolboxId(nId, &pToolBox))
3807std::unique_ptr<WeldToolbarPopup> SvxFrameToolBoxControl::weldPopupWindow()
3809 if ( m_aCommandURL ==
".uno:LineStyle" )
3810 return std::make_unique<SvxLineWindow_Impl>(
this, m_pToolbar);
3811 return std::make_unique<SvxFrameWindow_Impl>(
this, m_pToolbar);
3816 if ( m_aCommandURL ==
".uno:LineStyle" )
3819 std::make_unique<SvxLineWindow_Impl>(
this, pParent->
GetFrameWeld()),
true);
3821 mxInterimPopover->Show();
3823 mxInterimPopover->SetText(
SvxResId(RID_SVXSTR_FRAME_STYLE));
3825 return mxInterimPopover;
3829 std::make_unique<SvxFrameWindow_Impl>(
this, pParent->
GetFrameWeld()),
true);
3831 mxInterimPopover->Show();
3833 mxInterimPopover->SetText(
SvxResId(RID_SVXSTR_FRAME));
3835 return mxInterimPopover;
3838OUString SvxFrameToolBoxControl::getImplementationName()
3840 return "com.sun.star.comp.svx.FrameToolBoxControl";
3843css::uno::Sequence< OUString > SvxFrameToolBoxControl::getSupportedServiceNames()
3845 return {
"com.sun.star.frame.ToolbarController" };
3848extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
3850 css::uno::XComponentContext* rContext,
3851 css::uno::Sequence<css::uno::Any>
const & )
3853 return cppu::acquire(
new SvxFrameToolBoxControl( rContext ) );
3856SvxCurrencyToolBoxControl::SvxCurrencyToolBoxControl(
const css::uno::Reference<css::uno::XComponentContext>& rContext ) :
3857 PopupWindowController( rContext, nullptr, OUString() ),
3858 m_eLanguage(
Application::GetSettings().GetLanguageTag().getLanguageType() ),
3863SvxCurrencyToolBoxControl::~SvxCurrencyToolBoxControl() {}
3871 std::unique_ptr<weld::Label>
m_xLabel;
3872 std::unique_ptr<weld::TreeView> m_xCurrencyLb;
3873 std::unique_ptr<weld::Button> m_xOkBtn;
3874 OUString& m_rSelectedFormat;
3877 std::vector<OUString> m_aFormatEntries;
3885 SvxCurrencyList_Impl(SvxCurrencyToolBoxControl* pControl,
weld::Widget* pParent, OUString& rSelectedFormat,
LanguageType& eSelectedLanguage)
3886 :
WeldToolbarPopup(pControl->getFrameInterface(), pParent,
"svx/ui/currencywindow.ui",
"CurrencyWindow")
3888 ,
m_xLabel(m_xBuilder->weld_label(
"label"))
3889 , m_xCurrencyLb(m_xBuilder->weld_tree_view(
"currency"))
3890 , m_xOkBtn(m_xBuilder->weld_button(
"ok"))
3891 , m_rSelectedFormat(rSelectedFormat)
3892 , m_eSelectedLanguage(eSelectedLanguage)
3894 std::vector< OUString > aList;
3895 std::vector< sal_uInt16 > aCurrencyList;
3897 sal_uInt16 nLen = rCurrencyTable.
size();
3900 m_eFormatLanguage = aFormatter.GetLanguage();
3902 SvxCurrencyToolBoxControl::GetCurrencySymbols( aList,
true, aCurrencyList );
3905 sal_Int32 nSelectedPos = -1;
3909 OUString sLongestString;
3911 m_xCurrencyLb->freeze();
3912 for(
const auto& rItem : aList )
3914 sal_uInt16& rCurrencyIndex = aCurrencyList[
nCount ];
3915 if ( rCurrencyIndex < nLen )
3917 m_xCurrencyLb->append_text(rItem);
3919 if (rItem.getLength() > sLongestString.getLength())
3920 sLongestString = rItem;
3922 bIsSymbol =
nPos >= nLen;
3924 sal_uInt16 nDefaultFormat;
3925 const NfCurrencyEntry& rCurrencyEntry = rCurrencyTable[ rCurrencyIndex ];
3926 if (rCurrencyIndex == 0)
3931 NfCurrencyEntry aCurrencyEntry( rCurrencyEntry);
3933 nDefaultFormat = aFormatter.GetCurrencyFormatStrings( aStringsDtor, aCurrencyEntry, bIsSymbol);
3937 nDefaultFormat = aFormatter.GetCurrencyFormatStrings( aStringsDtor, rCurrencyEntry, bIsSymbol);
3939 const OUString& rFormatStr = aStringsDtor[ nDefaultFormat ];
3940 m_aFormatEntries.push_back( rFormatStr );
3941 if( rFormatStr == m_rSelectedFormat )
3942 nSelectedPos =
nPos;
3947 m_xCurrencyLb->thaw();
3949 m_xCurrencyLb->set_selection_mode(SelectionMode::Multiple);
3950 m_xCurrencyLb->connect_row_activated(
LINK(
this, SvxCurrencyList_Impl, RowActivatedHdl ) );
3952 m_xCurrencyLb->select( nSelectedPos );
3953 m_xOkBtn->connect_clicked(
LINK(
this, SvxCurrencyList_Impl, OKHdl));
3957 m_xCurrencyLb->insert_text(0, sLongestString);
3958 m_xCurrencyLb->set_size_request(m_xCurrencyLb->get_preferred_size().Width(), m_xCurrencyLb->get_height_rows(12));
3959 m_xCurrencyLb->remove(0);
3963 void SvxCurrencyList_Impl::GrabFocus()
3965 m_xCurrencyLb->grab_focus();
3970 RowActivatedHdl(*m_xCurrencyLb);
3980 int nSelected = m_xCurrencyLb->get_selected_index();
3981 if (nSelected == -1)
3984 m_xCurrencyLb->set_selection_mode(SelectionMode::Single);
3986 m_rSelectedFormat = m_aFormatEntries[nSelected];
3987 m_eSelectedLanguage = m_eFormatLanguage;
3997void SvxCurrencyToolBoxControl::initialize(
const css::uno::Sequence< css::uno::Any >& rArguments )
3999 PopupWindowController::initialize(rArguments);
4004 m_pToolbar->set_item_popover(m_aCommandURL.toUtf8(), mxPopoverContainer->getTopLevel());
4010 if (getToolboxId(nId, &pToolBox) && pToolBox->
GetItemCommand(nId) == m_aCommandURL)
4014std::unique_ptr<WeldToolbarPopup> SvxCurrencyToolBoxControl::weldPopupWindow()
4016 return std::make_unique<SvxCurrencyList_Impl>(
this, m_pToolbar, m_aFormatString, m_eLanguage);
4022 std::make_unique<SvxCurrencyList_Impl>(
this, pParent->
GetFrameWeld(), m_aFormatString, m_eLanguage));
4024 mxInterimPopover->Show();
4026 return mxInterimPopover;
4029void SvxCurrencyToolBoxControl::execute( sal_Int16 nSelectModifier )
4031 sal_uInt32 nFormatKey;
4032 if (m_aFormatString.isEmpty())
4036 if ( nSelectModifier > 0 )
4040 uno::Reference< util::XNumberFormatsSupplier > xRef(
m_xFrame->getController()->getModel(), uno::UNO_QUERY );
4041 uno::Reference< util::XNumberFormats > rxNumberFormats( xRef->getNumberFormats(), uno::UNO_SET_THROW );
4043 nFormatKey = rxNumberFormats->queryKey( m_aFormatString, aLocale,
false );
4044 if ( nFormatKey == NUMBERFORMAT_ENTRY_NOT_FOUND )
4045 nFormatKey = rxNumberFormats->addNew( m_aFormatString, aLocale );
4047 catch(
const uno::Exception& )
4049 nFormatKey = m_nFormatKey;
4053 nFormatKey = m_nFormatKey;
4056 if( nFormatKey != NUMBERFORMAT_ENTRY_NOT_FOUND )
4061 m_nFormatKey = nFormatKey;
4064 PopupWindowController::execute( nSelectModifier );
4067OUString SvxCurrencyToolBoxControl::getImplementationName()
4069 return "com.sun.star.comp.svx.CurrencyToolBoxControl";
4072css::uno::Sequence<OUString> SvxCurrencyToolBoxControl::getSupportedServiceNames()
4074 return {
"com.sun.star.frame.ToolbarController" };
4077extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
4079 css::uno::XComponentContext* rContext,
4080 css::uno::Sequence<css::uno::Any>
const & )
4082 return cppu::acquire(
new SvxCurrencyToolBoxControl( rContext ) );
4085Reference< css::accessibility::XAccessible > SvxFontNameBox_Impl::CreateAccessible()
4092void SvxCurrencyToolBoxControl::GetCurrencySymbols( std::vector<OUString>& rList,
bool bFlag,
4093 std::vector<sal_uInt16>& rCurrencyList )
4095 rCurrencyList.clear();
4100 sal_uInt16 nStart = 1;
4106 rList.push_back( aString );
4107 rCurrencyList.push_back( sal_uInt16(-1) );
4111 rList.push_back( aString );
4112 rCurrencyList.push_back( 0 );
4116 CollatorWrapper aCollator( ::comphelper::getProcessComponentContext() );
4119 static const OUStringLiteral aTwoSpace(u
" ");
4121 for( sal_uInt16 i = 1;
i <
nCount; ++
i )
4130 std::vector<OUString>::size_type j = nStart;
4131 for( ; j < rList.size(); ++j )
4132 if ( aCollator.compareString( aStr, rList[j] ) < 0 )
4135 rList.insert( rList.begin() + j, aStr );
4136 rCurrencyList.insert( rCurrencyList.begin() + j, i );
4142 std::vector<OUString>::size_type nCont = rList.size();
4144 for ( sal_uInt16 i = 1;
i <
nCount; ++
i )
4146 bool bInsert =
true;
4149 std::vector<OUString>::size_type j = nCont;
4150 for ( ; j < rList.size() && bInsert; ++j )
4152 if( rList[j] == aStr )
4154 else if ( aCollator.compareString( aStr, rList[j] ) < 0 )
4159 rList.insert( rList.begin() + j, aStr );
4160 rCurrencyList.insert( rCurrencyList.begin() + j, i );
4166 : mpControl(pControl)
4199 : m_xButton(
std::move(pControl))
4200 , m_aColorWrapper(this)
4201 , m_aAutoDisplayColor(
Application::GetSettings().GetStyleSettings().GetDialogColor())
4203 , m_bShowNoneButton(false)
4204 , m_aTopLevelParentFunction(
std::move(aTopLevelParentFunction))
4221 if (rButton.get_active())
4244 css::uno::Reference<css::frame::XFrame>
xFrame(pFrame ? pFrame->
GetFrameInterface() : uno::Reference<css::frame::XFrame>());
4267 if (rColor.second.trim().isEmpty())
4305 auto nColorTextWidth =
m_xButton->get_pixel_size(rEntry.
GetName()).Width();
4306 if (nColorTextWidth > nMaxStandardColorTextWidth)
4308 nMaxStandardColorTextWidth = nColorTextWidth;
4309 aLongestColor.second = rEntry.
GetName();
4313 return m_xButton->get_preferred_size().Width();
4318 m_xButton->set_size_request(nWidth, -1);
4328 xDevice->SetOutputSize(aImageSize);
4333 const Color aG(0xef, 0xef, 0xef);
4334 int nMinDim = std::min(aImageSize.
Width(), aImageSize.
Height()) + 1;
4335 int nCheckSize = nMinDim / 3;
4336 xDevice->DrawCheckered(aRect.
TopLeft(), aRect.
GetSize(), std::min(nCheckSize, 8), aW, aG);
4337 xDevice->SetFillColor();
4344 xDevice->SetFillColor(rColor.first);
4348 xDevice->DrawRect(aRect);
4355 : m_pMenuButton(pMenuButton)
4356 , m_pToolbar(nullptr)
4357 , m_pControl(nullptr)
4363 : m_pMenuButton(nullptr)
4364 , m_pToolbar(pToolbar)
4365 , m_aIdent(
std::move(aIdent))
4366 , m_pControl(nullptr)
4372 : m_pMenuButton(nullptr)
4373 , m_pToolbar(nullptr)
4374 , m_pControl(pControl)
4375 , m_xToolBox(pToolbar)
std::function< void(const OUString &, const svx::NamedThemedColor &)> ColorSelectFunction
std::pair< Color, OUString > NamedColor
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 svx::NamedThemedColor &rNamedColor)
Link< ColorListBox &, void > m_aSelectedLink
int CalcBestWidthRequest()
void LockWidthRequest(int nWidthRequest)
ColorStatus m_aColorStatus
void SelectEntry(const NamedColor &rColor)
ListBoxColorWrapper m_aColorWrapper
TopLevelParentFunction m_aTopLevelParentFunction
ColorWindow * getColorWindow() const
svx::NamedThemedColor m_aSelectedColor
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)
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 svx::NamedThemedColor &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 void GetThemeIndexLumModOff(sal_uInt16 nItemId, sal_Int16 &rThemeIndex, sal_Int16 &rLumMod, sal_Int16 &rLumOff)
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 OString &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 OStringLiteral HID_POPUP_COLOR
constexpr OStringLiteral HID_STYLE_LISTBOX
constexpr OStringLiteral HID_POPUP_LINE
constexpr OStringLiteral HID_POPUP_COLOR_CTRL
constexpr OStringLiteral 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()
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)
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
A color with an optional name and other theming-related properties.
static NamedThemedColor FromNamedColor(const NamedColor &rNamedColor)
NamedColor ToNamedColor() const
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 &)
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