[Libreoffice-commits] .: 2 commits - automation/source cui/source

Caolán McNamara caolan at kemper.freedesktop.org
Tue Aug 2 03:08:59 PDT 2011


 automation/source/testtool/httprequest.cxx |    3 --
 automation/source/testtool/objtest.cxx     |   25 ++++++++++--------------
 cui/source/dialogs/about.cxx               |   30 ++++++++++++++++++++++-------
 cui/source/dialogs/about.hrc               |    8 +++++--
 cui/source/dialogs/about.src               |   18 ++++++++++++++++-
 cui/source/inc/about.hxx                   |   10 +++++----
 6 files changed, 63 insertions(+), 31 deletions(-)

New commits:
commit 3be86cef0892d37c1db9ac0c66d6753b88dd26b4
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Aug 1 21:57:42 2011 +0100

    Split this up into the constituent facts and bump copyright year.
    
    Make this more readable and make it clearer what's based on what if someone
    does a --with-vendor build with or without a custom product

diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx
index 9dc0312..0b478a7 100644
--- a/cui/source/dialogs/about.cxx
+++ b/cui/source/dialogs/about.cxx
@@ -55,6 +55,7 @@
 #include "about.hrc"
 #include <sfx2/sfxdefs.hxx>
 #include <sfx2/app.hxx>
+#include <rtl/ustrbuf.hxx>
 
 using namespace ::com::sun::star;
 
@@ -114,9 +115,11 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId) :
     aVersionText 	( this, 	ResId( ABOUT_FTXT_VERSION, *rId.GetResMgr() ) ),
     aCopyrightText	( this, 	ResId( ABOUT_FTXT_COPYRIGHT, *rId.GetResMgr() ) ),
     aInfoLink       ( this,     ResId( ABOUT_FTXT_LINK, *rId.GetResMgr() ) ),
-    aVersionTextStr(            ResId( ABOUT_STR_VERSION, *rId.GetResMgr() ) ),
-    aCopyrightTextStr(          ResId( ABOUT_STR_COPYRIGHT, *rId.GetResMgr() ) ),
-    aLinkStr        (           ResId( ABOUT_STR_LINK, *rId.GetResMgr() ) ),
+    aVersionTextStr(ResId(ABOUT_STR_VERSION, *rId.GetResMgr())),
+    m_aVendorTextStr(ResId(ABOUT_STR_VENDOR, *rId.GetResMgr())),
+    m_aOracleCopyrightTextStr(ResId(ABOUT_STR_COPYRIGHT_ORACLE_DERIVED, *rId.GetResMgr())),
+    m_aAcknowledgementTextStr(ResId(ABOUT_STR_ACKNOWLEDGEMENT, *rId.GetResMgr())),
+    m_aLinkStr(ResId( ABOUT_STR_LINK, *rId.GetResMgr())),
     m_sBuildStr(ResId(ABOUT_STR_BUILD, *rId.GetResMgr()))
 {
     rtl::OUString sProduct;
@@ -157,7 +160,7 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId) :
 
     aVersionText.SetBackground();
     aCopyrightText.SetBackground();
-    aInfoLink.SetURL( aLinkStr );
+    aInfoLink.SetURL(m_aLinkStr);
     aInfoLink.SetBackground();
     aInfoLink.SetClickHdl( LINK( this, AboutDialog, HandleHyperlink ) );
 
@@ -165,7 +168,17 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId) :
     aVersionText.SetControlForeground( aTextColor );
     aCopyrightText.SetControlForeground( aTextColor );
 
-    aCopyrightText.SetText( aCopyrightTextStr );
+    rtl::OUStringBuffer sText(m_aVendorTextStr);
+    sText.appendAscii(RTL_CONSTASCII_STRINGPARAM("\n\n"));
+    sal_uInt32 nCopyrightId = sProduct.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("LibreOffice" )) ?
+        ABOUT_STR_COPYRIGHT : ABOUT_STR_COPYRIGHT_DERIVED;
+    String aProductCopyrightTextStr(ResId(nCopyrightId, *rId.GetResMgr()));
+    sText.append(aProductCopyrightTextStr);
+    sText.appendAscii(RTL_CONSTASCII_STRINGPARAM("\n\n"));
+    sText.append(m_aOracleCopyrightTextStr);
+    sText.appendAscii(RTL_CONSTASCII_STRINGPARAM("\n\n"));
+    sText.append(m_aAcknowledgementTextStr);
+    aCopyrightText.SetText(sText.makeStringAndClear());
 
     // determine size and position of the dialog & elements
     Size aAppLogoSiz = aAppLogo.GetSizePixel();
@@ -178,7 +191,7 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId) :
     long nDlgMargin  = a6Size.Width() * 2;
     long nCtrlMargin = a6Size.Height() * 2;
 
-    aVersionText.SetSizePixel(Size(800,600));
+    aVersionText.SetSizePixel(Size(800, 600));
     Size aVersionTextSize = aVersionText.CalcMinimumSize();
     aVersionTextSize.Width() += nDlgMargin;
 
@@ -191,7 +204,10 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId) :
     if (aOutSiz.Width() < 300)
         aOutSiz.Width() = 300;
 
-    long nTextWidth  = aOutSiz.Width() - nDlgMargin;
+    //round up to nearest even
+    aOutSiz.Width() += aOutSiz.Width() & 1;
+
+    long nTextWidth = (aOutSiz.Width() - nDlgMargin);
 
     // finally set the aVersionText widget position and size
     Size aVTSize = aVersionText.GetSizePixel();
diff --git a/cui/source/dialogs/about.hrc b/cui/source/dialogs/about.hrc
index dfc71c4..37c0499 100644
--- a/cui/source/dialogs/about.hrc
+++ b/cui/source/dialogs/about.hrc
@@ -33,5 +33,9 @@
 #define ABOUT_FTXT_LINK		4
 #define ABOUT_STR_BUILD         5
 #define ABOUT_STR_VERSION	6
-#define ABOUT_STR_COPYRIGHT	7
-#define ABOUT_STR_LINK		8
+#define ABOUT_STR_VENDOR	7
+#define ABOUT_STR_COPYRIGHT	8
+#define ABOUT_STR_COPYRIGHT_DERIVED 9
+#define ABOUT_STR_COPYRIGHT_ORACLE_DERIVED 10
+#define ABOUT_STR_ACKNOWLEDGEMENT 11
+#define ABOUT_STR_LINK		12
diff --git a/cui/source/dialogs/about.src b/cui/source/dialogs/about.src
index 383fc29..9cf835a 100644
--- a/cui/source/dialogs/about.src
+++ b/cui/source/dialogs/about.src
@@ -72,9 +72,25 @@ ModalDialog RID_DEFAULTABOUT
     {
         Text[ en-US ] = "%PRODUCTNAME %ABOUTBOXPRODUCTVERSION %PRODUCTEXTENSION";
     };
+    String ABOUT_STR_VENDOR
+    {
+        Text[ en-US ] = "This product was supplied by %OOOVENDOR.";
+    };
     String ABOUT_STR_COPYRIGHT
     {
-        Text[ en-US ] = "Copyright © 2000, 2010 LibreOffice contributors and/or their affiliates. All rights reserved.\n\nThis product was created by %OOOVENDOR, based on OpenOffice.org, which is Copyright 2000, 2010 Oracle and/or its affiliates.\n\n%OOOVENDOR acknowledges all community members, please find more info at the link below:";
+        Text[ en-US ] = "LibreOffice is copyright © 2000, 2011 LibreOffice contributors and/or their affiliates. All rights reserved.";
+    };
+    String ABOUT_STR_COPYRIGHT_DERIVED
+    {
+        Text[ en-US ] = "%PRODUCTNAME is derived from LibreOffice. LibreOffice is copyright © 2000, 2011 LibreOffice contributors and/or their affiliates. All rights reserved.";
+    };
+    String ABOUT_STR_COPYRIGHT_ORACLE_DERIVED
+    {
+        Text[ en-US ] = "LibreOffice is derived from OpenOffice.org. OpenOffice.org is copyright © 2000, 2011 Oracle and/or its affiliates. All rights reserved.";
+    };
+    String ABOUT_STR_ACKNOWLEDGEMENT
+    {
+        Text[ en-US ] = "%OOOVENDOR acknowledges all community members, please find more info at the link below:";
     };
     String ABOUT_STR_LINK
     {
diff --git a/cui/source/inc/about.hxx b/cui/source/inc/about.hxx
index 2643f46..70aa098 100644
--- a/cui/source/inc/about.hxx
+++ b/cui/source/inc/about.hxx
@@ -53,10 +53,12 @@ private:
     MultiLineEdit       aCopyrightText;
     svt::FixedHyperlink aInfoLink;
 
-    String			aVersionData;
-    String          aVersionTextStr;
-    String          aCopyrightTextStr;
-    String          aLinkStr;
+    String aVersionData;
+    String aVersionTextStr;
+    String m_aVendorTextStr;
+    String m_aOracleCopyrightTextStr;
+    String m_aAcknowledgementTextStr;
+    String m_aLinkStr;
     String m_sBuildStr;
 
 protected:
commit 2ba40a594e9a4b9ed332c82c5d5b99b9d7b1d32f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Jul 29 11:13:09 2011 +0100

    callcatcher: fix leak

diff --git a/automation/source/testtool/httprequest.cxx b/automation/source/testtool/httprequest.cxx
index f33c9a0..b940828 100644
--- a/automation/source/testtool/httprequest.cxx
+++ b/automation/source/testtool/httprequest.cxx
@@ -53,10 +53,7 @@ HttpRequest::HttpRequest()
 HttpRequest::~HttpRequest()
 {
     delete pStream;
-    pStream = NULL;
-
     delete pOutSocket;
-    pOutSocket = NULL;
 }
 
 void HttpRequest::SetRequest( rtl::OString aHost, rtl::OString aPath, sal_uInt16 nPort )
diff --git a/automation/source/testtool/objtest.cxx b/automation/source/testtool/objtest.cxx
index 57c9455..dabf805 100644
--- a/automation/source/testtool/objtest.cxx
+++ b/automation/source/testtool/objtest.cxx
@@ -714,31 +714,28 @@ TestToolObj::~TestToolObj()
         pImpl->pMyVars[i].Clear();
     }
 
-    if (m_pControls)
-        delete m_pControls;
-    if (m_pReverseSlots)
-        delete m_pReverseSlots;
-    if (m_pReverseControls)
-        delete m_pReverseControls;
-    if (m_pReverseControlsSon)
-        delete m_pReverseControlsSon;
-    if (m_pReverseUIds)
-        delete m_pReverseUIds;
-    if (m_pSIds)
-        delete m_pSIds;
+    delete m_pControls;
+    delete m_pReverseSlots;
+    delete m_pReverseControls;
+    delete m_pReverseControlsSon;
+    delete m_pReverseUIds;
+    delete m_pSIds;
+
     if (pFehlerListe)
     {
         delete pFehlerListe;
         pFehlerListe = NULL;    // da pFehlerListe static ist!!
     }
+
     if ( pCommunicationManager )
     {
         pCommunicationManager->StopCommunication();
         delete pCommunicationManager;
     }
+
     delete In;
-    if ( pImpl->pTTSfxBroadcaster )
-        delete pImpl->pTTSfxBroadcaster;
+    delete pImpl->pTTSfxBroadcaster;
+    delete pImpl->pHttpRequest;
     delete pImpl->pChildEnv;
     delete pImpl->pHttpRequest;
 


More information about the Libreoffice-commits mailing list