r20949 by craig -
scribus-commit
scribus-commit at lists.scribus.net
Tue Feb 9 16:44:17 UTC 2016
Author: craig
Date: Tue Feb 9 16:44:17 2016
New Revision: 20949
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20949
Log:
coverity #1350539: Big parameter passed by value
Modified:
trunk/Scribus/scribus/third_party/rtf-qt/AbstractRtfOutput.h
trunk/Scribus/scribus/third_party/rtf-qt/sladocumentrtfoutput.cpp
trunk/Scribus/scribus/third_party/rtf-qt/sladocumentrtfoutput.h
Modified: trunk/Scribus/scribus/third_party/rtf-qt/AbstractRtfOutput.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20949&path=/trunk/Scribus/scribus/third_party/rtf-qt/AbstractRtfOutput.h
==============================================================================
--- trunk/Scribus/scribus/third_party/rtf-qt/AbstractRtfOutput.h (original)
+++ trunk/Scribus/scribus/third_party/rtf-qt/AbstractRtfOutput.h Tue Feb 9 16:44:17 2016
@@ -314,7 +314,7 @@
virtual void addTabStop( const int value, const int type ) = 0;
virtual void appendToColourTable( const QColor &colour ) = 0;
virtual void insertFontTableEntry( FontTableEntry fontTableEntry, quint32 fontTableIndex ) = 0;
- virtual void insertStyleSheetTableEntry( quint32 stylesheetTableIndex, ParagraphStyle stylesheetTableEntry ) = 0;
+ virtual void insertStyleSheetTableEntry( quint32 stylesheetTableIndex, const ParagraphStyle& stylesheetTableEntry ) = 0;
virtual void resolveStyleSheetParents(QHash<quint32, int> &parentSet) = 0;
virtual void useStyleSheetTableEntry(const int styleIndex) = 0;
Modified: trunk/Scribus/scribus/third_party/rtf-qt/sladocumentrtfoutput.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20949&path=/trunk/Scribus/scribus/third_party/rtf-qt/sladocumentrtfoutput.cpp
==============================================================================
--- trunk/Scribus/scribus/third_party/rtf-qt/sladocumentrtfoutput.cpp (original)
+++ trunk/Scribus/scribus/third_party/rtf-qt/sladocumentrtfoutput.cpp Tue Feb 9 16:44:17 2016
@@ -434,29 +434,28 @@
}
- void SlaDocumentRtfOutput::insertStyleSheetTableEntry(quint32 stylesheetTableIndex, ParagraphStyle stylesheetTableEntry)
- {
- QString newName = stylesheetTableEntry.name();
+ void SlaDocumentRtfOutput::insertStyleSheetTableEntry(quint32 stylesheetTableIndex, const ParagraphStyle& stylesheetTableEntry)
+ {
+ ParagraphStyle pStyle(stylesheetTableEntry);
if (m_prefixName)
- newName = m_item->itemName() + "_" + stylesheetTableEntry.name();
- stylesheetTableEntry.setName(newName);
- if (stylesheetTableEntry.charStyle().fontVariant() != "")
- {
- int fontInd = stylesheetTableEntry.charStyle().fontVariant().toInt();
- stylesheetTableEntry.charStyle().setFontVariant("");
+ pStyle.setName(m_item->itemName() + "_" + stylesheetTableEntry.name());
+ if (pStyle.charStyle().fontVariant() != "")
+ {
+ int fontInd = pStyle.charStyle().fontVariant().toInt();
+ pStyle.charStyle().setFontVariant("");
if (m_fontTable.contains(fontInd))
{
FontTableEntry fontTableEntry = m_fontTable[fontInd];
QString fontName = getFontName(fontTableEntry.fontName());
- stylesheetTableEntry.charStyle().setFont(PrefsManager::instance()->appPrefs.fontPrefs.AvailFonts[fontName]);
+ pStyle.charStyle().setFont(PrefsManager::instance()->appPrefs.fontPrefs.AvailFonts[fontName]);
fontTableEntry.setFontName(fontName);
m_fontTableReal.insert(fontInd, fontTableEntry);
}
}
StyleSet<ParagraphStyle>tmp;
- tmp.create(stylesheetTableEntry);
+ tmp.create(pStyle);
m_Doc->redefineStyles(tmp, false);
- m_stylesTable.insert(stylesheetTableIndex, stylesheetTableEntry);
+ m_stylesTable.insert(stylesheetTableIndex, pStyle);
}
void SlaDocumentRtfOutput::resolveStyleSheetParents(QHash<quint32, int> &parentSet)
Modified: trunk/Scribus/scribus/third_party/rtf-qt/sladocumentrtfoutput.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20949&path=/trunk/Scribus/scribus/third_party/rtf-qt/sladocumentrtfoutput.h
==============================================================================
--- trunk/Scribus/scribus/third_party/rtf-qt/sladocumentrtfoutput.h (original)
+++ trunk/Scribus/scribus/third_party/rtf-qt/sladocumentrtfoutput.h Tue Feb 9 16:44:17 2016
@@ -78,7 +78,7 @@
virtual void setTextDirectionRightToLeft();
virtual void appendToColourTable(const QColor &colour);
virtual void insertFontTableEntry(FontTableEntry fontTableEntry, quint32 fontTableIndex);
- virtual void insertStyleSheetTableEntry(quint32 stylesheetTableIndex, ParagraphStyle stylesheetTableEntry);
+ virtual void insertStyleSheetTableEntry(quint32 stylesheetTableIndex, const ParagraphStyle& stylesheetTableEntry);
virtual void resolveStyleSheetParents(QHash<quint32, int> &parentSet);
virtual void useStyleSheetTableEntry(const int styleIndex);
virtual void resetParagraphFormat();
More information about the scribus-commit
mailing list