Changeset View
Changeset View
Standalone View
Standalone View
libs/flake/KoShape.cpp
Context not available. | |||||
1101 | void KoShape::setSelectable(bool selectable) | 1101 | void KoShape::setSelectable(bool selectable) | ||
---|---|---|---|---|---|
1102 | { | 1102 | { | ||
1103 | Q_D(KoShape); | 1103 | Q_D(KoShape); | ||
1104 | #if QT_VERSION >= 0x050700 | ||||
1104 | d->allowedInteractions.setFlag(SelectionAllowed, selectable); | 1105 | d->allowedInteractions.setFlag(SelectionAllowed, selectable); | ||
1106 | #else | ||||
1107 | selectable ? (d->allowedInteractions |= SelectionAllowed) : (d->allowedInteractions &= ~SelectionAllowed); | ||||
1108 | #endif | ||||
1105 | } | 1109 | } | ||
1106 | 1110 | | |||
1107 | bool KoShape::isSelectable() const | 1111 | bool KoShape::isSelectable() const | ||
Context not available. | |||||
1113 | void KoShape::setGeometryProtected(bool on) | 1117 | void KoShape::setGeometryProtected(bool on) | ||
1114 | { | 1118 | { | ||
1115 | Q_D(KoShape); | 1119 | Q_D(KoShape); | ||
1120 | #if QT_VERSION >= 0x050700 | ||||
1116 | d->allowedInteractions.setFlag(MoveAllowed, !on); | 1121 | d->allowedInteractions.setFlag(MoveAllowed, !on); | ||
1117 | d->allowedInteractions.setFlag(ResizeAllowed, !on); | 1122 | d->allowedInteractions.setFlag(ResizeAllowed, !on); | ||
1123 | #else | ||||
1124 | (!on) ? (d->allowedInteractions |= MoveAllowed) : (d->allowedInteractions &= ~MoveAllowed); | ||||
1125 | (!on) ? (d->allowedInteractions |= ResizeAllowed) : (d->allowedInteractions &= ~ResizeAllowed); | ||||
1126 | #endif | ||||
1118 | } | 1127 | } | ||
1119 | 1128 | | |||
1120 | bool KoShape::isGeometryProtected() const | 1129 | bool KoShape::isGeometryProtected() const | ||
Context not available. | |||||
1126 | void KoShape::setContentProtected(bool protect) | 1135 | void KoShape::setContentProtected(bool protect) | ||
1127 | { | 1136 | { | ||
1128 | Q_D(KoShape); | 1137 | Q_D(KoShape); | ||
1138 | #if QT_VERSION >= 0x050700 | ||||
1129 | d->allowedInteractions.setFlag(ContentChangeAllowed, !protect); | 1139 | d->allowedInteractions.setFlag(ContentChangeAllowed, !protect); | ||
1140 | #else | ||||
1141 | (!protect) ? (d->allowedInteractions |= ContentChangeAllowed) : (d->allowedInteractions &= ~ContentChangeAllowed); | ||||
1142 | #endif | ||||
1130 | } | 1143 | } | ||
1131 | 1144 | | |||
1132 | bool KoShape::isContentProtected() const | 1145 | bool KoShape::isContentProtected() const | ||
Context not available. | |||||
1138 | void KoShape::setDeletable(bool deletable) | 1151 | void KoShape::setDeletable(bool deletable) | ||
1139 | { | 1152 | { | ||
1140 | Q_D(KoShape); | 1153 | Q_D(KoShape); | ||
1154 | #if QT_VERSION >= 0x050700 | ||||
1141 | d->allowedInteractions.setFlag(DeletionAllowed, deletable); | 1155 | d->allowedInteractions.setFlag(DeletionAllowed, deletable); | ||
1156 | #else | ||||
1157 | deletable ? (d->allowedInteractions |= DeletionAllowed) : (d->allowedInteractions &= ~DeletionAllowed); | ||||
1158 | #endif | ||||
1142 | } | 1159 | } | ||
1143 | 1160 | | |||
1144 | bool KoShape::isDeletable() const | 1161 | bool KoShape::isDeletable() const | ||
Context not available. | |||||
1150 | void KoShape::setAllowedInteraction(KoShape::AllowedInteraction flag, bool value) | 1167 | void KoShape::setAllowedInteraction(KoShape::AllowedInteraction flag, bool value) | ||
1151 | { | 1168 | { | ||
1152 | Q_D(KoShape); | 1169 | Q_D(KoShape); | ||
1170 | #if QT_VERSION >= 0x050700 | ||||
1153 | d->allowedInteractions.setFlag(flag, value); | 1171 | d->allowedInteractions.setFlag(flag, value); | ||
1172 | #else | ||||
1173 | value ? (d->allowedInteractions |= flag) : (d->allowedInteractions &= ~flag); | ||||
1174 | #endif | ||||
1154 | } | 1175 | } | ||
1155 | 1176 | | |||
1156 | bool KoShape::allowedInteraction(KoShape::AllowedInteraction flag, bool recursive) const | 1177 | bool KoShape::allowedInteraction(KoShape::AllowedInteraction flag, bool recursive) const | ||
Context not available. | |||||
1494 | setBorder(d->loadOdfBorder(context)); | 1515 | setBorder(d->loadOdfBorder(context)); | ||
1495 | 1516 | | |||
1496 | QString protect(styleStack.property(KoXmlNS::style, "protect")); | 1517 | QString protect(styleStack.property(KoXmlNS::style, "protect")); | ||
1518 | #if QT_VERSION >= 0x050700 | ||||
1497 | d->allowedInteractions.setFlag(MoveAllowed, !protect.contains("position")); | 1519 | d->allowedInteractions.setFlag(MoveAllowed, !protect.contains("position")); | ||
1498 | d->allowedInteractions.setFlag(ResizeAllowed, !protect.contains("size")); | 1520 | d->allowedInteractions.setFlag(ResizeAllowed, !protect.contains("size")); | ||
1521 | #else | ||||
1522 | (!protect.contains("position")) ? (d->allowedInteractions |= MoveAllowed) : (d->allowedInteractions &= ~MoveAllowed); | ||||
1523 | (!protect.contains("size")) ? (d->allowedInteractions |= ResizeAllowed) : (d->allowedInteractions &= ~ResizeAllowed); | ||||
1524 | #endif | ||||
1499 | setContentProtected(protect.contains("content")); | 1525 | setContentProtected(protect.contains("content")); | ||
1500 | 1526 | | |||
1501 | QString margin = styleStack.property(KoXmlNS::fo, "margin"); | 1527 | QString margin = styleStack.property(KoXmlNS::fo, "margin"); | ||
Context not available. |