summaryrefslogtreecommitdiffstats
path: root/src/ui/widget/page-sizer.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2013-10-12 22:24:05 +0000
committerJohan B. C. Engelen <j.b.c.engelen@alumnus.utwente.nl>2013-10-12 22:24:05 +0000
commita970dc423d59ea844bdb1af48d5d9419a5e2a287 (patch)
tree8f6a51df0574fe048ae7e791f276e72716aa090c /src/ui/widget/page-sizer.cpp
parentFix crash with experimental lpe tool. (diff)
downloadinkscape-a970dc423d59ea844bdb1af48d5d9419a5e2a287.tar.gz
inkscape-a970dc423d59ea844bdb1af48d5d9419a5e2a287.zip
Units: stop newing Unit objects. pass around pointers to "undeletable" Unit objects in the UnitTable. I think we should move to using indexed units, and pass around the index of the unit in the unittable, or smth like that... ?
(bzr r12679)
Diffstat (limited to 'src/ui/widget/page-sizer.cpp')
-rw-r--r--src/ui/widget/page-sizer.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/ui/widget/page-sizer.cpp b/src/ui/widget/page-sizer.cpp
index 2379dc181..b13567adb 100644
--- a/src/ui/widget/page-sizer.cpp
+++ b/src/ui/widget/page-sizer.cpp
@@ -565,9 +565,8 @@ PageSizer::find_paper_size (Inkscape::Util::Quantity w, Inkscape::Util::Quantity
for (iter = _paperSizeTable.begin() ;
iter != _paperSizeTable.end() ; ++iter) {
PaperSize paper = iter->second;
- Inkscape::Util::Unit const &i_unit = paper.unit;
- double smallX = Inkscape::Util::Quantity::convert(paper.smaller, i_unit, *w.unit);
- double largeX = Inkscape::Util::Quantity::convert(paper.larger, i_unit, *w.unit);
+ double smallX = Inkscape::Util::Quantity::convert(paper.smaller, paper.unit, w.unit);
+ double largeX = Inkscape::Util::Quantity::convert(paper.larger, paper.unit, w.unit);
g_return_val_if_fail(smallX <= largeX, _paperSizeListStore->children().end());
@@ -704,7 +703,7 @@ void
PageSizer::on_value_changed()
{
if (_widgetRegistry->isUpdating()) return;
- if (_unit != _dimensionUnits.getUnit().abbr) return;
+ if (_unit != _dimensionUnits.getUnit()->abbr) return;
setDim (Inkscape::Util::Quantity(_dimensionWidth.getValue(""), _dimensionUnits.getUnit()),
Inkscape::Util::Quantity(_dimensionHeight.getValue(""), _dimensionUnits.getUnit()));
}
@@ -712,7 +711,7 @@ void
PageSizer::on_units_changed()
{
if (_widgetRegistry->isUpdating()) return;
- _unit = _dimensionUnits.getUnit().abbr;
+ _unit = _dimensionUnits.getUnit()->abbr;
setDim (Inkscape::Util::Quantity(_dimensionWidth.getValue(""), _dimensionUnits.getUnit()),
Inkscape::Util::Quantity(_dimensionHeight.getValue(""), _dimensionUnits.getUnit()));
}