[Libreoffice-commits] core.git: Branch 'feature/calc-cell-borders' - 134 commits - accessibility/source android/experimental basctl/source basegfx/source basic/source bin/count-todo-dialogs bin/ui-translatable.sh chart2/inc chart2/source codemaker/source comphelper/source compilerplugins/clang configmgr/source configure.ac cppuhelper/source cui/Library_cui.mk cui/source cui/uiconfig dbaccess/inc dbaccess/source dbaccess/uiconfig dbaccess/UIConfig_dbaccess.mk desktop/inc desktop/source drawinglayer/source editeng/source extensions/source external/openssl filter/source framework/inc framework/source framework/util helpcontent2 i18nutil/Library_i18nutil.mk i18nutil/source include/comphelper include/i18nutil include/oox include/sfx2 include/svtools include/vcl odk/CustomTarget_settings.mk odk/settings oox/source qadevOOo/objdsc qadevOOo/tests README.cross sax/source scaddins/source sc/CppunitTest_sc_ucalc.mk sc/inc sc/Library_sc.mk sc/qa sc/source sc/uiconfig sd/CppunitTest_sd_uimpress.mk sd/Library_ sd.mk sd/qa sd/source sfx2/source solenv/bin solenv/gbuild starmath/source stoc/source svtools/Library_svt.mk svtools/source svtools/util svx/Library_svxcore.mk svx/Library_svx.mk svx/source sw/inc sw/qa sw/source sw/uiconfig vcl/source writerfilter/source

Kohei Yoshida kohei.yoshida at collabora.com
Mon Jan 20 09:50:25 PST 2014


Rebased ref, commits from common ancestor:
commit f3ecf65f63ab474a15f6c26128961f77fbab2502
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Mon Jan 20 12:30:11 2014 -0500

    Handle double lines for screen rendering.
    
    Double lines are always drawn as 2 parallel hair lines that are 1 pixel
    apart, at any zoom level.
    
    Change-Id: I2796477d0ea45c9880aa8057bd1a10104df96673

diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 439ce61..61145f5 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -297,11 +297,14 @@ namespace drawinglayer
             switch (rSource.getStyle())
             {
                 case table::BorderLineStyle::SOLID:
+                case table::BorderLineStyle::DOUBLE:
                 {
                     const basegfx::BColor aLineColor =
                         maBColorModifierStack.getModifiedColor(rSource.getRGBColorLeft());
                     double nThick = rtl::math::round(rSource.getLeftWidth());
 
+                    bool bDouble = rSource.getStyle() == table::BorderLineStyle::DOUBLE;
+
                     basegfx::B2DPolygon aTarget;
 
                     if (bHorizontal)
@@ -314,12 +317,20 @@ namespace drawinglayer
                         basegfx::B2DRange aRange = aTarget.getB2DRange();
                         double fH = aRange.getHeight();
 
-                        if (fH <= 1.0)
+                        if (fH <= 1.0 || bDouble)
                         {
                             // Draw it as a line.
                             drawHairLine(
                                 mpOutputDevice, aRange.getMinX(), aRange.getMinY(), aRange.getMaxX(), aRange.getMinY(),
                                 aLineColor);
+
+                            if (bDouble)
+                            {
+                                drawHairLine(
+                                    mpOutputDevice, aRange.getMinX(), aRange.getMinY()+2.0, aRange.getMaxX(), aRange.getMinY()+2.0,
+                                    aLineColor);
+                            }
+
                             return true;
                         }
                     }
@@ -333,12 +344,19 @@ namespace drawinglayer
                         basegfx::B2DRange aRange = aTarget.getB2DRange();
                         double fW = aRange.getWidth();
 
-                        if (fW <= 1.0)
+                        if (fW <= 1.0 || bDouble)
                         {
                             // Draw it as a line.
                             drawHairLine(
                                 mpOutputDevice, aRange.getMinX(), aRange.getMinY(), aRange.getMinX(), aRange.getMaxY(),
                                 aLineColor);
+
+                            if (bDouble)
+                            {
+                                drawHairLine(
+                                    mpOutputDevice, aRange.getMinX()+2.0, aRange.getMinY(), aRange.getMinX()+2.0, aRange.getMaxY(),
+                                    aLineColor);
+                            }
                             return true;
                         }
                     }
commit dceb425a85e7cc1c1e5cfbd82a5a4dc6f9aaa663
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Mon Jan 20 12:03:39 2014 -0500

    Ensure that the pixel line is at least 1 pixel wide.
    
    Without this, some dashed lines may not get drawn at all at some zoom levels.
    
    Change-Id: I273c1548325d14f56618df8ca4166aac58a3ff3f

diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index ce22687..439ce61 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -430,7 +430,12 @@ namespace drawinglayer
                                 if (fX + fBlockW > fX2)
                                     // Clip the right end in case it spills over the range.
                                     fBlockW = fX2 - fX + 1;
-                                aTarget.append(makeRectPolygon(fX, fY1, fBlockW, aRange.getHeight()));
+
+                                double fH = aRange.getHeight();
+                                if (basegfx::fTools::equalZero(fH))
+                                    fH = 1.0;
+
+                                aTarget.append(makeRectPolygon(fX, fY1, fBlockW, fH));
                             }
 
                             bLine = !bLine; // line and blank alternate.
@@ -497,7 +502,12 @@ namespace drawinglayer
                                 if (fY + fBlockH > fY2)
                                     // Clip the bottom end in case it spills over the range.
                                     fBlockH = fY2 - fY + 1;
-                                aTarget.append(makeRectPolygon(fX1, fY, aRange.getWidth(), fBlockH));
+
+                                double fW = aRange.getWidth();
+                                if (basegfx::fTools::equalZero(fW))
+                                    fW = 1.0;
+
+                                aTarget.append(makeRectPolygon(fX1, fY, fW, fBlockH));
                             }
 
                             bLine = !bLine; // line and blank alternate.
commit 63515cd0c30a62c2855adb766ca256a2b339db50
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Mon Jan 20 11:48:36 2014 -0500

    Do the same when the pixel thickness is zero.
    
    Change-Id: Icfbb295abb19cf58477f4f14f4a7294a540151c2

diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 68abfa4..ce22687 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -378,6 +378,13 @@ namespace drawinglayer
                     {
                         // Horizontal line.
 
+                        if (basegfx::fTools::equalZero(nThick))
+                        {
+                            // Dash line segment too small to draw.  Substitute it with a solid line.
+                            drawHairLine(mpOutputDevice, fX1, fY1, fX2, fY1, aLineColor);
+                            return true;
+                        }
+
                         // Create a dash unit polygon set.
                         basegfx::B2DPolyPolygon aDashes;
                         std::vector<double>::const_iterator it = aPattern.begin(), itEnd = aPattern.end();
@@ -438,6 +445,13 @@ namespace drawinglayer
                     {
                         // Vertical line.
 
+                        if (basegfx::fTools::equalZero(nThick))
+                        {
+                            // Dash line segment too small to draw.  Substitute it with a solid line.
+                            drawHairLine(mpOutputDevice, fX1, fY1, fX1, fY2, aLineColor);
+                            return true;
+                        }
+
                         // Create a dash unit polygon set.
                         basegfx::B2DPolyPolygon aDashes;
                         std::vector<double>::const_iterator it = aPattern.begin(), itEnd = aPattern.end();
commit 321127e6817880a6108fa0b29bc4284de0294271
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Mon Jan 20 11:41:41 2014 -0500

    Substitute dashed line with a solid line at lower zoom levels.
    
    Change-Id: I0437409b6a5d6163fadf777df5c028950727e786

diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 06ca763..68abfa4 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -73,6 +73,19 @@ basegfx::B2DPolygon makeRectPolygon( double fX, double fY, double fW, double fH
     return aPoly;
 }
 
+void drawHairLine(
+    OutputDevice* pOutDev, double fX1, double fY1, double fX2, double fY2,
+    const basegfx::BColor& rColor )
+{
+    basegfx::B2DPolygon aTarget;
+    aTarget.append(basegfx::B2DPoint(fX1, fY1));
+    aTarget.append(basegfx::B2DPoint(fX2, fY2));
+
+    pOutDev->SetFillColor();
+    pOutDev->SetLineColor(Color(rColor));
+    pOutDev->DrawPolyLine(aTarget);
+}
+
 }
 
 namespace drawinglayer
@@ -289,7 +302,6 @@ namespace drawinglayer
                         maBColorModifierStack.getModifiedColor(rSource.getRGBColorLeft());
                     double nThick = rtl::math::round(rSource.getLeftWidth());
 
-                    bool bAsLine = false;
                     basegfx::B2DPolygon aTarget;
 
                     if (bHorizontal)
@@ -305,10 +317,10 @@ namespace drawinglayer
                         if (fH <= 1.0)
                         {
                             // Draw it as a line.
-                            aTarget.clear();
-                            aTarget.append(basegfx::B2DPoint(aRange.getMinX(), aRange.getMinY()));
-                            aTarget.append(basegfx::B2DPoint(aRange.getMaxX(), aRange.getMinY()));
-                            bAsLine = true;
+                            drawHairLine(
+                                mpOutputDevice, aRange.getMinX(), aRange.getMinY(), aRange.getMaxX(), aRange.getMinY(),
+                                aLineColor);
+                            return true;
                         }
                     }
                     else
@@ -324,25 +336,16 @@ namespace drawinglayer
                         if (fW <= 1.0)
                         {
                             // Draw it as a line.
-                            aTarget.clear();
-                            aTarget.append(basegfx::B2DPoint(aRange.getMinX(), aRange.getMinY()));
-                            aTarget.append(basegfx::B2DPoint(aRange.getMinX(), aRange.getMaxY()));
-                            bAsLine = true;
+                            drawHairLine(
+                                mpOutputDevice, aRange.getMinX(), aRange.getMinY(), aRange.getMinX(), aRange.getMaxY(),
+                                aLineColor);
+                            return true;
                         }
                     }
 
-                    if (bAsLine)
-                    {
-                        mpOutputDevice->SetFillColor();
-                        mpOutputDevice->SetLineColor(Color(aLineColor));
-                        mpOutputDevice->DrawPolyLine(aTarget);
-                    }
-                    else
-                    {
-                        mpOutputDevice->SetFillColor(Color(aLineColor));
-                        mpOutputDevice->SetLineColor();
-                        mpOutputDevice->DrawPolygon(aTarget);
-                    }
+                    mpOutputDevice->SetFillColor(Color(aLineColor));
+                    mpOutputDevice->SetLineColor();
+                    mpOutputDevice->DrawPolygon(aTarget);
                     return true;
                 }
                 break;
@@ -358,6 +361,8 @@ namespace drawinglayer
                         return false;
 
                     double nThick = rtl::math::round(rSource.getLeftWidth());
+                    const basegfx::BColor aLineColor =
+                        maBColorModifierStack.getModifiedColor(rSource.getRGBColorLeft());
 
                     // Transform the current line range before using it for rendering.
                     basegfx::B2DRange aRange(fX1, fY1, fX2, fY2);
@@ -391,6 +396,13 @@ namespace drawinglayer
                             basegfx::B2DPolygon aPoly = aDashes.getB2DPolygon(i);
                             aRange = aPoly.getB2DRange();
                             double fW = rtl::math::round(aRange.getWidth());
+                            if (basegfx::fTools::equalZero(fW))
+                            {
+                                // Dash line segment too small to draw.  Substitute it with a solid line.
+                                drawHairLine(mpOutputDevice, fX1, fY1, fX2, fY1, aLineColor);
+                                return true;
+                            }
+
                             if (rtl::math::isNan(nThick))
                                 nThick = rtl::math::round(aRange.getHeight());
 
@@ -444,6 +456,13 @@ namespace drawinglayer
                             basegfx::B2DPolygon aPoly = aDashes.getB2DPolygon(i);
                             aRange = aPoly.getB2DRange();
                             double fH = rtl::math::round(aRange.getHeight());
+                            if (basegfx::fTools::equalZero(fH))
+                            {
+                                // Dash line segment too small to draw.  Substitute it with a solid line.
+                                drawHairLine(mpOutputDevice, fX1, fY1, fX1, fY2, aLineColor);
+                                return true;
+                            }
+
                             if (rtl::math::isNan(nThick))
                                 nThick = rtl::math::round(aRange.getWidth());
 
@@ -476,8 +495,6 @@ namespace drawinglayer
                         }
                     }
 
-                    const basegfx::BColor aLineColor =
-                        maBColorModifierStack.getModifiedColor(rSource.getRGBColorLeft());
                     mpOutputDevice->SetFillColor(Color(aLineColor));
                     mpOutputDevice->SetLineColor();
                     mpOutputDevice->DrawPolyPolygon(aTarget);
commit 9ff49c9181ec5753a050ebde40cb747287127b02
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Mon Jan 20 11:10:52 2014 -0500

    Better on-screen drawing of vertical dashed lines.
    
    Change-Id: I53d5f8b0278d1228cd941221a07cd360943c5ce6

diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index d037d0c..06ca763 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -267,6 +267,20 @@ namespace drawinglayer
             double fX2 = rE.getX();
             double fY2 = rE.getY();
 
+            bool bHorizontal = false;
+            if (fX1 == fX2)
+            {
+                // Vertical line.
+            }
+            else if (fY1 == fY2)
+            {
+                // Horizontal line.
+                bHorizontal = true;
+            }
+            else
+                // Neither.  Bail out.
+                return false;
+
             switch (rSource.getStyle())
             {
                 case table::BorderLineStyle::SOLID:
@@ -275,14 +289,12 @@ namespace drawinglayer
                         maBColorModifierStack.getModifiedColor(rSource.getRGBColorLeft());
                     double nThick = rtl::math::round(rSource.getLeftWidth());
 
-                    bool bDraw = false;
                     bool bAsLine = false;
                     basegfx::B2DPolygon aTarget;
 
-                    if (fY1 == fY2)
+                    if (bHorizontal)
                     {
                         // Horizontal line.  Draw it as a rectangle.
-                        bDraw = true;
 
                         aTarget = makeRectPolygon(fX1, fY1, fX2-fX1, nThick);
                         aTarget.transform(maCurrentTransformation);
@@ -299,10 +311,9 @@ namespace drawinglayer
                             bAsLine = true;
                         }
                     }
-                    else if (fX1 == fX2)
+                    else
                     {
                         // Vertical line.  Draw it as a rectangle.
-                        bDraw = true;
 
                         aTarget = makeRectPolygon(fX1, fY1, nThick, fY2-fY1);
                         aTarget.transform(maCurrentTransformation);
@@ -320,9 +331,6 @@ namespace drawinglayer
                         }
                     }
 
-                    if (!bDraw)
-                        return false;
-
                     if (bAsLine)
                     {
                         mpOutputDevice->SetFillColor();
@@ -342,30 +350,37 @@ namespace drawinglayer
                 case table::BorderLineStyle::DASHED:
                 case table::BorderLineStyle::FINE_DASHED:
                 {
-                    double fH = rtl::math::round(rSource.getLeftWidth());
+                    std::vector<double> aPattern =
+                        svtools::GetLineDashing(rSource.getStyle(), rSource.getPatternScale()*10.0);
 
-                    if (fY1 == fY2)
-                    {
-                        // Horizontal line.
+                    if (aPattern.empty())
+                        // Failed to get pattern values.
+                        return false;
 
-                        basegfx::B2DPolyPolygon aDashes;
-                        std::vector<double> aPattern =
-                            svtools::GetLineDashing(rSource.getStyle(), rSource.getPatternScale()*10.0);
+                    double nThick = rtl::math::round(rSource.getLeftWidth());
+
+                    // Transform the current line range before using it for rendering.
+                    basegfx::B2DRange aRange(fX1, fY1, fX2, fY2);
+                    aRange.transform(maCurrentTransformation);
+                    fX1 = aRange.getMinX();
+                    fX2 = aRange.getMaxX();
+                    fY1 = aRange.getMinY();
+                    fY2 = aRange.getMaxY();
 
-                        if (aPattern.empty())
-                            // Failed to get pattern values.
-                            return false;
+                    basegfx::B2DPolyPolygon aTarget;
+
+                    if (bHorizontal)
+                    {
+                        // Horizontal line.
 
                         // Create a dash unit polygon set.
+                        basegfx::B2DPolyPolygon aDashes;
                         std::vector<double>::const_iterator it = aPattern.begin(), itEnd = aPattern.end();
                         for (; it != itEnd; ++it)
-                        {
-                            double fW = *it;
-                            aDashes.append(makeRectPolygon(0, 0, fW, fH));
-                        }
+                            aDashes.append(makeRectPolygon(0, 0, *it, nThick));
 
                         aDashes.transform(maCurrentTransformation);
-                        rtl::math::setNan(&fH);
+                        rtl::math::setNan(&nThick);
 
                         // Pixelize the dash unit.  We use the same height for
                         // all dash polygons.
@@ -374,24 +389,15 @@ namespace drawinglayer
                         for (sal_uInt32 i = 0, n = aDashes.count(); i < n; ++i)
                         {
                             basegfx::B2DPolygon aPoly = aDashes.getB2DPolygon(i);
-                            basegfx::B2DRange aRange = aPoly.getB2DRange();
+                            aRange = aPoly.getB2DRange();
                             double fW = rtl::math::round(aRange.getWidth());
-                            if (rtl::math::isNan(fH))
-                                fH = rtl::math::round(aRange.getHeight());
+                            if (rtl::math::isNan(nThick))
+                                nThick = rtl::math::round(aRange.getHeight());
 
-                            aDashesPix.append(makeRectPolygon(0, 0, fW, fH));
+                            aDashesPix.append(makeRectPolygon(0, 0, fW, nThick));
                         }
 
-                        // Transform the current line range before using it for rendering.
-                        basegfx::B2DRange aRange(fX1, fY1, fX2, fY2);
-                        aRange.transform(maCurrentTransformation);
-                        fX1 = aRange.getMinX();
-                        fX2 = aRange.getMaxX();
-                        fY1 = aRange.getMinY();
-                        fY2 = aRange.getMaxY();
-
                         // Make all dash polygons and render them.
-                        basegfx::B2DPolyPolygon aTarget;
                         double fX = fX1;
                         bool bLine = true;
                         sal_uInt32 i = 0, n = aDashesPix.count();
@@ -415,16 +421,68 @@ namespace drawinglayer
                             if (i >= n)
                                 i = 0;
                         }
+                    }
+                    else
+                    {
+                        // Vertical line.
 
-                        const basegfx::BColor aLineColor =
-                            maBColorModifierStack.getModifiedColor(rSource.getRGBColorLeft());
-                        mpOutputDevice->SetFillColor(Color(aLineColor));
-                        mpOutputDevice->SetLineColor();
+                        // Create a dash unit polygon set.
+                        basegfx::B2DPolyPolygon aDashes;
+                        std::vector<double>::const_iterator it = aPattern.begin(), itEnd = aPattern.end();
+                        for (; it != itEnd; ++it)
+                            aDashes.append(makeRectPolygon(0, 0, nThick, *it));
 
-                        mpOutputDevice->DrawPolyPolygon(aTarget);
+                        aDashes.transform(maCurrentTransformation);
+                        rtl::math::setNan(&nThick);
 
-                        return true;
+                        // Pixelize the dash unit.  We use the same width for
+                        // all dash polygons.
+                        basegfx::B2DPolyPolygon aDashesPix;
+
+                        for (sal_uInt32 i = 0, n = aDashes.count(); i < n; ++i)
+                        {
+                            basegfx::B2DPolygon aPoly = aDashes.getB2DPolygon(i);
+                            aRange = aPoly.getB2DRange();
+                            double fH = rtl::math::round(aRange.getHeight());
+                            if (rtl::math::isNan(nThick))
+                                nThick = rtl::math::round(aRange.getWidth());
+
+                            aDashesPix.append(makeRectPolygon(0, 0, nThick, fH));
+                        }
+
+                        // Make all dash polygons and render them.
+                        double fY = fY1;
+                        bool bLine = true;
+                        sal_uInt32 i = 0, n = aDashesPix.count();
+                        while (fY <= fY2)
+                        {
+                            basegfx::B2DPolygon aPoly = aDashesPix.getB2DPolygon(i);
+                            aRange = aPoly.getB2DRange();
+                            if (bLine)
+                            {
+                                double fBlockH = aRange.getHeight();
+                                if (fY + fBlockH > fY2)
+                                    // Clip the bottom end in case it spills over the range.
+                                    fBlockH = fY2 - fY + 1;
+                                aTarget.append(makeRectPolygon(fX1, fY, aRange.getWidth(), fBlockH));
+                            }
+
+                            bLine = !bLine; // line and blank alternate.
+                            fY += aRange.getHeight();
+
+                            ++i;
+                            if (i >= n)
+                                i = 0;
+                        }
                     }
+
+                    const basegfx::BColor aLineColor =
+                        maBColorModifierStack.getModifiedColor(rSource.getRGBColorLeft());
+                    mpOutputDevice->SetFillColor(Color(aLineColor));
+                    mpOutputDevice->SetLineColor();
+                    mpOutputDevice->DrawPolyPolygon(aTarget);
+
+                    return true;
                 }
                 break;
                 default:
commit 1ce65b49915e667baa7d6f1d86df062f33c4a9f5
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Mon Jan 20 10:12:53 2014 -0500

    Same solid line treatment for vertical lines during on-screen drawing.
    
    Change-Id: Idb352dc2afeb2ee7b48620c972c2a186209228ea

diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index f1429a1..d037d0c 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -271,15 +271,20 @@ namespace drawinglayer
             {
                 case table::BorderLineStyle::SOLID:
                 {
+                    const basegfx::BColor aLineColor =
+                        maBColorModifierStack.getModifiedColor(rSource.getRGBColorLeft());
+                    double nThick = rtl::math::round(rSource.getLeftWidth());
+
+                    bool bDraw = false;
+                    bool bAsLine = false;
+                    basegfx::B2DPolygon aTarget;
+
                     if (fY1 == fY2)
                     {
                         // Horizontal line.  Draw it as a rectangle.
+                        bDraw = true;
 
-                        const basegfx::BColor aLineColor =
-                            maBColorModifierStack.getModifiedColor(rSource.getRGBColorLeft());
-                        double nThick = rtl::math::round(rSource.getLeftWidth());
-
-                        basegfx::B2DPolygon aTarget = makeRectPolygon(fX1, fY1, fX2-fX1, nThick);
+                        aTarget = makeRectPolygon(fX1, fY1, fX2-fX1, nThick);
                         aTarget.transform(maCurrentTransformation);
 
                         basegfx::B2DRange aRange = aTarget.getB2DRange();
@@ -291,20 +296,46 @@ namespace drawinglayer
                             aTarget.clear();
                             aTarget.append(basegfx::B2DPoint(aRange.getMinX(), aRange.getMinY()));
                             aTarget.append(basegfx::B2DPoint(aRange.getMaxX(), aRange.getMinY()));
+                            bAsLine = true;
+                        }
+                    }
+                    else if (fX1 == fX2)
+                    {
+                        // Vertical line.  Draw it as a rectangle.
+                        bDraw = true;
+
+                        aTarget = makeRectPolygon(fX1, fY1, nThick, fY2-fY1);
+                        aTarget.transform(maCurrentTransformation);
 
-                            mpOutputDevice->SetFillColor();
-                            mpOutputDevice->SetLineColor(Color(aLineColor));
+                        basegfx::B2DRange aRange = aTarget.getB2DRange();
+                        double fW = aRange.getWidth();
 
-                            mpOutputDevice->DrawPolyLine(aTarget);
-                            return true;
+                        if (fW <= 1.0)
+                        {
+                            // Draw it as a line.
+                            aTarget.clear();
+                            aTarget.append(basegfx::B2DPoint(aRange.getMinX(), aRange.getMinY()));
+                            aTarget.append(basegfx::B2DPoint(aRange.getMinX(), aRange.getMaxY()));
+                            bAsLine = true;
                         }
+                    }
+
+                    if (!bDraw)
+                        return false;
 
+                    if (bAsLine)
+                    {
+                        mpOutputDevice->SetFillColor();
+                        mpOutputDevice->SetLineColor(Color(aLineColor));
+                        mpOutputDevice->DrawPolyLine(aTarget);
+                    }
+                    else
+                    {
                         mpOutputDevice->SetFillColor(Color(aLineColor));
                         mpOutputDevice->SetLineColor();
-
                         mpOutputDevice->DrawPolygon(aTarget);
-                        return true;
                     }
+                    return true;
                 }
                 break;
                 case table::BorderLineStyle::DOTTED:
commit d85dc4b2fe6acc294827aed377109ee174ac7f47
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Mon Jan 20 10:04:26 2014 -0500

    Add vertical lines for testing.
    
    Change-Id: I93d3613547b74a37cebbb6e791e0d23ea405401b

diff --git a/sc/qa/unit/data/xls/cell-borders.xls b/sc/qa/unit/data/xls/cell-borders.xls
index 87d6cf9..5bdf57f 100644
Binary files a/sc/qa/unit/data/xls/cell-borders.xls and b/sc/qa/unit/data/xls/cell-borders.xls differ
commit 4be9a845ed31e78d813a10b16abb72cdd9e647f5
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Sat Jan 18 23:02:05 2014 -0500

    Better pixelization of dashed lines for screen rendering.
    
    Now the dashed lines are evenly placed on screen.  For now, horizontal lines
    only.  I'll work on vertical lines later.
    
    Change-Id: I474e9c8214e5f079ea2cfca12b35381d8fcf2ae1

diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 97a6791..f1429a1 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -52,6 +52,7 @@
 #include <drawinglayer/primitive2d/svggradientprimitive2d.hxx>
 #include <toolkit/helper/vclunohelper.hxx>
 #include <vcl/window.hxx>
+#include <svtools/borderhelper.hxx>
 
 #include <com/sun/star/table/BorderLineStyle.hpp>
 
@@ -59,7 +60,20 @@
 
 using namespace com::sun::star;
 
-//////////////////////////////////////////////////////////////////////////////
+namespace {
+
+basegfx::B2DPolygon makeRectPolygon( double fX, double fY, double fW, double fH )
+{
+    basegfx::B2DPolygon aPoly;
+    aPoly.append(basegfx::B2DPoint(fX, fY));
+    aPoly.append(basegfx::B2DPoint(fX+fW, fY));
+    aPoly.append(basegfx::B2DPoint(fX+fW, fY+fH));
+    aPoly.append(basegfx::B2DPoint(fX, fY+fH));
+    aPoly.setClosed(true);
+    return aPoly;
+}
+
+}
 
 namespace drawinglayer
 {
@@ -245,56 +259,145 @@ namespace drawinglayer
         bool VclPixelProcessor2D::tryDrawBorderLinePrimitive2DDirect(
             const drawinglayer::primitive2d::BorderLinePrimitive2D& rSource)
         {
-            if (rSource.getStyle() == table::BorderLineStyle::SOLID)
-            {
-                const basegfx::B2DPoint& rS = rSource.getStart();
-                const basegfx::B2DPoint& rE = rSource.getEnd();
+            const basegfx::B2DPoint& rS = rSource.getStart();
+            const basegfx::B2DPoint& rE = rSource.getEnd();
 
-                double nX1 = rS.getX();
-                double nY1 = rS.getY();
-                double nX2 = rE.getX();
-                double nY2 = rE.getY();
+            double fX1 = rS.getX();
+            double fY1 = rS.getY();
+            double fX2 = rE.getX();
+            double fY2 = rE.getY();
 
-                if (nY1 == nY2)
+            switch (rSource.getStyle())
+            {
+                case table::BorderLineStyle::SOLID:
                 {
-                    // Horizontal line.  Draw it as a rectangle.
-                    basegfx::B2DPolygon aTarget;
+                    if (fY1 == fY2)
+                    {
+                        // Horizontal line.  Draw it as a rectangle.
 
-                    const basegfx::BColor aLineColor =
-                        maBColorModifierStack.getModifiedColor(rSource.getRGBColorLeft());
-                    double nThick = rtl::math::round(rSource.getLeftWidth());
+                        const basegfx::BColor aLineColor =
+                            maBColorModifierStack.getModifiedColor(rSource.getRGBColorLeft());
+                        double nThick = rtl::math::round(rSource.getLeftWidth());
 
-                    aTarget.append(basegfx::B2DPoint(nX1, nY1));
-                    aTarget.append(basegfx::B2DPoint(nX2, nY1));
-                    aTarget.append(basegfx::B2DPoint(nX2, nY1+nThick));
-                    aTarget.append(basegfx::B2DPoint(nX1, nY1+nThick));
-                    aTarget.setClosed(true);
-                    aTarget.transform(maCurrentTransformation);
+                        basegfx::B2DPolygon aTarget = makeRectPolygon(fX1, fY1, fX2-fX1, nThick);
+                        aTarget.transform(maCurrentTransformation);
 
-                    basegfx::B2DRange aRange = aTarget.getB2DRange();
-                    double fH = aRange.getHeight();
+                        basegfx::B2DRange aRange = aTarget.getB2DRange();
+                        double fH = aRange.getHeight();
 
-                    if (fH <= 1.0)
-                    {
-                        // Draw it as a line.
-                        aTarget.clear();
-                        aTarget.append(basegfx::B2DPoint(aRange.getMinX(), aRange.getMinY()));
-                        aTarget.append(basegfx::B2DPoint(aRange.getMaxX(), aRange.getMinY()));
+                        if (fH <= 1.0)
+                        {
+                            // Draw it as a line.
+                            aTarget.clear();
+                            aTarget.append(basegfx::B2DPoint(aRange.getMinX(), aRange.getMinY()));
+                            aTarget.append(basegfx::B2DPoint(aRange.getMaxX(), aRange.getMinY()));
 
-                        mpOutputDevice->SetFillColor();
-                        mpOutputDevice->SetLineColor(Color(aLineColor));
+                            mpOutputDevice->SetFillColor();
+                            mpOutputDevice->SetLineColor(Color(aLineColor));
 
-                        mpOutputDevice->DrawPolyLine(aTarget);
+                            mpOutputDevice->DrawPolyLine(aTarget);
+                            return true;
+                        }
+
+                        mpOutputDevice->SetFillColor(Color(aLineColor));
+                        mpOutputDevice->SetLineColor();
+
+                        mpOutputDevice->DrawPolygon(aTarget);
                         return true;
                     }
+                }
+                break;
+                case table::BorderLineStyle::DOTTED:
+                case table::BorderLineStyle::DASHED:
+                case table::BorderLineStyle::FINE_DASHED:
+                {
+                    double fH = rtl::math::round(rSource.getLeftWidth());
 
-                    mpOutputDevice->SetFillColor(Color(aLineColor));
-                    mpOutputDevice->SetLineColor();
+                    if (fY1 == fY2)
+                    {
+                        // Horizontal line.
 
-                    mpOutputDevice->DrawPolygon(aTarget);
-                    return true;
-                }
+                        basegfx::B2DPolyPolygon aDashes;
+                        std::vector<double> aPattern =
+                            svtools::GetLineDashing(rSource.getStyle(), rSource.getPatternScale()*10.0);
+
+                        if (aPattern.empty())
+                            // Failed to get pattern values.
+                            return false;
+
+                        // Create a dash unit polygon set.
+                        std::vector<double>::const_iterator it = aPattern.begin(), itEnd = aPattern.end();
+                        for (; it != itEnd; ++it)
+                        {
+                            double fW = *it;
+                            aDashes.append(makeRectPolygon(0, 0, fW, fH));
+                        }
+
+                        aDashes.transform(maCurrentTransformation);
+                        rtl::math::setNan(&fH);
+
+                        // Pixelize the dash unit.  We use the same height for
+                        // all dash polygons.
+                        basegfx::B2DPolyPolygon aDashesPix;
+
+                        for (sal_uInt32 i = 0, n = aDashes.count(); i < n; ++i)
+                        {
+                            basegfx::B2DPolygon aPoly = aDashes.getB2DPolygon(i);
+                            basegfx::B2DRange aRange = aPoly.getB2DRange();
+                            double fW = rtl::math::round(aRange.getWidth());
+                            if (rtl::math::isNan(fH))
+                                fH = rtl::math::round(aRange.getHeight());
 
+                            aDashesPix.append(makeRectPolygon(0, 0, fW, fH));
+                        }
+
+                        // Transform the current line range before using it for rendering.
+                        basegfx::B2DRange aRange(fX1, fY1, fX2, fY2);
+                        aRange.transform(maCurrentTransformation);
+                        fX1 = aRange.getMinX();
+                        fX2 = aRange.getMaxX();
+                        fY1 = aRange.getMinY();
+                        fY2 = aRange.getMaxY();
+
+                        // Make all dash polygons and render them.
+                        basegfx::B2DPolyPolygon aTarget;
+                        double fX = fX1;
+                        bool bLine = true;
+                        sal_uInt32 i = 0, n = aDashesPix.count();
+                        while (fX <= fX2)
+                        {
+                            basegfx::B2DPolygon aPoly = aDashesPix.getB2DPolygon(i);
+                            aRange = aPoly.getB2DRange();
+                            if (bLine)
+                            {
+                                double fBlockW = aRange.getWidth();
+                                if (fX + fBlockW > fX2)
+                                    // Clip the right end in case it spills over the range.
+                                    fBlockW = fX2 - fX + 1;
+                                aTarget.append(makeRectPolygon(fX, fY1, fBlockW, aRange.getHeight()));
+                            }
+
+                            bLine = !bLine; // line and blank alternate.
+                            fX += aRange.getWidth();
+
+                            ++i;
+                            if (i >= n)
+                                i = 0;
+                        }
+
+                        const basegfx::BColor aLineColor =
+                            maBColorModifierStack.getModifiedColor(rSource.getRGBColorLeft());
+                        mpOutputDevice->SetFillColor(Color(aLineColor));
+                        mpOutputDevice->SetLineColor();
+
+                        mpOutputDevice->DrawPolyPolygon(aTarget);
+
+                        return true;
+                    }
+                }
+                break;
+                default:
+                    ;
             }
             return false;
         }
diff --git a/include/svtools/borderhelper.hxx b/include/svtools/borderhelper.hxx
index a1eb77b..5e4328d 100644
--- a/include/svtools/borderhelper.hxx
+++ b/include/svtools/borderhelper.hxx
@@ -29,6 +29,8 @@
 
 namespace svtools {
 
+SVT_DLLPUBLIC std::vector<double> GetLineDashing( sal_uInt16 nDashing, double fScale );
+
 SVT_DLLPUBLIC basegfx::B2DPolyPolygon ApplyLineDashing(
     const basegfx::B2DPolygon& rPolygon, sal_uInt16 nDashing, double fScale );
 
diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx
index b77b737..47012cd 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -586,6 +586,9 @@ void lclDrawPolygon( OutputDevice& rDev, const basegfx::B2DPolygon& rPolygon, lo
 
 namespace svtools {
 
+/**
+ * Dashing array must start with a line width and end with a blank width.
+ */
 std::vector<double> GetDashing( sal_uInt16 nDashing )
 {
     std::vector<double> aPattern;
@@ -625,6 +628,13 @@ public:
 
 }
 
+std::vector<double> GetLineDashing( sal_uInt16 nDashing, double fScale )
+{
+    std::vector<double> aPattern = GetDashing(nDashing);
+    std::for_each(aPattern.begin(), aPattern.end(), ApplyScale(fScale));
+    return aPattern;
+}
+
 basegfx::B2DPolyPolygon ApplyLineDashing( const basegfx::B2DPolygon& rPolygon, sal_uInt16 nDashing, double fScale )
 {
     std::vector<double> aPattern = GetDashing(nDashing);
commit bc1f6b0f89c8561a80541a0a15fc7b30e09c07e5
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Sat Jan 18 18:17:52 2014 -0500

    Draw horizontal solid border lines directly in the pixel processor.
    
    This makes slightly skinnier solid lines which look better on screen.
    
    Change-Id: Ia7764be4a53d1dd6bb60ecb3ba5c8966403e4e6c

diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 9b020f7..97a6791 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -34,6 +34,7 @@
 #include <drawinglayer/primitive2d/pointarrayprimitive2d.hxx>
 #include <drawinglayer/primitive2d/wrongspellprimitive2d.hxx>
 #include <drawinglayer/primitive2d/controlprimitive2d.hxx>
+#include <drawinglayer/primitive2d/borderlineprimitive2d.hxx>
 #include <com/sun/star/awt/XWindow2.hpp>
 #include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
 #include <drawinglayer/primitive2d/pagepreviewprimitive2d.hxx>
@@ -52,6 +53,8 @@
 #include <toolkit/helper/vclunohelper.hxx>
 #include <vcl/window.hxx>
 
+#include <com/sun/star/table/BorderLineStyle.hpp>
+
 //////////////////////////////////////////////////////////////////////////////
 
 using namespace com::sun::star;
@@ -239,6 +242,63 @@ namespace drawinglayer
             return bTryWorked;
         }
 
+        bool VclPixelProcessor2D::tryDrawBorderLinePrimitive2DDirect(
+            const drawinglayer::primitive2d::BorderLinePrimitive2D& rSource)
+        {
+            if (rSource.getStyle() == table::BorderLineStyle::SOLID)
+            {
+                const basegfx::B2DPoint& rS = rSource.getStart();
+                const basegfx::B2DPoint& rE = rSource.getEnd();
+
+                double nX1 = rS.getX();
+                double nY1 = rS.getY();
+                double nX2 = rE.getX();
+                double nY2 = rE.getY();
+
+                if (nY1 == nY2)
+                {
+                    // Horizontal line.  Draw it as a rectangle.
+                    basegfx::B2DPolygon aTarget;
+
+                    const basegfx::BColor aLineColor =
+                        maBColorModifierStack.getModifiedColor(rSource.getRGBColorLeft());
+                    double nThick = rtl::math::round(rSource.getLeftWidth());
+
+                    aTarget.append(basegfx::B2DPoint(nX1, nY1));
+                    aTarget.append(basegfx::B2DPoint(nX2, nY1));
+                    aTarget.append(basegfx::B2DPoint(nX2, nY1+nThick));
+                    aTarget.append(basegfx::B2DPoint(nX1, nY1+nThick));
+                    aTarget.setClosed(true);
+                    aTarget.transform(maCurrentTransformation);
+
+                    basegfx::B2DRange aRange = aTarget.getB2DRange();
+                    double fH = aRange.getHeight();
+
+                    if (fH <= 1.0)
+                    {
+                        // Draw it as a line.
+                        aTarget.clear();
+                        aTarget.append(basegfx::B2DPoint(aRange.getMinX(), aRange.getMinY()));
+                        aTarget.append(basegfx::B2DPoint(aRange.getMaxX(), aRange.getMinY()));
+
+                        mpOutputDevice->SetFillColor();
+                        mpOutputDevice->SetLineColor(Color(aLineColor));
+
+                        mpOutputDevice->DrawPolyLine(aTarget);
+                        return true;
+                    }
+
+                    mpOutputDevice->SetFillColor(Color(aLineColor));
+                    mpOutputDevice->SetLineColor();
+
+                    mpOutputDevice->DrawPolygon(aTarget);
+                    return true;
+                }
+
+            }
+            return false;
+        }
+
         void VclPixelProcessor2D::processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate)
         {
             switch(rCandidate.getPrimitive2DID())
@@ -851,7 +911,11 @@ namespace drawinglayer
                     sal_uInt16 nAntiAliasing = mpOutputDevice->GetAntialiasing();
                     mpOutputDevice->SetAntialiasing(nAntiAliasing & ~ANTIALIASING_ENABLE_B2DDRAW);
 
-                    process(rCandidate.get2DDecomposition(getViewInformation2D()));
+                    const drawinglayer::primitive2d::BorderLinePrimitive2D& rBorder =
+                        static_cast<const drawinglayer::primitive2d::BorderLinePrimitive2D&>(rCandidate);
+
+                    if (!tryDrawBorderLinePrimitive2DDirect(rBorder))
+                        process(rCandidate.get2DDecomposition(getViewInformation2D()));
 
                     mpOutputDevice->SetAntialiasing(nAntiAliasing);
                     break;
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.hxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.hxx
index a55962d..c9c2d742 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.hxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.hxx
@@ -34,6 +34,7 @@ namespace drawinglayer { namespace primitive2d {
     class PolyPolygonColorPrimitive2D;
     class PolygonHairlinePrimitive2D;
     class PolygonStrokePrimitive2D;
+    class BorderLinePrimitive2D;
 }}
 
 //////////////////////////////////////////////////////////////////////////////
@@ -64,6 +65,7 @@ namespace drawinglayer
             bool tryDrawPolyPolygonColorPrimitive2DDirect(const drawinglayer::primitive2d::PolyPolygonColorPrimitive2D& rSource, double fTransparency);
             bool tryDrawPolygonHairlinePrimitive2DDirect(const drawinglayer::primitive2d::PolygonHairlinePrimitive2D& rSource, double fTransparency);
             bool tryDrawPolygonStrokePrimitive2DDirect(const drawinglayer::primitive2d::PolygonStrokePrimitive2D& rSource, double fTransparency);
+            bool tryDrawBorderLinePrimitive2DDirect(const drawinglayer::primitive2d::BorderLinePrimitive2D& rSource);
 
         public:
             /// constructor/destructor
commit 9bc2ab30e302c210b725e7035ea4d17774ef90e1
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Mon Jan 20 09:26:58 2014 +0100

    Revert "svt: Use constructor feature for FilePicker and FolderPicker..."
    
    It does not make a real sense to use constructor for implementations that act
    as a trampoline; instead, we should do a constructor for the real
    implementations that hide behind it.
    
    This reverts commit 2fbb47156773b2e300fc987efc2da85c66e567d1.
    This reverts (part of) commit 58ea27124af27bfac21a796b0d13d72354bd0dd3.
    This reverts (part of) commit 194bdbde25dd70988c94ff5e1af43b530d47d94b.
    This reverts (part of) commit df002e39f7518036ae1c1d2afec7a525ef902327.
    This reverts (part of) commit eb89c6f7dcd613cda6a9eee6f7897225e0334a25.
    This reverts (part of) commit bdeb57c23973f3ef79020847b2fe39f312cf3c0b.
    This reverts (part of) commit 4337a0664f4fb73f9e1be74f2a632847871da402.
    
    Change-Id: Ibd9b1066f3b6ea215d8da9f491d5f026cd75b029

diff --git a/svtools/Library_svt.mk b/svtools/Library_svt.mk
index 4690961..4762808 100644
--- a/svtools/Library_svt.mk
+++ b/svtools/Library_svt.mk
@@ -230,6 +230,7 @@ $(eval $(call gb_Library_add_exception_objects,svt,\
     svtools/source/uno/framestatuslistener \
     svtools/source/uno/generictoolboxcontroller \
     svtools/source/uno/genericunodialog \
+    svtools/source/uno/miscservices \
     svtools/source/uno/popupmenucontrollerbase \
     svtools/source/uno/popupwindowcontroller \
     svtools/source/uno/statusbarcontroller \
diff --git a/svtools/source/uno/fpicker.cxx b/svtools/source/uno/fpicker.cxx
index 1eccb57..c3961e8 100644
--- a/svtools/source/uno/fpicker.cxx
+++ b/svtools/source/uno/fpicker.cxx
@@ -53,12 +53,14 @@ static OUString FilePicker_getSystemPickerServiceName()
 #endif
 }
 
-extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
-com_sun_star_comp_svt_FilePicker_get_implementation(
-        css::uno::XComponentContext *context,
-    css::uno::Sequence<css::uno::Any> const &)
+Reference< css::uno::XInterface > FilePicker_CreateInstance (
+    Reference< css::uno::XComponentContext > const & context)
 {
     Reference< css::uno::XInterface > xResult;
+
+    if (!context.is())
+        return xResult;
+
     Reference< css::lang::XMultiComponentFactory > xFactory (context->getServiceManager());
     if (xFactory.is() && SvtMiscOptions().UseSystemFileDialog())
     {
@@ -92,8 +94,20 @@ com_sun_star_comp_svt_FilePicker_get_implementation(
         // Add to FilePicker history.
         svt::addFilePicker (xResult);
     }
-    xResult->acquire();
-    return xResult.get();
+    return xResult;
+}
+
+OUString SAL_CALL FilePicker_getImplementationName()
+{
+    return OUString("com.sun.star.comp.svt.FilePicker");
+}
+
+Sequence< OUString > FilePicker_getSupportedServiceNames()
+{
+    Sequence< OUString > aServiceNames(1);
+    aServiceNames.getArray()[0] =
+        OUString( "com.sun.star.ui.dialogs.FilePicker");
+    return aServiceNames;
 }
 
 /*
@@ -113,12 +127,14 @@ static OUString FolderPicker_getSystemPickerServiceName()
     return OUString("com.sun.star.ui.dialogs.SystemFolderPicker");
 }
 
-extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
-com_sun_star_comp_svt_FolderPicker_get_implementation(
-        css::uno::XComponentContext *context,
-    css::uno::Sequence<css::uno::Any> const &)
+Reference< css::uno::XInterface > FolderPicker_CreateInstance (
+    Reference< css::uno::XComponentContext > const & context)
 {
     Reference< css::uno::XInterface > xResult;
+
+    if (!context.is())
+        return xResult;
+
     Reference< css::lang::XMultiComponentFactory > xFactory (context->getServiceManager());
     if (xFactory.is() && SvtMiscOptions().UseSystemFileDialog())
     {
@@ -149,8 +165,20 @@ com_sun_star_comp_svt_FolderPicker_get_implementation(
         // Add to FolderPicker history.
         svt::addFolderPicker (xResult);
     }
-    xResult->acquire();
-    return xResult.get();
+    return xResult;
+}
+
+OUString SAL_CALL FolderPicker_getImplementationName()
+{
+    return OUString("com.sun.star.comp.svt.FolderPicker");
+}
+
+Sequence< OUString > FolderPicker_getSupportedServiceNames()
+{
+    Sequence< OUString > aServiceNames(1);
+    aServiceNames.getArray()[0] =
+        OUString( "com.sun.star.ui.dialogs.FolderPicker");
+    return aServiceNames;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/uno/fpicker.hxx b/svtools/source/uno/fpicker.hxx
new file mode 100644
index 0000000..5042cff
--- /dev/null
+++ b/svtools/source/uno/fpicker.hxx
@@ -0,0 +1,47 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_SVTOOLS_SOURCE_UNO_FPICKER_HXX
+#define INCLUDED_SVTOOLS_SOURCE_UNO_FPICKER_HXX
+
+#include <sal/config.h>
+#include <sal/types.h>
+#include <rtl/ustring.hxx>
+
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
+
+namespace com { namespace sun { namespace star {
+    namespace lang { class XMultiServiceFactory; }
+    namespace uno { class XInterface; }
+} } }
+
+css::uno::Reference<css::uno::XInterface> SAL_CALL FilePicker_CreateInstance(
+        css::uno::Reference< css::uno::XComponentContext > const & context);
+css::uno::Sequence<OUString> FilePicker_getSupportedServiceNames();
+OUString FilePicker_getImplementationName();
+
+css::uno::Reference<css::uno::XInterface> SAL_CALL FolderPicker_CreateInstance(
+        css::uno::Reference< css::uno::XComponentContext > const & context);
+css::uno::Sequence<OUString> FolderPicker_getSupportedServiceNames();
+OUString FolderPicker_getImplementationName();
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/uno/miscservices.cxx b/svtools/source/uno/miscservices.cxx
new file mode 100644
index 0000000..3801ce7
--- /dev/null
+++ b/svtools/source/uno/miscservices.cxx
@@ -0,0 +1,77 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#include <sal/types.h>
+
+#include <cppuhelper/factory.hxx>
+#include <cppuhelper/implementationentry.hxx>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+
+#include "fpicker.hxx"
+
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::lang;
+
+namespace
+{
+    static const struct ::cppu::ImplementationEntry s_aServiceEntries[] =
+    {
+        {
+            // FilePicker should not use a constructor, it is only a
+            // trampoline to a real impl.
+            FilePicker_CreateInstance,
+            FilePicker_getImplementationName,
+            FilePicker_getSupportedServiceNames,
+            ::cppu::createSingleComponentFactory, 0, 0
+        },
+        {
+            // FolderPicker should not use a constructor, it is only a
+            // trampoline to a real impl.
+            FolderPicker_CreateInstance,
+            FolderPicker_getImplementationName,
+            FolderPicker_getSupportedServiceNames,
+            ::cppu::createSingleComponentFactory, 0, 0
+        },
+        { 0, 0, 0, 0, 0, 0 }
+    };
+}
+
+extern "C"
+{
+
+SAL_DLLPUBLIC_EXPORT void * SAL_CALL svt_component_getFactory(
+    const sal_Char * pImplementationName, void * _pServiceManager, void * pRegistryKey)
+{
+    void * pResult = 0;
+    if (_pServiceManager)
+    {
+        Reference< XMultiServiceFactory > xSMgr(reinterpret_cast< XMultiServiceFactory * >(_pServiceManager));
+
+        pResult = cppu::component_getFactoryHelper(pImplementationName,
+                _pServiceManager,
+                pRegistryKey,
+                s_aServiceEntries);
+    }
+    return pResult;
+}
+
+} // extern "C"
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/util/svt.component b/svtools/util/svt.component
index 5e5438e..f48425f 100644
--- a/svtools/util/svt.component
+++ b/svtools/util/svt.component
@@ -18,7 +18,7 @@
  -->
 
 <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
-    xmlns="http://openoffice.org/2010/uno-components">
+    prefix="svt" xmlns="http://openoffice.org/2010/uno-components">
   <implementation name="com.sun.star.comp.graphic.GraphicProvider"
       constructor="com_sun_star_comp_graphic_GraphicProvider_get_implementation">
     <service name="com.sun.star.graphic.GraphicProvider"/>
@@ -43,12 +43,10 @@
       constructor="com_sun_star_svtools_SvFilterOptionsDialog_get_implementation">
     <service name="com.sun.star.ui.dialogs.FilterOptionsDialog"/>
   </implementation>
-  <implementation name="com.sun.star.comp.svt.FilePicker"
-      constructor="com_sun_star_comp_svt_FilePicker_get_implementation">
+  <implementation name="com.sun.star.comp.svt.FilePicker">
     <service name="com.sun.star.ui.dialogs.FilePicker"/>
   </implementation>
-  <implementation name="com.sun.star.comp.svt.FolderPicker"
-      constructor="com_sun_star_comp_svt_FolderPicker_get_implementation">
+  <implementation name="com.sun.star.comp.svt.FolderPicker">
     <service name="com.sun.star.ui.dialogs.FolderPicker"/>
   </implementation>
   <implementation name="com.sun.star.comp.embed.DocumentCloser"
commit 306efefe22e02248eff14f8be2cef68d75d26e55
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Thu Jan 16 16:26:55 2014 +0100

    Minimize the constructor functions to a bare minimum.
    
    Most of the constructors are supposed to be only a call of
    
      new TheInstance(arguments)
    
    or an equivalent; so let's just change the constructor caller accordingly, to
    accept unacquired new instance.
    
    If there are exceptions that need to do more heavy lifting, they do not have
    to use the constructor feature, or there can be a wrapper for the real
    implementation, doing the additional work in their (C++) constructor.
    
    Change-Id: I035c378778aeda60d15af4e56ca3761c586d5ded

diff --git a/codemaker/source/cppumaker/cpputype.cxx b/codemaker/source/cppumaker/cpputype.cxx
index d3898d9..4dbfd3a 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -3463,7 +3463,7 @@ void ServiceType::dumpHxxFile(
                       "LO_URE_CTOR_FUN_")
                   << name_.replaceAll(".", "_dot_")
                   << (")(the_context.get(), ::css::uno::Sequence<"
-                      " ::css::uno::Any >())), ::SAL_NO_ACQUIRE),"
+                      " ::css::uno::Any >()))),"
                       " ::css::uno::UNO_QUERY);\n#else\n")
                   << indent() << "the_instance = ::css::uno::Reference< "
                   << scopedBaseName
@@ -3606,7 +3606,7 @@ void ServiceType::dumpHxxFile(
                 } else {
                     o << "the_arguments";
                 }
-                o << ")), ::SAL_NO_ACQUIRE), ::css::uno::UNO_QUERY);\n" << indent()
+                o << "))), ::css::uno::UNO_QUERY);\n" << indent()
                   << ("::css::uno::Reference< ::css::lang::XInitialization > "
                       "init(the_instance, ::css::uno::UNO_QUERY);\n")
                   << indent() << "if (init.is()) {\n"
diff --git a/cppuhelper/source/servicemanager.cxx b/cppuhelper/source/servicemanager.cxx
index 9bc3113..af964fe 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -706,8 +706,7 @@ cppuhelper::ServiceManager::Data::Implementation::createInstance(
         if (constructor != 0) {
             return css::uno::Reference<css::uno::XInterface>(
                 (*constructor)(
-                    context.get(), css::uno::Sequence<css::uno::Any>()),
-                SAL_NO_ACQUIRE);
+                    context.get(), css::uno::Sequence<css::uno::Any>()));
         }
         if (factory1.is()) {
             return factory1->createInstanceWithContext(context);
@@ -730,8 +729,7 @@ cppuhelper::ServiceManager::Data::Implementation::createInstance(
         if (constructor != 0) {
             singleton.set(
                 (*constructor)(
-                    context.get(), css::uno::Sequence<css::uno::Any>()),
-                SAL_NO_ACQUIRE);
+                    context.get(), css::uno::Sequence<css::uno::Any>()));
         } else if (factory1.is()) {
             singleton = factory1->createInstanceWithContext(context);
         } else if (factory2.is()) {
@@ -761,7 +759,7 @@ cppuhelper::ServiceManager::Data::Implementation::createInstanceWithArguments(
             // should be removed again once XInitialization-based
             // implementations have become rare:
             css::uno::Reference<css::uno::XInterface> inst(
-                (*constructor)(context.get(), arguments), SAL_NO_ACQUIRE);
+                (*constructor)(context.get(), arguments));
             css::uno::Reference<css::lang::XInitialization> init(
                 inst, css::uno::UNO_QUERY);
             if (init.is()) {
@@ -793,8 +791,7 @@ cppuhelper::ServiceManager::Data::Implementation::createInstanceWithArguments(
         }
         if (constructor != 0) {
             //HACK: see above
-            singleton.set(
-                (*constructor)(context.get(), arguments), SAL_NO_ACQUIRE);
+            singleton.set((*constructor)(context.get(), arguments));
             css::uno::Reference<css::lang::XInitialization> init(
                 singleton, css::uno::UNO_QUERY);
             if (init.is()) {
diff --git a/include/sfx2/app.hxx b/include/sfx2/app.hxx
index 5a5cf36..d811b27 100644
--- a/include/sfx2/app.hxx
+++ b/include/sfx2/app.hxx
@@ -189,10 +189,8 @@ public:
     static ErrCode              CallAppBasic( const OUString& i_macroName, SbxArray* i_args = NULL, SbxValue* i_ret = NULL )
                                 { return CallBasic( i_macroName, SfxApplication::GetOrCreate()->GetBasicManager(), i_args, i_ret ); }
     BasicManager*               GetBasicManager();
-    com::sun::star::uno::Reference< com::sun::star::script::XLibraryContainer >
-                                GetDialogContainer();
-    com::sun::star::uno::Reference< com::sun::star::script::XLibraryContainer >
-                                GetBasicContainer();
+    com::sun::star::script::XLibraryContainer * GetDialogContainer();
+    com::sun::star::script::XLibraryContainer * GetBasicContainer();
     StarBASIC*                  GetBasic();
     sal_uInt16                  SaveBasicAndDialogContainer() const;
 
diff --git a/sax/source/expatwrap/sax_expat.cxx b/sax/source/expatwrap/sax_expat.cxx
index 12066dc..7d5e36c 100644
--- a/sax/source/expatwrap/sax_expat.cxx
+++ b/sax/source/expatwrap/sax_expat.cxx
@@ -1025,9 +1025,7 @@ com_sun_star_comp_extensions_xml_sax_ParserExpat_get_implementation(
     css::uno::XComponentContext *,
     css::uno::Sequence<css::uno::Any> const &)
 {
-    rtl::Reference<SaxExpatParser> x(new SaxExpatParser);
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new SaxExpatParser);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sax/source/expatwrap/saxwriter.cxx b/sax/source/expatwrap/saxwriter.cxx
index be86b61..73cb50f 100644
--- a/sax/source/expatwrap/saxwriter.cxx
+++ b/sax/source/expatwrap/saxwriter.cxx
@@ -1375,9 +1375,7 @@ com_sun_star_extensions_xml_sax_Writer_get_implementation(
     css::uno::XComponentContext *,
     css::uno::Sequence<css::uno::Any> const &)
 {
-    rtl::Reference<SAXWriter> x(new SAXWriter);
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new SAXWriter);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx
index 57bff21..152c22d 100644
--- a/sax/source/fastparser/fastparser.cxx
+++ b/sax/source/fastparser/fastparser.cxx
@@ -1431,9 +1431,7 @@ com_sun_star_comp_extensions_xml_sax_FastParser_get_implementation(
     css::uno::XComponentContext *,
     css::uno::Sequence<css::uno::Any> const &)
 {
-    rtl::Reference<FastSaxParser> x(new FastSaxParser);
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new FastSaxParser);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/appbas.cxx b/sfx2/source/appl/appbas.cxx
index 5010806..3251a92 100644
--- a/sfx2/source/appl/appbas.cxx
+++ b/sfx2/source/appl/appbas.cxx
@@ -127,11 +127,10 @@ BasicManager* SfxApplication::GetBasicManager()
 
 //--------------------------------------------------------------------
 
-Reference< XLibraryContainer > SfxApplication::GetDialogContainer()
+XLibraryContainer * SfxApplication::GetDialogContainer()
 {
 #ifdef DISABLE_SCRIPTING
-    Reference< XLibraryContainer >  dummy;
-    return dummy;
+    return NULL;
 #else
     if ( !pAppData_Impl->pBasicManager->isValid() )
         GetBasicManager();
@@ -141,11 +140,10 @@ Reference< XLibraryContainer > SfxApplication::GetDialogContainer()
 
 //--------------------------------------------------------------------
 
-Reference< XLibraryContainer > SfxApplication::GetBasicContainer()
+XLibraryContainer * SfxApplication::GetBasicContainer()
 {
 #ifdef DISABLE_SCRIPTING
-    Reference< XLibraryContainer >  dummy;
-    return dummy;
+    return NULL;
 #else
     if ( !pAppData_Impl->pBasicManager->isValid() )
         GetBasicManager();
diff --git a/sfx2/source/appl/appbaslib.cxx b/sfx2/source/appl/appbaslib.cxx
index 4b96cc2..df0c237 100644
--- a/sfx2/source/appl/appbaslib.cxx
+++ b/sfx2/source/appl/appbaslib.cxx
@@ -121,7 +121,7 @@ void SfxBasicManagerHolder::storeLibrariesToStorage( const Reference< XStorage >
 #endif
 }
 
-Reference< XLibraryContainer > SfxBasicManagerHolder::getLibraryContainer( ContainerType _eType )
+XLibraryContainer * SfxBasicManagerHolder::getLibraryContainer( ContainerType _eType )
 {
     OSL_PRECOND( isValid(), "SfxBasicManagerHolder::getLibraryContainer: not initialized!" );
 
@@ -161,9 +161,7 @@ com_sun_star_comp_sfx2_ApplicationDialogLibraryContainer_get_implementation(
     css::uno::Sequence<css::uno::Any> const &)
 {
     SFX_APP()->GetBasicManager();
-    Reference< XInterface > xRet( SFX_APP()->GetDialogContainer(), UNO_QUERY );
-    xRet->acquire();
-    return xRet.get();
+    return SFX_APP()->GetDialogContainer();
 }
 
 //============================================================================
@@ -175,9 +173,7 @@ com_sun_star_comp_sfx2_ApplicationScriptLibraryContainer_get_implementation(
     css::uno::Sequence<css::uno::Any> const &)
 {
     SFX_APP()->GetBasicManager();
-    Reference< XInterface > xRet( SFX_APP()->GetBasicContainer(), UNO_QUERY );
-    xRet->acquire();
-    return xRet.get();
+    return SFX_APP()->GetBasicContainer();
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/appdispatchprovider.cxx b/sfx2/source/appl/appdispatchprovider.cxx
index 7774582..c2b88af 100644
--- a/sfx2/source/appl/appdispatchprovider.cxx
+++ b/sfx2/source/appl/appdispatchprovider.cxx
@@ -255,9 +255,7 @@ com_sun_star_comp_sfx2_AppDispatchProvider_get_implementation(
     css::uno::XComponentContext *,
     css::uno::Sequence<css::uno::Any> const &arguments)
 {
-    rtl::Reference<SfxAppDispatchProvider> x(new SfxAppDispatchProvider(arguments));
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new SfxAppDispatchProvider(arguments));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/macroloader.cxx b/sfx2/source/appl/macroloader.cxx
index 8d59b84..ff58861 100644
--- a/sfx2/source/appl/macroloader.cxx
+++ b/sfx2/source/appl/macroloader.cxx
@@ -341,9 +341,7 @@ com_sun_star_comp_sfx2_SfxMacroLoader_get_implementation(
     css::uno::XComponentContext *,
     css::uno::Sequence<css::uno::Any> const &arguments)
 {
-    rtl::Reference<SfxMacroLoader> x(new SfxMacroLoader(arguments));
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new SfxMacroLoader(arguments));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx
index bef4019..a7e2e1b 100644
--- a/sfx2/source/appl/shutdownicon.cxx
+++ b/sfx2/source/appl/shutdownicon.cxx
@@ -976,9 +976,7 @@ com_sun_star_comp_desktop_QuickstartWrapper_get_implementation(
     css::uno::XComponentContext *context,
     css::uno::Sequence<css::uno::Any> const &)
 {
-    rtl::Reference<ShutdownIcon> x(new ShutdownIcon(context));
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new ShutdownIcon(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/xpackcreator.cxx b/sfx2/source/appl/xpackcreator.cxx
index 5fcc445..6c654e7 100644
--- a/sfx2/source/appl/xpackcreator.cxx
+++ b/sfx2/source/appl/xpackcreator.cxx
@@ -178,9 +178,7 @@ com_sun_star_comp_embed_PackageStructureCreator_get_implementation(
     css::uno::XComponentContext *,
     css::uno::Sequence<css::uno::Any> const &)
 {
-    rtl::Reference<OPackageStructureCreator> x(new OPackageStructureCreator());
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new OPackageStructureCreator());
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/dialog/backingcomp.cxx b/sfx2/source/dialog/backingcomp.cxx
index 6052c96..fa5cfa8 100644
--- a/sfx2/source/dialog/backingcomp.cxx
+++ b/sfx2/source/dialog/backingcomp.cxx
@@ -813,9 +813,7 @@ com_sun_star_comp_sfx2_BackingComp_get_implementation(
     css::uno::XComponentContext *context,
     css::uno::Sequence<css::uno::Any> const &)
 {
-    rtl::Reference<BackingComp> x(new BackingComp(context));
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new BackingComp(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx
index 9e1d2f1..90bb305 100644
--- a/sfx2/source/doc/SfxDocumentMetaData.cxx
+++ b/sfx2/source/doc/SfxDocumentMetaData.cxx
@@ -2319,9 +2319,7 @@ CompatWriterDocPropsImpl_get_implementation(
     css::uno::XComponentContext *context,
     css::uno::Sequence<css::uno::Any> const &)
 {
-    rtl::Reference<CompatWriterDocPropsImpl> x(new CompatWriterDocPropsImpl(context));
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new CompatWriterDocPropsImpl(context));
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
@@ -2329,9 +2327,7 @@ SfxDocumentMetaData_get_implementation(
     css::uno::XComponentContext *context,
     css::uno::Sequence<css::uno::Any> const &)
 {
-    rtl::Reference<SfxDocumentMetaData> x(new SfxDocumentMetaData(context));
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new SfxDocumentMetaData(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index 11461cd..54d2bf9 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -2900,9 +2900,7 @@ com_sun_star_comp_sfx2_DocumentTemplates_get_implementation(
     css::uno::XComponentContext *context,
     css::uno::Sequence<css::uno::Any> const &)
 {
-    rtl::Reference<SfxDocTplService> x(new SfxDocTplService(context));
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new SfxDocTplService(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/doc/iframe.cxx b/sfx2/source/doc/iframe.cxx
index d4d5d5c..504b289 100644
--- a/sfx2/source/doc/iframe.cxx
+++ b/sfx2/source/doc/iframe.cxx
@@ -432,9 +432,7 @@ com_sun_star_comp_sfx2_IFrameObject_get_implementation(
     css::uno::XComponentContext *context,
     css::uno::Sequence<css::uno::Any> const &arguments)
 {
-    rtl::Reference<IFrameObject> x(new IFrameObject(context, arguments));
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new IFrameObject(context, arguments));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/doc/ownsubfilterservice.cxx b/sfx2/source/doc/ownsubfilterservice.cxx
index bb817db..139f7da 100644
--- a/sfx2/source/doc/ownsubfilterservice.cxx
+++ b/sfx2/source/doc/ownsubfilterservice.cxx
@@ -126,9 +126,7 @@ com_sun_star_comp_document_OwnSubFilter_get_implementation(
     css::uno::XComponentContext *,
     css::uno::Sequence<css::uno::Any> const &arguments)
 {
-    rtl::Reference<OwnSubFilterService> x(new OwnSubFilterService(arguments));
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new OwnSubFilterService(arguments));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/doc/plugin.cxx b/sfx2/source/doc/plugin.cxx
index 86d4945..b792196 100644
--- a/sfx2/source/doc/plugin.cxx
+++ b/sfx2/source/doc/plugin.cxx
@@ -311,9 +311,7 @@ com_sun_star_comp_sfx2_PluginObject_get_implementation(
     css::uno::XComponentContext *,
     css::uno::Sequence<css::uno::Any> const &)
 {
-    rtl::Reference<PluginObject> x(new PluginObject());
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new PluginObject());
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/inc/appbaslib.hxx b/sfx2/source/inc/appbaslib.hxx
index 8f80420..2763b75 100644
--- a/sfx2/source/inc/appbaslib.hxx
+++ b/sfx2/source/inc/appbaslib.hxx
@@ -59,7 +59,7 @@ public:
     */
     void    reset( BasicManager* _pBasicManager );
 
-    ::com::sun::star::uno::Reference< ::com::sun::star::script::XLibraryContainer >
+    ::com::sun::star::script::XLibraryContainer *
             getLibraryContainer( ContainerType _eType );
 
     /** calls the storeLibraries at both our script and basic library container
diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx
index c565c3d..daab66b 100644
--- a/sfx2/source/view/frmload.cxx
+++ b/sfx2/source/view/frmload.cxx
@@ -778,9 +778,7 @@ com_sun_star_comp_office_FrameLoader_get_implementation(
     css::uno::XComponentContext *context,
     css::uno::Sequence<css::uno::Any> const &)
 {
-    rtl::Reference<SfxFrameLoader_Impl> x(new SfxFrameLoader_Impl(context));
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new SfxFrameLoader_Impl(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/stoc/source/defaultregistry/defaultregistry.cxx b/stoc/source/defaultregistry/defaultregistry.cxx
index c1c07e1..a5446f2 100644
--- a/stoc/source/defaultregistry/defaultregistry.cxx
+++ b/stoc/source/defaultregistry/defaultregistry.cxx
@@ -1355,9 +1355,7 @@ com_sun_star_comp_stoc_NestedRegistry_get_implementation(
     SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
     css::uno::Sequence<css::uno::Any> const &)
 {
-    rtl::Reference<NestedRegistryImpl> x(new NestedRegistryImpl);
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new NestedRegistryImpl);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/stoc/source/implementationregistration/implreg.cxx b/stoc/source/implementationregistration/implreg.cxx
index e5daf98..e594dbd 100644
--- a/stoc/source/implementationregistration/implreg.cxx
+++ b/stoc/source/implementationregistration/implreg.cxx
@@ -1821,9 +1821,7 @@ com_sun_star_comp_stoc_ImplementationRegistration_get_implementation(
     css::uno::XComponentContext *context,
     css::uno::Sequence<css::uno::Any> const &)
 {
-    rtl::Reference<ImplementationRegistration> x(new ImplementationRegistration(context));
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new ImplementationRegistration(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/stoc/source/loader/dllcomponentloader.cxx b/stoc/source/loader/dllcomponentloader.cxx
index 14fc172..4b90cdc 100644
--- a/stoc/source/loader/dllcomponentloader.cxx
+++ b/stoc/source/loader/dllcomponentloader.cxx
@@ -170,9 +170,7 @@ com_sun_star_comp_stoc_DLLComponentLoader_get_implementation(
     css::uno::XComponentContext *context,
     css::uno::Sequence<css::uno::Any> const &)
 {
-    rtl::Reference<DllComponentLoader> x(new DllComponentLoader(context));
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new DllComponentLoader(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/stoc/source/security/access_controller.cxx b/stoc/source/security/access_controller.cxx
index 2e6c84b..90d46f7 100644
--- a/stoc/source/security/access_controller.cxx
+++ b/stoc/source/security/access_controller.cxx
@@ -984,9 +984,7 @@ com_sun_star_security_comp_stoc_AccessController_get_implementation(
     css::uno::XComponentContext *context,
     css::uno::Sequence<css::uno::Any> const &)
 {
-    rtl::Reference<AccessController> x(new AccessController(context));
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new AccessController(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/stoc/source/security/file_policy.cxx b/stoc/source/security/file_policy.cxx
index 4cd5e8c..6766aff 100644
--- a/stoc/source/security/file_policy.cxx
+++ b/stoc/source/security/file_policy.cxx
@@ -545,9 +545,7 @@ com_sun_star_security_comp_stoc_FilePolicy_get_implementation(
     css::uno::XComponentContext *context,
     css::uno::Sequence<css::uno::Any> const &)
 {
-    rtl::Reference<FilePolicy> x(new FilePolicy(context));
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new FilePolicy(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/stoc/source/servicemanager/servicemanager.cxx b/stoc/source/servicemanager/servicemanager.cxx
index 1dd406e..9d206c4 100644
--- a/stoc/source/servicemanager/servicemanager.cxx
+++ b/stoc/source/servicemanager/servicemanager.cxx
@@ -1676,9 +1676,7 @@ com_sun_star_comp_stoc_OServiceManager_get_implementation(
     css::uno::XComponentContext *context,
     css::uno::Sequence<css::uno::Any> const &)
 {
-    rtl::Reference<OServiceManager> x(new OServiceManager(context));
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new OServiceManager(context));
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
@@ -1686,9 +1684,7 @@ com_sun_star_comp_stoc_ORegistryServiceManager_get_implementation(
     css::uno::XComponentContext *context,
     css::uno::Sequence<css::uno::Any> const &)
 {
-    rtl::Reference<ORegistryServiceManager> x(new ORegistryServiceManager(context));
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new ORegistryServiceManager(context));
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
@@ -1696,9 +1692,7 @@ com_sun_star_comp_stoc_OServiceManagerWrapper_get_implementation(
     css::uno::XComponentContext *context,
     css::uno::Sequence<css::uno::Any> const &)
 {
-    rtl::Reference<OServiceManagerWrapper> x(new OServiceManagerWrapper(context));
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new OServiceManagerWrapper(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/stoc/source/simpleregistry/simpleregistry.cxx b/stoc/source/simpleregistry/simpleregistry.cxx
index 96230e1..bddc67b 100644
--- a/stoc/source/simpleregistry/simpleregistry.cxx
+++ b/stoc/source/simpleregistry/simpleregistry.cxx
@@ -1128,9 +1128,7 @@ com_sun_star_comp_stoc_SimpleRegistry_get_implementation(
     SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
     css::uno::Sequence<css::uno::Any> const &)
 {
-    rtl::Reference<SimpleRegistry> x(new SimpleRegistry);
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new SimpleRegistry);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/filter/SvFilterOptionsDialog.cxx b/svtools/source/filter/SvFilterOptionsDialog.cxx
index 3d02a9f..8311d83 100644
--- a/svtools/source/filter/SvFilterOptionsDialog.cxx
+++ b/svtools/source/filter/SvFilterOptionsDialog.cxx
@@ -304,9 +304,7 @@ com_sun_star_svtools_SvFilterOptionsDialog_get_implementation(
         css::uno::XComponentContext * context,
         css::uno::Sequence<css::uno::Any> const &)
 {
-    rtl::Reference<SvFilterOptionsDialog> x(new SvFilterOptionsDialog(context));
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new SvFilterOptionsDialog(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/graphic/graphicunofactory.cxx b/svtools/source/graphic/graphicunofactory.cxx
index 40c4567..5ba8db4 100644
--- a/svtools/source/graphic/graphicunofactory.cxx
+++ b/svtools/source/graphic/graphicunofactory.cxx
@@ -115,9 +115,7 @@ com_sun_star_graphic_GraphicObject_get_implementation(
         SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
         css::uno::Sequence<css::uno::Any> const &arguments)
 {
-    rtl::Reference<GObjectImpl> x(new GObjectImpl(arguments));
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new GObjectImpl(arguments));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/graphic/provider.cxx b/svtools/source/graphic/provider.cxx
index b2ea034..9f99ce4 100644
--- a/svtools/source/graphic/provider.cxx
+++ b/svtools/source/graphic/provider.cxx
@@ -861,9 +861,7 @@ com_sun_star_comp_graphic_GraphicProvider_get_implementation(
     css::uno::XComponentContext *,
     css::uno::Sequence<css::uno::Any> const &)
 {
-    rtl::Reference<GraphicProvider> x(new GraphicProvider);
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new GraphicProvider);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/graphic/renderer.cxx b/svtools/source/graphic/renderer.cxx
index 0621e57..40280d8 100644
--- a/svtools/source/graphic/renderer.cxx
+++ b/svtools/source/graphic/renderer.cxx
@@ -297,9 +297,7 @@ com_sun_star_comp_graphic_GraphicRendererVCL_get_implementation(
     css::uno::XComponentContext *,
     css::uno::Sequence<css::uno::Any> const &)
 {
-    rtl::Reference<GraphicRendererVCL> x(new GraphicRendererVCL);
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new GraphicRendererVCL);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/hatchwindow/documentcloser.cxx b/svtools/source/hatchwindow/documentcloser.cxx
index 94058f2..86a64ff 100644
--- a/svtools/source/hatchwindow/documentcloser.cxx
+++ b/svtools/source/hatchwindow/documentcloser.cxx
@@ -252,9 +252,7 @@ com_sun_star_comp_embed_DocumentCloser_get_implementation(
         SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
         css::uno::Sequence<css::uno::Any> const &arguments)
 {
-    rtl::Reference<ODocumentCloser> x(new ODocumentCloser(arguments));
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new ODocumentCloser(arguments));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/hatchwindow/hatchwindowfactory.cxx b/svtools/source/hatchwindow/hatchwindowfactory.cxx
index afa3f33..2a581d0 100644
--- a/svtools/source/hatchwindow/hatchwindowfactory.cxx
+++ b/svtools/source/hatchwindow/hatchwindowfactory.cxx
@@ -89,9 +89,7 @@ com_sun_star_comp_embed_HatchWindowFactory_get_implementation(
     css::uno::XComponentContext *,
     css::uno::Sequence<css::uno::Any> const &)
 {
-    rtl::Reference<OHatchWindowFactory> x(new OHatchWindowFactory);
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new OHatchWindowFactory);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/uno/addrtempuno.cxx b/svtools/source/uno/addrtempuno.cxx
index 73b2c18..c90b4c0 100644
--- a/svtools/source/uno/addrtempuno.cxx
+++ b/svtools/source/uno/addrtempuno.cxx
@@ -228,9 +228,7 @@ com_sun_star_comp_svtools_OAddressBookSourceDialogUno_get_implementation(
         css::uno::XComponentContext * context,
         css::uno::Sequence<css::uno::Any> const &)
 {
-    rtl::Reference<OAddressBookSourceDialogUno> x(new OAddressBookSourceDialogUno(context));
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new OAddressBookSourceDialogUno(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/uno/wizard/unowizard.cxx b/svtools/source/uno/wizard/unowizard.cxx
index 7fbd2d4..8703153 100644
--- a/svtools/source/uno/wizard/unowizard.cxx
+++ b/svtools/source/uno/wizard/unowizard.cxx
@@ -502,9 +502,7 @@ com_sun_star_comp_svtools_uno_Wizard_get_implementation(
         css::uno::XComponentContext *context,
         css::uno::Sequence<css::uno::Any> const &)
 {
-    rtl::Reference<Wizard> x(new Wizard(context));
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new Wizard(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
index 2c3cd3e..dfe1711 100644
--- a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
@@ -494,9 +494,7 @@ com_sun_star_drawing_EnhancedCustomShapeEngine_get_implementation(
     css::uno::XComponentContext *,
     css::uno::Sequence<css::uno::Any> const &)
 {
-    rtl::Reference<EnhancedCustomShapeEngine> x(new EnhancedCustomShapeEngine);
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new EnhancedCustomShapeEngine);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/sdr/primitive2d/primitivefactory2d.cxx b/svx/source/sdr/primitive2d/primitivefactory2d.cxx
index ded21f9..eb5ad2d 100644
--- a/svx/source/sdr/primitive2d/primitivefactory2d.cxx
+++ b/svx/source/sdr/primitive2d/primitivefactory2d.cxx
@@ -93,9 +93,7 @@ com_sun_star_comp_graphic_PrimitiveFactory2D_get_implementation(
     css::uno::XComponentContext *,
     css::uno::Sequence<css::uno::Any> const &)
 {
-    rtl::Reference<PrimitiveFactory2D> x(new PrimitiveFactory2D);
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new PrimitiveFactory2D);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/sidebar/PanelFactory.cxx b/svx/source/sidebar/PanelFactory.cxx
index 26352c0..fb5be30 100644
--- a/svx/source/sidebar/PanelFactory.cxx
+++ b/svx/source/sidebar/PanelFactory.cxx
@@ -209,7 +209,5 @@ org_apache_openoffice_comp_svx_sidebar_PanelFactory_get_implementation(
     css::uno::XComponentContext *,
     css::uno::Sequence<css::uno::Any> const &)
 {
-    rtl::Reference<PanelFactory> x(new PanelFactory);
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new PanelFactory);
 }
diff --git a/svx/source/tbxctrls/tbunocontroller.cxx b/svx/source/tbxctrls/tbunocontroller.cxx
index d93065e..9ab903cf 100644
--- a/svx/source/tbxctrls/tbunocontroller.cxx
+++ b/svx/source/tbxctrls/tbunocontroller.cxx
@@ -444,9 +444,7 @@ com_sun_star_svx_FontHeightToolBoxController_get_implementation(
     css::uno::XComponentContext *rxContext,
     css::uno::Sequence<css::uno::Any> const &)
 {
-    rtl::Reference<FontHeightToolBoxControl> x(new FontHeightToolBoxControl(rxContext));
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new FontHeightToolBoxControl(rxContext));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
index 05c6bfe..1207691 100644
--- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx
+++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
@@ -1055,9 +1055,7 @@ com_sun_star_svx_FindTextToolboxController_get_implementation(
     css::uno::XComponentContext *context,
     css::uno::Sequence<css::uno::Any> const &)
 {
-    rtl::Reference<FindTextToolbarController> x(new FindTextToolbarController(context));
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new FindTextToolbarController(context));
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
@@ -1065,9 +1063,7 @@ com_sun_star_svx_ExitFindbarToolboxController_get_implementation(
     css::uno::XComponentContext *context,
     css::uno::Sequence<css::uno::Any> const &)
 {
-    rtl::Reference<ExitSearchToolboxController> x(new ExitSearchToolboxController(context));
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new ExitSearchToolboxController(context));
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
@@ -1075,10 +1071,7 @@ com_sun_star_svx_UpSearchToolboxController_get_implementation(
     css::uno::XComponentContext *context,
     css::uno::Sequence<css::uno::Any> const &)
 {
-    rtl::Reference<UpDownSearchToolboxController> x(new UpDownSearchToolboxController(
-                context, UpDownSearchToolboxController::UP));
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new UpDownSearchToolboxController(context, UpDownSearchToolboxController::UP));
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
@@ -1086,10 +1079,7 @@ com_sun_star_svx_DownSearchToolboxController_get_implementation(
     css::uno::XComponentContext *context,
     css::uno::Sequence<css::uno::Any> const &)
 {
-    rtl::Reference<UpDownSearchToolboxController> x(new UpDownSearchToolboxController(
-                context, UpDownSearchToolboxController::DOWN));
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new UpDownSearchToolboxController(context, UpDownSearchToolboxController::DOWN));
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
@@ -1097,9 +1087,7 @@ com_sun_star_svx_MatchCaseToolboxController_get_implementation(
     css::uno::XComponentContext *context,
     css::uno::Sequence<css::uno::Any> const &)
 {
-    rtl::Reference<MatchCaseToolboxController> x(new MatchCaseToolboxController(context));
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new MatchCaseToolboxController(context));
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
@@ -1107,9 +1095,7 @@ com_sun_star_svx_FindAllToolboxController_get_implementation(
     css::uno::XComponentContext *context,
     css::uno::Sequence<css::uno::Any> const &)
 {
-    rtl::Reference<FindAllToolboxController> x(new FindAllToolboxController(context));
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new FindAllToolboxController(context));
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
@@ -1117,9 +1103,7 @@ com_sun_star_comp_svx_Impl_FindbarDispatcher_get_implementation(
     SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
     css::uno::Sequence<css::uno::Any> const &)
 {
-    rtl::Reference<FindbarDispatcher> x(new FindbarDispatcher);
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new FindbarDispatcher);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx
index 7a611be..ace45e8 100644
--- a/svx/source/unodraw/UnoGraphicExporter.cxx
+++ b/svx/source/unodraw/UnoGraphicExporter.cxx
@@ -1285,9 +1285,7 @@ com_sun_star_comp_Draw_GraphicExporter_get_implementation(
     css::uno::XComponentContext *,
     css::uno::Sequence<css::uno::Any> const &)
 {
-    rtl::Reference<GraphicExporter> x(new GraphicExporter);
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new GraphicExporter);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/unodraw/recoveryui.cxx b/svx/source/unodraw/recoveryui.cxx
index 5fdb5f2..ea34f6c 100644
--- a/svx/source/unodraw/recoveryui.cxx
+++ b/svx/source/unodraw/recoveryui.cxx
@@ -425,9 +425,7 @@ com_sun_star_comp_svx_RecoveryUI_get_implementation(
     css::uno::XComponentContext *context,
     css::uno::Sequence<css::uno::Any> const &)
 {
-    rtl::Reference<RecoveryUI> x(new RecoveryUI(context));
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new RecoveryUI(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/unodraw/unoctabl.cxx b/svx/source/unodraw/unoctabl.cxx
index b707904..ec8fcc8 100644
--- a/svx/source/unodraw/unoctabl.cxx
+++ b/svx/source/unodraw/unoctabl.cxx
@@ -190,9 +190,7 @@ com_sun_star_drawing_SvxUnoColorTable_get_implementation(
     css::uno::XComponentContext *,
     css::uno::Sequence<css::uno::Any> const &)
 {
-    rtl::Reference<SvxUnoColorTable> x(new SvxUnoColorTable);
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new SvxUnoColorTable);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/unodraw/unoshcol.cxx b/svx/source/unodraw/unoshcol.cxx
index 8b873ac..a3d187a 100644
--- a/svx/source/unodraw/unoshcol.cxx
+++ b/svx/source/unodraw/unoshcol.cxx
@@ -274,9 +274,7 @@ com_sun_star_drawing_SvxShapeCollection_get_implementation(
     css::uno::XComponentContext *,
     css::uno::Sequence<css::uno::Any> const &)
 {
-    rtl::Reference<SvxShapeCollection> x(new SvxShapeCollection);
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new SvxShapeCollection);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/unogallery/unogalthemeprovider.cxx b/svx/source/unogallery/unogalthemeprovider.cxx
index 2fcaec8..ece7420 100644
--- a/svx/source/unogallery/unogalthemeprovider.cxx
+++ b/svx/source/unogallery/unogalthemeprovider.cxx
@@ -236,9 +236,7 @@ com_sun_star_comp_gallery_GalleryThemeProvider_get_implementation(
     css::uno::XComponentContext *,
     css::uno::Sequence<css::uno::Any> const &)
 {
-    rtl::Reference<GalleryThemeProvider> x(new GalleryThemeProvider);
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new GalleryThemeProvider);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx
index f9bad05..c285806 100644
--- a/svx/source/xml/xmlgrhlp.cxx
+++ b/svx/source/xml/xmlgrhlp.cxx
@@ -1055,10 +1055,7 @@ com_sun_star_comp_Svx_GraphicImportHelper_get_implementation(
     css::uno::XComponentContext *,
     css::uno::Sequence<css::uno::Any> const &)
 {
-    rtl::Reference<SvXMLGraphicImportExportHelper> x(
-        new SvXMLGraphicImportExportHelper(GRAPHICHELPER_MODE_READ));
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new SvXMLGraphicImportExportHelper(GRAPHICHELPER_MODE_READ));
 }
 
 /** Create this with createInstanceWithArguments. service name
@@ -1078,10 +1075,7 @@ com_sun_star_comp_Svx_GraphicExportHelper_get_implementation(
     css::uno::XComponentContext *,
     css::uno::Sequence<css::uno::Any> const &)
 {
-    rtl::Reference<SvXMLGraphicImportExportHelper> x(
-        new SvXMLGraphicImportExportHelper(GRAPHICHELPER_MODE_WRITE));
-    x->acquire();
-    return static_cast<cppu::OWeakObject *>(x.get());
+    return static_cast<cppu::OWeakObject *>(new SvXMLGraphicImportExportHelper(GRAPHICHELPER_MODE_WRITE));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit ef602ba8ce58211c9588d8df72cbde7d48542a1a
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Jan 20 17:39:11 2014 +0100

    Remove unused XInitialization.args data
    
    ...now that ModuleUIConfigurationManager no longer implements XInitialization
    since 72b5343bd16deec540d8cd148cd7aebd74e92c16 "fwk: Use constructor feature for
    ModuleUIConfigurationManager."
    
    Change-Id: I479c6c93e9982d80318e53b794bac99e949a5e46

diff --git a/qadevOOo/tests/java/mod/_fwk/ModuleUIConfigurationManager.java b/qadevOOo/tests/java/mod/_fwk/ModuleUIConfigurationManager.java
index eedef1c..21945a1 100644
--- a/qadevOOo/tests/java/mod/_fwk/ModuleUIConfigurationManager.java
+++ b/qadevOOo/tests/java/mod/_fwk/ModuleUIConfigurationManager.java
@@ -22,11 +22,7 @@ import com.sun.star.beans.PropertyValue;
 import com.sun.star.container.XIndexAccess;
 import com.sun.star.container.XIndexContainer;
 import com.sun.star.container.XNameAccess;
-import com.sun.star.embed.ElementModes;
-import com.sun.star.embed.XStorage;
-import com.sun.star.embed.XTransactedObject;
 import com.sun.star.lang.XMultiServiceFactory;
-import com.sun.star.lang.XSingleServiceFactory;
 import com.sun.star.uno.UnoRuntime;
 import com.sun.star.uno.XInterface;
 import com.sun.star.ui.XModuleUIConfigurationManagerSupplier;
@@ -51,7 +47,6 @@ public class ModuleUIConfigurationManager extends TestCase {
     XInterface oObj = null;
     XMultiServiceFactory xMSF = null;
     XTextDocument xTextDoc = null;
-    XStorage xStore = null;
 
     /**
      * Cleanup: close the created document
@@ -72,9 +67,6 @@ public class ModuleUIConfigurationManager extends TestCase {
             }
         }
         log.println("   disposing storage");
-        if (xStore != null) {
-            xStore.dispose();
-        }
     }
 
     /**
@@ -101,38 +93,6 @@ public class ModuleUIConfigurationManager extends TestCase {
             XNameAccess xMM = UnoRuntime.queryInterface(XNameAccess.class, xMSF.createInstance("com.sun.star.comp.framework.ModuleManager"));
             xMM.getElementNames();
 
-            o = xMSF.createInstance("com.sun.star.embed.StorageFactory");
-            XSingleServiceFactory xStorageService = UnoRuntime.queryInterface(XSingleServiceFactory.class, o);
-            Object[]props = new Object[2];
-
-            String aFile = util.utils.getOfficeTempDir(xMSF) + "dummyFile.dat";
-            log.println("storage file : '"+ aFile + "'");
-
-            props[0] = aFile;
-            props[1] = new Integer(ElementModes.READWRITE);
-            xStore = UnoRuntime.queryInterface(XStorage.class, xStorageService.createInstanceWithArguments(props));
-
-            PropertyValue[] initProps = new PropertyValue[4];
-            PropertyValue propVal = new PropertyValue();
-            propVal.Name = "DefaultConfigStorage";
-            propVal.Value = xStore;
-            initProps[0] = propVal;
-            propVal = new PropertyValue();
-            propVal.Name = "UserConfigStorage";
-            propVal.Value = xStore;

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list