[Libreoffice-commits] core.git: 3 commits - sd/source svx/source
Ivan Timofeev
timofeev.i.s at gmail.com
Sat Sep 14 09:03:47 PDT 2013
sd/source/core/drawdoc3.cxx | 85 ++++++++++++++------------------------
sd/source/filter/html/htmlex.cxx | 3 -
sd/source/filter/html/pubdlg.cxx | 44 ++++++++-----------
sd/source/filter/sdpptwrp.cxx | 2
sd/source/filter/xml/sdxmlwrp.cxx | 4 -
svx/source/tbxctrls/tbcontrl.cxx | 2
6 files changed, 59 insertions(+), 81 deletions(-)
New commits:
commit 1d0e18703523139e5fd6d11b6f3d72bb0b368036
Author: Ivan Timofeev <timofeev.i.s at gmail.com>
Date: Sat Sep 14 09:16:28 2013 +0400
fdo#68874: Highlighter icon doesn't change color if no text is selected
the problem is that bChoiceFromPalette becomes false too early when StateChanged
is called with nSID=SID_ATTR_CHAR_COLOR_BACKGROUND_EXT (we don't handle it in the
switch) and the following call with nSID=SID_ATTR_CHAR_COLOR_BACKGROUND (which
we actually want to handle) is no-op.
Change-Id: I024f6a443535411648bda44576e838c3d863e7de
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 9c6b63e..2a254065 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -2537,7 +2537,7 @@ void SvxColorExtToolBoxControl::StateChanged(
{
const SvxColorItem* pItem = 0;
- if ( bChoiceFromPalette )
+ if ( bChoiceFromPalette && nSID == GetSlotId() )
{
bChoiceFromPalette = sal_False;
switch( nSID )
commit 501dc6c1debaac98d7f5375bfff80a4709172297
Author: Ivan Timofeev <timofeev.i.s at gmail.com>
Date: Sun Sep 8 18:58:27 2013 +0400
String->OUString
Change-Id: Ic69c3372ebbcbd74e57082066221ee9ef0d49d22
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index 4f51b84..ec2fee2 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -147,7 +147,7 @@ static void lcl_IterateBookmarkPages( SdDrawDocument &rDoc, SdDrawDocument* pBoo
else
{
// fetch nPos'th entry from bookmark list, and determine master page
- String aBMPgName(rBookmarkList[nPos]);
+ OUString aBMPgName(rBookmarkList[nPos]);
sal_Bool bIsMasterPage;
sal_uInt16 nBMPage = pBookmarkDoc->GetPageByName( aBMPgName, bIsMasterPage );
@@ -183,7 +183,7 @@ SdDrawDocument* SdDrawDocument::OpenBookmarkDoc(SfxMedium& rMedium)
{
sal_Bool bOK = sal_True;
SdDrawDocument* pBookmarkDoc = NULL;
- String aBookmarkName = rMedium.GetName();
+ OUString aBookmarkName = rMedium.GetName();
const SfxFilter* pFilter = rMedium.GetFilter();
if ( !pFilter )
{
@@ -195,7 +195,7 @@ SdDrawDocument* SdDrawDocument::OpenBookmarkDoc(SfxMedium& rMedium)
{
bOK = sal_False;
}
- else if ( maBookmarkFile != aBookmarkName && aBookmarkName.Len() )
+ else if ( !aBookmarkName.isEmpty() && maBookmarkFile != aBookmarkName )
{
sal_Bool bCreateGraphicShell = pFilter->GetServiceName() == "com.sun.star.drawing.DrawingDocument";
sal_Bool bCreateImpressShell = pFilter->GetServiceName() == "com.sun.star.presentation.PresentationDocument";
@@ -222,7 +222,7 @@ SdDrawDocument* SdDrawDocument::OpenBookmarkDoc(SfxMedium& rMedium)
}
}
- DBG_ASSERT(aBookmarkName.Len(), "Empty document name!");
+ DBG_ASSERT(!aBookmarkName.isEmpty(), "Empty document name!");
if (!bOK)
{
@@ -281,17 +281,14 @@ sal_Bool SdDrawDocument::InsertBookmark(
else
{
SdDrawDocument* pBookmarkDoc = NULL;
- String aBookmarkName;
if (pBookmarkDocSh)
{
pBookmarkDoc = pBookmarkDocSh->GetDoc();
- aBookmarkName = pBookmarkDocSh->GetMedium()->GetName();
}
else if ( mxBookmarkDocShRef.Is() )
{
pBookmarkDoc = mxBookmarkDocShRef->GetDoc();
- aBookmarkName = maBookmarkFile;
}
else
bOK = sal_False;
@@ -300,10 +297,8 @@ sal_Bool SdDrawDocument::InsertBookmark(
for ( pIter = rBookmarkList.begin(); bOK && pIter != rBookmarkList.end() && !bInsertPages; ++pIter )
{
// Is there a page name in the bookmark list?
- String aBMPgName(*pIter);
sal_Bool bIsMasterPage;
-
- if( pBookmarkDoc->GetPageByName( aBMPgName, bIsMasterPage ) != SDRPAGE_NOTFOUND )
+ if( pBookmarkDoc->GetPageByName( *pIter, bIsMasterPage ) != SDRPAGE_NOTFOUND )
{
// Found the page
bInsertPages = sal_True;
@@ -368,7 +363,7 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
sal_uInt16 nReplacedStandardPages = 0;
SdDrawDocument* pBookmarkDoc = NULL;
- String aBookmarkName;
+ OUString aBookmarkName;
if (pBookmarkDocSh)
{
@@ -439,7 +434,7 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
pBMPage->GetUppBorder() != pRefPage->GetUppBorder() ||
pBMPage->GetLwrBorder() != pRefPage->GetLwrBorder())
{
- String aStr(SdResId(STR_SCALE_OBJECTS));
+ OUString aStr(SD_RESSTR(STR_SCALE_OBJECTS));
sal_uInt16 nBut = QueryBox( NULL, WB_YES_NO_CANCEL, aStr).Execute();
bScaleObjects = nBut == RET_YES;
@@ -459,7 +454,7 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
if( mpDocSh )
{
pUndoMgr = mpDocSh->GetUndoManager();
- pUndoMgr->EnterListAction(SD_RESSTR(STR_UNDO_INSERTPAGES), String());
+ pUndoMgr->EnterListAction(SD_RESSTR(STR_UNDO_INSERTPAGES), "");
}
//
@@ -482,7 +477,7 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
for ( pIter = aLayoutsToTransfer.begin(); pIter != aLayoutsToTransfer.end(); ++pIter )
{
SdStyleSheetVector aCreatedStyles;
- String layoutName = *pIter;
+ OUString layoutName = *pIter;
pStyleSheetPool->CopyLayoutSheets(layoutName, *pBookmarkStyleSheetPool,aCreatedStyles);
@@ -532,7 +527,7 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
for (nBMSdPage=0; nBMSdPage < nBMSdPageCount; nBMSdPage++)
{
SdPage* pBMPage = pBookmarkDoc->GetSdPage(nBMSdPage, PK_STANDARD);
- String sName( pBMPage->GetName() );
+ OUString sName(pBMPage->GetName());
sal_Bool bIsMasterPage;
if (bLink)
@@ -570,13 +565,13 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
{
// Page name already in use -> Use default name for default and
// notes page
- pPage->SetName(String());
- pNotesPage->SetName(String());
+ pPage->SetName(OUString());
+ pNotesPage->SetName(OUString());
}
if (bLink)
{
- String aName(aNameMap[nBMSdPage]);
+ OUString aName(aNameMap[nBMSdPage]);
// Assemble all link names
pPage->SetFileName(aBookmarkName);
@@ -605,7 +600,7 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
::std::vector<SdPage*> aBookmarkedPages (rBookmarkList.size(), NULL);
for ( size_t nPos = 0, n = rBookmarkList.size(); nPos < n; ++nPos)
{
- String aPgName(rBookmarkList[nPos]);
+ OUString aPgName(rBookmarkList[nPos]);
sal_Bool bIsMasterPage;
sal_uInt16 nBMPage = pBookmarkDoc->GetPageByName( aPgName, bIsMasterPage );
@@ -628,7 +623,7 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
// delay renaming *after* pages are copied (might destroy source otherwise)
// don't change name if source and dest model are the same!
// avoid renaming if replacing the same page
- String aPgName(rBookmarkList[nPos]);
+ OUString aPgName(rBookmarkList[nPos]);
sal_Bool bIsMasterPage;
sal_uInt16 nPageSameName = GetPageByName(aPgName, bIsMasterPage);
if( pBookmarkDoc != this &&
@@ -668,9 +663,9 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
// Page name already in use -> use default name for default and
// notes page
SdPage* pPage = (SdPage*) GetPage(nActualInsertPos);
- pPage->SetName(String());
+ pPage->SetName(OUString());
SdPage* pNotesPage = (SdPage*) GetPage(nActualInsertPos+1);
- pNotesPage->SetName(String());
+ pNotesPage->SetName(OUString());
}
if (bLink)
@@ -753,14 +748,14 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
for (sal_uInt16 nPage = nNewMPageCount - 1; nPage >= nMPageCount; nPage--)
{
pRefPage = (SdPage*) GetMasterPage(nPage);
- String aMPLayout(pRefPage->GetLayoutName());
+ OUString aMPLayout(pRefPage->GetLayoutName());
PageKind eKind = pRefPage->GetPageKind();
// Does this already exist?
for (sal_uInt16 nTest = 0; nTest < nMPageCount; nTest++)
{
SdPage* pTest = (SdPage*) GetMasterPage(nTest);
- String aTest(pTest->GetLayoutName());
+ OUString aTest(pTest->GetLayoutName());
// nInsertPos > 2 is always true when inserting into non-empty models
if ( nInsertPos > 2 &&
@@ -807,7 +802,7 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
if (pExchangeList && pExchangeIter != pExchangeList->end())
{
// Get the name to use from Exchange list
- String aExchangeName (*pExchangeIter);
+ OUString aExchangeName(*pExchangeIter);
pRefPage->SetName(aExchangeName);
SdrHint aHint(HINT_PAGEORDERCHG);
aHint.SetPage(pRefPage);
@@ -930,21 +925,14 @@ sal_Bool SdDrawDocument::InsertBookmarkAsObject(
::sd::View* pBMView = NULL;
SdDrawDocument* pBookmarkDoc = NULL;
- String aBookmarkName;
if (pBookmarkDocSh)
{
pBookmarkDoc = pBookmarkDocSh->GetDoc();
-
- if (pBookmarkDocSh->GetMedium())
- {
- aBookmarkName = pBookmarkDocSh->GetMedium()->GetName();
- }
}
else if ( mxBookmarkDocShRef.Is() )
{
pBookmarkDoc = mxBookmarkDocShRef->GetDoc();
- aBookmarkName = maBookmarkFile;
}
else
{
@@ -966,9 +954,7 @@ sal_Bool SdDrawDocument::InsertBookmarkAsObject(
for ( pIter = rBookmarkList.begin(); pIter != rBookmarkList.end(); ++pIter )
{
// Get names of bookmarks from the list
- String aBMName (*pIter);
-
- SdrObject* pObj = pBookmarkDoc->GetObj(aBMName);
+ SdrObject* pObj = pBookmarkDoc->GetObj(*pIter);
if (pObj)
{
@@ -1078,11 +1064,9 @@ sal_Bool SdDrawDocument::InsertBookmarkAsObject(
// Get the name to use from the Exchange list
if (pIter != rExchangeList.end())
{
- String aExchangeName (*pIter);
-
if (pPage->GetObj(nObj))
{
- pPage->GetObj(nObj)->SetName(aExchangeName);
+ pPage->GetObj(nObj)->SetName(*pIter);
}
++pIter;
@@ -1105,7 +1089,7 @@ void SdDrawDocument::CloseBookmarkDoc()
}
mxBookmarkDocShRef.Clear();
- maBookmarkFile = String();
+ maBookmarkFile = "";
}
// Is this document read-only?
@@ -1300,9 +1284,9 @@ void SdDrawDocument::RemoveUnnecessaryMasterPages(SdPage* pMasterPage, sal_Bool
* If rLayoutName is empty, the first master page is used.
*/
// #i121863# factored out functionality
-bool isMasterPageLayoutNameUnique(const SdDrawDocument& rDoc, const String& rCandidate)
+bool isMasterPageLayoutNameUnique(const SdDrawDocument& rDoc, const OUString& rCandidate)
{
- if(!rCandidate.Len())
+ if (rCandidate.isEmpty())
{
return false;
}
@@ -1312,8 +1296,8 @@ bool isMasterPageLayoutNameUnique(const SdDrawDocument& rDoc, const String& rCan
for(sal_uInt16 a(0); a < nPageCount; a++)
{
const SdrPage* pCandidate = rDoc.GetMasterPage(a);
- String aPageLayoutName(pCandidate->GetLayoutName());
- aPageLayoutName.Erase(aPageLayoutName.SearchAscii(SD_LT_SEPARATOR));
+ OUString aPageLayoutName(pCandidate->GetLayoutName());
+ aPageLayoutName = aPageLayoutName.copy(0, aPageLayoutName.indexOf(SD_LT_SEPARATOR));
if(aPageLayoutName == rCandidate)
{
@@ -1325,13 +1309,13 @@ bool isMasterPageLayoutNameUnique(const SdDrawDocument& rDoc, const String& rCan
}
// #i121863# factored out functinality
-String createNewMasterPageLayoutName(const SdDrawDocument& rDoc)
+OUString createNewMasterPageLayoutName(const SdDrawDocument& rDoc)
{
const String aBaseName(SdResId(STR_LAYOUT_DEFAULT_NAME));
- String aRetval;
+ OUString aRetval;
sal_uInt16 nCount(0);
- while(!aRetval.Len())
+ while (aRetval.isEmpty())
{
aRetval = aBaseName;
@@ -1344,7 +1328,7 @@ String createNewMasterPageLayoutName(const SdDrawDocument& rDoc)
if(!isMasterPageLayoutNameUnique(rDoc, aRetval))
{
- aRetval.Erase();
+ aRetval = "";
}
}
@@ -1744,9 +1728,7 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
{
// Find a new name for the layout
OUString aName(createNewMasterPageLayoutName(*this));
- String aPageLayoutName(aName);
- aPageLayoutName.AppendAscii( SD_LT_SEPARATOR );
- aPageLayoutName += SD_RESSTR(STR_LAYOUT_OUTLINE);
+ OUString aPageLayoutName(aName + SD_LT_SEPARATOR + SD_RESSTR(STR_LAYOUT_OUTLINE));
// Generate new stylesheets
static_cast<SdStyleSheetPool*>( mxStyleSheetPool.get())->CreateLayoutStyleSheets(aName);
@@ -1804,8 +1786,7 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
for (sal_uInt16 nPage = 1; nPage < GetPageCount(); nPage++)
{
pPage = (SdPage*) GetPage(nPage);
- const String s(pPage->GetLayoutName());
- if(s == aOldPageLayoutName)
+ if (pPage->GetLayoutName() == aOldPageLayoutName)
{
aPageList.push_back(pPage);
}
commit cc750edbd7b80e570e307522392dbb2a8c0065cc
Author: Ivan Timofeev <timofeev.i.s at gmail.com>
Date: Sun Sep 8 17:53:08 2013 +0400
String->OUString
Change-Id: Id1f2035979ab567020aa51e0368d3e77c4db007e
diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx
index d94a761..356a56d 100644
--- a/sd/source/filter/html/htmlex.cxx
+++ b/sd/source/filter/html/htmlex.cxx
@@ -2790,7 +2790,8 @@ OUString HtmlExport::StringToHTMLString( const OUString& rString )
SvMemoryStream aMemStm;
HTMLOutFuncs::Out_String( aMemStm, rString, RTL_TEXTENCODING_UTF8 );
aMemStm << (char) 0;
- return String( (char*)aMemStm.GetData(), RTL_TEXTENCODING_UTF8 );
+ sal_Int32 nLength = strlen((char*)aMemStm.GetData());
+ return OUString( (char*)aMemStm.GetData(), nLength, RTL_TEXTENCODING_UTF8 );
}
// =====================================================================
diff --git a/sd/source/filter/html/pubdlg.cxx b/sd/source/filter/html/pubdlg.cxx
index b6a8050..26acda2 100644
--- a/sd/source/filter/html/pubdlg.cxx
+++ b/sd/source/filter/html/pubdlg.cxx
@@ -83,14 +83,14 @@ const char* aPageHelpIds[NOOFPAGES] =
class SdPublishingDesign
{
public:
- String m_aDesignName;
+ OUString m_aDesignName;
HtmlPublishMode m_eMode;
// special WebCast options
PublishingScript m_eScript;
- String m_aCGI;
- String m_aURL;
+ OUString m_aCGI;
+ OUString m_aURL;
// special Kiosk options
sal_Bool m_bAutoSlide;
@@ -103,16 +103,16 @@ public:
// misc options
sal_uInt16 m_nResolution;
- String m_aCompression;
+ OUString m_aCompression;
PublishingFormat m_eFormat;
sal_Bool m_bSlideSound;
sal_Bool m_bHiddenSlides;
// titel page information
- String m_aAuthor;
- String m_aEMail;
- String m_aWWW;
- String m_aMisc;
+ OUString m_aAuthor;
+ OUString m_aEMail;
+ OUString m_aWWW;
+ OUString m_aMisc;
sal_Bool m_bDownload;
sal_Bool m_bCreated; // not used
@@ -143,19 +143,17 @@ SdPublishingDesign::SdPublishingDesign()
m_eFormat = FORMAT_PNG;
- String aFilterConfigPath( "Office.Common/Filter/Graphic/Export/JPG" );
- FilterConfigItem aFilterConfigItem( aFilterConfigPath );
+ FilterConfigItem aFilterConfigItem("Office.Common/Filter/Graphic/Export/JPG");
sal_Int32 nCompression = aFilterConfigItem.ReadInt32( OUString( KEY_QUALITY ), 75 );
- m_aCompression = OUString::number( nCompression );
- m_aCompression.Append( sal_Unicode('%') );
+ m_aCompression = OUString::number(nCompression) + "%";
SvtUserOptions aUserOptions;
m_nResolution = PUB_LOWRES_WIDTH;
m_aAuthor = aUserOptions.GetFirstName();
- if( m_aAuthor.Len() && !aUserOptions.GetLastName().isEmpty() )
- m_aAuthor += sal_Unicode(' ');
- m_aAuthor += (String)aUserOptions.GetLastName();
+ if (!m_aAuthor.isEmpty() && !aUserOptions.GetLastName().isEmpty())
+ m_aAuthor += " ";
+ m_aAuthor += aUserOptions.GetLastName();
m_aEMail = aUserOptions.GetEmail();
m_bDownload = sal_False;
m_nButtonThema = -1;
@@ -357,9 +355,9 @@ private:
CancelButton m_aBtnCancel;
public:
- SdDesignNameDlg(Window* pWindow, const String& aName );
+ SdDesignNameDlg(Window* pWindow, const OUString& aName );
- String GetDesignName();
+ OUString GetDesignName();
DECL_LINK(ModifyHdl, void *);
};
@@ -411,9 +409,7 @@ SdPublishingDlg::SdPublishingDlg(Window* pWindow, DocumentType eDocType)
pPage2_ASP->SetClickHdl(LINK(this,SdPublishingDlg,WebServerHdl));
pPage2_PERL->SetClickHdl(LINK(this,SdPublishingDlg,WebServerHdl));
- String aText( OUString("index") );
- aText += SD_RESSTR(STR_HTMLEXP_DEFAULT_EXTENSION);
- pPage2_Index->SetText(aText);
+ pPage2_Index->SetText("index" + SD_RESSTR(STR_HTMLEXP_DEFAULT_EXTENSION));
pPage2_CGI->SetText( OUString( "/cgi-bin/" ) );
pPage3_Png->SetClickHdl(LINK(this,SdPublishingDlg, GfxFormatHdl));
@@ -1120,7 +1116,7 @@ IMPL_LINK_NOARG(SdPublishingDlg, FinishHdl)
if(bSave)
{
- String aName;
+ OUString aName;
if(m_pDesign)
aName = m_pDesign->m_aDesignName;
@@ -1585,7 +1581,7 @@ sal_Bool SdPublishingDlg::Save()
}
// SdDesignNameDlg Methods
-SdDesignNameDlg::SdDesignNameDlg(Window* pWindow, const String& aName):
+SdDesignNameDlg::SdDesignNameDlg(Window* pWindow, const OUString& aName):
ModalDialog (pWindow, SdResId( DLG_DESIGNNAME )),
m_aEdit (this, SdResId(EDT_NAME)),
m_aBtnOK (this, SdResId(BTN_SAVE)),
@@ -1594,10 +1590,10 @@ SdDesignNameDlg::SdDesignNameDlg(Window* pWindow, const String& aName):
FreeResource();
m_aEdit.SetModifyHdl(LINK(this, SdDesignNameDlg, ModifyHdl ));
m_aEdit.SetText(aName);
- m_aBtnOK.Enable(aName.Len() != 0);
+ m_aBtnOK.Enable(!aName.isEmpty());
}
-String SdDesignNameDlg::GetDesignName()
+OUString SdDesignNameDlg::GetDesignName()
{
return m_aEdit.GetText();
}
diff --git a/sd/source/filter/sdpptwrp.cxx b/sd/source/filter/sdpptwrp.cxx
index f70b12a..784bb0b 100644
--- a/sd/source/filter/sdpptwrp.cxx
+++ b/sd/source/filter/sdpptwrp.cxx
@@ -90,7 +90,7 @@ sal_Bool SdPPTFilter::Import()
/* check if there is a dualstorage, then the
document is propably a PPT95 containing PPT97 */
SvStorageRef xDualStorage;
- String sDualStorage( "PP97_DUALSTORAGE" );
+ OUString sDualStorage( "PP97_DUALSTORAGE" );
if ( pStorage->IsContained( sDualStorage ) )
{
xDualStorage = pStorage->OpenSotStorage( sDualStorage, STREAM_STD_READ );
diff --git a/sd/source/filter/xml/sdxmlwrp.cxx b/sd/source/filter/xml/sdxmlwrp.cxx
index ba216c8..5a3fc8d 100644
--- a/sd/source/filter/xml/sdxmlwrp.cxx
+++ b/sd/source/filter/xml/sdxmlwrp.cxx
@@ -196,7 +196,7 @@ SdXMLFilter::~SdXMLFilter(void)
sal_Int32 ReadThroughComponent(
Reference<io::XInputStream> xInputStream,
Reference<XComponent> xModelComponent,
- const String& rStreamName,
+ const OUString& rStreamName,
Reference<uno::XComponentContext> & rxContext,
const sal_Char* pFilterName,
Sequence<Any> rFilterArguments,
@@ -273,7 +273,7 @@ sal_Int32 ReadThroughComponent(
sErr += ",";
sErr += OUString::number( r.ColumnNumber );
- if( rStreamName.Len() )
+ if (!rStreamName.isEmpty())
{
return *new TwoStringErrorInfo(
(bMustBeSuccessfull ? ERR_FORMAT_FILE_ROWCOL
More information about the Libreoffice-commits
mailing list