]> git.lyx.org Git - lyx.git/blobdiff - src/graphics/GraphicsImage.cpp
Add context menu for outline operations. Choice of words might not be best.
[lyx.git] / src / graphics / GraphicsImage.cpp
index c71304082448aa420ad5c885945e2f999a078ef0..ee0274e09f663038356e09985b05e739554bc509 100644 (file)
@@ -14,7 +14,8 @@
 
 #include "GraphicsImage.h"
 #include "GraphicsParams.h"
-#include "debug.h"
+
+#include "support/debug.h"
 
 
 namespace lyx {
@@ -22,34 +23,28 @@ namespace graphics {
 
 // This is to be connected to a function that will return a new
 // instance of a viable derived class.
-boost::function<Image::ImagePtr()> Image::newImage;
+boost::function<Image *()> Image::newImage;
 
 /// Return the list of loadable formats.
 boost::function<Image::FormatList()> Image::loadableFormats;
 
 
-std::pair<unsigned int, unsigned int>
-Image::getScaledDimensions(Params const & params) const
+Dimension Image::scaledDimension(Params const & params) const
 {
        // scale only when value > 0
-       unsigned int width;
-       unsigned int height;
+       unsigned int w = width();
+       unsigned int h = height();
        if (params.scale) {
-               width  = (getWidth() * params.scale) / 100;
-               height = (getHeight() * params.scale) / 100;
-       } else {
-               width = getWidth();
-               height = getHeight();
+               w = (w * params.scale) / 100;
+               h = (h * params.scale) / 100;
        }
 
-       LYXERR(Debug::GRAPHICS)
-               << "graphics::Image::getScaledDimensions()"
+       LYXERR(Debug::GRAPHICS, "graphics::Image::getScaledDimensions()"
                << "\n\tparams.scale       : " << params.scale
-               << "\n\twidth              : " << width
-               << "\n\theight             : " << height
-               << std::endl;
+               << "\n\twidth              : " << w
+               << "\n\theight             : " << h);
 
-       return std::make_pair(width, height);
+       return Dimension(w, h, 0);
 }
 
 } // namespace graphics