[Libreoffice-commits] core.git: 2 commits - include/tools tools/source vcl/unx
Caolán McNamara
caolanm at redhat.com
Sat Oct 19 06:25:04 PDT 2013
include/tools/string.hxx | 2
tools/source/string/strimp.cxx | 92 -------------------------------------
vcl/unx/gtk/window/gtksalframe.cxx | 6 +-
3 files changed, 3 insertions(+), 97 deletions(-)
New commits:
commit 3bb099ecb3b63f365bbe514322201712108092ee
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Oct 19 13:57:54 2013 +0100
older gtks don't have gtk_widget_get_window
Change-Id: I700f45c680fb0154aecd37b54d8de9fe4ee9d238
diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx
index 4531164..a3e3b91 100644
--- a/vcl/unx/gtk/window/gtksalframe.cxx
+++ b/vcl/unx/gtk/window/gtksalframe.cxx
@@ -628,7 +628,7 @@ static const GActionEntry app_entries[] = {
gboolean ensure_dbus_setup( gpointer data )
{
GtkSalFrame* pSalFrame = reinterpret_cast< GtkSalFrame* >( data );
- GdkWindow* gdkWindow = gtk_widget_get_window( pSalFrame->getWindow() );
+ GdkWindow* gdkWindow = widget_get_window( pSalFrame->getWindow() );
if ( gdkWindow != NULL && g_object_get_data( G_OBJECT( gdkWindow ), "g-lo-menubar" ) == NULL )
{
@@ -2312,7 +2312,7 @@ void GtkSalFrame::SetScreen( unsigned int nNewScreen, int eType, Rectangle *pSiz
#endif
{
#if GTK_CHECK_VERSION(3,8,0)
- gdk_window_set_fullscreen_mode( gtk_widget_get_window(m_pWindow), m_bSpanMonitorsWhenFullscreen
+ gdk_window_set_fullscreen_mode( widget_get_window(m_pWindow), m_bSpanMonitorsWhenFullscreen
? GDK_FULLSCREEN_ON_ALL_MONITORS : GDK_FULLSCREEN_ON_CURRENT_MONITOR );
#endif
if( eType == SET_FULLSCREEN )
@@ -3560,7 +3560,7 @@ gboolean GtkSalFrame::signalMap( GtkWidget *pWidget, GdkEvent*, gpointer frame )
//window to span all displays.
if (pThis->m_bFullscreen && pThis->m_bSpanMonitorsWhenFullscreen)
{
- GdkWindow* gdkwin = gtk_widget_get_window(pThis->m_pWindow);
+ GdkWindow* gdkwin = widget_get_window(pThis->m_pWindow);
if (gdkwin)
{
OUString sProgramURL( "$BRAND_BASE_DIR/" LIBO_LIBEXEC_FOLDER "/xid-fullscreen-on-all-monitors");
commit f2bdfdb2952b4ef6064be65130242fbabb71f885
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Oct 18 20:35:37 2013 +0100
Related: fdo#38838 remove String::Replace
Change-Id: Ia6602809a65db0a7dcfef80cc474aab67d520980
diff --git a/include/tools/string.hxx b/include/tools/string.hxx
index 99d5f4a..6c73882 100644
--- a/include/tools/string.hxx
+++ b/include/tools/string.hxx
@@ -107,7 +107,6 @@ private:
StringCompare CompareTo( const UniString& rStr,
xub_StrLen nLen = STRING_LEN ) const;
- UniString& Erase( xub_StrLen nIndex = 0, xub_StrLen nCount = STRING_LEN );
UniString( const int* pDummy ); // not implemented: to prevent UniString( NULL )
UniString(int); // not implemented; to detect misuses of
@@ -222,7 +221,6 @@ public:
UniString& Insert( const UniString& rStr, xub_StrLen nPos, xub_StrLen nLen,
xub_StrLen nIndex = STRING_LEN );
UniString& Insert( sal_Unicode c, xub_StrLen nIndex = STRING_LEN );
- UniString& Replace( xub_StrLen nIndex, xub_StrLen nLen, const UniString& rStr );
UniString Copy( xub_StrLen nIndex = 0, xub_StrLen nCount = STRING_LEN ) const;
sal_Bool Equals( const UniString& rStr ) const;
diff --git a/tools/source/string/strimp.cxx b/tools/source/string/strimp.cxx
index 6b0c401..99a2778 100644
--- a/tools/source/string/strimp.cxx
+++ b/tools/source/string/strimp.cxx
@@ -244,98 +244,6 @@ STRING& STRING::Insert( const STRING& rStr, xub_StrLen nIndex )
return *this;
}
-STRING& STRING::Replace( xub_StrLen nIndex, xub_StrLen nCount, const STRING& rStr )
-{
- DBG_CHKTHIS( STRING, DBGCHECKSTRING );
- DBG_CHKOBJ( &rStr, STRING, DBGCHECKSTRING );
-
- // Append if index > current length
- if ( nIndex >= mpData->mnLen )
- {
- Append( rStr );
- return *this;
- }
-
- // assign if index = 0 and length >= stringlen
- if ( (nIndex == 0) && (nCount >= mpData->mnLen) )
- {
- Assign( rStr );
- return *this;
- }
-
- // Use erase if replacestring is empty
- sal_Int32 nStrLen = rStr.mpData->mnLen;
- if ( !nStrLen )
- return Erase( nIndex, nCount );
-
- // Adjust nCount if it's larger than the string
- if ( nCount > mpData->mnLen - nIndex )
- nCount = static_cast< xub_StrLen >(mpData->mnLen-nIndex);
-
- if ( !nCount )
- return Insert( rStr, nIndex );
-
- // Use character-based assignment if length is equal
- if ( nCount == nStrLen )
- {
- ImplCopyData();
- memcpy( mpData->maStr+nIndex, rStr.mpData->maStr, nCount*sizeof( STRCODE ) );
- return *this;
- }
-
- // detect overflow
- nStrLen = ImplGetCopyLen( mpData->mnLen-nCount, nStrLen );
-
- // allocate string of new size
- STRINGDATA* pNewData = ImplAllocData( mpData->mnLen-nCount+nStrLen );
-
- // copy string
- memcpy( pNewData->maStr, mpData->maStr, nIndex*sizeof( STRCODE ) );
- memcpy( pNewData->maStr+nIndex, rStr.mpData->maStr, nStrLen*sizeof( STRCODE ) );
- memcpy( pNewData->maStr+nIndex+nStrLen, mpData->maStr+nIndex+nCount,
- (mpData->mnLen-nIndex-nCount+1)*sizeof( STRCODE ) );
-
- // free old string
- STRING_RELEASE((STRING_TYPE *)mpData);
- mpData = pNewData;
-
- return *this;
-}
-
-STRING& STRING::Erase( xub_StrLen nIndex, xub_StrLen nCount )
-{
- DBG_CHKTHIS( STRING, DBGCHECKSTRING );
-
- // Return if index outside string or count = 0
- if ( (nIndex >= mpData->mnLen) || !nCount )
- return *this;
-
- // Adjust nCount if it's larger than the string
- if ( nCount > mpData->mnLen - nIndex )
- nCount = static_cast< xub_StrLen >(mpData->mnLen-nIndex);
-
- if ( mpData->mnLen - nCount )
- {
- // allocate string of new size
- STRINGDATA* pNewData = ImplAllocData( mpData->mnLen-nCount );
-
- // copy string
- memcpy( pNewData->maStr, mpData->maStr, nIndex*sizeof( STRCODE ) );
- memcpy( pNewData->maStr+nIndex, mpData->maStr+nIndex+nCount,
- (mpData->mnLen-nIndex-nCount+1)*sizeof( STRCODE ) );
-
- // free old string
- STRING_RELEASE((STRING_TYPE *)mpData);
- mpData = pNewData;
- }
- else
- {
- STRING_NEW((STRING_TYPE **)&mpData);
- }
-
- return *this;
-}
-
xub_StrLen STRING::Search( STRCODE c, xub_StrLen nIndex ) const
{
DBG_CHKTHIS( STRING, DBGCHECKSTRING );
More information about the Libreoffice-commits
mailing list