]> git.pld-linux.org Git - packages/inkscape.git/blob - gcc11.patch
794fc7043c626242934ff2afe4de54b05b83a9fd
[packages/inkscape.git] / gcc11.patch
1 diff --git a/src/extension/system.cpp b/src/extension/system.cpp
2 index 08de0b4..418f5ba 100644
3 --- a/src/extension/system.cpp
4 +++ b/src/extension/system.cpp
5 @@ -174,7 +174,7 @@ open_internal(Extension *in_plug, gpointer in_data)
6          // skip all the rest if we already found a function to open it
7          // since they're ordered by preference now.
8          if (!*pimod) {
9 -            gchar const *ext = dynamic_cast<Input *>(in_plug)->get_extension();
10 +            gchar const *ext = dynamic_cast<Input &>(*in_plug).get_extension();
11  
12              gchar *filenamelower = g_utf8_strdown(filename, -1);
13              gchar *extensionlower = g_utf8_strdown(ext, -1);
14 @@ -384,7 +384,7 @@ save_internal(Extension *in_plug, gpointer in_data)
15          // skip all the rest if we already found someone to save it
16          // since they're ordered by preference now.
17          if (!*pomod) {
18 -            gchar const *ext = dynamic_cast<Output *>(in_plug)->get_extension();
19 +            gchar const *ext = dynamic_cast<Output &>(*in_plug).get_extension();
20  
21              gchar *filenamelower = g_utf8_strdown(filename, -1);
22              gchar *extensionlower = g_utf8_strdown(ext, -1);
23 diff --git a/src/object/object-set.cpp b/src/object/object-set.cpp
24 index bf41bb0..dafa2c1 100644
25 --- a/src/object/object-set.cpp
26 +++ b/src/object/object-set.cpp
27 @@ -242,7 +242,7 @@ void ObjectSet::set(SPObject *object, bool persist_selection_context) {
28      _clear();
29      _add(object);
30      if(dynamic_cast<Inkscape::Selection*>(this))
31 -        return dynamic_cast<Inkscape::Selection*>(this)->_emitChanged(persist_selection_context);
32 +        return dynamic_cast<Inkscape::Selection&>(*this)._emitChanged(persist_selection_context);
33  }
34  
35  void ObjectSet::setReprList(std::vector<XML::Node*> const &list) {
36 @@ -257,7 +257,7 @@ void ObjectSet::setReprList(std::vector<XML::Node*> const &list) {
37      }
38      _emitSignals();
39      if(dynamic_cast<Inkscape::Selection*>(this))
40 -        return dynamic_cast<Inkscape::Selection*>(this)->_emitChanged();//
41 +        return dynamic_cast<Inkscape::Selection&>(*this)._emitChanged();//
42  }
43  
44  
45 diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp
46 index 88c5d8d..c4c3788 100644
47 --- a/src/selection-chemistry.cpp
48 +++ b/src/selection-chemistry.cpp
49 @@ -680,7 +680,7 @@ static void sp_edit_select_all_full(SPDesktop *dt, bool force_all_layers, bool i
50  
51      switch (inlayer) {
52          case PREFS_SELECTION_LAYER: {
53 -        if ( (onlysensitive && dynamic_cast<SPItem *>(dt->currentLayer())->isLocked()) ||
54 +        if ( (onlysensitive && dynamic_cast<SPItem &>(*dt->currentLayer()).isLocked()) ||
55               (onlyvisible && dt->itemIsHidden(dynamic_cast<SPItem *>(dt->currentLayer()))) )
56          return;
57  
58 @@ -775,7 +775,7 @@ Inkscape::XML::Node* ObjectSet::group() {
59              Geom::Affine item_t(Geom::identity());
60              if (t_str)
61                  sp_svg_transform_read(t_str, &item_t);
62 -            item_t *= dynamic_cast<SPItem *>(doc->getObjectByRepr(current->parent()))->i2doc_affine();
63 +            item_t *= dynamic_cast<SPItem &>(*doc->getObjectByRepr(current->parent())).i2doc_affine();
64              // FIXME: when moving both clone and original from a transformed group (either by
65              // grouping into another parent, or by cut/paste) the transform from the original's
66              // parent becomes embedded into original itself, and this affects its clones. Fix
67 @@ -869,7 +869,7 @@ static void ungroup_impl(ObjectSet *set)
68  
69          SPItem *original = use;
70          while (dynamic_cast<SPUse *>(original)) {
71 -            original = dynamic_cast<SPUse *>(original)->get_original();
72 +            original = dynamic_cast<SPUse &>(*original).get_original();
73          }
74  
75          if (groups.find(original) !=  groups.end()) {
76 @@ -1651,7 +1651,8 @@ void ObjectSet::applyAffine(Geom::Affine const &affine, bool set_i2d, bool compe
77                                               && includes( sp_textpath_get_path_item(dynamic_cast<SPTextPath *>(item->firstChild())) ));
78  
79          // ...both a flowtext and its frame?
80 -        bool transform_flowtext_with_frame = (dynamic_cast<SPFlowtext *>(item) && includes( dynamic_cast<SPFlowtext *>(item)->get_frame(nullptr))); // (only the first frame is checked so far)
81 +        bool transform_flowtext_with_frame = (dynamic_cast<SPFlowtext *>(item) && includes(
82 +dynamic_cast<SPFlowtext &>(*item).get_frame(nullptr))); // (only the first frame is checked so far)
83  
84          // ...both an offset and its source?
85          bool transform_offset_with_source = (dynamic_cast<SPOffset *>(item) && dynamic_cast<SPOffset *>(item)->sourceHref) && includes( sp_offset_get_source(dynamic_cast<SPOffset *>(item)) );
86 @@ -2048,19 +2049,21 @@ std::vector<SPItem*> sp_get_same_fill_or_stroke_color(SPItem *sel, std::vector<S
87                      (type == SP_FILL_COLOR) ? iter->style->getFillPaintServer() : iter->style->getStrokePaintServer();
88  
89                  if ((dynamic_cast<SPLinearGradient *>(sel_server) || dynamic_cast<SPRadialGradient *>(sel_server) ||
90 -                     (dynamic_cast<SPGradient *>(sel_server) && dynamic_cast<SPGradient *>(sel_server)->getVector()->isSwatch()))
91 +                     (dynamic_cast<SPGradient *>(sel_server) && dynamic_cast<SPGradient
92 +&>(*sel_server).getVector()->isSwatch()))
93                      &&
94                      (dynamic_cast<SPLinearGradient *>(iter_server) || dynamic_cast<SPRadialGradient *>(iter_server) ||
95 -                     (dynamic_cast<SPGradient *>(iter_server) && dynamic_cast<SPGradient *>(iter_server)->getVector()->isSwatch()))) {
96 -                    SPGradient *sel_vector = dynamic_cast<SPGradient *>(sel_server)->getVector();
97 -                    SPGradient *iter_vector = dynamic_cast<SPGradient *>(iter_server)->getVector();
98 +                     (dynamic_cast<SPGradient *>(iter_server) && dynamic_cast<SPGradient
99 +&>(*iter_server).getVector()->isSwatch()))) {
100 +                    SPGradient *sel_vector = dynamic_cast<SPGradient &>(*sel_server).getVector();
101 +                    SPGradient *iter_vector = dynamic_cast<SPGradient &>(*iter_server).getVector();
102                      if (sel_vector == iter_vector) {
103                          match = true;
104                      }
105  
106                  } else if (dynamic_cast<SPPattern *>(sel_server) && dynamic_cast<SPPattern *>(iter_server)) {
107 -                    SPPattern *sel_pat = dynamic_cast<SPPattern *>(sel_server)->rootPattern();
108 -                    SPPattern *iter_pat = dynamic_cast<SPPattern *>(iter_server)->rootPattern();
109 +                    SPPattern *sel_pat = dynamic_cast<SPPattern &>(*sel_server).rootPattern();
110 +                    SPPattern *iter_pat = dynamic_cast<SPPattern &>(*iter_server).rootPattern();
111                      if (sel_pat == iter_pat) {
112                          match = true;
113                      }
114 diff --git a/src/text-chemistry.cpp b/src/text-chemistry.cpp
115 index 151be25..cce1642 100644
116 --- a/src/text-chemistry.cpp
117 +++ b/src/text-chemistry.cpp
118 @@ -134,7 +134,7 @@ text_put_on_path()
119  
120      if (SP_IS_TEXT(text)) {
121          // Replace any new lines (including sodipodi:role="line") by spaces.
122 -        dynamic_cast<SPText *>(text)->remove_newlines();
123 +        dynamic_cast<SPText &>(*text).remove_newlines();
124      }
125  
126      Inkscape::Text::Layout const *layout = te_get_layout(text);
127 diff --git a/src/ui/clipboard.cpp b/src/ui/clipboard.cpp
128 index cca4172..fe9638e 100644
129 --- a/src/ui/clipboard.cpp
130 +++ b/src/ui/clipboard.cpp
131 @@ -334,7 +334,7 @@ void ClipboardManagerImpl::copySymbol(Inkscape::XML::Node* symbol, gchar const*
132      SPObject *cmobj = _clipboardSPDoc->getObjectByRepr(repr);
133      if (cmobj && !user_symbol) { // convert only stock symbols
134          if (!Geom::are_near(scale_units, 1.0, Geom::EPSILON)) {
135 -            dynamic_cast<SPGroup *>(cmobj)->scaleChildItemsRec(
136 +            dynamic_cast<SPGroup &>(*cmobj).scaleChildItemsRec(
137                  Geom::Scale(scale_units), Geom::Point(0, SP_ACTIVE_DESKTOP->getDocument()->getHeight().value("px")),
138                  false);
139          }
140 diff --git a/src/ui/dialog/filedialogimpl-gtkmm.cpp b/src/ui/dialog/filedialogimpl-gtkmm.cpp
141 index 5874cac..f119c81 100644
142 --- a/src/ui/dialog/filedialogimpl-gtkmm.cpp
143 +++ b/src/ui/dialog/filedialogimpl-gtkmm.cpp
144 @@ -639,7 +639,7 @@ void FileSaveDialogImplGtk::fileNameChanged() {
145      Glib::ustring::size_type pos = name.rfind('.');
146      if ( pos == Glib::ustring::npos ) return;
147      Glib::ustring ext = name.substr( pos ).casefold();
148 -    if (extension && Glib::ustring(dynamic_cast<Inkscape::Extension::Output *>(extension)->get_extension()).casefold() == ext ) return;
149 +    if (extension && Glib::ustring(dynamic_cast<Inkscape::Extension::Output &>(*extension).get_extension()).casefold() == ext ) return;
150      if (knownExtensions.find(ext) == knownExtensions.end()) return;
151      fromCB = true;
152      fileTypeComboBox.set_active_text(knownExtensions[ext]->get_filetypename(true));
153 diff --git a/src/ui/dialog/filter-effects-dialog.cpp b/src/ui/dialog/filter-effects-dialog.cpp
154 index 9b1e130..d1e8efd 100644
155 --- a/src/ui/dialog/filter-effects-dialog.cpp
156 +++ b/src/ui/dialog/filter-effects-dialog.cpp
157 @@ -477,8 +477,8 @@ private:
158  
159              for(int i = 0; i < cols; ++i) {
160                  _tree.append_column_numeric_editable("", _columns.cols[i], "%.2f");
161 -                dynamic_cast<Gtk::CellRendererText*>(
162 -                    _tree.get_column_cell_renderer(i))->signal_edited().connect(
163 +                dynamic_cast<Gtk::CellRendererText&>(
164 +                    *_tree.get_column_cell_renderer(i)).signal_edited().connect(
165                          sigc::mem_fun(*this, &MatrixAttr::rebind));
166              }
167  
168 @@ -575,7 +575,7 @@ public:
169          if(w == &_label)
170              return "";
171          else
172 -            return dynamic_cast<const AttrWidget*>(w)->get_as_attribute();
173 +            return dynamic_cast<const AttrWidget&>(*w).get_as_attribute();
174      }
175  
176      void clear_store()
177 @@ -2571,7 +2571,7 @@ void FilterEffectsDialog::PrimitiveList::on_drag_end(const Glib::RefPtr<Gdk::Dra
178  bool FilterEffectsDialog::PrimitiveList::on_scroll_timeout()
179  {
180      if(_autoscroll_y) {
181 -        auto a = dynamic_cast<Gtk::ScrolledWindow*>(get_parent())->get_vadjustment();
182 +        auto a = dynamic_cast<Gtk::ScrolledWindow&>(*get_parent()).get_vadjustment();
183          double v = a->get_value() + _autoscroll_y;
184          
185         if(v < 0)
186 @@ -2586,7 +2586,7 @@ bool FilterEffectsDialog::PrimitiveList::on_scroll_timeout()
187  
188            
189      if(_autoscroll_x) {
190 -        auto a_h = dynamic_cast<Gtk::ScrolledWindow*>(get_parent())->get_hadjustment();
191 +        auto a_h = dynamic_cast<Gtk::ScrolledWindow&>(*get_parent()).get_hadjustment();
192          double h = a_h->get_value() + _autoscroll_x;
193          
194         if(h < 0)
195 diff --git a/src/ui/dialog/paint-servers.cpp b/src/ui/dialog/paint-servers.cpp
196 index ec49312..2c6852f 100644
197 --- a/src/ui/dialog/paint-servers.cpp
198 +++ b/src/ui/dialog/paint-servers.cpp
199 @@ -283,7 +283,7 @@ Glib::RefPtr<Gdk::Pixbuf> PaintServersDialog::get_pixbuf(SPDocument *document, G
200      preview_document->getRoot()->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
201      preview_document->ensureUpToDate();
202  
203 -    Geom::OptRect dbox = dynamic_cast<SPItem *>(rect)->visualBounds();
204 +    Geom::OptRect dbox = dynamic_cast<SPItem &>(*rect).visualBounds();
205  
206      if (!dbox) {
207          return pixbuf;
208 diff --git a/src/ui/dialog/svg-fonts-dialog.cpp b/src/ui/dialog/svg-fonts-dialog.cpp
209 index 000f7ba..0c4bce9 100644
210 --- a/src/ui/dialog/svg-fonts-dialog.cpp
211 +++ b/src/ui/dialog/svg-fonts-dialog.cpp
212 @@ -826,13 +826,13 @@ Gtk::VBox* SvgFontsDialog::glyphs_tab(){
213      glyph_from_path_button.set_label(_("Get curves from selection..."));
214      glyph_from_path_button.signal_clicked().connect(sigc::mem_fun(*this, &SvgFontsDialog::set_glyph_description_from_selected_path));
215  
216 -    dynamic_cast<Gtk::CellRendererText*>( _GlyphsList.get_column_cell_renderer(0))->signal_edited().connect(
217 +    dynamic_cast<Gtk::CellRendererText&>( *_GlyphsList.get_column_cell_renderer(0)).signal_edited().connect(
218          sigc::mem_fun(*this, &SvgFontsDialog::glyph_name_edit));
219  
220 -    dynamic_cast<Gtk::CellRendererText*>( _GlyphsList.get_column_cell_renderer(1))->signal_edited().connect(
221 +    dynamic_cast<Gtk::CellRendererText&>( *_GlyphsList.get_column_cell_renderer(1)).signal_edited().connect(
222          sigc::mem_fun(*this, &SvgFontsDialog::glyph_unicode_edit));
223  
224 -    dynamic_cast<Gtk::CellRendererText*>( _GlyphsList.get_column_cell_renderer(2))->signal_edited().connect(
225 +    dynamic_cast<Gtk::CellRendererText&>( *_GlyphsList.get_column_cell_renderer(2)).signal_edited().connect(
226          sigc::mem_fun(*this, &SvgFontsDialog::glyph_advance_edit));
227  
228      _glyphs_observer.signal_changed().connect(sigc::mem_fun(*this, &SvgFontsDialog::update_glyphs));
229 diff --git a/src/ui/widget/ink-flow-box.cpp b/src/ui/widget/ink-flow-box.cpp
230 index 8485dd9..4b1ebe2 100644
231 --- a/src/ui/widget/ink-flow-box.cpp
232 +++ b/src/ui/widget/ink-flow-box.cpp
233 @@ -72,7 +72,7 @@ void InkFlowBox::on_toggle(gint pos, Gtk::ToggleButton *tbutton)
234          bool active = true;
235          for (auto child : tbutton->get_parent()->get_children()) {
236              if (tbutton != child) {
237 -                dynamic_cast<Gtk::ToggleButton *>(child)->set_active(active);
238 +                dynamic_cast<Gtk::ToggleButton &>(*child).set_active(active);
239                  active = false;
240              }
241          }
242 @@ -97,7 +97,7 @@ void InkFlowBox::on_global_toggle(Gtk::ToggleButton *tbutton)
243          bool active = true;
244          for (auto child : tbutton->get_parent()->get_children()) {
245              if (tbutton != child) {
246 -                dynamic_cast<Gtk::ToggleButton *>(child)->set_active(active);
247 +                dynamic_cast<Gtk::ToggleButton &>(*child).set_active(active);
248                  active = false;
249              }
250          }
251 diff --git a/src/ui/widget/spin-button-tool-item.cpp b/src/ui/widget/spin-button-tool-item.cpp
252 index b283939..b8c639c 100644
253 --- a/src/ui/widget/spin-button-tool-item.cpp
254 +++ b/src/ui/widget/spin-button-tool-item.cpp
255 @@ -207,7 +207,7 @@ SpinButtonToolItem::process_tab(int increment)
256                  if(dynamic_cast<SpinButtonToolItem *>(tool_item)) {
257                      // (1) The tool item is a SpinButtonToolItem, in which case, we just pass
258                      //     focus to its spin-button
259 -                    dynamic_cast<SpinButtonToolItem *>(tool_item)->grab_button_focus();
260 +                    dynamic_cast<SpinButtonToolItem &>(*tool_item).grab_button_focus();
261                      handled = true;
262                  }
263                  else if(dynamic_cast<Gtk::SpinButton *>(tool_item->get_child())) {
264 diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp
265 index ebeb8ca..c25a217 100644
266 --- a/src/widgets/desktop-widget.cpp
267 +++ b/src/widgets/desktop-widget.cpp
268 @@ -1848,7 +1848,7 @@ void SPDesktopWidget::namedviewModified(SPObject *obj, guint flags)
269              std::vector<Gtk::Widget*> ch = Glib::wrap(GTK_CONTAINER(aux_toolbox))->get_children();
270              for (auto i:ch) {
271                  if (GTK_IS_CONTAINER(i->gobj())) {
272 -                    std::vector<Gtk::Widget*> grch = dynamic_cast<Gtk::Container*>(i)->get_children();
273 +                    std::vector<Gtk::Widget*> grch = dynamic_cast<Gtk::Container&>(*i).get_children();
274                      for (auto j:grch) {
275  
276                          if (!GTK_IS_WIDGET(j->gobj())) // wasn't a widget
277 diff --git a/src/xml/repr-io.cpp b/src/xml/repr-io.cpp
278 index ac9794e..fc08250 100644
279 --- a/src/xml/repr-io.cpp
280 +++ b/src/xml/repr-io.cpp
281 @@ -912,7 +912,7 @@ void sp_repr_write_stream( Node *repr, Writer &out, gint indent_level,
282  {
283      switch (repr->type()) {
284          case Inkscape::XML::TEXT_NODE: {
285 -            if( dynamic_cast<const Inkscape::XML::TextNode *>(repr)->is_CData() ) {
286 +            if( dynamic_cast<const Inkscape::XML::TextNode &>(*repr).is_CData() ) {
287                  // Preserve CDATA sections, not converting '&' to &amp;, etc.
288                  out.printf( "<![CDATA[%s]]>", repr->content() );
289              } else {
This page took 0.052277 seconds and 2 git commands to generate.