This is an automated email from the ASF dual-hosted git repository.

asf-gitbox-commits pushed a commit to branch compilers-101
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit 7808d7b85cd26f23fd06a3967f62aa1f0c6759e2
Author: Pedro F. Giffuni <[email protected]>
AuthorDate: Thu Nov 5 22:30:13 2026 -0500

    Boost modernization Phase 2: scoped_array to std::unique_ptr<T[]>
    
    - Replace boost::scoped_array<T> / scoped_array<T> with std::unique_ptr<T[]>
      (C++11 array specialization, uses delete[])
    - Replace #include <boost/scoped_array.hpp> with #include <memory>
    - 34 files across extensions, cppcanvas, cppuhelper, desktop, jvmfwk, sc, 
sd,
      sdext, sfx2, slideshow, stoc, svx, sw, unoxml, vcl, xmloff, xmlsecurity
    
    boost::scoped_ptr, boost::array, boost::tuple were migrated in Phase 1.
    boost::function, boost::bind, boost::noncopyable, Boost.Optional,
    Boost.Variant, Boost.Spirit not migrated.
---
 .../source/directx/dx_textlayout_drawhelper.cxx    |  4 +-
 main/canvas/source/directx/dx_vcltools.cxx         | 11 ++---
 main/cppcanvas/source/mtfrenderer/textaction.cxx   |  4 +-
 main/sd/source/ui/app/sdmod1.cxx                   | 12 +++---
 main/sdext/source/pdfimport/wrapper/wrapper.cxx    |  4 +-
 main/sfx2/source/sidebar/SidebarController.cxx     |  2 +-
 main/svx/source/sidebar/line/LinePropertyPanel.hxx | 50 +++++++++++-----------
 main/vcl/source/gdi/image.cxx                      |  4 +-
 main/xmloff/source/text/txtimp.cxx                 | 13 +++---
 9 files changed, 53 insertions(+), 51 deletions(-)

diff --git a/main/canvas/source/directx/dx_textlayout_drawhelper.cxx 
b/main/canvas/source/directx/dx_textlayout_drawhelper.cxx
index 1b5ab8f8f4..fbb8996329 100644
--- a/main/canvas/source/directx/dx_textlayout_drawhelper.cxx
+++ b/main/canvas/source/directx/dx_textlayout_drawhelper.cxx
@@ -32,7 +32,7 @@
 #include <vcl/canvastools.hxx>
 #include <tools/diagnose_ex.h>
 
-#include <boost/scoped_array.hpp>
+#include <memory>
 #include <boost/bind.hpp>
 #include <com/sun/star/rendering/FontRequest.hpp>
 #include <com/sun/star/rendering/PanoseProportion.hpp>
@@ -248,7 +248,7 @@ namespace dxcanvas
             {
                 // create the DXArray
                 const sal_Int32 nLen( rLogicalAdvancements.getLength() );
-                ::boost::scoped_array<sal_Int32> pDXArray( new sal_Int32[nLen] 
);
+                ::std::unique_ptr<sal_Int32[]> pDXArray( new sal_Int32[nLen] );
                 for( sal_Int32 i=0; i<nLen; ++i )
                     pDXArray[i] = basegfx::fround( rLogicalAdvancements[i] );
 
diff --git a/main/canvas/source/directx/dx_vcltools.cxx 
b/main/canvas/source/directx/dx_vcltools.cxx
index ddf1fe3d80..cc004d37f0 100644
--- a/main/canvas/source/directx/dx_vcltools.cxx
+++ b/main/canvas/source/directx/dx_vcltools.cxx
@@ -40,7 +40,8 @@
 #include <com/sun/star/lang/XServiceInfo.hpp>
 #include <com/sun/star/rendering/XIntegerBitmap.hpp>
 
-#include <boost/scoped_array.hpp>
+#include <memory>
+#include <memory>
 
 #include "dx_vcltools.hxx"
 
@@ -77,7 +78,7 @@ namespace dxcanvas
             }
 
             /// Draw DI bits to given Graphics
-            bool drawDIBits( const ::boost::shared_ptr< Gdiplus::Graphics >& 
rGraphics,
+            bool drawDIBits( const ::std::shared_ptr< Gdiplus::Graphics >& 
rGraphics,
                              const void*                                       
                                 hDIB )
             {
                 bool                   bRet( false );
@@ -107,7 +108,7 @@ namespace dxcanvas
                 Reference to bitmap. Might get modified, in such a way
                 that it will hold a DIB after a successful function call.
              */
-            bool drawVCLBitmap( const ::boost::shared_ptr< Gdiplus::Graphics 
>&        rGraphics,
+            bool drawVCLBitmap( const ::std::shared_ptr< Gdiplus::Graphics >&  
rGraphics,
                                 ::Bitmap&                                      
                                        rBmp )
             {
                 BitmapSystemData aBmpSysData;
@@ -483,7 +484,7 @@ namespace dxcanvas
                 return aBmpData;
             }
 
-            bool drawVCLBitmapEx( const ::boost::shared_ptr< Gdiplus::Graphics 
>& rGraphics,
+            bool drawVCLBitmapEx( const ::std::shared_ptr< Gdiplus::Graphics 
>& rGraphics,
                                   const ::BitmapEx&                            
                          rBmpEx )
             {
                 if( !rBmpEx.IsTransparent() )
@@ -499,7 +500,7 @@ namespace dxcanvas
             }
         }
 
-        bool drawVCLBitmapFromXBitmap( const ::boost::shared_ptr< 
Gdiplus::Graphics >& rGraphics,
+        bool drawVCLBitmapFromXBitmap( const ::std::shared_ptr< 
Gdiplus::Graphics >& rGraphics,
                                        const uno::Reference< 
rendering::XBitmap >&        xBitmap )
         {
             // TODO(F2): add support for floating point bitmap formats
diff --git a/main/cppcanvas/source/mtfrenderer/textaction.cxx 
b/main/cppcanvas/source/mtfrenderer/textaction.cxx
index 323deca099..42478f2a34 100644
--- a/main/cppcanvas/source/mtfrenderer/textaction.cxx
+++ b/main/cppcanvas/source/mtfrenderer/textaction.cxx
@@ -50,7 +50,7 @@
 #include <basegfx/tools/canvastools.hxx>
 #include <canvas/canvastools.hxx>
 
-#include <boost/scoped_array.hpp>
+#include <memory>
 #include <boost/bind.hpp>
 #include <boost/utility.hpp>
 
@@ -205,7 +205,7 @@ namespace cppcanvas
             {
                 // no external DX array given, create one from given
                 // string
-                ::boost::scoped_array< sal_Int32 > pCharWidths( new 
sal_Int32[nLen] );
+                ::std::unique_ptr< sal_Int32 []> pCharWidths( new 
sal_Int32[nLen] );
 
                 rVDev.GetTextArray( rText, pCharWidths.get(),
                                     static_cast<sal_uInt16>(nStartPos),
diff --git a/main/sd/source/ui/app/sdmod1.cxx b/main/sd/source/ui/app/sdmod1.cxx
index 309cb212a8..33748ec9a9 100644
--- a/main/sd/source/ui/app/sdmod1.cxx
+++ b/main/sd/source/ui/app/sdmod1.cxx
@@ -70,8 +70,8 @@
 #include "FactoryIds.hxx"
 #include "sdabstdlg.hxx"
 #include <memory>
-#include <boost/shared_ptr.hpp>
-#include <boost/scoped_array.hpp>
+#include <memory>
+#include <memory>
 #include "slideshow.hxx"
 
 #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
@@ -96,7 +96,7 @@ public:
 private:
        ::sd::ViewShellBase& mrBase;
        SdDrawDocument& mrDocument;
-       ::boost::shared_ptr<SvMemoryStream> mpStream;
+       ::std::shared_ptr<SvMemoryStream> mpStream;
 };
 
 
@@ -315,7 +315,7 @@ void SdModule::OutlineToImpress (SfxRequest& rRequest)
                                                = dynamic_cast< 
::sd::ViewShellBase*>(pViewFrame->GetViewShell());
                                        if (pBase != NULL)
                                        {
-                                               
::boost::shared_ptr<FrameworkHelper> pHelper (
+                                               
::std::shared_ptr<FrameworkHelper> pHelper (
                                                        
FrameworkHelper::Instance(*pBase));
                                                pHelper->RequestView(
                                                        
FrameworkHelper::msOutlineViewURL,
@@ -691,7 +691,7 @@ SfxFrame* SdModule::ExecuteNewDocument( SfxRequest& rReq )
                                                                  
::sd::ViewShellBase::GetViewShellBase (
                                                                          
pViewFrame);
                                                        OSL_ASSERT 
(pBase!=NULL);
-                                                       
::boost::shared_ptr<sd::ViewShell> pViewSh = pBase->GetMainViewShell();
+                                                       
::std::shared_ptr<sd::ViewShell> pViewSh = pBase->GetMainViewShell();
                                                        SdOptions* pOptions = 
GetSdOptions(pDoc->GetDocumentType());
 
                                                        if (pOptions && 
pViewSh.get())
@@ -954,7 +954,7 @@ OutlineToImpressFinalizer::OutlineToImpressFinalizer (
                // the original stream.
                mpStream.reset(new SvMemoryStream());
                static const sal_Size nBufferSize = 4096;
-               ::boost::scoped_array<sal_Int8> pBuffer (new 
sal_Int8[nBufferSize]);
+               ::std::unique_ptr<sal_Int8[]> pBuffer (new 
sal_Int8[nBufferSize]);
 
                sal_Size nReadPosition (0);
                bool bLoop (true);
diff --git a/main/sdext/source/pdfimport/wrapper/wrapper.cxx 
b/main/sdext/source/pdfimport/wrapper/wrapper.cxx
index 9f2909a96f..b20c10c801 100644
--- a/main/sdext/source/pdfimport/wrapper/wrapper.cxx
+++ b/main/sdext/source/pdfimport/wrapper/wrapper.cxx
@@ -62,7 +62,7 @@
 #include <boost/bind.hpp>
 #include <boost/preprocessor/stringize.hpp>
 #include <memory>
-#include <boost/scoped_array.hpp>
+#include <memory>
 
 #include <unordered_map>
 #include <string.h>
@@ -919,7 +919,7 @@ static bool checkEncryption( const rtl::OUString&
     aPDFFile = rtl::OUStringToOString( i_rPath, osl_getThreadTextEncoding() );
 
     pdfparse::PDFReader aParser;
-    std::unique_ptr<pdfparse::PDFEntry> pEntry( aParser.read( 
aPDFFile.getStr() ));
+    std::unique_ptr<pdfparse::PDFEntry[]> pEntry( aParser.read( 
aPDFFile.getStr() ));
     if( pEntry )
     {
         pdfparse::PDFFile* pPDFFile = 
dynamic_cast<pdfparse::PDFFile*>(pEntry.get());
diff --git a/main/sfx2/source/sidebar/SidebarController.cxx 
b/main/sfx2/source/sidebar/SidebarController.cxx
index 524e74c11e..05321b21ca 100644
--- a/main/sfx2/source/sidebar/SidebarController.cxx
+++ b/main/sfx2/source/sidebar/SidebarController.cxx
@@ -64,7 +64,7 @@
 
 #include <boost/bind.hpp>
 #include <boost/function.hpp>
-#include <boost/scoped_array.hpp>
+#include <memory>
 #include <memory>
 #include <functional>
 
diff --git a/main/svx/source/sidebar/line/LinePropertyPanel.hxx 
b/main/svx/source/sidebar/line/LinePropertyPanel.hxx
index 7191be9712..d3aa8b94e9 100644
--- a/main/svx/source/sidebar/line/LinePropertyPanel.hxx
+++ b/main/svx/source/sidebar/line/LinePropertyPanel.hxx
@@ -30,7 +30,7 @@
 #include <vcl/fixed.hxx>
 #include <vcl/field.hxx>
 #include <memory>
-#include <boost/scoped_array.hpp>
+#include <memory>
 #include <svx/sidebar/ColorPopup.hxx>
 #include <memory>
 #include "LineWidthPopup.hxx"
@@ -98,23 +98,23 @@ public:
 
 private:
     //ui controls
-    ::std::unique_ptr< FixedText >                        mpFTWidth;
-    ::std::unique_ptr< Window >                           mpTBWidthBackground;
-    ::std::unique_ptr< ToolBox >                          mpTBWidth;
-    ::std::unique_ptr< FixedText >                        mpFTColor;
-    ::std::unique_ptr< Window >                           mpTBColorBackground;
-    ::std::unique_ptr< ToolBox >                          mpTBColor;
-    ::std::unique_ptr< FixedText >                        mpFTStyle;
-    ::std::unique_ptr< ListBox >                          mpLBStyle;
-    ::std::unique_ptr< FixedText >                        mpFTTrancparency;
-    ::std::unique_ptr< MetricField >                      mpMFTransparent;
-    ::std::unique_ptr< FixedText >                        mpFTArrow;
-    ::std::unique_ptr< ListBox >                          mpLBStart;
-    ::std::unique_ptr< ListBox >                          mpLBEnd;
-    ::std::unique_ptr< FixedText >                        mpFTEdgeStyle;
-    ::std::unique_ptr< ListBox >                          mpLBEdgeStyle;
-    ::std::unique_ptr< FixedText >                        mpFTCapStyle;
-    ::std::unique_ptr< ListBox >                          mpLBCapStyle;
+    ::std::unique_ptr< FixedText []>                        mpFTWidth;
+    ::std::unique_ptr< Window []>                           
mpTBWidthBackground;
+    ::std::unique_ptr< ToolBox []>                          mpTBWidth;
+    ::std::unique_ptr< FixedText []>                        mpFTColor;
+    ::std::unique_ptr< Window []>                           
mpTBColorBackground;
+    ::std::unique_ptr< ToolBox []>                          mpTBColor;
+    ::std::unique_ptr< FixedText []>                        mpFTStyle;
+    ::std::unique_ptr< ListBox []>                          mpLBStyle;
+    ::std::unique_ptr< FixedText []>                        mpFTTrancparency;
+    ::std::unique_ptr< MetricField []>                      mpMFTransparent;
+    ::std::unique_ptr< FixedText []>                        mpFTArrow;
+    ::std::unique_ptr< ListBox []>                          mpLBStart;
+    ::std::unique_ptr< ListBox []>                          mpLBEnd;
+    ::std::unique_ptr< FixedText []>                        mpFTEdgeStyle;
+    ::std::unique_ptr< ListBox []>                          mpLBEdgeStyle;
+    ::std::unique_ptr< FixedText []>                        mpFTCapStyle;
+    ::std::unique_ptr< ListBox []>                          mpLBCapStyle;
 
     //ControllerItem
     ::sfx2::sidebar::ControllerItem                         maStyleControl;
@@ -130,16 +130,16 @@ private:
     ::sfx2::sidebar::ControllerItem                         maCapStyle;
 
     Color                                                   maColor;
-    ::std::unique_ptr< ::svx::ToolboxButtonColorUpdater > mpColorUpdater;
-    ::std::unique_ptr< XLineStyleItem >                   mpStyleItem;
-    ::std::unique_ptr< XLineDashItem >                    mpDashItem;
+    ::std::unique_ptr< ::svx::ToolboxButtonColorUpdater []> mpColorUpdater;
+    ::std::unique_ptr< XLineStyleItem []>                   mpStyleItem;
+    ::std::unique_ptr< XLineDashItem []>                    mpDashItem;
     sal_uInt16                                              mnTrans;
     SfxMapUnit                                              meMapUnit;
     sal_Int32                                               mnWidthCoreValue;
     XLineEndListSharedPtr                                   maLineEndList;
     XDashListSharedPtr                                      maLineStyleList;
-    ::std::unique_ptr< XLineStartItem >                   mpStartItem;
-    ::std::unique_ptr< XLineEndItem >                     mpEndItem;
+    ::std::unique_ptr< XLineStartItem []>                   mpStartItem;
+    ::std::unique_ptr< XLineEndItem []>                     mpEndItem;
 
     //popup windows
     ColorPopup maColorPopup;
@@ -150,8 +150,8 @@ private:
     Image                                                   maIMGNone;
 
     // multi-images
-    ::boost::scoped_array<Image>                            mpIMGWidthIcon;
-    ::boost::scoped_array<Image>                            mpIMGWidthIconH;   
//high contrast
+    ::std::unique_ptr<Image[]>                            mpIMGWidthIcon;
+    ::std::unique_ptr<Image[]>                            mpIMGWidthIconH;     
//high contrast
 
     cssu::Reference< css::frame::XFrame >                   mxFrame;
     SfxBindings*                                            mpBindings;
diff --git a/main/vcl/source/gdi/image.cxx b/main/vcl/source/gdi/image.cxx
index 5992c1130f..1d00224427 100644
--- a/main/vcl/source/gdi/image.cxx
+++ b/main/vcl/source/gdi/image.cxx
@@ -23,7 +23,7 @@
 #include "precompiled_vcl.hxx"
 
 #include <memory>
-#include <boost/scoped_array.hpp>
+#include <memory>
 
 #include <rtl/logfile.hxx>
 
@@ -440,7 +440,7 @@ ImageList::ImageList( const ResId& rResId ) :
 
                sal_uLong                                                       
        nObjMask = pResMgr->ReadLong();
                const String                                            
aPrefix( pResMgr->ReadString() );
-               ::std::unique_ptr< Color >              spMaskColor;
+               ::std::unique_ptr< Color []>            spMaskColor;
 
                if( nObjMask & RSC_IMAGE_MASKCOLOR )
                        spMaskColor.reset( new Color( ResId( 
(RSHEADER_TYPE*)pResMgr->GetClass(), *pResMgr ) ) );
diff --git a/main/xmloff/source/text/txtimp.cxx 
b/main/xmloff/source/text/txtimp.cxx
index 785c83d40d..f1518b4e2a 100644
--- a/main/xmloff/source/text/txtimp.cxx
+++ b/main/xmloff/source/text/txtimp.cxx
@@ -26,7 +26,7 @@
 
 #include <vector>
 
-#include <boost/scoped_array.hpp>
+#include <memory>
 #include <tuple>
 
 #include <tools/solar.h>
@@ -92,6 +92,7 @@
 #include <txtlists.hxx>
 #include <xmloff/odffields.hxx>
 #include <comphelper/stlunosequence.hxx>
+#include <memory>
 
 using ::rtl::OUString;
 using ::rtl::OUStringBuffer;
@@ -557,14 +558,14 @@ struct SAL_DLLPRIVATE XMLTextImportHelper::Impl
     //   will be assigned to the outline style
     // - data structure contains more than one candidate for each list level
     //   of the outline style
-    ::boost::scoped_array< ::std::vector< ::rtl::OUString > >
+    ::std::unique_ptr< ::std::vector< ::rtl::OUString []> >
         m_pOutlineStylesCandidates;
     // <--
 
     // start range, xml:id, RDFa stuff
     typedef ::std::tuple<
         uno::Reference<text::XTextRange>, ::rtl::OUString,
-        ::boost::shared_ptr< ::xmloff::ParsedRDFaAttributes > >
+        ::std::shared_ptr< ::xmloff::ParsedRDFaAttributes > >
             BookmarkMapEntry_t;
     /// start ranges for open bookmarks
     ::std::map< ::rtl::OUString, BookmarkMapEntry_t,
@@ -636,7 +637,7 @@ struct SAL_DLLPRIVATE XMLTextImportHelper::Impl
         // <--
         ,   m_pRenameMap()
         // --> OD 2006-10-12 #i69629#
-        ,   m_pOutlineStylesCandidates( 0 )
+        ,   m_pOutlineStylesCandidates( nullptr )
         // <--
         ,   m_xServiceFactory( rModel, UNO_QUERY )
         ,   m_rSvXMLImport( rImport )
@@ -2721,7 +2722,7 @@ void XMLTextImportHelper::InsertBookmarkStartRange(
        const OUString sName,
        const Reference<XTextRange> & rRange,
     OUString const& i_rXmlId,
-    ::boost::shared_ptr< ::xmloff::ParsedRDFaAttributes > & i_rpRDFaAttributes)
+    ::std::shared_ptr< ::xmloff::ParsedRDFaAttributes > & i_rpRDFaAttributes)
 {
     m_pImpl->m_BookmarkStartRanges[sName] =
         ::std::make_tuple(rRange, i_rXmlId, i_rpRDFaAttributes);
@@ -2732,7 +2733,7 @@ sal_Bool 
XMLTextImportHelper::FindAndRemoveBookmarkStartRange(
        const OUString sName,
        Reference<XTextRange> & o_rRange,
     OUString & o_rXmlId,
-    ::boost::shared_ptr< ::xmloff::ParsedRDFaAttributes > & o_rpRDFaAttributes)
+    ::std::shared_ptr< ::xmloff::ParsedRDFaAttributes > & o_rpRDFaAttributes)
 {
     if (m_pImpl->m_BookmarkStartRanges.count(sName))
     {

Reply via email to