20 #include <osl/diagnose.h>
22 #include <com/sun/star/uno/Any.hxx>
23 #include <com/sun/star/uno/Sequence.hxx>
114 aGridOpt.SetDefaults();
120 *pStrName = aGridColName;
132 for ( i=0; i<
MAX_OPT && bEqual; i++ ) bEqual = (aOptArr [i] == rOpt.
aOptArr[i]);
133 for ( i=0; i<
MAX_TYPE && bEqual; i++ ) bEqual = (aModeArr[i] == rOpt.
aModeArr[i]);
135 bEqual = bEqual && (aGridCol == rOpt.
aGridCol);
137 bEqual = bEqual && (aGridOpt == rOpt.
aGridOpt);
144 std::unique_ptr<SvxGridItem> pItem(
new SvxGridItem( SID_ATTR_GRID_OPTIONS ));
146 pItem->SetFieldDrawX ( aGridOpt.GetFieldDrawX() );
147 pItem->SetFieldDivisionX ( aGridOpt.GetFieldDivisionX() );
148 pItem->SetFieldDrawY ( aGridOpt.GetFieldDrawY() );
149 pItem->SetFieldDivisionY ( aGridOpt.GetFieldDivisionY() );
150 pItem->SetFieldSnapX ( aGridOpt.GetFieldSnapX() );
151 pItem->SetFieldSnapY ( aGridOpt.GetFieldSnapY() );
152 pItem->SetUseGridSnap ( aGridOpt.GetUseGridSnap() );
153 pItem->SetSynchronize ( aGridOpt.GetSynchronize() );
154 pItem->SetGridVisible ( aGridOpt.GetGridVisible() );
155 pItem->SetEqualGrid ( aGridOpt.GetEqualGrid() );
174 assert(SfxPoolItem::operator==(rItem));
188 #define CFGPATH_LAYOUT "Office.Calc/Layout"
190 #define SCLAYOUTOPT_GRIDLINES 0
191 #define SCLAYOUTOPT_GRIDCOLOR 1
192 #define SCLAYOUTOPT_PAGEBREAK 2
193 #define SCLAYOUTOPT_GUIDE 3
194 #define SCLAYOUTOPT_COLROWHDR 4
195 #define SCLAYOUTOPT_HORISCROLL 5
196 #define SCLAYOUTOPT_VERTSCROLL 6
197 #define SCLAYOUTOPT_SHEETTAB 7
198 #define SCLAYOUTOPT_OUTLINE 8
199 #define SCLAYOUTOPT_GRID_ONCOLOR 9
200 #define SCLAYOUTOPT_SUMMARY 10
202 #define CFGPATH_DISPLAY "Office.Calc/Content/Display"
204 #define SCDISPLAYOPT_FORMULA 0
205 #define SCDISPLAYOPT_ZEROVALUE 1
206 #define SCDISPLAYOPT_NOTETAG 2
207 #define SCDISPLAYOPT_VALUEHI 3
208 #define SCDISPLAYOPT_ANCHOR 4
209 #define SCDISPLAYOPT_TEXTOVER 5
210 #define SCDISPLAYOPT_OBJECTGRA 6
211 #define SCDISPLAYOPT_CHART 7
212 #define SCDISPLAYOPT_DRAWING 8
214 #define CFGPATH_GRID "Office.Calc/Grid"
216 #define SCGRIDOPT_RESOLU_X 0
217 #define SCGRIDOPT_RESOLU_Y 1
218 #define SCGRIDOPT_SUBDIV_X 2
219 #define SCGRIDOPT_SUBDIV_Y 3
220 #define SCGRIDOPT_OPTION_X 4
221 #define SCGRIDOPT_OPTION_Y 5
222 #define SCGRIDOPT_SNAPTOGRID 6
223 #define SCGRIDOPT_SYNCHRON 7
224 #define SCGRIDOPT_VISIBLE 8
225 #define SCGRIDOPT_SIZETOGRID 9
229 return {
"Line/GridLine",
230 "Line/GridLineColor",
233 "Window/ColumnRowHeader",
234 "Window/HorizontalScroll",
235 "Window/VerticalScroll",
237 "Window/OutlineSymbol",
238 "Line/GridOnColoredCells",
239 "Window/SearchSummary"};
259 return {(bIsMetric ? OUString(
"Resolution/XAxis/Metric")
260 : OUString(
"Resolution/XAxis/NonMetric")),
261 (bIsMetric ? OUString(
"Resolution/YAxis/Metric")
262 : OUString(
"Resolution/YAxis/NonMetric")),
265 (bIsMetric ? OUString(
"Option/XAxis/Metric")
266 : OUString(
"Option/XAxis/NonMetric")),
267 (bIsMetric ? OUString(
"Option/YAxis/Metric")
268 : OUString(
"Option/YAxis/NonMetric")),
270 "Option/Synchronize",
271 "Option/VisibleGrid",
272 "Option/SizeToGrid"};
280 sal_Int32 nIntVal = 0;
286 OSL_ENSURE(aValues.getLength() == aNames.getLength(),
"GetProperties failed");
287 if(aValues.getLength() == aNames.getLength())
289 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
291 OSL_ENSURE(pValues[nProp].hasValue(),
"property value missing");
292 if(pValues[nProp].hasValue())
299 if ( pValues[nProp] >>= aColor )
342 pValues = aValues.getConstArray();
343 OSL_ENSURE(aValues.getLength() == aNames.getLength(),
"GetProperties failed");
344 if(aValues.getLength() == aNames.getLength())
346 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
348 OSL_ENSURE(pValues[nProp].hasValue(),
"property value missing");
349 if(pValues[nProp].hasValue())
372 if ( pValues[nProp] >>= nIntVal )
381 if ( pValues[nProp] >>= nIntVal )
390 if ( pValues[nProp] >>= nIntVal )
408 pValues = aValues.getConstArray();
409 OSL_ENSURE(aValues.getLength() == aNames.getLength(),
"GetProperties failed");
410 if(aValues.getLength() == aNames.getLength())
412 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
414 OSL_ENSURE(pValues[nProp].hasValue(),
"property value missing");
415 if(pValues[nProp].hasValue())
420 if (pValues[nProp] >>= nIntVal) aGrid.
SetFieldDrawX( nIntVal );
423 if (pValues[nProp] >>= nIntVal) aGrid.
SetFieldDrawY( nIntVal );
432 if (pValues[nProp] >>= nIntVal) aGrid.
SetFieldSnapX( nIntVal );
435 if (pValues[nProp] >>= nIntVal) aGrid.
SetFieldSnapY( nIntVal );
463 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
468 pValues[nProp] <<= GetGridColor();
471 pValues[nProp] <<= GetOption(
VOPT_GRID );
502 aLayoutItem.PutProperties(aNames, aValues);
511 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
534 pValues[nProp] <<=
static_cast<sal_Int32
>(GetObjMode(
VOBJ_TYPE_OLE ));
537 pValues[nProp] <<=
static_cast<sal_Int32
>(GetObjMode(
VOBJ_TYPE_CHART ));
540 pValues[nProp] <<=
static_cast<sal_Int32
>(GetObjMode(
VOBJ_TYPE_DRAW ));
544 aDisplayItem.PutProperties(aNames, aValues);
555 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
560 pValues[nProp] <<=
static_cast<sal_Int32
>(rGrid.
GetFieldDrawX());
563 pValues[nProp] <<=
static_cast<sal_Int32
>(rGrid.
GetFieldDrawY());
572 pValues[nProp] <<=
static_cast<sal_Int32
>(rGrid.
GetFieldSnapX());
575 pValues[nProp] <<=
static_cast<sal_Int32
>(rGrid.
GetFieldSnapY());
591 aGridItem.PutProperties(aNames, aValues);
#define LINK(Instance, Class, Member)
#define SCGRIDOPT_OPTION_X
void SetOption(ScViewOption eOpt, bool bNew)
sal_uInt32 GetFieldDivisionY() const
ScTpViewItem(const ScViewOptions &rOpt)
void SetFieldDrawX(sal_uInt32 nSet)
#define SCDISPLAYOPT_TEXTOVER
ScLinkConfigItem aDisplayItem
bool GetEqualGrid() const
#define SCGRIDOPT_SUBDIV_Y
void SetFieldSnapY(sal_uInt32 nSet)
void SetFieldDrawY(sal_uInt32 nSet)
bool operator==(const ScGridOptions &rOpt) const
#define SCGRIDOPT_SIZETOGRID
sal_uInt32 GetFieldDrawX() const
ScVObjMode aModeArr[MAX_TYPE]
void SetEqualGrid(bool bSet)
IMPL_LINK_NOARG(ScViewCfg, LayoutCommitHdl, ScLinkConfigItem &, void)
#define SCDISPLAYOPT_CHART
void SetFieldDivisionY(sal_uInt32 nSet)
#define SCDISPLAYOPT_FORMULA
#define SCGRIDOPT_SYNCHRON
void SetCommitLink(const Link< ScLinkConfigItem &, void > &rLink)
sal_uInt32 GetFieldSnapX() const
#define SCGRIDOPT_VISIBLE
#define SCDISPLAYOPT_NOTETAG
void SetObjMode(ScVObjType eObj, ScVObjMode eMode)
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
#define SCLAYOUTOPT_HORISCROLL
#define SCLAYOUTOPT_SUMMARY
static css::uno::Sequence< OUString > GetGridPropertyNames()
static bool IsMetricSystem()
bool EnableNotification(const css::uno::Sequence< OUString > &rNames, bool bEnableInternalNotification=false)
#define SCLAYOUTOPT_SHEETTAB
ScViewOptions & operator=(const ScViewOptions &rCpy)
#define SCGRIDOPT_RESOLU_X
#define SCLAYOUTOPT_COLROWHDR
#define SCDISPLAYOPT_ZEROVALUE
sal_uInt32 GetFieldSnapY() const
void SetGridVisible(bool bSet)
bool GetUseGridSnap() const
#define SCLAYOUTOPT_GRIDLINES
void SetOptions(const ScViewOptions &rNew)
virtual ScTpViewItem * Clone(SfxItemPool *pPool=nullptr) const override
#define SCGRIDOPT_OPTION_Y
sal_uInt32 GetFieldDivisionX() const
void SetGridOptions(const ScGridOptions &rNew)
void SetFieldDivisionX(sal_uInt32 nSet)
#define SCLAYOUTOPT_PAGEBREAK
const ScGridOptions & GetGridOptions() const
std::unique_ptr< SvxGridItem > CreateGridItem() const
#define SCDISPLAYOPT_ANCHOR
bool operator==(const ScViewOptions &rOpt) const
virtual bool operator==(const SfxPoolItem &) const override
bool GetSynchronize() const
#define SCLAYOUTOPT_GRID_ONCOLOR
ScLinkConfigItem aGridItem
#define SCGRIDOPT_RESOLU_Y
#define SCLAYOUTOPT_OUTLINE
static css::uno::Sequence< OUString > GetLayoutPropertyNames()
#define SCLAYOUTOPT_VERTSCROLL
const PropertyValue * pValues
#define SCLAYOUTOPT_GRIDCOLOR
void SetSynchronize(bool bSet)
virtual ~ScTpViewItem() override
#define SCGRIDOPT_SUBDIV_X
void SetUseGridSnap(bool bSet)
sal_uInt32 GetFieldDrawY() const
Color const & GetGridColor(OUString *pStrName=nullptr) const
static css::uno::Sequence< OUString > GetDisplayPropertyNames()
void SetFieldSnapX(sal_uInt32 nSet)
#define SCGRIDOPT_SNAPTOGRID
void SetGridColor(const Color &rCol, const OUString &rName)
static bool GetBoolFromAny(const css::uno::Any &aAny)
bool GetGridVisible() const
#define SCLAYOUTOPT_GUIDE
css::uno::Sequence< css::uno::Any > GetProperties(const css::uno::Sequence< OUString > &rNames)
#define SCDISPLAYOPT_DRAWING
#define SCDISPLAYOPT_VALUEHI
#define SCDISPLAYOPT_OBJECTGRA
ScLinkConfigItem aLayoutItem