Kaydet (Commit) 89399a6b authored tarafından Zolnai Tamás's avatar Zolnai Tamás

Char highlight: option about export LO character background to MSO formats

Export as highlighting or shading.
Highlighting is the default.

Change-Id: Ib2a38e4cd0d49317288bb565383b690d4222c8ed
üst 15931deb
...@@ -140,6 +140,10 @@ OfaMSFilterTabPage2::OfaMSFilterTabPage2( vcl::Window* pParent, const SfxItemSet ...@@ -140,6 +140,10 @@ OfaMSFilterTabPage2::OfaMSFilterTabPage2( vcl::Window* pParent, const SfxItemSet
pCheckButtonData(0) pCheckButtonData(0)
{ {
get(m_pCheckLBContainer, "checklbcontainer"); get(m_pCheckLBContainer, "checklbcontainer");
get( aHighlightingRB, "highlighting");
get( aShadingRB, "shading" );
Size aControlSize(248, 55); Size aControlSize(248, 55);
aControlSize = LogicToPixel(aControlSize, MAP_APPFONT); aControlSize = LogicToPixel(aControlSize, MAP_APPFONT);
m_pCheckLBContainer->set_width_request(aControlSize.Width()); m_pCheckLBContainer->set_width_request(aControlSize.Width());
...@@ -220,6 +224,14 @@ bool OfaMSFilterTabPage2::FillItemSet( SfxItemSet* ) ...@@ -220,6 +224,14 @@ bool OfaMSFilterTabPage2::FillItemSet( SfxItemSet* )
} }
} }
if( aHighlightingRB->IsValueChangedFromSaved() )
{
if( aHighlightingRB->IsChecked() )
rOpt.SetCharBackground2Highlighting();
else
rOpt.SetCharBackground2Shading();
}
return true; return true;
} }
...@@ -279,6 +291,13 @@ void OfaMSFilterTabPage2::Reset( const SfxItemSet* ) ...@@ -279,6 +291,13 @@ void OfaMSFilterTabPage2::Reset( const SfxItemSet* )
} }
} }
m_pCheckLB->SetUpdateMode( true ); m_pCheckLB->SetUpdateMode( true );
if (rOpt.IsCharBackground2Highlighting())
aHighlightingRB->Check(true);
else
aShadingRB->Check(true);
aHighlightingRB->SaveValue();
} }
void OfaMSFilterTabPage2::InsertEntry( const OUString& _rTxt, sal_IntPtr _nType ) void OfaMSFilterTabPage2::InsertEntry( const OUString& _rTxt, sal_IntPtr _nType )
......
...@@ -83,6 +83,9 @@ class OfaMSFilterTabPage2 : public SfxTabPage ...@@ -83,6 +83,9 @@ class OfaMSFilterTabPage2 : public SfxTabPage
sChgToFromSmartArt; sChgToFromSmartArt;
SvLBoxButtonData* pCheckButtonData; SvLBoxButtonData* pCheckButtonData;
RadioButton* aHighlightingRB;
RadioButton* aShadingRB;
OfaMSFilterTabPage2( vcl::Window* pParent, const SfxItemSet& rSet ); OfaMSFilterTabPage2( vcl::Window* pParent, const SfxItemSet& rSet );
virtual ~OfaMSFilterTabPage2(); virtual ~OfaMSFilterTabPage2();
......
...@@ -92,5 +92,99 @@ ...@@ -92,5 +92,99 @@
<property name="height">1</property> <property name="height">1</property>
</packing> </packing>
</child> </child>
<child>
<object class="GtkFrame" id="frame2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
<object class="GtkAlignment" id="alignment2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="top_padding">6</property>
<property name="left_padding">12</property>
<child>
<object class="GtkBox" id="box2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">18</property>
<child>
<object class="GtkLabel" id="label5">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Export as:</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButtonBox" id="buttonbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="layout_style">start</property>
<child>
<object class="GtkRadioButton" id="highlighting">
<property name="label" translatable="yes">Highlighting</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="shading">
<property name="label" translatable="yes">Shading</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="label">
<object class="GtkLabel" id="label4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Character Background</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
</object> </object>
</interface> </interface>
...@@ -87,6 +87,11 @@ public: ...@@ -87,6 +87,11 @@ public:
bool IsEnableCalcPreview() const; bool IsEnableCalcPreview() const;
bool IsEnableWordPreview() const; bool IsEnableWordPreview() const;
bool IsCharBackground2Highlighting() const;
bool IsCharBackground2Shading() const;
void SetCharBackground2Highlighting();
void SetCharBackground2Shading();
static SvtFilterOptions& Get(); static SvtFilterOptions& Get();
}; };
......
...@@ -4082,6 +4082,13 @@ ...@@ -4082,6 +4082,13 @@
</info> </info>
<value>false</value> <value>false</value>
</prop> </prop>
<prop oor:name="CharBackgroundToHighlighting" oor:type="xs:boolean" oor:nillable="false">
<info>
<desc>Specifies if character background is exported as highlighting
(and not as shading) when saving to Word document</desc>
</info>
<value>true</value>
</prop>
</group> </group>
</group> </group>
<group oor:name="Graphic"> <group oor:name="Graphic">
......
...@@ -51,6 +51,7 @@ using namespace com::sun::star::uno; ...@@ -51,6 +51,7 @@ using namespace com::sun::star::uno;
#define FILTERCFG_USE_ENHANCED_FIELDS 0x100000 #define FILTERCFG_USE_ENHANCED_FIELDS 0x100000
#define FILTERCFG_WORD_WBCTBL 0x200000 #define FILTERCFG_WORD_WBCTBL 0x200000
#define FILTERCFG_SMARTART_SHAPE_LOAD 0x400000 #define FILTERCFG_SMARTART_SHAPE_LOAD 0x400000
#define FILTERCFG_CHAR_BACKGROUND_TO_HIGHLIGHTING 0x8000000
class SvtAppFilterOptions_Impl : public utl::ConfigItem class SvtAppFilterOptions_Impl : public utl::ConfigItem
{ {
...@@ -251,7 +252,8 @@ struct SvtFilterOptions_Impl ...@@ -251,7 +252,8 @@ struct SvtFilterOptions_Impl
FILTERCFG_IMPRESS_LOAD | FILTERCFG_IMPRESS_LOAD |
FILTERCFG_IMPRESS_SAVE | FILTERCFG_IMPRESS_SAVE |
FILTERCFG_USE_ENHANCED_FIELDS | FILTERCFG_USE_ENHANCED_FIELDS |
FILTERCFG_SMARTART_SHAPE_LOAD; FILTERCFG_SMARTART_SHAPE_LOAD |
FILTERCFG_CHAR_BACKGROUND_TO_HIGHLIGHTING;
Load(); Load();
} }
...@@ -322,7 +324,7 @@ const Sequence<OUString>& SvtFilterOptions::GetPropertyNames() ...@@ -322,7 +324,7 @@ const Sequence<OUString>& SvtFilterOptions::GetPropertyNames()
static Sequence<OUString> aNames; static Sequence<OUString> aNames;
if(!aNames.getLength()) if(!aNames.getLength())
{ {
int nCount = 13; int nCount = 14;
aNames.realloc(nCount); aNames.realloc(nCount);
static const char* aPropNames[] = static const char* aPropNames[] =
{ {
...@@ -338,7 +340,8 @@ const Sequence<OUString>& SvtFilterOptions::GetPropertyNames() ...@@ -338,7 +340,8 @@ const Sequence<OUString>& SvtFilterOptions::GetPropertyNames()
"Export/EnableExcelPreview", // 9 "Export/EnableExcelPreview", // 9
"Export/EnableWordPreview", // 10 "Export/EnableWordPreview", // 10
"Import/ImportWWFieldsAsEnhancedFields", // 11 "Import/ImportWWFieldsAsEnhancedFields", // 11
"Import/SmartArtToShapes" // 12 "Import/SmartArtToShapes", // 12
"Export/CharBackgroundToHighlighting" // 13
}; };
OUString* pNames = aNames.getArray(); OUString* pNames = aNames.getArray();
for(int i = 0; i < nCount; i++) for(int i = 0; i < nCount; i++)
...@@ -365,6 +368,7 @@ static sal_uLong lcl_GetFlag(sal_Int32 nProp) ...@@ -365,6 +368,7 @@ static sal_uLong lcl_GetFlag(sal_Int32 nProp)
case 10: nFlag = FILTERCFG_ENABLE_WORD_PREVIEW; break; case 10: nFlag = FILTERCFG_ENABLE_WORD_PREVIEW; break;
case 11: nFlag = FILTERCFG_USE_ENHANCED_FIELDS; break; case 11: nFlag = FILTERCFG_USE_ENHANCED_FIELDS; break;
case 12: nFlag = FILTERCFG_SMARTART_SHAPE_LOAD; break; case 12: nFlag = FILTERCFG_SMARTART_SHAPE_LOAD; break;
case 13: nFlag = FILTERCFG_CHAR_BACKGROUND_TO_HIGHLIGHTING; break;
default: OSL_FAIL("illegal value"); default: OSL_FAIL("illegal value");
} }
...@@ -634,4 +638,27 @@ bool SvtFilterOptions::IsEnableWordPreview() const ...@@ -634,4 +638,27 @@ bool SvtFilterOptions::IsEnableWordPreview() const
return pImp->IsFlag( FILTERCFG_ENABLE_WORD_PREVIEW ); return pImp->IsFlag( FILTERCFG_ENABLE_WORD_PREVIEW );
} }
bool SvtFilterOptions::IsCharBackground2Highlighting() const
{
return pImp->IsFlag( FILTERCFG_CHAR_BACKGROUND_TO_HIGHLIGHTING );
}
bool SvtFilterOptions::IsCharBackground2Shading() const
{
return !pImp->IsFlag( FILTERCFG_CHAR_BACKGROUND_TO_HIGHLIGHTING );
}
void SvtFilterOptions::SetCharBackground2Highlighting()
{
pImp->SetFlag( FILTERCFG_CHAR_BACKGROUND_TO_HIGHLIGHTING, true );
SetModified();
}
void SvtFilterOptions::SetCharBackground2Shading()
{
pImp->SetFlag( FILTERCFG_CHAR_BACKGROUND_TO_HIGHLIGHTING, false );
SetModified();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment