fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / svx / source / dialog / rlrcitem.cxx
blob4822c1be155f022f03c0397898fc2bc4adcd2a09
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <svl/rectitem.hxx>
27 #include <svx/dialogs.hrc>
29 #include <svx/ruler.hxx>
30 #include <editeng/lrspitem.hxx>
31 #include <editeng/ulspitem.hxx>
32 #include <editeng/tstpitem.hxx>
33 #include "editeng/protitem.hxx"
34 #include "rlrcitem.hxx"
35 #include "svx/rulritem.hxx"
36 #include <svl/eitem.hxx>
38 SvxRulerItem::SvxRulerItem(sal_uInt16 _nId, SvxRuler &rRul, SfxBindings &rBindings)
39 : SfxControllerItem(_nId, rBindings),
40 rRuler(rRul)
46 void SvxRulerItem::StateChanged( sal_uInt16 nSID, SfxItemState eState,
47 const SfxPoolItem* pState)
49 // SfxItemState::DONTCARE => pState == -1 => PTR_CAST buff
50 if ( eState != SfxItemState::DEFAULT )
51 pState = 0;
53 switch(nSID)
55 // Left / right margin
56 case SID_RULER_LR_MIN_MAX:
58 const SfxRectangleItem *pItem = PTR_CAST(SfxRectangleItem, pState);
59 rRuler.UpdateFrameMinMax(pItem);
60 break;
62 case SID_ATTR_LONG_LRSPACE:
64 const SvxLongLRSpaceItem *pItem = PTR_CAST(SvxLongLRSpaceItem, pState);
65 DBG_ASSERT(pState == nullptr || pItem != nullptr, "SvxLRSpaceItem expected");
66 rRuler.UpdateFrame(pItem);
67 break;
69 case SID_ATTR_LONG_ULSPACE:
71 const SvxLongULSpaceItem *pItem = PTR_CAST(SvxLongULSpaceItem, pState);
72 DBG_ASSERT(pState == nullptr || pItem != nullptr, "SvxULSpaceItem expected");
73 rRuler.UpdateFrame(pItem);
74 break;
76 case SID_ATTR_TABSTOP_VERTICAL:
77 case SID_ATTR_TABSTOP:
79 const SvxTabStopItem *pItem = PTR_CAST(SvxTabStopItem, pState);
80 DBG_ASSERT(pState == nullptr || pItem != nullptr, "SvxTabStopItem expected");
81 rRuler.Update(pItem);
82 break;
84 case SID_ATTR_PARA_LRSPACE_VERTICAL:
85 case SID_ATTR_PARA_LRSPACE:
87 const SvxLRSpaceItem *pItem = PTR_CAST(SvxLRSpaceItem, pState);
88 DBG_ASSERT(pState == nullptr || pItem != nullptr, "SvxLRSpaceItem expected");
89 rRuler.UpdatePara(pItem);
90 break;
92 case SID_RULER_BORDERS_VERTICAL:
93 case SID_RULER_BORDERS:
94 case SID_RULER_ROWS:
95 case SID_RULER_ROWS_VERTICAL:
97 const SvxColumnItem *pItem = PTR_CAST(SvxColumnItem, pState);
98 DBG_ASSERT(pState == nullptr || pItem != nullptr, "SvxColumnItem expected");
99 #ifdef DBG_UTIL
100 if(pItem)
102 if(pItem->IsConsistent())
103 rRuler.Update(pItem, nSID);
104 else
105 OSL_FAIL("Column item corrupted");
107 else
108 rRuler.Update(pItem, nSID);
109 #else
110 rRuler.Update(pItem, nSID);
111 #endif
112 break;
114 case SID_RULER_PAGE_POS:
115 { // Position page, page width
116 const SvxPagePosSizeItem *pItem = PTR_CAST(SvxPagePosSizeItem, pState);
117 DBG_ASSERT(pState == nullptr || pItem != nullptr, "SvxPagePosSizeItem expected");
118 rRuler.Update(pItem);
119 break;
121 case SID_RULER_OBJECT:
122 { // Object selection
123 const SvxObjectItem *pItem = PTR_CAST(SvxObjectItem, pState);
124 DBG_ASSERT(pState == nullptr || pItem != nullptr, "SvxObjectItem expected");
125 rRuler.Update(pItem);
126 break;
128 case SID_RULER_PROTECT:
130 const SvxProtectItem *pItem = PTR_CAST(SvxProtectItem, pState);
131 DBG_ASSERT(pState == nullptr || pItem != nullptr, "SvxProtectItem expected");
132 rRuler.Update(pItem);
133 break;
135 case SID_RULER_BORDER_DISTANCE:
137 const SvxLRSpaceItem *pItem = PTR_CAST(SvxLRSpaceItem, pState);
138 DBG_ASSERT(pState == nullptr || pItem != nullptr, "SvxLRSpaceItem expected");
139 rRuler.UpdateParaBorder(pItem);
141 break;
142 case SID_RULER_TEXT_RIGHT_TO_LEFT :
144 const SfxBoolItem *pItem = PTR_CAST(SfxBoolItem, pState);
145 DBG_ASSERT(pState == nullptr || pItem != nullptr, "SfxBoolItem expected");
146 rRuler.UpdateTextRTL(pItem);
148 break;
153 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */