[Libreoffice-commits] core.git: include/svtools svtools/source

2018-01-05 Thread Takeshi Abe
 include/svtools/headbar.hxx|6 -
 svtools/source/control/headbar.cxx |  121 +++--
 2 files changed, 52 insertions(+), 75 deletions(-)

New commits:
commit d25465aed6cc15cf51529d92bdf3475d2b6d551f
Author: Takeshi Abe 
Date:   Fri Jan 5 19:46:22 2018 +0900

svtools: Simplify HeaderBar with std::unique_ptr

Change-Id: I5376616ed1b1a1087dd8bac6830d31212252e4bd
Reviewed-on: https://gerrit.libreoffice.org/47459
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/svtools/headbar.hxx b/include/svtools/headbar.hxx
index 077718815656..a575bd7c3fb5 100644
--- a/include/svtools/headbar.hxx
+++ b/include/svtools/headbar.hxx
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 
 /*
 
@@ -173,8 +174,6 @@ HeaderBarItemBits::CLICKABLE, but 
HeaderBarItemBits::FIXEDPOS.
 class Accelerator;
 class ImplHeadItem;
 
-typedef ::std::vector< ImplHeadItem* > ImplHeadItemList;
-
 #define WB_BOTTOMBORDER ((WinBits)0x0400)
 #define WB_BUTTONSTYLE  ((WinBits)0x0800)
 #define WB_STDHEADERBAR (WB_BUTTONSTYLE | WB_BOTTOMBORDER)
@@ -216,7 +215,7 @@ class VCLXHeaderBar;
 class SVT_DLLPUBLIC HeaderBar : public vcl::Window
 {
 private:
-ImplHeadItemList*   mpItemList;
+std::vector mvItemList;
 longmnBorderOff1;
 longmnBorderOff2;
 longmnOffset;
@@ -266,7 +265,6 @@ private:
 public:
 HeaderBar( vcl::Window* pParent, WinBits nWinBits );
 virtual ~HeaderBar() override;
-virtual void dispose() override;
 
 virtual voidMouseButtonDown( const MouseEvent& rMEvt ) override;
 virtual voidMouseMove( const MouseEvent& rMEvt ) override;
diff --git a/svtools/source/control/headbar.cxx 
b/svtools/source/control/headbar.cxx
index bd66dbc52c02..42c0f9cd092c 100644
--- a/svtools/source/control/headbar.cxx
+++ b/svtools/source/control/headbar.cxx
@@ -56,7 +56,6 @@ public:
 
 void HeaderBar::ImplInit( WinBits nWinStyle )
 {
-mpItemList  = new ImplHeadItemList;
 mnBorderOff1= 0;
 mnBorderOff2= 0;
 mnOffset= 0;
@@ -103,22 +102,7 @@ HeaderBar::HeaderBar( vcl::Window* pParent, WinBits 
nWinStyle ) :
 SetSizePixel( CalcWindowSizePixel() );
 }
 
-HeaderBar::~HeaderBar()
-{
-disposeOnce();
-}
-
-void HeaderBar::dispose()
-{
-if (mpItemList)
-{
-for (ImplHeadItem* i : *mpItemList)
-delete i;
-delete mpItemList;
-mpItemList = nullptr;
-}
-Window::dispose();
-}
+HeaderBar::~HeaderBar() = default;
 
 void HeaderBar::ApplySettings(vcl::RenderContext& rRenderContext)
 {
@@ -153,14 +137,14 @@ long HeaderBar::ImplGetItemPos( sal_uInt16 nPos ) const
 {
 long nX = -mnOffset;
 for ( size_t i = 0; i < nPos; i++ )
-nX += (*mpItemList)[ i ]->mnSize;
+nX += mvItemList[ i ]->mnSize;
 return nX;
 }
 
 tools::Rectangle HeaderBar::ImplGetItemRect( sal_uInt16 nPos ) const
 {
 tools::Rectangle aRect( ImplGetItemPos( nPos ), 0, 0, mnDY-1 );
-aRect.Right() = aRect.Left() + (*mpItemList)[ nPos ]->mnSize - 1;
+aRect.Right() = aRect.Left() + mvItemList[ nPos ]->mnSize - 1;
 // check for overflow on various systems
 if ( aRect.Right() > 16000 )
 aRect.Right() = 16000;
@@ -170,14 +154,13 @@ tools::Rectangle HeaderBar::ImplGetItemRect( sal_uInt16 
nPos ) const
 sal_uInt16 HeaderBar::ImplHitTest( const Point& rPos,
long& nMouseOff, sal_uInt16& nPos ) const
 {
-ImplHeadItem*   pItem;
-size_t  nCount = (sal_uInt16)mpItemList->size();
+size_t  nCount = (sal_uInt16)mvItemList.size();
 boolbLastFixed = true;
 longnX = -mnOffset;
 
 for ( size_t i = 0; i < nCount; i++ )
 {
-pItem = (*mpItemList)[ i ];
+auto& pItem = mvItemList[ i ];
 
 if ( rPos.X() < (nX+pItem->mnSize) )
 {
@@ -215,7 +198,7 @@ sal_uInt16 HeaderBar::ImplHitTest( const Point& rPos,
 
 if ( !bLastFixed )
 {
-pItem = (*mpItemList)[ nCount-1 ];
+auto& pItem = mvItemList[ nCount-1 ];
 if ( (pItem->mnSize < 4)  && (rPos.X() < (nX+HEADERBAR_SPLITOFF)) )
 {
 nPos = nCount-1;
@@ -302,7 +285,7 @@ void HeaderBar::ImplDrawItem(vcl::RenderContext& 
rRenderContext, sal_uInt16 nPos
 return;
 }
 
-ImplHeadItem* pItem  = (*mpItemList)[nPos];
+auto& pItem  = mvItemList[nPos];
 HeaderBarItemBits nBits = pItem->mnBits;
 const StyleSettings& rStyleSettings = 
rRenderContext.GetSettings().GetStyleSettings();
 
@@ -617,7 +600,7 @@ void HeaderBar::ImplUpdate(sal_uInt16 nPos, bool bEnd)
 return;
 
 tools::Rectangle aRect;
-size_t nItemCount = mpItemList->size();
+size_t nItemCount = mvItemList.size();
 

[Libreoffice-commits] core.git: include/svtools svtools/source

2017-12-27 Thread Takeshi Abe
 include/svtools/fmtfield.hxx|   11 +++
 svtools/source/control/fmtfield.cxx |   14 +-
 2 files changed, 8 insertions(+), 17 deletions(-)

New commits:
commit d77d0d8e2fabc9dfc9eef3e532c31351632fb7b7
Author: Takeshi Abe 
Date:   Wed Dec 27 14:02:17 2017 +0900

svtools: Simplify DoubleNumericField with std::unique_ptr

Change-Id: I25df3a06afa5e1eb2fa282f2be2ae1ea69aa0ab5
Reviewed-on: https://gerrit.libreoffice.org/47077
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/svtools/fmtfield.hxx b/include/svtools/fmtfield.hxx
index e8d794fd76f6..6be6e44c59b0 100644
--- a/include/svtools/fmtfield.hxx
+++ b/include/svtools/fmtfield.hxx
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace validation { class NumberValidator; }
 
@@ -255,15 +256,9 @@ protected:
 class SVT_DLLPUBLIC DoubleNumericField final : public FormattedField
 {
 public:
-DoubleNumericField(vcl::Window* pParent, WinBits nStyle)
-:FormattedField(pParent, nStyle)
-,m_pNumberValidator( nullptr )
-{
-ResetConformanceTester();
-}
+DoubleNumericField(vcl::Window* pParent, WinBits nStyle);
 
 virtual ~DoubleNumericField() override;
-virtual void dispose() override;
 
 private:
 virtual bool CheckText(const OUString& sText) const override;
@@ -271,7 +266,7 @@ private:
 virtual void FormatChanged(FORMAT_CHANGE_TYPE nWhat) override;
 void ResetConformanceTester();
 
-validation::NumberValidator*m_pNumberValidator;
+std::unique_ptr m_pNumberValidator;
 };
 
 
diff --git a/svtools/source/control/fmtfield.cxx 
b/svtools/source/control/fmtfield.cxx
index 3b47e08c938b..20770f95569b 100644
--- a/svtools/source/control/fmtfield.cxx
+++ b/svtools/source/control/fmtfield.cxx
@@ -1007,16 +1007,13 @@ void FormattedField::UseInputStringForFormatting()
 }
 
 
-DoubleNumericField::~DoubleNumericField()
+DoubleNumericField::DoubleNumericField(vcl::Window* pParent, WinBits nStyle)
+: FormattedField(pParent, nStyle)
 {
-disposeOnce();
+ResetConformanceTester();
 }
 
-void DoubleNumericField::dispose()
-{
-delete m_pNumberValidator;
-FormattedField::dispose();
-}
+DoubleNumericField::~DoubleNumericField() = default;
 
 void DoubleNumericField::FormatChanged(FORMAT_CHANGE_TYPE nWhat)
 {
@@ -1052,8 +1049,7 @@ void DoubleNumericField::ResetConformanceTester()
 cSeparatorDecimal = sSeparator[0];
 }
 
-delete m_pNumberValidator;
-m_pNumberValidator = new validation::NumberValidator( cSeparatorThousand, 
cSeparatorDecimal );
+m_pNumberValidator.reset(new validation::NumberValidator( 
cSeparatorThousand, cSeparatorDecimal ));
 }
 
 DoubleCurrencyField::DoubleCurrencyField(vcl::Window* pParent, WinBits nStyle)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2017-12-25 Thread Takeshi Abe
 include/svtools/ctrlbox.hxx|5 -
 svtools/source/control/ctrlbox.cxx |   98 ++---
 2 files changed, 41 insertions(+), 62 deletions(-)

New commits:
commit c2ae5bc29b7064a599871358e6a4bb7b1dec2b85
Author: Takeshi Abe 
Date:   Sun Dec 24 20:46:53 2017 +0900

svtools: Use std::unique_ptr for LineListBox

This also inlines LineListBox::ImplInit(). Note that m_vLineList
never contains nullptr.

Change-Id: Ia4798943fbb53e1720d51faff7643e46d2cd2585
Reviewed-on: https://gerrit.libreoffice.org/47046
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/svtools/ctrlbox.hxx b/include/svtools/ctrlbox.hxx
index 6e0358721885..b446b7a0503d 100644
--- a/include/svtools/ctrlbox.hxx
+++ b/include/svtools/ctrlbox.hxx
@@ -31,12 +31,12 @@
 
 #include 
 #include 
+#include 
 
 class FontList;
 class ImpLineListData;
 enum class SvxBorderLineStyle : sal_Int16;
 
-typedef ::std::vector< ImpLineListData*  > ImpLineList;
 typedef ::std::vector< FontMetric > ImplFontList;
 
 /*
@@ -232,7 +232,6 @@ private:
 Color nColor1, Color nColor2, Color 
nColorDist,
 SvxBorderLineStyle nStyle, Bitmap& rBmp );
 using Window::ImplInit;
-SVT_DLLPRIVATE void ImplInit();
 voidUpdatePaintLineColor();   // returns sal_True if 
maPaintCol has changed
 virtual voidDataChanged( const DataChangedEvent& rDCEvt ) override;
 
@@ -247,7 +246,7 @@ private:
 LineListBox( const LineListBox& ) = delete;
 LineListBox&operator =( const LineListBox& ) = delete;
 
-ImpLineList*pLineList;
+std::vector m_vLineList;
 longm_nWidth;
 OUStringm_sNone;
 ScopedVclPtr   aVirDev;
diff --git a/svtools/source/control/ctrlbox.cxx 
b/svtools/source/control/ctrlbox.cxx
index b7b3ceae461a..16c6fdcb7310 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -470,11 +470,16 @@ void LineListBox::ImpGetLine( long nLine1, long nLine2, 
long nDistance,
 rBmp = aVirDev->GetBitmap( Point(), Size( aSize.Width(), n1+nDist+n2 ) );
 }
 
-void LineListBox::ImplInit()
+LineListBox::LineListBox( vcl::Window* pParent, WinBits nWinStyle ) :
+ListBox( pParent, nWinStyle ),
+m_nWidth( 5 ),
+m_sNone( ),
+aVirDev( VclPtr::Create() ),
+aColor( COL_BLACK ),
+maPaintCol( COL_BLACK )
 {
 aTxtSize.Width()  = GetTextWidth( " " );
 aTxtSize.Height() = GetTextHeight();
-pLineList   = new ImpLineList;
 eSourceUnit = FUNIT_POINT;
 
 aVirDev->SetLineColor();
@@ -483,17 +488,6 @@ void LineListBox::ImplInit()
 UpdatePaintLineColor();
 }
 
-LineListBox::LineListBox( vcl::Window* pParent, WinBits nWinStyle ) :
-ListBox( pParent, nWinStyle ),
-m_nWidth( 5 ),
-m_sNone( ),
-aVirDev( VclPtr::Create() ),
-aColor( COL_BLACK ),
-maPaintCol( COL_BLACK )
-{
-ImplInit();
-}
-
 extern "C" SAL_DLLPUBLIC_EXPORT void makeLineListBox(VclPtr & 
rRet, VclPtr & pParent, VclBuilder::stringmap & rMap)
 {
 bool bDropdown = BuilderUtils::extractDropdown(rMap);
@@ -513,10 +507,7 @@ LineListBox::~LineListBox()
 
 void LineListBox::dispose()
 {
-for (ImpLineListData* p : *pLineList)
-delete p;
-pLineList->clear();
-delete pLineList;
+m_vLineList.clear();
 ListBox::dispose();
 }
 
@@ -528,11 +519,11 @@ sal_Int32 LineListBox::GetStylePos( sal_Int32 nListPos, 
long nWidth )
 
 sal_Int32 n = 0;
 size_t i = 0;
-size_t nCount = pLineList->size();
+size_t nCount = m_vLineList.size();
 while ( nPos == LISTBOX_ENTRY_NOTFOUND && i < nCount )
 {
-ImpLineListData* pData = (*pLineList)[ i ];
-if ( pData && pData->GetMinWidth() <= nWidth )
+auto& pData = m_vLineList[ i ];
+if ( pData->GetMinWidth() <= nWidth )
 {
 if ( nListPos == n )
 nPos = static_cast(i);
@@ -555,26 +546,22 @@ void LineListBox::InsertEntry(
 const BorderWidthImpl& rWidthImpl, SvxBorderLineStyle nStyle, long 
nMinWidth,
 ColorFunc pColor1Fn, ColorFunc pColor2Fn, ColorDistFunc pColorDistFn )
 {
-ImpLineListData* pData = new ImpLineListData(
-rWidthImpl, nStyle, nMinWidth, pColor1Fn, pColor2Fn, pColorDistFn);
-pLineList->push_back( pData );
+m_vLineList.emplace_back(new ImpLineListData(
+rWidthImpl, nStyle, nMinWidth, pColor1Fn, pColor2Fn, pColorDistFn));
 }
 
 sal_Int32 LineListBox::GetEntryPos( SvxBorderLineStyle nStyle ) const
 {
 if(nStyle == SvxBorderLineStyle::NONE && !m_sNone.isEmpty())
 return 0;
-for ( size_t i = 0, n = pLineList->size(); i < n; ++i ) {
-ImpLineListData* pData = (*pLineList)[ i ];
-if ( pData )
+for ( size_t 

[Libreoffice-commits] core.git: include/svtools svtools/source

2017-12-25 Thread Caolán McNamara
 include/svtools/ehdl.hxx |4 ++--
 svtools/source/misc/ehdl.cxx |   12 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 6fabcc6d45774d1c99c99a6d0dc92c44ac196185
Author: Caolán McNamara 
Date:   Sun Dec 24 11:16:42 2017 +

coverity#1426923 Pointer to local outside scope

Change-Id: I200b09dc514b64fbd88050a1f5a8668ec640305f
Reviewed-on: https://gerrit.libreoffice.org/47040
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/include/svtools/ehdl.hxx b/include/svtools/ehdl.hxx
index 2b42fd5e8b91..a78e9d22d648 100644
--- a/include/svtools/ehdl.hxx
+++ b/include/svtools/ehdl.hxx
@@ -45,7 +45,7 @@ public:
 private:
 sal_uInt16 nCtxId;
 const ErrMsgCode* pIds;
-const std::locale& rResLocale;
+std::locale aResLocale;
 OUString aArg1;
 };
 
@@ -63,7 +63,7 @@ private:
 ErrCodeArea  lStart;
 ErrCodeArea  lEnd;
 const ErrMsgCode*pIds;
-const std::locale&   rResLocale;
+std::locale aResLocale;
 
 SVT_DLLPRIVATE static void GetClassString(ErrCodeClass lErrId, OUString &);
 virtual bool  CreateString(const ErrorInfo *, OUString &) const 
override;
diff --git a/svtools/source/misc/ehdl.cxx b/svtools/source/misc/ehdl.cxx
index 1c4b070e8ccb..f73adec3c045 100644
--- a/svtools/source/misc/ehdl.cxx
+++ b/svtools/source/misc/ehdl.cxx
@@ -140,7 +140,7 @@ static DialogMask aWndFunc(
 }
 
 SfxErrorHandler::SfxErrorHandler(const ErrMsgCode* pIdPs, ErrCodeArea lStartP, 
ErrCodeArea lEndP, const std::locale& rLocale)
-: lStart(lStartP), lEnd(lEndP), pIds(pIdPs), rResLocale(rLocale)
+: lStart(lStartP), lEnd(lEndP), pIds(pIdPs), aResLocale(rLocale)
 {
 ErrorRegistry::RegisterDisplay();
 }
@@ -219,7 +219,7 @@ bool SfxErrorHandler::GetErrorString(ErrCode lErrId, 
OUString ) const
 {
 if (pItem->second.GetRest() == lErrId.GetRest())
 {
-rStr = rStr.replaceAll("$(ERROR)", Translate::get(pItem->first, 
rResLocale));
+rStr = rStr.replaceAll("$(ERROR)", Translate::get(pItem->first, 
aResLocale));
 bRet = true;
 break;
 }
@@ -239,7 +239,7 @@ bool SfxErrorHandler::GetErrorString(ErrCode lErrId, 
OUString ) const
 
 SfxErrorContext::SfxErrorContext(
 sal_uInt16 nCtxIdP, vcl::Window *pWindow, const ErrMsgCode* pIdsP, const 
std::locale& rResLocaleP)
-:   ErrorContext(pWindow), nCtxId(nCtxIdP), pIds(pIdsP), 
rResLocale(rResLocaleP)
+:   ErrorContext(pWindow), nCtxId(nCtxIdP), pIds(pIdsP), 
aResLocale(rResLocaleP)
 {
 if (!pIds)
 pIds = getRID_ERRCTX();
@@ -249,7 +249,7 @@ SfxErrorContext::SfxErrorContext(
 SfxErrorContext::SfxErrorContext(
 sal_uInt16 nCtxIdP, const OUString , vcl::Window *pWindow,
 const ErrMsgCode* pIdsP, const std::locale& rResLocaleP)
-:   ErrorContext(pWindow), nCtxId(nCtxIdP), pIds(pIdsP), 
rResLocale(rResLocaleP),
+:   ErrorContext(pWindow), nCtxId(nCtxIdP), pIds(pIdsP), 
aResLocale(rResLocaleP),
 aArg1(aArg1P)
 {
 if (!pIds)
@@ -269,7 +269,7 @@ bool SfxErrorContext::GetString(ErrCode nErrId, OUString 
)
 {
 if (sal_uInt32(pItem->second) == nCtxId)
 {
-rStr = Translate::get(pItem->first, rResLocale);
+rStr = Translate::get(pItem->first, aResLocale);
 rStr = rStr.replaceAll("$(ARG1)", aArg1);
 bRet = true;
 break;
@@ -285,7 +285,7 @@ bool SfxErrorContext::GetString(ErrCode nErrId, OUString 
)
 {
 if (sal_uInt32(pItem->second) == nId)
 {
-rStr = rStr.replaceAll("$(ERR)", Translate::get(pItem->first, 
rResLocale));
+rStr = rStr.replaceAll("$(ERR)", Translate::get(pItem->first, 
aResLocale));
 break;
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2017-12-09 Thread Takeshi Abe
 include/svtools/imap.hxx  |5 +++--
 svtools/source/misc/imap.cxx  |   38 +-
 svtools/source/misc/imap2.cxx |   22 --
 3 files changed, 28 insertions(+), 37 deletions(-)

New commits:
commit 0fa13a403fed6e729e58963479d34694afa7b8d8
Author: Takeshi Abe 
Date:   Sat Dec 9 23:28:39 2017 +0900

svtools: Simplify ImageMap with std::unique_ptr

Change-Id: I49b3c21ff4d8177fb75197d6641040be0ace6324
Reviewed-on: https://gerrit.libreoffice.org/46149
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/svtools/imap.hxx b/include/svtools/imap.hxx
index 427d2768b67d..e60efb9990ed 100644
--- a/include/svtools/imap.hxx
+++ b/include/svtools/imap.hxx
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 class Point;
@@ -35,7 +36,7 @@ class SVT_DLLPUBLIC ImageMap final
 {
 private:
 
-::std::vector< IMapObject* > maList;
+std::vector maList;
 OUString aName;
 
 // binary saving/loading
@@ -81,7 +82,7 @@ public:
 // not be destroyed from outside
 IMapObject* GetIMapObject( size_t nPos ) const
 {
-return ( nPos < maList.size() ) ? maList[ nPos ] : 
nullptr;
+return ( nPos < maList.size() ) ? maList[ nPos 
].get() : nullptr;
 }
 
 // returns the object which was hit first or NULL;
diff --git a/svtools/source/misc/imap.cxx b/svtools/source/misc/imap.cxx
index 471399fd40bc..b06fd21042db 100644
--- a/svtools/source/misc/imap.cxx
+++ b/svtools/source/misc/imap.cxx
@@ -570,15 +570,15 @@ ImageMap::ImageMap( const ImageMap& rImageMap )
 switch( pCopyObj->GetType() )
 {
 case IMAP_OBJ_RECTANGLE:
-maList.push_back( new IMapRectangleObject( 
*static_cast( pCopyObj ) ) );
+maList.emplace_back( new IMapRectangleObject( 
*static_cast( pCopyObj ) ) );
 break;
 
 case IMAP_OBJ_CIRCLE:
-maList.push_back( new IMapCircleObject( 
*static_cast( pCopyObj ) ) );
+maList.emplace_back( new IMapCircleObject( 
*static_cast( pCopyObj ) ) );
 break;
 
 case IMAP_OBJ_POLYGON:
-maList.push_back( new IMapPolygonObject( 
*static_cast( pCopyObj ) ) );
+maList.emplace_back( new IMapPolygonObject( 
*static_cast( pCopyObj ) ) );
 break;
 
 default:
@@ -598,8 +598,6 @@ ImageMap::ImageMap( const ImageMap& rImageMap )
 
 ImageMap::~ImageMap()
 {
-
-ClearImageMap();
 }
 
 
@@ -611,8 +609,6 @@ ImageMap::~ImageMap()
 
 void ImageMap::ClearImageMap()
 {
-for(IMapObject* i : maList)
-delete i;
 maList.clear();
 
 aName.clear();
@@ -638,15 +634,15 @@ ImageMap& ImageMap::operator=( const ImageMap& rImageMap )
 switch( pCopyObj->GetType() )
 {
 case IMAP_OBJ_RECTANGLE:
-maList.push_back( new IMapRectangleObject( 
*static_cast(pCopyObj) ) );
+maList.emplace_back( new IMapRectangleObject( 
*static_cast(pCopyObj) ) );
 break;
 
 case IMAP_OBJ_CIRCLE:
-maList.push_back( new IMapCircleObject( 
*static_cast(pCopyObj) ) );
+maList.emplace_back( new IMapCircleObject( 
*static_cast(pCopyObj) ) );
 break;
 
 case IMAP_OBJ_POLYGON:
-maList.push_back( new IMapPolygonObject( 
*static_cast(pCopyObj) ) );
+maList.emplace_back( new IMapPolygonObject( 
*static_cast(pCopyObj) ) );
 break;
 
 default:
@@ -678,7 +674,7 @@ bool ImageMap::operator==( const ImageMap& rImageMap )
 
 for ( size_t i = 0; ( i < nCount ) && !bDifferent; i++ )
 {
-IMapObject* pObj = maList[ i ];
+IMapObject* pObj = maList[ i ].get();
 IMapObject* pEqObj = rImageMap.GetIMapObject( i );
 
 if ( pObj->GetType() == pEqObj->GetType() )
@@ -745,15 +741,15 @@ void ImageMap::InsertIMapObject( const IMapObject& 
rIMapObject )
 switch( rIMapObject.GetType() )
 {
 case IMAP_OBJ_RECTANGLE:
-maList.push_back( new IMapRectangleObject( static_cast( rIMapObject ) ) );
+maList.emplace_back( new IMapRectangleObject( static_cast( rIMapObject ) ) );
 break;
 
 case IMAP_OBJ_CIRCLE:
-maList.push_back( new IMapCircleObject( static_cast( rIMapObject ) ) );
+maList.emplace_back( new IMapCircleObject( static_cast( rIMapObject ) ) );
 break;
 
 case IMAP_OBJ_POLYGON:
-  

[Libreoffice-commits] core.git: include/svtools svtools/source

2017-12-01 Thread Andras Timar
 include/svtools/strings.hrc|1 +
 svtools/source/dialogs/PlaceEditDialog.cxx |2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

New commits:
commit ae745789704fd7ad86c84ff9875cda810ff915b0
Author: Andras Timar 
Date:   Thu Nov 30 13:51:03 2017 +0100

tdf#102160 make 'Other CMIS' string localizable

Change-Id: I58cf9eea05f15223e32ff1542b946c5962041e6c
Reviewed-on: https://gerrit.libreoffice.org/45577
Tested-by: Jenkins 
Reviewed-by: Andras Timar 

diff --git a/include/svtools/strings.hrc b/include/svtools/strings.hrc
index ebda4b746df8..7580610f79bc 100644
--- a/include/svtools/strings.hrc
+++ b/include/svtools/strings.hrc
@@ -213,6 +213,7 @@
 #define STR_SVT_ESTIMATED_SIZE_VEC  
NC_("STR_SVT_ESTIMATED_SIZE_VEC", "The file size is %1 KB.")
 #define STR_SVT_HOSTNC_("STR_SVT_HOST", "host")
 #define STR_SVT_PORTNC_("STR_SVT_PORT", "port")
+#define STR_SVT_OTHER_CMIS  NC_("STR_SVT_OTHER_CMIS", 
"Other CMIS")
 #define STR_SVT_PRNDLG_READYNC_("STR_SVT_PRNDLG_READY", 
"Ready")
 #define STR_SVT_PRNDLG_PAUSED   NC_("STR_SVT_PRNDLG_PAUSED", 
"Paused")
 #define STR_SVT_PRNDLG_PENDING  NC_("STR_SVT_PRNDLG_PENDING", 
"Pending deletion")
diff --git a/svtools/source/dialogs/PlaceEditDialog.cxx 
b/svtools/source/dialogs/PlaceEditDialog.cxx
index e1318d1aa5dc..a8a09a739485 100644
--- a/svtools/source/dialogs/PlaceEditDialog.cxx
+++ b/svtools/source/dialogs/PlaceEditDialog.cxx
@@ -185,7 +185,7 @@ void PlaceEditDialog::InitDetails( )
 continue;
 }
 
-nPos = m_pLBServerType->InsertEntry( aTypesNamesList[i], nPos );
+nPos = m_pLBServerType->InsertEntry( 
aTypesNamesList[i].replaceFirst("Other CMIS", SvtResId(STR_SVT_OTHER_CMIS)), 
nPos );
 
 std::shared_ptr 
xCmisDetails(std::make_shared(this, this, sUrl));
 xCmisDetails->setChangeHdl( LINK( this, PlaceEditDialog, EditHdl ) );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2017-11-30 Thread Gabor Kelemen
 include/svtools/strings.hrc   |1 +
 svtools/source/dialogs/insdlg.cxx |1 +
 2 files changed, 2 insertions(+)

New commits:
commit f66ace21cdf4fec85c05be1a85ecfdaa8c281066
Author: Gabor Kelemen 
Date:   Wed Nov 29 00:20:09 2017 +0100

tdf#114124 Translate 'PNG Bitmap' string in Calc Paste dropdown

Change-Id: I8356f241d0742276cf32aa301c35055a7f3c5898
Reviewed-on: https://gerrit.libreoffice.org/45447
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/include/svtools/strings.hrc b/include/svtools/strings.hrc
index a7af8ca5889d..ebda4b746df8 100644
--- a/include/svtools/strings.hrc
+++ b/include/svtools/strings.hrc
@@ -94,6 +94,7 @@
 #define STR_FORMAT_ID_DIALOG_60 NC_("STR_FORMAT_ID_DIALOG_60", 
"OpenOffice.org 1.0 dialog")
 #define STR_FORMAT_ID_FILEGRPDESCRIPTOR 
NC_("STR_FORMAT_ID_FILEGRPDESCRIPTOR", "Link")
 #define STR_FORMAT_ID_HTML_NO_COMMENT   
NC_("STR_FORMAT_ID_HTML_NO_COMMENT", "HTML format without comments")
+#define STR_FORMAT_ID_PNG_BITMAP
NC_("STR_FORMAT_ID_PNG_BITMAP", "PNG Bitmap")
 
 #define STR_ERROR_OBJNOCREATE   NC_("STR_ERROR_OBJNOCREATE", 
"Object % could not be inserted.")
 #define STR_ERROR_OBJNOCREATE_FROM_FILE 
NC_("STR_ERROR_OBJNOCREATE_FROM_FILE", "Object from file % could not be 
inserted.")
diff --git a/svtools/source/dialogs/insdlg.cxx 
b/svtools/source/dialogs/insdlg.cxx
index 08c68596063f..a7ed5ca32c1a 100644
--- a/svtools/source/dialogs/insdlg.cxx
+++ b/svtools/source/dialogs/insdlg.cxx
@@ -264,6 +264,7 @@ OUString SvPasteObjectHelper::GetSotFormatUIName( 
SotClipboardFormatId nId )
 { SotClipboardFormatId::HTML_NO_COMMENT, 
STR_FORMAT_ID_HTML_NO_COMMENT },
 { SotClipboardFormatId::RICHTEXT,STR_FORMAT_ID_RICHTEXT },
 { SotClipboardFormatId::STRING_TSVC, STR_FORMAT_ID_STRING_TSVC 
},
+{ SotClipboardFormatId::PNG, STR_FORMAT_ID_PNG_BITMAP 
},
 };
 
 const char* pResId = nullptr;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2017-10-19 Thread Takeshi Abe
 include/svtools/treelistentry.hxx   |2 +-
 svtools/source/contnr/treelistentry.cxx |   13 -
 2 files changed, 1 insertion(+), 14 deletions(-)

New commits:
commit 44f54bf392375b789e3e3c3e868c9426d6cd4e41
Author: Takeshi Abe 
Date:   Wed Oct 18 17:22:02 2017 +0900

svtools: SvTreeListEntry's copy ctor is unnecessary

Change-Id: Idce8773d96e30dacfc9ce13fdb9b399c2a8bf341
Reviewed-on: https://gerrit.libreoffice.org/43485
Tested-by: Jenkins 
Reviewed-by: Julien Nabet 

diff --git a/include/svtools/treelistentry.hxx 
b/include/svtools/treelistentry.hxx
index 57a7056cdad7..899e3f8bbc96 100644
--- a/include/svtools/treelistentry.hxx
+++ b/include/svtools/treelistentry.hxx
@@ -70,13 +70,13 @@ private:
 void SetListPositions();
 void InvalidateChildrensListPositions();
 
+SvTreeListEntry(const SvTreeListEntry& r) = delete;
 void operator=(SvTreeListEntry const&) = delete;
 
 public:
 static const size_t ITEM_NOT_FOUND = SAL_MAX_SIZE;
 
 SvTreeListEntry();
-SvTreeListEntry(const SvTreeListEntry& r);
 virtual ~SvTreeListEntry();
 
 bool HasChildren() const;
diff --git a/svtools/source/contnr/treelistentry.cxx 
b/svtools/source/contnr/treelistentry.cxx
index 72436e9f5fa6..aab1f37597c2 100644
--- a/svtools/source/contnr/treelistentry.cxx
+++ b/svtools/source/contnr/treelistentry.cxx
@@ -20,7 +20,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
@@ -60,18 +59,6 @@ SvTreeListEntry::SvTreeListEntry()
 {
 }
 
-SvTreeListEntry::SvTreeListEntry(const SvTreeListEntry& r)
-: pParent(nullptr)
-, nAbsPos(r.nAbsPos)
-, nListPos(r.nListPos & 0x7FFF)
-, pUserData(r.pUserData)
-, nEntryFlags(r.nEntryFlags)
-, 
maBackColor(Application::GetSettings().GetStyleSettings().GetWindowColor())
-{
-for (auto const& it : r.m_Children)
-m_Children.push_back(o3tl::make_unique(*it));
-}
-
 SvTreeListEntry::~SvTreeListEntry()
 {
 #ifdef DBG_UTIL
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2017-10-18 Thread Noel Grandin
 include/svtools/treelist.hxx   |4 +-
 svtools/source/contnr/treelist.cxx |   73 +
 2 files changed, 36 insertions(+), 41 deletions(-)

New commits:
commit facb86ea0140a3c82f02754e311efad33e072d1c
Author: Noel Grandin 
Date:   Tue Oct 17 15:52:51 2017 +0200

use std::unique_ptr in SvTreeList

Change-Id: Ibfba32d6855532aeb42c45f493a4f01f7d0cd4ee
Reviewed-on: https://gerrit.libreoffice.org/43475
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/svtools/treelist.hxx b/include/svtools/treelist.hxx
index 483575b01c6b..d921653c29fb 100644
--- a/include/svtools/treelist.hxx
+++ b/include/svtools/treelist.hxx
@@ -131,7 +131,7 @@ class SVT_DLLPUBLIC SvTreeList final
 SvTreeList(const SvTreeList&) = delete;
 SvTreeList& operator= (const SvTreeList&) = delete;
 
-SvTreeListEntry*pRootItem;
+std::unique_ptr  pRootItem;
 
 public:
 
@@ -166,7 +166,7 @@ public:
 
 sal_uLong   Insert( SvTreeListEntry* pEntry,SvTreeListEntry* 
pPar,sal_uLong nPos = TREELIST_APPEND);
 sal_uLong   Insert( SvTreeListEntry* pEntry,sal_uLong nRootPos = 
TREELIST_APPEND )
-{ return Insert(pEntry, pRootItem, nRootPos ); }
+{ return Insert(pEntry, pRootItem.get(), nRootPos ); }
 
 voidInsertTree( SvTreeListEntry* pTree, SvTreeListEntry* 
pTargetParent, sal_uLong nListPos );
 
diff --git a/svtools/source/contnr/treelist.cxx 
b/svtools/source/contnr/treelist.cxx
index 8d6c72b570c4..89ff1edccac1 100644
--- a/svtools/source/contnr/treelist.cxx
+++ b/svtools/source/contnr/treelist.cxx
@@ -63,17 +63,13 @@ SvTreeList::SvTreeList() :
 nEntryCount = 0;
 bAbsPositionsValid = false;
 nRefCount = 1;
-pRootItem = new SvTreeListEntry;
+pRootItem.reset(new SvTreeListEntry);
 eSortMode = SortNone;
 }
 
 SvTreeList::~SvTreeList()
 {
 Clear();
-delete pRootItem;
-#ifdef DBG_UTIL
-pRootItem = nullptr;
-#endif
 }
 
 void SvTreeList::Broadcast(
@@ -123,7 +119,7 @@ bool SvTreeList::IsEntryVisible( const SvListView* pView, 
SvTreeListEntry* pEntr
 bool bRetVal = false;
 do
 {
-if ( pEntry == pRootItem )
+if ( pEntry == pRootItem.get() )
 {
 bRetVal = true;
 break;
@@ -135,9 +131,9 @@ bool SvTreeList::IsEntryVisible( const SvListView* pView, 
SvTreeListEntry* pEntr
 
 sal_uInt16 SvTreeList::GetDepth( const SvTreeListEntry* pEntry ) const
 {
-DBG_ASSERT(pEntry&!=pRootItem,"GetDepth:Bad Entry");
+DBG_ASSERT(pEntry && pEntry!=pRootItem.get(),"GetDepth:Bad Entry");
 sal_uInt16 nDepth = 0;
-while( pEntry->pParent != pRootItem )
+while( pEntry->pParent != pRootItem.get() )
 {
 nDepth++;
 pEntry = pEntry->pParent;
@@ -147,7 +143,7 @@ sal_uInt16 SvTreeList::GetDepth( const SvTreeListEntry* 
pEntry ) const
 
 bool SvTreeList::IsAtRootDepth( const SvTreeListEntry* pEntry ) const
 {
-return pEntry->pParent == pRootItem;
+return pEntry->pParent == pRootItem.get();
 }
 
 void SvTreeList::Clear()
@@ -161,7 +157,7 @@ void SvTreeList::Clear()
 bool SvTreeList::IsChild(const SvTreeListEntry* pParent, const 
SvTreeListEntry* pChild) const
 {
 if ( !pParent )
-pParent = pRootItem;
+pParent = pRootItem.get();
 
 if (pParent->m_Children.empty())
 return false;
@@ -211,7 +207,7 @@ sal_uLong SvTreeList::Move(SvTreeListEntry* 
pSrcEntry,SvTreeListEntry* pTargetPa
 // pDest may be 0!
 DBG_ASSERT(pSrcEntry,"Entry?");
 if ( !pTargetParent )
-pTargetParent = pRootItem;
+pTargetParent = pRootItem.get();
 DBG_ASSERT(pSrcEntry!=pTargetParent,"Move:Source=Target");
 
 Broadcast( SvListAction::MOVING, pSrcEntry, pTargetParent, nListPos );
@@ -306,7 +302,7 @@ sal_uLong SvTreeList::Copy(SvTreeListEntry* 
pSrcEntry,SvTreeListEntry* pTargetPa
 // pDest may be 0!
 DBG_ASSERT(pSrcEntry,"Entry?");
 if ( !pTargetParent )
-pTargetParent = pRootItem;
+pTargetParent = pRootItem.get();
 
 bAbsPositionsValid = false;
 
@@ -341,7 +337,7 @@ void SvTreeList::Move( SvTreeListEntry* pSrcEntry, 
SvTreeListEntry* pDstEntry )
 
 if ( !pDstEntry )
 {
-pParent = pRootItem;
+pParent = pRootItem.get();
 nPos = 0;
 }
 else
@@ -361,7 +357,7 @@ void SvTreeList::InsertTree(SvTreeListEntry* pSrcEntry,
 return;
 
 if ( !pTargetParent )
-pTargetParent = pRootItem;
+pTargetParent = pRootItem.get();
 
 // take sorting into account
 GetInsertionPos( pSrcEntry, pTargetParent, nListPos );
@@ -452,7 +448,7 @@ sal_uLong SvTreeList::GetVisibleChildCount(const 
SvListView* pView, SvTreeListEn
 {
 DBG_ASSERT(pView,"GetVisChildCount:No View");
 if ( !pParent )
-pParent = pRootItem;
+pParent = pRootItem.get();
 
 if (!pParent || !pView->IsExpanded(pParent) || 

[Libreoffice-commits] core.git: include/svtools svtools/source

2017-09-22 Thread Eike Rathke
 include/svtools/DocumentToGraphicRenderer.hxx   |   21 +
 svtools/source/filter/DocumentToGraphicRenderer.cxx |   24 
 2 files changed, 45 insertions(+)

New commits:
commit 3b06d9df29dc2aef568bad5bbe10c57e78bbb81a
Author: Eike Rathke 
Date:   Fri Sep 22 14:02:20 2017 +0200

Introduce DocumentToGraphicRenderer::isShapeSelected()

Change-Id: I66fc0e39a7a35969b937253c88326516949ea7e7
Reviewed-on: https://gerrit.libreoffice.org/42653
Reviewed-by: Eike Rathke 
Tested-by: Eike Rathke 

diff --git a/include/svtools/DocumentToGraphicRenderer.hxx 
b/include/svtools/DocumentToGraphicRenderer.hxx
index 80f37df3c56e..5ed6f2ce4434 100644
--- a/include/svtools/DocumentToGraphicRenderer.hxx
+++ b/include/svtools/DocumentToGraphicRenderer.hxx
@@ -30,6 +30,16 @@
 
 #include 
 
+namespace com { namespace sun { namespace star {
+namespace drawing {
+class XShapes;
+class XShape;
+}
+namespace frame {
+class XController;
+}
+}}}
+
 class SVT_DLLPUBLIC DocumentToGraphicRenderer
 {
 const css::uno::Reference& mxDocument;
@@ -63,6 +73,17 @@ public:
 
 Graphic renderToGraphic( sal_Int32 nCurrentPage, Size aDocumentSizePixel,
 Size aTargetSizePixel, Color aPageColor);
+
+/** Determine whether rxController has a css::view::XSelectionSupplier at
+which either a css::drawing::XShapes or css::drawing::XShape is
+selected. XShapes has precedence over XShape.
+
+Call only if the SelectionOnly property was set.
+ */
+static bool isShapeSelected(
+css::uno::Reference< css::drawing::XShapes > & rxShapes,
+css::uno::Reference< css::drawing::XShape > & rxShape,
+const css::uno::Reference< css::frame::XController > & 
rxController );
 };
 
 #endif
diff --git a/svtools/source/filter/DocumentToGraphicRenderer.cxx 
b/svtools/source/filter/DocumentToGraphicRenderer.cxx
index 180631cf56e4..8bf5120078bc 100644
--- a/svtools/source/filter/DocumentToGraphicRenderer.cxx
+++ b/svtools/source/filter/DocumentToGraphicRenderer.cxx
@@ -31,6 +31,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 
@@ -227,4 +229,26 @@ sal_Int32 DocumentToGraphicRenderer::getCurrentPageWriter()
 return xCursor->getPage();
 }
 
+// static
+bool DocumentToGraphicRenderer::isShapeSelected(
+css::uno::Reference< css::drawing::XShapes > & rxShapes,
+css::uno::Reference< css::drawing::XShape > & rxShape,
+const css::uno::Reference< css::frame::XController > & rxController )
+{
+bool bShape = false;
+if (rxController.is())
+{
+uno::Reference< view::XSelectionSupplier > xSelectionSupplier( 
rxController, uno::UNO_QUERY);
+if (xSelectionSupplier.is())
+{
+uno::Any aAny( xSelectionSupplier->getSelection());
+if (aAny >>= rxShapes)
+bShape = true;
+else if (aAny >>= rxShape)
+bShape = true;
+}
+}
+return bShape;
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2017-09-19 Thread Eike Rathke
 include/svtools/DocumentToGraphicRenderer.hxx   |   13 +-
 svtools/source/filter/DocumentToGraphicRenderer.cxx |   25 +---
 2 files changed, 24 insertions(+), 14 deletions(-)

New commits:
commit 5214e841b6ca5362f94d59f940ec3947978c1abe
Author: Eike Rathke 
Date:   Tue Sep 19 20:43:02 2017 +0200

Detect Writer doc independent of selection, we'll need that later

Change-Id: Ieddbcd3e8b750ec4b32643aec0433f8638ee46ee
Reviewed-on: https://gerrit.libreoffice.org/42495
Reviewed-by: Eike Rathke 
Tested-by: Eike Rathke 

diff --git a/include/svtools/DocumentToGraphicRenderer.hxx 
b/include/svtools/DocumentToGraphicRenderer.hxx
index 2240b160d79b..80f37df3c56e 100644
--- a/include/svtools/DocumentToGraphicRenderer.hxx
+++ b/include/svtools/DocumentToGraphicRenderer.hxx
@@ -34,12 +34,13 @@ class SVT_DLLPUBLIC DocumentToGraphicRenderer
 {
 const css::uno::Reference& mxDocument;
 
-css::uno::ReferencemxModel;
-css::uno::Reference   mxController;
-css::uno::ReferencemxRenderable;
-css::uno::ReferencemxToolkit;
-css::uno::Any  maSelection;
-bool   mbSelectionOnly;
+css::uno::Reference mxModel;
+css::uno::ReferencemxController;
+css::uno::Reference mxRenderable;
+css::uno::Reference mxToolkit;
+css::uno::Any   maSelection;
+boolmbSelectionOnly;
+boolmbIsWriter;
 
 bool hasSelection() const;
 
diff --git a/svtools/source/filter/DocumentToGraphicRenderer.cxx 
b/svtools/source/filter/DocumentToGraphicRenderer.cxx
index 524c30afcd64..5b125bbdebd3 100644
--- a/svtools/source/filter/DocumentToGraphicRenderer.cxx
+++ b/svtools/source/filter/DocumentToGraphicRenderer.cxx
@@ -45,8 +45,22 @@ DocumentToGraphicRenderer::DocumentToGraphicRenderer( const 
ReferencegetCurrentController() ),
 mxRenderable (mxDocument, uno::UNO_QUERY ),
 mxToolkit( VCLUnoHelper::CreateToolkit() ),
-mbSelectionOnly( bSelectionOnly )
+mbSelectionOnly( bSelectionOnly ),
+mbIsWriter( false )
 {
+try
+{
+uno::Reference< lang::XServiceInfo > xServiceInfo( mxDocument, 
uno::UNO_QUERY);
+if (xServiceInfo.is())
+{
+if 
(xServiceInfo->supportsService("com.sun.star.text.TextDocument"))
+mbIsWriter = true;
+}
+}
+catch (const uno::Exception&)
+{
+}
+
 if (mbSelectionOnly && mxController.is())
 {
 try
@@ -57,18 +71,13 @@ DocumentToGraphicRenderer::DocumentToGraphicRenderer( const 
ReferencegetSelection());
 if (aViewSelection.hasValue())
 {
-maSelection = aViewSelection;
 /* FIXME: Writer always has a selection even if nothing is
  * selected, but passing a selection to
  * XRenderable::render() it always renders an empty page.
  * So disable the selection already here. The current page
  * the cursor is on is rendered. */
-uno::Reference< lang::XServiceInfo > xServiceInfo( 
mxDocument, uno::UNO_QUERY);
-if (xServiceInfo.is())
-{
-if 
(xServiceInfo->supportsService("com.sun.star.text.TextDocument"))
-maSelection = uno::Any();
-}
+if (!mbIsWriter)
+maSelection = aViewSelection;
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2017-09-19 Thread Eike Rathke
 include/svtools/DocumentToGraphicRenderer.hxx   |6 ++
 svtools/source/filter/DocumentToGraphicRenderer.cxx |   42 +++-
 2 files changed, 31 insertions(+), 17 deletions(-)

New commits:
commit cb6cbbd5cad2ea0433cf5cc3ced8491f5c400a38
Author: Eike Rathke 
Date:   Tue Sep 19 19:08:14 2017 +0200

Introduce DocumentToGraphicRenderer::hasSelection() and maSelection

Change-Id: Ib7a9df04eb1b8646e20f58c3f9af3ee2dbbb13db
Reviewed-on: https://gerrit.libreoffice.org/42489
Reviewed-by: Eike Rathke 
Tested-by: Eike Rathke 

diff --git a/include/svtools/DocumentToGraphicRenderer.hxx 
b/include/svtools/DocumentToGraphicRenderer.hxx
index 450672ebe7ad..2240b160d79b 100644
--- a/include/svtools/DocumentToGraphicRenderer.hxx
+++ b/include/svtools/DocumentToGraphicRenderer.hxx
@@ -38,8 +38,14 @@ class SVT_DLLPUBLIC DocumentToGraphicRenderer
 css::uno::Reference   mxController;
 css::uno::ReferencemxRenderable;
 css::uno::ReferencemxToolkit;
+css::uno::Any  maSelection;
 bool   mbSelectionOnly;
 
+bool hasSelection() const;
+
+/** Always something even if hasSelection() is false (in which case the
+selection is mxDocument).
+ */
 css::uno::Any getSelection() const;
 
 sal_Int32 getCurrentPageWriter();
diff --git a/svtools/source/filter/DocumentToGraphicRenderer.cxx 
b/svtools/source/filter/DocumentToGraphicRenderer.cxx
index 459bfb925174..8cf4e0e53a77 100644
--- a/svtools/source/filter/DocumentToGraphicRenderer.cxx
+++ b/svtools/source/filter/DocumentToGraphicRenderer.cxx
@@ -46,22 +46,6 @@ DocumentToGraphicRenderer::DocumentToGraphicRenderer( const 
ReferenceLogicToPixel( aSize100mm, 
MapUnit::Map100thMM );
-}
-
-uno::Any DocumentToGraphicRenderer::getSelection() const
-{
-uno::Any aSelection;
-aSelection <<= mxDocument;  // default: render whole document
 if (mbSelectionOnly && mxController.is())
 {
 try
@@ -71,13 +55,37 @@ uno::Any DocumentToGraphicRenderer::getSelection() const
 {
 uno::Any aViewSelection( xSelSup->getSelection());
 if (aViewSelection.hasValue())
-aSelection = aViewSelection;
+maSelection = aViewSelection;
 }
 }
 catch (const uno::Exception&)
 {
 }
 }
+}
+
+DocumentToGraphicRenderer::~DocumentToGraphicRenderer()
+{
+}
+
+Size DocumentToGraphicRenderer::getDocumentSizeInPixels(sal_Int32 nCurrentPage)
+{
+Size aSize100mm = getDocumentSizeIn100mm(nCurrentPage);
+return Application::GetDefaultDevice()->LogicToPixel( aSize100mm, 
MapUnit::Map100thMM );
+}
+
+bool DocumentToGraphicRenderer::hasSelection() const
+{
+return maSelection.hasValue();
+}
+
+uno::Any DocumentToGraphicRenderer::getSelection() const
+{
+uno::Any aSelection;
+if (hasSelection())
+aSelection <<= maSelection;
+else
+aSelection <<= mxDocument;  // default: render whole document
 return aSelection;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2017-08-18 Thread Noel Grandin
 include/svtools/tabbar.hxx|7 ---
 svtools/source/control/tabbar.cxx |   21 +
 2 files changed, 1 insertion(+), 27 deletions(-)

New commits:
commit fd2c6137ea45e0587a56bf219b1e5d8fb72cce03
Author: Noel Grandin 
Date:   Fri Aug 18 14:45:17 2017 +0200

WB_TOPBORDER,WB_3DTAB are dead

since

commit 8ab086b6cc054501bfbf7ef6fa509c393691e860
initial import

Change-Id: Icbbf01de92c6dab4f9f94052cda784326a051ad8
Reviewed-on: https://gerrit.libreoffice.org/41295
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/svtools/tabbar.hxx b/include/svtools/tabbar.hxx
index 5be67be2efec..8cef7ff434d6 100644
--- a/include/svtools/tabbar.hxx
+++ b/include/svtools/tabbar.hxx
@@ -36,8 +36,6 @@ WB_MINSCROLL- The tabs can be scrolled via 2 additional 
buttons
 WB_RANGESELECT  - Connected ranges can be selected
 WB_MULTISELECT  - single tabs can be selected
 WB_BORDER   - a border is drawn in the top and in the bottom
-WB_TOPBORDER- a border is drawn in the top
-WB_3DTAB- the tabs and the border are drawn in 3D
 WB_DRAG - A StartDrag handler is called by the TabBar, if drag
   and drop should be started. In addition, drag and drop
   is activated in the TabBar with EnableDrop().
@@ -45,9 +43,6 @@ WB_SIZEABLE - a Split handler is called by the TabBar, if 
the user
   wants to change the width of the TabBar
 WB_STDTABBAR- WB_BORDER
 
-If the TabBar should be used for example as Property bar, the WinBits
-WB_TOPBORDER and WB_3DTAB should be set instead of WB_BORDER.
-
 
 Allowed PageBits
 -
@@ -268,8 +263,6 @@ class Button;
 
 #define WB_RANGESELECT  ((WinBits)0x0020)
 #define WB_MULTISELECT  ((WinBits)0x0040)
-#define WB_TOPBORDER((WinBits)0x0400)
-#define WB_3DTAB((WinBits)0x0800)
 #define WB_MINSCROLL((WinBits)0x2000)
 #define WB_INSERTTAB((WinBits)0x4000)
 #define WB_STDTABBARWB_BORDER
diff --git a/svtools/source/control/tabbar.cxx 
b/svtools/source/control/tabbar.cxx
index a1d5218786a9..8ca68320d8eb 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -78,18 +78,11 @@ public:
 WinBits nWinStyle = mrParent.GetStyle();
 
 // draw extra line if above and below border
-if ((nWinStyle & WB_BORDER) || (nWinStyle & WB_TOPBORDER))
+if (nWinStyle & WB_BORDER)
 {
 Size aOutputSize(mrParent.GetOutputSizePixel());
 tools::Rectangle aOutRect = mrParent.GetPageArea();
 
-// also draw border in 3D for 3D-tabs
-if (nWinStyle & WB_3DTAB)
-{
-mrRenderContext.SetLineColor(mrStyleSettings.GetShadowColor());
-mrRenderContext.DrawLine(Point(aOutRect.Left(), 0), 
Point(aOutputSize.Width(), 0));
-}
-
 // draw border (line above and line below)
 mrRenderContext.SetLineColor(mrStyleSettings.GetDarkShadowColor());
 mrRenderContext.DrawLine(aOutRect.TopLeft(), 
Point(aOutputSize.Width() - 1, aOutRect.Top()));
@@ -552,9 +545,6 @@ void TabBar::ImplInit( WinBits nWinStyle )
 mbMirrored  = false;
 mbScrollAlwaysEnabled = false;
 
-if ( nWinStyle & WB_3DTAB )
-mnOffY++;
-
 ImplInitControls();
 
 if (mpImpl->mpFirstButton)
@@ -645,15 +635,6 @@ void TabBar::ImplGetColors(const StyleSettings& 
rStyleSettings,
 rFaceTextColor = rStyleSettings.GetButtonTextColor();
 rSelectColor = rStyleSettings.GetActiveTabColor();
 rSelectTextColor = rStyleSettings.GetWindowTextColor();
-
-// For 3D-tabs the selection- and face-colours are swapped,
-// as the selected tabs should appear in 3D
-if (mnWinStyle & WB_3DTAB)
-{
-using std::swap;
-swap(rFaceColor, rSelectColor);
-swap(rFaceTextColor, rSelectTextColor);
-}
 }
 
 bool TabBar::ImplCalcWidth()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2017-07-25 Thread Noel Grandin
 include/svtools/imagemgr.hxx |  105 
 svtools/source/misc/imagemgr.cxx |  492 +++
 2 files changed, 301 insertions(+), 296 deletions(-)

New commits:
commit 38498f05cae63566c1e2d9db04d8fc8be6d309e2
Author: Noel Grandin 
Date:   Tue Jul 25 14:18:44 2017 +0200

Convert IMG_ constants to scoped enum

Change-Id: I4cb65be468422f3cfbf88a6b9ef39fc370fd1a08
Reviewed-on: https://gerrit.libreoffice.org/40408
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/svtools/imagemgr.hxx b/include/svtools/imagemgr.hxx
index a81cbbf70efe..7d97842997cb 100644
--- a/include/svtools/imagemgr.hxx
+++ b/include/svtools/imagemgr.hxx
@@ -23,57 +23,60 @@
 #include 
 #include 
 
-#define IMAGELIST_START 3076  // must match to old Id's in SFX!
-
-#define IMG_IMPRESS (IMAGELIST_START + 47)
-#define IMG_BITMAP  (IMAGELIST_START + 49)
-#define IMG_CALC(IMAGELIST_START + 50)
-#define IMG_CALCTEMPLATE(IMAGELIST_START + 51)
-#define IMG_DATABASE(IMAGELIST_START + 53)
-#define IMG_IMPRESSTEMPLATE (IMAGELIST_START + 54)
-#define IMG_GIF (IMAGELIST_START + 61)
-#define IMG_HTML(IMAGELIST_START + 63)
-#define IMG_JPG (IMAGELIST_START + 64)
-#define IMG_MATH(IMAGELIST_START + 68)
-#define IMG_MATHTEMPLATE(IMAGELIST_START + 69)
-#define IMG_FILE(IMAGELIST_START + 74)
-#define IMG_PCD (IMAGELIST_START + 76)
-#define IMG_PCT (IMAGELIST_START + 77)
-#define IMG_PCX (IMAGELIST_START + 78)
-#define IMG_SIM (IMAGELIST_START + 79)
-#define IMG_TEXTFILE(IMAGELIST_START + 80)
-#define IMG_TIFF(IMAGELIST_START + 82)
-#define IMG_WMF (IMAGELIST_START + 84)
-#define IMG_WRITER  (IMAGELIST_START + 86)
-#define IMG_WRITERTEMPLATE  (IMAGELIST_START + 87)
-#define IMG_FIXEDDEV(IMAGELIST_START + 88)
-#define IMG_REMOVABLEDEV(IMAGELIST_START + 89)
-#define IMG_CDROMDEV(IMAGELIST_START + 90)
-#define IMG_NETWORKDEV  (IMAGELIST_START + 91)
-#define IMG_TABLE   (IMAGELIST_START + 112)
-#define IMG_FOLDER  (IMAGELIST_START + 113)
-#define IMG_DXF (IMAGELIST_START + 141)
-#define IMG_MET (IMAGELIST_START + 142)
-#define IMG_PNG (IMAGELIST_START + 143)
-#define IMG_SGF (IMAGELIST_START + 144)
-#define IMG_SGV (IMAGELIST_START + 145)
-#define IMG_SVM (IMAGELIST_START + 146)
-#define IMG_GLOBAL_DOC  (IMAGELIST_START + 150)
-#define IMG_DRAW(IMAGELIST_START + 151)
-#define IMG_DRAWTEMPLATE(IMAGELIST_START + 152)
-#define IMG_TEMPLATE(IMAGELIST_START + 166)
-#define IMG_OO_DATABASE_DOC (IMAGELIST_START + 169)
-#define IMG_OO_DRAW_DOC (IMAGELIST_START + 170)
-#define IMG_OO_MATH_DOC (IMAGELIST_START + 171)
-#define IMG_OO_GLOBAL_DOC   (IMAGELIST_START + 172)
-#define IMG_OO_IMPRESS_DOC  (IMAGELIST_START + 173)
-#define IMG_OO_CALC_DOC (IMAGELIST_START + 174)
-#define IMG_OO_WRITER_DOC   (IMAGELIST_START + 175)
-#define IMG_OO_DRAW_TEMPLATE(IMAGELIST_START + 176)
-#define IMG_OO_IMPRESS_TEMPLATE (IMAGELIST_START + 177)
-#define IMG_OO_CALC_TEMPLATE(IMAGELIST_START + 178)
-#define IMG_OO_WRITER_TEMPLATE  (IMAGELIST_START + 179)
-#define IMG_EXTENSION   (IMAGELIST_START + 180)
+enum class SvImageId {
+NONE   =0,
+START  = 3076,  // must match to old Id's in SFX!
+
+Impress= START + 47,
+Bitmap = START + 49,
+Calc   = START + 50,
+CalcTemplate   = START + 51,
+Database   = START + 53,
+ImpressTemplate= START + 54,
+GIF= START + 61,
+HTML   = START + 63,
+JPG= START + 64,
+Math   = START + 68,
+MathTemplate   = START + 69,
+File   = START + 74,
+PCD= START + 76,
+PCT= START + 77,
+PCX= START + 78,
+SIM= START + 79,
+TextFile   = START + 80,
+TIFF   = START + 82,
+WMF= 

[Libreoffice-commits] core.git: include/svtools svtools/source

2017-07-20 Thread Jochen Nitschke
 include/svtools/calendar.hxx|2 +-
 svtools/source/control/calendar.cxx |   17 -
 2 files changed, 9 insertions(+), 10 deletions(-)

New commits:
commit 102b01c80a271ccaec226d7b0bcc960917ea6b57
Author: Jochen Nitschke 
Date:   Thu Jul 20 17:34:46 2017 +0200

change some Date += long to Date += sal_Int32

found by adding
 Date& operator+=(long) = delete;
to Date class

Change-Id: I0e6b59a2e789f2bdf2f271b99d10c6acbae8bf55
Reviewed-on: https://gerrit.libreoffice.org/40241
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/svtools/calendar.hxx b/include/svtools/calendar.hxx
index e0c583e732a1..6cd7f153d5de 100644
--- a/include/svtools/calendar.hxx
+++ b/include/svtools/calendar.hxx
@@ -176,7 +176,7 @@ private:
 Color*  mpStandardColor;
 Color*  mpSaturdayColor;
 Color*  mpSundayColor;
-sal_uLong   mnDayCount;
+sal_Int32   mnDayCount;
 longmnDaysOffX;
 longmnWeekDayOffY;
 longmnDaysOffY;
diff --git a/svtools/source/control/calendar.cxx 
b/svtools/source/control/calendar.cxx
index f48bff13eb1c..324a548b0bf2 100644
--- a/svtools/source/control/calendar.cxx
+++ b/svtools/source/control/calendar.cxx
@@ -418,7 +418,7 @@ void Calendar::ImplFormat()
 maFirstDate = aTempDate;
 nWeekDay = (sal_uInt16)aTempDate.GetDayOfWeek();
 nWeekDay = (nWeekDay+(7-(sal_uInt16)eStartDay)) % 7;
-maFirstDate -= (sal_uLong)nWeekDay;
+maFirstDate -= static_cast(nWeekDay);
 mnDayCount = nWeekDay;
 sal_uInt16 nDaysInMonth;
 sal_uInt16 nMonthCount = (sal_uInt16)(mnMonthPerLine*mnLines);
@@ -981,7 +981,7 @@ void Calendar::ImplUpdateSelection( IntDateSet* pOld )
 
 for ( IntDateSet::const_iterator it = pOld->begin(); it != pOld->end(); 
++it )
 {
-sal_uLong nKey = *it;
+sal_Int32 nKey = *it;
 if ( pNew->find( nKey ) == pNew->end() )
 {
 Date aTempDate( nKey );
@@ -991,7 +991,7 @@ void Calendar::ImplUpdateSelection( IntDateSet* pOld )
 
 for ( IntDateSet::const_iterator it = pNew->begin(); it != pNew->end(); 
++it )
 {
-sal_uLong nKey = *it;
+sal_Int32 nKey = *it;
 if ( pOld->find( nKey ) == pOld->end() )
 {
 Date aTempDate( nKey );
@@ -1256,8 +1256,7 @@ void Calendar::ImplEndTracking( bool bCancel )
 if ( !bCancel )
 {
 // determine if we should scroll the visible area
-sal_uLong nSelCount = mpSelectTable->size();
-if ( nSelCount )
+if ( !mpSelectTable->empty() )
 {
 Date aFirstSelDate( *mpSelectTable->begin() );
 Date aLastSelDate( *mpSelectTable->rbegin() );
@@ -1695,7 +1694,7 @@ void Calendar::SetCurDate( const Date& rNewDate )
 while ( nDateOff > aTempDate.GetDaysInMonth() )
 {
 aFirstDate += aFirstDate.GetDaysInMonth();
-long nDaysInMonth = aTempDate.GetDaysInMonth();
+sal_Int32 nDaysInMonth = aTempDate.GetDaysInMonth();
 aTempDate += nDaysInMonth;
 nDateOff -= nDaysInMonth;
 }
@@ -1779,7 +1778,7 @@ tools::Rectangle Calendar::GetDateRect( const Date& rDate 
) const
 
 longnX;
 longnY;
-sal_uLong   nDaysOff;
+sal_Int32   nDaysOff;
 sal_uInt16  nDayIndex;
 DateaDate = GetFirstMonth();
 
@@ -1787,7 +1786,7 @@ tools::Rectangle Calendar::GetDateRect( const Date& rDate 
) const
 {
 aRect = GetDateRect( aDate );
 nDaysOff = aDate-rDate;
-nX = (long)(nDaysOff*mnDayWidth);
+nX = nDaysOff*mnDayWidth;
 aRect.Left() -= nX;
 aRect.Right() -= nX;
 return aRect;
@@ -1803,7 +1802,7 @@ tools::Rectangle Calendar::GetDateRect( const Date& rDate 
) const
 aRect = GetDateRect( aLastDate );
 nDaysOff = rDate-aLastDate;
 nDayIndex = 0;
-for ( sal_uLong i = 0; i <= nDaysOff; i++ )
+for ( sal_Int32 i = 0; i <= nDaysOff; i++ )
 {
 if ( aLastDate == rDate )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2017-06-22 Thread Muhammet Kara
 include/svtools/treelistbox.hxx   |4 
 svtools/source/contnr/treelistbox.cxx |5 +
 2 files changed, 9 insertions(+)

New commits:
commit 89594b646eb53df91329d5e68cba068b1ec49492
Author: Muhammet Kara 
Date:   Mon Jun 19 16:50:50 2017 +0300

Add RemoveEntry method to SvTreeListBox

Allows you to remove an entry along with its children
without selecting the entry.

Change-Id: Ie833df5e0d2d3bc86ed01a70dc6f042ebb6d6a47
Reviewed-on: https://gerrit.libreoffice.org/38971
Tested-by: Jenkins 
Reviewed-by: Eike Rathke 

diff --git a/include/svtools/treelistbox.hxx b/include/svtools/treelistbox.hxx
index 3bc9168cbc00..5080ebcff5df 100644
--- a/include/svtools/treelistbox.hxx
+++ b/include/svtools/treelistbox.hxx
@@ -380,6 +380,10 @@ public:
 boolCopySelection( SvTreeListBox* pSource, SvTreeListEntry* 
pTarget );
 boolMoveSelectionCopyFallbackPossible( SvTreeListBox* pSource, 
SvTreeListEntry* pTarget, bool bAllowCopyFallback );
 voidRemoveSelection();
+/**
+ * Removes the entry along with all of its descendants
+ */
+voidRemoveEntry(SvTreeListEntry* pEntry);
 
 DragDropModeGetDragDropMode() const { return nDragDropMode; }
 SelectionMode   GetSelectionMode() const { return eSelMode; }
diff --git a/svtools/source/contnr/treelistbox.cxx 
b/svtools/source/contnr/treelistbox.cxx
index 17da61af2333..0b728f512c38 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -676,6 +676,11 @@ void SvTreeListBox::RemoveSelection()
 pModel->Remove(*it);
 }
 
+void SvTreeListBox::RemoveEntry(SvTreeListEntry* pEntry)
+{
+pModel->Remove(pEntry);
+}
+
 void SvTreeListBox::RecalcViewData()
 {
 SvTreeListEntry* pEntry = First();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2017-06-08 Thread Gabor Kelemen
 include/svtools/svtools.hrc |   15 +++-
 svtools/source/control/ctrltool.cxx |   32 +
 svtools/source/control/ctrltool.src |   65 
 3 files changed, 110 insertions(+), 2 deletions(-)

New commits:
commit f5eae04d7af0ae165ee7045bf5fa101ee681aebf
Author: Gabor Kelemen 
Date:   Wed Jun 7 00:43:06 2017 +0200

tdf#107700 Translate some less common font style names

These are used in at least on of the free fonts we bundle.
Also translate a stray German comment :)

Change-Id: I3f4d83001bcfc3a8b3d490e56d9e538a8d892f0c
Reviewed-on: https://gerrit.libreoffice.org/38476
Tested-by: Jenkins 
Reviewed-by: Katarina Behrens 

diff --git a/include/svtools/svtools.hrc b/include/svtools/svtools.hrc
index 2873c5f026ad..70186f41fabb 100644
--- a/include/svtools/svtools.hrc
+++ b/include/svtools/svtools.hrc
@@ -114,7 +114,20 @@
 #define STR_SVT_STYLE_BOLD_ITALIC   (STR_SVT_STYLE_START+5)
 #define STR_SVT_STYLE_BLACK (STR_SVT_STYLE_START+6)
 #define STR_SVT_STYLE_BLACK_ITALIC  (STR_SVT_STYLE_START+7)
-#define STR_SVT_STYLE_END   (STR_SVT_STYLE_BLACK_ITALIC)
+#define STR_SVT_STYLE_BOOK  (STR_SVT_STYLE_START+8)
+#define STR_SVT_STYLE_BOLD_OBLIQUE  (STR_SVT_STYLE_START+9)
+#define STR_SVT_STYLE_CONDENSED (STR_SVT_STYLE_START+10)
+#define STR_SVT_STYLE_CONDENSED_BOLD(STR_SVT_STYLE_START+11)
+#define STR_SVT_STYLE_CONDENSED_BOLD_ITALIC (STR_SVT_STYLE_START+12)
+#define STR_SVT_STYLE_CONDENSED_BOLD_OBLIQUE (STR_SVT_STYLE_START+13)
+#define STR_SVT_STYLE_CONDENSED_ITALIC  (STR_SVT_STYLE_START+14)
+#define STR_SVT_STYLE_CONDENSED_OBLIQUE (STR_SVT_STYLE_START+15)
+#define STR_SVT_STYLE_EXTRALIGHT(STR_SVT_STYLE_START+16)
+#define STR_SVT_STYLE_EXTRALIGHT_ITALIC (STR_SVT_STYLE_START+17)
+#define STR_SVT_STYLE_OBLIQUE   (STR_SVT_STYLE_START+18)
+#define STR_SVT_STYLE_SEMIBOLD  (STR_SVT_STYLE_START+19)
+#define STR_SVT_STYLE_SEMIBOLD_ITALIC   (STR_SVT_STYLE_START+20)
+#define STR_SVT_STYLE_END   (STR_SVT_STYLE_SEMIBOLD_ITALIC)
 
 #define STR_SVT_FONTMAP_START   (STR_SVT_STYLE_END+1)
 #define STR_SVT_FONTMAP_BOTH(STR_SVT_FONTMAP_START+0)
diff --git a/svtools/source/control/ctrltool.cxx 
b/svtools/source/control/ctrltool.cxx
index 0aeb07318966..c4ab3de8dbcf 100644
--- a/svtools/source/control/ctrltool.cxx
+++ b/svtools/source/control/ctrltool.cxx
@@ -35,7 +35,7 @@
 #include 
 #include 
 
-// Standard Fontgroessen fuer scalierbare Fonts
+// Standard fontsizes for scalable Fonts
 const sal_IntPtr FontList::aStdSizeAry[] =
 {
  60,
@@ -463,6 +463,36 @@ OUString FontList::GetStyleName(const FontMetric& rInfo) 
const
 aStyleName = maBlack;
 else if (aCompareStyleName == "blackitalic")
 aStyleName = maBlackItalic;
+/* tdf#107700 support some less common style names with localization */
+else if (aCompareStyleName == "book")
+aStyleName = SvtResId(STR_SVT_STYLE_BOOK);
+else if (aCompareStyleName == "boldoblique")
+aStyleName = SvtResId(STR_SVT_STYLE_BOLD_OBLIQUE);
+else if (aCompareStyleName == "condensed")
+aStyleName = SvtResId(STR_SVT_STYLE_CONDENSED);
+else if (aCompareStyleName == "condensedbold")
+aStyleName = SvtResId(STR_SVT_STYLE_CONDENSED_BOLD);
+else if (aCompareStyleName == "condensedbolditalic")
+aStyleName = SvtResId(STR_SVT_STYLE_CONDENSED_BOLD_ITALIC);
+else if (aCompareStyleName == "condensedboldoblique")
+aStyleName = SvtResId(STR_SVT_STYLE_CONDENSED_BOLD_OBLIQUE);
+else if (aCompareStyleName == "condenseditalic")
+aStyleName = SvtResId(STR_SVT_STYLE_CONDENSED_ITALIC);
+else if (aCompareStyleName == "condensedoblique")
+aStyleName = SvtResId(STR_SVT_STYLE_CONDENSED_OBLIQUE);
+else if (aCompareStyleName == "extralight")
+aStyleName = SvtResId(STR_SVT_STYLE_EXTRALIGHT);
+else if (aCompareStyleName == "extralightitalic")
+aStyleName = SvtResId(STR_SVT_STYLE_EXTRALIGHT_ITALIC);
+/* Medium is synonym with Normal */
+else if (aCompareStyleName == "mediumitalic")
+aStyleName = maNormalItalic;
+else if (aCompareStyleName == "oblique")
+aStyleName = SvtResId(STR_SVT_STYLE_OBLIQUE);
+else if (aCompareStyleName == "semibold")
+aStyleName = SvtResId(STR_SVT_STYLE_SEMIBOLD);
+else if (aCompareStyleName == "semibolditalic")
+aStyleName = SvtResId(STR_SVT_STYLE_SEMIBOLD_ITALIC);
 
 // fix up StyleName, because the PS Printer driver from
 // W2000 returns wrong StyleNames (e.g. Bold instead of Bold Italic
diff --git a/svtools/source/control/ctrltool.src 

[Libreoffice-commits] core.git: include/svtools svtools/source

2017-05-12 Thread Jochen Nitschke
 include/svtools/imap.hxx  |4 ++--
 include/svtools/svparser.hxx  |2 +-
 svtools/source/misc/imap2.cxx |2 +-
 svtools/source/misc/imap3.cxx |4 ++--
 svtools/source/svhtml/parhtml.cxx |   22 +++---
 svtools/source/svrtf/svparser.cxx |2 +-
 svtools/source/urlobj/inetimg.cxx |3 ++-
 7 files changed, 20 insertions(+), 19 deletions(-)

New commits:
commit 05d3a1899eb50202fd3929b702bae1003b5610be
Author: Jochen Nitschke 
Date:   Thu May 11 15:53:08 2017 +0200

tdf#75280 replace uses of sal_uLong

those vars get their type from SvStream which uses sal_uInt64

Change-Id: Ia356699bb0f5e9787ae6f02e52e0b00cc2f817b1
Reviewed-on: https://gerrit.libreoffice.org/37547
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/svtools/imap.hxx b/include/svtools/imap.hxx
index ecb5b09edfc1..0b30c6183596 100644
--- a/include/svtools/imap.hxx
+++ b/include/svtools/imap.hxx
@@ -118,8 +118,8 @@ public:
 class IMapCompat
 {
 SvStream*   pRWStm;
-sal_uLong   nCompatPos;
-sal_uLong   nTotalSize;
+sal_uInt64  nCompatPos;
+sal_uInt64  nTotalSize;
 StreamMode  nStmMode;
 
 IMapCompat( const IMapCompat& ) = delete;
diff --git a/include/svtools/svparser.hxx b/include/svtools/svparser.hxx
index 136eb3a42573..2faa184d7643 100644
--- a/include/svtools/svparser.hxx
+++ b/include/svtools/svparser.hxx
@@ -60,7 +60,7 @@ protected:
 
 rtl_TextEncodingeSrcEnc;// Source encoding
 
-sal_uLong   nNextChPos;
+sal_uInt64  nNextChPos;
 sal_uInt32  nNextCh;// current character codepoint in 
UTF32 for the "lex"
 
 boolbUCS2BSrcEnc : 1;   // or as big-endian UCS2
diff --git a/svtools/source/misc/imap2.cxx b/svtools/source/misc/imap2.cxx
index e9ccd365606d..e60174de0dab 100644
--- a/svtools/source/misc/imap2.cxx
+++ b/svtools/source/misc/imap2.cxx
@@ -501,7 +501,7 @@ Point ImageMap::ImpReadNCSACoords( const char** ppStr )
 
 sal_uLong ImageMap::ImpDetectFormat( SvStream& rIStm )
 {
-sal_uLong   nPos = rIStm.Tell();
+sal_uInt64  nPos = rIStm.Tell();
 sal_uLong   nRet = IMAP_FORMAT_BIN;
 charcMagic[6];
 
diff --git a/svtools/source/misc/imap3.cxx b/svtools/source/misc/imap3.cxx
index 49e8dd9b4aba..cef90050650d 100644
--- a/svtools/source/misc/imap3.cxx
+++ b/svtools/source/misc/imap3.cxx
@@ -67,7 +67,7 @@ IMapCompat::~IMapCompat()
 {
 if ( nStmMode == StreamMode::WRITE )
 {
-const sal_uLong nEndPos = pRWStm->Tell();
+const sal_uInt64 nEndPos = pRWStm->Tell();
 
 pRWStm->Seek( nCompatPos );
 pRWStm->WriteUInt32( nEndPos - nTotalSize );
@@ -75,7 +75,7 @@ IMapCompat::~IMapCompat()
 }
 else
 {
-const sal_uLong nReadSize = pRWStm->Tell() - nCompatPos;
+const sal_uInt64 nReadSize = pRWStm->Tell() - nCompatPos;
 
 if ( nTotalSize > nReadSize )
 pRWStm->SeekRel( nTotalSize - nReadSize );
diff --git a/svtools/source/svhtml/parhtml.cxx 
b/svtools/source/svhtml/parhtml.cxx
index f7daee079cb1..aaee085dd267 100644
--- a/svtools/source/svhtml/parhtml.cxx
+++ b/svtools/source/svhtml/parhtml.cxx
@@ -374,7 +374,7 @@ HtmlTokenId HTMLParser::ScanText( const sal_Unicode cBreak )
 sTmpBuffer.append( '&' );
 else
 {
-sal_uLong nStreamPos = rInput.Tell();
+sal_uInt64 nStreamPos = rInput.Tell();
 sal_uLong nLinePos = GetLinePos();
 
 sal_uInt32 cChar = 0U;
@@ -459,7 +459,7 @@ HtmlTokenId HTMLParser::ScanText( const sal_Unicode cBreak )
 if( 0U == cChar && ';' != nNextCh )
 {
 DBG_ASSERT( rInput.Tell() - nStreamPos ==
-(sal_uLong)(nPos+1L)*GetCharSize(),
+
static_cast(nPos+1)*GetCharSize(),
 "UTF-8 is failing here" );
 for( sal_Int32 i = nPos-1; i>1; i-- )
 {
@@ -469,8 +469,8 @@ HtmlTokenId HTMLParser::ScanText( const sal_Unicode cBreak )
 cChar = GetHTMLCharName( sEntity );
 if( cChar )
 {
-rInput.SeekRel( -(long)
-((nPos-i)*GetCharSize()) );
+rInput.SeekRel( -static_cast
+(nPos-i)*GetCharSize() );
 nlLinePos -= sal_uInt32(nPos-i);
 nPos = i;
 ClearTxtConvContext();
@@ -486,7 

[Libreoffice-commits] core.git: include/svtools svtools/source

2017-05-09 Thread Stephan Bergmann
 include/svtools/DocumentInfoPreview.hxx   |1 -
 svtools/source/contnr/DocumentInfoPreview.cxx |4 +---
 2 files changed, 1 insertion(+), 4 deletions(-)

New commits:
commit 10b03e6ea8d93c5f47c68177fd73269a628e630d
Author: Stephan Bergmann 
Date:   Tue May 9 08:55:45 2017 +0200

-Werror,-Wunused-private-field

Change-Id: Id42e8699f5cfb420d49f7223ee288090539f2492

diff --git a/include/svtools/DocumentInfoPreview.hxx 
b/include/svtools/DocumentInfoPreview.hxx
index c4e48d697a12..f071fdaf568f 100644
--- a/include/svtools/DocumentInfoPreview.hxx
+++ b/include/svtools/DocumentInfoPreview.hxx
@@ -55,7 +55,6 @@ public:
 private:
 VclPtr m_pEditWin;
 std::unique_ptr< SvtDocInfoTable_Impl > m_xInfoTable;
-LanguageTag m_aLanguageTag;
 
 void insertEntry(OUString const & title, OUString const & value);
 
diff --git a/svtools/source/contnr/DocumentInfoPreview.cxx 
b/svtools/source/contnr/DocumentInfoPreview.cxx
index f8f2c9a1742b..7b44cb4f69d2 100644
--- a/svtools/source/contnr/DocumentInfoPreview.cxx
+++ b/svtools/source/contnr/DocumentInfoPreview.cxx
@@ -37,7 +37,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include "fileview.hxx"
@@ -49,8 +48,7 @@ namespace svtools {
 ODocumentInfoPreview::ODocumentInfoPreview(vcl::Window * pParent, WinBits 
nBits):
 Window(pParent, WB_DIALOGCONTROL),
 m_pEditWin( VclPtr::Create(this, nBits) ),
-m_xInfoTable(new SvtDocInfoTable_Impl),
-m_aLanguageTag(SvtPathOptions().GetLanguageTag()) // detect application 
language
+m_xInfoTable(new SvtDocInfoTable_Impl)
 {
 m_pEditWin->SetLeftMargin(10);
 m_pEditWin->Show();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2017-04-24 Thread Gabor Kelemen
 include/svtools/soerr.hxx |   28 ---
 svtools/source/dialogs/so3res.src |   56 --
 2 files changed, 84 deletions(-)

New commits:
commit 1c8f03b48a02a56bc4eb364d8a4e9bd4715a530a
Author: Gabor Kelemen 
Date:   Sun Apr 23 21:15:30 2017 +0200

Drop unused string resources from svtools/soerr.hxx

Change-Id: If3060b101dc0692f47d9d5eaf649bce60965b04f
Reviewed-on: https://gerrit.libreoffice.org/36864
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/svtools/soerr.hxx b/include/svtools/soerr.hxx
index c44f9e2b4dfb..4f02c70cfecd 100644
--- a/include/svtools/soerr.hxx
+++ b/include/svtools/soerr.hxx
@@ -28,39 +28,11 @@
 #define SO_WRN() (ERRCODE_AREA_SO | ERRCODE_CLASS_SO | ERRCODE_WARNING_MASK)
 
 #define ERRCODE_SO_GENERALERROR (SO_ERR() | 1)
-#define ERRCODE_SO_CANT_BINDTOSOURCE(SO_ERR() | 2)
-#define ERRCODE_SO_NOCACHE_UPDATED  (SO_ERR() | 3)
-#define ERRCODE_SO_SOMECACHES_NOTUPDATED(SO_WRN() | 4)
-#define ERRCODE_SO_MK_UNAVAILABLE   (SO_ERR() | 5)
-#define ERRCODE_SO_E_CLASSDIFF  (SO_ERR() | 6)
-#define ERRCODE_SO_MK_NO_OBJECT (SO_ERR() | 7)
-#define ERRCODE_SO_MK_EXCEEDED_DEADLINE (SO_ERR() | 8)
-#define ERRCODE_SO_MK_CONNECT_MANUALLY  (SO_ERR() | 9)
-#define ERRCODE_SO_MK_INTERMEDIATE_INTERFACE_NOT_SUPPORTED  (SO_ERR() | 10)
-#define ERRCODE_SO_NO_INTERFACE (SO_ERR() | 11)
-#define ERRCODE_SO_OUT_OF_MEMORY(SO_ERR() | 12)
-#define ERRCODE_SO_MK_SYNTAX(SO_ERR() | 13)
-#define ERRCODE_SO_MK_REDUCED_TO_SELF   (SO_WRN() | 14)
-#define ERRCODE_SO_MK_NO_INVERSE(SO_ERR() | 15)
-#define ERRCODE_SO_MK_NO_PREFIX (SO_ERR() | 16)
-#define ERRCODE_SO_MK_HIM   (SO_WRN() | 17)
-#define ERRCODE_SO_MK_US(SO_WRN() | 18)
-#define ERRCODE_SO_MK_ME(SO_WRN() | 19)
-#define ERRCODE_SO_MK_NOT_BINDABLE  (SO_ERR() | 20)
-#define ERRCODE_SO_NOT_IMPLEMENTED  (SO_ERR() | 21)
-#define ERRCODE_SO_MK_NO_STORAGE(SO_ERR() | 22)
 #define ERRCODE_SO_FALSE(SO_WRN() | 23)
-#define ERRCODE_SO_MK_NEED_GENERIC  (SO_ERR() | 24)
 #define ERRCODE_SO_PENDING  (SO_ERR() | 25)
-#define ERRCODE_SO_NOT_INPLACEACTIVE(SO_ERR() | 26)
-#define ERRCODE_SO_LINDEX   (SO_ERR() | 27)
 #define ERRCODE_SO_CANNOT_DOVERB_NOW(SO_WRN() | 28)
-#define ERRCODE_SO_OLEOBJ_INVALIDHWND   (SO_WRN() | 29)
 #define ERRCODE_SO_NOVERBS  (SO_ERR() | 30)
-#define ERRCODE_SO_INVALIDVERB  (SO_WRN() | 31)
-#define ERRCODE_SO_MK_CONNECT   (SO_ERR() | 32)
 #define ERRCODE_SO_NOTIMPL  (SO_ERR() | 33)
-#define ERRCODE_SO_MK_CANTOPENFILE  (SO_ERR() | 34)
 
 // error contexts
 #define RID_SO_ERRCTX   32001
diff --git a/svtools/source/dialogs/so3res.src 
b/svtools/source/dialogs/so3res.src
index 38dcb1780969..3ffd4cb482f7 100644
--- a/svtools/source/dialogs/so3res.src
+++ b/svtools/source/dialogs/so3res.src
@@ -28,72 +28,16 @@ StringArray RID_SO_ERROR_HANDLER
 {
 < "General OLE error." ;
   ERRCODE_SO_GENERALERROR_MAX ; >;
-< "The connection to the object cannot be established." ;
-  ERRCODE_SO_CANT_BINDTOSOURCE_MAX ; >;
-< "No cache files were updated." ;
-  ERRCODE_SO_NOCACHE_UPDATED_MAX ; >;
-< "Some cache files were not updated." ;
-  ERRCODE_SO_SOMECACHES_NOTUPDATED_MAX ; >;
-< "Status of object cannot be determined in a timely manner." ;
-  ERRCODE_SO_MK_UNAVAILABLE_MAX ; >;
-< "Source of the OLE link has been converted." ;
-  ERRCODE_SO_E_CLASSDIFF_MAX ; >;
-< "The object could not be found." ;
-  ERRCODE_SO_MK_NO_OBJECT_MAX ; >;
-< "The process could not be completed within the specified time 
period." ;
-  ERRCODE_SO_MK_EXCEEDED_DEADLINE_MAX ; >;
-< "OLE could not connect to a network device (server)." ;
-  ERRCODE_SO_MK_CONNECT_MANUALLY_MAX ; >;
-< "The object found does not support the interface required for the 
desired operation." ;
-  ERRCODE_SO_MK_INTERMEDIATE_INTERFACE_NOT_SUPPORTED_MAX ; >;
-< "Interface not supported." ;
-  ERRCODE_SO_NO_INTERFACE_MAX ; >;
-< "Insufficient memory." ;
-  ERRCODE_SO_OUT_OF_MEMORY_MAX ; >;
-< "The connection name could not be processed." ;
-  ERRCODE_SO_MK_SYNTAX_MAX ; >;
-< "The connection name could not be reduced further." ;
-  ERRCODE_SO_MK_REDUCED_TO_SELF_MAX ; >;
-< "The connection name has no inverse." ;
-  ERRCODE_SO_MK_NO_INVERSE_MAX ; >;
-< "No common prefix exists." ;
-  ERRCODE_SO_MK_NO_PREFIX_MAX ; >;
-< "The connection name is 

[Libreoffice-commits] core.git: include/svtools svtools/source

2017-04-10 Thread Noel Grandin
 include/svtools/openfiledroptargetlistener.hxx |2 +-
 svtools/source/misc/openfiledroptargetlistener.cxx |   11 ---
 2 files changed, 5 insertions(+), 8 deletions(-)

New commits:
commit 1b921c2f1ba4bba7e69565fb29cb1738cea25497
Author: Noel Grandin 
Date:   Mon Apr 10 09:42:49 2017 +0200

loplugin:inlinefields in OpenFileDropTargetListener

Change-Id: Ib1f7004ce57f144309d396bc71419f3d1036ff74
Reviewed-on: https://gerrit.libreoffice.org/36353
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/svtools/openfiledroptargetlistener.hxx 
b/include/svtools/openfiledroptargetlistener.hxx
index af00e9bc769c..88e7dbe4da71 100644
--- a/include/svtools/openfiledroptargetlistener.hxx
+++ b/include/svtools/openfiledroptargetlistener.hxx
@@ -45,7 +45,7 @@ class SVT_DLLPUBLIC OpenFileDropTargetListener : public 
cppu::WeakImplHelper< cs
 css::uno::WeakReference< css::frame::XFrame > m_xTargetFrame;
 
 /// drag/drop info
-DataFlavorExVector* m_pFormats;
+DataFlavorExVector m_aFormats;
 
 public:
 OpenFileDropTargetListener( const css::uno::Reference< 
css::uno::XComponentContext >& xContext,
diff --git a/svtools/source/misc/openfiledroptargetlistener.cxx 
b/svtools/source/misc/openfiledroptargetlistener.cxx
index df4d03b67474..802d326f480f 100644
--- a/svtools/source/misc/openfiledroptargetlistener.cxx
+++ b/svtools/source/misc/openfiledroptargetlistener.cxx
@@ -37,7 +37,6 @@ OpenFileDropTargetListener::OpenFileDropTargetListener( const 
css::uno::Referenc
 const css::uno::Reference< 
css::frame::XFrame >&  xFrame  )
 : m_xContext  ( xContext  )
 , m_xTargetFrame  ( xFrame)
-, m_pFormats  ( new DataFlavorExVector)
 {
 }
 
@@ -46,8 +45,6 @@ OpenFileDropTargetListener::~OpenFileDropTargetListener()
 {
 m_xTargetFrame.clear();
 m_xContext.clear();
-delete m_pFormats;
-m_pFormats = nullptr;
 }
 
 
@@ -145,8 +142,8 @@ void OpenFileDropTargetListener::implts_BeginDrag( const 
css::uno::Sequence< css
 /* SAFE { */
 SolarMutexGuard aGuard;
 
-m_pFormats->clear();
-
TransferableDataHelper::FillDataFlavorExVector(rSupportedDataFlavors,*m_pFormats);
+m_aFormats.clear();
+TransferableDataHelper::FillDataFlavorExVector(rSupportedDataFlavors, 
m_aFormats);
 /* } SAFE */
 }
 
@@ -155,7 +152,7 @@ void OpenFileDropTargetListener::implts_EndDrag()
 /* SAFE { */
 SolarMutexGuard aGuard;
 
-m_pFormats->clear();
+m_aFormats.clear();
 /* } SAFE */
 }
 
@@ -164,7 +161,7 @@ bool 
OpenFileDropTargetListener::implts_IsDropFormatSupported( SotClipboardForma
 /* SAFE { */
 SolarMutexGuard aGuard;
 
-DataFlavorExVector::iterator aIter( m_pFormats->begin() ), aEnd( 
m_pFormats->end() );
+DataFlavorExVector::iterator aIter( m_aFormats.begin() ), aEnd( 
m_aFormats.end() );
 bool bRet = false;
 
 while ( aIter != aEnd )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2017-03-09 Thread Stephan Bergmann
 include/svtools/brwbox.hxx|2 
 svtools/source/brwbox/brwbox1.cxx |  138 ++
 svtools/source/brwbox/brwbox2.cxx |  108 ++---
 svtools/source/brwbox/datwin.cxx  |   16 ++--
 4 files changed, 131 insertions(+), 133 deletions(-)

New commits:
commit 5b25275002e12d2c9794ca0dd014e5d25efe486e
Author: Stephan Bergmann 
Date:   Thu Mar 9 18:26:40 2017 +0100

No need for extra heap allocation

Change-Id: I0844a0a8a3476cdb007ab1d587b15ce26c68783e

diff --git a/include/svtools/brwbox.hxx b/include/svtools/brwbox.hxx
index 4e9f2df..fd6b18b 100644
--- a/include/svtools/brwbox.hxx
+++ b/include/svtools/brwbox.hxx
@@ -240,7 +240,7 @@ private:
 TriStatebHideCursor;// hide cursor (frame)
 Range   aSelRange;  // for selection expansion
 
-BrowserColumns* pCols;  // array of column-descriptions
+BrowserColumns pCols;   // array of column-descriptions
 union
 {
 MultiSelection* pSel;   // selected rows for multi-selection
diff --git a/svtools/source/brwbox/brwbox1.cxx 
b/svtools/source/brwbox/brwbox1.cxx
index c4a0ab9..35ff282 100644
--- a/svtools/source/brwbox/brwbox1.cxx
+++ b/svtools/source/brwbox/brwbox1.cxx
@@ -63,7 +63,6 @@ void BrowseBox::ConstructImpl( BrowserMode nMode )
 pColSel = nullptr;
 pVScroll = nullptr;
 pDataWin = VclPtr::Create( this ).get();
-pCols = new BrowserColumns;
 m_pImpl.reset( new ::svt::BrowseBoxImpl() );
 
 aGridLineColor = Color( COL_LIGHTGRAY );
@@ -140,10 +139,9 @@ void BrowseBox::dispose()
 aHScroll.disposeAndClear();
 
 // free columns-space
-for (BrowserColumn* pCol : *pCols)
+for (BrowserColumn* pCol : pCols)
 delete pCol;
-pCols->clear();
-delete pCols;
+pCols.clear();
 delete pColSel;
 if ( bMultiSelection )
 delete uRow.pSel;
@@ -220,17 +218,17 @@ void BrowseBox::InsertHandleColumn( sal_uLong nWidth )
 {
 
 #if OSL_DEBUG_LEVEL > 0
-OSL_ENSURE( ColCount() == 0 || (*pCols)[0]->GetId() != HandleColumnId , 
"BrowseBox::InsertHandleColumn: there is already a handle column" );
+OSL_ENSURE( ColCount() == 0 || pCols[0]->GetId() != HandleColumnId , 
"BrowseBox::InsertHandleColumn: there is already a handle column" );
 {
-BrowserColumns::iterator iCol = pCols->begin();
-const BrowserColumns::iterator colsEnd = pCols->end();
+BrowserColumns::iterator iCol = pCols.begin();
+const BrowserColumns::iterator colsEnd = pCols.end();
 if ( iCol != colsEnd )
 for (++iCol; iCol != colsEnd; ++iCol)
 OSL_ENSURE( (*iCol)->GetId() != HandleColumnId, 
"BrowseBox::InsertHandleColumn: there is a non-Handle column with handle ID" );
 }
 #endif
 
-pCols->insert( pCols->begin(), new BrowserColumn( 0, OUString(), nWidth, 
GetZoom() ) );
+pCols.insert( pCols.begin(), new BrowserColumn( 0, OUString(), nWidth, 
GetZoom() ) );
 FreezeColumn( 0 );
 
 // adjust headerbar
@@ -255,21 +253,21 @@ void BrowseBox::InsertDataColumn( sal_uInt16 nItemId, 
const OUString& rText,
 
 #if OSL_DEBUG_LEVEL > 0
 {
-const BrowserColumns::iterator colsEnd = pCols->end();
-for (BrowserColumns::iterator iCol = pCols->begin(); iCol != colsEnd; 
++iCol)
+const BrowserColumns::iterator colsEnd = pCols.end();
+for (BrowserColumns::iterator iCol = pCols.begin(); iCol != colsEnd; 
++iCol)
 OSL_ENSURE( (*iCol)->GetId() != nItemId, 
"BrowseBox::InsertDataColumn: duplicate column Id" );
 }
 #endif
 
-if ( nPos < pCols->size() )
+if ( nPos < pCols.size() )
 {
-BrowserColumns::iterator it = pCols->begin();
+BrowserColumns::iterator it = pCols.begin();
 ::std::advance( it, nPos );
-pCols->insert( it, new BrowserColumn( nItemId, rText, nWidth, 
GetZoom() ) );
+pCols.insert( it, new BrowserColumn( nItemId, rText, nWidth, GetZoom() 
) );
 }
 else
 {
-pCols->push_back( new BrowserColumn( nItemId, rText, nWidth, GetZoom() 
) );
+pCols.push_back( new BrowserColumn( nItemId, rText, nWidth, GetZoom() 
) );
 }
 if ( nCurColId == 0 )
 nCurColId = nItemId;
@@ -295,7 +293,7 @@ sal_uInt16 BrowseBox::ToggleSelectedColumn()
 ToggleSelection();
 long nSelected = pColSel->FirstSelected();
 if (nSelected != static_cast(SFX_ENDOFSELECTION))
-nSelectedColId = (*pCols)[nSelected]->GetId();
+nSelectedColId = pCols[nSelected]->GetId();
 pColSel->SelectAll(false);
 }
 return nSelectedColId;
@@ -316,30 +314,30 @@ void BrowseBox::FreezeColumn( sal_uInt16 nItemId )
 {
 // get the position in the current array
 size_t nItemPos = GetColumnPos( nItemId );
-if ( nItemPos >= pCols->size() )
+if ( nItemPos >= pCols.size() )
 // not available!
 return;
 
 // doesn't the state change?
-if ( 

[Libreoffice-commits] core.git: include/svtools svtools/source

2017-03-01 Thread Noel Grandin
 include/svtools/brwbox.hxx|   13 +
 svtools/source/brwbox/brwbox2.cxx |2 +-
 2 files changed, 2 insertions(+), 13 deletions(-)

New commits:
commit 60f612785477ab86fe580e4ba8b567a401e09985
Author: Noel Grandin 
Date:   Thu Mar 2 08:38:55 2017 +0200

don't need this STL hack anymore

Change-Id: Id0883060acf2ca73af5cce56e1cf9021c2fb121a

diff --git a/include/svtools/brwbox.hxx b/include/svtools/brwbox.hxx
index 266491a..4e9f2df 100644
--- a/include/svtools/brwbox.hxx
+++ b/include/svtools/brwbox.hxx
@@ -39,7 +39,6 @@ class BrowserColumn;
 class BrowserDataWin;
 class MultiSelection;
 class BrowserHeader;
-
 typedef ::std::vector< BrowserColumn* > BrowserColumns;
 
 namespace svt {
@@ -372,16 +371,11 @@ protected:
 
 longCalcReverseZoom(long nVal);
 
-inline const DataFlavorExVector&
+const DataFlavorExVector&
 GetDataFlavors() const;
 
 boolIsDropFormatSupported( SotClipboardFormatId nFormat ); 
// need this because the base class' IsDropFormatSupported is not const ...
 
-private:
-const DataFlavorExVector& implGetDataFlavors() const;
-// with this we can make GetDataFlavors() inline, which is strongly 
needed as SVTOOLS does not export
-// any sysmbol containing an "_STL", so a non-inlined method would not 
be exported 
-
 protected:
 // callbacks for the data window
 virtual voidImplStartTracking();
@@ -785,11 +779,6 @@ private:
 };
 
 
-inline const DataFlavorExVector& BrowseBox::GetDataFlavors() const
-{
-return implGetDataFlavors();
-}
-
 #endif // INCLUDED_SVTOOLS_BRWBOX_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/brwbox/brwbox2.cxx 
b/svtools/source/brwbox/brwbox2.cxx
index 8346f0f..f623b17 100644
--- a/svtools/source/brwbox/brwbox2.cxx
+++ b/svtools/source/brwbox/brwbox2.cxx
@@ -67,7 +67,7 @@ sal_Int8 BrowseBox::ExecuteDrop( const 
BrowserExecuteDropEvent& )
 }
 
 
-const DataFlavorExVector& BrowseBox::implGetDataFlavors() const
+const DataFlavorExVector& BrowseBox::GetDataFlavors() const
 {
 if (pDataWin->bCallingDropCallback)
 return pDataWin->GetDataFlavorExVector();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2017-02-20 Thread Caolán McNamara
 include/svtools/brwbox.hxx  |2 +-
 svtools/source/brwbox/brwbox1.cxx   |   10 --
 svtools/source/brwbox/editbrowsebox.cxx |   14 ++
 3 files changed, 15 insertions(+), 11 deletions(-)

New commits:
commit 917d5b8b26a7428f7b7dd495a8db14a3ce16aa55
Author: Caolán McNamara 
Date:   Mon Feb 20 16:51:17 2017 +

Resolves: tdf#97731 allow status bar to adapt to its own preferred size

Change-Id: I4390f61a21eef21371ce7399bf746e60234b8db8

diff --git a/include/svtools/brwbox.hxx b/include/svtools/brwbox.hxx
index 237ee5c..ae950f5 100644
--- a/include/svtools/brwbox.hxx
+++ b/include/svtools/brwbox.hxx
@@ -522,7 +522,7 @@ public:
 voidRowInserted( long nRow, long nNumRows = 1, bool bDoPaint = 
true, bool bKeepSelection = false );
 
 // miscellaneous
-voidReserveControlArea( sal_uInt16 nWidth = USHRT_MAX );
+boolReserveControlArea(sal_uInt16 nWidth = USHRT_MAX);
 Rectangle   GetControlArea() const;
 boolProcessKey( const KeyEvent& rEvt );
 voidDispatch( sal_uInt16 nId );
diff --git a/svtools/source/brwbox/brwbox1.cxx 
b/svtools/source/brwbox/brwbox1.cxx
index c16c1d6..c4a0ab9 100644
--- a/svtools/source/brwbox/brwbox1.cxx
+++ b/svtools/source/brwbox/brwbox1.cxx
@@ -2092,19 +2092,18 @@ sal_uInt16 BrowseBox::GetColumnAtXPosPixel( long nX, 
bool ) const
 return BROWSER_INVALIDID;
 }
 
-
-void BrowseBox::ReserveControlArea( sal_uInt16 nWidth )
+bool BrowseBox::ReserveControlArea(sal_uInt16 nWidth)
 {
-
-if ( nWidth != nControlAreaWidth )
+if (nWidth != nControlAreaWidth)
 {
 OSL_ENSURE(nWidth,"Control area of 0 is not allowed, Use USHRT_MAX 
instead!");
 nControlAreaWidth = nWidth;
 UpdateScrollbars();
+return true;
 }
+return false;
 }
 
-
 Rectangle BrowseBox::GetControlArea() const
 {
 
@@ -2114,7 +2113,6 @@ Rectangle BrowseBox::GetControlArea() const
  aHScroll->GetSizePixel().Height() ) );
 }
 
-
 void BrowseBox::SetMode( BrowserMode nMode )
 {
 
diff --git a/svtools/source/brwbox/editbrowsebox.cxx 
b/svtools/source/brwbox/editbrowsebox.cxx
index d81d10d..5812171 100644
--- a/svtools/source/brwbox/editbrowsebox.cxx
+++ b/svtools/source/brwbox/editbrowsebox.cxx
@@ -1091,7 +1091,6 @@ namespace svt
 return nId;
 }
 
-
 void EditBrowseBox::Resize()
 {
 BrowseBox::Resize();
@@ -1110,15 +1109,22 @@ namespace svt
 
 if (!nX)
 nX = USHRT_MAX;
-ReserveControlArea((sal_uInt16)nX);
-}
 
+bool bChanged = ReserveControlArea(nX);
+
+//tdf#97731 if the reserved area changed size, give the controls a
+//chance to adapt to the new size
+if (bChanged)
+{
+nX = (sal_uInt16)aPoint.X();
+ArrangeControls(nX, (sal_uInt16)aPoint.Y());
+}
+}
 
 void EditBrowseBox::ArrangeControls(sal_uInt16&, sal_uInt16)
 {
 }
 
-
 CellController* EditBrowseBox::GetController(long, sal_uInt16)
 {
 return nullptr;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2017-02-08 Thread Andras Timar
 include/svtools/svtools.hrc|2 ++
 svtools/source/dialogs/PlaceEditDialog.cxx |2 +-
 svtools/source/misc/svtools.src|8 
 3 files changed, 11 insertions(+), 1 deletion(-)

New commits:
commit 21864fed063c1888323e14977fc73061d4905b80
Author: Andras Timar 
Date:   Wed Feb 8 11:12:25 2017 +0100

tdf#105814 enable localization of "host" and "port" in sample addresses

Change-Id: I2e58f4757bd86393410cdc6fd77205a8ebb9b917
Reviewed-on: https://gerrit.libreoffice.org/34021
Tested-by: Jenkins 
Reviewed-by: Andras Timar 

diff --git a/include/svtools/svtools.hrc b/include/svtools/svtools.hrc
index ce64c93..47ff7df 100644
--- a/include/svtools/svtools.hrc
+++ b/include/svtools/svtools.hrc
@@ -47,6 +47,8 @@
 #define STR_SVT_ESTIMATED_SIZE_PIX_1(RID_SVTOOLS_START + 39)
 #define STR_SVT_ESTIMATED_SIZE_PIX_2(RID_SVTOOLS_START + 40)
 #define STR_SVT_ESTIMATED_SIZE_VEC  (RID_SVTOOLS_START + 41)
+#define STR_SVT_HOST(RID_SVTOOLS_START + 42)
+#define STR_SVT_PORT(RID_SVTOOLS_START + 43)
 
 // FREE
 
diff --git a/svtools/source/dialogs/PlaceEditDialog.cxx 
b/svtools/source/dialogs/PlaceEditDialog.cxx
index edf7b3f..5c887e7 100644
--- a/svtools/source/dialogs/PlaceEditDialog.cxx
+++ b/svtools/source/dialogs/PlaceEditDialog.cxx
@@ -175,7 +175,7 @@ void PlaceEditDialog::InitDetails( )
 unsigned int nPos = 0;
 for ( sal_Int32 i = 0; i < aTypesUrlsList.getLength( ) && 
aTypesNamesList.getLength( ); ++i )
 {
-OUString sUrl = aTypesUrlsList[i];
+OUString sUrl = aTypesUrlsList[i].replaceFirst("",  SVT_RESSTR(STR_SVT_PORT) + 
">");
 
 if ((sUrl == GDRIVE_BASE_URL && bSkipGDrive) ||
 (sUrl.startsWith( ALFRESCO_CLOUD_BASE_URL) && bSkipAlfresco) ||
diff --git a/svtools/source/misc/svtools.src b/svtools/source/misc/svtools.src
index ff49b29..2604ecc 100644
--- a/svtools/source/misc/svtools.src
+++ b/svtools/source/misc/svtools.src
@@ -49,6 +49,14 @@ String STR_SVT_ESTIMATED_SIZE_VEC
 {
 Text [ en-US ] = "The file size is %1 KB.";
 };
+String STR_SVT_HOST
+{
+Text [ en-US ] = "host";
+};
+String STR_SVT_PORT
+{
+Text [ en-US ] = "port";
+};
 String STR_SVT_PRNDLG_READY
 {
 Text [ en-US ] = "Ready" ;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2017-01-13 Thread Noel Grandin
 include/svtools/grfmgr.hxx|2 +-
 svtools/source/graphic/grfmgr.cxx |5 -
 2 files changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 24fa5d0570b997cc92f1fdf412f517f8d4021207
Author: Noel Grandin 
Date:   Fri Jan 13 14:15:23 2017 +0200

better fix for tdf#101563: Export to PDF creates huge PDF files

Change-Id: Idda6a5ac824090e620fc6577fc82d5c5f1234b7e
Reviewed-on: https://gerrit.libreoffice.org/33037
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 

diff --git a/include/svtools/grfmgr.hxx b/include/svtools/grfmgr.hxx
index 18af820..b39e691 100644
--- a/include/svtools/grfmgr.hxx
+++ b/include/svtools/grfmgr.hxx
@@ -386,7 +386,7 @@ public:
 boolHasLink() const { return !maLink.isEmpty(); }
 voidSetLink();
 voidSetLink( const OUString& rLink );
-OUStringGetLink() const { return maLink; }
+const OUString& GetLink() const { return maLink; }
 
 boolHasUserData() const { return 
!maUserData.isEmpty(); }
 voidSetUserData();
diff --git a/svtools/source/graphic/grfmgr.cxx 
b/svtools/source/graphic/grfmgr.cxx
index ffaa93a..f818bad 100644
--- a/svtools/source/graphic/grfmgr.cxx
+++ b/svtools/source/graphic/grfmgr.cxx
@@ -647,8 +647,11 @@ void GraphicObject::SetGraphic( const Graphic& rGraphic, 
const GraphicObject* pC
 
 void GraphicObject::SetGraphic( const Graphic& rGraphic, const OUString& rLink 
)
 {
+// in case we are called from a situation where rLink and maLink are the 
same thing,
+// we need a copy because SetGraphic clears maLink
+OUString sLinkCopy = rLink;
 SetGraphic( rGraphic );
-maLink = rLink;
+maLink = sLinkCopy;
 }
 
 Graphic GraphicObject::GetTransformedGraphic( const Size& rDestSize, const 
MapMode& rDestMap, const GraphicAttr& rAttr ) const
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2017-01-11 Thread Caolán McNamara
 include/svtools/grfmgr.hxx|1 
 svtools/source/graphic/grfmgr.cxx |   53 +++---
 2 files changed, 21 insertions(+), 33 deletions(-)

New commits:
commit 4ff1b3589076f66c3d783c3ea6c5f1fd9b9337ed
Author: Caolán McNamara 
Date:   Wed Jan 11 09:32:20 2017 +

fold ImplConstruct into ctors and reduce to necessary

ImplConstruct sets mnAnimationLoopCount, but is always followed by
ImplAssignGraphicData which overwrites it so we can omit that

ImplConstruct sets mnDataChangeTimeStamp, but is always
followed by ImplAssignGraphicData which always calls
ImplAfterDataChange which overwrites it so we can omit that

Change-Id: I2304dc1ea590071a83ca30768426f721c1bd259c
Reviewed-on: https://gerrit.libreoffice.org/32953
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/include/svtools/grfmgr.hxx b/include/svtools/grfmgr.hxx
index ac8bdea..abd8b29 100644
--- a/include/svtools/grfmgr.hxx
+++ b/include/svtools/grfmgr.hxx
@@ -199,7 +199,6 @@ private:
 boolmbIsInSwapOut   : 1;
 boolmbAlpha : 1;
 
-voidSVT_DLLPRIVATE ImplConstruct();
 voidSVT_DLLPRIVATE ImplAssignGraphicData();
 static void SVT_DLLPRIVATE ImplEnsureGraphicManager();
 voidSVT_DLLPRIVATE ImplAutoSwapIn();
diff --git a/svtools/source/graphic/grfmgr.cxx 
b/svtools/source/graphic/grfmgr.cxx
index a42ab8f..ffaa93a 100644
--- a/svtools/source/graphic/grfmgr.cxx
+++ b/svtools/source/graphic/grfmgr.cxx
@@ -70,48 +70,49 @@ void GraphicObject::ImplAfterDataChange()
 mpGlobalMgr->ImplCheckSizeOfSwappedInGraphics(this);
 }
 
-GraphicObject::GraphicObject() :
-maLink  (),
-maUserData  ()
+GraphicObject::GraphicObject()
+: mbAutoSwapped(false)
+, mbIsInSwapIn(false)
+, mbIsInSwapOut(false)
 {
 ImplEnsureGraphicManager();
-ImplConstruct();
 ImplAssignGraphicData();
 mpGlobalMgr->ImplRegisterObj(*this, maGraphic, nullptr, nullptr);
 }
 
-GraphicObject::GraphicObject( const Graphic& rGraphic ) :
-maGraphic   ( rGraphic ),
-maLink  (),
-maUserData  ()
+GraphicObject::GraphicObject(const Graphic& rGraphic)
+: maGraphic(rGraphic)
+, mbAutoSwapped(false)
+, mbIsInSwapIn(false)
+, mbIsInSwapOut(false)
 {
 ImplEnsureGraphicManager();
-ImplConstruct();
 ImplAssignGraphicData();
 mpGlobalMgr->ImplRegisterObj(*this, maGraphic, nullptr, nullptr);
 }
 
-GraphicObject::GraphicObject( const GraphicObject& rGraphicObj ) :
-maGraphic   ( rGraphicObj.GetGraphic() ),
-maAttr  ( rGraphicObj.maAttr ),
-maLink  ( rGraphicObj.maLink ),
-maUserData  ( rGraphicObj.maUserData )
+GraphicObject::GraphicObject(const GraphicObject& rGraphicObj)
+: maGraphic(rGraphicObj.GetGraphic())
+, maAttr(rGraphicObj.maAttr)
+, maLink(rGraphicObj.maLink)
+, maUserData(rGraphicObj.maUserData)
+, mbAutoSwapped(false)
+, mbIsInSwapIn(false)
+, mbIsInSwapOut(false)
 {
-ImplConstruct();
 ImplAssignGraphicData();
 mpGlobalMgr->ImplRegisterObj(*this, maGraphic, nullptr, );
 if( rGraphicObj.HasUserData() && rGraphicObj.IsSwappedOut() )
 SetSwapState();
 }
 
-GraphicObject::GraphicObject( const OString& rUniqueID ) :
-maLink  (),
-maUserData  ()
+GraphicObject::GraphicObject(const OString& rUniqueID)
+: mbAutoSwapped(false)
+, mbIsInSwapIn(false)
+, mbIsInSwapOut(false)
 {
 ImplEnsureGraphicManager();
 
-ImplConstruct();
-
 // assign default properties
 ImplAssignGraphicData();
 
@@ -132,18 +133,6 @@ GraphicObject::~GraphicObject()
 }
 }
 
-void GraphicObject::ImplConstruct()
-{
-maSwapStreamHdl = Link();
-mnAnimationLoopCount = 0;
-mbAutoSwapped = false;
-mbIsInSwapIn = false;
-mbIsInSwapOut = false;
-
-// Init with a unique, increasing ID
-mnDataChangeTimeStamp = aIncrementingTimeOfLastDataChange++;
-}
-
 void GraphicObject::ImplAssignGraphicData()
 {
 maPrefSize = maGraphic.GetPrefSize();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2017-01-10 Thread Caolán McNamara
 include/svtools/grfmgr.hxx|   10 -
 svtools/source/graphic/grfmgr.cxx |   64 --
 2 files changed, 34 insertions(+), 40 deletions(-)

New commits:
commit a1d3dc1cbd1ca8b61e717c8ef8c7fdfe3ec33045
Author: Caolán McNamara 
Date:   Mon Jan 9 16:16:38 2017 +

post ctor, pre dtor there is always a mpMgr and its mpGlobalMgr

move the ImplEnsureGraphicManager calls to be the first thing
in the ctor to ensure that its also always available during
the ctoring, this is hopefully a good change

Change-Id: Iccddee7cac152df66dec0039df207a7575e1fa54

diff --git a/include/svtools/grfmgr.hxx b/include/svtools/grfmgr.hxx
index 247b036..ac8bdea 100644
--- a/include/svtools/grfmgr.hxx
+++ b/include/svtools/grfmgr.hxx
@@ -181,7 +181,6 @@ private:
 MapMode maPrefMapMode;
 sal_uLong   mnSizeBytes;
 GraphicType meType;
-GraphicManager* mpMgr;
 OUStringmaLink;
 Link maSwapStreamHdl;
 OUStringmaUserData;
@@ -202,7 +201,7 @@ private:
 
 voidSVT_DLLPRIVATE ImplConstruct();
 voidSVT_DLLPRIVATE ImplAssignGraphicData();
-voidSVT_DLLPRIVATE ImplEnsureGraphicManager();
+static void SVT_DLLPRIVATE ImplEnsureGraphicManager();
 voidSVT_DLLPRIVATE ImplAutoSwapIn();
 boolSVT_DLLPRIVATE ImplGetCropParams(
 OutputDevice* pOut,
@@ -332,7 +331,12 @@ public:
 voidFireSwapInRequest();
 voidFireSwapOutRequest();
 
-GraphicManager& GetGraphicManager() const { return *mpMgr; }
+GraphicManager& GetGraphicManager() const
+{
+(void)this; // avoid loplugin:staticmethods because first 
GraphicManager ctor creates
+// mpGlobalMgr and the last GraphicManager dtor destroys it
+return *mpGlobalMgr;
+}
 
 boolIsCached(
 OutputDevice* pOut,
diff --git a/svtools/source/graphic/grfmgr.cxx 
b/svtools/source/graphic/grfmgr.cxx
index 1826e5f..91c7265 100644
--- a/svtools/source/graphic/grfmgr.cxx
+++ b/svtools/source/graphic/grfmgr.cxx
@@ -67,18 +67,17 @@ void GraphicObject::ImplAfterDataChange()
 mnDataChangeTimeStamp = aIncrementingTimeOfLastDataChange++;
 
 // check memory footprint of all GraphicObjects managed and evtl. take 
action
-if (mpMgr)
-mpMgr->ImplCheckSizeOfSwappedInGraphics(this);
+mpGlobalMgr->ImplCheckSizeOfSwappedInGraphics(this);
 }
 
 GraphicObject::GraphicObject() :
 maLink  (),
 maUserData  ()
 {
+ImplEnsureGraphicManager();
 ImplConstruct();
 ImplAssignGraphicData();
-ImplEnsureGraphicManager();
-mpMgr->ImplRegisterObj(*this, maGraphic, nullptr, nullptr);
+mpGlobalMgr->ImplRegisterObj(*this, maGraphic, nullptr, nullptr);
 }
 
 GraphicObject::GraphicObject( const Graphic& rGraphic ) :
@@ -86,10 +85,10 @@ GraphicObject::GraphicObject( const Graphic& rGraphic ) :
 maLink  (),
 maUserData  ()
 {
+ImplEnsureGraphicManager();
 ImplConstruct();
 ImplAssignGraphicData();
-ImplEnsureGraphicManager();
-mpMgr->ImplRegisterObj(*this, maGraphic, nullptr, nullptr);
+mpGlobalMgr->ImplRegisterObj(*this, maGraphic, nullptr, nullptr);
 }
 
 GraphicObject::GraphicObject( const GraphicObject& rGraphicObj ) :
@@ -98,10 +97,10 @@ GraphicObject::GraphicObject( const GraphicObject& 
rGraphicObj ) :
 maLink  ( rGraphicObj.maLink ),
 maUserData  ( rGraphicObj.maUserData )
 {
+ImplEnsureGraphicManager();
 ImplConstruct();
 ImplAssignGraphicData();
-ImplEnsureGraphicManager();
-mpMgr->ImplRegisterObj(*this, maGraphic, nullptr, );
+mpGlobalMgr->ImplRegisterObj(*this, maGraphic, nullptr, );
 if( rGraphicObj.HasUserData() && rGraphicObj.IsSwappedOut() )
 SetSwapState();
 }
@@ -110,13 +109,14 @@ GraphicObject::GraphicObject( const OString& rUniqueID ) :
 maLink  (),
 maUserData  ()
 {
+ImplEnsureGraphicManager();
+
 ImplConstruct();
 
 // assign default properties
 ImplAssignGraphicData();
 
-ImplEnsureGraphicManager();
-mpMgr->ImplRegisterObj(*this, maGraphic, , nullptr);
+mpGlobalMgr->ImplRegisterObj(*this, maGraphic, , nullptr);
 
 // update properties
 ImplAssignGraphicData();
@@ -124,7 +124,7 @@ GraphicObject::GraphicObject( const OString& rUniqueID ) :
 
 GraphicObject::~GraphicObject()
 {
-mpMgr->ImplUnregisterObj( *this );
+mpGlobalMgr->ImplUnregisterObj( *this );
 
 if (!mpGlobalMgr->ImplHasObjects())
 {
@@ -135,7 +135,6 @@ GraphicObject::~GraphicObject()
 
 void GraphicObject::ImplConstruct()
 {
-mpMgr = nullptr;
 maSwapStreamHdl = Link();
 mnAnimationLoopCount = 0;
 mbAutoSwapped = false;
@@ -186,8 +185,6 

[Libreoffice-commits] core.git: include/svtools svtools/source

2017-01-10 Thread Caolán McNamara
 include/svtools/grfmgr.hxx|5 +
 svtools/source/graphic/grfmgr.cxx |   15 +--
 2 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit 8065e33626b8b9cf02caaa12b345b538535a8acf
Author: Caolán McNamara 
Date:   Mon Jan 9 16:05:35 2017 +

move the ImplRegisterObj outside ImplSetGraphicManager and rename it

Change-Id: I1eded3ee41787b9a3339e01cf6e1157724bba1a6

diff --git a/include/svtools/grfmgr.hxx b/include/svtools/grfmgr.hxx
index 9c3ddc9..247b036 100644
--- a/include/svtools/grfmgr.hxx
+++ b/include/svtools/grfmgr.hxx
@@ -202,10 +202,7 @@ private:
 
 voidSVT_DLLPRIVATE ImplConstruct();
 voidSVT_DLLPRIVATE ImplAssignGraphicData();
-voidSVT_DLLPRIVATE ImplSetGraphicManager(
-const OString* pID = nullptr,
-const GraphicObject* pCopyObj = nullptr
-);
+voidSVT_DLLPRIVATE ImplEnsureGraphicManager();
 voidSVT_DLLPRIVATE ImplAutoSwapIn();
 boolSVT_DLLPRIVATE ImplGetCropParams(
 OutputDevice* pOut,
diff --git a/svtools/source/graphic/grfmgr.cxx 
b/svtools/source/graphic/grfmgr.cxx
index 9c5b89f..003063d 100644
--- a/svtools/source/graphic/grfmgr.cxx
+++ b/svtools/source/graphic/grfmgr.cxx
@@ -77,7 +77,8 @@ GraphicObject::GraphicObject() :
 {
 ImplConstruct();
 ImplAssignGraphicData();
-ImplSetGraphicManager();
+ImplEnsureGraphicManager();
+mpMgr->ImplRegisterObj(*this, maGraphic, nullptr, nullptr);
 }
 
 GraphicObject::GraphicObject( const Graphic& rGraphic ) :
@@ -87,7 +88,8 @@ GraphicObject::GraphicObject( const Graphic& rGraphic ) :
 {
 ImplConstruct();
 ImplAssignGraphicData();
-ImplSetGraphicManager();
+ImplEnsureGraphicManager();
+mpMgr->ImplRegisterObj(*this, maGraphic, nullptr, nullptr);
 }
 
 GraphicObject::GraphicObject( const GraphicObject& rGraphicObj ) :
@@ -98,7 +100,8 @@ GraphicObject::GraphicObject( const GraphicObject& 
rGraphicObj ) :
 {
 ImplConstruct();
 ImplAssignGraphicData();
-ImplSetGraphicManager(nullptr, );
+ImplEnsureGraphicManager();
+mpMgr->ImplRegisterObj(*this, maGraphic, nullptr, );
 if( rGraphicObj.HasUserData() && rGraphicObj.IsSwappedOut() )
 SetSwapState();
 }
@@ -112,7 +115,8 @@ GraphicObject::GraphicObject( const OString& rUniqueID ) :
 // assign default properties
 ImplAssignGraphicData();
 
-ImplSetGraphicManager();
+ImplEnsureGraphicManager();
+mpMgr->ImplRegisterObj(*this, maGraphic, , nullptr);
 
 // update properties
 ImplAssignGraphicData();
@@ -161,7 +165,7 @@ void GraphicObject::ImplAssignGraphicData()
 ImplAfterDataChange();
 }
 
-void GraphicObject::ImplSetGraphicManager(const OString* pID, const 
GraphicObject* pCopyObj)
+void GraphicObject::ImplEnsureGraphicManager()
 {
 if (!mpGlobalMgr)
 {
@@ -187,7 +191,6 @@ void GraphicObject::ImplSetGraphicManager(const OString* 
pID, const GraphicObjec
 }
 
 mpMgr = mpGlobalMgr;
-mpMgr->ImplRegisterObj( *this, maGraphic, pID, pCopyObj );
 }
 
 void GraphicObject::ImplAutoSwapIn()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2017-01-10 Thread Caolán McNamara
 include/svtools/grfmgr.hxx |1 -
 svtools/source/graphic/grfmgr.cxx  |7 ---
 svtools/source/graphic/grfmgr2.cxx |4 +---
 3 files changed, 1 insertion(+), 11 deletions(-)

New commits:
commit 3a44ef1d5de57022ad2f5339dbcbfa534174eb9f
Author: Caolán McNamara 
Date:   Mon Jan 9 15:58:45 2017 +

GraphicManagerDestroyed would just set the default manager again

which is the only one that could already be set. Seeing
as the manager is always there if a Graphic exists then
the maObjList must be empty at the dtor time

Change-Id: Id447d1e62a4b94b0ef986edf3cc05629c90e511b

diff --git a/include/svtools/grfmgr.hxx b/include/svtools/grfmgr.hxx
index 7a8291f..9c3ddc9 100644
--- a/include/svtools/grfmgr.hxx
+++ b/include/svtools/grfmgr.hxx
@@ -315,7 +315,6 @@ private:
 void SVT_DLLPRIVATE ImplAfterDataChange();
 protected:
 
-voidGraphicManagerDestroyed();
 SvStream*   GetSwapStream() const;
 voidSetSwapState();
 
diff --git a/svtools/source/graphic/grfmgr.cxx 
b/svtools/source/graphic/grfmgr.cxx
index f480537..2682e95 100644
--- a/svtools/source/graphic/grfmgr.cxx
+++ b/svtools/source/graphic/grfmgr.cxx
@@ -447,13 +447,6 @@ void GraphicObject::FireSwapOutRequest()
 ImplAutoSwapOutHdl( nullptr );
 }
 
-void GraphicObject::GraphicManagerDestroyed()
-{
-// we're alive, but our manager doesn't live anymore ==> connect to 
default manager
-mpMgr = nullptr;
-ImplSetGraphicManager();
-}
-
 bool GraphicObject::IsCached( OutputDevice* pOut, const Point& rPt, const 
Size& rSz,
   const GraphicAttr* pAttr, 
GraphicManagerDrawFlags nFlags ) const
 {
diff --git a/svtools/source/graphic/grfmgr2.cxx 
b/svtools/source/graphic/grfmgr2.cxx
index e2608bb..f71c67a 100644
--- a/svtools/source/graphic/grfmgr2.cxx
+++ b/svtools/source/graphic/grfmgr2.cxx
@@ -49,9 +49,7 @@ GraphicManager::GraphicManager( sal_uLong nCacheSize, 
sal_uLong nMaxObjCacheSize
 
 GraphicManager::~GraphicManager()
 {
-for(GraphicObject* i : maObjList)
-i->GraphicManagerDestroyed();
-
+assert(maObjList.empty());
 delete mpCache;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2017-01-10 Thread Caolán McNamara
 include/svtools/grfmgr.hxx|1 -
 svtools/source/graphic/grfmgr.cxx |   20 ++--
 2 files changed, 10 insertions(+), 11 deletions(-)

New commits:
commit 8564b5beb1c49104d555e70d3c6134908fc0811f
Author: Caolán McNamara 
Date:   Mon Jan 9 15:48:36 2017 +

first GraphicManager* arg of ImplSetGraphicManager is thus always null

Change-Id: I3da98280d3c1d95663e6e43ce7a5ca82c001c334

diff --git a/include/svtools/grfmgr.hxx b/include/svtools/grfmgr.hxx
index 929fe89..7a8291f 100644
--- a/include/svtools/grfmgr.hxx
+++ b/include/svtools/grfmgr.hxx
@@ -203,7 +203,6 @@ private:
 voidSVT_DLLPRIVATE ImplConstruct();
 voidSVT_DLLPRIVATE ImplAssignGraphicData();
 voidSVT_DLLPRIVATE ImplSetGraphicManager(
-const GraphicManager* pMgr,
 const OString* pID = nullptr,
 const GraphicObject* pCopyObj = nullptr
 );
diff --git a/svtools/source/graphic/grfmgr.cxx 
b/svtools/source/graphic/grfmgr.cxx
index 0b04656..d0e27c4 100644
--- a/svtools/source/graphic/grfmgr.cxx
+++ b/svtools/source/graphic/grfmgr.cxx
@@ -77,7 +77,7 @@ GraphicObject::GraphicObject() :
 {
 ImplConstruct();
 ImplAssignGraphicData();
-ImplSetGraphicManager( nullptr );
+ImplSetGraphicManager();
 }
 
 GraphicObject::GraphicObject( const Graphic& rGraphic ) :
@@ -87,7 +87,7 @@ GraphicObject::GraphicObject( const Graphic& rGraphic ) :
 {
 ImplConstruct();
 ImplAssignGraphicData();
-ImplSetGraphicManager( nullptr );
+ImplSetGraphicManager();
 }
 
 GraphicObject::GraphicObject( const GraphicObject& rGraphicObj ) :
@@ -98,7 +98,7 @@ GraphicObject::GraphicObject( const GraphicObject& 
rGraphicObj ) :
 {
 ImplConstruct();
 ImplAssignGraphicData();
-ImplSetGraphicManager( nullptr, nullptr,  );
+ImplSetGraphicManager(nullptr, );
 if( rGraphicObj.HasUserData() && rGraphicObj.IsSwappedOut() )
 SetSwapState();
 }
@@ -112,7 +112,7 @@ GraphicObject::GraphicObject( const OString& rUniqueID ) :
 // assign default properties
 ImplAssignGraphicData();
 
-ImplSetGraphicManager( nullptr,  );
+ImplSetGraphicManager();
 
 // update properties
 ImplAssignGraphicData();
@@ -161,11 +161,11 @@ void GraphicObject::ImplAssignGraphicData()
 ImplAfterDataChange();
 }
 
-void GraphicObject::ImplSetGraphicManager( const GraphicManager* pMgr, const 
OString* pID, const GraphicObject* pCopyObj )
+void GraphicObject::ImplSetGraphicManager(const OString* pID, const 
GraphicObject* pCopyObj)
 {
-if( !mpMgr || ( pMgr != mpMgr ) )
+if (!mpMgr || mpMgr)
 {
-if( !pMgr && mpMgr && ( mpMgr == mpGlobalMgr ) )
+if (mpMgr && mpMgr == mpGlobalMgr)
 return;
 else
 {
@@ -180,7 +180,7 @@ void GraphicObject::ImplSetGraphicManager( const 
GraphicManager* pMgr, const OSt
 }
 }
 
-if( !pMgr )
+if (true)
 {
 if( !mpGlobalMgr )
 {
@@ -208,7 +208,7 @@ void GraphicObject::ImplSetGraphicManager( const 
GraphicManager* pMgr, const OSt
 mpMgr = mpGlobalMgr;
 }
 else
-mpMgr = const_cast(pMgr);
+mpMgr = nullptr;
 
 mpMgr->ImplRegisterObj( *this, maGraphic, pID, pCopyObj );
 }
@@ -473,7 +473,7 @@ void GraphicObject::GraphicManagerDestroyed()
 {
 // we're alive, but our manager doesn't live anymore ==> connect to 
default manager
 mpMgr = nullptr;
-ImplSetGraphicManager( nullptr );
+ImplSetGraphicManager();
 }
 
 bool GraphicObject::IsCached( OutputDevice* pOut, const Point& rPt, const 
Size& rSz,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2016-12-30 Thread Caolán McNamara
 include/svtools/svtools.hrc  |  103 ++-
 svtools/source/misc/imagemgr.cxx |  126 ++--
 svtools/source/misc/imagemgr.src |  569 +--
 3 files changed, 682 insertions(+), 116 deletions(-)

New commits:
commit b8e27d5da6b14241e80526d67d68dfd1132a288e
Author: Caolán McNamara 
Date:   Tue Dec 27 16:00:56 2016 +

unwind this ImageList

after discovering one of the referenced images was missing

Change-Id: I25321ee436976415313fb004e798fad897673ee5
Reviewed-on: https://gerrit.libreoffice.org/32511
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/include/svtools/svtools.hrc b/include/svtools/svtools.hrc
index 44b14c4..10b8942 100644
--- a/include/svtools/svtools.hrc
+++ b/include/svtools/svtools.hrc
@@ -255,11 +255,104 @@
 #define BMP_CURRENT_PRIMARYKEY  (RID_SVTOOLS_BITMAP_START +  11)
 #define BMP_FILTER  (RID_SVTOOLS_BITMAP_START +  12)
 #define BMP_HEADERFOOTER(RID_SVTOOLS_BITMAP_START +  13)
-
-// image lists
-
-#define RID_SVTOOLS_IMAGELIST_BIG   
(RID_SVTOOLS_IMAGELIST_START +  1)
-#define RID_SVTOOLS_IMAGELIST_SMALL 
(RID_SVTOOLS_IMAGELIST_START +  2)
+#define BMP_IMPRESS_SC  (RID_SVTOOLS_BITMAP_START +  14)
+#define BMP_BITMAP_SC   (RID_SVTOOLS_BITMAP_START +  15)
+#define BMP_CALC_SC (RID_SVTOOLS_BITMAP_START +  16)
+#define BMP_CALCTEMPLATE_SC (RID_SVTOOLS_BITMAP_START +  17)
+#define BMP_DATABASE_SC (RID_SVTOOLS_BITMAP_START +  18)
+#define BMP_IMPRESSTEMPLATE_SC  (RID_SVTOOLS_BITMAP_START +  19)
+#define BMP_GIF_SC  (RID_SVTOOLS_BITMAP_START +  20)
+#define BMP_HTML_SC (RID_SVTOOLS_BITMAP_START +  21)
+#define BMP_JPG_SC  (RID_SVTOOLS_BITMAP_START +  22)
+#define BMP_MATH_SC (RID_SVTOOLS_BITMAP_START +  23)
+#define BMP_MATHTEMPLATE_SC (RID_SVTOOLS_BITMAP_START +  24)
+#define BMP_FILE_SC (RID_SVTOOLS_BITMAP_START +  25)
+#define BMP_PCD_SC  (RID_SVTOOLS_BITMAP_START +  26)
+#define BMP_PCT_SC  (RID_SVTOOLS_BITMAP_START +  27)
+#define BMP_PCX_SC  (RID_SVTOOLS_BITMAP_START +  28)
+#define BMP_SIM_SC  (RID_SVTOOLS_BITMAP_START +  29)
+#define BMP_TEXTFILE_SC (RID_SVTOOLS_BITMAP_START +  30)
+#define BMP_TIFF_SC (RID_SVTOOLS_BITMAP_START +  31)
+#define BMP_WMF_SC  (RID_SVTOOLS_BITMAP_START +  32)
+#define BMP_WRITER_SC   (RID_SVTOOLS_BITMAP_START +  33)
+#define BMP_WRITERTEMPLATE_SC   (RID_SVTOOLS_BITMAP_START +  34)
+#define BMP_FIXEDDEV_SC (RID_SVTOOLS_BITMAP_START +  35)
+#define BMP_REMOVABLEDEV_SC (RID_SVTOOLS_BITMAP_START +  36)
+#define BMP_CDROMDEV_SC (RID_SVTOOLS_BITMAP_START +  37)
+#define BMP_NETWORKDEV_SC   (RID_SVTOOLS_BITMAP_START +  38)
+#define BMP_TABLE_SC(RID_SVTOOLS_BITMAP_START +  39)
+#define BMP_FOLDER_SC   (RID_SVTOOLS_BITMAP_START +  40)
+#define BMP_DXF_SC  (RID_SVTOOLS_BITMAP_START +  41)
+#define BMP_MET_SC  (RID_SVTOOLS_BITMAP_START +  42)
+#define BMP_PNG_SC  (RID_SVTOOLS_BITMAP_START +  43)
+#define BMP_SGF_SC  (RID_SVTOOLS_BITMAP_START +  44)
+#define BMP_SGV_SC  (RID_SVTOOLS_BITMAP_START +  45)
+#define BMP_SVM_SC  (RID_SVTOOLS_BITMAP_START +  46)
+#define BMP_GLOBAL_DOC_SC   (RID_SVTOOLS_BITMAP_START +  47)
+#define BMP_DRAW_SC (RID_SVTOOLS_BITMAP_START +  48)
+#define BMP_DRAWTEMPLATE_SC (RID_SVTOOLS_BITMAP_START +  49)
+#define BMP_TEMPLATE_SC (RID_SVTOOLS_BITMAP_START +  50)
+#define BMP_OO_DATABASE_DOC_SC  (RID_SVTOOLS_BITMAP_START +  51)
+#define BMP_OO_DRAW_DOC_SC  (RID_SVTOOLS_BITMAP_START +  52)
+#define BMP_OO_MATH_DOC_SC  (RID_SVTOOLS_BITMAP_START +  53)
+#define BMP_OO_GLOBAL_DOC_SC(RID_SVTOOLS_BITMAP_START +  54)
+#define BMP_OO_IMPRESS_DOC_SC   (RID_SVTOOLS_BITMAP_START +  55)
+#define BMP_OO_CALC_DOC_SC  (RID_SVTOOLS_BITMAP_START +  56)
+#define BMP_OO_WRITER_DOC_SC(RID_SVTOOLS_BITMAP_START +  57)
+#define BMP_OO_DRAW_TEMPLATE_SC (RID_SVTOOLS_BITMAP_START +  58)
+#define BMP_OO_IMPRESS_TEMPLATE_SC  (RID_SVTOOLS_BITMAP_START +  59)
+#define BMP_OO_CALC_TEMPLATE_SC (RID_SVTOOLS_BITMAP_START +  60)
+#define BMP_OO_WRITER_TEMPLATE_SC   (RID_SVTOOLS_BITMAP_START +  61)
+#define BMP_EXTENSION_SC(RID_SVTOOLS_BITMAP_START +  62)
+#define BMP_IMPRESS_LC  

[Libreoffice-commits] core.git: include/svtools svtools/source

2016-12-23 Thread Noel Grandin
 include/svtools/brwbox.hxx|   13 +-
 svtools/source/brwbox/brwbox1.cxx |  174 --
 svtools/source/brwbox/brwbox2.cxx |  107 +++
 3 files changed, 149 insertions(+), 145 deletions(-)

New commits:
commit cfcbbfaeb4cfee5ffeb968dc21d1c266a870d89f
Author: Noel Grandin 
Date:   Fri Dec 23 13:15:43 2016 +0200

remove unnecessary casting in BrowseBox::pDataWin member

Change-Id: I1187691c19808c53ff3839cfd8892ab06d36053e
Reviewed-on: https://gerrit.libreoffice.org/32381
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/svtools/brwbox.hxx b/include/svtools/brwbox.hxx
index 6a97897..237ee5c 100644
--- a/include/svtools/brwbox.hxx
+++ b/include/svtools/brwbox.hxx
@@ -197,9 +197,9 @@ public:
 static const sal_uInt16 HandleColumnId = 0;
 
 private:
-VclPtr pDataWin;   // window to display data rows
-VclPtr  pVScroll;   // vertical scrollbar
-VclPtr  aHScroll;   // horizontal scrollbar
+VclPtr pDataWin;   // window to display data rows
+VclPtr  pVScroll;   // vertical scrollbar
+VclPtr  aHScroll;   // horizontal scrollbar
 
 longnDataRowHeight; // height of a single data-row
 sal_uInt16  nTitleLines;// number of lines in title row
@@ -356,8 +356,7 @@ protected:
 virtual voidVisibleRowsChanged( long nNewTopRow, sal_uInt16 nNumRows);
 
 // number of visible rows in the window (incl. "truncated" rows)
-sal_uInt16  GetVisibleRows()
-{ return 
(sal_uInt16)((pDataWin->GetOutputSizePixel().Height() - 1 )/ GetDataRowHeight() 
+ 1); }
+sal_uInt16  GetVisibleRows();
 longGetTopRow() { return nTopRow; }
 sal_uInt16  GetFirstVisibleColNumber() const { return nFirstCol; }
 
@@ -436,7 +435,7 @@ public:
 
 // map-mode and font control
 voidSetFont( const vcl::Font& rNewFont );
-const vcl::Font& GetFont() const { return pDataWin->GetFont(); }
+const vcl::Font& GetFont() const;
 voidSetTitleFont( const vcl::Font& rNewFont )
 { Control::SetFont( rNewFont ); }
 
@@ -505,7 +504,7 @@ public:
 boolIsResizing() const { return bResizing; }
 
 // access to positions of fields, column and rows
-vcl::Window&GetDataWindow() const { return *pDataWin; }
+vcl::Window&GetDataWindow() const;
 Rectangle   GetRowRectPixel( long nRow ) const;
 Rectangle   GetFieldRectPixel( long nRow, sal_uInt16 nColId,
bool bRelToBrowser = true) const;
diff --git a/svtools/source/brwbox/brwbox1.cxx 
b/svtools/source/brwbox/brwbox1.cxx
index 915e0e4..c16c1d6 100644
--- a/svtools/source/brwbox/brwbox1.cxx
+++ b/svtools/source/brwbox/brwbox1.cxx
@@ -36,7 +36,6 @@
 
 
 #define SCROLL_FLAGS (ScrollFlags::Clip | ScrollFlags::NoChildren)
-#define getDataWindow() (static_cast(pDataWin.get()))
 
 using namespace com::sun::star::accessibility::AccessibleEventId;
 using namespace com::sun::star::accessibility::AccessibleTableModelChangeType;
@@ -62,9 +61,7 @@ void BrowseBox::ConstructImpl( BrowserMode nMode )
 SAL_INFO("svtools", "BrowseBox:ConstructImpl " << this );
 bMultiSelection = false;
 pColSel = nullptr;
-pDataWin = nullptr;
 pVScroll = nullptr;
-
 pDataWin = VclPtr::Create( this ).get();
 pCols = new BrowserColumns;
 m_pImpl.reset( new ::svt::BrowseBoxImpl() );
@@ -106,7 +103,7 @@ void BrowseBox::ConstructImpl( BrowserMode nMode )
 SetMode( nMode );
 bSelectionIsVisible = bKeepHighlight;
 bHasFocus = HasChildPathFocus();
-getDataWindow()->nCursorHidden =
+pDataWin->nCursorHidden =
 ( bHasFocus ? 0 : 1 ) + ( GetUpdateMode() ? 0 : 1 );
 }
 
@@ -136,8 +133,8 @@ void BrowseBox::dispose()
 }
 
 Hide();
-getDataWindow()->pHeaderBar.disposeAndClear();
-getDataWindow()->pCornerWin.disposeAndClear();
+pDataWin->pHeaderBar.disposeAndClear();
+pDataWin->pCornerWin.disposeAndClear();
 pDataWin.disposeAndClear();
 pVScroll.disposeAndClear();
 aHScroll.disposeAndClear();
@@ -158,15 +155,15 @@ void BrowseBox::dispose()
 
 short BrowseBox::GetCursorHideCount() const
 {
-return getDataWindow()->nCursorHidden;
+return pDataWin->nCursorHidden;
 }
 
 
 void BrowseBox::DoShowCursor( const char * )
 {
-if (!getDataWindow())
+if (!pDataWin)
 return;
-short nHiddenCount = --getDataWindow()->nCursorHidden;
+short nHiddenCount = --pDataWin->nCursorHidden;
 if (PaintCursorIfHiddenOnce())
 {
 if (1 == nHiddenCount)
@@ -182,7 +179,7 @@ void BrowseBox::DoShowCursor( const char * )
 
 void BrowseBox::DoHideCursor( const char * )
 {
-short nHiddenCount = ++getDataWindow()->nCursorHidden;
+short nHiddenCount = 

[Libreoffice-commits] core.git: include/svtools svtools/source

2016-10-24 Thread Yousuf Philips
 include/svtools/svtools.hrc|1 +
 svtools/source/java/javaerror.src  |5 +
 svtools/source/java/javainteractionhandler.cxx |4 
 3 files changed, 10 insertions(+)

New commits:
commit 967436ba7c552ea8fa30fd3b7abced231e174951
Author: Yousuf Philips 
Date:   Thu Oct 20 00:13:40 2016 +0400

tdf#103259 Add java not found error for mac

Change-Id: Ia52316b8868c8124dcb322b44e9600a33a13df28
Reviewed-on: https://gerrit.libreoffice.org/29920
Tested-by: Jenkins 
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/svtools/svtools.hrc b/include/svtools/svtools.hrc
index b5a38eb..92cc809 100644
--- a/include/svtools/svtools.hrc
+++ b/include/svtools/svtools.hrc
@@ -195,6 +195,7 @@
 #define STR_WARNING_INVALIDJAVASETTINGS_TITLE (STR_SVT_JAVAERROR_START+6)
 #define STR_ERROR_JVMCREATIONFAILED   (STR_SVT_JAVAERROR_START+7)
 #define STR_ERROR_JVMCREATIONFAILED_MAC   (STR_SVT_JAVAERROR_START+8)
+#define STR_WARNING_JAVANOTFOUND_MAC  (STR_SVT_JAVAERROR_START+9)
 #define STR_SVT_JAVAERROR_END (STR_ERROR_JVMCREATIONFAILED_MAC)
 
 // String array to match UI language names to LanguageType values and vice 
versa
diff --git a/svtools/source/java/javaerror.src 
b/svtools/source/java/javaerror.src
index f1d1386..60d7c72 100644
--- a/svtools/source/java/javaerror.src
+++ b/svtools/source/java/javaerror.src
@@ -24,6 +24,11 @@ String STR_WARNING_JAVANOTFOUND
 Text [ en-US ] ="%PRODUCTNAME requires a Java runtime environment (JRE) to 
perform this task. Please install a JRE and restart %PRODUCTNAME.";
 };
 
+String STR_WARNING_JAVANOTFOUND_MAC
+{
+Text [ en-US ] ="%PRODUCTNAME requires Oracle's Java Development Kit (JDK) 
on Mac OS X 10.10 or greater to perform this task. Please install them and 
restart %PRODUCTNAME.";
+};
+
 String STR_WARNING_INVALIDJAVASETTINGS_MAC
 {
 Text [ en-US ] ="The %PRODUCTNAME configuration has been changed. Under 
%PRODUCTNAME - Preferences - %PRODUCTNAME - Advanced, select the Java runtime 
environment you want to have used by %PRODUCTNAME.";
diff --git a/svtools/source/java/javainteractionhandler.cxx 
b/svtools/source/java/javainteractionhandler.cxx
index f947a28..860f3e0 100644
--- a/svtools/source/java/javainteractionhandler.cxx
+++ b/svtools/source/java/javainteractionhandler.cxx
@@ -122,7 +122,11 @@ void SAL_CALL JavaInteractionHandler::handle( const 
Reference< XInteractionReque
// No suitable JRE found
 SolarMutexGuard aSolarGuard;
 m_bJavaNotFound_Handled = true;
+#ifdef MACOSX
+ScopedVclPtrInstance< MessageDialog > aWarningBox(nullptr, 
SvtResId(STR_WARNING_JAVANOTFOUND_MAC), VclMessageType::Warning);
+#else
 ScopedVclPtrInstance< MessageDialog > aWarningBox(nullptr, 
SvtResId(STR_WARNING_JAVANOTFOUND), VclMessageType::Warning);
+#endif
 aWarningBox->SetText(SvtResId(STR_WARNING_JAVANOTFOUND_TITLE));
 nResult = aWarningBox->Execute();
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2016-10-12 Thread Caolán McNamara
 include/svtools/brwbox.hxx|2 --
 svtools/source/brwbox/brwbox1.cxx |   12 
 2 files changed, 14 deletions(-)

New commits:
commit 7f5d27a7a7d51282bc816f945bbe7f8df25b0e6c
Author: Caolán McNamara 
Date:   Wed Oct 12 16:24:26 2016 +0100

no Browse is loaded from .src anymore

Change-Id: I72e87433fef1a27c6bcac2746d9d366335797800

diff --git a/include/svtools/brwbox.hxx b/include/svtools/brwbox.hxx
index cdaca6b..5ec84e6 100644
--- a/include/svtools/brwbox.hxx
+++ b/include/svtools/brwbox.hxx
@@ -393,8 +393,6 @@ protected:
 public:
 BrowseBox( vcl::Window* pParent, WinBits nBits = 0,
BrowserMode nMode = BrowserMode::NONE );
-BrowseBox( vcl::Window* pParent, const ResId& rId,
-   BrowserMode nMode = BrowserMode::NONE );
 virtual ~BrowseBox() override;
 virtual voiddispose() override;
 
diff --git a/svtools/source/brwbox/brwbox1.cxx 
b/svtools/source/brwbox/brwbox1.cxx
index 37deeb5..8a7b1fa 100644
--- a/svtools/source/brwbox/brwbox1.cxx
+++ b/svtools/source/brwbox/brwbox1.cxx
@@ -110,7 +110,6 @@ void BrowseBox::ConstructImpl( BrowserMode nMode )
 ( bHasFocus ? 0 : 1 ) + ( GetUpdateMode() ? 0 : 1 );
 }
 
-
 BrowseBox::BrowseBox( vcl::Window* pParent, WinBits nBits, BrowserMode nMode )
 :Control( pParent, nBits | WB_3DLOOK )
 ,DragSourceHelper( this )
@@ -120,17 +119,6 @@ BrowseBox::BrowseBox( vcl::Window* pParent, WinBits nBits, 
BrowserMode nMode )
 ConstructImpl( nMode );
 }
 
-
-BrowseBox::BrowseBox( vcl::Window* pParent, const ResId& rId, BrowserMode 
nMode )
-:Control( pParent, rId )
-,DragSourceHelper( this )
-,DropTargetHelper( this )
-,aHScroll( VclPtr::Create(this, WinBits(WB_HSCROLL)) )
-{
-ConstructImpl(nMode);
-}
-
-
 BrowseBox::~BrowseBox()
 {
 disposeOnce();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2016-10-12 Thread Caolán McNamara
 include/svtools/editbrowsebox.hxx   |1 -
 svtools/source/brwbox/editbrowsebox.cxx |   30 --
 2 files changed, 31 deletions(-)

New commits:
commit f9a0f120a0939a71f6bcff32e6e9d2502f240093
Author: Caolán McNamara 
Date:   Wed Oct 12 15:26:03 2016 +0100

no EditBrowseBox is loaded from .src anymore

Change-Id: I70c4cfa85a4a4379ee80e73066193676ca83b5b0

diff --git a/include/svtools/editbrowsebox.hxx 
b/include/svtools/editbrowsebox.hxx
index 8f66b13..1f2be5b 100644
--- a/include/svtools/editbrowsebox.hxx
+++ b/include/svtools/editbrowsebox.hxx
@@ -586,7 +586,6 @@ namespace svt
 
 public:
 EditBrowseBox(vcl::Window* pParent, EditBrowseBoxFlags nBrowserFlags = 
EditBrowseBoxFlags::NONE, WinBits nBits = WB_TABSTOP, BrowserMode nMode = 
BrowserMode::NONE );
-EditBrowseBox(vcl::Window* pParent, const ResId& rId, 
EditBrowseBoxFlags nBrowserFlags = EditBrowseBoxFlags::NONE, BrowserMode nMode 
= BrowserMode::NONE );
 virtual ~EditBrowseBox() override;
 virtual void dispose() override;
 
diff --git a/svtools/source/brwbox/editbrowsebox.cxx 
b/svtools/source/brwbox/editbrowsebox.cxx
index be82911..d374f81 100644
--- a/svtools/source/brwbox/editbrowsebox.cxx
+++ b/svtools/source/brwbox/editbrowsebox.cxx
@@ -66,10 +66,8 @@ namespace svt
 {
 }
 
-
 //= EditBrowserHeader
 
-
 void EditBrowserHeader::DoubleClick()
 {
 sal_uInt16 nColId = GetCurItemId();
@@ -84,16 +82,13 @@ namespace svt
 }
 }
 
-
 //= EditBrowseBox
 
-
 void EditBrowseBox::BrowserMouseEventPtr::Clear()
 {
 DELETEZ(pEvent);
 }
 
-
 void EditBrowseBox::BrowserMouseEventPtr::Set(const BrowserMouseEvent* 
pEvt, bool bIsDown)
 {
 if (pEvt == pEvent)
@@ -114,7 +109,6 @@ namespace svt
 }
 }
 
-
 void EditBrowseBox::impl_construct()
 {
 m_aImpl.reset(new EditBrowseBoxImpl());
@@ -129,28 +123,6 @@ namespace svt
 pCheckBoxPaint->SetBackground();
 }
 
-
-EditBrowseBox::EditBrowseBox(vcl::Window* pParent, const ResId& rId, 
EditBrowseBoxFlags nBrowserFlags, BrowserMode _nMode )
-  :BrowseBox( pParent, rId, _nMode )
-  ,nStartEvent(nullptr)
-  ,nEndEvent(nullptr)
-  ,nCellModifiedEvent(nullptr)
-  ,m_pFocusWhileRequest(nullptr)
-  ,nPaintRow(-1)
-  ,nEditRow(-1)
-  ,nOldEditRow(-1)
-  ,nEditCol(0)
-  ,nOldEditCol(0)
-  ,bHasFocus(false)
-  ,bPaintStatus(true)
-  ,bActiveBeforeTracking( false )
-  ,m_nBrowserFlags(nBrowserFlags)
-  ,pHeader(nullptr)
-{
-impl_construct();
-}
-
-
 EditBrowseBox::EditBrowseBox( vcl::Window* pParent, EditBrowseBoxFlags 
nBrowserFlags, WinBits nBits, BrowserMode _nMode )
   :BrowseBox( pParent, nBits, _nMode )
   ,nStartEvent(nullptr)
@@ -171,13 +143,11 @@ namespace svt
 impl_construct();
 }
 
-
 void EditBrowseBox::Init()
 {
 // late construction
 }
 
-
 EditBrowseBox::~EditBrowseBox()
 {
 disposeOnce();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2016-10-07 Thread Stephan Bergmann
 include/svtools/rtfout.hxx  |   20 +
 svtools/source/svrtf/rtfout.cxx |   47 +---
 2 files changed, 32 insertions(+), 35 deletions(-)

New commits:
commit e738e79d21c8f48784602efdd915aed3ef2a7c2d
Author: Stephan Bergmann 
Date:   Fri Oct 7 18:27:43 2016 +0200

Clean up RTFOutFuncs interface

Change-Id: I934f2375474035504b4ba9612af4f45a7d05ce9b

diff --git a/include/svtools/rtfout.hxx b/include/svtools/rtfout.hxx
index 504a648..508414d 100644
--- a/include/svtools/rtfout.hxx
+++ b/include/svtools/rtfout.hxx
@@ -30,20 +30,14 @@ namespace rtl {
 };
 class SvStream;
 
-class SVT_DLLPUBLIC RTFOutFuncs
-{
-public:
-static SvStream& Out_Char( SvStream&, sal_Unicode cChar,
-int *pUCMode,
-rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
-bool bWriteHelpFile = false );
-static SvStream& Out_String( SvStream&, const rtl::OUString&,
-rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
-bool bWriteHelpFile = false );
-
-static SvStream& Out_Hex( SvStream&, sal_uLong nHex, sal_uInt8 nLen );
-};
+namespace RTFOutFuncs {
+
+SVT_DLLPUBLIC SvStream& Out_String(
+SvStream&, const rtl::OUString&,
+rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
+bool bWriteHelpFile = false );
 
+}
 
 #endif
 
diff --git a/svtools/source/svrtf/rtfout.cxx b/svtools/source/svrtf/rtfout.cxx
index 68ccedd..405d2e4 100644
--- a/svtools/source/svrtf/rtfout.cxx
+++ b/svtools/source/svrtf/rtfout.cxx
@@ -24,7 +24,29 @@
 #include 
 #include 
 
-SvStream& RTFOutFuncs::Out_Char(SvStream& rStream, sal_Unicode c,
+namespace {
+
+SvStream& Out_Hex( SvStream& rStream, sal_uLong nHex, sal_uInt8 nLen )
+{
+sal_Char aNToABuf[] = "";
+
+DBG_ASSERT( nLen < sizeof(aNToABuf), "zu viele Stellen" );
+if( nLen >= sizeof(aNToABuf) )
+nLen = (sizeof(aNToABuf)-1);
+
+// set pointer to end of buffer
+sal_Char* pStr = aNToABuf + (sizeof(aNToABuf)-1);
+for( sal_uInt8 n = 0; n < nLen; ++n )
+{
+*(--pStr) = (sal_Char)(nHex & 0xf ) + 48;
+if( *pStr > '9' )
+*pStr += 39;
+nHex >>= 4;
+}
+return rStream.WriteCharPtr( pStr );
+}
+
+SvStream& Out_Char(SvStream& rStream, sal_Unicode c,
 int *pUCMode, rtl_TextEncoding eDestEnc, bool bWriteHelpFile)
 {
 const sal_Char* pStr = nullptr;
@@ -147,6 +169,8 @@ SvStream& RTFOutFuncs::Out_Char(SvStream& rStream, 
sal_Unicode c,
 return rStream;
 }
 
+}
+
 SvStream& RTFOutFuncs::Out_String( SvStream& rStream, const OUString& rStr,
 rtl_TextEncoding eDestEnc, bool bWriteHelpFile)
 {
@@ -158,25 +182,4 @@ SvStream& RTFOutFuncs::Out_String( SvStream& rStream, 
const OUString& rStr,
 return rStream;
 }
 
-SvStream& RTFOutFuncs::Out_Hex( SvStream& rStream, sal_uLong nHex, sal_uInt8 
nLen )
-{
-sal_Char aNToABuf[] = "";
-
-DBG_ASSERT( nLen < sizeof(aNToABuf), "zu viele Stellen" );
-if( nLen >= sizeof(aNToABuf) )
-nLen = (sizeof(aNToABuf)-1);
-
-// set pointer to end of buffer
-sal_Char* pStr = aNToABuf + (sizeof(aNToABuf)-1);
-for( sal_uInt8 n = 0; n < nLen; ++n )
-{
-*(--pStr) = (sal_Char)(nHex & 0xf ) + 48;
-if( *pStr > '9' )
-*pStr += 39;
-nHex >>= 4;
-}
-return rStream.WriteCharPtr( pStr );
-}
-
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2016-10-07 Thread Stephan Bergmann
 include/svtools/htmlout.hxx   |2 +-
 svtools/source/svhtml/htmlout.cxx |   36 +---
 2 files changed, 26 insertions(+), 12 deletions(-)

New commits:
commit 375b99cad4a79d26a6cbcd0f71bc12b312d95818
Author: Stephan Bergmann 
Date:   Fri Oct 7 15:02:47 2016 +0200

rhbz#1382401: Support surrogate pairs in HTMLOutFuncs

Change-Id: Ib578f758e4f5f355a79a014c2ad4660924dd34a4

diff --git a/include/svtools/htmlout.hxx b/include/svtools/htmlout.hxx
index 969d02c..ef18c83 100644
--- a/include/svtools/htmlout.hxx
+++ b/include/svtools/htmlout.hxx
@@ -60,7 +60,7 @@ struct HTMLOutFuncs
 SVT_DLLPUBLIC static SvStream& Out_AsciiTag( SvStream&, const sal_Char* 
pStr,
bool bOn = true,
 rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252);
-SVT_DLLPUBLIC static SvStream& Out_Char( SvStream&, sal_Unicode cChar,
+SVT_DLLPUBLIC static SvStream& Out_Char( SvStream&, sal_uInt32 cChar,
 HTMLOutContext& rContext,
 OUString *pNonConvertableChars );
 SVT_DLLPUBLIC static SvStream& Out_String( SvStream&, const OUString&,
diff --git a/svtools/source/svhtml/htmlout.cxx 
b/svtools/source/svhtml/htmlout.cxx
index a8a3fb5..f885488 100644
--- a/svtools/source/svhtml/htmlout.cxx
+++ b/svtools/source/svhtml/htmlout.cxx
@@ -55,7 +55,7 @@ HTMLOutContext::~HTMLOutContext()
 rtl_destroyUnicodeToTextConverter( m_hConv );
 }
 
-static const sal_Char *lcl_svhtml_GetEntityForChar( sal_Unicode c,
+static const sal_Char *lcl_svhtml_GetEntityForChar( sal_uInt32 c,
  rtl_TextEncoding eDestEnc )
 {
 const sal_Char* pStr = nullptr;
@@ -399,10 +399,12 @@ static sal_Size lcl_FlushContext(HTMLOutContext& 
rContext, sal_Char* pBuffer, sa
 return nLen;
 }
 
-static OString lcl_ConvertCharToHTML( sal_Unicode c,
+static OString lcl_ConvertCharToHTML( sal_uInt32 c,
 HTMLOutContext& rContext,
 OUString *pNonConvertableChars )
 {
+assert(rtl::isUnicodeCodePoint(c));
+
 OStringBuffer aDest;
 DBG_ASSERT( RTL_TEXTENCODING_DONTKNOW != rContext.m_eDestEnc,
 "wrong destination encoding" );
@@ -446,8 +448,18 @@ static OString lcl_ConvertCharToHTML( sal_Unicode c,
 sal_uInt32 nInfo = 0;
 sal_Size nSrcChars;
 
+sal_Unicode utf16[2];
+sal_Size n;
+if (c < 0x1) {
+utf16[0] = c;
+n = 1;
+} else {
+utf16[0] = rtl::getHighSurrogate(c);
+utf16[1] = rtl::getLowSurrogate(c);
+n = 2;
+}
 sal_Size nLen = rtl_convertUnicodeToText(rContext.m_hConv,
- rContext.m_hContext, , 1,
+ rContext.m_hContext, utf16, n,
  cBuffer, TXTCONV_BUFFER_SIZE,
  nFlags, , );
 if( nLen > 0 && (nInfo & 
(RTL_UNICODETOTEXT_INFO_ERROR|RTL_UNICODETOTEXT_INFO_DESTBUFFERTOSMALL)) == 0 )
@@ -467,11 +479,13 @@ static OString lcl_ConvertCharToHTML( sal_Unicode c,
 while( nLen-- )
 aDest.append(*pBuffer++);
 
-aDest.append('&').append('#').append(static_cast(c))
+aDest.append('&').append('#').append(static_cast(c))
+// Unicode code points guaranteed to fit into sal_Int32
  .append(';');
+OUString cs(, 1);
 if( pNonConvertableChars &&
--1 == pNonConvertableChars->indexOf( c ) )
-(*pNonConvertableChars) += OUStringLiteral1(c);
+-1 == pNonConvertableChars->indexOf( cs ) )
+(*pNonConvertableChars) += cs;
 }
 }
 return aDest.makeStringAndClear();
@@ -498,9 +512,9 @@ OString HTMLOutFuncs::ConvertStringToHTML( const OUString& 
rSrc,
 {
 HTMLOutContext aContext( eDestEnc );
 OStringBuffer aDest;
-for( sal_Int32 i=0, nLen = rSrc.getLength(); i < nLen; i++ )
+for( sal_Int32 i=0, nLen = rSrc.getLength(); i < nLen; )
 aDest.append(lcl_ConvertCharToHTML(
-rSrc[i], aContext, pNonConvertableChars));
+rSrc.iterateCodePoints(), aContext, pNonConvertableChars));
 aDest.append(lcl_FlushToAscii(aContext));
 return aDest.makeStringAndClear();
 }
@@ -518,7 +532,7 @@ SvStream& HTMLOutFuncs::Out_AsciiTag( SvStream& rStream, 
const sal_Char *pStr,
 return rStream;
 }
 
-SvStream& HTMLOutFuncs::Out_Char( SvStream& rStream, sal_Unicode c,
+SvStream& HTMLOutFuncs::Out_Char( SvStream& rStream, sal_uInt32 c,
   HTMLOutContext& rContext,
   OUString *pNonConvertableChars )
 {
@@ -533,8 +547,8 @@ SvStream& HTMLOutFuncs::Out_String( SvStream& rStream, 
const OUString& rOUStr,
 {

[Libreoffice-commits] core.git: include/svtools svtools/source

2016-09-05 Thread Aron Budea
 include/svtools/grfmgr.hxx  |6 +++---
 svtools/source/graphic/grfcache.cxx |4 ++--
 svtools/source/graphic/grfmgr2.cxx  |   20 
 3 files changed, 13 insertions(+), 17 deletions(-)

New commits:
commit fdc867a4bc6ac2810732af898c620a889cde725c
Author: Aron Budea 
Date:   Sun Aug 28 18:42:31 2016 +0200

tdf#100442 use unordered_set for GraphicManager's maObjList

Speeds up ImplCheckSizeOfSwappedInGraphics.
maObjList didn't seem to depend on it being a vector.

Change-Id: I0028186b5c4f53ae198b9b33a31c51f0b2e5eb45
Reviewed-on: https://gerrit.libreoffice.org/28439
Tested-by: Jenkins 
Reviewed-by: Michael Meeks 
Tested-by: Michael Meeks 

diff --git a/include/svtools/grfmgr.hxx b/include/svtools/grfmgr.hxx
index 80e03d0..f30b0df 100644
--- a/include/svtools/grfmgr.hxx
+++ b/include/svtools/grfmgr.hxx
@@ -24,6 +24,8 @@
 #include 
 #include 
 
+#include 
+
 enum class GraphicManagerDrawFlags
 {
 CACHED  = 0x01,
@@ -504,8 +506,6 @@ public:
 sal_uLong GetDataChangeTimeStamp() const { return mnDataChangeTimeStamp; }
 };
 
-typedef ::std::vector< GraphicObject* > GraphicObjectList_impl;
-
 class SVT_DLLPUBLIC GraphicManager
 {
 friend class GraphicObject;
@@ -513,7 +513,7 @@ class SVT_DLLPUBLIC GraphicManager
 
 private:
 
-GraphicObjectList_impl  maObjList;
+std::unordered_set< GraphicObject* >maObjList;
 sal_uLong   mnUsedSize; // currently used memory footprint of 
all swapped in graphics
 GraphicCache*   mpCache;
 
diff --git a/svtools/source/graphic/grfcache.cxx 
b/svtools/source/graphic/grfcache.cxx
index 5d2bf62..4669f21 100644
--- a/svtools/source/graphic/grfcache.cxx
+++ b/svtools/source/graphic/grfcache.cxx
@@ -146,7 +146,7 @@ class GraphicCacheEntry
 {
 private:
 
-GraphicObjectList_impl  maGraphicObjectList;
+std::vector< GraphicObject* >   maGraphicObjectList;
 
 GraphicID   maID;
 GfxLink maGfxLink;
@@ -336,7 +336,7 @@ void GraphicCacheEntry::AddGraphicObjectReference( const 
GraphicObject& rObj, Gr
 bool GraphicCacheEntry::ReleaseGraphicObjectReference( const GraphicObject& 
rObj )
 {
 for(
-GraphicObjectList_impl::iterator it = maGraphicObjectList.begin();
+auto it = maGraphicObjectList.begin();
 it != maGraphicObjectList.end();
 ++it
 ) {
diff --git a/svtools/source/graphic/grfmgr2.cxx 
b/svtools/source/graphic/grfmgr2.cxx
index 03ca1a5..6455884 100644
--- a/svtools/source/graphic/grfmgr2.cxx
+++ b/svtools/source/graphic/grfmgr2.cxx
@@ -141,10 +141,10 @@ bool GraphicManager::DrawObj( OutputDevice* pOut, const 
Point& rPt, const Size&
 void GraphicManager::ImplRegisterObj( const GraphicObject& rObj, Graphic& 
rSubstitute,
   const OString* pID, const GraphicObject* 
pCopyObj )
 {
-assert(std::find(maObjList.begin(), maObjList.end(),
-   const_cast()) == maObjList.end());
+assert(maObjList.find(const_cast()) == 
maObjList.end());
+
+maObjList.emplace( const_cast() );
 
-maObjList.push_back( const_cast() );
 mpCache->AddGraphicObject( rObj, rSubstitute, pID, pCopyObj );
 if( !rObj.IsSwappedOut() )
 mnUsedSize += rObj.maGraphic.GetSizeBytes();
@@ -158,13 +158,9 @@ void GraphicManager::ImplUnregisterObj( const 
GraphicObject& rObj )
 assert(mnUsedSize >= rObj.maGraphic.GetSizeBytes());
 mnUsedSize -= rObj.maGraphic.GetSizeBytes();
 }
-for( GraphicObjectList_impl::iterator it = maObjList.begin(); it != 
maObjList.end(); ++it )
-{
-if ( *it ==  ) {
-maObjList.erase( it );
-return;
-}
-}
+if ( 0 < maObjList.erase( const_cast() ) )
+return;
+
 assert(false); // surely it should have been registered?
 }
 
@@ -203,7 +199,7 @@ void GraphicManager::ImplCheckSizeOfSwappedInGraphics(const 
GraphicObject* pGrap
 std::vector< GraphicObject* > aCandidates(maObjList.begin(), 
maObjList.end());
 // if we use more currently, sort by last DataChangeTimeStamp
 // sort by DataChangeTimeStamp so that the oldest get removed first
-::std::sort(aCandidates.begin(), aCandidates.end(), 
simpleSortByDataChangeTimeStamp());
+std::sort(aCandidates.begin(), aCandidates.end(), 
simpleSortByDataChangeTimeStamp());
 
 for(sal_uInt32 a(0); mnUsedSize >= nMaxCacheSize && a < 
aCandidates.size(); a++)
 {
@@ -214,7 +210,7 @@ void GraphicManager::ImplCheckSizeOfSwappedInGraphics(const 
GraphicObject* pGrap
 {
 continue;
 }
-if (std::find(maObjList.begin(), maObjList.end(), pObj) == 
maObjList.end())
+if (maObjList.find(pObj) == maObjList.end())
 {
  

[Libreoffice-commits] core.git: include/svtools svtools/source

2016-08-29 Thread Caolán McNamara
 include/svtools/collatorres.hxx  |   26 +++--
 include/svtools/indexentryres.hxx|   25 +++--
 svtools/source/control/collatorres.cxx   |   73 +-
 svtools/source/control/indexentryres.cxx |   86 +--
 4 files changed, 70 insertions(+), 140 deletions(-)

New commits:
commit 9ae319f938de37a9de1e8a8853af106b413a4bc7
Author: Caolán McNamara 
Date:   Sun Aug 28 21:46:45 2016 +0100

coverity#1371317 avoid unnecessary copies

and coverity#1371211

Change-Id: I65e277c4af70a86f1513749de4eb116d929e858f
Reviewed-on: https://gerrit.libreoffice.org/28448
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/include/svtools/collatorres.hxx b/include/svtools/collatorres.hxx
index 762ea7b..5b41b61 100644
--- a/include/svtools/collatorres.hxx
+++ b/include/svtools/collatorres.hxx
@@ -22,19 +22,33 @@
 
 #include 
 #include 
+#include 
 
 class CollatorResourceData;
 
 class SVT_DLLPUBLIC CollatorResource
 {
+private:
+//  wrapper for locale specific translations data of collator algorithm
+class CollatorResourceData
+{
+friend class CollatorResource;
 private:
-
-CollatorResourceData  *mp_Data;
-
+OUString m_aName;
+OUString m_aTranslation;
 public:
-CollatorResource();
-~CollatorResource();
-const OUString& GetTranslation (const OUString& r_Algorithm);
+CollatorResourceData(const OUString& rAlgorithm, const OUString& 
rTranslation)
+: m_aName(rAlgorithm)
+, m_aTranslation(rTranslation)
+{
+}
+const OUString& GetAlgorithm() const { return m_aName; }
+const OUString& GetTranslation() const { return m_aTranslation; }
+};
+std::vector m_aData;
+public:
+CollatorResource();
+const OUString& GetTranslation(const OUString& rAlgorithm);
 };
 
 #endif // INCLUDED_SVTOOLS_COLLATORRES_HXX
diff --git a/include/svtools/indexentryres.hxx 
b/include/svtools/indexentryres.hxx
index 89f8273..2de22b0 100644
--- a/include/svtools/indexentryres.hxx
+++ b/include/svtools/indexentryres.hxx
@@ -22,18 +22,33 @@
 
 #include 
 #include 
+#include 
 
 class IndexEntryResourceData;
 
 class SVT_DLLPUBLIC IndexEntryResource
 {
+private:
+//  wrapper for locale specific translations data of indexentry algorithm
+class IndexEntryResourceData
+{
+friend class IndexEntryResource;
 private:
-IndexEntryResourceData  *mp_Data;
-
+OUString m_aName;
+OUString m_aTranslation;
 public:
-IndexEntryResource ();
-~IndexEntryResource ();
-const OUString& GetTranslation (const OUString& r_Algorithm);
+IndexEntryResourceData(const OUString& rAlgorithm, const OUString& 
rTranslation)
+: m_aName(rAlgorithm)
+, m_aTranslation(rTranslation)
+{
+}
+const OUString& GetAlgorithm () const { return m_aName; }
+const OUString& GetTranslation () const { return m_aTranslation; }
+};
+std::vector m_aData;
+public:
+IndexEntryResource();
+const OUString& GetTranslation(const OUString& rAlgorithm);
 };
 
 #endif // INCLUDED_SVTOOLS_INDEXENTRYRES_HXX
diff --git a/svtools/source/control/collatorres.cxx 
b/svtools/source/control/collatorres.cxx
index 26fc9a7..b11cfce 100644
--- a/svtools/source/control/collatorres.cxx
+++ b/svtools/source/control/collatorres.cxx
@@ -17,70 +17,27 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-
 #include 
 #include 
 #include 
 
-
-//  wrapper for locale specific translations data of collator algorithm
-
-
-class CollatorResourceData
-{
-friend class CollatorResource;
-private: /* data */
-OUString ma_Name;
-OUString ma_Translation;
-private: /* member functions */
-CollatorResourceData () {}
-public:
-CollatorResourceData ( const OUString _Algorithm, const OUString 
_Translation)
-: ma_Name (r_Algorithm), ma_Translation (r_Translation) {}
-
-const OUString& GetAlgorithm () const { return ma_Name; }
-
-const OUString& GetTranslation () const { return ma_Translation; }
-
-~CollatorResourceData () {}
-
-CollatorResourceData& operator= (const CollatorResourceData& r_From)
-{
-ma_Name = r_From.GetAlgorithm();
-ma_Translation  = r_From.GetTranslation();
-return *this;
-}
-};
-
-
 //  implementation of the collator-algorithm-name translation
-
-
-#define COLLATOR_RESOURCE_COUNT (STR_SVT_COLLATE_END - STR_SVT_COLLATE_START + 
1)
-
 CollatorResource::CollatorResource()
 {
-mp_Data = new CollatorResourceData[COLLATOR_RESOURCE_COUNT];
-
 #define RESSTR(rid) SvtResId(rid).toString()
 
-mp_Data[0] = CollatorResourceData 

[Libreoffice-commits] core.git: include/svtools svtools/source

2016-08-26 Thread Jochen Nitschke
 include/svtools/svlbitm.hxx   |   15 -
 include/svtools/treelistbox.hxx   |3 --
 svtools/source/contnr/svlbitm.cxx |   43 --
 3 files changed, 1 insertion(+), 60 deletions(-)

New commits:
commit 532c2bba7d9985a10b112c880f21691f6b66c19c
Author: Jochen Nitschke 
Date:   Fri Aug 26 01:58:01 2016 +0200

remove SvLBoxBmp class

not used by anything

Change-Id: I35d12bdd29c5aef43296ce4709e69b29f4685acc
Reviewed-on: https://gerrit.libreoffice.org/28398
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/svtools/svlbitm.hxx b/include/svtools/svlbitm.hxx
index 2e5f83e..f520f86 100644
--- a/include/svtools/svlbitm.hxx
+++ b/include/svtools/svlbitm.hxx
@@ -133,21 +133,6 @@ public:
 virtual void Clone(SvLBoxItem* pSource) override;
 };
 
-class SvLBoxBmp : public SvLBoxItem
-{
-Image aBmp;
-public:
-SvLBoxBmp();
-virtual ~SvLBoxBmp();
-virtual SvLBoxItemType GetType() const override;
-virtual void InitViewData( SvTreeListBox* ,SvTreeListEntry*, 
SvViewDataItem* = nullptr ) override;
-virtual void Paint(const Point& rPos, SvTreeListBox& rOutDev,  
vcl::RenderContext& rRenderContext,
-   const SvViewDataEntry* pView, const SvTreeListEntry& 
rEntry) override;
-virtual SvLBoxItem* Create() const override;
-virtual void Clone( SvLBoxItem* pSource ) override;
-};
-
-
 class SVT_DLLPUBLIC SvLBoxButton : public SvLBoxItem
 {
 boolisVis;
diff --git a/include/svtools/treelistbox.hxx b/include/svtools/treelistbox.hxx
index 9898716..25bbf74 100644
--- a/include/svtools/treelistbox.hxx
+++ b/include/svtools/treelistbox.hxx
@@ -50,7 +50,6 @@ class SvInplaceEdit2;
 class SvLBoxString;
 class SvLBoxButton;
 class SvLBoxContextBmp;
-class SvLBoxBmp;
 class SvImpLBox;
 class SvLBoxButtonData;
 struct SvLBoxDDInfo;
@@ -125,7 +124,7 @@ typedef sal_Int64   ExtendedWinBits;
 // disable the behavior of automatically selecting a "CurEntry" upon painting 
the control
 #define EWB_NO_AUTO_CURENTRY0x0001
 
-enum class SvLBoxItemType {String, Bmp, Button, ContextBmp};
+enum class SvLBoxItemType {String, Button, ContextBmp};
 
 class SvLBoxTab
 {
diff --git a/svtools/source/contnr/svlbitm.cxx 
b/svtools/source/contnr/svlbitm.cxx
index 4aeb7ee..52c0da1 100644
--- a/svtools/source/contnr/svlbitm.cxx
+++ b/svtools/source/contnr/svlbitm.cxx
@@ -238,49 +238,6 @@ void SvLBoxString::InitViewData(
 }
 
 // ***
-// class SvLBoxBmp
-// ***
-
-
-SvLBoxBmp::SvLBoxBmp() : SvLBoxItem()
-{
-}
-
-SvLBoxBmp::~SvLBoxBmp()
-{
-}
-
-SvLBoxItemType SvLBoxBmp::GetType() const
-{
-return SvLBoxItemType::Bmp;
-}
-
-void SvLBoxBmp::InitViewData( SvTreeListBox* pView,SvTreeListEntry* pEntry,
-SvViewDataItem* pViewData)
-{
-if( !pViewData )
-pViewData = pView->GetViewDataItem( pEntry, this );
-pViewData->maSize = aBmp.GetSizePixel();
-}
-
-void SvLBoxBmp::Paint(const Point& rPos, SvTreeListBox& rDev, 
vcl::RenderContext& rRenderContext,
-  const SvViewDataEntry* /*pView*/, const SvTreeListEntry& 
/*rEntry*/)
-{
-DrawImageFlags nStyle = rDev.IsEnabled() ? DrawImageFlags::NONE : 
DrawImageFlags::Disable;
-rRenderContext.DrawImage(rPos, aBmp ,nStyle);
-}
-
-SvLBoxItem* SvLBoxBmp::Create() const
-{
-return new SvLBoxBmp;
-}
-
-void SvLBoxBmp::Clone( SvLBoxItem* pSource )
-{
-aBmp = static_cast(pSource)->aBmp;
-}
-
-// ***
 // class SvLBoxButton
 // ***
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2016-08-03 Thread Caolán McNamara
 include/svtools/imagemgr.hrc |1 +
 svtools/source/misc/imagemgr.src |5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 61062608a27ceaef5424203d849f88c7fb77b8d0
Author: Caolán McNamara 
Date:   Wed Aug 3 12:58:54 2016 +0100

Resolves: tdf#96873 include template image to make it available in help

alternatively move it into the helpimg dir and change the usage
in helpcontent2, but do it this way to keep it together with the others

Change-Id: I84c6b10aed948a5fea835dc86bade5a4390c716b

diff --git a/include/svtools/imagemgr.hrc b/include/svtools/imagemgr.hrc
index fc09804..4d6f313 100644
--- a/include/svtools/imagemgr.hrc
+++ b/include/svtools/imagemgr.hrc
@@ -58,6 +58,7 @@
 #define IMG_GLOBAL_DOC  (IMAGELIST_START + 150)
 #define IMG_DRAW(IMAGELIST_START + 151)
 #define IMG_DRAWTEMPLATE(IMAGELIST_START + 152)
+#define IMG_TEMPLATE(IMAGELIST_START + 166)
 #define IMG_OO_DATABASE_DOC (IMAGELIST_START + 169)
 #define IMG_OO_DRAW_DOC (IMAGELIST_START + 170)
 #define IMG_OO_MATH_DOC (IMAGELIST_START + 171)
diff --git a/svtools/source/misc/imagemgr.src b/svtools/source/misc/imagemgr.src
index c750faa..de0d7d8 100644
--- a/svtools/source/misc/imagemgr.src
+++ b/svtools/source/misc/imagemgr.src
@@ -78,6 +78,7 @@
 IMG_SVM ; \
 IMG_TABLE ; \
 IMG_TEXTFILE ; \
+IMG_TEMPLATE ; \
 IMG_TIFF ; \
 IMG_WMF ; \
 IMG_WRITER ; \
@@ -94,7 +95,7 @@ ImageList RID_SVTOOLS_IMAGELIST_BIG
 };
 IdCount =
 {
-66 ;
+67 ;
 };
 };
 
@@ -108,7 +109,7 @@ ImageList RID_SVTOOLS_IMAGELIST_SMALL
 };
 IdCount =
 {
-66;
+67;
 };
 };
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2016-06-21 Thread Xisco Fauli
 include/svtools/slidesorterbaropt.hxx   |   23 ---
 svtools/source/config/slidesorterbaropt.cxx |   58 
 2 files changed, 28 insertions(+), 53 deletions(-)

New commits:
commit bb6500aa74feabcf884801d7ca9ce70b5449cafb
Author: Xisco Fauli 
Date:   Wed Jun 15 20:46:16 2016 +0200

tdf#89329: use shared_ptr for pImpl in slidesorterbaropt

Change-Id: If5b7fd23448a584d1faebaf0a540e61f091471fa
Reviewed-on: https://gerrit.libreoffice.org/26331
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/svtools/slidesorterbaropt.hxx 
b/include/svtools/slidesorterbaropt.hxx
index e436fe6..d92dd58 100644
--- a/include/svtools/slidesorterbaropt.hxx
+++ b/include/svtools/slidesorterbaropt.hxx
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 
 /** forward declaration to our private date container implementation
 
@@ -41,16 +42,6 @@ class SvtSlideSorterBarOptions_Impl;
 class SVT_DLLPUBLIC SvtSlideSorterBarOptions: public utl::detail::Options
 {
 public:
-/** standard constructor and destructor
-
-This will initialize an instance with default values.
-We implement these class with a refcount mechanism! Every instance 
of this class increase it
-at create and decrease it at delete time - but all instances use 
the same data container!
-He is implemented as a static member ...
-
-\samember m_nRefCount
-\samember m_pDataContainer
-*/
 SvtSlideSorterBarOptions();
 virtual ~SvtSlideSorterBarOptions();
 
@@ -79,17 +70,7 @@ class SVT_DLLPUBLIC SvtSlideSorterBarOptions: public 
utl::detail::Options
 SVT_DLLPRIVATE static ::osl::Mutex& GetInitMutex();
 
 private:
-
-/**
-\attention
-Don't initialize these static members in these headers!
-\li Double defined symbols will be detected ...
-\li and unresolved externals exist at linking time.
-Do it in your source only.
-*/
-static SvtSlideSorterBarOptions_Impl* m_pDataContainer;
-static sal_Int32  m_nRefCount ;
-
+std::shared_ptr m_pImpl;
 };
 
 #endif
diff --git a/svtools/source/config/slidesorterbaropt.cxx 
b/svtools/source/config/slidesorterbaropt.cxx
index 49607c0..00028af 100644
--- a/svtools/source/config/slidesorterbaropt.cxx
+++ b/svtools/source/config/slidesorterbaropt.cxx
@@ -55,7 +55,7 @@ class SvtSlideSorterBarOptions_Impl : public ConfigItem
 public:
 
  SvtSlideSorterBarOptions_Impl();
-virtual ~SvtSlideSorterBarOptions_Impl();
+~SvtSlideSorterBarOptions_Impl() override;
 
 /** called for notify of configmanager
 
@@ -83,7 +83,7 @@ class SvtSlideSorterBarOptions_Impl : public ConfigItem
 bool m_bVisibleDrawView;
 
 private:
-virtual void ImplCommit() override;
+virtual void ImplCommit() final override;
 
 /** return list of key names of our configuration management which 
represent oue module tree
 
@@ -193,7 +193,8 @@ 
SvtSlideSorterBarOptions_Impl::SvtSlideSorterBarOptions_Impl()
 
 SvtSlideSorterBarOptions_Impl::~SvtSlideSorterBarOptions_Impl()
 {
-assert(!IsModified()); // should have been committed
+if (IsModified())
+Commit();
 }
 
 static int lcl_MapPropertyName( const OUString& rCompare,
@@ -343,20 +344,20 @@ void SvtSlideSorterBarOptions_Impl::SetVisibleViewImpl( 
bool& bVisibleView, bool
 }
 }
 
-//  initialize static member, see definition for further information
-//  DON'T DO IT IN YOUR HEADER!
-SvtSlideSorterBarOptions_Impl* SvtSlideSorterBarOptions::m_pDataContainer= 
nullptr  ;
-sal_Int32  SvtSlideSorterBarOptions::m_nRefCount = 0 ;
+namespace {
+std::weak_ptr g_pSlideSorterBarOptions;
+}
 
 SvtSlideSorterBarOptions::SvtSlideSorterBarOptions()
 {
 // Global access, must be guarded (multithreading!).
 MutexGuard aGuard( GetInitMutex() );
-++m_nRefCount;
-// ... and initialize our data container only if it not already exist!
-if( m_pDataContainer == nullptr )
+
+m_pImpl = g_pSlideSorterBarOptions.lock();
+if( !m_pImpl )
 {
-   m_pDataContainer = new SvtSlideSorterBarOptions_Impl;
+m_pImpl = std::make_shared();
+g_pSlideSorterBarOptions = m_pImpl;
 }
 }
 
@@ -364,75 +365,68 @@ SvtSlideSorterBarOptions::~SvtSlideSorterBarOptions()
 {
 // Global access, must be guarded (multithreading!)
 MutexGuard aGuard( GetInitMutex() );
---m_nRefCount;
-// If last instance was deleted we must destroy our static data container!
-if( m_nRefCount <= 0 )
-{
-if (m_pDataContainer->IsModified())
-m_pDataContainer->Commit();
-delete m_pDataContainer;
-m_pDataContainer = nullptr;
-}
+
+m_pImpl.reset();
 }
 
 bool 

[Libreoffice-commits] core.git: include/svtools svtools/source

2016-06-21 Thread Xisco Fauli
 include/svtools/optionsdrawinglayer.hxx   |   24 
 svtools/source/config/optionsdrawinglayer.cxx |  155 +++---
 2 files changed, 46 insertions(+), 133 deletions(-)

New commits:
commit 5ee7d509e7c6d78e758286efb6145385a310cfa5
Author: Xisco Fauli 
Date:   Wed Jun 15 01:57:25 2016 +0200

tdf#89329: use shared_ptr for pImpl in optionsdrawinglayer

Change-Id: Ic9da196c1dfe138ff6408a37fa8ff70492d00bc2
Reviewed-on: https://gerrit.libreoffice.org/26282
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/svtools/optionsdrawinglayer.hxx 
b/include/svtools/optionsdrawinglayer.hxx
index 25951f6..c096f48 100644
--- a/include/svtools/optionsdrawinglayer.hxx
+++ b/include/svtools/optionsdrawinglayer.hxx
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 
 
/*-
 @short  forward declaration to our private date container 
implementation
@@ -44,17 +45,6 @@ class SVT_DLLPUBLIC SvtOptionsDrawinglayer
 {
 public:
 
-
/*-
-@short  standard constructor and destructor
-@descr  This will initialize an instance with default values.
-We implement these class with a refcount mechanism! 
Every instance of this class increase it
-at create and decrease it at delete time - but all 
instances use the same data container!
-He is implemented as a static member ...
-
-@seealsomember m_nRefCount
-@seealsomember m_pDataContainer
-
*//*-*/
-
  SvtOptionsDrawinglayer();
 ~SvtOptionsDrawinglayer();
 
@@ -140,17 +130,7 @@ class SVT_DLLPUBLIC SvtOptionsDrawinglayer
 
*//*-*/
 SVT_DLLPRIVATE static ::osl::Mutex& GetOwnStaticMutex();
 
-/*Attention
-
-Don't initialize these static members in these headers!
-a) Double defined symbols will be detected ...
-b) and unresolved externals exist at linking time.
-Do it in your source only.
- */
-
-static SvtOptionsDrawinglayer_Impl* m_pDataContainer;
-static sal_Int32m_nRefCount ;
-
+std::shared_ptr m_pImpl;
 };
 
 #endif  // #ifndef INCLUDED_SVTOOLS_OPTIONSDRAWINGLAYER_HXX
diff --git a/svtools/source/config/optionsdrawinglayer.cxx 
b/svtools/source/config/optionsdrawinglayer.cxx
index ce7eaa8..fbf76ea 100644
--- a/svtools/source/config/optionsdrawinglayer.cxx
+++ b/svtools/source/config/optionsdrawinglayer.cxx
@@ -28,10 +28,8 @@
 #include 
 #include 
 
-
 //  namespaces
 
-
 using namespace ::utl   ;
 using namespace ::osl   ;
 using namespace ::com::sun::star::uno   ;
@@ -157,23 +155,11 @@ using namespace ::com::sun::star::uno   ;
 class SvtOptionsDrawinglayer_Impl : public ConfigItem
 {
 public:
-
-
-//  constructor / destructor
-
-
- SvtOptionsDrawinglayer_Impl();
-virtual ~SvtOptionsDrawinglayer_Impl();
-
-
-//  override methods of baseclass
+SvtOptionsDrawinglayer_Impl();
+~SvtOptionsDrawinglayer_Impl();
 
 virtual void Notify( const css::uno::Sequence& aPropertyNames) 
override;
 
-
-//  public interface
-
-
 boolIsOverlayBuffer() const { return m_bOverlayBuffer;}
 boolIsPaintBuffer() const { return m_bPaintBuffer;}
 const Color& GetStripeColorA() const { return m_bStripeColorA;}
@@ -220,8 +206,7 @@ public:
 //  private methods
 
 private:
-
-virtual void ImplCommit() override;
+virtual void ImplCommit() SAL_FINAL override;
 
 static Sequence< OUString > impl_GetPropertyNames();
 
@@ -272,9 +257,6 @@ private:
 boolm_bAllowAAChecked : 1;
 };
 
-
-//  constructor
-
 SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl() :
 ConfigItem( ROOTNODE_START  ),
 m_bOverlayBuffer( DEFAULT_OVERLAYBUFFER ),
@@ -535,15 +517,12 @@ 
SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl() :
 }
 }
 
-
-//  destructor
-
 SvtOptionsDrawinglayer_Impl::~SvtOptionsDrawinglayer_Impl()
 {
-assert(!IsModified()); // should have been committed
+if (IsModified())
+Commit();
 }
 
-
 //  Commit
 
 void SvtOptionsDrawinglayer_Impl::ImplCommit()
@@ -676,32 +655,12 @@ void SvtOptionsDrawinglayer_Impl::ImplCommit()
 void SvtOptionsDrawinglayer_Impl::Notify( const css::uno::Sequence& )
 {
 }
-
-
-//  public method
-
-
-//  public method
-
-
-//  public method
-
-
-//  public method
-
-
-//  public method
-
-
 // 

[Libreoffice-commits] core.git: include/svtools svtools/source

2016-06-17 Thread Xisco Fauli
 include/svtools/helpopt.hxx   |3 +-
 svtools/source/config/helpopt.cxx |   56 ++
 2 files changed, 29 insertions(+), 30 deletions(-)

New commits:
commit 81071d8a877c5883b871a2699955ab3ef62b0bee
Author: Xisco Fauli 
Date:   Wed Jun 15 01:56:58 2016 +0200

tdf#89329: use shared_ptr for pImpl in helpopt

Change-Id: I9d3fa64405f70cfa942935eaae6cc520f172d70d
Reviewed-on: https://gerrit.libreoffice.org/26281
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/svtools/helpopt.hxx b/include/svtools/helpopt.hxx
index c9f44c7..3651469 100644
--- a/include/svtools/helpopt.hxx
+++ b/include/svtools/helpopt.hxx
@@ -24,12 +24,13 @@
 #include 
 #include 
 #include 
+#include 
 
 class SvtHelpOptions_Impl;
 
 class SVT_DLLPUBLIC SvtHelpOptions: public utl::detail::Options
 {
-SvtHelpOptions_Impl*pImp;
+std::shared_ptrpImpl;
 
 public:
 SvtHelpOptions();
diff --git a/svtools/source/config/helpopt.cxx 
b/svtools/source/config/helpopt.cxx
index 94edac0..ca6b9c0 100644
--- a/svtools/source/config/helpopt.cxx
+++ b/svtools/source/config/helpopt.cxx
@@ -36,9 +36,10 @@ using namespace utl;
 using namespace com::sun::star::uno;
 using namespace com::sun::star;
 
-
-static SvtHelpOptions_Impl* pOptions = nullptr;
-static sal_Int32   nRefCount = 0;
+namespace {
+//global
+std::weak_ptr g_pHelpOptions;
+}
 
 enum class HelpProperty
 {
@@ -60,10 +61,11 @@ class SvtHelpOptions_Impl : public utl::ConfigItem
 
 static Sequence< OUString > GetPropertyNames();
 
-virtual voidImplCommit() override;
+virtual voidImplCommit() SAL_FINAL override;
 
 public:
 SvtHelpOptions_Impl();
+~SvtHelpOptions_Impl();
 
 virtual voidNotify( const css::uno::Sequence< OUString >& 
aPropertyNames ) override;
 voidLoad( const css::uno::Sequence< OUString>& aPropertyNames);
@@ -119,7 +121,6 @@ Sequence< OUString > SvtHelpOptions_Impl::GetPropertyNames()
 return *pMutex;
 }
 
-
 SvtHelpOptions_Impl::SvtHelpOptions_Impl()
 : ConfigItem( OUString( "Office.Common/Help" ) )
 , bExtendedHelp( false )
@@ -131,6 +132,11 @@ SvtHelpOptions_Impl::SvtHelpOptions_Impl()
 EnableNotification( aNames );
 }
 
+SvtHelpOptions_Impl::~SvtHelpOptions_Impl()
+{
+if ( IsModified() )
+Commit();
+}
 
 static int lcl_MapPropertyName( const OUString& rCompare,
 const uno::Sequence< OUString>& aInternalPropertyNames)
@@ -211,7 +217,6 @@ void  SvtHelpOptions_Impl::Load(const uno::Sequence< 
OUString>& rPropertyNames)
 }
 }
 
-
 void SvtHelpOptions_Impl::ImplCommit()
 {
 Sequence< OUString > aNames = GetPropertyNames();
@@ -246,7 +251,6 @@ void SvtHelpOptions_Impl::ImplCommit()
 PutProperties( aNames, aValues );
 }
 
-
 void SvtHelpOptions_Impl::Notify( const Sequence& aPropertyNames )
 {
 Load( aPropertyNames );
@@ -256,73 +260,67 @@ SvtHelpOptions::SvtHelpOptions()
 {
 // Global access, must be guarded (multithreading)
 ::osl::MutexGuard aGuard( SvtHelpOptions_Impl::getInitMutex() );
-++nRefCount;
-if ( !pOptions )
-{
-pOptions = new SvtHelpOptions_Impl;
 
+pImpl = g_pHelpOptions.lock();
+if ( !pImpl )
+{
+pImpl = std::make_shared();
+g_pHelpOptions = pImpl;
 svtools::ItemHolder2::holdConfigItem(E_HELPOPTIONS);
 }
-pImp = pOptions;
 }
 
-
 SvtHelpOptions::~SvtHelpOptions()
 {
 // Global access, must be guarded (multithreading)
 ::osl::MutexGuard aGuard( SvtHelpOptions_Impl::getInitMutex() );
-if ( !--nRefCount )
-{
-if ( pOptions->IsModified() )
-pOptions->Commit();
-DELETEZ( pOptions );
-}
+
+pImpl.reset();
 }
 
 void SvtHelpOptions::SetExtendedHelp( bool b )
 {
-pImp->SetExtendedHelp( b );
+pImpl->SetExtendedHelp( b );
 }
 
 bool SvtHelpOptions::IsExtendedHelp() const
 {
-return pImp->IsExtendedHelp();
+return pImpl->IsExtendedHelp();
 }
 
 void SvtHelpOptions::SetHelpTips( bool b )
 {
-pImp->SetHelpTips( b );
+pImpl->SetHelpTips( b );
 }
 
 bool SvtHelpOptions::IsHelpTips() const
 {
-return pImp->IsHelpTips();
+return pImpl->IsHelpTips();
 }
 
-
 void SvtHelpOptions::SetWelcomeScreen( bool b )
 {
-pImp->SetWelcomeScreen( b );
+pImpl->SetWelcomeScreen( b );
 }
 
 bool SvtHelpOptions::IsWelcomeScreen() const
 {
-return pImp->IsWelcomeScreen();
+return pImpl->IsWelcomeScreen();
 }
 
 OUString SvtHelpOptions::GetSystem() const
 {
-return pImp->GetSystem();
+return pImpl->GetSystem();
 }
 
 const OUString&   SvtHelpOptions::GetHelpStyleSheet()const
 {
-return pImp->GetHelpStyleSheet();
+return pImpl->GetHelpStyleSheet();
 }
 
 void  SvtHelpOptions::SetHelpStyleSheet(const OUString& rStyleSheet)
 {
-pImp->SetHelpStyleSheet(rStyleSheet);
+

[Libreoffice-commits] core.git: include/svtools svtools/source

2016-06-16 Thread Xisco Fauli
 include/svtools/menuoptions.hxx   |   25 +
 svtools/source/config/menuoptions.cxx |   64 +-
 2 files changed, 13 insertions(+), 76 deletions(-)

New commits:
commit 2d2ef979c2feb8cd70a1dbc3f47cf7f86a5d39ea
Author: Xisco Fauli 
Date:   Wed Jun 15 19:34:52 2016 +0200

tdf#89329: use shared_ptr for pImpl in menuoptions

Change-Id: I93ece349dc15ea9af00c661ac34fed80a57ea3d2
Reviewed-on: https://gerrit.libreoffice.org/26318
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/svtools/menuoptions.hxx b/include/svtools/menuoptions.hxx
index e59f6a8..64bdc73 100644
--- a/include/svtools/menuoptions.hxx
+++ b/include/svtools/menuoptions.hxx
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 
 
/*-
 @short  forward declaration to our private date container 
implementation
@@ -43,18 +44,6 @@ class SvtMenuOptions_Impl;
 class SAL_WARN_UNUSED SVT_DLLPUBLIC SvtMenuOptions: public utl::detail::Options
 {
 public:
-
-
/*-
-@short  standard constructor and destructor
-@descr  This will initialize an instance with default values.
-We implement these class with a refcount mechanism! 
Every instance of this class increase it
-at create and decrease it at delete time - but all 
instances use the same data container!
-He is implemented as a static member ...
-
-@seealsomember m_nRefCount
-@seealsomember m_pDataContainer
-
*//*-*/
-
  SvtMenuOptions();
 virtual ~SvtMenuOptions();
 
@@ -91,17 +80,7 @@ class SAL_WARN_UNUSED SVT_DLLPUBLIC SvtMenuOptions: public 
utl::detail::Options
 SVT_DLLPRIVATE static ::osl::Mutex& GetOwnStaticMutex();
 
 private:
-
-/*Attention
-
-Don't initialize these static members in these headers!
-a) Double defined symbols will be detected ...
-b) and unresolved externals exist at linking time.
-Do it in your source only.
- */
-
-static SvtMenuOptions_Impl* m_pDataContainer;
-static sal_Int32m_nRefCount ;
+std::shared_ptr m_pImpl;
 
 };  // class SvtMenuOptions
 
diff --git a/svtools/source/config/menuoptions.cxx 
b/svtools/source/config/menuoptions.cxx
index fc64447..be735a6 100644
--- a/svtools/source/config/menuoptions.cxx
+++ b/svtools/source/config/menuoptions.cxx
@@ -17,7 +17,6 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-
 #include 
 #include 
 #include 
@@ -31,10 +30,8 @@
 
 #include 
 
-
 //  namespaces
 
-
 using namespace ::utl   ;
 using namespace ::osl   ;
 using namespace ::com::sun::star::uno   ;
@@ -58,37 +55,29 @@ using namespace ::com::sun::star::uno   ;
 
 #include 
 
-
 //  private declarations!
 
-
 class SvtMenuOptions_Impl : public ConfigItem
 {
 
 //  private member
 
-
 private:
 boolm_bDontHideDisabledEntries  ;   /// cache 
"DontHideDisabledEntries" of Menu section
 boolm_bFollowMouse  ;   /// cache 
"FollowMouse" of Menu section
 TriStatem_eMenuIcons;   /// cache 
"MenuIcons" of Menu section
 
-
 //  public methods
 
-
 public:
 
-
 //  constructor / destructor
 
-
  SvtMenuOptions_Impl();
 virtual ~SvtMenuOptions_Impl();
 
 //  override methods of baseclass
 
-
 
/*-
 @short  called for notify of configmanager
 @descr  These method is called from the ConfigManager before 
application ends or from the
@@ -104,7 +93,6 @@ class SvtMenuOptions_Impl : public ConfigItem
 
 //  public interface
 
-
 
/*-
 @short  access method to get internal values
 @descr  These methods give us a chance to regulate access to 
our internal values.
@@ -124,10 +112,8 @@ class SvtMenuOptions_Impl : public ConfigItem
 // tdf#93451: don't Commit() here, it's too early
 }
 
-
 //  private methods
 
-
 private:
 
 virtual void ImplCommit() override;
@@ -142,7 +128,6 @@ class SvtMenuOptions_Impl : public ConfigItem
 static Sequence< OUString > impl_GetPropertyNames();
 };
 
-
 //  

[Libreoffice-commits] core.git: include/svtools svtools/source

2016-06-16 Thread Xisco Fauli
 include/svtools/toolpanelopt.hxx   |   29 +-
 svtools/source/config/toolpanelopt.cxx |   43 +
 2 files changed, 20 insertions(+), 52 deletions(-)

New commits:
commit dad8d71f4a73b64e534c1977e09e54905b8e27e8
Author: Xisco Fauli 
Date:   Wed Jun 15 01:20:36 2016 +0200

tdf#89329: use shared_ptr for pImpl in toolpanelopt

Change-Id: I2035971f6633aed1389ffae5815c7000699b9735
Reviewed-on: https://gerrit.libreoffice.org/26279
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/svtools/toolpanelopt.hxx b/include/svtools/toolpanelopt.hxx
index 8fcda68..2480e2e 100644
--- a/include/svtools/toolpanelopt.hxx
+++ b/include/svtools/toolpanelopt.hxx
@@ -25,13 +25,8 @@
 #include 
 #include 
 #include 
+#include 
 
-/** forward declaration to our private date container implementation
-
-We use these class as internal member to support small memory requirements.
-You can create the container if it is necessary. The class which use these 
mechanism
-is faster and smaller then a complete implementation!
-*/
 class SvtToolPanelOptions_Impl;
 
 /** collect information about sidebar group
@@ -41,16 +36,6 @@ class SvtToolPanelOptions_Impl;
 class SVT_DLLPUBLIC SvtToolPanelOptions: public utl::detail::Options
 {
 public:
-/** standard constructor and destructor
-
-This will initialize an instance with default values.
-We implement these class with a refcount mechanism! Every instance 
of this class increase it
-at create and decrease it at delete time - but all instances use 
the same data container!
-He is implemented as a static member ...
-
-\samember m_nRefCount
-\samember m_pDataContainer
-*/
 SvtToolPanelOptions();
 virtual ~SvtToolPanelOptions();
 
@@ -77,17 +62,7 @@ class SVT_DLLPUBLIC SvtToolPanelOptions: public 
utl::detail::Options
 SVT_DLLPRIVATE static ::osl::Mutex& GetInitMutex();
 
 private:
-
-/**
-\attention
-Don't initialize these static members in these headers!
-\li Double defined symbols will be detected ...
-\li and unresolved externals exist at linking time.
-Do it in your source only.
-*/
-static SvtToolPanelOptions_Impl* m_pDataContainer;
-static sal_Int32 m_nRefCount;
-
+std::shared_ptr m_pImpl;
 };
 
 #endif
diff --git a/svtools/source/config/toolpanelopt.cxx 
b/svtools/source/config/toolpanelopt.cxx
index bddf81d..5294886 100644
--- a/svtools/source/config/toolpanelopt.cxx
+++ b/svtools/source/config/toolpanelopt.cxx
@@ -297,20 +297,18 @@ Sequence< OUString > 
SvtToolPanelOptions_Impl::GetPropertyNames()
 return Sequence< OUString >( pProperties, SAL_N_ELEMENTS( pProperties ) );
 }
 
-//  initialize static member, see definition for further information
-//  DON'T DO IT IN YOUR HEADER!
-SvtToolPanelOptions_Impl* SvtToolPanelOptions::m_pDataContainer = nullptr;
-sal_Int32   SvtToolPanelOptions::m_nRefCount = 0;
+std::weak_ptr m_pOptions;
 
 SvtToolPanelOptions::SvtToolPanelOptions()
 {
 // Global access, must be guarded (multithreading!).
 MutexGuard aGuard( GetInitMutex() );
-++m_nRefCount;
-// ... and initialize our data container only if it not already exist!
-if( m_pDataContainer == nullptr )
+
+m_pImpl = m_pOptions.lock();
+if( !m_pImpl )
 {
-   m_pDataContainer = new SvtToolPanelOptions_Impl;
+   m_pImpl = std::make_shared();
+   m_pOptions = m_pImpl;
 }
 }
 
@@ -318,63 +316,58 @@ SvtToolPanelOptions::~SvtToolPanelOptions()
 {
 // Global access, must be guarded (multithreading!)
 MutexGuard aGuard( GetInitMutex() );
---m_nRefCount;
-// If last instance was deleted we must destroy our static data container!
-if( m_nRefCount <= 0 )
-{
-delete m_pDataContainer;
-m_pDataContainer = nullptr;
-}
+
+m_pImpl.reset();
 }
 
 bool SvtToolPanelOptions::GetVisibleImpressView() const
 {
-return m_pDataContainer->m_bVisibleImpressView;
+return m_pImpl->m_bVisibleImpressView;
 }
 
 void SvtToolPanelOptions::SetVisibleImpressView(bool bVisible)
 {
-m_pDataContainer->m_bVisibleImpressView = bVisible;
+m_pImpl->m_bVisibleImpressView = bVisible;
 }
 
 bool SvtToolPanelOptions::GetVisibleOutlineView() const
 {
-return m_pDataContainer->m_bVisibleOutlineView;
+return m_pImpl->m_bVisibleOutlineView;
 }
 
 void SvtToolPanelOptions::SetVisibleOutlineView(bool bVisible)
 {
-m_pDataContainer->m_bVisibleOutlineView = bVisible;
+m_pImpl->m_bVisibleOutlineView = bVisible;
 }
 
 bool SvtToolPanelOptions::GetVisibleNotesView() const
 {
-return m_pDataContainer->m_bVisibleNotesView;
+return m_pImpl->m_bVisibleNotesView;
 }
 
 void 

[Libreoffice-commits] core.git: include/svtools svtools/source

2016-06-16 Thread Xisco Fauli
 include/svtools/miscopt.hxx   |   24 --
 svtools/source/config/miscopt.cxx |   86 ++
 2 files changed, 34 insertions(+), 76 deletions(-)

New commits:
commit f698ddfeffda7391965b7bb8b488420332ac37bf
Author: Xisco Fauli 
Date:   Wed Jun 15 20:41:11 2016 +0200

tdf#89329: use shared_ptr for pImpl in miscopt

Change-Id: I7c60116d4f14e1451e7b96568104baada01dfaca
Reviewed-on: https://gerrit.libreoffice.org/26330
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/svtools/miscopt.hxx b/include/svtools/miscopt.hxx
index 31b745f..80835a9 100644
--- a/include/svtools/miscopt.hxx
+++ b/include/svtools/miscopt.hxx
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 
 
/*-
 @short  forward declaration to our private date container 
implementation
@@ -45,17 +46,6 @@ class SvtMiscOptions_Impl;
 class SVT_DLLPUBLIC SvtMiscOptions: public utl::detail::Options
 {
 public:
-
/*-
-@short  standard constructor and destructor
-@descr  This will initialize an instance with default values.
-We implement these class with a refcount mechanism! 
Every instance of this class increase it
-at create and decrease it at delete time - but all 
instances use the same data container!
-He is implemented as a static member ...
-
-@seealsomember m_nRefCount
-@seealsomember m_pDataContainer
-
*//*-*/
-
  SvtMiscOptions();
 virtual ~SvtMiscOptions();
 
@@ -108,17 +98,7 @@ class SVT_DLLPUBLIC SvtMiscOptions: public 
utl::detail::Options
 SVT_DLLPRIVATE static ::osl::Mutex& GetInitMutex();
 
 private:
-
-/*Attention
-
-Don't initialize these static members in these headers!
-a) Double defined symbols will be detected ...
-b) and unresolved externals exist at linking time.
-Do it in your source only.
- */
-
-static SvtMiscOptions_Impl* m_pDataContainer;
-static sal_Int32m_nRefCount ;
+std::shared_ptr m_pImpl;
 
 };  // class SvtMiscOptions
 
diff --git a/svtools/source/config/miscopt.cxx 
b/svtools/source/config/miscopt.cxx
index 12108830..e0ecfd8 100644
--- a/svtools/source/config/miscopt.cxx
+++ b/svtools/source/config/miscopt.cxx
@@ -643,85 +643,63 @@ Sequence< OUString > 
SvtMiscOptions_Impl::GetPropertyNames()
 return seqPropertyNames;
 }
 
-
-//  initialize static member
-//  DON'T DO IT IN YOUR HEADER!
-//  see definition for further information
-
-SvtMiscOptions_Impl*SvtMiscOptions::m_pDataContainer= nullptr  ;
-sal_Int32   SvtMiscOptions::m_nRefCount = 0 ;
-
-
-//  constructor
+std::weak_ptr m_pMiscOptions;
 
 SvtMiscOptions::SvtMiscOptions()
 {
-// SvtMiscOptions_Impl ctor indirectly calls code that requires locked
-// SolarMutex; lock it first:
-SolarMutexGuard g;
 // Global access, must be guarded (multithreading!).
 MutexGuard aGuard( GetInitMutex() );
-// Increase our refcount ...
-++m_nRefCount;
-// ... and initialize our data container only if it not already exist!
-if( m_pDataContainer == nullptr )
+
+m_pImpl = m_pMiscOptions.lock();
+if( !m_pImpl )
 {
-   m_pDataContainer = new SvtMiscOptions_Impl;
-   svtools::ItemHolder2::holdConfigItem(E_MISCOPTIONS);
+m_pImpl = std::make_shared();
+m_pMiscOptions = m_pImpl;
+svtools::ItemHolder2::holdConfigItem(E_MISCOPTIONS);
 }
 }
 
-
-//  destructor
-
 SvtMiscOptions::~SvtMiscOptions()
 {
 // Global access, must be guarded (multithreading!)
 MutexGuard aGuard( GetInitMutex() );
-// Decrease our refcount.
---m_nRefCount;
-// If last instance was deleted ...
-// we must destroy our static data container!
-if( m_nRefCount <= 0 )
-{
-delete m_pDataContainer;
-m_pDataContainer = nullptr;
-}
+
+m_pImpl.reset();
 }
 
 bool SvtMiscOptions::UseSystemFileDialog() const
 {
-return m_pDataContainer->UseSystemFileDialog();
+return m_pImpl->UseSystemFileDialog();
 }
 
 void SvtMiscOptions::SetUseSystemFileDialog( bool bEnable )
 {
-m_pDataContainer->SetUseSystemFileDialog( bEnable );
+m_pImpl->SetUseSystemFileDialog( bEnable );
 }
 
 bool SvtMiscOptions::IsUseSystemFileDialogReadOnly() const
 {
-return m_pDataContainer->IsUseSystemFileDialogReadOnly();
+return m_pImpl->IsUseSystemFileDialogReadOnly();
 }
 
 bool 

[Libreoffice-commits] core.git: include/svtools svtools/source sw/inc sw/source

2016-06-02 Thread Noel Grandin
 include/svtools/treelistbox.hxx |3 
 svtools/source/contnr/imivctl.hxx   |4 
 svtools/source/contnr/imivctl1.cxx  |   14 --
 svtools/source/contnr/imivctl2.cxx  |   49 ++--
 svtools/source/contnr/treelistbox.cxx   |  191 +++-
 sw/inc/dbmgr.hxx|2 
 sw/inc/shellio.hxx  |2 
 sw/inc/swabstdlg.hxx|5 
 sw/source/filter/html/htmlflywriter.cxx |8 -
 sw/source/filter/html/wrthtml.hxx   |2 
 sw/source/filter/writer/writer.cxx  |9 -
 sw/source/ui/dialog/swdlgfact.cxx   |5 
 sw/source/ui/dialog/swdlgfact.hxx   |3 
 sw/source/uibase/dbui/dbmgr.cxx |4 
 14 files changed, 127 insertions(+), 174 deletions(-)

New commits:
commit 84d15d6e5418bd5024bb21b6c8fdc2700667ac04
Author: Noel Grandin 
Date:   Wed Jun 1 10:09:07 2016 +0200

loplugin:unuseddefaultparams

Change-Id: I0fe173534dc2e70c3d507eae757a91e48a26acfc
Reviewed-on: https://gerrit.libreoffice.org/25757
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/svtools/treelistbox.hxx b/include/svtools/treelistbox.hxx
index f4342b8..aaeb1f6 100644
--- a/include/svtools/treelistbox.hxx
+++ b/include/svtools/treelistbox.hxx
@@ -560,8 +560,7 @@ protected:
 SVT_DLLPRIVATE void AdjustEntryHeight();
 
 SVT_DLLPRIVATE void ImpEntryInserted( SvTreeListEntry* pEntry );
-SVT_DLLPRIVATE void PaintEntry1( SvTreeListEntry&, long nLine, 
vcl::RenderContext& rRenderContext,
- SvLBoxTabFlags nTabFlagMask = 
SvLBoxTabFlags::ALL );
+SVT_DLLPRIVATE void PaintEntry1( SvTreeListEntry&, long nLine, 
vcl::RenderContext& rRenderContext );
 
 SVT_DLLPRIVATE void InitTreeView();
 SVT_DLLPRIVATE SvLBoxItem*  GetItem_Impl( SvTreeListEntry*, long nX, 
SvLBoxTab** ppTab );
diff --git a/svtools/source/contnr/imivctl.hxx 
b/svtools/source/contnr/imivctl.hxx
index 22d5470..0e0f09e 100644
--- a/svtools/source/contnr/imivctl.hxx
+++ b/svtools/source/contnr/imivctl.hxx
@@ -273,7 +273,7 @@ class SvxIconChoiceCtrl_Impl
 Rectangle   CalcMaxTextRect( const SvxIconChoiceCtrlEntry* pEntry 
) const;
 
 voidClipAtVirtOutRect( Rectangle& rRect ) const;
-voidAdjustAtGrid( const SvxIconChoiceCtrlEntryPtrVec& 
rRow, SvxIconChoiceCtrlEntry* pStart=nullptr );
+voidAdjustAtGrid( const SvxIconChoiceCtrlEntryPtrVec& rRow 
);
 Point   AdjustAtGrid(
 const Rectangle& rCenterRect, // balance point of 
object (typically Bmp-Rect)
 const Rectangle& rBoundRect
@@ -547,7 +547,7 @@ public:
 // Creates a list of entries for every row (height = nGridDY) sorted by
 // BoundRect.Left(). A list may be empty. The lists become the property of
 // the caller and have to be deleted with DestroyGridAdjustData.
-voidCreateGridAjustData( IconChoiceMap& pLists, 
SvxIconChoiceCtrlEntry* pRow=nullptr);
+voidCreateGridAjustData( IconChoiceMap& pLists );
 static void DestroyGridAdjustData( IconChoiceMap& rLists );
 };
 
diff --git a/svtools/source/contnr/imivctl1.cxx 
b/svtools/source/contnr/imivctl1.cxx
index 75c79f3..64b2d3d 100644
--- a/svtools/source/contnr/imivctl1.cxx
+++ b/svtools/source/contnr/imivctl1.cxx
@@ -2724,29 +2724,19 @@ void SvxIconChoiceCtrl_Impl::AdjustEntryAtGrid()
 }
 
 // align a row, might expand width, doesn't break the line
-void SvxIconChoiceCtrl_Impl::AdjustAtGrid( const SvxIconChoiceCtrlEntryPtrVec& 
rRow, SvxIconChoiceCtrlEntry* pStart )
+void SvxIconChoiceCtrl_Impl::AdjustAtGrid( const SvxIconChoiceCtrlEntryPtrVec& 
rRow )
 {
 if( rRow.empty() )
 return;
 
-bool bGo;
-if( !pStart )
-bGo = true;
-else
-bGo = false;
-
 long nCurRight = 0;
 for(SvxIconChoiceCtrlEntry* pCur : rRow)
 {
-if( !bGo && pCur == pStart )
-bGo = true;
-
-// SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pCur);
 // Decisive (for our eye) is the bitmap, else, the entry might jump too
 // much within long texts.
 const Rectangle& rBoundRect = GetEntryBoundRect( pCur );
 Rectangle aCenterRect( CalcBmpRect( pCur ));
-if( bGo && !pCur->IsPosLocked() )
+if( !pCur->IsPosLocked() )
 {
 long nWidth = aCenterRect.GetSize().Width();
 Point aNewPos( AdjustAtGrid( aCenterRect, rBoundRect ) );
diff --git a/svtools/source/contnr/imivctl2.cxx 
b/svtools/source/contnr/imivctl2.cxx
index f785b0e..e9a914d 100644
--- a/svtools/source/contnr/imivctl2.cxx
+++ b/svtools/source/contnr/imivctl2.cxx
@@ -479,46 +479,21 @@ void IcnCursor_Impl::SetDeltas()
 }
 }
 
-void IcnCursor_Impl::CreateGridAjustData( 

[Libreoffice-commits] core.git: include/svtools svtools/source

2016-06-01 Thread Xisco Fauli
 include/svtools/toolbarmenu.hxx|2 +-
 svtools/source/control/toolbarmenu.cxx |6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 3aaa90c36c2910847576bd9362276b0e9b5acca4
Author: Xisco Fauli 
Date:   Thu May 26 01:48:15 2016 +0200

tdf#89329: use unique_ptr for pImpl in toolbarmenu

Change-Id: I2adafe082bd83edc31777f11f66313a51fde7d81
Reviewed-on: https://gerrit.libreoffice.org/25478
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/svtools/toolbarmenu.hxx b/include/svtools/toolbarmenu.hxx
index a5f06e7..ac38dbd 100644
--- a/include/svtools/toolbarmenu.hxx
+++ b/include/svtools/toolbarmenu.hxx
@@ -129,7 +129,7 @@ private:
 ToolbarMenuEntry*   implGetEntry( int nEntry ) const;
 ToolbarMenuEntry*   implSearchEntry( int nEntryId ) const;
 
-ToolbarMenu_Impl*   mpImpl;
+std::unique_ptr   mpImpl;
 };
 
 } // namespace svtools
diff --git a/svtools/source/control/toolbarmenu.cxx 
b/svtools/source/control/toolbarmenu.cxx
index c846ef0..71accc7 100644
--- a/svtools/source/control/toolbarmenu.cxx
+++ b/svtools/source/control/toolbarmenu.cxx
@@ -411,7 +411,7 @@ ToolbarMenu::ToolbarMenu( const Reference< XFrame >& 
rFrame, vcl::Window* pParen
 
 void ToolbarMenu::implInit(const Reference< XFrame >& rFrame)
 {
-mpImpl = new ToolbarMenu_Impl( *this, rFrame );
+mpImpl.reset( new ToolbarMenu_Impl( *this, rFrame ) );
 
 const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
 SetControlBackground( rStyleSettings.GetMenuColor() );
@@ -443,8 +443,8 @@ void ToolbarMenu::dispose()
 
 mpImpl->mxAccessible.clear();
 
-std::unique_ptr pImpl{mpImpl};
-mpImpl = nullptr;
+std::unique_ptr pImpl = std::move(pImpl);
+mpImpl.reset();
 
 pImpl->maEntryVector.clear();
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2016-05-26 Thread Xisco Fauli
 include/svtools/transfer.hxx  |2 +-
 svtools/source/misc/transfer2.cxx |1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 86d84ae4bba0d4c45bc13232645318291a8aed75
Author: Xisco Fauli 
Date:   Thu May 26 01:50:38 2016 +0200

tdf#89329: use unique_ptr for pImpl in transfer

Change-Id: Ia28a7bd63c8f3a06ef2fd508619bae3a31af450c
Reviewed-on: https://gerrit.libreoffice.org/25479
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/svtools/transfer.hxx b/include/svtools/transfer.hxx
index 9734c89..ea50c8e 100644
--- a/include/svtools/transfer.hxx
+++ b/include/svtools/transfer.hxx
@@ -481,7 +481,7 @@ struct TransferDataContainer_Impl;
 
 class SVT_DLLPUBLIC TransferDataContainer : public TransferableHelper
 {
-TransferDataContainer_Impl* pImpl;
+std::unique_ptr pImpl;
 
 protected:
 
diff --git a/svtools/source/misc/transfer2.cxx 
b/svtools/source/misc/transfer2.cxx
index 3d3a7c6..782b804 100644
--- a/svtools/source/misc/transfer2.cxx
+++ b/svtools/source/misc/transfer2.cxx
@@ -344,7 +344,6 @@ TransferDataContainer::TransferDataContainer()
 
 TransferDataContainer::~TransferDataContainer()
 {
-delete pImpl;
 }
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2016-05-26 Thread Xisco Fauli
 include/svtools/addresstemplate.hxx|3 +--
 svtools/source/dialogs/addresstemplate.cxx |2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 205863589da24441546f77f36fda8bc27489ac93
Author: Xisco Fauli 
Date:   Thu May 26 01:26:46 2016 +0200

tdf#89329: use unique_ptr for pImpl in addresstemplate

Change-Id: I3e2cac86101e8a82eefacbe937cf40139fa77090
Reviewed-on: https://gerrit.libreoffice.org/25473
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/svtools/addresstemplate.hxx 
b/include/svtools/addresstemplate.hxx
index 3406a26..e52b17a 100644
--- a/include/svtools/addresstemplate.hxx
+++ b/include/svtools/addresstemplate.hxx
@@ -64,8 +64,7 @@ namespace svt
 css::uno::Reference< css::container::XNameAccess >
m_xCurrentDatasourceTables;
 
-AddressBookSourceDialogData*
-   m_pImpl;
+std::unique_ptr m_pImpl;
 
 public:
 AddressBookSourceDialog( vcl::Window* _pParent,
diff --git a/svtools/source/dialogs/addresstemplate.cxx 
b/svtools/source/dialogs/addresstemplate.cxx
index 073d890..e6118aa 100644
--- a/svtools/source/dialogs/addresstemplate.cxx
+++ b/svtools/source/dialogs/addresstemplate.cxx
@@ -729,7 +729,7 @@ void AssignmentPersistentData::ImplCommit()
 
 void AddressBookSourceDialog::dispose()
 {
-delete m_pImpl;
+m_pImpl.reset();
 m_pDatasource.clear();
 m_pAdministrateDatasources.clear();
 m_pTable.clear();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2016-05-26 Thread Xisco Fauli
 include/svtools/hyperlabel.hxx|4 +---
 svtools/source/control/hyperlabel.cxx |2 +-
 2 files changed, 2 insertions(+), 4 deletions(-)

New commits:
commit 61a70fb5094ca6edfef9500f358c517e6674cb0c
Author: Xisco Fauli 
Date:   Thu May 26 01:37:50 2016 +0200

tdf#89329: use unique_ptr for pImpl in hyperlabel

Change-Id: I697eb48591c53ba27c99fc86baa4b8b33e7c9fd1
Reviewed-on: https://gerrit.libreoffice.org/25474
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/svtools/hyperlabel.hxx b/include/svtools/hyperlabel.hxx
index b70e706..6e027c7 100644
--- a/include/svtools/hyperlabel.hxx
+++ b/include/svtools/hyperlabel.hxx
@@ -29,14 +29,12 @@
 
 namespace svt
 {
-
-
 class HyperLabelImpl;
 
 class HyperLabel : public FixedText
 {
 protected:
-HyperLabelImpl* m_pImpl;
+std::unique_ptr m_pImpl;
 Link  maClickHdl;
 
 virtual voidMouseMove( const MouseEvent& rMEvt ) override;
diff --git a/svtools/source/control/hyperlabel.cxx 
b/svtools/source/control/hyperlabel.cxx
index 4530f99..9fb0879 100644
--- a/svtools/source/control/hyperlabel.cxx
+++ b/svtools/source/control/hyperlabel.cxx
@@ -159,7 +159,7 @@ namespace svt
 
 void HyperLabel::dispose()
 {
-delete m_pImpl;
+m_pImpl.reset();
 FixedText::dispose();
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2016-05-26 Thread Xisco Fauli
 include/svtools/roadmapwizard.hxx|4 +---
 svtools/source/dialogs/roadmapwizard.cxx |3 +--
 2 files changed, 2 insertions(+), 5 deletions(-)

New commits:
commit 9a2bbaad2667c025744792948961606fbcc5029c
Author: Xisco Fauli 
Date:   Thu May 26 01:40:23 2016 +0200

tdf#89329: use unique_ptr for pImpl in roadmapwizard

Change-Id: I37c24d830ae702579fe14ecba627d7f1d363eef6
Reviewed-on: https://gerrit.libreoffice.org/25475
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/svtools/roadmapwizard.hxx 
b/include/svtools/roadmapwizard.hxx
index 7e588e9..1fb57e3 100644
--- a/include/svtools/roadmapwizard.hxx
+++ b/include/svtools/roadmapwizard.hxx
@@ -26,8 +26,6 @@
 
 namespace svt
 {
-
-
 struct RoadmapWizardImpl;
 class RoadmapWizard;
 
@@ -64,7 +62,7 @@ namespace svt
 class SVT_DLLPUBLIC RoadmapWizard : public OWizardMachine, public 
RoadmapWizardTypes
 {
 private:
-RoadmapWizardImpl*  m_pImpl;
+std::unique_ptr  m_pImpl;
 
 public:
 RoadmapWizard(
diff --git a/svtools/source/dialogs/roadmapwizard.cxx 
b/svtools/source/dialogs/roadmapwizard.cxx
index 1df26b6..4fa72e8 100644
--- a/svtools/source/dialogs/roadmapwizard.cxx
+++ b/svtools/source/dialogs/roadmapwizard.cxx
@@ -150,8 +150,7 @@ namespace svt
 
 void RoadmapWizard::dispose()
 {
-delete m_pImpl;
-m_pImpl = nullptr;
+m_pImpl.reset();
 OWizardMachine::dispose();
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2016-05-26 Thread Xisco Fauli
 include/svtools/svlbitm.hxx   |2 +-
 svtools/source/contnr/svlbitm.cxx |1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 832c9b7b9107ca2f2a85dbf4e0e42a4c2b62a174
Author: Xisco Fauli 
Date:   Thu May 26 01:42:14 2016 +0200

tdf#89329: use unique_ptr for pImpl in svlbitm

Change-Id: If047546c953a5f3bf7af3f99fb7f9d604e0bdba8
Reviewed-on: https://gerrit.libreoffice.org/25476
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/svtools/svlbitm.hxx b/include/svtools/svlbitm.hxx
index 516e231..06b3a40e 100644
--- a/include/svtools/svlbitm.hxx
+++ b/include/svtools/svlbitm.hxx
@@ -241,7 +241,7 @@ struct SvLBoxContextBmp_Impl;
 
 class SVT_DLLPUBLIC SvLBoxContextBmp : public SvLBoxItem
 {
-SvLBoxContextBmp_Impl*  m_pImpl;
+std::unique_ptr  m_pImpl;
 public:
 SvLBoxContextBmp(Image aBmp1,
  Image aBmp2,
diff --git a/svtools/source/contnr/svlbitm.cxx 
b/svtools/source/contnr/svlbitm.cxx
index ccc86ca..353ff60 100644
--- a/svtools/source/contnr/svlbitm.cxx
+++ b/svtools/source/contnr/svlbitm.cxx
@@ -463,7 +463,6 @@ SvLBoxContextBmp::SvLBoxContextBmp()
 
 SvLBoxContextBmp::~SvLBoxContextBmp()
 {
-delete m_pImpl;
 }
 
 sal_uInt16 SvLBoxContextBmp::GetType() const
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2016-05-26 Thread Xisco Fauli
 include/svtools/svtabbx.hxx   |2 +-
 svtools/source/contnr/svtabbx.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit bb694dfef762327a5446338aa1a1ad23ed8970ed
Author: Xisco Fauli 
Date:   Thu May 26 01:44:07 2016 +0200

tdf#89329: use unique_ptr for pImpl in svtabbx

Change-Id: I40a826f6430532769590e6c34d8a98997127fc2e
Reviewed-on: https://gerrit.libreoffice.org/25477
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/svtools/svtabbx.hxx b/include/svtools/svtabbx.hxx
index bf86082..6a0b866 100644
--- a/include/svtools/svtabbx.hxx
+++ b/include/svtools/svtabbx.hxx
@@ -128,7 +128,7 @@ private:
 typedef ::std::vector< css::uno::Reference< 
css::accessibility::XAccessible > > AccessibleChildren;
 
 boolm_bFirstPaint;
-::svt::SvHeaderTabListBoxImpl*  m_pImpl;
+std::unique_ptr<::svt::SvHeaderTabListBoxImpl>  m_pImpl;
 ::svt::IAccessibleTabListBox*   m_pAccessible;
 AccessibleChildren  m_aAccessibleChildren;
 
diff --git a/svtools/source/contnr/svtabbx.cxx 
b/svtools/source/contnr/svtabbx.cxx
index f3a9d92..f0345af 100644
--- a/svtools/source/contnr/svtabbx.cxx
+++ b/svtools/source/contnr/svtabbx.cxx
@@ -519,7 +519,7 @@ SvHeaderTabListBox::~SvHeaderTabListBox()
 
 void SvHeaderTabListBox::dispose()
 {
-delete m_pImpl;
+m_pImpl.reset();
 SvTabListBox::dispose();
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2016-05-26 Thread Xisco Fauli
 include/svtools/treelistbox.hxx   |4 
 svtools/source/contnr/iconview.cxx|7 
 svtools/source/contnr/treelistbox.cxx |  276 --
 3 files changed, 141 insertions(+), 146 deletions(-)

New commits:
commit 2ef6a52edddcca851c8b4555fd45e8f88d23a7bb
Author: Xisco Fauli 
Date:   Thu May 26 01:56:34 2016 +0200

tdf#89329: use unique_ptr for pImpl in treelistbox

Change-Id: I5ba1638c905893f62d6d24d7c88cbb66aaa7c786
Reviewed-on: https://gerrit.libreoffice.org/25480
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/svtools/treelistbox.hxx b/include/svtools/treelistbox.hxx
index 003122b..f4342b8 100644
--- a/include/svtools/treelistbox.hxx
+++ b/include/svtools/treelistbox.hxx
@@ -230,7 +230,7 @@ class SVT_DLLPUBLIC SvTreeListBox
 friend class IconViewImpl;
 friend class TreeControlPeer;
 
-SvTreeListBoxImpl* mpImpl;
+std::unique_ptr mpImpl;
 Link  aCheckButtonHdl;
 Link  aScrolledHdl;
 Link  aExpandedHdl;
@@ -267,7 +267,7 @@ class SVT_DLLPUBLIC SvTreeListBox
 SvLBoxItem* pEdItem;
 
 protected:
-SvImpLBox*  pImp;
+std::unique_ptr  pImpl;
 short   nColumns;
 short   nEntryHeight;
 short   nEntryWidth;
diff --git a/svtools/source/contnr/iconview.cxx 
b/svtools/source/contnr/iconview.cxx
index b50f9e4..bfa6783 100644
--- a/svtools/source/contnr/iconview.cxx
+++ b/svtools/source/contnr/iconview.cxx
@@ -30,10 +30,7 @@ IconView::IconView( vcl::Window* pParent, WinBits nBits )
 SetEntryHeight( 100 );
 SetEntryWidth( 100 );
 
-if(pImp)
-delete pImp;
-
-pImp = new IconViewImpl( this, GetModel(), GetStyle() );
+pImpl.reset( new IconViewImpl( this, GetModel(), GetStyle() ) );
 }
 
 void IconView::Resize()
@@ -92,7 +89,7 @@ void IconView::PaintEntry(SvTreeListEntry& rEntry, long nX, 
long nY,
 
 PreparePaint(rRenderContext, rEntry);
 
-pImp->UpdateContextBmpWidthMax();
+pImpl->UpdateContextBmpWidthMax();
 
 short nTempEntryHeight = GetEntryHeight();
 short nTempEntryWidth = GetEntryWidth();
diff --git a/svtools/source/contnr/treelistbox.cxx 
b/svtools/source/contnr/treelistbox.cxx
index 3008069..dd742ae 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -1355,7 +1355,7 @@ void SvTreeListBox::InitTreeView()
 nTreeFlags = SvTreeFlags::RECALCTABS;
 nIndent = SV_LBOX_DEFAULT_INDENT_PIXEL;
 nEntryHeightOffs = SV_ENTRYHEIGHTOFFS_PIXEL;
-pImp = new SvImpLBox( this, GetModel(), GetStyle() );
+pImpl.reset( new SvImpLBox( this, GetModel(), GetStyle() ) );
 
 mbContextBmpExpanded = true;
 nContextBmpWidthMax = 0;
@@ -1449,11 +1449,10 @@ SvTreeListBox::~SvTreeListBox()
 
 void SvTreeListBox::dispose()
 {
-if( pImp )
+if( pImpl )
 {
-pImp->CallEventListeners( VCLEVENT_OBJECT_DYING );
-delete pImp;
-pImp = nullptr;
+pImpl->CallEventListeners( VCLEVENT_OBJECT_DYING );
+pImpl.reset();
 }
 if( mpImpl )
 {
@@ -1479,8 +1478,7 @@ void SvTreeListBox::dispose()
 g_pDDSource = nullptr;
 if (this == g_pDDTarget)
 g_pDDTarget = nullptr;
-delete mpImpl;
-mpImpl = nullptr;
+mpImpl.reset();
 }
 
 Control::dispose();
@@ -1488,12 +1486,12 @@ void SvTreeListBox::dispose()
 
 void SvTreeListBox::SetExtendedWinBits( ExtendedWinBits _nBits )
 {
-pImp->SetExtendedWindowBits( _nBits );
+pImpl->SetExtendedWindowBits( _nBits );
 }
 
 void SvTreeListBox::SetModel( SvTreeList* pNewModel )
 {
-pImp->SetModel( pNewModel );
+pImpl->SetModel( pNewModel );
 SetBaseModel(pNewModel);
 }
 
@@ -1516,17 +1514,17 @@ void SvTreeListBox::DisconnectFromModel()
 pNewModel->SetRefCount( 0 );// else this will never be deleted
 SvListView::SetModel( pNewModel );
 
-pImp->SetModel( GetModel() );
+pImpl->SetModel( GetModel() );
 }
 
 void SvTreeListBox::SetSublistOpenWithReturn()
 {
-pImp->bSubLstOpRet = true;
+pImpl->bSubLstOpRet = true;
 }
 
 void SvTreeListBox::SetSublistOpenWithLeftRight()
 {
-pImp->bSubLstOpLR = true;
+pImpl->bSubLstOpLR = true;
 }
 
 void SvTreeListBox::Resize()
@@ -1536,10 +1534,10 @@ void SvTreeListBox::Resize()
 
 Control::Resize();
 
-pImp->Resize();
+pImpl->Resize();
 nFocusWidth = -1;
-pImp->ShowCursor( false );
-pImp->ShowCursor( true );
+pImpl->ShowCursor( false );
+pImpl->ShowCursor( true );
 }
 
 /* Cases:
@@ -1670,7 +1668,7 @@ void SvTreeListBox::SetTabs()
 AddTab( nStartPos, TABFLAGS_TEXT );
 break;
 }
-pImp->NotifyTabsChanged();
+pImpl->NotifyTabsChanged();
 }
 
 void SvTreeListBox::InitEntry(SvTreeListEntry* pEntry,
@@ -1727,8 +1725,8 

[Libreoffice-commits] core.git: include/svtools svtools/source

2016-05-26 Thread Xisco Fauli
 include/svtools/wizardmachine.hxx|2 +-
 svtools/source/dialogs/wizardmachine.cxx |3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 2c7a0652b86a24b6ea42746002dfaec09737f58a
Author: Xisco Fauli 
Date:   Thu May 26 01:58:04 2016 +0200

tdf#89329: use unique_ptr for pImpl in wizardmachine

Change-Id: Ie29a95fb913a7141ad6789db236f12c73c283a58
Reviewed-on: https://gerrit.libreoffice.org/25481
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/svtools/wizardmachine.hxx 
b/include/svtools/wizardmachine.hxx
index 0203198..4289d6b 100644
--- a/include/svtools/wizardmachine.hxx
+++ b/include/svtools/wizardmachine.hxx
@@ -166,7 +166,7 @@ namespace svt
 
 private:
 // hold members in this structure to allow keeping compatible when 
members are added
-WizardMachineImplData*  m_pImpl;
+std::unique_ptr  m_pImpl;
 
 public:
 OWizardMachine(vcl::Window* _pParent, const WinBits i_nStyle, 
WizardButtonFlags _nButtonFlags );
diff --git a/svtools/source/dialogs/wizardmachine.cxx 
b/svtools/source/dialogs/wizardmachine.cxx
index edeab91..f7066e0 100644
--- a/svtools/source/dialogs/wizardmachine.cxx
+++ b/svtools/source/dialogs/wizardmachine.cxx
@@ -211,8 +211,7 @@ namespace svt
 if (pPage)
 pPage->disposeOnce();
 }
-delete m_pImpl;
-m_pImpl = nullptr;
+m_pImpl.reset();
 }
 
 WizardDialog::dispose();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2016-05-26 Thread Xisco Fauli
 include/svtools/fileview.hxx   |2 
 svtools/source/contnr/fileview.cxx |  127 ++---
 2 files changed, 63 insertions(+), 66 deletions(-)

New commits:
commit 15fed4931ed100fbf0c4769b5b75ac51a95edf84
Author: Xisco Fauli 
Date:   Thu May 26 02:01:30 2016 +0200

tdf#89329: use unique_ptr for pImpl in fileview

Change-Id: Ief2fd163cc024b4a654a32c24cef832c68ad5e96
Reviewed-on: https://gerrit.libreoffice.org/25482
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/svtools/fileview.hxx b/include/svtools/fileview.hxx
index eb570ce..b0a75e7 100644
--- a/include/svtools/fileview.hxx
+++ b/include/svtools/fileview.hxx
@@ -70,7 +70,7 @@ struct FileViewAsyncAction
 class SVT_DLLPUBLIC SvtFileView : public Control
 {
 private:
-SvtFileView_Impl*  mpImp;
+std::unique_ptr  mpImpl;
 bool   bSortColumn;
 css::uno::Sequence< OUString > mpBlackList;
 
diff --git a/svtools/source/contnr/fileview.cxx 
b/svtools/source/contnr/fileview.cxx
index d7b4a89..13bf306 100644
--- a/svtools/source/contnr/fileview.cxx
+++ b/svtools/source/contnr/fileview.cxx
@@ -980,11 +980,11 @@ SvtFileView::SvtFileView( vcl::Window* pParent, WinBits 
nBits,
 InteractionHandler::createWithParent(xContext, nullptr), 
UNO_QUERY_THROW );
 Reference < XCommandEnvironment > xCmdEnv = new 
::ucbhelper::CommandEnvironment( xInteractionHandler, Reference< 
XProgressHandler >() );
 
-mpImp = new SvtFileView_Impl( this, xCmdEnv, nFlags, bOnlyFolder );
-mpImp->mpView->ForbidEmptyText();
+mpImpl.reset( new SvtFileView_Impl( this, xCmdEnv, nFlags, bOnlyFolder ) );
+mpImpl->mpView->ForbidEmptyText();
 SetSortColumn( true );
 
-HeaderBar* pHeaderBar = mpImp->mpView->GetHeaderBar();
+HeaderBar* pHeaderBar = mpImpl->mpView->GetHeaderBar();
 pHeaderBar->SetSelectHdl( LINK( this, SvtFileView, HeaderSelect_Impl ) );
 pHeaderBar->SetEndDragHdl( LINK( this, SvtFileView, HeaderEndDrag_Impl ) );
 }
@@ -996,10 +996,7 @@ SvtFileView::~SvtFileView()
 
 void SvtFileView::dispose()
 {
-// use temp pointer to prevent access of deleted member (GetFocus())
-SvtFileView_Impl* pTemp = mpImp;
-mpImp = nullptr;
-delete pTemp;
+mpImpl.reset();
 Control::dispose();
 }
 
@@ -1022,7 +1019,7 @@ Size SvtFileView::GetOptimalSize() const
 
 void SvtFileView::SetViewMode( FileViewMode eMode )
 {
-mpImp->SetViewMode( eMode );
+mpImpl->SetViewMode( eMode );
 }
 
 OUString SvtFileView::GetURL( SvTreeListEntry* pEntry )
@@ -1037,7 +1034,7 @@ OUString SvtFileView::GetURL( SvTreeListEntry* pEntry )
 OUString SvtFileView::GetCurrentURL() const
 {
 OUString aURL;
-SvTreeListEntry* pEntry = mpImp->mpCurView->FirstSelected();
+SvTreeListEntry* pEntry = mpImpl->mpCurView->FirstSelected();
 if ( pEntry && pEntry->GetUserData() )
 aURL = static_cast(pEntry->GetUserData())->maURL;
 return aURL;
@@ -1046,17 +1043,17 @@ OUString SvtFileView::GetCurrentURL() const
 
 void SvtFileView::CreatedFolder( const OUString& rUrl, const OUString& 
rNewFolder )
 {
-OUString sEntry = mpImp->FolderInserted( rUrl, rNewFolder );
+OUString sEntry = mpImpl->FolderInserted( rUrl, rNewFolder );
 
-SvTreeListEntry* pEntry = mpImp->mpView->InsertEntry( sEntry, 
mpImp->maFolderImage, mpImp->maFolderImage );
+SvTreeListEntry* pEntry = mpImpl->mpView->InsertEntry( sEntry, 
mpImpl->maFolderImage, mpImpl->maFolderImage );
 SvtContentEntry* pUserData = new SvtContentEntry( rUrl, true );
 pEntry->SetUserData( pUserData );
-mpImp->mpView->MakeVisible( pEntry );
+mpImpl->mpView->MakeVisible( pEntry );
 
-SvTreeListEntry* pEntry2 = mpImp->mpIconView->InsertEntry( 
sEntry.getToken( 0, '\t' ), mpImp->maFolderImage, mpImp->maFolderImage );
+SvTreeListEntry* pEntry2 = mpImpl->mpIconView->InsertEntry( 
sEntry.getToken( 0, '\t' ), mpImpl->maFolderImage, mpImpl->maFolderImage );
 SvtContentEntry* pUserData2 = new SvtContentEntry( rUrl, true );
 pEntry2->SetUserData( pUserData2 );
-mpImp->mpIconView->MakeVisible( pEntry2 );
+mpImpl->mpIconView->MakeVisible( pEntry2 );
 }
 
 
@@ -1066,7 +1063,7 @@ FileViewResult SvtFileView::PreviousLevel( const 
FileViewAsyncAction* pAsyncDesc
 
 OUString sParentURL;
 if ( GetParentURL( sParentURL ) )
-eResult = Initialize( sParentURL, mpImp->maCurrentFilter, 
pAsyncDescriptor, mpBlackList );
+eResult = Initialize( sParentURL, mpImpl->maCurrentFilter, 
pAsyncDescriptor, mpBlackList );
 
 return eResult;
 }
@@ -1077,7 +1074,7 @@ bool SvtFileView::GetParentURL( OUString& rParentURL ) 
const
 bool bRet = false;
 try
 {
-::ucbhelper::Content aCnt( mpImp->maViewURL, mpImp->mxCmdEnv, 
comphelper::getProcessComponentContext() );
+::ucbhelper::Content aCnt( mpImpl->maViewURL, 

[Libreoffice-commits] core.git: include/svtools svtools/source

2016-05-26 Thread Xisco Fauli
 include/svtools/htmlcfg.hxx   |3 
 svtools/source/config/htmlcfg.cxx |  135 ++
 2 files changed, 69 insertions(+), 69 deletions(-)

New commits:
commit 656f7c15c5a6e3cbc7df3e2e56287289d1296f8a
Author: Xisco Fauli 
Date:   Thu May 26 02:05:49 2016 +0200

tdf#89329: use unique_ptr for pImpl in htmlcfg

Change-Id: Ic85c082f1e6f6934efbe2c0aa73ee4e5d48c58bf
Reviewed-on: https://gerrit.libreoffice.org/25483
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/svtools/htmlcfg.hxx b/include/svtools/htmlcfg.hxx
index d0d2be7..5e46488 100644
--- a/include/svtools/htmlcfg.hxx
+++ b/include/svtools/htmlcfg.hxx
@@ -21,6 +21,7 @@
 
 #include 
 #include 
+#include 
 
 #define HTML_FONT_COUNT 7
 
@@ -36,7 +37,7 @@ struct HtmlOptions_Impl;
 
 class SVT_DLLPUBLIC SvxHtmlOptions : public utl::ConfigItem
 {
-HtmlOptions_Impl*pImp;
+std::unique_ptr   pImpl;
 static const css::uno::Sequence& GetPropertyNames();
 void Load( const css::uno::Sequence< OUString >& rPropertyNames );
 
diff --git a/svtools/source/config/htmlcfg.cxx 
b/svtools/source/config/htmlcfg.cxx
index bfb4252..53f6a8f 100644
--- a/svtools/source/config/htmlcfg.cxx
+++ b/svtools/source/config/htmlcfg.cxx
@@ -101,16 +101,15 @@ const Sequence& 
SvxHtmlOptions::GetPropertyNames()
 }
 
 SvxHtmlOptions::SvxHtmlOptions() :
-ConfigItem("Office.Common/Filter/HTML")
+ConfigItem("Office.Common/Filter/HTML"),
+pImpl( new HtmlOptions_Impl )
 {
-pImp = new HtmlOptions_Impl;
 Load( GetPropertyNames() );
 }
 
 
 SvxHtmlOptions::~SvxHtmlOptions()
 {
-delete pImp;
 }
 
 void SvxHtmlOptions::Load( const Sequence< OUString >& aNames )
@@ -120,7 +119,7 @@ void SvxHtmlOptions::Load( const Sequence< OUString >& 
aNames )
 DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties 
failed");
 if(aValues.getLength() == aNames.getLength())
 {
-pImp->nFlags = 0;
+pImpl->nFlags = 0;
 for(int nProp = 0; nProp < aNames.getLength(); nProp++)
 {
 if(pValues[nProp].hasValue())
@@ -129,19 +128,19 @@ void SvxHtmlOptions::Load( const Sequence< OUString >& 
aNames )
 {
 case  0:
 if(*static_cast(pValues[nProp].getValue()))
-pImp->nFlags |= HTMLCFG_UNKNOWN_TAGS;
+pImpl->nFlags |= HTMLCFG_UNKNOWN_TAGS;
 break;//"Import/UnknownTag",
 case  1:
 if(*static_cast(pValues[nProp].getValue()))
-pImp->nFlags |= HTMLCFG_IGNORE_FONT_FAMILY;
+pImpl->nFlags |= HTMLCFG_IGNORE_FONT_FAMILY;
 break;//"Import/FontSetting",
-case  2: pValues[nProp] >>= pImp->aFontSizeArr[0]; 
break;//"Import/FontSize/Size_1",
-case  3: pValues[nProp] >>= pImp->aFontSizeArr[1]; 
break;//"Import/FontSize/Size_2",
-case  4: pValues[nProp] >>= pImp->aFontSizeArr[2]; 
break;//"Import/FontSize/Size_3",
-case  5: pValues[nProp] >>= pImp->aFontSizeArr[3]; 
break;//"Import/FontSize/Size_4",
-case  6: pValues[nProp] >>= pImp->aFontSizeArr[4]; 
break;//"Import/FontSize/Size_5",
-case  7: pValues[nProp] >>= pImp->aFontSizeArr[5]; 
break;//"Import/FontSize/Size_6",
-case  8: pValues[nProp] >>= pImp->aFontSizeArr[6]; 
break;//"Import/FontSize/Size_7",
+case  2: pValues[nProp] >>= pImpl->aFontSizeArr[0]; 
break;//"Import/FontSize/Size_1",
+case  3: pValues[nProp] >>= pImpl->aFontSizeArr[1]; 
break;//"Import/FontSize/Size_2",
+case  4: pValues[nProp] >>= pImpl->aFontSizeArr[2]; 
break;//"Import/FontSize/Size_3",
+case  5: pValues[nProp] >>= pImpl->aFontSizeArr[3]; 
break;//"Import/FontSize/Size_4",
+case  6: pValues[nProp] >>= pImpl->aFontSizeArr[4]; 
break;//"Import/FontSize/Size_5",
+case  7: pValues[nProp] >>= pImpl->aFontSizeArr[5]; 
break;//"Import/FontSize/Size_6",
+case  8: pValues[nProp] >>= pImpl->aFontSizeArr[6]; 
break;//"Import/FontSize/Size_7",
 case  9://"Export/Browser",
 {
 sal_Int32 nExpMode = 0;
@@ -154,33 +153,33 @@ void SvxHtmlOptions::Load( const Sequence< OUString >& 
aNames )
 default:nExpMode = HTML_CFG_NS40;   
break;
 }
 
-pImp->nExportMode = nExpMode;
+pImpl->nExportMode = nExpMode;
 }
 break;
 case 10:
 if(*static_cast(pValues[nProp].getValue()))
-   

[Libreoffice-commits] core.git: include/svtools svtools/source

2016-05-26 Thread Xisco Fauli
 include/svtools/inettbc.hxx|2 +-
 svtools/source/control/inettbc.cxx |   26 +-
 2 files changed, 14 insertions(+), 14 deletions(-)

New commits:
commit c6e776e44124f8245117377cbd28af8e0c050ab1
Author: Xisco Fauli 
Date:   Thu May 26 02:08:55 2016 +0200

tdf#89329: use unique_ptr for pImpl in inettbc

Change-Id: I1205acb2823db95cc75c0b559581d278646b616a
Reviewed-on: https://gerrit.libreoffice.org/25484
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/svtools/inettbc.hxx b/include/svtools/inettbc.hxx
index 1aa02b1..686ad59 100644
--- a/include/svtools/inettbc.hxx
+++ b/include/svtools/inettbc.hxx
@@ -36,7 +36,7 @@ friend class SvtURLBox_Impl;
 OUStringaBaseURL;
 OUStringaPlaceHolder;
 rtl::Reference< SvtMatchContext_Impl > pCtx;
-SvtURLBox_Impl* pImp;
+std::unique_ptr pImpl;
 INetProtocoleSmartProtocol;
 boolbAutoCompleteMode   : 1;
 boolbOnlyDirectories: 1;
diff --git a/svtools/source/control/inettbc.cxx 
b/svtools/source/control/inettbc.cxx
index fbbfcab..962cc54 100644
--- a/svtools/source/control/inettbc.cxx
+++ b/svtools/source/control/inettbc.cxx
@@ -241,8 +241,8 @@ IMPL_LINK_NOARG_TYPED( SvtMatchContext_Impl, Select_Impl, 
void*, void )
 {
 OUString sUpperURL( sURL.toAsciiUpperCase() );
 
-if ( ::std::none_of( pBox->pImp->m_aFilters.begin(),
- pBox->pImp->m_aFilters.end(),
+if ( ::std::none_of( pBox->pImpl->m_aFilters.begin(),
+ pBox->pImpl->m_aFilters.end(),
  FilterMatch( sUpperURL ) ) )
 {   // this URL is not allowed
 bValidCompletionsFiltered = true;
@@ -262,8 +262,8 @@ IMPL_LINK_NOARG_TYPED( SvtMatchContext_Impl, Select_Impl, 
void*, void )
 }
 
 // transfer string lists to listbox and forget them
-pBox->pImp->aURLs = aURLs;
-pBox->pImp->aCompletions = aCompletions;
+pBox->pImpl->aURLs = aURLs;
+pBox->pImpl->aCompletions = aCompletions;
 aURLs.clear();
 aCompletions.clear();
 
@@ -861,7 +861,7 @@ VCL_BUILDER_DECL_FACTORY(SvtURLBox)
 
 void SvtURLBox::Init(bool bSetDefaultHelpID)
 {
-pImp = new SvtURLBox_Impl();
+pImpl.reset( new SvtURLBox_Impl );
 
 if (bSetDefaultHelpID && GetHelpId().isEmpty())
 SetHelpId( ".uno:OpenURL" );
@@ -888,7 +888,7 @@ void SvtURLBox::dispose()
 pCtx->join();
 }
 
-delete pImp;
+pImpl.reset();
 ComboBox::dispose();
 }
 
@@ -959,8 +959,8 @@ void SvtURLBox::UpdatePicklistForSmartProtocol_Impl()
 OUString aUpperURL( aURL );
 aUpperURL = aUpperURL.toAsciiUpperCase();
 
-bFound = ::std::any_of(pImp->m_aFilters.begin(),
-   pImp->m_aFilters.end(),
+bFound = ::std::any_of(pImpl->m_aFilters.begin(),
+   pImpl->m_aFilters.end(),
FilterMatch( aUpperURL ) );
 }
 if ( bFound )
@@ -1161,7 +1161,7 @@ OUString SvtURLBox::GetURL()
 return aPlaceHolder;
 
 // try to get the right case preserving URL from the list of URLs
-for(std::vector::iterator i = pImp->aCompletions.begin(), j = 
pImp->aURLs.begin(); i != pImp->aCompletions.end() && j != pImp->aURLs.end(); 
++i, ++j)
+for(std::vector::iterator i = pImpl->aCompletions.begin(), j = 
pImpl->aURLs.begin(); i != pImpl->aCompletions.end() && j != 
pImpl->aURLs.end(); ++i, ++j)
 {
 if((*i).equals(aText))
 return *j;
@@ -1240,8 +1240,8 @@ void SvtURLBox::SetBaseURL( const OUString& rURL )
 ::osl::MutexGuard aGuard( theSvtMatchContextMutex::get() );
 
 // Reset match lists
-pImp->aCompletions.clear();
-pImp->aURLs.clear();
+pImpl->aCompletions.clear();
+pImpl->aURLs.clear();
 
 aBaseURL = rURL;
 }
@@ -1344,8 +1344,8 @@ bool SvtURLBox_Impl::TildeParsing(
 
 void SvtURLBox::SetFilter(const OUString& _sFilter)
 {
-pImp->m_aFilters.clear();
-FilterMatch::createWildCardFilterList(_sFilter,pImp->m_aFilters);
+pImpl->m_aFilters.clear();
+FilterMatch::createWildCardFilterList(_sFilter,pImpl->m_aFilters);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2016-05-26 Thread Xisco Fauli
 include/svtools/ivctrl.hxx   |2 
 svtools/source/contnr/ivctrl.cxx |   95 +++
 2 files changed, 48 insertions(+), 49 deletions(-)

New commits:
commit f1aa4c4e281703b3f623202f4727703482076ea8
Author: Xisco Fauli 
Date:   Thu May 26 02:11:54 2016 +0200

tdf#89329: use unique_ptr for pImpl in ivctrl

Change-Id: Idd525be5934e752c3bed5e2d79c36c2305b4441f
Reviewed-on: https://gerrit.libreoffice.org/25485
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/svtools/ivctrl.hxx b/include/svtools/ivctrl.hxx
index 907197c..594b11b 100644
--- a/include/svtools/ivctrl.hxx
+++ b/include/svtools/ivctrl.hxx
@@ -207,7 +207,7 @@ class SVT_DLLPUBLIC SvtIconChoiceCtrl : public Control
 
 Link  _aClickIconHdl;
 KeyEvent*  _pCurKeyEvent;
-SvxIconChoiceCtrl_Impl*_pImp;
+std::unique_ptr_pImpl;
 bool   _bAutoFontColor;
 
 protected:
diff --git a/svtools/source/contnr/ivctrl.cxx b/svtools/source/contnr/ivctrl.cxx
index 1e872e3..886095e 100644
--- a/svtools/source/contnr/ivctrl.cxx
+++ b/svtools/source/contnr/ivctrl.cxx
@@ -74,13 +74,13 @@ SvtIconChoiceCtrl::SvtIconChoiceCtrl( vcl::Window* pParent, 
WinBits nWinStyle )
 Control( pParent, nWinStyle | WB_CLIPCHILDREN ),
 
 _pCurKeyEvent   ( nullptr ),
-_pImp   ( new SvxIconChoiceCtrl_Impl( this, nWinStyle ) ),
+_pImpl   ( new SvxIconChoiceCtrl_Impl( this, nWinStyle ) ),
 _bAutoFontColor ( false )
 
 {
 SetLineColor();
-_pImp->InitSettings();
-_pImp->SetPositionMode( IcnViewPositionModeAutoArrange );
+_pImpl->InitSettings();
+_pImpl->SetPositionMode( IcnViewPositionModeAutoArrange );
 }
 
 SvtIconChoiceCtrl::~SvtIconChoiceCtrl()
@@ -90,11 +90,10 @@ SvtIconChoiceCtrl::~SvtIconChoiceCtrl()
 
 void SvtIconChoiceCtrl::dispose()
 {
-if (_pImp)
+if (_pImpl)
 {
-_pImp->CallEventListeners( VCLEVENT_OBJECT_DYING );
-delete _pImp;
-_pImp = nullptr;
+_pImpl->CallEventListeners( VCLEVENT_OBJECT_DYING );
+_pImpl.reset();
 }
 Control::dispose();
 }
@@ -103,7 +102,7 @@ SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::InsertEntry( 
const OUString& rText, c
 {
 SvxIconChoiceCtrlEntry* pEntry = new SvxIconChoiceCtrlEntry( rText, 
rImage);
 
-_pImp->InsertEntry( pEntry, CONTAINER_APPEND );
+_pImpl->InsertEntry( pEntry, CONTAINER_APPEND );
 
 return pEntry;
 }
@@ -120,24 +119,24 @@ OUString SvtIconChoiceCtrl::GetEntryText( 
SvxIconChoiceCtrlEntry* pEntry, bool )
 
 void SvtIconChoiceCtrl::Paint(vcl::RenderContext& rRenderContext, const 
Rectangle& rRect)
 {
-_pImp->Paint(rRenderContext, rRect);
+_pImpl->Paint(rRenderContext, rRect);
 }
 
 void SvtIconChoiceCtrl::MouseButtonDown( const MouseEvent& rMEvt )
 {
-if( !_pImp->MouseButtonDown( rMEvt ) )
+if( !_pImpl->MouseButtonDown( rMEvt ) )
 Control::MouseButtonDown( rMEvt );
 }
 
 void SvtIconChoiceCtrl::MouseButtonUp( const MouseEvent& rMEvt )
 {
-if( !_pImp->MouseButtonUp( rMEvt ) )
+if( !_pImpl->MouseButtonUp( rMEvt ) )
 Control::MouseButtonUp( rMEvt );
 }
 
 void SvtIconChoiceCtrl::MouseMove( const MouseEvent& rMEvt )
 {
-if( !_pImp->MouseMove( rMEvt ) )
+if( !_pImpl->MouseMove( rMEvt ) )
 Control::MouseMove( rMEvt );
 }
 void SvtIconChoiceCtrl::ArrangeIcons()
@@ -150,12 +149,12 @@ void SvtIconChoiceCtrl::ArrangeIcons()
 for ( sal_Int32 i = 0; i < GetEntryCount(); i++ )
 {
 SvxIconChoiceCtrlEntry* pEntry = GetEntry ( i );
-aEntryRect = _pImp->GetEntryBoundRect ( pEntry );
+aEntryRect = _pImpl->GetEntryBoundRect ( pEntry );
 
 aFullSize.setWidth ( aFullSize.getWidth()+aEntryRect.GetWidth() );
 }
 
-_pImp->Arrange ( false, aFullSize.getWidth() );
+_pImpl->Arrange ( false, aFullSize.getWidth() );
 }
 else if ( GetStyle() & WB_ALIGN_LEFT )
 {
@@ -165,22 +164,22 @@ void SvtIconChoiceCtrl::ArrangeIcons()
 for ( sal_Int32 i = 0; i < GetEntryCount(); i++ )
 {
 SvxIconChoiceCtrlEntry* pEntry = GetEntry ( i );
-aEntryRect = _pImp->GetEntryBoundRect ( pEntry );
+aEntryRect = _pImpl->GetEntryBoundRect ( pEntry );
 
 aFullSize.setHeight ( aFullSize.getHeight()+aEntryRect.GetHeight() 
);
 }
 
-_pImp->Arrange ( false, 0, aFullSize.getHeight() );
+_pImpl->Arrange ( false, 0, aFullSize.getHeight() );
 }
 else
 {
-_pImp->Arrange();
+_pImpl->Arrange();
 }
-_pImp->Arrange( false, 0, 1000 );
+_pImpl->Arrange( false, 0, 1000 );
 }
 void SvtIconChoiceCtrl::Resize()
 {
-_pImp->Resize();
+_pImpl->Resize();
 Control::Resize();
 }
 
@@ -193,17 +192,17 @@ Point SvtIconChoiceCtrl::GetPixelPos( const Point& 

[Libreoffice-commits] core.git: include/svtools svtools/source svx/source

2016-05-11 Thread Noel Grandin
 include/svtools/ruler.hxx|9 -
 svtools/source/control/ruler.cxx |6 +++---
 svx/source/dialog/svxruler.cxx   |6 +++---
 3 files changed, 10 insertions(+), 11 deletions(-)

New commits:
commit adcd59aebbdeba925eb5c5c4b74a90855bca286f
Author: Noel Grandin 
Date:   Wed May 11 10:39:29 2016 +0200

Convert RulerExtra to scoped enum

Change-Id: I81f5380e27a741ab6049bcec6b4136d8f2d1169a
Reviewed-on: https://gerrit.libreoffice.org/24878
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/svtools/ruler.hxx b/include/svtools/ruler.hxx
index f7708ba..d18ae42 100644
--- a/include/svtools/ruler.hxx
+++ b/include/svtools/ruler.hxx
@@ -370,9 +370,9 @@ that can be used to handle specific actions.
 With this method, it can be defined what should be displayed in
 the extra field.
 - ExtraType what should be displayed in the extra field
-RULER_EXTRA_DONTKNOW(nothing)
-RULER_EXTRA_NULLOFFSET  (coordinate axes)
-RULER_EXTRA_TAB (Tab)
+RulerExtra::DontKnow(nothing)
+RulerExtra::NullOffset  (coordinate axes)
+RulerExtra::Tab (Tab)
 - sal_uInt16 nStyle bit field as style:
 RULER_STYLE_HIGHLIGHT   (selected)
 RULER_TAB_...   (a Tab style)
@@ -466,8 +466,7 @@ enum RulerType { RULER_TYPE_DONTKNOW, RULER_TYPE_OUTSIDE,
  RULER_TYPE_MARGIN1, RULER_TYPE_MARGIN2,
  RULER_TYPE_BORDER, RULER_TYPE_INDENT, RULER_TYPE_TAB };
 
-enum RulerExtra { RULER_EXTRA_DONTKNOW,
-  RULER_EXTRA_NULLOFFSET, RULER_EXTRA_TAB };
+enum class RulerExtra { DontKnow, NullOffset, Tab };
 
 #define RULER_STYLE_HIGHLIGHT   ((sal_uInt16)0x8000)
 #define RULER_STYLE_DONTKNOW((sal_uInt16)0x4000)
diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx
index 5022bc3..2c9abac 100644
--- a/svtools/source/control/ruler.cxx
+++ b/svtools/source/control/ruler.cxx
@@ -253,7 +253,7 @@ void Ruler::ImplInit( WinBits nWinBits )
 mbActive= true; // Is ruler active
 mnUpdateFlags   = 0;// What needs to be updated
 mpData  = mpSaveData;   // Pointer to normal data
-meExtraType = RULER_EXTRA_DONTKNOW; // What is in extra field
+meExtraType = RulerExtra::DontKnow; // What is in extra field
 meDragType  = RULER_TYPE_DONTKNOW;  // Which element is dragged
 
 // Initialize Units
@@ -1416,7 +1416,7 @@ void Ruler::ImplDrawExtra(vcl::RenderContext& 
rRenderContext)
 }
 
 // output content
-if (meExtraType == RULER_EXTRA_NULLOFFSET)
+if (meExtraType == RulerExtra::NullOffset)
 {
 rRenderContext.SetLineColor(rStyleSettings.GetButtonTextColor());
 rRenderContext.DrawLine(Point(aRect.Left() + 1, aRect.Top() + 4),
@@ -1424,7 +1424,7 @@ void Ruler::ImplDrawExtra(vcl::RenderContext& 
rRenderContext)
 rRenderContext.DrawLine(Point(aRect.Left() + 4, aRect.Top() + 1),
 Point(aRect.Left() + 4, aRect.Bottom() - 1));
 }
-else if (meExtraType == RULER_EXTRA_TAB)
+else if (meExtraType == RulerExtra::Tab)
 {
 sal_uInt16 nTabStyle = mnExtraStyle & RULER_TAB_STYLE;
 if (mpData->bTextRTL)
diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx
index 91bf433..cce37b1 100644
--- a/svx/source/dialog/svxruler.cxx
+++ b/svx/source/dialog/svxruler.cxx
@@ -278,7 +278,7 @@ SvxRuler::SvxRuler(
 {
 sal_uInt16 nTabStopId = bHorz ? SID_ATTR_TABSTOP : 
SID_ATTR_TABSTOP_VERTICAL;
 pCtrlItems[i++].reset(new SvxRulerItem(nTabStopId, *this, rBindings));
-SetExtraType(RULER_EXTRA_TAB, nDefTabType);
+SetExtraType(RulerExtra::Tab, nDefTabType);
 }
 
 if(nFlags & (SvxRulerSupportFlags::PARAGRAPH_MARGINS 
|SvxRulerSupportFlags::PARAGRAPH_MARGINS_VERTICAL))
@@ -328,7 +328,7 @@ SvxRuler::SvxRuler(
 mxRulerImpl->nControlerItems=i;
 
 if( (nFlags & SvxRulerSupportFlags::SET_NULLOFFSET) == 
SvxRulerSupportFlags::SET_NULLOFFSET )
-SetExtraType(RULER_EXTRA_NULLOFFSET);
+SetExtraType(RulerExtra::NullOffset);
 
 rBindings.LeaveRegistrations();
 
@@ -3323,7 +3323,7 @@ void SvxRuler::ExtraDown()
 ++nDefTabType;
 if(RULER_TAB_DEFAULT == nDefTabType)
 nDefTabType = RULER_TAB_LEFT;
-SetExtraType(RULER_EXTRA_TAB, nDefTabType);
+SetExtraType(RulerExtra::Tab, nDefTabType);
 }
 Ruler::ExtraDown();
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org

[Libreoffice-commits] core.git: include/svtools svtools/source svx/source

2016-05-11 Thread Noel Grandin
 include/svtools/ruler.hxx|   17 -
 svtools/source/control/ruler.cxx |   26 +-
 svx/source/dialog/svxruler.cxx   |   14 +++---
 3 files changed, 32 insertions(+), 25 deletions(-)

New commits:
commit 8e4a113229298b4fa5bddd6cf71715d1fb87c3ef
Author: Noel Grandin 
Date:   Wed May 11 09:52:15 2016 +0200

Convert RULER_MARGIN to scoped enum

Change-Id: Ia8711614fdb9090faeebfe294cbb064ded20b5fb
Reviewed-on: https://gerrit.libreoffice.org/24874
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/svtools/ruler.hxx b/include/svtools/ruler.hxx
index 0db49dc..f7708ba 100644
--- a/include/svtools/ruler.hxx
+++ b/include/svtools/ruler.hxx
@@ -484,7 +484,14 @@ enum class RulerDragSize {
 #define RULER_MOUSE_MARGINWIDTH 3
 
 
-#define RULER_MARGIN_SIZEABLE   ((sal_uInt16)0x0001)
+enum class RulerMarginStyle {
+NONE   = 0x,
+Sizeable   = 0x0001,
+Invisible  = 0x0002
+};
+namespace o3tl {
+template<> struct typed_flags : 
is_typed_flags {};
+}
 
 
 enum class RulerBorderStyle {
@@ -764,11 +771,11 @@ public:
 
 voidSetNullOffset( long nPos );
 longGetNullOffset() const;
-voidSetMargin1() { SetMargin1( 0, RULER_STYLE_INVISIBLE ); }
-voidSetMargin1( long nPos, sal_uInt16 nMarginStyle = 
RULER_MARGIN_SIZEABLE );
+voidSetMargin1() { SetMargin1( 0, RulerMarginStyle::Invisible 
); }
+voidSetMargin1( long nPos, RulerMarginStyle nMarginStyle = 
RulerMarginStyle::Sizeable );
 longGetMargin1() const;
-voidSetMargin2() { SetMargin2( 0, RULER_STYLE_INVISIBLE ); }
-voidSetMargin2( long nPos, sal_uInt16 nMarginStyle = 
RULER_MARGIN_SIZEABLE );
+voidSetMargin2() { SetMargin2( 0, RulerMarginStyle::Invisible 
); }
+voidSetMargin2( long nPos, RulerMarginStyle nMarginStyle = 
RulerMarginStyle::Sizeable );
 longGetMargin2() const;
 
 voidSetLeftFrameMargin( long nPos );
diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx
index e97a098..5022bc3 100644
--- a/svtools/source/control/ruler.cxx
+++ b/svtools/source/control/ruler.cxx
@@ -81,8 +81,8 @@ private:
 long   nMargin2;
 long   nLeftFrameMargin;
 long   nRightFrameMargin;
-sal_uInt16 nMargin1Style;
-sal_uInt16 nMargin2Style;
+RulerMarginStyle nMargin1Style;
+RulerMarginStyle nMargin2Style;
 bool   bAutoPageWidth;
 bool   bTextRTL;
 
@@ -104,8 +104,8 @@ ImplRulerData::ImplRulerData() :
 nMargin2  (0),
 nLeftFrameMargin  (0),
 nRightFrameMargin (0),
-nMargin1Style (0),
-nMargin2Style (0),
+nMargin1Style (RulerMarginStyle::NONE),
+nMargin2Style (RulerMarginStyle::NONE),
 bAutoPageWidth(true), // Page width == EditWin width
 bTextRTL  (false)
 {
@@ -603,7 +603,7 @@ void Ruler::ImplDrawTicks(vcl::RenderContext& 
rRenderContext, long nMin, long nM
 if (nStart > nMin)
 {
 // 0 is only painted when Margin1 is not equal to zero
-if ((mpData->nMargin1Style & RULER_STYLE_INVISIBLE) || 
(mpData->nMargin1 != 0))
+if ((mpData->nMargin1Style & RulerMarginStyle::Invisible) 
|| (mpData->nMargin1 != 0))
 {
 aNumString = "0";
 ImplVDrawText(rRenderContext, nStart, nCenter, 
aNumString);
@@ -1200,7 +1200,7 @@ void Ruler::ImplFormat(vcl::RenderContext& rRenderContext)
 maVirDev->Erase();
 
 // calculate margins
-if (!(mpData->nMargin1Style & RULER_STYLE_INVISIBLE))
+if (!(mpData->nMargin1Style & RulerMarginStyle::Invisible))
 {
 nM1 = mpData->nMargin1 + nNullVirOff;
 if (mpData->bAutoPageWidth)
@@ -1217,7 +1217,7 @@ void Ruler::ImplFormat(vcl::RenderContext& rRenderContext)
 nM1 = nVirLeft-1;
 nP1 = nM1;
 }
-if (!(mpData->nMargin2Style & RULER_STYLE_INVISIBLE))
+if (!(mpData->nMargin2Style & RulerMarginStyle::Invisible))
 {
 nM2 = mpData->nMargin2 + nNullVirOff;
 if (mpData->bAutoPageWidth)
@@ -1699,7 +1699,7 @@ bool Ruler::ImplHitTest( const Point& rPos, 
RulerSelection* pHitTest,
 // Margins
 int nMarginTolerance = pHitTest->bExpandTest ? nBorderTolerance : 
RULER_MOUSE_MARGINWIDTH;
 
-if ( (mpData->nMargin1Style & (RULER_MARGIN_SIZEABLE | 
RULER_STYLE_INVISIBLE)) == RULER_MARGIN_SIZEABLE )
+if ( (mpData->nMargin1Style & (RulerMarginStyle::Sizeable | 
RulerMarginStyle::Invisible)) == RulerMarginStyle::Sizeable )
 {
 n1 = mpData->nMargin1;
 if ( (nX >= n1 - nMarginTolerance) && (nX <= n1 + nMarginTolerance) )
@@ -1709,7 +1709,7 @@ bool Ruler::ImplHitTest( const Point& 

[Libreoffice-commits] core.git: include/svtools svtools/source svx/source

2016-05-11 Thread Noel Grandin
 include/svtools/ruler.hxx|   22 +++---
 svtools/source/control/ruler.cxx |   33 ++---
 svx/source/dialog/svxruler.cxx   |   19 +++
 3 files changed, 32 insertions(+), 42 deletions(-)

New commits:
commit f09ab2ccb8bbbcf9b9db3cec94ce9b59f901a1c6
Author: Noel Grandin 
Date:   Tue May 10 15:32:29 2016 +0200

convert RULER_INDENT to scoped enum

Also separate out the INVISIBLE flag into it's own bit, because the
constant is shared with other fields.
Also fix some dubious code in SVX that was setting stuff on the field
that meant nothing.

Change-Id: If460be575eee38b8e9f01af4d73f93f6426c604f
Reviewed-on: https://gerrit.libreoffice.org/24853
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/svtools/ruler.hxx b/include/svtools/ruler.hxx
index 620f3f3..42869f85 100644
--- a/include/svtools/ruler.hxx
+++ b/include/svtools/ruler.hxx
@@ -171,9 +171,9 @@ initialized:
 
 longnPos- offset relative to the origin in pixels
 sal_uInt16 nStyle   - bit style:
-RULER_INDENT_TOP(indent of the first line)
-RULER_INDENT_BOTTOM (left/right indent)
-RULER_INDENT_BORDER (Vertical line that shows 
the border distance)
+RulerIndentStyle::Top(indent of the first 
line)
+RulerIndentStyle::Bottom (left/right indent)
+RulerIndentStyle::Border (Vertical line that 
shows the border distance)
 The following bits can be set in addition
 to these styles:
 RULER_STYLE_DONTKNOW (for old position or for
@@ -502,15 +502,15 @@ struct RulerBorder
 };
 
 
-#define RULER_INDENT_TOP((sal_uInt16)0x)
-#define RULER_INDENT_BOTTOM ((sal_uInt16)0x0001)
-#define RULER_INDENT_BORDER ((sal_uInt16)0x0002)
-#define RULER_INDENT_STYLE  ((sal_uInt16)0x000F)
+enum class RulerIndentStyle {
+Top, Bottom, Border
+};
 
 struct RulerIndent
 {
-longnPos;
-sal_uInt16  nStyle;
+long  nPos;
+RulerIndentStyle  nStyle;
+bool  bInvisible;
 };
 
 
@@ -659,7 +659,7 @@ private:
 SVT_DLLPRIVATE void ImplDrawBorders(vcl::RenderContext& rRenderContext,
 long nMin, long nMax, long nVirTop, 
long nVirBottom);
 SVT_DLLPRIVATE void ImplDrawIndent(vcl::RenderContext& rRenderContext,
-   const tools::Polygon& rPoly, sal_uInt16 
nStyle, bool bIsHit = false);
+   const tools::Polygon& rPoly, bool 
bIsHit = false);
 SVT_DLLPRIVATE void ImplDrawIndents(vcl::RenderContext& rRenderContext,
 long nMin, long nMax, long nVirTop, 
long nVirBottom);
 SVT_DLLPRIVATE void ImplDrawTab(vcl::RenderContext& rRenderContext, const 
Point& rPos, sal_uInt16 nStyle);
@@ -683,7 +683,7 @@ private:
 SVT_DLLPRIVATE bool ImplHitTest( const Point& rPosition,
  RulerSelection* pHitTest,
  bool bRequiredStyle = false,
- sal_uInt16 nRequiredStyle = 0 ) const;
+ RulerIndentStyle nRequiredStyle = 
RulerIndentStyle::Top ) const;
 SVT_DLLPRIVATE bool ImplDocHitTest( const Point& rPos, RulerType 
eDragType, RulerSelection* pHitTest ) const;
 SVT_DLLPRIVATE bool ImplStartDrag( RulerSelection* pHitTest, 
sal_uInt16 nModifier );
 SVT_DLLPRIVATE void ImplDrag( const Point& rPos );
diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx
index 81c551d..050cce7 100644
--- a/svtools/source/control/ruler.cxx
+++ b/svtools/source/control/ruler.cxx
@@ -789,13 +789,10 @@ void Ruler::ImplDrawBorders(vcl::RenderContext& 
rRenderContext, long nMin, long
 }
 }
 
-void Ruler::ImplDrawIndent(vcl::RenderContext& rRenderContext, const 
tools::Polygon& rPoly, sal_uInt16 nStyle, bool bIsHit)
+void Ruler::ImplDrawIndent(vcl::RenderContext& rRenderContext, const 
tools::Polygon& rPoly, bool bIsHit)
 {
 const StyleSettings& rStyleSettings = 
rRenderContext.GetSettings().GetStyleSettings();
 
-if (nStyle & RULER_STYLE_INVISIBLE)
-return;
-
 rRenderContext.SetLineColor(rStyleSettings.GetDarkShadowColor());
 rRenderContext.SetFillColor(bIsHit ? rStyleSettings.GetDarkShadowColor() : 
rStyleSettings.GetWorkspaceColor());
 rRenderContext.DrawPolygon(rPoly);
@@ -812,23 +809,22 @@ void Ruler::ImplDrawIndents(vcl::RenderContext& 
rRenderContext, long nMin, long
 
 for (j = 0; j < mpData->pIndents.size(); j++)
 {
-if (mpData->pIndents[j].nStyle & 

[Libreoffice-commits] core.git: include/svtools svtools/source sw/inc sw/source

2016-03-23 Thread Oliver Specht
 include/svtools/htmlout.hxx |4 
 svtools/source/svhtml/htmlout.cxx   |   15 ++-
 sw/inc/shellio.hxx  |7 +
 sw/source/filter/html/css1atr.cxx   |   77 +++
 sw/source/filter/html/htmlatr.cxx   |3 
 sw/source/filter/html/htmlflywriter.cxx |  156 +++-
 sw/source/filter/html/htmlnumwriter.cxx |3 
 sw/source/filter/html/htmlplug.cxx  |   23 
 sw/source/filter/html/wrthtml.cxx   |   39 ++--
 sw/source/filter/html/wrthtml.hxx   |   11 +-
 sw/source/filter/writer/writer.cxx  |   63 
 sw/source/ui/dbui/mmresultdialogs.cxx   |9 +
 12 files changed, 344 insertions(+), 66 deletions(-)

New commits:
commit 46fa816aa0a713c54836b9689fa7a1c9ff55ef5a
Author: Oliver Specht 
Date:   Fri Mar 18 15:57:17 2016 +0100

tdf#63211: saving embedded images to HTML optional

This change re-introduces linked images in HTML export
but keeps embedded image export in mailmerge e-Mail function

Change-Id: I9e956b590f4c675b5954e19e4d3948c36b55f1e6
Reviewed-on: https://gerrit.libreoffice.org/23359
Tested-by: Jenkins 
Reviewed-by: Oliver Specht 

diff --git a/include/svtools/htmlout.hxx b/include/svtools/htmlout.hxx
index 1547550..715f0ba 100644
--- a/include/svtools/htmlout.hxx
+++ b/include/svtools/htmlout.hxx
@@ -66,7 +66,8 @@ struct HTMLOutFuncs
 SVT_DLLPUBLIC static SvStream& Out_String( SvStream&, const OUString&,
 rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
 OUString *pNonConvertableChars = nullptr );
-SVT_DLLPUBLIC static SvStream& Out_Hex( SvStream&, sal_uLong nHex, 
sal_uInt8 nLen );
+SVT_DLLPUBLIC static SvStream& Out_Hex( SvStream&, sal_uLong nHex, 
sal_uInt8 nLen,
+rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252 );
 SVT_DLLPUBLIC static SvStream& Out_Color( SvStream&, const Color&,
 rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252 );
 SVT_DLLPUBLIC static SvStream& Out_ImageMap( SvStream&, const OUString&, 
const ImageMap&, const OUString&,
@@ -103,6 +104,7 @@ struct HTMLOutFuncs
 SvNumberFormatter& rFormatter,
 rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
 OUString *pNonConvertableChars = nullptr);
+SVT_DLLPUBLIC static bool PrivateURLToInternalImg( OUString& rURL );
 };
 
 struct HtmlWriterHelper
diff --git a/svtools/source/svhtml/htmlout.cxx 
b/svtools/source/svhtml/htmlout.cxx
index 477c24d..99d9e38 100644
--- a/svtools/source/svhtml/htmlout.cxx
+++ b/svtools/source/svhtml/htmlout.cxx
@@ -558,7 +558,8 @@ SvStream& HTMLOutFuncs::FlushToAscii( SvStream& rStream,
 return rStream;
 }
 
-SvStream& HTMLOutFuncs::Out_Hex( SvStream& rStream, sal_uLong nHex, sal_uInt8 
nLen )
+SvStream& HTMLOutFuncs::Out_Hex( SvStream& rStream, sal_uLong nHex, sal_uInt8 
nLen,
+   rtl_TextEncoding )
 {  // in einen Stream aus
 sal_Char aNToABuf[] = "";
 
@@ -977,6 +978,18 @@ OString HTMLOutFuncs::CreateTableDataOptionsValNum(
 return aStrTD.makeStringAndClear();
 }
 
+bool HTMLOutFuncs::PrivateURLToInternalImg( OUString& rURL )
+{
+if( rURL.getLength() > 14 &&
+rURL.compareTo( OOO_STRING_SVTOOLS_HTML_private_image, 14 ) == 0 )
+{
+rURL = rURL.copy( 14 );
+return true;
+}
+
+return false;
+}
+
 void HtmlWriterHelper::applyColor(HtmlWriter& rHtmlWriter, const OString 
, const Color& rColor)
 {
 OStringBuffer sBuffer;
diff --git a/sw/inc/shellio.hxx b/sw/inc/shellio.hxx
index b23e1be..9d492b3 100644
--- a/sw/inc/shellio.hxx
+++ b/sw/inc/shellio.hxx
@@ -374,7 +374,7 @@ protected:
 bool CopyNextPam( SwPaM ** );
 
 void PutNumFormatFontsInAttrPool();
-void PutEditEngFontsInAttrPool();
+void PutEditEngFontsInAttrPool( bool bIncl_CJK_CTL = true );
 
 virtual sal_uLong WriteStream() = 0;
 voidSetBaseURL( const OUString& rURL ) { sBaseURL = rURL; }
@@ -415,6 +415,8 @@ public:
 
 void SetShowProgress( bool bFlag )  { bShowProgress = bFlag; }
 
+const OUString* GetOrigFileName() const   { return pOrigFileName; }
+
 const SwAsciiOptions& GetAsciiOptions() const { return aAscOpts; }
 void SetAsciiOptions( const SwAsciiOptions& rOpt ) { aAscOpts = rOpt; }
 
@@ -434,6 +436,9 @@ public:
 static SwPaM * NewSwPaM(SwDoc & rDoc,
 sal_uLong const nStartIdx, sal_uLong const 
nEndIdx);
 
+// If applicable copy a local file into internet.
+bool CopyLocalFileToINet( OUString& rFileNm );
+
 // Stream-specific routines. Do not use in storage-writer!
 
 // Optimizing output on stream.
diff --git a/sw/source/filter/html/css1atr.cxx 
b/sw/source/filter/html/css1atr.cxx
index 547f28d..35f4861 

[Libreoffice-commits] core.git: include/svtools svtools/source

2016-03-10 Thread Aleksas Pantechovskis
 include/svtools/svparser.hxx  |5 +++--
 svtools/source/svrtf/svparser.cxx |   11 +++
 2 files changed, 6 insertions(+), 10 deletions(-)

New commits:
commit 50336412f775af154509d67b1ebbdb4b5feb147b
Author: Aleksas Pantechovskis 
Date:   Wed Mar 9 14:27:10 2016 +0200

tdf#89329 Use std::unique_ptr for pImpl in svparser

Change-Id: Ia791bade1a1f9d27a48994f8bb380ffec50e23bb
Reviewed-on: https://gerrit.libreoffice.org/23072
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/include/svtools/svparser.hxx b/include/svtools/svparser.hxx
index cfbd115..527c192 100644
--- a/include/svtools/svparser.hxx
+++ b/include/svtools/svparser.hxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 
 struct SvParser_Impl;
 class SvStream;
@@ -51,7 +52,7 @@ protected:
 sal_uLong   nlLineNr;   // current line number
 sal_uLong   nlLinePos;  // current column number
 
-SvParser_Impl   *pImplData; // internal data
+std::unique_ptr pImplData; // internal data
 longnTokenValue;// additional value (RTF)
 boolbTokenHasValue; // indicates whether nTokenValue 
is valid
 SvParserState   eState; // status also in derived classes
@@ -230,7 +231,7 @@ public:
 class SVT_DLLPUBLIC SvKeyValueIterator : public SvRefBase
 {
 struct Impl;
-Impl* mpImpl;
+std::unique_ptr mpImpl;
 
 public:
 /** Construction/Destruction.
diff --git a/svtools/source/svrtf/svparser.cxx 
b/svtools/source/svrtf/svparser.cxx
index 3350492..a17ca8a 100644
--- a/svtools/source/svrtf/svparser.cxx
+++ b/svtools/source/svrtf/svparser.cxx
@@ -94,8 +94,6 @@ SvParser::~SvParser()
 rtl_destroyTextToUnicodeConverter( pImplData->hConv );
 }
 
-delete pImplData;
-
 delete [] pTokenStack;
 }
 
@@ -124,7 +122,7 @@ void SvParser::SetSrcEncoding( rtl_TextEncoding eEnc )
 {
 eSrcEnc = eEnc;
 if( !pImplData )
-pImplData = new SvParser_Impl;
+pImplData.reset(new SvParser_Impl);
 pImplData->hConv = rtl_createTextToUnicodeConverter( eSrcEnc );
 DBG_ASSERT( pImplData->hConv,
 "SvParser::SetSrcEncoding: no converter for source 
encoding" );
@@ -523,7 +521,7 @@ void SvParser::SaveState( int nToken )
 // save actual status
 if( !pImplData )
 {
-pImplData = new SvParser_Impl;
+pImplData.reset(new SvParser_Impl);
 pImplData->nSaveToken = 0;
 }
 
@@ -672,10 +670,7 @@ struct SvKeyValueIterator::Impl
 
 SvKeyValueIterator::SvKeyValueIterator() : mpImpl(new Impl) {}
 
-SvKeyValueIterator::~SvKeyValueIterator()
-{
-delete mpImpl;
-}
+SvKeyValueIterator::~SvKeyValueIterator() = default;
 
 bool SvKeyValueIterator::GetFirst (SvKeyValue )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2016-01-08 Thread Giuseppe Castagno
 include/svtools/PlaceEditDialog.hxx|1 +
 include/svtools/ServerDetailsControls.hxx  |3 +++
 svtools/source/dialogs/PlaceEditDialog.cxx |   11 ---
 3 files changed, 12 insertions(+), 3 deletions(-)

New commits:
commit 3113ecb2fcb6d868a213c5dc978159e18f4e2efa
Author: Giuseppe Castagno 
Date:   Thu Dec 31 12:04:13 2015 +0100

Related tdf#96833: hide user and password for WebDAV servers...

...because they are asked for and stored in a successive user
interaction.

Change-Id: I09a3a1e59fe3819a28d7565e83b0db968dfee74b
Reviewed-on: https://gerrit.libreoffice.org/21040
Tested-by: Jenkins 
Reviewed-by: jan iversen 
Tested-by: jan iversen 

diff --git a/include/svtools/PlaceEditDialog.hxx 
b/include/svtools/PlaceEditDialog.hxx
index f682580..2c274c4 100644
--- a/include/svtools/PlaceEditDialog.hxx
+++ b/include/svtools/PlaceEditDialog.hxx
@@ -34,6 +34,7 @@ private:
 std::shared_ptr< DetailsContainer > m_xCurrentDetails;
 
 VclPtr m_pEDUsername;
+VclPtrm_pFTUsernameLabel;
 VclPtr m_pCBPassword;
 VclPtr m_pEDPassword;
 VclPtrm_pFTPasswordLabel;
diff --git a/include/svtools/ServerDetailsControls.hxx 
b/include/svtools/ServerDetailsControls.hxx
index 8a2289e..e9f4d4c 100644
--- a/include/svtools/ServerDetailsControls.hxx
+++ b/include/svtools/ServerDetailsControls.hxx
@@ -57,6 +57,8 @@ class DetailsContainer
 virtual void setUsername( const OUString& /*rUsername*/ ) { };
 virtual void setPassword( const OUString& ) { };
 
+virtual bool enableUserCredentials( ) { return true; };
+
 void setActive( bool bActive = true );
 
 protected:
@@ -98,6 +100,7 @@ class DavDetailsContainer : public HostDetailsContainer
 virtual ~DavDetailsContainer( ) { };
 
 virtual void show( bool bShow = true ) override;
+virtual bool enableUserCredentials( ) override { return false; };
 
 protected:
 virtual bool verifyScheme( const OUString& rScheme ) override;
diff --git a/svtools/source/dialogs/PlaceEditDialog.cxx 
b/svtools/source/dialogs/PlaceEditDialog.cxx
index 19634b7..b062b93 100644
--- a/svtools/source/dialogs/PlaceEditDialog.cxx
+++ b/svtools/source/dialogs/PlaceEditDialog.cxx
@@ -28,6 +28,7 @@ PlaceEditDialog::PlaceEditDialog(vcl::Window* pParent)
 get( m_pEDServerName, "name" );
 get( m_pLBServerType, "type" );
 get( m_pEDUsername, "login" );
+get( m_pFTUsernameLabel, "loginLabel" );
 get( m_pBTOk, "ok" );
 get( m_pBTCancel, "cancel" );
 get( m_pBTDelete, "delete" );
@@ -61,6 +62,7 @@ PlaceEditDialog::PlaceEditDialog(vcl::Window* pParent, const 
std::shared_ptrshow();
 
-m_pCBPassword->Show( m_bShowPassword );
-m_pEDPassword->Show( m_bShowPassword );
-m_pFTPasswordLabel->Show( m_bShowPassword );
+m_pCBPassword->Show( m_bShowPassword && 
m_xCurrentDetails->enableUserCredentials() );
+m_pEDPassword->Show( m_bShowPassword && 
m_xCurrentDetails->enableUserCredentials() );
+m_pFTPasswordLabel->Show( m_bShowPassword && 
m_xCurrentDetails->enableUserCredentials() );
+m_pEDUsername->Show( m_xCurrentDetails->enableUserCredentials() );
+m_pFTUsernameLabel->Show( m_xCurrentDetails->enableUserCredentials() );
 
 SetSizePixel(GetOptimalSize());
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2016-01-04 Thread Stephan Bergmann
 include/svtools/unoevent.hxx|   13 -
 svtools/source/uno/unoevent.cxx |  266 
 2 files changed, 133 insertions(+), 146 deletions(-)

New commits:
commit d2f6f86330b68500a4e0c7987ff2bb1493a7ea8d
Author: Stephan Bergmann 
Date:   Mon Jan 4 18:18:53 2016 +0100

loplugin:stringconstant

Change-Id: I08430479a2c8d1fd6e3fc357ba3069b3a7bb6ac8

diff --git a/include/svtools/unoevent.hxx b/include/svtools/unoevent.hxx
index ac1f03c..899b2bb 100644
--- a/include/svtools/unoevent.hxx
+++ b/include/svtools/unoevent.hxx
@@ -150,19 +150,6 @@ protected:
 
 /// get the event ID for the name; return 0 if not supported
 sal_uInt16 getMacroID(const OUString& rName) const;
-
-/// create PropertyValues and Any from macro
-void getAnyFromMacro(
-css::uno::Any& aAny,   // Any to be filled by Macro values
-const SvxMacro& rMacro);
-
-/// create macro from PropertyValues (in an Any)
-void getMacroFromAny(
-SvxMacro& aMacro,   // reference to be filled by Any
-const css::uno::Any& rAny)
-throw (
-css::lang::IllegalArgumentException);
-
 };
 
 
diff --git a/svtools/source/uno/unoevent.cxx b/svtools/source/uno/unoevent.cxx
index 8ddfd0d..bfa752f 100644
--- a/svtools/source/uno/unoevent.cxx
+++ b/svtools/source/uno/unoevent.cxx
@@ -45,138 +45,9 @@ static const char sJavaScript[] = "JavaScript";
 static const char sScript[] = "Script";
 static const char sNone[] = "None";
 
+namespace {
 
-SvBaseEventDescriptor::SvBaseEventDescriptor( const SvEventDescription* 
pSupportedMacroItems ) :
-mpSupportedMacroItems(pSupportedMacroItems),
-mnMacroItems(0)
-{
-assert(pSupportedMacroItems != nullptr && "Need a list of supported 
events!");
-
-for( ; mpSupportedMacroItems[mnMacroItems].mnEvent != 0; mnMacroItems++) ;
-}
-
-
-SvBaseEventDescriptor::~SvBaseEventDescriptor()
-{
-}
-
-void SvBaseEventDescriptor::replaceByName(
-const OUString& rName,
-const Any& rElement )
-throw(
-IllegalArgumentException,
-NoSuchElementException,
-WrappedTargetException,
-RuntimeException, std::exception)
-{
-sal_uInt16 nMacroID = getMacroID(rName);
-
-// error checking
-if (0 == nMacroID)
-throw NoSuchElementException();
-if (rElement.getValueType() != getElementType())
-throw IllegalArgumentException();
-
-// get sequence
-Sequence aSequence;
-rElement >>= aSequence;
-
-// perform replace (in subclass)
-SvxMacro aMacro("","");
-getMacroFromAny(aMacro, rElement);
-replaceByName(nMacroID, aMacro);
-}
-
-Any SvBaseEventDescriptor::getByName(
-const OUString& rName )
-throw(
-NoSuchElementException,
-WrappedTargetException,
-RuntimeException, std::exception)
-{
-sal_uInt16 nMacroID = getMacroID(rName);
-
-// error checking
-if (0 == nMacroID)
-throw NoSuchElementException();
-
-// perform get (in subclass)
-Any aAny;
-SvxMacro aMacro( "", "" );
-getByName(aMacro, nMacroID);
-getAnyFromMacro(aAny, aMacro);
-return aAny;
-}
-
-Sequence SvBaseEventDescriptor::getElementNames()
-throw(RuntimeException, std::exception)
-{
-// create and fill sequence
-Sequence aSequence(mnMacroItems);
-for( sal_Int16 i = 0; i < mnMacroItems; i++)
-{
-aSequence[i] = OUString::createFromAscii( 
mpSupportedMacroItems[i].mpEventName );
-}
-
-return aSequence;
-}
-
-sal_Bool SvBaseEventDescriptor::hasByName(
-const OUString& rName )
-throw(RuntimeException, std::exception)
-{
-sal_uInt16 nMacroID = getMacroID(rName);
-return (nMacroID != 0);
-}
-
-Type SvBaseEventDescriptor::getElementType()
-throw(RuntimeException, std::exception)
-{
-return cppu::UnoType::get();
-}
-
-sal_Bool SvBaseEventDescriptor::hasElements()
-throw(RuntimeException, std::exception)
-{
-return mnMacroItems != 0;
-}
-
-sal_Bool SvBaseEventDescriptor::supportsService(const OUString& rServiceName)
-throw(RuntimeException, std::exception)
-{
-return cppu::supportsService(this, rServiceName);
-}
-
-Sequence SvBaseEventDescriptor::getSupportedServiceNames()
-throw(RuntimeException, std::exception)
-{
-Sequence aSequence { sAPI_ServiceName };
-
-return aSequence;
-}
-
-sal_uInt16 SvBaseEventDescriptor::mapNameToEventID(const OUString& rName) const
-{
-// iterate over known event names
-for(sal_Int16 i = 0; i < mnMacroItems; i++)
-{
-if( rName.equalsAscii(mpSupportedMacroItems[i].mpEventName))
-{
-return mpSupportedMacroItems[i].mnEvent;
-}
-}
-
-// not found -> return zero
-return 0;
-}
-
-sal_uInt16 SvBaseEventDescriptor::getMacroID(const OUString& rName) const
-{
-return mapNameToEventID(rName);
-}
-
-void SvBaseEventDescriptor::getAnyFromMacro(Any& rAny,
-   const 

[Libreoffice-commits] core.git: include/svtools svtools/source

2015-10-14 Thread Lionel Elie Mamane
 include/svtools/fmtfield.hxx|5 +++--
 svtools/source/control/fmtfield.cxx |   31 ---
 2 files changed, 19 insertions(+), 17 deletions(-)

New commits:
commit eb33ef931a635d2d706e2ec4abec3f5a7a24674a
Author: Lionel Elie Mamane 
Date:   Wed Oct 14 14:46:31 2015 +0200

tdf#93390 correctly handle back-and-forth between numeric and text value

Change-Id: I06711afd5d668816608661f0fe433efd93fef99e

diff --git a/include/svtools/fmtfield.hxx b/include/svtools/fmtfield.hxx
index ea9ba48..6426772 100644
--- a/include/svtools/fmtfield.hxx
+++ b/include/svtools/fmtfield.hxx
@@ -66,10 +66,11 @@ protected:
 
 boolm_bStrictFormat : 1;
 
-boolm_bValueDirty : 1;
 boolm_bEnableEmptyField : 1;
 boolm_bAutoColor : 1;
 boolm_bEnableNaN : 1;
+enum valueState { valueDirty, valueString, valueDouble };
+valueState  m_ValueState;
 double  m_dCurrentValue;
 double  m_dDefaultValue;
 
@@ -119,7 +120,7 @@ public:
 voidEnableEmptyField(bool bEnable);
 // If disabled, the value will be resetted to the last valid value on leave
 
-voidSetDefaultValue(double dDefault){ m_dDefaultValue = dDefault; 
m_bValueDirty = true; }
+voidSetDefaultValue(double dDefault){ m_dDefaultValue = dDefault; 
m_ValueState = valueDirty; }
 // If the current String is invalid, GetValue() returns this value
 double  GetDefaultValue() const { return m_dDefaultValue; }
 
diff --git a/svtools/source/control/fmtfield.cxx 
b/svtools/source/control/fmtfield.cxx
index 93b997a..df0c0cd 100644
--- a/svtools/source/control/fmtfield.cxx
+++ b/svtools/source/control/fmtfield.cxx
@@ -304,10 +304,10 @@ FormattedField::FormattedField(vcl::Window* pParent, 
WinBits nStyle, SvNumberFor
 ,m_bHasMin(false)
 ,m_bHasMax(false)
 ,m_bStrictFormat(true)
-,m_bValueDirty(true)
 ,m_bEnableEmptyField(true)
 ,m_bAutoColor(false)
 ,m_bEnableNaN(false)
+,m_ValueState(valueDirty)
 ,m_dCurrentValue(0)
 ,m_dDefaultValue(0)
 ,m_nFormatKey(0)
@@ -333,14 +333,14 @@ void FormattedField::SetText(const OUString& rStr)
 {
 
 SpinField::SetText(rStr);
-m_bValueDirty = true;
+m_ValueState = valueDirty;
 }
 
 void FormattedField::SetText( const OUString& rStr, const Selection& 
rNewSelection )
 {
 
 SpinField::SetText( rStr, rNewSelection );
-m_bValueDirty = true;
+m_ValueState = valueDirty;
 }
 
 void FormattedField::SetTextFormatted(const OUString& rStr)
@@ -402,15 +402,15 @@ void FormattedField::SetTextFormatted(const OUString& 
rStr)
 else
 aNewSel = aSel; // don't use the justified version
 SpinField::SetText(sFormatted, aNewSel);
-m_bValueDirty = false;
+m_ValueState = valueString;
 }
 
 OUString FormattedField::GetTextValue() const
 {
-if (m_bValueDirty)
+if (m_ValueState != valueString )
 {
 const_cast(this)->m_sCurrentTextValue = GetText();
-const_cast(this)->m_bValueDirty = false;
+const_cast(this)->m_ValueState = valueString;
 }
 return m_sCurrentTextValue;
 }
@@ -444,7 +444,7 @@ void FormattedField::impl_Modify(bool makeValueDirty)
 if (!IsStrictFormat())
 {
 if(makeValueDirty)
-m_bValueDirty = true;
+m_ValueState = valueDirty;
 SpinField::Modify();
 return;
 }
@@ -455,7 +455,7 @@ void FormattedField::impl_Modify(bool makeValueDirty)
 m_sLastValidText = sCheck;
 m_aLastSelection = GetSelection();
 if(makeValueDirty)
-m_bValueDirty = true;
+m_ValueState = valueDirty;
 }
 else
 {
@@ -518,7 +518,7 @@ void FormattedField::ImplSetTextImpl(const OUString& rNew, 
Selection* pNewSel)
 SpinField::SetText(rNew, aSel);
 }
 
-m_bValueDirty = true; // not always necessary, but better re-evaluate for 
safety reasons
+m_ValueState = valueDirty; // not always necessary, but better re-evaluate 
for safety reasons
 }
 
 bool FormattedField::PreNotify(NotifyEvent& rNEvt)
@@ -800,6 +800,7 @@ bool FormattedField::Notify(NotifyEvent& rNEvt)
 {
 ImplSetValue(m_dCurrentValue, true);
 Modify();
+m_ValueState = valueDouble;
 }
 else
 {
@@ -808,8 +809,8 @@ bool FormattedField::Notify(NotifyEvent& rNEvt)
 SetTextFormatted(sNew);
 else
 SetTextFormatted(m_sDefaultText);
+m_ValueState = valueString;
 }
-m_bValueDirty = false;
 }
 }
 else
@@ -869,7 +870,7 @@ void FormattedField::ImplSetValue(double dVal, bool bForce)
 
 DBG_ASSERT(ImplGetFormatter() != NULL, 

[Libreoffice-commits] core.git: include/svtools svtools/source

2015-09-22 Thread Noel Grandin
 include/svtools/svparser.hxx  |4 ++--
 svtools/source/svrtf/svparser.cxx |4 +---
 2 files changed, 3 insertions(+), 5 deletions(-)

New commits:
commit f378e1748f0645481a8b2deebd7bb2b34797aff7
Author: Noel Grandin 
Date:   Tue Sep 22 15:27:33 2015 +0200

convert Link<> to typed

Change-Id: Iccdfc807447c18c2929cc93bcb11d32b3659d666
Reviewed-on: https://gerrit.libreoffice.org/18774
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 

diff --git a/include/svtools/svparser.hxx b/include/svtools/svparser.hxx
index f4c04f5..7c595fb 100644
--- a/include/svtools/svparser.hxx
+++ b/include/svtools/svparser.hxx
@@ -44,7 +44,7 @@ enum SvParserState
 
 class SVT_DLLPUBLIC SvParser : public SvRefBase
 {
-DECL_LINK( NewDataRead, void* );
+DECL_LINK_TYPED( NewDataRead, LinkParamNone*, void );
 
 protected:
 SvStream&   rInput;
@@ -134,7 +134,7 @@ public:
 
 inline bool IsParserWorking() const { return SVPAR_WORKING == eState; }
 
-Link<> GetAsynchCallLink() const
+Link GetAsynchCallLink() const
 { return LINK( const_cast(this), SvParser, NewDataRead ); }
 
 // for asynchronous reading from the SvStream
diff --git a/svtools/source/svrtf/svparser.cxx 
b/svtools/source/svrtf/svparser.cxx
index 2a76863..241688d 100644
--- a/svtools/source/svrtf/svparser.cxx
+++ b/svtools/source/svrtf/svparser.cxx
@@ -606,7 +606,7 @@ void SvParser::BuildWhichTable( std::vector 
,
 }
 
 
-IMPL_LINK_NOARG( SvParser, NewDataRead )
+IMPL_LINK_NOARG_TYPED( SvParser, NewDataRead, LinkParamNone*, void )
 {
 switch( eState )
 {
@@ -640,8 +640,6 @@ IMPL_LINK_NOARG( SvParser, NewDataRead )
 ReleaseRef();// ready otherwise!
 break;
 }
-
-return 0;
 }
 
 /*
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2015-09-08 Thread Stephan Bergmann
 include/svtools/table/tablemodel.hxx|8 +---
 svtools/source/table/tablecontrol_impl.cxx  |4 +---
 svtools/source/table/tablecontrol_impl.hxx  |2 +-
 svtools/source/uno/unocontroltablemodel.cxx |2 +-
 4 files changed, 4 insertions(+), 12 deletions(-)

New commits:
commit 1b082cdfbe8cc9961741a1bb906af810ea129da5
Author: Stephan Bergmann 
Date:   Tue Sep 8 18:02:10 2015 +0200

Remove unused function param

Change-Id: Iab33c8008e07c4f17482dc3a8e4d15e38dc32b4e

diff --git a/include/svtools/table/tablemodel.hxx 
b/include/svtools/table/tablemodel.hxx
index 563ff88..9c07ef2 100644
--- a/include/svtools/table/tablemodel.hxx
+++ b/include/svtools/table/tablemodel.hxx
@@ -105,14 +105,8 @@ namespace svt { namespace table
 
 /** notifies the listener that one or more columns have been inserted 
into
 the table
-
-@param first
-the index of the first newly inserted row
-@param last
-the index of the last newly inserted row. Must not be smaller
-than ->first
 */
-virtual voidcolumnInserted( ColPos const i_colIndex ) = 0;
+virtual voidcolumnInserted() = 0;
 
 /** notifies the listener that one or more columns have been removed 
from
 the table
diff --git a/svtools/source/table/tablecontrol_impl.cxx 
b/svtools/source/table/tablecontrol_impl.cxx
index 7100781..d99e88e 100644
--- a/svtools/source/table/tablecontrol_impl.cxx
+++ b/svtools/source/table/tablecontrol_impl.cxx
@@ -425,14 +425,12 @@ namespace svt { namespace table
 }
 
 
-void TableControl_Impl::columnInserted( ColPos const i_colIndex )
+void TableControl_Impl::columnInserted()
 {
 m_nColumnCount = m_pModel->getColumnCount();
 impl_ni_relayout();
 
 m_rAntiImpl.Invalidate();
-
-OSL_UNUSED( i_colIndex );
}
 
 
diff --git a/svtools/source/table/tablecontrol_impl.hxx 
b/svtools/source/table/tablecontrol_impl.hxx
index 59f3299..25084ab 100644
--- a/svtools/source/table/tablecontrol_impl.hxx
+++ b/svtools/source/table/tablecontrol_impl.hxx
@@ -298,7 +298,7 @@ namespace svt { namespace table
 // ITableModelListener
 virtual voidrowsInserted( RowPos first, RowPos last ) SAL_OVERRIDE;
 virtual voidrowsRemoved( RowPos first, RowPos last ) SAL_OVERRIDE;
-virtual voidcolumnInserted( ColPos const i_colIndex ) SAL_OVERRIDE;
+virtual voidcolumnInserted() SAL_OVERRIDE;
 virtual voidcolumnRemoved( ColPos const i_colIndex ) SAL_OVERRIDE;
 virtual voidallColumnsRemoved() SAL_OVERRIDE;
 virtual voidcellsUpdated( ColPos const i_firstCol, ColPos 
i_lastCol, RowPos const i_firstRow, RowPos const i_lastRow ) SAL_OVERRIDE;
diff --git a/svtools/source/uno/unocontroltablemodel.cxx 
b/svtools/source/uno/unocontroltablemodel.cxx
index 7997de8..7140933 100644
--- a/svtools/source/uno/unocontroltablemodel.cxx
+++ b/svtools/source/uno/unocontroltablemodel.cxx
@@ -238,7 +238,7 @@ namespace svt { namespace table
 ++loop
 )
 {
-(*loop)->columnInserted( i_position );
+(*loop)->columnInserted();
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2015-07-14 Thread Stephan Bergmann
 include/svtools/filectrl.hxx   |2 --
 svtools/source/filter/exportdialog.hxx |3 ---
 2 files changed, 5 deletions(-)

New commits:
commit 34c211efce812d16dd414a94ca7aead8f671ae71
Author: Stephan Bergmann sberg...@redhat.com
Date:   Tue Jul 14 14:59:56 2015 +0200

-Werror,-Wunused-private-field

Change-Id: Iccb727f1aae27a27ed829c9ba09e247611710295

diff --git a/include/svtools/filectrl.hxx b/include/svtools/filectrl.hxx
index 8038b78..f82f67b 100644
--- a/include/svtools/filectrl.hxx
+++ b/include/svtools/filectrl.hxx
@@ -60,8 +60,6 @@ private:
 OUStringmaButtonText;
 boolmbOpenDlg;
 
-Link  maDialogCreatedHdl;
-
 FileControlMode mnFlags;
 FileControlMode_InternalmnInternalFlags;
 
diff --git a/svtools/source/filter/exportdialog.hxx 
b/svtools/source/filter/exportdialog.hxx
index e3015ec..1ef4ecd 100644
--- a/svtools/source/filter/exportdialog.hxx
+++ b/svtools/source/filter/exportdialog.hxx
@@ -109,13 +109,10 @@ private:
 OUStringms8BitColorPalette;
 OUStringms24BitColor;
 
-SizemaDialogSize;
-
 FilterConfigItem*   mpOptionsItem;
 FilterConfigItem*   mpFilterOptionsItem;
 
 OUStringmaExt;
-OUStringmaEstimatedSizeText;
 sal_Int16   mnFormat;
 sal_Int32   mnMaxFilesizeForRealtimePreview;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source svtools/uiconfig sw/source

2015-05-19 Thread Bjoern Michaelsen
 include/svtools/restartdialog.hxx|5 ++-
 svtools/source/dialogs/restartdialog.cxx |3 ++
 svtools/uiconfig/ui/restartdialog.ui |   15 ++
 sw/source/uibase/app/apphdl.cxx  |   45 ++-
 4 files changed, 66 insertions(+), 2 deletions(-)

New commits:
commit 76c61ced4eaa5f69b948dca7537028eaa88225b3
Author: Bjoern Michaelsen bjoern.michael...@canonical.com
Date:   Tue May 19 13:58:13 2015 +0200

check for and handle missing base in mail merge (related: fdo#33266)

Change-Id: I3e362a873c28026cbecf005c07def1295aa920e0

diff --git a/include/svtools/restartdialog.hxx 
b/include/svtools/restartdialog.hxx
index 48aa5b2..bede9ed 100644
--- a/include/svtools/restartdialog.hxx
+++ b/include/svtools/restartdialog.hxx
@@ -29,9 +29,12 @@ enum RestartReason {
 RESTART_REASON_PDF_AS_STANDARD_JOB_FORMAT,
 // For the modified default print job format to take effect,
 // %PRODUCTNAME must be restarted.
-RESTART_REASON_BIBLIOGRAPHY_INSTALL
+RESTART_REASON_BIBLIOGRAPHY_INSTALL,
 // For the bibliography to work properly,
 // %PRODUCTNAME must be restarted.
+RESTART_REASON_MAILMERGE_INSTALL
+// For the mail merge to work properly,
+// %PRODUCTNAME must be restarted.
 };
 
 // Must be called with the solar mutex locked:
diff --git a/svtools/source/dialogs/restartdialog.cxx 
b/svtools/source/dialogs/restartdialog.cxx
index 1e99d16..7bef797 100644
--- a/svtools/source/dialogs/restartdialog.cxx
+++ b/svtools/source/dialogs/restartdialog.cxx
@@ -40,6 +40,9 @@ public:
 case svtools::RESTART_REASON_BIBLIOGRAPHY_INSTALL:
 get(reason_, reason_bibliography_install);
 break;
+case svtools::RESTART_REASON_MAILMERGE_INSTALL:
+get(reason_, reason_mailmerge_install);
+break;
 default:
 assert(false); // this cannot happen
 }
diff --git a/svtools/uiconfig/ui/restartdialog.ui 
b/svtools/uiconfig/ui/restartdialog.ui
index 0782ff4..78e4d7d 100644
--- a/svtools/uiconfig/ui/restartdialog.ui
+++ b/svtools/uiconfig/ui/restartdialog.ui
@@ -106,6 +106,21 @@
   /packing
 /child
 child
+  object class=GtkLabel id=reason_mailmerge_install
+property name=can_focusFalse/property
+property name=no_show_allTrue/property
+property name=xalign0/property
+property name=label translatable=yesFor the mail merge 
to work properly, %PRODUCTNAME must be restarted./property
+property name=wrapTrue/property
+property name=max_width_chars50/property
+  /object
+  packing
+property name=expandFalse/property
+property name=fillTrue/property
+property name=position2/property
+  /packing
+/child
+child
   object class=GtkLabel id=label
 property name=visibleTrue/property
 property name=can_focusFalse/property
diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx
index 8b7..9b32ae7 100644
--- a/sw/source/uibase/app/apphdl.cxx
+++ b/sw/source/uibase/app/apphdl.cxx
@@ -21,17 +21,19 @@
 
 #include hintids.hxx
 
+#include comphelper/processfactory.hxx
 #include osl/diagnose.h
 #include tools/link.hxx
 #include svl/urihelper.hxx
 #include unotools/pathoptions.hxx
-#include svtools/accessibilityoptions.hxx
 #include sfx2/dispatch.hxx
 #include sfx2/event.hxx
 #include sfx2/objitem.hxx
 #include svx/dataaccessdescriptor.hxx
 #include svl/srchitem.hxx
+#include svtools/accessibilityoptions.hxx
 #include svtools/colorcfg.hxx
+#include svtools/restartdialog.hxx
 #include svl/eitem.hxx
 #include svl/whiter.hxx
 #include svl/isethint.hxx
@@ -92,7 +94,9 @@
 #include com/sun/star/beans/XPropertyContainer.hpp
 #include com/sun/star/container/XChild.hpp
 #include com/sun/star/sdbc/XConnection.hpp
+#include com/sun/star/sdb/TextConnectionSettings.hpp
 #include com/sun/star/sdbc/XDataSource.hpp
+#include org/freedesktop/PackageKit/SyncDbusSessionHelper.hpp
 #include swabstdlg.hxx
 
 #include vcl/status.hxx
@@ -115,6 +119,24 @@ using namespace ::com::sun::star;
 
 #include shells.hrc
 
+namespace
+{
+static bool lcl_hasAllComponentsAvailable()
+{
+try
+{
+return 
css::sdb::TextConnectionSettings::create(comphelper::getProcessComponentContext()).is();
+}
+catch (css::uno::Exception  e)
+{
+SAL_INFO(
+sw.core,
+assuming Base to be missing; caught   e.Message);
+return false;
+}
+}
+}
+
 SFX_IMPL_INTERFACE(SwModule, SfxModule)
 
 void SwModule::InitInterface_Impl()
@@ -278,6 +300,27 @@ SwMailMergeWizardExecutor::~SwMailMergeWizardExecutor()
 
 void SwMailMergeWizardExecutor::ExecuteMailMergeWizard( const SfxItemSet * 
pArgs )
 {

[Libreoffice-commits] core.git: include/svtools svtools/source svx/source

2015-01-14 Thread dbeurle
 include/svtools/ruler.hxx|   24 +
 svtools/source/control/ruler.cxx |  168 ---
 svx/source/dialog/svxruler.cxx   |   27 ++
 3 files changed, 152 insertions(+), 67 deletions(-)

New commits:
commit 8748ae646bd5347ce9b964efbb941a873a7b5e0d
Author: dbeurle dbeu...@student.unimelb.edu.au
Date:   Mon Jan 12 17:36:02 2015 +1100

HiDPI changes to ruler to respect screen DPI

Change-Id: I4cbb303b395ad60d4935bff55fbaea08f13334a0
Reviewed-on: https://gerrit.libreoffice.org/13867
Tested-by: Jenkins c...@libreoffice.org
Reviewed-by: Tomaž Vajngerl qui...@gmail.com
Tested-by: Tomaž Vajngerl qui...@gmail.com
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/include/svtools/ruler.hxx b/include/svtools/ruler.hxx
index 06463cf..8667f69 100644
--- a/include/svtools/ruler.hxx
+++ b/include/svtools/ruler.hxx
@@ -555,8 +555,7 @@ struct RulerTab
 sal_uInt16  nStyle;
 };
 
-#define RULER_TAB_WIDTH 7
-#define RULER_TAB_HEIGHT6
+
 
 // - RulerLine -
 
@@ -600,6 +599,27 @@ struct RulerUnitData
 sal_CharaUnitStr[8];// Unit string
 };
 
+// Data for drawing ruler tabstops
+struct RulerTabData
+{
+sal_uInt16  DPIScaleFactor;
+sal_uInt16  width;
+sal_uInt16  height;
+sal_uInt16  height2;
+sal_uInt16  width2;
+sal_uInt16  cwidth;
+sal_uInt16  cwidth2;
+sal_uInt16  cwidth3;
+sal_uInt16  cwidth4;
+sal_uInt16  dheight;
+sal_uInt16  dheight2;
+sal_uInt16  dwidth;
+sal_uInt16  dwidth2;
+sal_uInt16  dwidth3;
+sal_uInt16  dwidth4;
+sal_uInt16  textoff;
+};
+
 // - Ruler -
 
 class ImplRulerData;
diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx
index fa16f47..96b6aa0 100644
--- a/svtools/source/control/ruler.cxx
+++ b/svtools/source/control/ruler.cxx
@@ -39,25 +39,11 @@ using namespace ::com::sun::star::lang;
 using namespace ::com::sun::star::accessibility;
 
 #define RULER_OFF   3
-#define RULER_TEXTOFF   5
 #define RULER_RESIZE_OFF4
 #define RULER_MIN_SIZE  3
 
 #define RULER_VAR_SIZE  8
 
-#define RULER_TAB_HEIGHT2   2
-#define RULER_TAB_WIDTH22
-#define RULER_TAB_CWIDTH8
-#define RULER_TAB_CWIDTH2   4
-#define RULER_TAB_CWIDTH3   4
-#define RULER_TAB_CWIDTH4   2
-#define RULER_TAB_DHEIGHT   4
-#define RULER_TAB_DHEIGHT2  1
-#define RULER_TAB_DWIDTH5
-#define RULER_TAB_DWIDTH2   3
-#define RULER_TAB_DWIDTH3   3
-#define RULER_TAB_DWIDTH4   1
-
 #define RULER_UPDATE_LINES  0x01
 #define RULER_UPDATE_DRAW   0x02
 
@@ -207,6 +193,26 @@ static const RulerUnitData 
aImplRulerUnitTab[RULER_UNIT_COUNT] =
 { MAP_100TH_MM,551,   551.0,   551.0,551.0,   1102.0, 551, 3, 
 li}  // LINE
 };
 
+static RulerTabData ruler_tab =
+{
+0, // DPIScaleFactor to be set
+7, // ruler_tab_width
+6, // ruler_tab_height
+2, // ruler_tab_height2
+2, // ruler_tab_width2
+8, // ruler_tab_cwidth
+4, // ruler_tab_cwidth2
+4, // ruler_tab_cwidth3
+2, // ruler_tab_cwidth4
+4, // ruler_tab_dheight
+1, // ruler_tab_dheight2
+5, // ruler_tab_dwidth
+3, // ruler_tab_dwidth2
+3, // ruler_tab_dwidth3
+1, // ruler_tab_dwidth4
+5  // ruler_tab_textoff
+};
+
 void Ruler::ImplInit( WinBits nWinBits )
 {
 // Default WinBits setzen
@@ -219,7 +225,7 @@ void Ruler::ImplInit( WinBits nWinBits )
 EnableRTL( false );
 }
 
-// Variablen initialisieren
+// Initialize variables
 mnWinStyle  = nWinBits; // Window-Style
 mnBorderOff = 0;// Border-Offset
 mnWinOff= 0;// EditWinOffset
@@ -270,7 +276,7 @@ void Ruler::ImplInit( WinBits nWinBits )
 // Setup the default size
 Rectangle aRect;
 GetTextBoundRect( aRect, OUString( 0123456789 ) );
-long nDefHeight = aRect.GetHeight() + RULER_OFF * 2 + RULER_TEXTOFF * 2 + 
mnBorderWidth;
+long nDefHeight = aRect.GetHeight() + RULER_OFF * 2 + ruler_tab.textoff * 
2 + mnBorderWidth;
 
 Size aDefSize;
 if ( nWinBits  WB_HORZ )
@@ -290,7 +296,32 @@ Ruler::Ruler( vcl::Window* pParent, WinBits nWinStyle ) :
 mpData(NULL),
 mpDragData(new ImplRulerData)
 {
+
+// Check to see if the ruler constructor has
+// already been called before otherwise
+// we end up with over-scaled elements
+if( ruler_tab.DPIScaleFactor == 0 )
+{
+ruler_tab.DPIScaleFactor = pParent-GetDPIScaleFactor();
+ruler_tab.width*= ruler_tab.DPIScaleFactor;
+ruler_tab.height   *= ruler_tab.DPIScaleFactor;
+ruler_tab.height2  *= ruler_tab.DPIScaleFactor;
+ruler_tab.width2   *= ruler_tab.DPIScaleFactor;
+ruler_tab.cwidth   *= ruler_tab.DPIScaleFactor;
+ruler_tab.cwidth2  *= ruler_tab.DPIScaleFactor;
+ruler_tab.cwidth3  *= ruler_tab.DPIScaleFactor;
+ruler_tab.cwidth4  *= 

[Libreoffice-commits] core.git: include/svtools svtools/source

2014-12-14 Thread Michael Weghorn
 include/svtools/stdmenu.hxx|   80 ++---
 include/svtools/svlbitm.hxx|6 +-
 include/svtools/svparser.hxx   |   70 +++-
 include/svtools/treelistentry.hxx  |   12 ++---
 svtools/source/control/stdmenu.cxx |2 
 5 files changed, 83 insertions(+), 87 deletions(-)

New commits:
commit 4595dc37e601c5a1f245af38ac728d6e45c2865c
Author: Michael Weghorn m.wegh...@posteo.de
Date:   Fri Dec 12 22:30:32 2014 +0100

fdo#39468 translate German comments

Change-Id: I90deb0877940167c9d5e3ba630528e575af6dd66
Reviewed-on: https://gerrit.libreoffice.org/13459
Reviewed-by: Noel Grandin noelgran...@gmail.com
Tested-by: Noel Grandin noelgran...@gmail.com

diff --git a/include/svtools/stdmenu.hxx b/include/svtools/stdmenu.hxx
index 7f4e9af..504db1f 100644
--- a/include/svtools/stdmenu.hxx
+++ b/include/svtools/stdmenu.hxx
@@ -31,36 +31,34 @@ namespace vcl {
 
 /*
 
-Beschreibung
+Description
 
 
 class FontNameMenu
 
-Beschreibung
+Description
 
-Erlaubt die Auswahl von Fonts. Das Menu wird ueber Fill mit den FontNamen
-gefuellt. Fill sortiert automatisch die FontNamen (inkl. aller Umlaute und
-sprachabhaengig). Mit SetCurName()/GetCurName() kann der aktuelle Fontname
-gesetzt/abgefragt werden. Wenn SetCurName() mit einem leeren String
-aufgerufen wird, wird kein Eintrag als aktueller angezeigt (fuer DontKnow).
-Vor dem Selectaufruf wird der ausgewaehlte Name automatisch als aktueller
-gesetzt und wuerde beim naechsten Aufruf auch als aktueller Name angezeigt
-werden. Deshalb sollte vor PopupMenu::Execute() gegebenenfalls mit
-SetCurName() der aktuelle Fontname gesetzt werden.
+Allows the selection of fonts. The menu is filled with the FontNames by
+the method Fill(). Fill() automatically sorts the FontNames (incl. all
+umlauts and language-dependent). Using SetCurName()/GetCurName(), the
+current FontName can be set/requested. If SetCurName() is called with
+an empty string, no entry is displayed as the current one.
+Before the Select call, the selected name is automatically set as the
+current one and would be displayed as the current name on the next call.
+Because of this, the current FontName should be set using SetCurName()
+if necessary before calling PopupMenu::Execute().
 
-Da die Id's und der interne Aufbau des Menus nicht bekannt ist, muss ein
-Select-Handler gesetzt werden, um die Auswahl eines Namens mitzubekommen.
+As the Ids and the internal structure of the menu are not known, a
+Select handler must be set in order to notice the selection of a name.
 
-In dieses Menu koennen keine weiteren Items eingefuegt werden.
+No further items can be inserted into that menu.
 
-Spaeter soll auch das Menu die gleichen Bitmaps anzeigen, wie die
-FontNameBox. Auf den Systemen, wo Menues nicht automatisch scrollen,
-wird spaeter wohl ein A-Z Menu ziwschengeschaltet. Da ein Menu bei vielen
-installierten Fonts bisher schon immer lange gebraucht hat, sollte dieses
-Menu schon jetzt nur einmal erzeugt werden (da sonst das Kontextmenu bis
-zu 10-Sekunden fuer die Erzeugung brauchen koennte).
+Later on, the menu shall display the same bitmaps as the FontNameBox.
+On many systems, where menues don't scroll automatically, an A-Z menu
+might be interposed. As a menu has always needed long when many Fonts
+are installed, this menu should only be generated once.
 
-Querverweise
+References
 
 FontList; FontSizeMenu; FontNameBox
 
@@ -68,32 +66,32 @@ FontList; FontSizeMenu; FontNameBox
 
 class FontSizeMenu
 
-Beschreibung
+Description
 
-Erlaubt die Auswahl von Fontgroessen. Ueber Fill wird das FontSizeMenu
-gefuellt und ueber GetCurHeight() kann die ausgewaehlte Fontgroesse
-abgefragt werden. Mit SetCurHeight()/GetCurHeight() kann die aktuelle
-Fontgroesse gesetzt/abgefragt werden. Wenn SetCurHeight() mit 0 aufgerufen
-wird, wird kein Eintrag als aktueller angezeigt (fuer DontKnow). Vor dem
-Selectaufruf wird die ausgewaehlte Groesse automatisch als aktuelle gesetzt
-und wuerde beim naechsten Aufruf auch als aktuelle Groesse angezeigt werden.
-Deshalb sollte vor PopupMenu::Execute() gegebenenfalls mit SetCurHeight()
-die aktuelle Groesse gesetzt werden. Da die Groessen vom ausgewaehlten Font
-abhaengen, sollte nach einer Aenderung des Fontnamen das Menu mit Fill mit
-den Groessen des Fonts neu gefuellt werden.
+Allows the selection of font sizes. The FontSizeMenu is filled using
+Fill(). The selected font size can be queried using GetCurHeight().
+Using SetCurHeight()/GetCurHeight(), the current font size can be set/
+requested. If SetCurHeight() is called with 0, no entry is displayed
+as the current one.
+Before the Select call, the selected size is automatically set as the
+current one and would be displayed as the current size on the next call.
+Because of this, the current font size should be set using SetCurHeight()
+if necessary before 

[Libreoffice-commits] core.git: include/svtools svtools/source

2014-11-22 Thread Kohei Yoshida
 include/svtools/svparser.hxx  |   15 
 svtools/source/svrtf/svparser.cxx |   45 --
 2 files changed, 24 insertions(+), 36 deletions(-)

New commits:
commit 811d6ff5e30e1527c54b25b8040b3783205245a6
Author: Kohei Yoshida kohei.yosh...@collabora.com
Date:   Sat Nov 22 22:37:41 2014 -0500

Apply pimpl to SvKeyValueIterator, to hide ptr_vector from the header.

Change-Id: I16c25d28066fbc8d6357bf89b047763b67bc85bb

diff --git a/include/svtools/svparser.hxx b/include/svtools/svparser.hxx
index d3294ea..f6cfc9c 100644
--- a/include/svtools/svparser.hxx
+++ b/include/svtools/svparser.hxx
@@ -25,8 +25,7 @@
 #include tools/ref.hxx
 #include rtl/textenc.h
 #include rtl/ustring.hxx
-#include boost/ptr_container/ptr_vector.hpp
-#include boost/utility.hpp
+#include boost/noncopyable.hpp
 #include vector
 
 struct SvParser_Impl;
@@ -248,21 +247,17 @@ public:
  *
  *==*/
 
-typedef boost::ptr_vectorSvKeyValue SvKeyValueList_Impl;
-
 class SVT_DLLPUBLIC SvKeyValueIterator : public SvRefBase,
 private boost::noncopyable
 {
-/** Representation.
-*/
-SvKeyValueList_Impl* m_pList;
-sal_uInt16   m_nPos;
+struct Impl;
+Impl* mpImpl;
 
 public:
 /** Construction/Destruction.
 */
-SvKeyValueIterator (void);
-virtual ~SvKeyValueIterator (void);
+SvKeyValueIterator();
+virtual ~SvKeyValueIterator();
 
 /** Operation.
 */
diff --git a/svtools/source/svrtf/svparser.cxx 
b/svtools/source/svrtf/svparser.cxx
index 1412609..d8c5aea 100644
--- a/svtools/source/svrtf/svparser.cxx
+++ b/svtools/source/svrtf/svparser.cxx
@@ -17,13 +17,15 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include stdio.h
 #include svtools/svparser.hxx
 #include tools/stream.hxx
 #include tools/debug.hxx
 #include rtl/textcvt.h
 #include rtl/tencinfo.h
 
+#include stdio.h
+#include boost/ptr_container/ptr_vector.hpp
+
 // structure to store the actuel data
 struct SvParser_Impl
 {
@@ -649,40 +651,34 @@ IMPL_STATIC_LINK( SvParser, NewDataRead, void*, EMPTYARG )
  *
  *==*/
 
-/*
- * SvKeyValueIterator.
- */
-SvKeyValueIterator::SvKeyValueIterator (void)
-: m_pList (new SvKeyValueList_Impl),
-  m_nPos  (0)
+typedef boost::ptr_vectorSvKeyValue SvKeyValueList_Impl;
+
+struct SvKeyValueIterator::Impl
 {
-}
+SvKeyValueList_Impl maList;
+sal_uInt16 mnPos;
 
-/*
- * ~SvKeyValueIterator.
- */
-SvKeyValueIterator::~SvKeyValueIterator (void)
+Impl() : mnPos(0) {}
+};
+
+SvKeyValueIterator::SvKeyValueIterator() : mpImpl(new Impl) {}
+
+SvKeyValueIterator::~SvKeyValueIterator()
 {
-delete m_pList;
+delete mpImpl;
 }
 
-/*
- * GetFirst.
- */
 bool SvKeyValueIterator::GetFirst (SvKeyValue rKeyVal)
 {
-m_nPos = m_pList-size();
+mpImpl-mnPos = mpImpl-maList.size();
 return GetNext (rKeyVal);
 }
 
-/*
- * GetNext.
- */
 bool SvKeyValueIterator::GetNext (SvKeyValue rKeyVal)
 {
-if (m_nPos  0)
+if (mpImpl-mnPos  0)
 {
-rKeyVal = (*m_pList)[--m_nPos];
+rKeyVal = mpImpl-maList[--mpImpl-mnPos];
 return true;
 }
 else
@@ -692,12 +688,9 @@ bool SvKeyValueIterator::GetNext (SvKeyValue rKeyVal)
 }
 }
 
-/*
- * Append.
- */
 void SvKeyValueIterator::Append (const SvKeyValue rKeyVal)
 {
-m_pList-push_back(new SvKeyValue(rKeyVal));
+mpImpl-maList.push_back(new SvKeyValue(rKeyVal));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2014-10-14 Thread Noel Grandin
 include/svtools/treelist.hxx  |   47 +++--
 include/svtools/treelistbox.hxx   |2 -
 svtools/source/contnr/treelist.cxx|   54 +-
 svtools/source/contnr/treelistbox.cxx |   14 +---
 4 files changed, 61 insertions(+), 56 deletions(-)

New commits:
commit fa6ac05beaaf1160c205e40099b99f0ed0efb131
Author: Noel Grandin n...@peralex.com
Date:   Mon Oct 13 20:42:24 2014 +0200

fdo#84938 - replace LIST_ACTION constants with enum

Change-Id: I21c05ada0a793b1e3ddf87481e66b60b83529767

diff --git a/include/svtools/treelist.hxx b/include/svtools/treelist.hxx
index e0984d7..cf20872 100644
--- a/include/svtools/treelist.hxx
+++ b/include/svtools/treelist.hxx
@@ -32,17 +32,20 @@
 #include vector
 #include boost/ptr_container/ptr_map.hpp
 
-#define LISTACTION_INSERTED 1
-#define LISTACTION_REMOVING 2
-#define LISTACTION_REMOVED  3
-#define LISTACTION_MOVING   4
-#define LISTACTION_MOVED5
-#define LISTACTION_CLEARING 6
-#define LISTACTION_INSERTED_TREE7
-#define LISTACTION_INVALIDATE_ENTRY 8
-#define LISTACTION_RESORTING9
-#define LISTACTION_RESORTED 10
-#define LISTACTION_CLEARED  11
+enum class SvListAction
+{
+INSERTED = 1,
+REMOVING = 2,
+REMOVED  = 3,
+MOVING   = 4,
+MOVED= 5,
+CLEARING = 6,
+INSERTED_TREE= 7,
+INVALIDATE_ENTRY = 8,
+RESORTING= 9,
+RESORTED = 10,
+CLEARED  = 11
+};
 
 class SvTreeListEntry;
 class SvListView;
@@ -142,27 +145,27 @@ public:
 { return ( nPos  aViewList.size() ) ? aViewList[ nPos ] : NULL; }
 
 voidBroadcast(
-sal_uInt16 nActionId,
+SvListAction nActionId,
 SvTreeListEntry* pEntry1=0,
 SvTreeListEntry* pEntry2=0,
 sal_uLong nPos=0
 );
 
-void EnableInvalidate( bool bEnable );
+voidEnableInvalidate( bool bEnable );
 
 // Notify all Listeners
 voidInvalidateEntry( SvTreeListEntry* );
 
 sal_uLong   GetEntryCount() const { return nEntryCount; }
-SvTreeListEntry*First() const;
-SvTreeListEntry*Next( SvTreeListEntry* pEntry, sal_uInt16* 
pDepth=0 ) const;
-SvTreeListEntry*Prev( SvTreeListEntry* pEntry, sal_uInt16* 
pDepth=0 ) const;
-SvTreeListEntry*Last() const;
+SvTreeListEntry*First() const;
+SvTreeListEntry*Next( SvTreeListEntry* pEntry, sal_uInt16* pDepth=0 ) 
const;
+SvTreeListEntry*Prev( SvTreeListEntry* pEntry, sal_uInt16* pDepth=0 ) 
const;
+SvTreeListEntry*Last() const;
 
-SvTreeListEntry*FirstChild( SvTreeListEntry* pParent ) const;
-SvTreeListEntry*NextSibling( SvTreeListEntry* pEntry ) const;
-SvTreeListEntry*PrevSibling( SvTreeListEntry* pEntry ) const;
-SvTreeListEntry*LastSibling( SvTreeListEntry* pEntry ) const;
+SvTreeListEntry*FirstChild( SvTreeListEntry* pParent ) const;
+SvTreeListEntry*NextSibling( SvTreeListEntry* pEntry ) const;
+SvTreeListEntry*PrevSibling( SvTreeListEntry* pEntry ) const;
+SvTreeListEntry*LastSibling( SvTreeListEntry* pEntry ) const;
 
 sal_uLong   Insert( SvTreeListEntry* pEntry,SvTreeListEntry* 
pPar,sal_uLong nPos = TREELIST_APPEND);
 sal_uLong   Insert( SvTreeListEntry* pEntry,sal_uLong nRootPos = 
TREELIST_APPEND )
@@ -273,7 +276,7 @@ public:
 voidClear();
 virtual voidSetModel( SvTreeList* );
 virtual voidModelNotification(
-sal_uInt16 nActionId,
+SvListAction nActionId,
 SvTreeListEntry* pEntry1,
 SvTreeListEntry* pEntry2,
 sal_uLong nPos
diff --git a/include/svtools/treelistbox.hxx b/include/svtools/treelistbox.hxx
index fb69656..733d4a2 100644
--- a/include/svtools/treelistbox.hxx
+++ b/include/svtools/treelistbox.hxx
@@ -752,7 +752,7 @@ public:
 voidRemoveParentKeepChildren( SvTreeListEntry* pParent );
 
 DECL_LINK( DefaultCompare, SvSortData* );
-virtual voidModelNotification( sal_uInt16 nActionId, SvTreeListEntry* 
pEntry1,
+virtual voidModelNotification( SvListAction nActionId, 
SvTreeListEntry* pEntry1,
 SvTreeListEntry* pEntry2, sal_uLong nPos ) 
SAL_OVERRIDE;
 
 voidEndSelection();
diff --git a/svtools/source/contnr/treelist.cxx 
b/svtools/source/contnr/treelist.cxx
index 087496c..27eebd4 100644
--- a/svtools/source/contnr/treelist.cxx
+++ b/svtools/source/contnr/treelist.cxx
@@ -44,7 +44,7 @@ SvTreeList::~SvTreeList()
 }
 
 void SvTreeList::Broadcast(
-

[Libreoffice-commits] core.git: include/svtools svtools/source

2014-09-26 Thread Caolán McNamara
 include/svtools/brwbox.hxx|   24 
 svtools/source/brwbox/brwbox1.cxx |   19 +--
 2 files changed, 41 insertions(+), 2 deletions(-)

New commits:
commit 827ae65e8577e285b8ad30f4a81af087658e42fa
Author: Caolán McNamara caol...@redhat.com
Date:   Fri Sep 26 12:51:07 2014 +0100

Resolves: fdo#83943 avoid infinite recursion

when attempting to make a cell visible when
the parent simply isn't large enough to show
any part of the cell

Change-Id: I987c9b3be30a66a5e1e27ad9e452f2ca65330d9e

diff --git a/include/svtools/brwbox.hxx b/include/svtools/brwbox.hxx
index 34eb593..e16e0de 100644
--- a/include/svtools/brwbox.hxx
+++ b/include/svtools/brwbox.hxx
@@ -271,6 +271,30 @@ private:
 }   uRow;
 MultiSelection* pColSel;// selected column-ids
 
+//fdo#83943, detect if making the cursor position
+//visible is impossible to achieve
+struct CursorMoveAttempt
+{
+long m_nCol;
+long m_nRow;
+bool m_bScrolledToReachCell;
+CursorMoveAttempt(long nCol, long nRow, bool bScrolledToReachCell)
+: m_nCol(nCol)
+, m_nRow(nRow)
+, m_bScrolledToReachCell(bScrolledToReachCell)
+{
+}
+bool operator==(const CursorMoveAttempt r) const
+{
+return m_nCol == r.m_nCol 
+   m_nRow == r.m_nRow 
+   m_bScrolledToReachCell == r.m_bScrolledToReachCell;
+}
+bool operator!=(const CursorMoveAttempt r) const { return !(*this == 
r); }
+};
+typedef std::stackCursorMoveAttempt GotoStack;
+GotoStack   m_aGotoStack;
+
 ::std::auto_ptr ::svt::BrowseBoxImpl   m_pImpl;   // impl structure 
of the BrowseBox object
 
 boolm_bFocusOnlyCursor; // hide cursor if we don't have the 
focus
diff --git a/svtools/source/brwbox/brwbox1.cxx 
b/svtools/source/brwbox/brwbox1.cxx
index 4416b23..3fedada 100644
--- a/svtools/source/brwbox/brwbox1.cxx
+++ b/svtools/source/brwbox/brwbox1.cxx
@@ -1560,7 +1560,6 @@ bool BrowseBox::GoToColumnId( sal_uInt16 nColId)
 
 bool BrowseBox::GoToColumnId( sal_uInt16 nColId, bool bMakeVisible, bool 
bRowColMove)
 {
-
 if (!bColumnCursor)
 return false;
 
@@ -1579,6 +1578,8 @@ bool BrowseBox::GoToColumnId( sal_uInt16 nColId, bool 
bMakeVisible, bool bRowCol
 DoHideCursor( GoToColumnId );
 nCurColId = nColId;
 
+bool bScrolled = false;
+
 sal_uInt16 nFirstPos = nFirstCol;
 sal_uInt16 nWidth = (sal_uInt16)pColumn-Width();
 sal_uInt16 nLastPos = GetColumnAtXPosPixel(
@@ -1591,11 +1592,25 @@ bool BrowseBox::GoToColumnId( sal_uInt16 nColId, bool 
bMakeVisible, bool bRowCol
 ScrollColumns( nNewPos-nFirstPos );
 else if ( nNewPos  nLastPos )
 ScrollColumns( nNewPos-nLastPos );
+bScrolled = true;
 }
 
 DoShowCursor( GoToColumnId );
 if (!bRowColMove)
-CursorMoved();
+{
+//try to move to nCurRow, nColId
+CursorMoveAttempt aAttempt(nCurRow, nColId, bScrolled);
+//Detect if we are already in a call to BrowseBox::GoToColumnId
+//but the the attempt is impossible and we are simply recursing
+//into BrowseBox::GoToColumnId with the same impossible to
+//fulfill conditions
+if (m_aGotoStack.empty() || aAttempt != m_aGotoStack.top())
+{
+m_aGotoStack.push(aAttempt);
+CursorMoved();
+m_aGotoStack.pop();
+}
+}
 return true;
 }
 return true;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source unusedcode.easy

2014-08-13 Thread Caolán McNamara
 include/svtools/wizdlg.hxx|1 -
 svtools/source/dialogs/wizdlg.cxx |   12 
 unusedcode.easy   |1 +
 3 files changed, 1 insertion(+), 13 deletions(-)

New commits:
commit a498fb83318308427414103c158e186c6b20ff73
Author: Caolán McNamara caol...@redhat.com
Date:   Wed Aug 13 08:44:17 2014 +0100

callcatcher: another round of ResId ctor removals

Change-Id: I2d074133172a2641d735efd2a007d18a65b4d9e9

diff --git a/include/svtools/wizdlg.hxx b/include/svtools/wizdlg.hxx
index 4efca16..6ee3deb 100644
--- a/include/svtools/wizdlg.hxx
+++ b/include/svtools/wizdlg.hxx
@@ -253,7 +253,6 @@ private:
 
 public:
 WizardDialog( Window* pParent, WinBits nStyle = WB_STDTABDIALOG );
-WizardDialog( Window* pParent, const ResId rResId );
 WizardDialog( Window* pParent, const OString rID, const OUString 
rUIXMLDescription );
 virtual ~WizardDialog();
 
diff --git a/svtools/source/dialogs/wizdlg.cxx 
b/svtools/source/dialogs/wizdlg.cxx
index 51bd143..2c8b752 100644
--- a/svtools/source/dialogs/wizdlg.cxx
+++ b/svtools/source/dialogs/wizdlg.cxx
@@ -359,8 +359,6 @@ TabPage* WizardDialog::ImplGetPage( sal_uInt16 nLevel ) 
const
 return NULL;
 }
 
-
-
 WizardDialog::WizardDialog( Window* pParent, WinBits nStyle ) :
 ModalDialog( pParent, nStyle )
 {
@@ -369,22 +367,12 @@ WizardDialog::WizardDialog( Window* pParent, WinBits 
nStyle ) :
 
 
 
-WizardDialog::WizardDialog( Window* pParent, const ResId rResId ) :
-ModalDialog( pParent, rResId )
-{
-ImplInitData();
-}
-
-
-
 WizardDialog::WizardDialog( Window* pParent, const OString rID, const 
OUString rUIXMLDescription ) :
 ModalDialog( pParent, rID, rUIXMLDescription )
 {
 ImplInitData();
 }
 
-
-
 WizardDialog::~WizardDialog()
 {
 maWizardLayoutTimer.Stop();
diff --git a/unusedcode.easy b/unusedcode.easy
index dc8ae96..7ce6296 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -217,5 +217,6 @@ svt::CheckInvariants(void const*)
 svt::table::TableControl_Impl::impl_checkInvariants() const
 svt::table::UnoControlTableModel::checkInvariants() const
 vcl::MapChar(vcl::_TrueTypeFont*, unsigned short, bool)
+writerfilter::dmapper::DomainMapper::IsStyleSheetImport() const
 writerfilter::dmapper::StyleSheetTable::GetStyleIdFromIndex(unsigned int)
 writerfilter::ooxml::OOXMLBooleanValue::OOXMLBooleanValue(char const*)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2014-05-13 Thread Matúš Kukan
 include/svtools/brwbox.hxx|4 
 svtools/source/brwbox/brwbox1.cxx |   23 ---
 svtools/source/brwbox/brwbox2.cxx |8 
 3 files changed, 35 deletions(-)

New commits:
commit 0727c09e244b52f1a10faead9123f9f502ffd56b
Author: Matúš Kukan matus.ku...@collabora.com
Date:   Tue May 13 15:37:44 2014 +0200

BrowseBoxCheckInvariants appears to be unused [loplugin:unreffun]

Change-Id: Ie6c546ee085b20bd3eb39cdfb7b38394c0a35b67

diff --git a/include/svtools/brwbox.hxx b/include/svtools/brwbox.hxx
index 61f3657..f16c001 100644
--- a/include/svtools/brwbox.hxx
+++ b/include/svtools/brwbox.hxx
@@ -213,10 +213,6 @@ class SVT_DLLPUBLIC BrowseBox
 friend class BrowserDataWin;
 friend class ::svt::BrowseBoxImpl;
 
-#ifdef DBG_UTIL
-friend const char* BrowseBoxCheckInvariants( const void * pVoid );
-#endif
-
 public:
 static const sal_uInt16 HandleColumnId = 0;
 
diff --git a/svtools/source/brwbox/brwbox1.cxx 
b/svtools/source/brwbox/brwbox1.cxx
index d529c49..a5f68dd 100644
--- a/svtools/source/brwbox/brwbox1.cxx
+++ b/svtools/source/brwbox/brwbox1.cxx
@@ -33,8 +33,6 @@
 #include brwimpl.hxx
 
 
-extern const char* BrowseBoxCheckInvariants( const void* pVoid );
-
 #define SCROLL_FLAGS (SCROLL_CLIP | SCROLL_NOCHILDREN)
 #define getDataWindow() ((BrowserDataWin*)pDataWin)
 
@@ -2391,27 +2389,6 @@ void BrowseBox::SetHeaderBar( BrowserHeader* pHeaderBar )
 ( (BrowserDataWin*)pDataWin )-pHeaderBar-SetStartDragHdl( LINK( this, 
BrowseBox, StartDragHdl ) );
 }
 
-
-#ifdef DBG_UTIL
-const char* BrowseBoxCheckInvariants( const void * pVoid )
-{
-const BrowseBox * p = (const BrowseBox *)pVoid;
-
-if (p-nRowCount  0) return BrowseBox: nRowCount  0;
-if (p-nTopRow  0) return BrowseBox: nTopRow  0;
-if (p-nTopRow = p-nRowCount  p-nRowCount != 0) return BrowseBox: 
nTopRow = nRowCount  nRowCount != 0;
-if (p-nCurRow  -1) return BrowseBox: nCurRow  -1;
-if (p-nCurRow  p-nRowCount) return BrowseBox: nCurRow  nRowCount;
-
-// Sadly not always the case when editing:
-//if (p-nCurRow  0  p-nRowCount != 0) return nCurRow  0  
nRowCount != 0;
-//if (p-nCurRow = p-nRowCount  p-nRowCount != 0) return nCurRow = 
nRowCount  nRowCount != 0;
-
-return NULL;
-}
-#endif
-
-
 long BrowseBox::GetTitleHeight() const
 {
 long nHeight;
diff --git a/svtools/source/brwbox/brwbox2.cxx 
b/svtools/source/brwbox/brwbox2.cxx
index 33e4935..ef9a6d4 100644
--- a/svtools/source/brwbox/brwbox2.cxx
+++ b/svtools/source/brwbox/brwbox2.cxx
@@ -33,14 +33,6 @@ using namespace ::com::sun::star::datatransfer;
 
 
 
-
-
-
-
-extern const char* BrowseBoxCheckInvariants( const void * pVoid );
-
-
-
 void BrowseBox::StartDrag( sal_Int8 /* _nAction */, const Point /* _rPosPixel 
*/ )
 {
 // not interested in this event
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2014-05-06 Thread Eike Rathke
 include/svtools/langtab.hxx |2 ++
 svtools/source/misc/langtab.cxx |   10 ++
 2 files changed, 12 insertions(+)

New commits:
commit a9ff01648ac19fa0f11ceaa2dfd2f4a475b4008c
Author: Eike Rathke er...@redhat.com
Date:   Tue May 6 14:19:42 2014 +0100

provide static GetLanguageEntryCount() and GetLanguageTypeAtIndex()

Change-Id: I89dc5d25b37169ebc1581ebf957d33dd7b0e204c

diff --git a/include/svtools/langtab.hxx b/include/svtools/langtab.hxx
index 7f437e0..090eb3f 100644
--- a/include/svtools/langtab.hxx
+++ b/include/svtools/langtab.hxx
@@ -49,6 +49,8 @@ public:
 static OUString GetLanguageString( const LanguageType eType );
 static OUString GetLanguageString( const LanguageType eType, bool 
bUserInterfaceSelection );
 static LanguageType GetLanguageType( const OUString rStr );
+static sal_uInt32   GetLanguageEntryCount();
+static LanguageType GetLanguageTypeAtIndex( sal_uInt32 nIndex );
 };
 
 // Add LRE or RLE embedding characters to the string based on the
diff --git a/svtools/source/misc/langtab.cxx b/svtools/source/misc/langtab.cxx
index 236f074..2cd2994 100644
--- a/svtools/source/misc/langtab.cxx
+++ b/svtools/source/misc/langtab.cxx
@@ -192,6 +192,11 @@ sal_uInt32 SvtLanguageTable::GetEntryCount() const
 return Count();
 }
 
+sal_uInt32 SvtLanguageTable::GetLanguageEntryCount()
+{
+return theLanguageTable::get().GetEntryCount();
+}
+
 
 
 LanguageType SvtLanguageTable::GetTypeAtIndex( sal_uInt32 nIndex ) const
@@ -202,6 +207,11 @@ LanguageType SvtLanguageTable::GetTypeAtIndex( sal_uInt32 
nIndex ) const
 return nType;
 }
 
+LanguageType SvtLanguageTable::GetLanguageTypeAtIndex( sal_uInt32 nIndex )
+{
+return theLanguageTable::get().GetTypeAtIndex( nIndex);
+}
+
 
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2014-05-06 Thread Eike Rathke
 include/svtools/langtab.hxx |   19 ++-
 svtools/source/misc/langtab.cxx |   28 +---
 2 files changed, 23 insertions(+), 24 deletions(-)

New commits:
commit d80490e938ec0fcc876879a09062fccca321998e
Author: Eike Rathke er...@redhat.com
Date:   Tue May 6 19:55:49 2014 +0100

move ResArray into SvtLanguageTableImpl

Change-Id: I0921fcef306f1ca60196fc9dfa2652e91db63004

diff --git a/include/svtools/langtab.hxx b/include/svtools/langtab.hxx
index e19aa75..14b506b 100644
--- a/include/svtools/langtab.hxx
+++ b/include/svtools/langtab.hxx
@@ -19,20 +19,13 @@
 #ifndef INCLUDED_SVTOOLS_LANGTAB_HXX
 #define INCLUDED_SVTOOLS_LANGTAB_HXX
 
-
-#include tools/resary.hxx
 #include i18nlangtag/lang.h
+#include rtl/ustring.hxx
 #include svtools/svtdllapi.h
 
-
-//  class SvtLanguageTable
-
-
-class SVT_DLLPUBLIC SvtLanguageTable : public ResStringArray
+class SVT_DLLPUBLIC SvtLanguageTable
 {
 public:
-SvtLanguageTable();
-~SvtLanguageTable();
 
 static OUString GetLanguageString( const LanguageType eType );
 static LanguageType GetLanguageType( const OUString rStr );
@@ -47,14 +40,6 @@ public:
   parameter.
  */
 static OUString GetLanguageString( const LanguageType eType, bool 
bUserInterfaceSelection );
-
-private:
-
-const OUString  GetString( const LanguageType eType, bool 
bUserInterfaceSelection = false ) const;
-LanguageTypeGetType( const OUString rStr ) const;
-sal_uInt32  GetEntryCount() const;
-LanguageTypeGetTypeAtIndex( sal_uInt32 nIndex ) const;
-
 };
 
 // Add LRE or RLE embedding characters to the string based on the
diff --git a/svtools/source/misc/langtab.cxx b/svtools/source/misc/langtab.cxx
index 2cd2994..08d50bd 100644
--- a/svtools/source/misc/langtab.cxx
+++ b/svtools/source/misc/langtab.cxx
@@ -31,12 +31,26 @@
 #include svtools/svtresid.hxx
 #include svtools/langtab.hxx
 #include unotools/syslocale.hxx
+#include tools/resary.hxx
 
 
 using namespace ::com::sun::star;
 
+class SvtLanguageTableImpl : public ResStringArray
+{
+public:
+
+SvtLanguageTableImpl();
+virtual ~SvtLanguageTableImpl();
+
+const OUString  GetString( const LanguageType eType, bool 
bUserInterfaceSelection = false ) const;
+LanguageTypeGetType( const OUString rStr ) const;
+sal_uInt32  GetEntryCount() const;
+LanguageTypeGetTypeAtIndex( sal_uInt32 nIndex ) const;
+};
+
 namespace {
-struct theLanguageTable : public rtl::Static SvtLanguageTable, 
theLanguageTable  {};
+struct theLanguageTable : public rtl::Static SvtLanguageTableImpl, 
theLanguageTable  {};
 }
 
 SVT_DLLPUBLIC const OUString ApplyLreOrRleEmbedding( const OUString rText )
@@ -122,20 +136,20 @@ namespace {
 //The value of STR_ARR_SVT_LANGUAGE_TABLE has changed. 
wizards/com/sun/star/wizards/letter/LocaleCodes.java has this value hard coded, 
please adapt it to your change.
 }
 
-SvtLanguageTable::SvtLanguageTable() :
+SvtLanguageTableImpl::SvtLanguageTableImpl() :
 ResStringArray( SvtResId( STR_ARR_SVT_LANGUAGE_TABLE ) )
 {
 }
 
 
 
-SvtLanguageTable::~SvtLanguageTable()
+SvtLanguageTableImpl::~SvtLanguageTableImpl()
 {
 }
 
 
 
-const OUString SvtLanguageTable::GetString( const LanguageType eType, bool 
bUserInterfaceSelection ) const
+const OUString SvtLanguageTableImpl::GetString( const LanguageType eType, bool 
bUserInterfaceSelection ) const
 {
 LanguageType eLang = MsLangId::getReplacementForObsoleteLanguage( eType, 
bUserInterfaceSelection);
 sal_uInt32 nPos = FindIndex( eLang );
@@ -164,7 +178,7 @@ OUString SvtLanguageTable::GetLanguageString( const 
LanguageType eType, bool bUs
 
 
 
-LanguageType SvtLanguageTable::GetType( const OUString rStr ) const
+LanguageType SvtLanguageTableImpl::GetType( const OUString rStr ) const
 {
 LanguageType eType = LANGUAGE_DONTKNOW;
 sal_uInt32 nCount = Count();
@@ -187,7 +201,7 @@ LanguageType SvtLanguageTable::GetLanguageType( const 
OUString rStr )
 
 
 
-sal_uInt32 SvtLanguageTable::GetEntryCount() const
+sal_uInt32 SvtLanguageTableImpl::GetEntryCount() const
 {
 return Count();
 }
@@ -199,7 +213,7 @@ sal_uInt32 SvtLanguageTable::GetLanguageEntryCount()
 
 
 
-LanguageType SvtLanguageTable::GetTypeAtIndex( sal_uInt32 nIndex ) const
+LanguageType SvtLanguageTableImpl::GetTypeAtIndex( sal_uInt32 nIndex ) const
 {
 LanguageType nType = LANGUAGE_DONTKNOW;
 if (nIndex  Count())
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2014-04-28 Thread Noel Grandin
 include/svtools/tabbar.hxx|   21 -
 svtools/source/control/tabbar.cxx |   18 +++---
 2 files changed, 3 insertions(+), 36 deletions(-)

New commits:
commit 2554d0ab4e293c2e68477c1b390367c15353234e
Author: Noel Grandin n...@peralex.com
Date:   Fri Apr 25 15:39:59 2014 +0200

remove unused code from TabBar

Change-Id: I9f975d99893135b414c749c4fe86912362375c4e
Reviewed-on: https://gerrit.libreoffice.org/9162
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/include/svtools/tabbar.hxx b/include/svtools/tabbar.hxx
index 4ca74ce..20e644b 100644
--- a/include/svtools/tabbar.hxx
+++ b/include/svtools/tabbar.hxx
@@ -372,13 +372,7 @@ private:
 boolmbHasInsertTab; // if true, the tab bar has an extra tab 
at the end.
 boolmbScrollAlwaysEnabled;
 LinkmaSelectHdl;
-LinkmaDoubleClickHdl;
 LinkmaSplitHdl;
-LinkmaActivatePageHdl;
-LinkmaDeactivatePageHdl;
-LinkmaStartRenamingHdl;
-LinkmaAllowRenamingHdl;
-LinkmaEndRenamingHdl;
 LinkmaScrollAreaContextHdl;
 size_t  maCurrentItemList;
 
@@ -537,23 +531,8 @@ public:
 SizeCalcWindowSizePixel() const;
 
 voidSetSelectHdl( const Link rLink ) { maSelectHdl = rLink; }
-const Link GetSelectHdl() const { return maSelectHdl; }
-voidSetDoubleClickHdl( const Link rLink ) { maDoubleClickHdl 
= rLink; }
-const Link GetDoubleClickHdl() const { return maDoubleClickHdl; }
 voidSetSplitHdl( const Link rLink ) { maSplitHdl = rLink; }
-const Link GetSplitHdl() const { return maSplitHdl; }
-voidSetActivatePageHdl( const Link rLink ) { 
maActivatePageHdl = rLink; }
-const Link GetActivatePageHdl() const { return maActivatePageHdl; }
-voidSetDeactivatePageHdl( const Link rLink ) { 
maDeactivatePageHdl = rLink; }
-const Link GetDeactivatePageHdl() const { return maDeactivatePageHdl; 
}
-voidSetStartRenamingHdl( const Link rLink ) { 
maStartRenamingHdl = rLink; }
-const Link GetStartRenamingHdl() const { return maStartRenamingHdl; }
-voidSetAllowRenamingHdl( const Link rLink ) { 
maAllowRenamingHdl = rLink; }
-const Link GetAllowRenamingHdl() const { return maAllowRenamingHdl; }
-voidSetEndRenamingHdl( const Link rLink ) { maEndRenamingHdl 
= rLink; }
-const Link GetEndRenamingHdl() const { return maEndRenamingHdl; }
 voidSetScrollAreaContextHdl( const Link rLink ) { 
maScrollAreaContextHdl = rLink; }
-const Link GetScrollAreaContextHdl() const { return 
maScrollAreaContextHdl; }
 
 // accessibility
 virtual ::com::sun::star::uno::Reference 
::com::sun::star::accessibility::XAccessible  CreateAccessible() SAL_OVERRIDE;
diff --git a/svtools/source/control/tabbar.cxx 
b/svtools/source/control/tabbar.cxx
index 5c118cb..2b1f0ed 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -1692,7 +1692,6 @@ void TabBar::Select()
 
 void TabBar::DoubleClick()
 {
-maDoubleClickHdl.Call( this );
 }
 
 
@@ -1715,7 +1714,6 @@ void TabBar::ImplActivatePage()
 
 void TabBar::ActivatePage()
 {
-maActivatePageHdl.Call( this );
 }
 
 
@@ -1809,37 +1807,27 @@ Rectangle TabBar::ImplGetInsertTabRect(ImplTabBarItem* 
pItem) const
 
 bool TabBar::DeactivatePage()
 {
-if ( maDeactivatePageHdl.IsSet() )
-return maDeactivatePageHdl.Call( this );
-else
-return true;
+return true;
 }
 
 
 
 bool TabBar::StartRenaming()
 {
-if ( maStartRenamingHdl.IsSet() )
-return maStartRenamingHdl.Call( this );
-else
-return true;
+return true;
 }
 
 
 
 TabBarAllowRenamingReturnCode TabBar::AllowRenaming()
 {
-if ( maAllowRenamingHdl.IsSet() )
-return (TabBarAllowRenamingReturnCode) maAllowRenamingHdl.Call( this );
-else
-return TABBAR_RENAMING_YES;
+return TABBAR_RENAMING_YES;
 }
 
 
 
 void TabBar::EndRenaming()
 {
-maEndRenamingHdl.Call( this );
 }
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2014-04-24 Thread Noel Grandin
 include/svtools/unoevent.hxx|6 +++---
 svtools/source/uno/unoevent.cxx |4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 532acfde021fb78de64faefeb561632b333931a2
Author: Noel Grandin n...@peralex.com
Date:   Thu Apr 24 11:37:21 2014 +0200

make SvDetachedEventDescriptor::hasByName return bool

Also, since this is a utility method, and it does not override
a method from an UNO interface, it does not need to be virtual.

Change-Id: I2dd90331e8ff49572bdfcb6ea2e2e3ed2fd95051

diff --git a/include/svtools/unoevent.hxx b/include/svtools/unoevent.hxx
index e3d2ef7..cdcfb2e 100644
--- a/include/svtools/unoevent.hxx
+++ b/include/svtools/unoevent.hxx
@@ -290,11 +290,11 @@ protected:
 ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
 
 /// do we have an event?
-/// return sal_True: we have a macro for the event
-/// return sal_False: no macro; getByName() will return an empty macro
+/// return true: we have a macro for the event
+/// return false: no macro; getByName() will return an empty macro
 /// IllegalArgumentException: the event is not supported
 using SvBaseEventDescriptor::hasByName;
-virtual sal_Bool hasByName(
+bool hasByName(
 const sal_uInt16 nEvent ) const /// item ID of event
  throw(
 ::com::sun::star::lang::IllegalArgumentException);
diff --git a/svtools/source/uno/unoevent.cxx b/svtools/source/uno/unoevent.cxx
index dc3dfe7..79c9c2b 100644
--- a/svtools/source/uno/unoevent.cxx
+++ b/svtools/source/uno/unoevent.cxx
@@ -497,7 +497,7 @@ void SvDetachedEventDescriptor::getByName(
 rMacro = (*aMacros[nIndex]);
 }
 
-sal_Bool SvDetachedEventDescriptor::hasByName(
+bool SvDetachedEventDescriptor::hasByName(
 const sal_uInt16 nEvent ) const /// item ID of event
 throw(IllegalArgumentException)
 {
@@ -505,7 +505,7 @@ sal_Bool SvDetachedEventDescriptor::hasByName(
 if (-1 == nIndex)
 throw IllegalArgumentException();
 
-return (NULL == aMacros[nIndex]) ? sal_False : aMacros[nIndex]-HasMacro();
+return (NULL != aMacros[nIndex])  aMacros[nIndex]-HasMacro();
 }
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2014-04-09 Thread Stephan Bergmann
 include/svtools/transfer.hxx |1 
 svtools/source/config/extcolorcfg.cxx|2 -
 svtools/source/config/helpopt.cxx|1 
 svtools/source/config/menuoptions.cxx|   21 ---
 svtools/source/config/miscopt.cxx|   19 --
 svtools/source/contnr/fileview.cxx   |   35 --
 svtools/source/contnr/imivctl1.cxx   |8 --
 svtools/source/control/hyperlabel.cxx|   24 --
 svtools/source/control/roadmap.cxx   |   29 -
 svtools/source/control/scriptedtext.cxx  |2 -
 svtools/source/control/tabbar.cxx|5 ---
 svtools/source/dialogs/addresstemplate.cxx   |9 --
 svtools/source/graphic/grfcache.cxx  |7 -
 svtools/source/misc/itemdel.cxx  |5 ++-
 svtools/source/misc/svtaccessiblefactory.cxx |8 +++---
 svtools/source/misc/templatefoldercache.cxx  |   20 ---
 svtools/source/misc/transfer.cxx |   36 ---
 svtools/source/table/tablecontrol_impl.cxx   |5 ---
 svtools/source/toolpanel/paneltabbar.cxx |3 +-
 svtools/source/toolpanel/toolpaneldeck.cxx   |1 
 svtools/source/uno/contextmenuhelper.cxx |9 +++---
 svtools/source/uno/fpicker.cxx   |2 +
 svtools/source/uno/treecontrolpeer.cxx   |1 
 svtools/source/uno/unocontroltablemodel.cxx  |6 
 24 files changed, 16 insertions(+), 243 deletions(-)

New commits:
commit fa72a0e94dab1a02c067e8e629f68a548bf2492b
Author: Stephan Bergmann sberg...@redhat.com
Date:   Wed Apr 9 10:15:47 2014 +0200

Remove unused code

Change-Id: Ifaab2aecec65ec6e81056e5fca430df8ca3af908

diff --git a/include/svtools/transfer.hxx b/include/svtools/transfer.hxx
index 62e9a13..8e4965b 100644
--- a/include/svtools/transfer.hxx
+++ b/include/svtools/transfer.hxx
@@ -79,7 +79,6 @@ struct TransferableObjectDescriptor
 , mbCanLink(false)
 {}
 
-SVT_DLLPUBLIC friend SvStream  ReadTransferableObjectDescriptor( 
SvStream rIStm, TransferableObjectDescriptor rObjDesc );
 SVT_DLLPUBLIC friend SvStream  WriteTransferableObjectDescriptor( 
SvStream rOStm, const TransferableObjectDescriptor rObjDesc );
 };
 
diff --git a/svtools/source/config/extcolorcfg.cxx 
b/svtools/source/config/extcolorcfg.cxx
index b85ee8a..770452d 100644
--- a/svtools/source/config/extcolorcfg.cxx
+++ b/svtools/source/config/extcolorcfg.cxx
@@ -116,8 +116,6 @@ public:
 voidSetColorConfigValue(const OUString _sName,
 const 
ExtendedColorConfigValue rValue );
 
-const OUStringGetLoadedScheme() const {return 
m_sLoadedScheme;}
-
 sal_BoolAddScheme(const OUString rNode);
 sal_BoolRemoveScheme(const OUString rNode);
 voidSetModified(){ConfigItem::SetModified();}
diff --git a/svtools/source/config/helpopt.cxx 
b/svtools/source/config/helpopt.cxx
index 72e7432..e58d707 100644
--- a/svtools/source/config/helpopt.cxx
+++ b/svtools/source/config/helpopt.cxx
@@ -75,7 +75,6 @@ public:
 
 voidSetWelcomeScreen( bool b )  { bWelcomeScreen = b; 
SetModified(); }
 boolIsWelcomeScreen() const { return 
bWelcomeScreen; }
-OUStringGetLocale() const   { return aLocale; }
 OUStringGetSystem() const   { return aSystem; }
 
 const OUString GetHelpStyleSheet()const{return sHelpStyleSheet;}
diff --git a/svtools/source/config/menuoptions.cxx 
b/svtools/source/config/menuoptions.cxx
index 275d4e2..507c486 100644
--- a/svtools/source/config/menuoptions.cxx
+++ b/svtools/source/config/menuoptions.cxx
@@ -131,30 +131,9 @@ class SvtMenuOptions_Impl : public ConfigItem
 boolIsEntryHidingEnabled() const
 { return m_bDontHideDisabledEntries; }
 
-boolIsFollowMouseEnabled() const
-{ return m_bFollowMouse; }
-
 TriStateGetMenuIconsState() const
 { return m_eMenuIcons; }
 
-voidSetEntryHidingState ( bool bState )
-{
-m_bDontHideDisabledEntries = bState;
-SetModified();
-for ( ::std::listLink::const_iterator iter = 
aList.begin(); iter != aList.end(); ++iter )
-iter-Call( this );
-Commit();
-}
-
-voidSetFollowMouseState ( bool bState )
-{
-m_bFollowMouse = bState;
-SetModified();
-for ( ::std::listLink::const_iterator iter = 
aList.begin(); iter != aList.end(); ++iter )
-iter-Call( this );
-

[Libreoffice-commits] core.git: include/svtools svtools/source

2014-02-25 Thread Stephan Bergmann
 include/svtools/brwbox.hxx|6 +-
 svtools/source/brwbox/brwbox1.cxx |8 
 svtools/source/brwbox/brwbox2.cxx |4 ++--
 3 files changed, 7 insertions(+), 11 deletions(-)

New commits:
commit ee120240f7021ce8f06c09fe2c2b26593c7de67e
Author: Stephan Bergmann sberg...@redhat.com
Date:   Tue Feb 25 12:44:37 2014 +0100

BrowseBox::bHideCursor misuses sal_Bool for TriState

(TRISTATE_INDET == smart is probably obvious enough to not warrant an 
extra
enum.)

Change-Id: I5fde5294c83c9f805d9df645089665b9dbcfec96

diff --git a/include/svtools/brwbox.hxx b/include/svtools/brwbox.hxx
index 8d172df..4581337 100644
--- a/include/svtools/brwbox.hxx
+++ b/include/svtools/brwbox.hxx
@@ -210,10 +210,6 @@ class SVT_DLLPUBLIC BrowseBox
 ,public DropTargetHelper
 ,public svt::IAccessibleTableProvider
 {
-#define NO_CURSOR_HIDE  0
-#define HARD_CURSOR_HIDE1
-#define SMART_CURSOR_HIDE   2
-
 friend class BrowserDataWin;
 friend class ::svt::BrowseBoxImpl;
 
@@ -268,7 +264,7 @@ private:
 sal_BoolbNotToggleSel;  // set while in ToggleSelection() etc.
 sal_BoolbHasFocus;  // set/unset in Get/LoseFocus
 sal_BoolbHideSelect;// hide selection (highlight)
-sal_BoolbHideCursor;// hide cursor (frame)
+TriStatebHideCursor;// hide cursor (frame)
 Range   aSelRange;  // for selection expansion
 
 BrowserColumns* pCols;  // array of column-descriptions
diff --git a/svtools/source/brwbox/brwbox1.cxx 
b/svtools/source/brwbox/brwbox1.cxx
index be9ad5d..55a0f77 100644
--- a/svtools/source/brwbox/brwbox1.cxx
+++ b/svtools/source/brwbox/brwbox1.cxx
@@ -96,7 +96,7 @@ void BrowseBox::ConstructImpl( BrowserMode nMode )
 bHit = sal_False;
 mbInteractiveRowHeight = sal_False;
 bHideSelect = sal_False;
-bHideCursor = NO_CURSOR_HIDE;
+bHideCursor = TRISTATE_FALSE;
 nRowCount = 0;
 m_bFocusOnlyCursor = sal_True;
 m_aCursorColor = COL_TRANSPARENT;
@@ -2291,15 +2291,15 @@ void BrowseBox::SetMode( BrowserMode nMode )
 
 bHideSelect = ((nMode  BROWSER_HIDESELECT) == BROWSER_HIDESELECT);
 // default: do not hide the cursor at all (untaken scrolling and such)
-bHideCursor = NO_CURSOR_HIDE;
+bHideCursor = TRISTATE_FALSE;
 
 if ( BROWSER_SMART_HIDECURSOR == ( nMode  BROWSER_SMART_HIDECURSOR ) )
 {   // smart cursor hide overrules hard cursor hide
-bHideCursor = SMART_CURSOR_HIDE;
+bHideCursor = TRISTATE_INDET;
 }
 else if ( BROWSER_HIDECURSOR == ( nMode  BROWSER_HIDECURSOR ) )
 {
-bHideCursor = HARD_CURSOR_HIDE;
+bHideCursor = TRISTATE_TRUE;
 }
 
 m_bFocusOnlyCursor = ((nMode  BROWSER_CURSOR_WO_FOCUS) == 0);
diff --git a/svtools/source/brwbox/brwbox2.cxx 
b/svtools/source/brwbox/brwbox2.cxx
index fb39186..7bc82fc 100644
--- a/svtools/source/brwbox/brwbox2.cxx
+++ b/svtools/source/brwbox/brwbox2.cxx
@@ -383,12 +383,12 @@ void BrowseBox::ToggleSelection( sal_Bool bForce )
 void BrowseBox::DrawCursor()
 {
 bool bReallyHide = false;
-if ( SMART_CURSOR_HIDE == bHideCursor )
+if ( bHideCursor == TRISTATE_INDET )
 {
 if ( !GetSelectRowCount()  !GetSelectColumnCount() )
 bReallyHide = true;
 }
-else if ( HARD_CURSOR_HIDE == bHideCursor )
+else if ( bHideCursor == TRISTATE_TRUE )
 {
 bReallyHide = true;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2014-01-16 Thread Bjoern Michaelsen
 include/svtools/colorcfg.hxx   |1 +
 svtools/source/config/accessibilityoptions.cxx |4 +++-
 svtools/source/config/colorcfg.cxx |5 +
 3 files changed, 9 insertions(+), 1 deletion(-)

New commits:
commit 7f7a0275be241b8a5e1d1cda0a1da613e3af61d3
Author: Bjoern Michaelsen bjoern.michael...@canonical.com
Date:   Thu Jan 16 23:21:53 2014 +0100

fdo#71511: reload ColorConfig after tweaking relevant a11y settings

note that the autodetect HC option is somewhat broken anyway:
it resets the icon theme hard, so there are not simple roundtrips
enableing/disabling it for that, but those havent been there before
either.

Change-Id: Ia35a41717224dfb7437054bb885c61d7e0b189d7

diff --git a/include/svtools/colorcfg.hxx b/include/svtools/colorcfg.hxx
index 2872f4c..ddc8485 100644
--- a/include/svtools/colorcfg.hxx
+++ b/include/svtools/colorcfg.hxx
@@ -105,6 +105,7 @@ public:
 // instead of the automatic color
 ColorConfigValueGetColorValue(ColorConfigEntry eEntry, sal_Bool 
bSmart = sal_True)const;
 static ColorGetDefaultColor(ColorConfigEntry eEntry);
+void Reload();
 };
 
 class SVT_DLLPUBLIC EditableColorConfig
diff --git a/svtools/source/config/accessibilityoptions.cxx 
b/svtools/source/config/accessibilityoptions.cxx
index 4294e7c..84f0e1c 100644
--- a/svtools/source/config/accessibilityoptions.cxx
+++ b/svtools/source/config/accessibilityoptions.cxx
@@ -31,6 +31,8 @@
 
 #include svl/smplhint.hxx
 
+#include svtools/colorcfg.hxx
+
 #include vcl/settings.hxx
 #include vcl/svapp.hxx
 #include rtl/instance.hxx
@@ -386,7 +388,7 @@ void 
SvtAccessibilityOptions_Impl::SetAutoDetectSystemHC(sal_Bool bSet)
 {
 xNode-setPropertyValue(s_sAutoDetectSystemHC, 
css::uno::makeAny(bSet));
 ::comphelper::ConfigurationHelper::flush(m_xCfg);
-
+svtools::ColorConfig().Reload();
 bIsModified = sal_True;
 }
 }
diff --git a/svtools/source/config/colorcfg.cxx 
b/svtools/source/config/colorcfg.cxx
index 81a1b20..a8e5ba8 100644
--- a/svtools/source/config/colorcfg.cxx
+++ b/svtools/source/config/colorcfg.cxx
@@ -510,6 +510,11 @@ ColorConfigValue 
ColorConfig::GetColorValue(ColorConfigEntry eEntry, sal_Bool bS
 return aRet;
 }
 
+void ColorConfig::Reload()
+{
+m_pImpl-Load(OUString());
+}
+
 EditableColorConfig::EditableColorConfig() :
 m_pImpl(new ColorConfig_Impl),
 m_bModified(sal_False)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2013-12-20 Thread Jürgen Schmidt
 include/svtools/table/tablemodel.hxx|4 
 svtools/source/table/gridtablerenderer.cxx  |   16 +++-
 svtools/source/table/tablecontrol_impl.cxx  |4 
 svtools/source/uno/svtxgridcontrol.cxx  |   15 +++
 svtools/source/uno/svtxgridcontrol.hxx  |3 +++
 svtools/source/uno/unocontroltablemodel.cxx |   17 +
 svtools/source/uno/unocontroltablemodel.hxx |2 ++
 7 files changed, 56 insertions(+), 5 deletions(-)

New commits:
commit 5f7d39a07e108385b34c00e95dfdf734ad8f1f56
Author: Jürgen Schmidt j...@apache.org
Date:   Fri Dec 20 05:47:11 2013 +

Resolves: #i120065# apply patch for Enabled property in grid model

Patch By: hanya
Review By: jsc

(cherry picked from commit 0164d67071d06aa42213c4a66765b5d032ca84d3)

Change-Id: Iad363b75dd30722b10139b31c90b3d598deaaf30

diff --git a/include/svtools/table/tablemodel.hxx 
b/include/svtools/table/tablemodel.hxx
index 38d1c28..0711bb0 100644
--- a/include/svtools/table/tablemodel.hxx
+++ b/include/svtools/table/tablemodel.hxx
@@ -525,6 +525,10 @@ namespace svt { namespace table
 */
 virtual ITableDataSort* getSortAdapter() = 0;
 
+/** returns enabled state.
+*/
+virtual bool isEnabled() const = 0;
+
 /// destroys the table model instance
 virtual ~ITableModel() { }
 };
diff --git a/svtools/source/table/gridtablerenderer.cxx 
b/svtools/source/table/gridtablerenderer.cxx
index ca99192..585d97e 100644
--- a/svtools/source/table/gridtablerenderer.cxx
+++ b/svtools/source/table/gridtablerenderer.cxx
@@ -260,7 +260,9 @@ namespace svt { namespace table
 _rDevice.SetTextColor( textColor );
 
 Rectangle const aTextRect( lcl_getTextRenderingArea( 
lcl_getContentArea( *m_pImpl, _rArea ) ) );
-sal_uLong const nDrawTextFlags = lcl_getAlignmentTextDrawFlags( 
*m_pImpl, _nCol ) | TEXT_DRAW_CLIP;
+sal_uLong nDrawTextFlags = lcl_getAlignmentTextDrawFlags( *m_pImpl, 
_nCol ) | TEXT_DRAW_CLIP;
+if ( !m_pImpl-rModel.isEnabled() )
+nDrawTextFlags |= TEXT_DRAW_DISABLE;
 _rDevice.DrawText( aTextRect, sHeaderText, nDrawTextFlags );
 
 ::boost::optional ::Color  const aLineColor( 
m_pImpl-rModel.getLineColor() );
@@ -396,7 +398,9 @@ namespace svt { namespace table
 _rDevice.SetTextColor( textColor );
 
 Rectangle const aTextRect( lcl_getTextRenderingArea( 
lcl_getContentArea( *m_pImpl, _rArea ) ) );
-sal_uLong const nDrawTextFlags = lcl_getAlignmentTextDrawFlags( 
*m_pImpl, 0 ) | TEXT_DRAW_CLIP;
+sal_uLong nDrawTextFlags = lcl_getAlignmentTextDrawFlags( 
*m_pImpl, 0 ) | TEXT_DRAW_CLIP;
+if ( !m_pImpl-rModel.isEnabled() )
+nDrawTextFlags |= TEXT_DRAW_DISABLE;
 // TODO: is using the horizontal alignment of the 0'th column 
a good idea here? This is pretty ... arbitray ..
 _rDevice.DrawText( aTextRect, rowTitle, nDrawTextFlags );
 }
@@ -500,8 +504,8 @@ namespace svt { namespace table
 }
 else
 imageSize.Height() = i_context.aContentArea.GetHeight() - 1;
-
-i_context.rDevice.DrawImage( imagePos, imageSize, i_image, 0 );
+sal_uInt16 const nStyle = m_pImpl-rModel.isEnabled() ? 0 : 
IMAGE_DRAW_DISABLE;
+i_context.rDevice.DrawImage( imagePos, imageSize, i_image, nStyle );
 }
 
 
//--
@@ -546,7 +550,9 @@ namespace svt { namespace table
 }
 
 Rectangle const textRect( lcl_getTextRenderingArea( 
i_context.aContentArea ) );
-sal_uLong const nDrawTextFlags = lcl_getAlignmentTextDrawFlags( 
*m_pImpl, i_context.nColumn ) | TEXT_DRAW_CLIP;
+sal_uLong nDrawTextFlags = lcl_getAlignmentTextDrawFlags( *m_pImpl, 
i_context.nColumn ) | TEXT_DRAW_CLIP;
+if ( !m_pImpl-rModel.isEnabled() )
+nDrawTextFlags |= TEXT_DRAW_DISABLE;
 i_context.rDevice.DrawText( textRect, i_text, nDrawTextFlags );
 }
 
diff --git a/svtools/source/table/tablecontrol_impl.cxx 
b/svtools/source/table/tablecontrol_impl.cxx
index f4238c9..7a849be 100644
--- a/svtools/source/table/tablecontrol_impl.cxx
+++ b/svtools/source/table/tablecontrol_impl.cxx
@@ -210,6 +210,10 @@ namespace svt { namespace table
 {
 return NULL;
 }
+virtual bool isEnabled() const
+{
+return true;
+}
 virtual void getCellContent( ColPos const i_col, RowPos const i_row, 
::com::sun::star::uno::Any o_cellContent )
 {
 (void)i_row;
diff --git a/svtools/source/uno/svtxgridcontrol.cxx 
b/svtools/source/uno/svtxgridcontrol.cxx
index 5397dc7..6fadfcc 100644
--- a/svtools/source/uno/svtxgridcontrol.cxx
+++ b/svtools/source/uno/svtxgridcontrol.cxx
@@ -853,6 +853,21 @@ void SVTXGridControl::ProcessWindowEvent( const 

[Libreoffice-commits] core.git: include/svtools svtools/source svtools/uiconfig svtools/UIConfig_svt.mk

2013-11-27 Thread Caolán McNamara
 include/svtools/fileview.hxx |   29 +++--
 include/svtools/svtools.hrc  |2 
 svtools/UIConfig_svt.mk  |1 
 svtools/source/contnr/fileview.cxx   |   68 +++--
 svtools/source/contnr/fileview.hrc   |   10 ---
 svtools/source/contnr/fileview.src   |   70 -
 svtools/uiconfig/ui/querydeletedialog.ui |   99 +++
 7 files changed, 135 insertions(+), 144 deletions(-)

New commits:
commit 02d4eb7438a83982b2602ea1d83d5accb1fe11f6
Author: Caolán McNamara caol...@redhat.com
Date:   Wed Nov 27 16:42:53 2013 +

convert query delete dialog to .ui

Change-Id: I0ab09c2c54bba4a287ef0f7cc812596958373e15

diff --git a/include/svtools/fileview.hxx b/include/svtools/fileview.hxx
index fd2ccfe..8b90816 100644
--- a/include/svtools/fileview.hxx
+++ b/include/svtools/fileview.hxx
@@ -25,8 +25,9 @@
 #include vcl/ctrl.hxx
 #include vcl/image.hxx
 #include vcl/fixed.hxx
-#include vcl/button.hxx
 #include vcl/dialog.hxx
+#include vcl/button.hxx
+#include vcl/layout.hxx
 #include rtl/ustring.hxx
 
 // class SvtFileView -
@@ -216,24 +217,19 @@ namespace svtools {
 
 enum QueryDeleteResult_Impl
 {
-QUERYDELETE_YES = 0,
-QUERYDELETE_NO,
-QUERYDELETE_ALL,
-QUERYDELETE_CANCEL
+QUERYDELETE_CANCEL = RET_CANCEL,
+QUERYDELETE_YES = RET_YES,
+QUERYDELETE_NO = RET_NO,
+QUERYDELETE_ALL = -1
 };
 
-class SVT_DLLPUBLIC QueryDeleteDlg_Impl : public ModalDialog
+class SVT_DLLPUBLIC QueryDeleteDlg_Impl : public MessageDialog
 {
-FixedText   _aEntryLabel;
-FixedText   _aEntry;
-FixedText   _aQueryMsg;
-
-PushButton  _aYesButton;
-PushButton  _aAllButton;
-PushButton  _aNoButton;
-CancelButton_aCancelButton;
+PushButton* m_pYesButton;
+PushButton* m_pAllButton;
+PushButton* m_pNoButton;
 
-QueryDeleteResult_Impl  _eResult;
+QueryDeleteResult_Impl  m_eResult;
 
 private:
 
@@ -244,8 +240,7 @@ public:
 QueryDeleteDlg_Impl( Window* pParent,
  const OUString rName );
 
-voidEnableAllButton() { _aAllButton.Enable( sal_True 
); }
-QueryDeleteResult_Impl  GetResult() const { return _eResult; }
+voidEnableAllButton() { m_pAllButton-Enable(true); }
 };
 
 }
diff --git a/include/svtools/svtools.hrc b/include/svtools/svtools.hrc
index 301d2f7..e11c5ae 100644
--- a/include/svtools/svtools.hrc
+++ b/include/svtools/svtools.hrc
@@ -27,8 +27,6 @@
 //.
 // various unsorted stuff
 
-#define DLG_SVT_QUERYDELETE (RID_SVTOOLS_START+6)
-
 #define STR_SVT_AUTOMATIC_COLOR (RID_SVTOOLS_START+16)
 
 #define STR_SVT_FILEVIEW_COLUMN_TITLE   (RID_SVTOOLS_START + 20)
diff --git a/svtools/UIConfig_svt.mk b/svtools/UIConfig_svt.mk
index 153054f..5a6b0ca 100644
--- a/svtools/UIConfig_svt.mk
+++ b/svtools/UIConfig_svt.mk
@@ -14,6 +14,7 @@ $(eval $(call gb_UIConfig_add_uifiles,svt,\
svtools/uiconfig/ui/graphicexport \
svtools/uiconfig/ui/placeedit \
svtools/uiconfig/ui/printersetupdialog \
+   svtools/uiconfig/ui/querydeletedialog \
svtools/uiconfig/ui/restartdialog \
svtools/uiconfig/ui/GraphicExportOptionsDialog \
 ))
diff --git a/svtools/source/contnr/fileview.cxx 
b/svtools/source/contnr/fileview.cxx
index 8757ca0..32ee18b 100644
--- a/svtools/source/contnr/fileview.cxx
+++ b/svtools/source/contnr/fileview.cxx
@@ -59,7 +59,7 @@
 #include unotools/localfilehelper.hxx
 #include ucbhelper/content.hxx
 #include ucbhelper/commandenvironment.hxx
-#include vcl/msgbox.hxx
+#include vcl/layout.hxx
 #include rtl/math.hxx
 #include tools/config.hxx
 #include osl/mutex.hxx
@@ -536,7 +536,7 @@ protected:
 
 protected:
 // IEnumerationResultHandler overridables
-virtual voidenumerationDone( ::svt::EnumerationResult _eResult );
+virtual voidenumerationDone( ::svt::EnumerationResult eResult );
 voidimplEnumerationSuccess();
 
 // ITimeoutHandler
@@ -900,7 +900,7 @@ void ViewTabListBox_Impl::ClearAll()
 // ---
 void ViewTabListBox_Impl::DeleteEntries()
 {
-svtools::QueryDeleteResult_Impl eResult = svtools::QUERYDELETE_YES;
+short eResult = svtools::QUERYDELETE_YES;
 SvTreeListEntry* pEntry = FirstSelected();
 OUString aURL;
 
@@ -946,10 +946,7 @@ void ViewTabListBox_Impl::DeleteEntries()
 if ( GetSelectionCount()  1 )
 aDlg.EnableAllButton();
 
-if ( aDlg.Execute() == RET_OK )
-eResult = aDlg.GetResult();
-else
-eResult = 

[Libreoffice-commits] core.git: include/svtools svtools/source

2013-11-20 Thread Rodolfo Ribeiro Gomes
 include/svtools/ruler.hxx|2 +-
 svtools/source/control/ruler.cxx |   24 
 2 files changed, 13 insertions(+), 13 deletions(-)

New commits:
commit 912d6d171603cdc68c600ab713e22eeca2c1f58a
Author: Rodolfo Ribeiro Gomes rodolf...@gmail.com
Date:   Mon Nov 18 01:30:49 2013 -0200

fdo#65355 Ruler Comment control doesn't disappears

ImplDraw() should not be directly called because it avoids
overriden Paint() method.

Change-Id: I0f0f6b4af231c1ea50a23fb96f3c9018b5ce2d31
Signed-off-by: Rodolfo Ribeiro Gomes rodolf...@gmail.com
Reviewed-on: https://gerrit.libreoffice.org/6707
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/include/svtools/ruler.hxx b/include/svtools/ruler.hxx
index eff79e251..a6ae1e5 100644
--- a/include/svtools/ruler.hxx
+++ b/include/svtools/ruler.hxx
@@ -767,7 +767,7 @@ public:
 RulerSelection  GetHoverSelection() const { return maHoverSelection; }
 
 using Window::GetType;
-RulerType   GetType( const Point rPos, sal_uInt16* pAryPos = NULL ) 
const;
+RulerType   GetType( const Point rPos, sal_uInt16* pAryPos = NULL );
 
 voidSetNullOffset( long nPos );
 longGetNullOffset() const;
diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx
index 5a0b32f..f6808a2 100644
--- a/svtools/source/control/ruler.cxx
+++ b/svtools/source/control/ruler.cxx
@@ -1868,7 +1868,7 @@ void Ruler::ImplDrag( const Point rPos )
 Drag();
 
 // and redraw
-ImplDraw();
+Paint(Rectangle());
 
 // reset the data as before cancel
 *mpDragData = aTempData;
@@ -1889,7 +1889,7 @@ void Ruler::ImplDrag( const Point rPos )
 
 // redraw
 if ( mbFormat )
-ImplDraw();
+Paint(Rectangle());
 }
 
 mnDragScroll = 0;
@@ -1921,7 +1921,7 @@ void Ruler::ImplEndDrag()
 mnStartDragPos  = 0;
 
 // redraw
-ImplDraw();
+Paint(Rectangle());
 }
 
 IMPL_LINK_NOARG(Ruler, ImplUpdateHdl)
@@ -1932,7 +1932,7 @@ IMPL_LINK_NOARG(Ruler, ImplUpdateHdl)
 if ( mnUpdateFlags  RULER_UPDATE_DRAW )
 {
 mnUpdateFlags = 0;
-ImplDraw();
+Paint(Rectangle());
 }
 else if ( mnUpdateFlags  RULER_UPDATE_LINES )
 {
@@ -1954,7 +1954,7 @@ void Ruler::MouseButtonDown( const MouseEvent rMEvt )
 // update ruler
 if ( mbFormat )
 {
-ImplDraw();
+Paint(Rectangle());
 mnUpdateFlags = ~RULER_UPDATE_DRAW;
 }
 
@@ -2062,7 +2062,7 @@ void Ruler::MouseMove( const MouseEvent rMEvt )
 
 if ( mbFormat )
 {
-ImplDraw();
+Paint(Rectangle());
 mnUpdateFlags = ~RULER_UPDATE_DRAW;
 }
 mpPreviousHitTest.swap(mpCurrentHitTest);
@@ -2189,7 +2189,7 @@ void Ruler::StateChanged( StateChangedType nType )
 else if ( nType == STATE_CHANGE_UPDATEMODE )
 {
 if ( IsReallyVisible()  IsUpdateMode() )
-ImplDraw();
+Paint(Rectangle());
 }
 else if ( (nType == STATE_CHANGE_ZOOM) ||
   (nType == STATE_CHANGE_CONTROLFONT) )
@@ -2291,7 +2291,7 @@ sal_Bool Ruler::StartDocDrag( const MouseEvent rMEvt, 
RulerType eDragType )
 // update ruler
 if ( mbFormat )
 {
-ImplDraw();
+Paint(Rectangle());
 mnUpdateFlags = ~RULER_UPDATE_DRAW;
 }
 
@@ -2350,15 +2350,15 @@ void Ruler::CancelDrag()
 }
 }
 
-RulerType Ruler::GetType( const Point rPos, sal_uInt16* pAryPos ) const
+RulerType Ruler::GetType( const Point rPos, sal_uInt16* pAryPos )
 {
 RulerSelection aHitTest;
 
 // update ruler
 if ( IsReallyVisible()  mbFormat )
 {
-((Ruler*)this)-ImplDraw();
-((Ruler*)this)-mnUpdateFlags = ~RULER_UPDATE_DRAW;
+Paint(Rectangle());
+mnUpdateFlags = ~RULER_UPDATE_DRAW;
 }
 
 ImplHitTest( rPos, aHitTest );
@@ -2790,7 +2790,7 @@ RulerUnitData Ruler::GetCurrentRulerUnit() const
 void Ruler::DrawTicks()
 {
 mbFormat = sal_True;
-ImplDraw();
+Paint(Rectangle());
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2013-10-14 Thread Thomas Arnhold
 include/svtools/htmlkywd.hxx   |   47 -
 include/svtools/htmltokn.h |   58 ++---
 svtools/source/svhtml/htmlkywd.cxx |   48 --
 3 files changed, 4 insertions(+), 149 deletions(-)

New commits:
commit a979956012a277c9cb85147605b9671ace12aa0a
Author: Thomas Arnhold tho...@arnhold.org
Date:   Thu Oct 10 22:12:46 2013 +0200

html: remove unused options

Change-Id: If8a6d5136e9e397f5f9b2b49bd9aaf4a7e6bfc17

diff --git a/include/svtools/htmlkywd.hxx b/include/svtools/htmlkywd.hxx
index 1b53f89..b6ce25a 100644
--- a/include/svtools/htmlkywd.hxx
+++ b/include/svtools/htmlkywd.hxx
@@ -403,57 +403,37 @@
 // HTML Attribut-Token (=Optionen)
 
 // Attribute ohne Wert
-#define OOO_STRING_SVTOOLS_HTML_O_box box
 #define OOO_STRING_SVTOOLS_HTML_O_checked checked
 #define OOO_STRING_SVTOOLS_HTML_O_compact compact
-#define OOO_STRING_SVTOOLS_HTML_O_continue continue
-#define OOO_STRING_SVTOOLS_HTML_O_controls controls
 #define OOO_STRING_SVTOOLS_HTML_O_declare declare
 #define OOO_STRING_SVTOOLS_HTML_O_disabled disabled
-#define OOO_STRING_SVTOOLS_HTML_O_folded folded
 #define OOO_STRING_SVTOOLS_HTML_O_ismap ismap
 #define OOO_STRING_SVTOOLS_HTML_O_mayscript mayscript
 #define OOO_STRING_SVTOOLS_HTML_O_multiple multiple
-#define OOO_STRING_SVTOOLS_HTML_O_noflow noflow
 #define OOO_STRING_SVTOOLS_HTML_O_nohref nohref
 #define OOO_STRING_SVTOOLS_HTML_O_noresize noresize
 #define OOO_STRING_SVTOOLS_HTML_O_noshade noshade
 #define OOO_STRING_SVTOOLS_HTML_O_nowrap nowrap
-#define OOO_STRING_SVTOOLS_HTML_O_plain plain
 #define OOO_STRING_SVTOOLS_HTML_O_sdfixed sdfixed
 #define OOO_STRING_SVTOOLS_HTML_O_selected selected
-#define OOO_STRING_SVTOOLS_HTML_O_shapes shapes
 
 // Attribute mit einem String als Wert
-#define OOO_STRING_SVTOOLS_HTML_O_above above
 #define OOO_STRING_SVTOOLS_HTML_O_accesskey accesskey
 #define OOO_STRING_SVTOOLS_HTML_O_accept accept
-#define OOO_STRING_SVTOOLS_HTML_O_add_date add_date
 #define OOO_STRING_SVTOOLS_HTML_O_alt alt
-#define OOO_STRING_SVTOOLS_HTML_O_axes axes
 #define OOO_STRING_SVTOOLS_HTML_O_axis axis
-#define OOO_STRING_SVTOOLS_HTML_O_below below
 #define OOO_STRING_SVTOOLS_HTML_O_char char
 #define OOO_STRING_SVTOOLS_HTML_O_class class
-#define OOO_STRING_SVTOOLS_HTML_O_clip clip
 #define OOO_STRING_SVTOOLS_HTML_O_code code
 #define OOO_STRING_SVTOOLS_HTML_O_codetype codetype
-#define OOO_STRING_SVTOOLS_HTML_O_colspec colspec
 #define OOO_STRING_SVTOOLS_HTML_O_content content
 #define OOO_STRING_SVTOOLS_HTML_O_coords coords
-#define OOO_STRING_SVTOOLS_HTML_O_dp dp
 #define OOO_STRING_SVTOOLS_HTML_O_enctype enctype
-#define OOO_STRING_SVTOOLS_HTML_O_error error
 #define OOO_STRING_SVTOOLS_HTML_O_face face
 #define OOO_STRING_SVTOOLS_HTML_O_frameborder frameborder
 #define OOO_STRING_SVTOOLS_HTML_O_httpequiv http-equiv
 #define OOO_STRING_SVTOOLS_HTML_O_language language
-#define OOO_STRING_SVTOOLS_HTML_O_last_modified last_modified
-#define OOO_STRING_SVTOOLS_HTML_O_last_visit last_visit
-#define OOO_STRING_SVTOOLS_HTML_O_md md
-#define OOO_STRING_SVTOOLS_HTML_O_n n
 #define OOO_STRING_SVTOOLS_HTML_O_name name
-#define OOO_STRING_SVTOOLS_HTML_O_notation notation
 #define OOO_STRING_SVTOOLS_HTML_O_prompt prompt
 #define OOO_STRING_SVTOOLS_HTML_O_shape shape
 #define OOO_STRING_SVTOOLS_HTML_O_standby standby
@@ -468,11 +448,9 @@
 #define OOO_STRING_SVTOOLS_HTML_O_sdaddparam sdaddparam-
 
 // Attribute mit einem SGML-Identifier als Wert
-#define OOO_STRING_SVTOOLS_HTML_O_from from
 #define OOO_STRING_SVTOOLS_HTML_O_id id
 #define OOO_STRING_SVTOOLS_HTML_O_target target
 #define OOO_STRING_SVTOOLS_HTML_O_to to
-#define OOO_STRING_SVTOOLS_HTML_O_until until
 
 // Attribute mit einem URI als Wert
 #define OOO_STRING_SVTOOLS_HTML_O_action action
@@ -481,19 +459,11 @@
 #define OOO_STRING_SVTOOLS_HTML_O_classid classid
 #define OOO_STRING_SVTOOLS_HTML_O_codebase codebase
 #define OOO_STRING_SVTOOLS_HTML_O_data data
-#define OOO_STRING_SVTOOLS_HTML_O_dynsrc dynsrc
-#define OOO_STRING_SVTOOLS_HTML_O_dynsync dynsync
-#define OOO_STRING_SVTOOLS_HTML_O_imagemap imagemap
 #define OOO_STRING_SVTOOLS_HTML_O_href href
-#define OOO_STRING_SVTOOLS_HTML_O_lowsrc lowsrc
 #define OOO_STRING_SVTOOLS_HTML_O_script script
 #define OOO_STRING_SVTOOLS_HTML_O_src src
 #define OOO_STRING_SVTOOLS_HTML_O_usemap usemap
 
-// Attribute mit Entity-Namen als Wert
-#define OOO_STRING_SVTOOLS_HTML_O_dingbat dingbat
-#define OOO_STRING_SVTOOLS_HTML_O_sym sym
-
 // Attribute mit einer Farbe als Wert (alle Netscape)
 #define OOO_STRING_SVTOOLS_HTML_O_alink alink
 #define OOO_STRING_SVTOOLS_HTML_O_bgcolor bgcolor
@@ -513,39 +483,24 @@
 #define OOO_STRING_SVTOOLS_HTML_O_colspan colspan
 #define OOO_STRING_SVTOOLS_HTML_O_framespacing framespacing
 #define OOO_STRING_SVTOOLS_HTML_O_gutter gutter
-#define OOO_STRING_SVTOOLS_HTML_O_indent indent
 #define OOO_STRING_SVTOOLS_HTML_O_height height
 #define 

[Libreoffice-commits] core.git: include/svtools svtools/source

2013-10-06 Thread Thomas Arnhold
 include/svtools/htmlkywd.hxx   |8 
 svtools/source/svhtml/htmlkywd.cxx |8 
 2 files changed, 16 deletions(-)

New commits:
commit c6413fec71cdb26496018c48eda59e1c8925d4fc
Author: Thomas Arnhold tho...@arnhold.org
Date:   Sun Oct 6 16:51:23 2013 +0200

html: remove duplicates

OOO_STRING_SVTOOLS_HTML_C_LT is the same as OOO_STRING_SVTOOLS_HTML_C_lt
and so on...

Change-Id: I7cc94a662e83176c2c2c441cbce27b4f2774e4a4

diff --git a/include/svtools/htmlkywd.hxx b/include/svtools/htmlkywd.hxx
index 9e7fd91..7120393 100644
--- a/include/svtools/htmlkywd.hxx
+++ b/include/svtools/htmlkywd.hxx
@@ -276,14 +276,6 @@
 #define OOO_STRING_SVTOOLS_HTML_S_uml uml
 #define OOO_STRING_SVTOOLS_HTML_S_yen yen
 
-// Netscape kennt noch ein paar in Grossbuchstaben ...
-#define OOO_STRING_SVTOOLS_HTML_C_LT lt
-#define OOO_STRING_SVTOOLS_HTML_C_GT gt
-#define OOO_STRING_SVTOOLS_HTML_C_AMP amp
-#define OOO_STRING_SVTOOLS_HTML_C_QUOT quot
-#define OOO_STRING_SVTOOLS_HTML_S_COPY copy
-#define OOO_STRING_SVTOOLS_HTML_S_REG reg
-
 // HTML4
 #define OOO_STRING_SVTOOLS_HTML_S_alefsym alefsym
 #define OOO_STRING_SVTOOLS_HTML_S_Alpha Alpha
diff --git a/svtools/source/svhtml/htmlkywd.cxx 
b/svtools/source/svhtml/htmlkywd.cxx
index 334adb0..fd451d6 100644
--- a/svtools/source/svhtml/htmlkywd.cxx
+++ b/svtools/source/svhtml/htmlkywd.cxx
@@ -365,14 +365,6 @@ static HTML_CharEntry aHTMLCharNameTab[] = {
 {{OOO_STRING_SVTOOLS_HTML_S_uml},168},
 {{OOO_STRING_SVTOOLS_HTML_S_yen},165},
 
-// Netscape has some in upper case...
-{{OOO_STRING_SVTOOLS_HTML_C_LT}, 60},
-{{OOO_STRING_SVTOOLS_HTML_C_GT}, 62},
-{{OOO_STRING_SVTOOLS_HTML_C_AMP},38},
-{{OOO_STRING_SVTOOLS_HTML_C_QUOT},   34},
-{{OOO_STRING_SVTOOLS_HTML_S_COPY},  169},
-{{OOO_STRING_SVTOOLS_HTML_S_REG},   174},
-
 // special characters, which will be converted to tokens !!!
 {{OOO_STRING_SVTOOLS_HTML_S_nbsp},  1},
 {{OOO_STRING_SVTOOLS_HTML_S_shy},   2},
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source sw/source

2013-09-18 Thread Abdulaziz A Alayed
 include/svtools/ruler.hxx|2 +-
 svtools/source/control/ruler.cxx |6 +-
 sw/source/ui/misc/swruler.cxx|6 +-
 3 files changed, 11 insertions(+), 3 deletions(-)

New commits:
commit d86a72b64f208fe55f302d9fd8a7f578a4275bb8
Author: Abdulaziz A Alayed aala...@kacst.edu.sa
Date:   Wed Sep 18 13:18:32 2013 +0300

fdo#69280 fixing comments toggle button position when local

set to RTL language

Change-Id: I0c133e3bbb6801f56e9ac0f508961bfa07a19523

Conflicts:
svtools/source/control/ruler.cxx

diff --git a/include/svtools/ruler.hxx b/include/svtools/ruler.hxx
index 9382cb0..8f34c23 100644
--- a/include/svtools/ruler.hxx
+++ b/include/svtools/ruler.hxx
@@ -808,7 +808,7 @@ public:
 const Link GetExtraDownHdl() const { return maExtraDownHdl; }
 
 voidSetTextRTL(sal_Bool bRTL);
-
+boolGetTextRTL();
 voidSetCharWidth( long nWidth ) { mnCharWidth = nWidth ; }
 voidSetLineHeight( long nHeight ) { mnLineHeight = nHeight ; }
 
diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx
index 6a356c6..91bb084 100644
--- a/svtools/source/control/ruler.cxx
+++ b/svtools/source/control/ruler.cxx
@@ -2728,7 +2728,6 @@ void Ruler::DrawTab( OutputDevice* pDevice, const Color 
rFillColor, const Point
 ImplDrawRulerTab( pDevice, aPos, nTabStyle, nStyle  );
 pDevice-Pop();
 }
-
 void Ruler::SetTextRTL(sal_Bool bRTL)
 {
 if(mpData-bTextRTL != (bool) bRTL)
@@ -2770,6 +2769,11 @@ long Ruler::GetRulerVirHeight() const
 return mnVirHeight;
 }
 
+bool Ruler::GetTextRTL()
+{
+return mpData-bTextRTL;
+}
+
 RulerUnitData Ruler::GetCurrentRulerUnit() const
 {
 return aImplRulerUnitTab[mnUnitIndex];
diff --git a/sw/source/ui/misc/swruler.cxx b/sw/source/ui/misc/swruler.cxx
index 76fb8be..f0838f3 100644
--- a/sw/source/ui/misc/swruler.cxx
+++ b/sw/source/ui/misc/swruler.cxx
@@ -246,6 +246,7 @@ void SwCommentRuler::UpdateCommentHelpText()
 // TODO Make Ruler return its central rectangle instead of margins.
 Rectangle SwCommentRuler::GetCommentControlRegion()
 {
+long nLeft = 0;
 SwPostItMgr *pPostItMgr = mpViewShell-GetPostItMgr();
 
 //rhbz#1006850 When the SwPostItMgr ctor is called from SwView::SwView it
@@ -255,7 +256,10 @@ Rectangle SwCommentRuler::GetCommentControlRegion()
 return Rectangle();
 
 //FIXME When the page width is larger then screen, the ruler is misplaced 
by one pixel
-long nLeft   = GetWinOffset() + GetPageOffset() + 
mpSwWin-LogicToPixel(Size(GetPageWidth(), 0)).Width();
+if (GetTextRTL())
+   nLeft = GetPageOffset() - pPostItMgr-GetSidebarWidth(true) + 
GetBorderOffset();
+else
+   nLeft = GetWinOffset() + GetPageOffset() + 
mpSwWin-LogicToPixel(Size(GetPageWidth(), 0)).Width();
 long nTop= 0 + 4; // Ruler::ImplDraw uses RULER_OFF (value: 3px) as 
offset, and Ruler::ImplFormat adds one extra pixel
 // Somehow pPostItMgr-GetSidebarBorderWidth() returns border width 
already doubled
 long nRight  = nLeft+ pPostItMgr-GetSidebarWidth(true) + 
pPostItMgr-GetSidebarBorderWidth(true);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source svx/source

2013-08-17 Thread Matteo Casalin
 include/svtools/svtabbx.hxx   |2 
 svtools/source/contnr/svtabbx.cxx |   77 +++---
 svx/source/dialog/ctredlin.cxx|   24 ++-
 3 files changed, 21 insertions(+), 82 deletions(-)

New commits:
commit 4ee77518f56915fec9dac2a0649eb633eeb27e25
Author: Matteo Casalin matteo.casa...@yahoo.com
Date:   Fri Aug 16 22:19:38 2013 +0200

SvTabListBox::GetToken: sal_Unicode* to OUString + OUString::getToken

Change-Id: I1006b33aaf4ba31cfbd38dd2a39b06cb7a381af6
Reviewed-on: https://gerrit.libreoffice.org/5461
Reviewed-by: Michael Stahl mst...@redhat.com
Tested-by: Michael Stahl mst...@redhat.com

diff --git a/include/svtools/svtabbx.hxx b/include/svtools/svtabbx.hxx
index 86138df..93502c3 100644
--- a/include/svtools/svtabbx.hxx
+++ b/include/svtools/svtabbx.hxx
@@ -53,7 +53,7 @@ private:
 protected:
 SvTreeListEntry*pViewParent;
 
-static const sal_Unicode*   GetToken( const sal_Unicode* pPtr, sal_uInt16 
rLen );
+static OUString GetToken( const OUString sStr, sal_Int32 
nIndex );
 
 virtual voidSetTabs();
 virtual voidInitEntry(SvTreeListEntry*, const OUString, 
const Image, const Image, SvLBoxButtonKind);
diff --git a/svtools/source/contnr/svtabbx.cxx 
b/svtools/source/contnr/svtabbx.cxx
index 0a0de29..584dd1e 100644
--- a/svtools/source/contnr/svtabbx.cxx
+++ b/svtools/source/contnr/svtabbx.cxx
@@ -76,25 +76,15 @@ void SvTabListBox::InitEntry(SvTreeListEntry* pEntry, const 
OUString rStr,
 const Image rColl, const Image rExp, SvLBoxButtonKind eButtonKind)
 {
 SvTreeListBox::InitEntry(pEntry, rStr, rColl, rExp, eButtonKind);
-OUString aToken;
 
-const sal_Unicode* pCurToken = aCurEntry.getStr();
-sal_uInt16 nCurTokenLen;
-const sal_Unicode* pNextToken = GetToken( pCurToken, nCurTokenLen );
-sal_uInt16 nCount = nTabCount; nCount--;
+sal_Int32 nIndex = 0;
+// TODO: verify if nTabCount is always 0 here!
+const sal_uInt16 nCount = nTabCount - 1;
 for( sal_uInt16 nToken = 0; nToken  nCount; nToken++ )
 {
-if( pCurToken  nCurTokenLen )
-aToken = OUString(pCurToken, nCurTokenLen);
-else
-aToken = OUString();
+const OUString aToken = GetToken(aCurEntry, nIndex);
 SvLBoxString* pStr = new SvLBoxString( pEntry, 0, aToken );
 pEntry-AddItem( pStr );
-pCurToken = pNextToken;
-if( pCurToken )
-pNextToken = GetToken( pCurToken, nCurTokenLen );
-else
-nCurTokenLen = 0;
 }
 }
 
@@ -324,45 +314,26 @@ void SvTabListBox::SetEntryText(const OUString rStr, 
SvTreeListEntry* pEntry, s
 if (sOldText == rStr)
 return;
 
-sal_uInt16 nTextColumn = nCol;
-const sal_Unicode* pCurToken = rStr.getStr();
-sal_uInt16 nCurTokenLen;
-const sal_Unicode* pNextToken = GetToken( pCurToken, nCurTokenLen );
-
-OUString aTemp;
-sal_uInt16 nCount = pEntry-ItemCount();
-sal_uInt16 nCur = 0;
-while( nCur  nCount )
+sal_Int32 nIndex = 0;
+const sal_uInt16 nTextColumn = nCol;
+const sal_uInt16 nCount = pEntry-ItemCount();
+for (sal_uInt16 nCur = 0; nCur  nCount; ++nCur)
 {
 SvLBoxItem* pStr = pEntry-GetItem( nCur );
 if (pStr  pStr-GetType() == SV_ITEM_ID_LBOXSTRING)
 {
-if( nCol == 0x )
+if (!nCol || nCol==0x)
 {
-if( pCurToken )
-aTemp = OUString(pCurToken, nCurTokenLen);
-else
-aTemp = OUString(); // delete all columns without a token
+const OUString aTemp(GetToken(rStr, nIndex));
 ((SvLBoxString*)pStr)-SetText( aTemp );
-pCurToken = pNextToken;
-pNextToken = GetToken( pCurToken, nCurTokenLen );
+if (!nCol  nIndex0)
+break;
 }
 else
 {
-if( !nCol )
-{
-aTemp = OUString(pCurToken, nCurTokenLen);
-((SvLBoxString*)pStr)-SetText( aTemp );
-if( !pNextToken )
-break;
-pCurToken = pNextToken;
-pNextToken = GetToken( pCurToken, nCurTokenLen );
-}
-else
-nCol--;
+--nCol;
 }
 }
-nCur++;
 }
 GetModel()-InvalidateEntry( pEntry );
 
@@ -420,27 +391,9 @@ void SvTabListBox::Resize()
 }
 
 // static
-const sal_Unicode* SvTabListBox::GetToken( const sal_Unicode* pPtr, 
sal_uInt16 rLen )
+OUString SvTabListBox::GetToken( const OUString sStr, sal_Int32 nIndex )
 {
-if( !pPtr || *pPtr == 0 )
-{
-rLen = 0;
-return 0;
-}
-sal_Unicode c = *pPtr;
-sal_uInt16 nLen = 0;
-while( c != '\t'  c != 0 )
-{
-pPtr++;
-nLen++;
-

[Libreoffice-commits] core.git: include/svtools svtools/source sw/source

2013-08-13 Thread Palenik Mihály
 include/svtools/parhtml.hxx|6 +--
 svtools/source/svhtml/htmlsupp.cxx |   66 ++---
 sw/source/filter/html/htmlbas.cxx  |   40 +++---
 sw/source/filter/html/htmlcss1.cxx |4 +-
 sw/source/filter/html/htmldraw.cxx |4 +-
 sw/source/filter/html/htmlfld.cxx  |   13 ++-
 sw/source/filter/html/htmlgrin.cxx |2 -
 sw/source/filter/html/htmlnum.cxx  |2 -
 sw/source/filter/html/swhtml.cxx   |   65 +---
 sw/source/filter/html/swhtml.hxx   |   32 -
 10 files changed, 115 insertions(+), 119 deletions(-)

New commits:
commit 7a504c8752bf7c5accbb9bcc33a98f79b31b8bf2
Author: Palenik Mihály palenik.mih...@gmail.com
Date:   Fri Aug 9 13:51:08 2013 +0200

Change String to OUString in SwHTMLParser class

I changed some variables in SwHTMLParser class and her dependencies.

Change-Id: Ie8ad6c481df8a904bd358c2e9cd6afeef990d418
Reviewed-on: https://gerrit.libreoffice.org/5330
Reviewed-by: Tor Lillqvist t...@iki.fi
Reviewed-by: Michael Stahl mst...@redhat.com
Tested-by: Michael Stahl mst...@redhat.com

diff --git a/include/svtools/parhtml.hxx b/include/svtools/parhtml.hxx
index 7df1d76..d82bbaf 100644
--- a/include/svtools/parhtml.hxx
+++ b/include/svtools/parhtml.hxx
@@ -252,13 +252,13 @@ public:
   bool bSwitchToUCS2 = false,
   rtl_TextEncoding eEnc=RTL_TEXTENCODING_DONTKNOW );
 
-bool ParseScriptOptions( String rLangString, const String, 
HTMLScriptLanguage rLang,
- String rSrc, String rLibrary, String rModule );
+bool ParseScriptOptions( OUString rLangString, const OUString, 
HTMLScriptLanguage rLang,
+ OUString rSrc, OUString rLibrary, OUString 
rModule );
 
 // Einen Kommentar um den Inhalt von SCRIPT oder STYLE entfernen
 // Bei 'bFull' wird ggf. die gesammte Zeile hinter einem !--
 // entfernt (fuer JavaSript)
-static void RemoveSGMLComment( String rString, sal_Bool bFull );
+static void RemoveSGMLComment( OUString rString, sal_Bool bFull );
 
 static bool InternalImgToPrivateURL( String rURL );
 static rtl_TextEncoding GetEncodingByHttpHeader( SvKeyValueIterator 
*pHTTPHeader );
diff --git a/svtools/source/svhtml/htmlsupp.cxx 
b/svtools/source/svhtml/htmlsupp.cxx
index 3d90fec..829e8f3 100644
--- a/svtools/source/svhtml/htmlsupp.cxx
+++ b/svtools/source/svhtml/htmlsupp.cxx
@@ -36,19 +36,19 @@ static HTMLOptionEnum const aScriptLangOptEnums[] =
 { 0,0   }
 };
 
-bool HTMLParser::ParseScriptOptions( String rLangString, const String 
rBaseURL,
+bool HTMLParser::ParseScriptOptions( OUString rLangString, const OUString 
rBaseURL,
  HTMLScriptLanguage rLang,
- String rSrc,
- String rLibrary,
- String rModule )
+ OUString rSrc,
+ OUString rLibrary,
+ OUString rModule )
 {
 const HTMLOptions aScriptOptions = GetOptions();
 
-rLangString.Erase();
+rLangString = ;
 rLang = HTML_SL_JAVASCRIPT;
-rSrc.Erase();
-rLibrary.Erase();
-rModule.Erase();
+rSrc = ;
+rLibrary = ;
+rModule = ;
 
 for( size_t i = aScriptOptions.size(); i; )
 {
@@ -82,71 +82,71 @@ bool HTMLParser::ParseScriptOptions( String rLangString, 
const String rBaseURL
 return true;
 }
 
-void HTMLParser::RemoveSGMLComment( String rString, sal_Bool bFull )
+void HTMLParser::RemoveSGMLComment( OUString rString, sal_Bool bFull )
 {
 sal_Unicode c = 0;
-while( rString.Len() 
-   ( ' '==(c=rString.GetChar(0)) || '\t'==c || '\r'==c || '\n'==c ) )
-rString.Erase( 0, 1 );
+while( !rString.isEmpty() 
+   ( ' '==(c=rString[0]) || '\t'==c || '\r'==c || '\n'==c ) )
+rString = rString.copy( 1, rString.getLength() - 1 );
 
-while( rString.Len() 
-   ( ' '==(c=rString.GetChar( rString.Len()-1))
+while( !rString.isEmpty() 
+   ( ' '==(c=rString[rString.getLength()-1])
|| '\t'==c || '\r'==c || '\n'==c ) )
-rString.Erase( rString.Len()-1 );
+rString = rString.copy( 0, rString.getLength()-1 );
 
 
 // remove SGML comments
-if( rString.Len() = 4 
-rString.CompareToAscii( !--, 4 ) == COMPARE_EQUAL )
+if( rString.getLength() = 4 
+rString.startsWith( !-- ) )
 {
-xub_StrLen nPos = 3;
+sal_Int32 nPos = 3;
 if( bFull )
 {
 // the whole line
 nPos = 4;
-while( nPos  rString.Len() 
-( ( c = rString.GetChar( nPos )) != '\r'  c != '\n' ) )
+while( nPos  rString.getLength() 
+( ( c = rString[nPos] ) != '\r'  c != '\n' ) )
   

[Libreoffice-commits] core.git: include/svtools svtools/source sw/source

2013-08-05 Thread Palenik Mihály
 include/svtools/htmlout.hxx|6 
 svtools/source/svhtml/htmlout.cxx  |8 -
 sw/source/filter/html/htmlatr.cxx  |  238 ++---
 sw/source/filter/html/htmlbas.cxx  |   16 +-
 sw/source/filter/html/htmlfldw.cxx |2 
 sw/source/filter/html/htmlgrin.cxx |   12 -
 sw/source/filter/html/swhtml.hxx   |6 
 sw/source/filter/html/wrthtml.hxx  |4 
 8 files changed, 145 insertions(+), 147 deletions(-)

New commits:
commit bd19e78f62a71bfe7bb6c6634cb021b1e26ef71a
Author: Palenik Mihály palenik.mih...@gmail.com
Date:   Thu Jul 25 09:37:58 2013 +0200

Change String class to OUString class in two files.

I changed String class to OUString class in htmlatr.cxx and
htmlbas.cxx and their dependencies.

Change-Id: I3d05c9705d221b5abe02d09845cd3cdc5381e201
Reviewed-on: https://gerrit.libreoffice.org/5091

diff --git a/include/svtools/htmlout.hxx b/include/svtools/htmlout.hxx
index 52c9234..bc91591 100644
--- a/include/svtools/htmlout.hxx
+++ b/include/svtools/htmlout.hxx
@@ -88,11 +88,11 @@ struct HTMLOutFuncs
 SVT_DLLPUBLIC static SvStream OutScript( SvStream rStrm,
 const String rBaseURL,
 const String rSource,
-const String rLanguage,
+const OUString rLanguage,
 ScriptType eScriptType,
 const String rSrc,
-const String *pSBLibrary = 0,
-const String *pSBModule = 0,
+const OUString *pSBLibrary = 0,
+const OUString *pSBModule = 0,
 rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
 String *pNonConvertableChars = 0 );
 
diff --git a/svtools/source/svhtml/htmlout.cxx 
b/svtools/source/svhtml/htmlout.cxx
index 37e6ba5..75568ee 100644
--- a/svtools/source/svhtml/htmlout.cxx
+++ b/svtools/source/svhtml/htmlout.cxx
@@ -783,11 +783,11 @@ SvStream HTMLOutFuncs::Out_ImageMap( SvStream rStream,
 SvStream HTMLOutFuncs::OutScript( SvStream rStrm,
const String rBaseURL,
const String rSource,
-   const String rLanguage,
+   const OUString rLanguage,
ScriptType eScriptType,
const String rSrc,
-   const String *pSBLibrary,
-   const String *pSBModule,
+   const OUString *pSBLibrary,
+   const OUString *pSBModule,
rtl_TextEncoding eDestEnc,
String *pNonConvertableChars )
 {
@@ -799,7 +799,7 @@ SvStream HTMLOutFuncs::OutScript( SvStream rStrm,
 sOut.append('')
 .append(RTL_CONSTASCII_STRINGPARAM(OOO_STRING_SVTOOLS_HTML_script));
 
-if( rLanguage.Len() )
+if( !rLanguage.isEmpty() )
 {
 sOut.append(' ')
 
.append(RTL_CONSTASCII_STRINGPARAM(OOO_STRING_SVTOOLS_HTML_O_language))
diff --git a/sw/source/filter/html/htmlatr.cxx 
b/sw/source/filter/html/htmlatr.cxx
index 59084b1..819b6ac 100644
--- a/sw/source/filter/html/htmlatr.cxx
+++ b/sw/source/filter/html/htmlatr.cxx
@@ -87,7 +87,7 @@ HTMLOutEvent aAnchorEventTable[] =
 
 static Writer OutHTML_SvxAdjust( Writer rWrt, const SfxPoolItem rHt );
 
-sal_uInt16 SwHTMLWriter::GetDefListLvl( const String rNm, sal_uInt16 nPoolId )
+sal_uInt16 SwHTMLWriter::GetDefListLvl( const OUString rNm, sal_uInt16 
nPoolId )
 {
 if( nPoolId == RES_POOLCOLL_HTML_DD )
 {
@@ -98,17 +98,16 @@ sal_uInt16 SwHTMLWriter::GetDefListLvl( const String rNm, 
sal_uInt16 nPoolId )
 return 1 | HTML_DLCOLL_DT;
 }
 
-String sDTDD( OUString(OOO_STRING_SVTOOLS_HTML_dt) );
-sDTDD += ' ';
-if( COMPARE_EQUAL == sDTDD.CompareTo( rNm, sDTDD.Len() ) )
+OUString sDTDD( OOO_STRING_SVTOOLS_HTML_dt );
+sDTDD +=  ;
+if( rNm.startsWith(sDTDD) )
 // DefinitionList - term
-return (sal_uInt16)rNm.Copy( sDTDD.Len() ).ToInt32() | HTML_DLCOLL_DT;
+return (sal_uInt16)rNm.copy( sDTDD.getLength() ).toInt32() | 
HTML_DLCOLL_DT;
 
-sDTDD.AssignAscii( OOO_STRING_SVTOOLS_HTML_dd );
-sDTDD += ' ';
-if( COMPARE_EQUAL == sDTDD.CompareTo( rNm, sDTDD.Len() ) )
+sDTDD = OUString( OOO_STRING_SVTOOLS_HTML_dd ) +  ;
+if( rNm.startsWith(sDTDD) )
 // DefinitionList - definition
-return (sal_uInt16)rNm.Copy( sDTDD.Len() ).ToInt32() | HTML_DLCOLL_DD;
+return (sal_uInt16)rNm.copy( sDTDD.getLength() ).toInt32() | 
HTML_DLCOLL_DD;
 
 return 0;
 }
@@ -529,7 +528,7 @@ void OutHTML_SwFmt( Writer rWrt, const SwFmt rFmt,
   

[Libreoffice-commits] core.git: include/svtools svtools/source

2013-08-01 Thread Andrzej J . R . Hunt
 include/svtools/dialogcontrolling.hxx |1 +
 svtools/source/misc/dialogcontrolling.cxx |9 +
 2 files changed, 10 insertions(+)

New commits:
commit ce33ac1da4b3345684e69dc0d5adff375fcb4a13
Author: Andrzej J.R. Hunt andr...@ahunt.org
Date:   Tue Jul 30 11:35:38 2013 +0200

Add enableOnRadioCheck for 2 dependent windows.

This is needed for the embedded db selector that is
to be added to the database setup wizard.

Change-Id: I5bbf4bf51472ca84c678b97991b9763fc062a88f
Reviewed-on: https://gerrit.libreoffice.org/5198
Reviewed-by: Luboš Luňák l.lu...@suse.cz
Tested-by: Luboš Luňák l.lu...@suse.cz

diff --git a/include/svtools/dialogcontrolling.hxx 
b/include/svtools/dialogcontrolling.hxx
index 56d31d4..95153ea 100644
--- a/include/svtools/dialogcontrolling.hxx
+++ b/include/svtools/dialogcontrolling.hxx
@@ -157,6 +157,7 @@ namespace svt
 disabled when it's unchecked
 */
 voidenableOnRadioCheck( RadioButton _rRadio, Window 
_rDependentWindow );
+voidenableOnRadioCheck( RadioButton _rRadio, Window 
_rDependentWindow1, Window _rDependentWindow2 );
 voidenableOnRadioCheck( RadioButton _rRadio, Window 
_rDependentWindow1, Window _rDependentWindow2, Window _rDependentWindow3 );
 voidenableOnRadioCheck( RadioButton _rRadio, Window 
_rDependentWindow1, Window _rDependentWindow2, Window _rDependentWindow3, 
Window _rDependentWindow4, Window _rDependentWindow5 );
 
diff --git a/svtools/source/misc/dialogcontrolling.cxx 
b/svtools/source/misc/dialogcontrolling.cxx
index 52b8656..e89a97c 100644
--- a/svtools/source/misc/dialogcontrolling.cxx
+++ b/svtools/source/misc/dialogcontrolling.cxx
@@ -181,6 +181,15 @@ namespace svt
 }
 
 //-
+void ControlDependencyManager::enableOnRadioCheck( RadioButton _rRadio, 
Window _rDependentWindow1, Window _rDependentWindow2 )
+{
+PDialogController pController( new RadioDependentEnabler( _rRadio ) );
+pController-addDependentWindow( _rDependentWindow1 );
+pController-addDependentWindow( _rDependentWindow2 );
+m_pImpl-aControllers.push_back( pController );
+}
+
+//-
 void ControlDependencyManager::enableOnRadioCheck( RadioButton _rRadio, 
Window _rDependentWindow1, Window _rDependentWindow2, Window 
_rDependentWindow3 )
 {
 PDialogController pController( new RadioDependentEnabler( _rRadio ) );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/svtools svtools/source

2013-07-18 Thread Caolán McNamara
 include/svtools/svtabbx.hxx   |   12 ++--
 svtools/source/contnr/svtabbx.cxx |   12 ++--
 2 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit eb3c79c29d9a1963fca2f7c3a9d908dc175c480c
Author: Caolán McNamara caol...@redhat.com
Date:   Wed Jul 17 12:40:05 2013 +0100

ditch some XubStrings

Change-Id: I4e54102819123a0b10fcade20df3485ec86543d0

diff --git a/include/svtools/svtabbx.hxx b/include/svtools/svtabbx.hxx
index c88b418..167e41e 100644
--- a/include/svtools/svtabbx.hxx
+++ b/include/svtools/svtabbx.hxx
@@ -86,11 +86,11 @@ public:
  sal_uLong nPos = LIST_APPEND, void* 
pUserData = 0,
  SvLBoxButtonKind eButtonKind = 
SvLBoxButtonKind_enabledCheckbox );
 
-virtual SvTreeListEntry* InsertEntryToColumn( const XubString, sal_uLong 
nPos = LIST_APPEND,
+virtual SvTreeListEntry* InsertEntryToColumn( const OUString, sal_uLong 
nPos = LIST_APPEND,
  sal_uInt16 nCol = 0x, void* pUserData = 
NULL );
-virtual SvTreeListEntry* InsertEntryToColumn( const XubString, 
SvTreeListEntry* pParent,
+virtual SvTreeListEntry* InsertEntryToColumn( const OUString, 
SvTreeListEntry* pParent,
  sal_uLong nPos, sal_uInt16 nCol, void* 
pUserData = NULL );
-virtual SvTreeListEntry* InsertEntryToColumn( const XubString, const 
Image rExpandedEntryBmp,
+virtual SvTreeListEntry* InsertEntryToColumn( const OUString, const 
Image rExpandedEntryBmp,
  const Image rCollapsedEntryBmp, 
SvTreeListEntry* pParent = NULL,
  sal_uLong nPos = LIST_APPEND, sal_uInt16 nCol 
= 0x, void* pUserData = NULL );
 
@@ -148,11 +148,11 @@ public:
 voidInitHeaderBar( HeaderBar* pHeaderBar );
 sal_BoolIsItemChecked( SvTreeListEntry* pEntry, sal_uInt16 nCol ) 
const;
 
-virtual SvTreeListEntry* InsertEntryToColumn( const XubString, sal_uLong 
nPos = LIST_APPEND,
+virtual SvTreeListEntry* InsertEntryToColumn( const OUString, sal_uLong 
nPos = LIST_APPEND,
  sal_uInt16 nCol = 0x, void* pUserData = 
NULL );
-virtual SvTreeListEntry* InsertEntryToColumn( const XubString, 
SvTreeListEntry* pParent,
+virtual SvTreeListEntry* InsertEntryToColumn( const OUString, 
SvTreeListEntry* pParent,
  sal_uLong nPos, sal_uInt16 nCol, void* 
pUserData = NULL );
-virtual SvTreeListEntry* InsertEntryToColumn( const XubString, const 
Image rExpandedEntryBmp,
+virtual SvTreeListEntry* InsertEntryToColumn( const OUString, const 
Image rExpandedEntryBmp,
  const Image rCollapsedEntryBmp, 
SvTreeListEntry* pParent = NULL,
  sal_uLong nPos = LIST_APPEND, sal_uInt16 nCol 
= 0x, void* pUserData = NULL );
 virtual sal_uLong Insert( SvTreeListEntry* pEnt,SvTreeListEntry* 
pPar,sal_uLong nPos=LIST_APPEND);
diff --git a/svtools/source/contnr/svtabbx.cxx 
b/svtools/source/contnr/svtabbx.cxx
index 6e77b49..e165bea 100644
--- a/svtools/source/contnr/svtabbx.cxx
+++ b/svtools/source/contnr/svtabbx.cxx
@@ -204,7 +204,7 @@ SvTreeListEntry* SvTabListBox::InsertEntry( const 
XubString rText,
 pParent, nPos, 0x, pUserData );
 }
 
-SvTreeListEntry* SvTabListBox::InsertEntryToColumn(const XubString 
rStr,SvTreeListEntry* pParent,sal_uLong nPos,sal_uInt16 nCol,
+SvTreeListEntry* SvTabListBox::InsertEntryToColumn(const OUString 
rStr,SvTreeListEntry* pParent,sal_uLong nPos,sal_uInt16 nCol,
 void* pUser )
 {
 XubString aStr;
@@ -230,7 +230,7 @@ SvTreeListEntry* SvTabListBox::InsertEntryToColumn(const 
XubString rStr,SvTreeL
 return SvTreeListBox::InsertEntry( aFirstStr, pParent, sal_False, nPos, 
pUser );
 }
 
-SvTreeListEntry* SvTabListBox::InsertEntryToColumn( const XubString rStr,
+SvTreeListEntry* SvTabListBox::InsertEntryToColumn( const OUString rStr,
 const Image rExpandedEntryBmp, const Image rCollapsedEntryBmp,
 SvTreeListEntry* pParent,sal_uLong nPos,sal_uInt16 nCol, void* pUser )
 {
@@ -261,7 +261,7 @@ SvTreeListEntry* SvTabListBox::InsertEntryToColumn( const 
XubString rStr,
 pParent, sal_False, nPos, pUser );
 }
 
-SvTreeListEntry* SvTabListBox::InsertEntryToColumn( const XubString rStr, 
sal_uLong nPos,
+SvTreeListEntry* SvTabListBox::InsertEntryToColumn( const OUString rStr, 
sal_uLong nPos,
 sal_uInt16 nCol, void* pUser )
 {
 return InsertEntryToColumn( rStr,0,nPos, nCol, pUser );
@@ -636,7 +636,7 @@ sal_Bool SvHeaderTabListBox::IsItemChecked( 
SvTreeListEntry* pEntry, sal_uInt16
 // ---
 
 SvTreeListEntry* SvHeaderTabListBox::InsertEntryToColumn(
-const XubString rStr, sal_uLong nPos, sal_uInt16 nCol, void* pUserData )
+const OUString rStr, sal_uLong nPos, sal_uInt16 

[Libreoffice-commits] core.git: include/svtools svtools/source

2013-05-16 Thread Eike Rathke
 include/svtools/parhtml.hxx   |2 ++
 svtools/source/svhtml/parhtml.cxx |   22 ++
 2 files changed, 20 insertions(+), 4 deletions(-)

New commits:
commit bb7360ca9929e9b395b3c903f460c9ed5efdce4d
Author: Eike Rathke er...@redhat.com
Date:   Thu May 16 23:53:30 2013 +0200

resolved fdo#56772 keep track of HTML ON/OFF tokens

Regression introduced with 11cbcb8b08b540b144a5df744e9fba0b6ba8144a
followed by 56d6589368c2e88cffec0c2e518f7c90863eeae6

Deep from svtools/source/svhtml/parhtml.cxx HTMLParser::_GetNextToken()
only a HTML_TABLEDATA_OFF was generated for td .../ without a matching
HTML_TABLEDATA_ON (actually same for all XXX/ ON/OFF tokens). This
confuses a state machine that doesn't keep track of such unexpected
closures and also expects all attributes of an element at an ON token.
Only the parser knows this is actually one token but needs to generate
separate ON/OFF tokens.

These bugs mentioned in the original code and commits are still fixed
with this change:
https://bugs.freedesktop.org/show_bug.cgi?id=34666
https://bugs.freedesktop.org/show_bug.cgi?id=36080
https://bugs.freedesktop.org/show_bug.cgi?id=36390

Change-Id: I2b3190d297a35ee3dfda95f9a4841f7c53ed4a92

diff --git a/include/svtools/parhtml.hxx b/include/svtools/parhtml.hxx
index 9011dad..7df1d76 100644
--- a/include/svtools/parhtml.hxx
+++ b/include/svtools/parhtml.hxx
@@ -144,6 +144,8 @@ private:
 
 sal_uInt32 nPre_LinePos;// Pos in der Line im PRE-Tag
 
+int mnPendingOffToken;  /// OFF token pending for a XX.../ 
ON/OFF ON token
+
 String aEndToken;
 
 protected:
diff --git a/svtools/source/svhtml/parhtml.cxx 
b/svtools/source/svhtml/parhtml.cxx
index 6e2fce3..a95ec79 100644
--- a/svtools/source/svhtml/parhtml.cxx
+++ b/svtools/source/svhtml/parhtml.cxx
@@ -297,7 +297,8 @@ HTMLParser::HTMLParser( SvStream rIn, bool bReadNewDoc ) :
 bEndTokenFound(false),
 bPre_IgnoreNewPara(false),
 bReadNextChar(false),
-bReadComment(false)
+bReadComment(false),
+mnPendingOffToken(0)
 {
 //#i76649, default to UTF-8 for HTML unless we know differently
 SetSrcEncoding(RTL_TEXTENCODING_UTF8);
@@ -1057,6 +1058,15 @@ int HTMLParser::_GetNextToken()
 int nRet = 0;
 sSaveToken.Erase();
 
+if (mnPendingOffToken)
+{
+// HTML_TOKEN_OFF generated for HTML_TOKEN_ON
+nRet = mnPendingOffToken;
+mnPendingOffToken = 0;
+aToken.Erase();
+return nRet;
+}
+
 // Delete options
 if (!maOptions.empty())
 maOptions.clear();
@@ -1204,10 +1214,14 @@ int HTMLParser::_GetNextToken()
 ScanText( '' );
 
 // fdo#34666 fdo#36080 fdo#36390: closing /?:
-// return HTML_TOKEN_OFF instead of HTML_TOKEN_ON
+// generate pending HTML_TOKEN_OFF for 
HTML_TOKEN_ON
+// Do not convert this to a single HTML_TOKEN_OFF
+// which lead to fdo#56772.
 if ((HTML_TOKEN_ONOFF  nRet)  (aToken.Len() = 1) 
-('/' == aToken.GetChar(aToken.Len()-1))) {
-++nRet; // HTML_TOKEN_ON - HTML_TOKEN_OFF;
+('/' == aToken.GetChar(aToken.Len()-1)))
+{
+mnPendingOffToken = nRet + 1;   // 
HTML_TOKEN_ON - HTML_TOKEN_OFF
+aToken.Erase( aToken.Len()-1, 1);   // remove 
trailing '/'
 }
 if( sal_Unicode(EOF) == nNextCh  rInput.IsEof() )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


<    1   2   3   >