[Libreoffice-commits] core.git: 5 commits - cui/source cui/uiconfig include/svx svx/source sw/source
Zolnai Tamás
zolnaitamas2000 at gmail.com
Sun Jun 14 12:51:53 PDT 2015
cui/source/dialogs/srchxtra.cxx | 4
cui/source/inc/backgrnd.hxx | 9 -
cui/source/inc/cuires.hrc | 1
cui/source/tabpages/backgrnd.cxx | 211 ++--------------------------------
cui/source/tabpages/strings.src | 4
cui/uiconfig/ui/backgroundpage.ui | 15 --
cui/uiconfig/ui/optfltrembedpage.ui | 2
cui/uiconfig/ui/searchformatdialog.ui | 2
include/svx/flagsdef.hxx | 1
include/svx/svxids.hrc | 1
svx/source/dialog/srchdlg.cxx | 3
sw/source/ui/fmtui/tmpdlg.cxx | 7 -
sw/source/uibase/app/docst.cxx | 2
sw/source/uibase/app/docstyle.cxx | 3
sw/source/uibase/utlui/uitool.cxx | 21 ---
15 files changed, 32 insertions(+), 254 deletions(-)
New commits:
commit a676ad5ec8348a6c8074e3a8d42590e8fd189cf5
Author: Zolnai Tamás <zolnaitamas2000 at gmail.com>
Date: Sun Jun 14 21:39:02 2015 +0200
Make this string localizable
Change-Id: I074ae2866a67cf90637cd229c717aa999f718558
diff --git a/cui/source/inc/cuires.hrc b/cui/source/inc/cuires.hrc
index 3214b51..87eb802 100644
--- a/cui/source/inc/cuires.hrc
+++ b/cui/source/inc/cuires.hrc
@@ -93,6 +93,7 @@
#define RID_SVXSTR_CHARNAME_FONT (RID_SVX_START + 241)
#define RID_SVXSTR_CHARNAME_STYLE (RID_SVX_START + 242)
#define RID_SVXSTR_CHARNAME_TYPEFACE (RID_SVX_START + 243)
+#define RID_SVXSTR_CHARNAME_HIGHLIGHTING (RID_SVX_START + 244)
// options
#define RID_SVXSTR_DIAGRAM_ROW (RID_SVX_START + 1162)
diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index 0a8e453..94b68db 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -1533,7 +1533,7 @@ void SvxBackgroundTabPage::PageCreated(const SfxAllItemSet& aSet)
}
if ( nFlags & SvxBackgroundTabFlags::SHOW_HIGHLIGHTING )
{
- m_pBackGroundColorLabelFT->SetText("Highlighting Color");
+ m_pBackGroundColorLabelFT->SetText(CUI_RES(RID_SVXSTR_CHARNAME_HIGHLIGHTING));
bHighlighting = true;
}
}
diff --git a/cui/source/tabpages/strings.src b/cui/source/tabpages/strings.src
index da547d4..e380d5a 100644
--- a/cui/source/tabpages/strings.src
+++ b/cui/source/tabpages/strings.src
@@ -103,6 +103,10 @@ String RID_SVXSTR_CHARNAME_TYPEFACE
{
Text [ en-US ] = "Typeface";
};
+String RID_SVXSTR_CHARNAME_HIGHLIGHTING
+{
+ Text [ en-US ] = "Highlighting Color";
+};
String RID_SVXSTR_USE_REPLACE
{
Text [ en-US ] = "Use replacement table" ;
commit e030422305590084263b7490301c3b7ea356d424
Author: Zolnai Tamás <zolnaitamas2000 at gmail.com>
Date: Sun Jun 14 20:25:26 2015 +0200
Paragraph related part of Background Tab is unused now
For paragraphs Area Tab is used for setting background.
Change-Id: I83859a1b2125374b81c084cfa45487a42adcd5a6
diff --git a/cui/source/inc/backgrnd.hxx b/cui/source/inc/backgrnd.hxx
index 2aefa5d..98933c9 100644
--- a/cui/source/inc/backgrnd.hxx
+++ b/cui/source/inc/backgrnd.hxx
@@ -30,7 +30,6 @@
class BackgroundPreviewImpl;
class SvxOpenGraphicDialog;
struct SvxBackgroundTable_Impl;
-struct SvxBackgroundPara_Impl;
struct SvxBackgroundPage_Impl;
class SvxBrushItem;
@@ -62,8 +61,6 @@ public:
void ShowSelector();
/// for the Writer (cells/rows/tables)
void ShowTblControl();
- /// for the Writer (paragraph/characters)
- void ShowParaControl(bool bCharOnly = false);
virtual void PageCreated(const SfxAllItemSet& aSet) SAL_OVERRIDE;
protected:
@@ -79,7 +76,6 @@ private:
VclPtr<ListBox> m_pLbSelect;
VclPtr<FixedText> m_pTblDesc;
VclPtr<ListBox> m_pTblLBox;
- VclPtr<ListBox> m_pParaLBox;
VclPtr<FixedText> m_pBackGroundColorLabelFT;
VclPtr<VclFrame> m_pBackGroundColorFrame;
@@ -120,7 +116,6 @@ private:
SvxOpenGraphicDialog* pImportDlg;
SvxBackgroundTable_Impl* pTableBck_Impl;///< Items for Sw-Table must be corrected
- SvxBackgroundPara_Impl* pParaBck_Impl;///< also for the paragraph style
std::unique_ptr<SvxBrushItem> pHighlighting;
void FillColorValueSets_Impl();
@@ -144,7 +139,6 @@ private:
DECL_LINK( FileClickHdl_Impl, CheckBox* );
DECL_LINK(BackgroundColorHdl_Impl, void *);
DECL_LINK( TblDestinationHdl_Impl, ListBox* );
- DECL_LINK( ParaDestinationHdl_Impl, ListBox* );
};
#endif // INCLUDED_CUI_SOURCE_INC_BACKGRND_HXX
diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index 2e066a3..0a8e453 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -89,21 +89,6 @@ struct SvxBackgroundTable_Impl
{}
};
-struct SvxBackgroundPara_Impl
-{
- SvxBrushItem* pParaBrush;
- SvxBrushItem* pCharBrush;
-
- sal_Int32 nActPos;
-
- SvxBackgroundPara_Impl()
- : pParaBrush(NULL)
- , pCharBrush(NULL)
- , nActPos(LISTBOX_ENTRY_NOTFOUND)
- {}
-
-};
-
struct SvxBackgroundPage_Impl
{
Idle* pLoadIdle;
@@ -349,7 +334,6 @@ SvxBackgroundTabPage::SvxBackgroundTabPage(vcl::Window* pParent, const SfxItemSe
, pPageImpl(new SvxBackgroundPage_Impl)
, pImportDlg(NULL)
, pTableBck_Impl(NULL)
- , pParaBck_Impl(NULL)
, pHighlighting(nullptr)
{
get(m_pAsGrid, "asgrid");
@@ -357,7 +341,6 @@ SvxBackgroundTabPage::SvxBackgroundTabPage(vcl::Window* pParent, const SfxItemSe
get(m_pLbSelect, "selectlb");
get(m_pTblDesc, "forft");
get(m_pTblLBox, "tablelb");
- get(m_pParaLBox, "paralb");
get(m_pBackGroundColorLabelFT, "background_label");
get(m_pBackGroundColorFrame, "backgroundcolorframe");
@@ -428,20 +411,11 @@ void SvxBackgroundTabPage::dispose()
pTableBck_Impl = NULL;
}
- if(pParaBck_Impl)
- {
- delete pParaBck_Impl->pParaBrush;
- delete pParaBck_Impl->pCharBrush;
- delete pParaBck_Impl;
- pParaBck_Impl = NULL;
- }
-
m_pAsGrid.clear();
m_pSelectTxt.clear();
m_pLbSelect.clear();
m_pTblDesc.clear();
m_pTblLBox.clear();
- m_pParaLBox.clear();
m_pBackGroundColorFrame.clear();
m_pBackgroundColorSet.clear();
m_pPreviewWin1.clear();
@@ -511,35 +485,12 @@ void SvxBackgroundTabPage::Reset( const SfxItemSet* rSet )
break;
}
}
- else if( SfxItemState::SET == rSet->GetItemState(
- SID_PARA_BACKGRND_DESTINATION, false, &pItem ) )
- {
- nDestValue = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
- // character activated?
- sal_Int32 nParaSel = m_pParaLBox->GetSelectEntryPos();
- if(1 == nParaSel)
- {
- // then it was a "standard"-call
- nDestValue = nParaSel;
- }
- m_pParaLBox->SelectEntryPos(nDestValue);
-
- switch ( nDestValue )
- {
- case PARA_DEST_PARA:
- nSlot = SID_ATTR_BRUSH;
- break;
- case PARA_DEST_CHAR:
- nSlot = SID_ATTR_BRUSH_CHAR;
- break;
- }
- }
else if( bHighlighting )
{
nSlot = SID_ATTR_BRUSH_CHAR;
}
//#111173# the destination item is missing when the parent style has been changed
- if(USHRT_MAX == nDestValue && (m_pParaLBox->IsVisible()||m_pTblLBox->IsVisible()))
+ if(USHRT_MAX == nDestValue && m_pTblLBox->IsVisible())
nDestValue = 0;
sal_uInt16 nWhich = GetWhich( nSlot );
@@ -608,41 +559,6 @@ void SvxBackgroundTabPage::Reset( const SfxItemSet* rSet )
TblDestinationHdl_Impl(m_pTblLBox);
m_pTblLBox->SaveValue();
}
- else if (m_pParaLBox->GetData() == m_pParaLBox)
- {
- sal_Int32 nValue = m_pParaLBox->GetSelectEntryPos();
-
- if ( pParaBck_Impl )
- {
- delete pParaBck_Impl->pParaBrush;
- delete pParaBck_Impl->pCharBrush;
- }
- else
- pParaBck_Impl = new SvxBackgroundPara_Impl();
-
- pParaBck_Impl->nActPos = nValue;
-
- nWhich = GetWhich( SID_ATTR_BRUSH );
- if ( rSet->GetItemState( nWhich, false ) >= SfxItemState::DEFAULT )
- {
- pBgdAttr = static_cast<const SvxBrushItem*>(&( rSet->Get( nWhich ) ));
- pParaBck_Impl->pParaBrush = new SvxBrushItem(*pBgdAttr);
- }
-
- nWhich = GetWhich( SID_ATTR_BRUSH_CHAR );
- rSet->GetItemState( nWhich, true );
- rSet->GetItemState( nWhich, false );
- if ( rSet->GetItemState( nWhich, true ) > SfxItemState::DEFAULT )
- {
- pBgdAttr = static_cast<const SvxBrushItem*>(&( rSet->Get( nWhich ) ));
- pParaBck_Impl->pCharBrush = new SvxBrushItem(*pBgdAttr);
- }
- else
- pParaBck_Impl->pCharBrush = new SvxBrushItem(SID_ATTR_BRUSH_CHAR);
-
- ParaDestinationHdl_Impl(m_pParaLBox);
- m_pParaLBox->SaveValue();
- }
else if( bHighlighting )
{
nWhich = GetWhich( SID_ATTR_BRUSH_CHAR );
@@ -751,18 +667,6 @@ bool SvxBackgroundTabPage::FillItemSet( SfxItemSet* rCoreSet )
break;
}
}
- else if (m_pParaLBox->GetData() == m_pParaLBox)
- {
- switch(m_pParaLBox->GetSelectEntryPos())
- {
- case PARA_DEST_PARA:
- nSlot = SID_ATTR_BRUSH;
- break;
- case PARA_DEST_CHAR:
- nSlot = SID_ATTR_BRUSH_CHAR;
- break;
- }
- }
else if( bHighlighting )
{
nSlot = SID_ATTR_BRUSH_CHAR;
@@ -923,44 +827,6 @@ bool SvxBackgroundTabPage::FillItemSet( SfxItemSet* rCoreSet )
bModified |= true;
}
}
- else if (m_pParaLBox->GetData() == m_pParaLBox)
- {
- // the current condition has already been put
- if( nSlot != SID_ATTR_BRUSH && m_pParaLBox->IsVisible()) // not in search format dialog
- {
- const SfxPoolItem* pOldPara =
- GetOldItem( *rCoreSet, SID_ATTR_BRUSH );
-
- if ( *pParaBck_Impl->pParaBrush != *pOldPara )
- {
- rCoreSet->Put( *pParaBck_Impl->pParaBrush );
- bModified |= true;
- }
- }
-
- if( nSlot != SID_ATTR_BRUSH_CHAR )
- {
- const SfxPoolItem* pOldChar =
- GetOldItem( *rCoreSet, SID_ATTR_BRUSH_CHAR );
- DBG_ASSERT(pParaBck_Impl, "pParaBck_Impl == NULL ?");
- if ( pOldChar &&
- //#111173# crash report shows that pParaBck_Impl can be NULL, the cause is unknown
- pParaBck_Impl &&
- (*pParaBck_Impl->pCharBrush != *pOldChar ||
- *pParaBck_Impl->pCharBrush != SvxBrushItem(SID_ATTR_BRUSH_CHAR)))
- {
- rCoreSet->Put( *pParaBck_Impl->pCharBrush );
- bModified |= true;
- }
- }
-
- if( m_pParaLBox->IsValueChangedFromSaved() )
- {
- rCoreSet->Put( SfxUInt16Item( SID_BACKGRND_DESTINATION,
- m_pParaLBox->GetSelectEntryPos() ) );
- bModified |= true;
- }
- }
else if( bHighlighting )
{
if( nSlot != SID_ATTR_BRUSH_CHAR )
@@ -1284,12 +1150,10 @@ IMPL_LINK_NOARG(SvxBackgroundTabPage, SelectHdl_Impl)
if ( drawing::FillStyle_SOLID == lcl_getFillStyle(m_pLbSelect) )
{
ShowColorUI_Impl();
- m_pParaLBox->Enable(); // drawing background can't be a bitmap
}
else
{
ShowBitmapUI_Impl();
- m_pParaLBox->Enable(false); // drawing background can't be a bitmap
}
return 0;
}
@@ -1458,19 +1322,6 @@ void SvxBackgroundTabPage::ShowTblControl()
m_pAsGrid->Show();
}
-void SvxBackgroundTabPage::ShowParaControl(bool bCharOnly)
-{
- m_pParaLBox->SetSelectHdl(HDL(ParaDestinationHdl_Impl));
- m_pParaLBox->SelectEntryPos(0);
- if (!bCharOnly)
- {
- m_pTblDesc->Show();
- m_pParaLBox->Show();
- m_pAsGrid->Show();
- }
- m_pParaLBox->SetData(m_pParaLBox); // here it can be recognized that this mode is turned on
-}
-
IMPL_LINK( SvxBackgroundTabPage, TblDestinationHdl_Impl, ListBox*, pBox )
{
sal_Int32 nSelPos = pBox->GetSelectEntryPos();
@@ -1559,68 +1410,6 @@ IMPL_LINK( SvxBackgroundTabPage, TblDestinationHdl_Impl, ListBox*, pBox )
return 0;
}
-IMPL_LINK( SvxBackgroundTabPage, ParaDestinationHdl_Impl, ListBox*, pBox )
-{
- sal_Int32 nSelPos = pBox->GetSelectEntryPos();
- if( pParaBck_Impl && pParaBck_Impl->nActPos != nSelPos)
- {
- SvxBrushItem* pActItem = NULL;
- switch(pParaBck_Impl->nActPos)
- {
- case PARA_DEST_PARA:
- pActItem = pParaBck_Impl->pParaBrush;
- break;
- case PARA_DEST_CHAR:
- pActItem = pParaBck_Impl->pCharBrush;
- break;
- default:
- /* we assert here because the rest of the code expect pActItem to be non NULL */
- assert(false);
- return 0;
- }
- pParaBck_Impl->nActPos = nSelPos;
- if(drawing::FillStyle_SOLID == lcl_getFillStyle(m_pLbSelect)) // brush selected
- {
- sal_uInt16 nWhich = pActItem->Which();
- *pActItem = SvxBrushItem( aBgdColor, nWhich );
- }
- else
- {
- SvxGraphicPosition eNewPos = GetGraphicPosition_Impl();
- const bool bIsLink = m_pBtnLink->IsChecked();
-
- if ( !bIsLink && !bIsGraphicValid )
- bIsGraphicValid = LoadLinkedGraphic_Impl();
-
- if ( bIsLink )
- *pActItem = SvxBrushItem( aBgdGraphicPath,
- aBgdGraphicFilter,
- eNewPos,
- pActItem->Which() );
- else
- *pActItem = SvxBrushItem( aBgdGraphic,
- eNewPos,
- pActItem->Which() );
- }
- switch(nSelPos)
- {
- case PARA_DEST_PARA:
- pActItem = pParaBck_Impl->pParaBrush;
- m_pLbSelect->Enable();
- break;
- case PARA_DEST_CHAR:
- {
- pActItem = pParaBck_Impl->pCharBrush;
- m_pLbSelect->Enable(false);
- }
- break;
- }
- OUString aUserData = GetUserData();
- FillControls_Impl(*pActItem, aUserData);
- }
- return 0;
-}
-
void SvxBackgroundTabPage::FillControls_Impl( const SvxBrushItem& rBgdAttr,
const OUString& rUserData )
{
@@ -1738,8 +1527,6 @@ void SvxBackgroundTabPage::PageCreated(const SfxAllItemSet& aSet)
SvxBackgroundTabFlags nFlags = static_cast<SvxBackgroundTabFlags>(pFlagItem->GetValue());
if (nFlags & SvxBackgroundTabFlags::SHOW_TBLCTL )
ShowTblControl();
- if ( nFlags & SvxBackgroundTabFlags::SHOW_PARACTL )
- ShowParaControl();
if ( nFlags & SvxBackgroundTabFlags::SHOW_SELECTOR )
{
ShowSelector();
diff --git a/cui/uiconfig/ui/backgroundpage.ui b/cui/uiconfig/ui/backgroundpage.ui
index 91c5cb8..bd31f22 100644
--- a/cui/uiconfig/ui/backgroundpage.ui
+++ b/cui/uiconfig/ui/backgroundpage.ui
@@ -97,21 +97,6 @@
<property name="position">0</property>
</packing>
</child>
- <child>
- <object class="GtkComboBoxText" id="paralb">
- <property name="can_focus">False</property>
- <property name="no_show_all">True</property>
- <items>
- <item translatable="yes">Paragraph</item>
- <item translatable="yes">Character</item>
- </items>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
</object>
<packing>
<property name="left_attach">3</property>
diff --git a/include/svx/flagsdef.hxx b/include/svx/flagsdef.hxx
index c3795de..d6fca53 100644
--- a/include/svx/flagsdef.hxx
+++ b/include/svx/flagsdef.hxx
@@ -42,7 +42,6 @@ enum class SvxBackgroundTabFlags
{
NONE = 0x00,
SHOW_SELECTOR = 0x01,
- SHOW_PARACTL = 0x02,
SHOW_TBLCTL = 0x08,
SHOW_HIGHLIGHTING = 0x10,
};
diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc
index ed45af0..5b8efbc 100644
--- a/include/svx/svxids.hrc
+++ b/include/svx/svxids.hrc
@@ -584,7 +584,6 @@
// CAUTION! Range <587 .. 587> used by EditEngine (!)
-#define SID_PARA_BACKGRND_DESTINATION ( SID_SVX_START + 590 )
// CAUTION! Range <591 .. 591> used by EditEngine (!)
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index 76c43e5..64bd0bf 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -1911,8 +1911,6 @@ IMPL_LINK_NOARG(SvxSearchDialog, FormatHdl_Impl)
sal_uInt16 nBrushWhich = pSh->GetPool().GetWhich(SID_ATTR_BRUSH);
pWhRanges[nPos++] = nBrushWhich;
pWhRanges[nPos++] = nBrushWhich;
- pWhRanges[nPos++] = SID_PARA_BACKGRND_DESTINATION;
- pWhRanges[nPos++] = SID_PARA_BACKGRND_DESTINATION;
pWhRanges[nPos] = 0;
SfxItemPool& rPool = pSh->GetPool();
SfxItemSet aSet( rPool, pWhRanges.get() );
@@ -1920,7 +1918,6 @@ IMPL_LINK_NOARG(SvxSearchDialog, FormatHdl_Impl)
aSet.InvalidateAllItems();
aSet.Put(SvxBrushItem(nBrushWhich));
- aSet.Put(SfxUInt16Item(SID_PARA_BACKGRND_DESTINATION, PARA_DEST_CHAR));
if ( bSearch )
{
diff --git a/sw/source/ui/fmtui/tmpdlg.cxx b/sw/source/ui/fmtui/tmpdlg.cxx
index 468b9fe..e29858a 100644
--- a/sw/source/ui/fmtui/tmpdlg.cxx
+++ b/sw/source/ui/fmtui/tmpdlg.cxx
@@ -200,11 +200,6 @@ SwTemplateDlg::SwTemplateDlg(vcl::Window* pParent,
m_nAreaId = AddTabPage("area", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_AREA ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_AREA ));
m_nTransparenceId = AddTabPage("transparence", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_TRANSPARENCE ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_TRANSPARENCE ) );
- //UUUU remove?
- //OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!");
- //OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!");
- //m_nBackgroundId = AddTabPage("background", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) );
-
OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "GetTabPageCreatorFunc fail!");
OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ), "GetTabPageRangesFunc fail!");
m_nBorderId = AddTabPage("borders", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ) );
@@ -472,8 +467,6 @@ void SwTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
else if (nId == m_nBackgroundId)
{
SvxBackgroundTabFlags nFlagType = SvxBackgroundTabFlags::NONE;
- if( SFX_STYLE_FAMILY_PARA == nType )
- nFlagType |= SvxBackgroundTabFlags::SHOW_PARACTL;
if( SFX_STYLE_FAMILY_CHAR != nType )
nFlagType |= SvxBackgroundTabFlags::SHOW_SELECTOR;
if( SFX_STYLE_FAMILY_CHAR == nType )
diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx
index 77e79af..3c76f25 100644
--- a/sw/source/uibase/app/docst.cxx
+++ b/sw/source/uibase/app/docst.cxx
@@ -751,8 +751,6 @@ sal_uInt16 SwDocShell::Edit(
{
SfxItemSet& rSet = xTmp->GetItemSet();
::SwToSfxPageDescAttr( rSet );
- // firstly only a Zero
- rSet.Put(SwBackgroundDestinationItem(SID_PARA_BACKGRND_DESTINATION, 0));
// merge list level indent attributes into the item set if needed
xTmp->MergeIndentAttrsOfListStyle( rSet );
}
diff --git a/sw/source/uibase/app/docstyle.cxx b/sw/source/uibase/app/docstyle.cxx
index 578445b..6aeb0fb 100644
--- a/sw/source/uibase/app/docstyle.cxx
+++ b/sw/source/uibase/app/docstyle.cxx
@@ -407,7 +407,7 @@ SwDocStyleSheet::SwDocStyleSheet( SwDoc& rDocument,
SID_SWREGISTER_COLLECTION, SID_SWREGISTER_COLLECTION, // [10451
SID_ATTR_PARA_PAGENUM, SID_ATTR_PARA_PAGENUM, // [10457
SID_SWREGISTER_MODE, SID_SWREGISTER_MODE, // [10467
- SID_PARA_BACKGRND_DESTINATION, SID_ATTR_BRUSH_CHAR, // [10590
+ SID_ATTR_BRUSH_CHAR, SID_ATTR_BRUSH_CHAR, // [10590
SID_ATTR_NUMBERING_RULE, SID_ATTR_NUMBERING_RULE, // [10855
SID_ATTR_AUTO_STYLE_UPDATE, SID_ATTR_AUTO_STYLE_UPDATE, // [12065
FN_PARAM_FTN_INFO, FN_PARAM_FTN_INFO, // [21123
@@ -803,7 +803,6 @@ OUString SwDocStyleSheet::GetDescription(SfxMapUnit eUnit)
switch ( pItem->Which() )
{
case SID_ATTR_AUTO_STYLE_UPDATE:
- case SID_PARA_BACKGRND_DESTINATION:
case RES_PAGEDESC:
//CTL not yet supported
case RES_CHRATR_CTL_FONT:
commit 16d202f29cafbdc8d0648b830d2209f5c61c878f
Author: Zolnai Tamás <zolnaitamas2000 at gmail.com>
Date: Sun Jun 14 19:45:15 2015 +0200
Search By Format: Background -> Highlighting
Change-Id: I58cda2c6f6f38cca3fe8fecf89722be09d43059b
diff --git a/cui/source/dialogs/srchxtra.cxx b/cui/source/dialogs/srchxtra.cxx
index 5bd9284..a8e298d 100644
--- a/cui/source/dialogs/srchxtra.cxx
+++ b/cui/source/dialogs/srchxtra.cxx
@@ -113,7 +113,9 @@ void SvxSearchFormatDialog::PageCreated( sal_uInt16 nId, SfxTabPage& rPage )
}
else if (nId == m_nBackPageId)
{
- static_cast<SvxBackgroundTabPage&>(rPage).ShowParaControl(true);
+ SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
+ aSet.Put(SfxUInt32Item(SID_FLAG_TYPE,static_cast<sal_uInt32>(SvxBackgroundTabFlags::SHOW_HIGHLIGHTING)));
+ rPage.PageCreated(aSet);
}
}
diff --git a/cui/uiconfig/ui/searchformatdialog.ui b/cui/uiconfig/ui/searchformatdialog.ui
index 6038e87..4a95988 100644
--- a/cui/uiconfig/ui/searchformatdialog.ui
+++ b/cui/uiconfig/ui/searchformatdialog.ui
@@ -210,7 +210,7 @@
<object class="GtkLabel" id="background">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">Background</property>
+ <property name="label" translatable="yes">Highlighting</property>
</object>
<packing>
<property name="position">8</property>
commit 62fb96e075e79676b45912a3a8ec2702b1e3aaf2
Author: Zolnai Tamás <zolnaitamas2000 at gmail.com>
Date: Sun Jun 14 20:24:27 2015 +0200
Handle highlighting case inside SvxBackgroundPage class
... instead of converting attributes.
Change-Id: I3e45c0641389a7b6bdecb5141646aa13ee5c0aa5
diff --git a/cui/source/inc/backgrnd.hxx b/cui/source/inc/backgrnd.hxx
index c12a33b..2aefa5d 100644
--- a/cui/source/inc/backgrnd.hxx
+++ b/cui/source/inc/backgrnd.hxx
@@ -25,6 +25,7 @@
#include <svx/SvxColorValueSet.hxx>
#include <svx/dlgctrl.hxx>
#include <editeng/brushitem.hxx>
+#include <memory>
class BackgroundPreviewImpl;
class SvxOpenGraphicDialog;
@@ -110,6 +111,7 @@ private:
bool bAllowShowSelector : 1;
bool bIsGraphicValid : 1;
bool bLinkOnly : 1;
+ bool bHighlighting : 1;
Graphic aBgdGraphic;
OUString aBgdGraphicPath;
OUString aBgdGraphicFilter;
@@ -119,6 +121,7 @@ private:
SvxBackgroundTable_Impl* pTableBck_Impl;///< Items for Sw-Table must be corrected
SvxBackgroundPara_Impl* pParaBck_Impl;///< also for the paragraph style
+ std::unique_ptr<SvxBrushItem> pHighlighting;
void FillColorValueSets_Impl();
void ShowColorUI_Impl();
diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index bc4b6c6..2e066a3 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -345,10 +345,12 @@ SvxBackgroundTabPage::SvxBackgroundTabPage(vcl::Window* pParent, const SfxItemSe
, bAllowShowSelector(true)
, bIsGraphicValid(false)
, bLinkOnly(false)
+ , bHighlighting(false)
, pPageImpl(new SvxBackgroundPage_Impl)
, pImportDlg(NULL)
, pTableBck_Impl(NULL)
, pParaBck_Impl(NULL)
+ , pHighlighting(nullptr)
{
get(m_pAsGrid, "asgrid");
get(m_pSelectTxt, "asft");
@@ -532,6 +534,10 @@ void SvxBackgroundTabPage::Reset( const SfxItemSet* rSet )
break;
}
}
+ else if( bHighlighting )
+ {
+ nSlot = SID_ATTR_BRUSH_CHAR;
+ }
//#111173# the destination item is missing when the parent style has been changed
if(USHRT_MAX == nDestValue && (m_pParaLBox->IsVisible()||m_pTblLBox->IsVisible()))
nDestValue = 0;
@@ -602,7 +608,7 @@ void SvxBackgroundTabPage::Reset( const SfxItemSet* rSet )
TblDestinationHdl_Impl(m_pTblLBox);
m_pTblLBox->SaveValue();
}
- else
+ else if (m_pParaLBox->GetData() == m_pParaLBox)
{
sal_Int32 nValue = m_pParaLBox->GetSelectEntryPos();
@@ -637,6 +643,15 @@ void SvxBackgroundTabPage::Reset( const SfxItemSet* rSet )
ParaDestinationHdl_Impl(m_pParaLBox);
m_pParaLBox->SaveValue();
}
+ else if( bHighlighting )
+ {
+ nWhich = GetWhich( SID_ATTR_BRUSH_CHAR );
+ if ( rSet->GetItemState( nWhich, false ) >= SfxItemState::DEFAULT )
+ {
+ pBgdAttr = static_cast<const SvxBrushItem*>(&( rSet->Get( nWhich ) ));
+ pHighlighting.reset(new SvxBrushItem(*pBgdAttr));
+ }
+ }
}
}
@@ -748,6 +763,10 @@ bool SvxBackgroundTabPage::FillItemSet( SfxItemSet* rCoreSet )
break;
}
}
+ else if( bHighlighting )
+ {
+ nSlot = SID_ATTR_BRUSH_CHAR;
+ }
sal_uInt16 nWhich = GetWhich( nSlot );
const SfxPoolItem* pOld = GetOldItem( *rCoreSet, nSlot );
@@ -942,6 +961,20 @@ bool SvxBackgroundTabPage::FillItemSet( SfxItemSet* rCoreSet )
bModified |= true;
}
}
+ else if( bHighlighting )
+ {
+ if( nSlot != SID_ATTR_BRUSH_CHAR )
+ {
+ const SfxPoolItem* pOldChar =
+ GetOldItem( *rCoreSet, SID_ATTR_BRUSH_CHAR );
+ if ( pOldChar && pHighlighting &&
+ (*pHighlighting != *pOldChar || *pHighlighting != SvxBrushItem(SID_ATTR_BRUSH_CHAR)))
+ {
+ rCoreSet->Put( *pHighlighting );
+ bModified |= true;
+ }
+ }
+ }
return bModified;
}
@@ -1714,6 +1747,7 @@ void SvxBackgroundTabPage::PageCreated(const SfxAllItemSet& aSet)
if ( nFlags & SvxBackgroundTabFlags::SHOW_HIGHLIGHTING )
{
m_pBackGroundColorLabelFT->SetText("Highlighting Color");
+ bHighlighting = true;
}
}
}
diff --git a/sw/source/uibase/utlui/uitool.cxx b/sw/source/uibase/utlui/uitool.cxx
index d793a99..4b4344c 100644
--- a/sw/source/uibase/utlui/uitool.cxx
+++ b/sw/source/uibase/utlui/uitool.cxx
@@ -127,28 +127,15 @@ void ConvertAttrCharToGen(SfxItemSet& rSet, const sal_uInt8 nMode)
{
// Always use the visible background
const SfxPoolItem *pTmpBrush;
- bool bUseHighlight = false;
if( SfxItemState::SET == rSet.GetItemState( RES_CHRATR_HIGHLIGHT, true, &pTmpBrush ) )
{
SvxBrushItem aTmpBrush( *static_cast<const SvxBrushItem*>(pTmpBrush) );
if( aTmpBrush.GetColor() != COL_TRANSPARENT )
{
- aTmpBrush.SetWhich( RES_BACKGROUND );
+ aTmpBrush.SetWhich( RES_CHRATR_BACKGROUND );
rSet.Put( aTmpBrush );
- bUseHighlight = true;
}
}
- if( !bUseHighlight )
- {
- if( SfxItemState::SET == rSet.GetItemState( RES_CHRATR_BACKGROUND, true, &pTmpBrush ) )
- {
- SvxBrushItem aTmpBrush( *static_cast<const SvxBrushItem*>(pTmpBrush) );
- aTmpBrush.SetWhich( RES_BACKGROUND );
- rSet.Put( aTmpBrush );
- }
- else
- rSet.ClearItem(RES_BACKGROUND);
- }
}
if( nMode == CONV_ATTR_STD )
@@ -181,12 +168,8 @@ void ConvertAttrGenToChar(SfxItemSet& rSet, const SfxItemSet& rOrigSet, const sa
// Background / highlighting
{
const SfxPoolItem *pTmpItem;
- if( SfxItemState::SET == rSet.GetItemState( RES_BACKGROUND, false, &pTmpItem ) )
+ if( SfxItemState::SET == rSet.GetItemState( RES_CHRATR_BACKGROUND, false, &pTmpItem ) )
{
- SvxBrushItem aTmpBrush( *static_cast<const SvxBrushItem*>(pTmpItem) );
- aTmpBrush.SetWhich( RES_CHRATR_BACKGROUND );
- rSet.Put( aTmpBrush );
-
// Highlight is an MS specific thing, so remove it at the first time when LO modifies
// this part of the imported document.
rSet.Put( SvxBrushItem(RES_CHRATR_HIGHLIGHT) );
commit b47151f5d1e287425511b45c5474e10eb0ba3a9d
Author: Zolnai Tamás <zolnaitamas2000 at gmail.com>
Date: Sun Jun 14 19:45:58 2015 +0200
Options: Background -> Highlighting
Change-Id: Id65f748ab32e119465444d02fa6584752b514047
diff --git a/cui/uiconfig/ui/optfltrembedpage.ui b/cui/uiconfig/ui/optfltrembedpage.ui
index 2b0cb04..4e88241 100644
--- a/cui/uiconfig/ui/optfltrembedpage.ui
+++ b/cui/uiconfig/ui/optfltrembedpage.ui
@@ -172,7 +172,7 @@
<object class="GtkLabel" id="label4">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">Character Background</property>
+ <property name="label" translatable="yes">Character Highlighting</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
More information about the Libreoffice-commits
mailing list