[Libreoffice-commits] core.git: 9 commits - connectivity/source include/vcl starmath/inc starmath/source svx/source sw/source ucb/source unusedcode.easy vcl/source
Caolán McNamara
caolanm at redhat.com
Fri Oct 31 06:04:55 PDT 2014
connectivity/source/drivers/firebird/Blob.cxx | 56 +++++++++-
include/vcl/metaact.hxx | 3
starmath/inc/parse.hxx | 5
starmath/source/mathmlexport.cxx | 30 +++++
starmath/source/mathmlimport.cxx | 19 ++-
starmath/source/mathmlimport.hxx | 3
starmath/source/node.cxx | 56 ++++++++--
starmath/source/parse.cxx | 10 +
svx/source/dialog/imapwnd.cxx | 1
sw/source/core/inc/unoport.hxx | 4
sw/source/core/unocore/unoport.cxx | 138 ++++++++++++++------------
sw/source/filter/basflt/fltshell.cxx | 14 --
sw/source/filter/inc/fltshell.hxx | 1
ucb/source/cacher/cachedcontentresultset.cxx | 53 ++++++---
unusedcode.easy | 1
vcl/source/gdi/metaact.cxx | 6 -
vcl/source/gdi/pdfwriter_impl.cxx | 63 ++++++-----
vcl/source/gdi/virdev.cxx | 2
18 files changed, 307 insertions(+), 158 deletions(-)
New commits:
commit bfd4f64bbbdffd50817ad580be0e1e45f7623bb8
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Oct 31 11:46:36 2014 +0000
coverity#705257 gold, Missing break in switch
this is the image map window, I see that indeed toggling a shape
active/inactive in the image mapwindow makes it change layer
to the front for no good reason
Change-Id: If6556e8f21dee2b0f7c750d460490d4e03fc0c02
diff --git a/svx/source/dialog/imapwnd.cxx b/svx/source/dialog/imapwnd.cxx
index 6502ff6..0d39472 100644
--- a/svx/source/dialog/imapwnd.cxx
+++ b/svx/source/dialog/imapwnd.cxx
@@ -725,6 +725,7 @@ IMPL_LINK( IMapWindow, MenuSelectHdl, Menu*, pMenu )
SetCurrentObjState( bNewState );
UpdateInfo( false );
}
+ break;
case( MN_FRAME_TO_TOP ):
pView->PutMarkedToTop();
commit fe5840aab17e366749c373e4f8683e06e40b4b05
Author: Regina Henschel <regina at apache.org>
Date: Thu Oct 30 18:41:23 2014 +0000
Resolves: #i118191# Red is not red enough
Enable Math to use 16 basic HTML colors
Patch by: Regina Henschel <rb.henschel at t-online.de>
Found by: <lapsap7+ooo at gmail.com
(cherry picked from commit 529e59d90037748d0030191b93252e597935243e)
Conflicts:
starmath/inc/parse.hxx
starmath/source/mathmlimport.cxx
starmath/source/parse.cxx
Change-Id: I08de0ce33928ead3635a3a87c81671b4cc4112ac
diff --git a/starmath/inc/parse.hxx b/starmath/inc/parse.hxx
index d967be7..7f59def 100644
--- a/starmath/inc/parse.hxx
+++ b/starmath/inc/parse.hxx
@@ -103,10 +103,11 @@ enum SmTokenType
/*220*/ TWIDESLASH, TWIDEBACKSLASH, TLDBRACKET, TRDBRACKET, TNOSPACE,
/*225*/ TUNKNOWN, TDEBUG, TPRECEDES, TSUCCEEDS, TPRECEDESEQUAL,
/*230*/ TSUCCEEDSEQUAL, TPRECEDESEQUIV, TSUCCEEDSEQUIV, TNOTPRECEDES, TNOTSUCCEEDS,
-/*235*/ TINTD
+/*235*/ TSILVER, TGRAY, TMAROON, TPURPLE, TLIME,
+/*240*/ TOLIVE, TNAVY, TTEAL, TAQUA, TFUCHSIA,
+/*245*/ TINTD
};
-
struct SmToken
{
diff --git a/starmath/source/mathmlexport.cxx b/starmath/source/mathmlexport.cxx
index c55190b..a39bc03 100644
--- a/starmath/source/mathmlexport.cxx
+++ b/starmath/source/mathmlexport.cxx
@@ -1341,6 +1341,36 @@ void SmXMLExport::ExportFont(const SmNode *pNode, int nLevel)
case TYELLOW:
AddAttribute(XML_NAMESPACE_MATH, XML_COLOR, XML_YELLOW);
break;
+ case TSILVER:
+ AddAttribute(XML_NAMESPACE_MATH, XML_COLOR, XML_SILVER);
+ break;
+ case TGRAY:
+ AddAttribute(XML_NAMESPACE_MATH, XML_COLOR, XML_GRAY);
+ break;
+ case TMAROON:
+ AddAttribute(XML_NAMESPACE_MATH, XML_COLOR, XML_MAROON);
+ break;
+ case TOLIVE:
+ AddAttribute(XML_NAMESPACE_MATH, XML_COLOR, XML_OLIVE);
+ break;
+ case TLIME:
+ AddAttribute(XML_NAMESPACE_MATH, XML_COLOR, XML_LIME);
+ break;
+ case TAQUA:
+ AddAttribute(XML_NAMESPACE_MATH, XML_COLOR, XML_AQUA);
+ break;
+ case TTEAL:
+ AddAttribute(XML_NAMESPACE_MATH, XML_COLOR, XML_TEAL);
+ break;
+ case TNAVY:
+ AddAttribute(XML_NAMESPACE_MATH, XML_COLOR, XML_NAVY);
+ break;
+ case TFUCHSIA:
+ AddAttribute(XML_NAMESPACE_MATH, XML_COLOR, XML_FUCHSIA);
+ break;
+ case TPURPLE:
+ AddAttribute(XML_NAMESPACE_MATH, XML_COLOR, XML_PURPLE);
+ break;
case TSIZE:
{
const SmFontNode *pFontNode = static_cast<const SmFontNode *>(pNode);
diff --git a/starmath/source/mathmlimport.cxx b/starmath/source/mathmlimport.cxx
index 0ea7bc2..0a5ddb9 100644
--- a/starmath/source/mathmlimport.cxx
+++ b/starmath/source/mathmlimport.cxx
@@ -670,6 +670,9 @@ void SmXMLContext_Helper::RetrieveAttrs(const uno::Reference<
case XML_TOK_COLOR:
sColor = sValue;
break;
+ case XML_TOK_MATHCOLOR:
+ sColor = sValue;
+ break;
default:
break;
}
@@ -1896,6 +1899,7 @@ static const SvXMLTokenMapEntry aPresLayoutAttrTokenMap[] =
{ XML_NAMESPACE_MATH, XML_FONTSIZE, XML_TOK_FONTSIZE },
{ XML_NAMESPACE_MATH, XML_FONTFAMILY, XML_TOK_FONTFAMILY },
{ XML_NAMESPACE_MATH, XML_COLOR, XML_TOK_COLOR },
+ { XML_NAMESPACE_MATH, XML_MATHCOLOR, XML_TOK_MATHCOLOR },
XML_TOKEN_MAP_END
};
@@ -1953,15 +1957,20 @@ static const SvXMLTokenMapEntry aColorTokenMap[] =
{ XML_NAMESPACE_MATH, XML_RED, TRED},
{ XML_NAMESPACE_MATH, XML_GREEN, TGREEN},
{ XML_NAMESPACE_MATH, XML_BLUE, TBLUE},
- { XML_NAMESPACE_MATH, XML_AQUA, TCYAN},
- { XML_NAMESPACE_MATH, XML_FUCHSIA, TMAGENTA},
+ { XML_NAMESPACE_MATH, XML_AQUA, TAQUA},
+ { XML_NAMESPACE_MATH, XML_FUCHSIA, TFUCHSIA},
{ XML_NAMESPACE_MATH, XML_YELLOW, TYELLOW},
+ { XML_NAMESPACE_MATH, XML_NAVY, TNAVY},
+ { XML_NAMESPACE_MATH, XML_TEAL, TTEAL},
+ { XML_NAMESPACE_MATH, XML_MAROON, TMAROON},
+ { XML_NAMESPACE_MATH, XML_PURPLE, TPURPLE},
+ { XML_NAMESPACE_MATH, XML_OLIVE, TOLIVE},
+ { XML_NAMESPACE_MATH, XML_GRAY, TGRAY},
+ { XML_NAMESPACE_MATH, XML_SILVER, TSILVER},
+ { XML_NAMESPACE_MATH, XML_LIME, TLIME},
XML_TOKEN_MAP_END
};
-
-
-
const SvXMLTokenMap& SmXMLImport::GetPresLayoutElemTokenMap()
{
if (!pPresLayoutElemTokenMap)
diff --git a/starmath/source/mathmlimport.hxx b/starmath/source/mathmlimport.hxx
index 44e4ce1..f7326e7 100644
--- a/starmath/source/mathmlimport.hxx
+++ b/starmath/source/mathmlimport.hxx
@@ -297,7 +297,8 @@ enum SmXMLPresLayoutAttrTokenMap
XML_TOK_FONTSTYLE,
XML_TOK_FONTSIZE,
XML_TOK_FONTFAMILY,
- XML_TOK_COLOR
+ XML_TOK_COLOR,
+ XML_TOK_MATHCOLOR
};
diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx
index 06fdbf7..7c93b14 100644
--- a/starmath/source/node.cxx
+++ b/starmath/source/node.cxx
@@ -2015,12 +2015,6 @@ void SmAttributNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat)
ExtendBy(*pAttr, RCP_THIS, true);
}
-
-/**************************************************************************/
-
-
-
-
void SmFontNode::CreateTextFromNode(OUString &rText)
{
switch (GetToken().eType)
@@ -2092,6 +2086,36 @@ void SmFontNode::CreateTextFromNode(OUString &rText)
case TYELLOW:
rText += "color yellow ";
break;
+ case TTEAL:
+ rText += "color teal";
+ break;
+ case TSILVER:
+ rText += "color silver";
+ break;
+ case TGRAY:
+ rText += "color gray";
+ break;
+ case TMAROON:
+ rText += "color maroon";
+ break;
+ case TPURPLE:
+ rText += "color purple";
+ break;
+ case TLIME:
+ rText += "color lime";
+ break;
+ case TOLIVE:
+ rText += "color olive";
+ break;
+ case TNAVY:
+ rText += "color navy";
+ break;
+ case TAQUA:
+ rText += "color aqua";
+ break;
+ case TFUCHSIA:
+ rText += "color fuchsia";
+ break;
case TSANS:
rText += "font sans ";
break;
@@ -2107,7 +2131,6 @@ void SmFontNode::CreateTextFromNode(OUString &rText)
GetSubNode(1)->CreateTextFromNode(rText);
}
-
void SmFontNode::Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell)
{
//! prepare subnodes first
@@ -2132,7 +2155,6 @@ void SmFontNode::Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell)
Flags() |= FLG_FONT;
}
-
void SmFontNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat)
{
SmNode *pNode = GetSubNode(1);
@@ -2157,12 +2179,22 @@ void SmFontNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat)
case TBLACK : SetColor(Color(COL_BLACK)); break;
case TWHITE : SetColor(Color(COL_WHITE)); break;
- case TRED : SetColor(Color(COL_RED)); break;
+ case TRED : SetColor(Color(COL_LIGHTRED)); break;
case TGREEN : SetColor(Color(COL_GREEN)); break;
- case TBLUE : SetColor(Color(COL_BLUE)); break;
- case TCYAN : SetColor(Color(COL_CYAN)); break;
- case TMAGENTA : SetColor(Color(COL_MAGENTA)); break;
+ case TBLUE : SetColor(Color(COL_LIGHTBLUE)); break;
+ case TCYAN : SetColor(Color(COL_LIGHTCYAN)); break; // as in Calc
+ case TMAGENTA : SetColor(Color(COL_LIGHTMAGENTA)); break; // as in Calc
case TYELLOW : SetColor(Color(COL_YELLOW)); break;
+ case TTEAL : SetColor(Color(COL_CYAN)); break;
+ case TSILVER : SetColor(Color(COL_LIGHTGRAY)); break;
+ case TGRAY : SetColor(Color(COL_GRAY)); break;
+ case TMAROON : SetColor(Color(COL_RED)); break;
+ case TPURPLE : SetColor(Color(COL_MAGENTA)); break;
+ case TLIME : SetColor(Color(COL_LIGHTGREEN)); break;
+ case TOLIVE : SetColor(Color(COL_BROWN)); break;
+ case TNAVY : SetColor(Color(COL_BLUE)); break;
+ case TAQUA : SetColor(Color(COL_LIGHTCYAN)); break;
+ case TFUCHSIA : SetColor(Color(COL_LIGHTMAGENTA)); break;
default:
SAL_WARN("starmath", "unknown case");
diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx
index b7373f1..408612e 100644
--- a/starmath/source/parse.cxx
+++ b/starmath/source/parse.cxx
@@ -92,6 +92,7 @@ static const SmTokenTableEntry aTokenTable[] =
{ "alignt", TALIGNC, '\0', TGALIGN | TGDISCARDED, 0},
{ "and", TAND, MS_AND, TGPRODUCT, 0},
{ "approx", TAPPROX, MS_APPROX, TGRELATION, 0},
+ { "aqua", TAQUA, '\0', TGCOLOR, 0},
{ "arccos", TACOS, '\0', TGFUNCTION, 5},
{ "arccot", TACOT, '\0', TGFUNCTION, 5},
{ "arcsin", TASIN, '\0', TGFUNCTION, 5},
@@ -146,11 +147,13 @@ static const SmTokenTableEntry aTokenTable[] =
{ "font", TFONT, '\0', TGFONTATTR, 5},
{ "forall", TFORALL, MS_FORALL, TGSTANDALONE, 5},
{ "from", TFROM, '\0', TGLIMIT, 0},
+ { "fuchsia", TFUCHSIA, '\0', TGCOLOR, 0},
{ "func", TFUNC, '\0', TGFUNCTION, 5},
{ "ge", TGE, MS_GE, TGRELATION, 0},
{ "geslant", TGESLANT, MS_GESLANT, TGRELATION, 0 },
{ "gg", TGG, MS_GG, TGRELATION, 0},
{ "grave", TGRAVE, MS_GRAVE, TGATTRIBUT, 5},
+ { "gray", TGRAY, '\0', TGCOLOR, 0},
{ "green", TGREEN, '\0', TGCOLOR, 0},
{ "gt", TGT, MS_GT, TGRELATION, 0},
{ "hat", THAT, MS_HAT, TGATTRIBUT, 5},
@@ -177,6 +180,7 @@ static const SmTokenTableEntry aTokenTable[] =
{ "leslant", TLESLANT, MS_LESLANT, TGRELATION, 0 },
{ "lfloor", TLFLOOR, MS_LFLOOR, TGLBRACES, 5},
{ "lim", TLIM, '\0', TGOPER, 5},
+ { "lime", TLIME, '\0', TGCOLOR, 0},
{ "liminf", TLIMINF, '\0', TGOPER, 5},
{ "limsup", TLIMSUP, '\0', TGOPER, 5},
{ "lint", TLINT, MS_LINT, TGOPER, 5},
@@ -190,10 +194,12 @@ static const SmTokenTableEntry aTokenTable[] =
{ "lsup", TLSUP, '\0', TGPOWER, 0},
{ "lt", TLT, MS_LT, TGRELATION, 0},
{ "magenta", TMAGENTA, '\0', TGCOLOR, 0},
+ { "maroon", TMAROON, '\0', TGCOLOR, 0},
{ "matrix", TMATRIX, '\0', 0, 5},
{ "minusplus", TMINUSPLUS, MS_MINUSPLUS, TGUNOPER | TGSUM, 5},
{ "mline", TMLINE, MS_VERTLINE, 0, 0}, //! not in TGRBRACES, Level 0
{ "nabla", TNABLA, MS_NABLA, TGSTANDALONE, 5},
+ { "navy", TNAVY, '\0', TGCOLOR, 0},
{ "nbold", TNBOLD, '\0', TGFONTATTR, 5},
{ "ndivides", TNDIVIDES, MS_NDIVIDES, TGRELATION, 0},
{ "neg", TNEG, MS_NEG, TGUNOPER, 5 },
@@ -211,6 +217,7 @@ static const SmTokenTableEntry aTokenTable[] =
{ "nsupseteq", TNSUPSETEQ, MS_NSUPSETEQ, TGRELATION, 0 },
{ "odivide", TODIVIDE, MS_ODIVIDE, TGPRODUCT, 0},
{ "odot", TODOT, MS_ODOT, TGPRODUCT, 0},
+ { "olive", TOLIVE, '\0', TGCOLOR, 0},
{ "ominus", TOMINUS, MS_OMINUS, TGSUM, 0},
{ "oper", TOPER, '\0', TGOPER, 5},
{ "oplus", TOPLUS, MS_OPLUS, TGSUM, 0},
@@ -232,6 +239,7 @@ static const SmTokenTableEntry aTokenTable[] =
{ "nprec", TNOTPRECEDES, MS_NOTPRECEDES, TGRELATION, 0 },
{ "prod", TPROD, MS_PROD, TGOPER, 5},
{ "prop", TPROP, MS_PROP, TGRELATION, 0},
+ { "purple", TPURPLE, '\0', TGCOLOR, 0},
{ "rangle", TRANGLE, MS_RMATHANGLE, TGRBRACES, 0}, //! 0 to terminate expression
{ "rbrace", TRBRACE, MS_RBRACE, TGRBRACES, 0},
{ "rceil", TRCEIL, MS_RCEIL, TGRBRACES, 0},
@@ -252,6 +260,7 @@ static const SmTokenTableEntry aTokenTable[] =
{ "setR" , TSETR, MS_SETR, TGSTANDALONE, 5},
{ "setZ" , TSETZ, MS_SETZ, TGSTANDALONE, 5},
{ "setminus", TBACKSLASH, MS_BACKSLASH, TGPRODUCT, 0 },
+ { "silver", TSILVER, '\0', TGCOLOR, 0},
{ "sim", TSIM, MS_SIM, TGRELATION, 0},
{ "simeq", TSIMEQ, MS_SIMEQ, TGRELATION, 0},
{ "sin", TSIN, '\0', TGFUNCTION, 5},
@@ -273,6 +282,7 @@ static const SmTokenTableEntry aTokenTable[] =
{ "supseteq", TSUPSETEQ, MS_SUPSETEQ, TGRELATION, 0},
{ "tan", TTAN, '\0', TGFUNCTION, 5},
{ "tanh", TTANH, '\0', TGFUNCTION, 5},
+ { "teal", TTEAL, '\0', TGCOLOR, 0},
{ "tilde", TTILDE, MS_TILDE, TGATTRIBUT, 5},
{ "times", TTIMES, MS_TIMES, TGPRODUCT, 0},
{ "to", TTO, '\0', TGLIMIT, 0},
commit fa277f5952d719f0dbc880301343e6653548bd03
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Oct 31 09:24:53 2014 +0000
callcatcher: a titchy bit more ww1 filter fallout
Change-Id: I38517bb7fbf4ab1e9314a28973b707223d7120e7
diff --git a/include/vcl/metaact.hxx b/include/vcl/metaact.hxx
index 1aea53f..d75d5ec 100644
--- a/include/vcl/metaact.hxx
+++ b/include/vcl/metaact.hxx
@@ -89,10 +89,7 @@ public:
void Delete() { if ( 0 == --mnRefCount ) delete this; }
public:
- OUString GetTypeName() { return TypeName( mnType ); }
-
static MetaAction* ReadMetaAction( SvStream& rIStm, ImplMetaReadData* pData );
- static OUString TypeName( sal_uInt16 nType );
};
class VCL_DLLPUBLIC MetaPixelAction : public MetaAction
diff --git a/sw/source/filter/basflt/fltshell.cxx b/sw/source/filter/basflt/fltshell.cxx
index f94b802..5b94102 100644
--- a/sw/source/filter/basflt/fltshell.cxx
+++ b/sw/source/filter/basflt/fltshell.cxx
@@ -737,20 +737,6 @@ const SfxPoolItem* SwFltControlStack::GetOpenStackAttr(const SwPosition& rPos, s
return 0;
}
-const SfxPoolItem* SwFltControlStack::GetFmtAttr(const SwPosition& rPos, sal_uInt16 nWhich)
-{
- SfxPoolItem* pHt = GetFmtStackAttr(nWhich);
- if (pHt)
- return (const SfxPoolItem*)pHt;
-
- // the attribute does not exist on the stack; query the document
- SwCntntNode * pNd = rPos.nNode.GetNode().GetCntntNode();
-
- if (!pNd) // no ContentNode, take the default attribute
- return &pDoc->GetAttrPool().GetDefaultItem(nWhich);
- return &pNd->GetAttr(nWhich);
-}
-
void SwFltControlStack::Delete(const SwPaM &rPam)
{
const SwPosition *pStt = rPam.Start(), *pEnd = rPam.End();
diff --git a/sw/source/filter/inc/fltshell.hxx b/sw/source/filter/inc/fltshell.hxx
index 5ea953c..3738c19 100644
--- a/sw/source/filter/inc/fltshell.hxx
+++ b/sw/source/filter/inc/fltshell.hxx
@@ -186,7 +186,6 @@ public:
void KillUnlockedAttrs(const SwPosition& pPos);
SfxPoolItem* GetFmtStackAttr(sal_uInt16 nWhich, sal_uInt16 * pPos = 0);
const SfxPoolItem* GetOpenStackAttr(const SwPosition& rPos, sal_uInt16 nWhich);
- const SfxPoolItem* GetFmtAttr(const SwPosition& rPos, sal_uInt16 nWhich);
void Delete(const SwPaM &rPam);
bool empty() const { return maEntries.empty(); }
diff --git a/unusedcode.easy b/unusedcode.easy
index d1271ea..ad3ba9c 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -5,7 +5,6 @@ GDriveDocument::GDriveDocument(GDriveSession*)
GDriveFolder::GDriveFolder(GDriveSession*)
GDriveProperty::GDriveProperty()
GDriveSession::GDriveSession()
-MetaAction::TypeName(unsigned short)
OpenGLContext::renderToFile()
OpenGLRender::CreateTextTexture(rtl::OUString const&, vcl::Font, long, com::sun::star::awt::Point, com::sun::star::awt::Size, long)
OutputDevice::GetCanvas() const
diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index 365bd46..50b856b 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -273,12 +273,6 @@ MetaAction* MetaAction::ReadMetaAction( SvStream& rIStm, ImplMetaReadData* pData
return pAction;
}
-OUString MetaAction::TypeName( sal_uInt16 nType )
-{
- const char *name = meta_action_name( nType );
- return OUString( name, strlen( name ), RTL_TEXTENCODING_ASCII_US );
-}
-
MetaPixelAction::MetaPixelAction() :
MetaAction(META_PIXEL_ACTION)
{}
commit a19817c3cafb483fe69ca3a6bc08bb3733ed8a2a
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Oct 31 12:51:11 2014 +0000
coverity#1202803 Explicit null dereferenced
Change-Id: Ia914c4842e69b3ea57692f1f8ac52c321240b7c4
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index a33d7ac..4280bb1 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -6904,6 +6904,9 @@ bool PDFWriterImpl::emitAdditionalStreams()
checkAndEnableStreamEncryption( rStream.m_nStreamObject );
com::sun::star::uno::Reference< com::sun::star::io::XOutputStream > xStream( new PDFStreamIf( this ) );
+ assert(rStream.m_pStream);
+ if (!rStream.m_pStream)
+ return false;
rStream.m_pStream->write( xStream );
xStream.clear();
delete rStream.m_pStream;
commit b62e428bd1562414e5421804bedb22761432a5d1
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Oct 31 12:28:19 2014 +0000
coverity#1158395 Uncaught exception
and
coverity#1158394 Uncaught exception
Change-Id: I73430678c658202475e0073c3c9bde0a072c1ee9
diff --git a/connectivity/source/drivers/firebird/Blob.cxx b/connectivity/source/drivers/firebird/Blob.cxx
index 44cd33e..a531dfc 100644
--- a/connectivity/source/drivers/firebird/Blob.cxx
+++ b/connectivity/source/drivers/firebird/Blob.cxx
@@ -11,9 +11,10 @@
#include "Connection.hxx"
#include "Util.hxx"
-#include <connectivity/dbexception.hxx>
-
#include <com/sun/star/lang/IllegalArgumentException.hpp>
+#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
+#include <connectivity/dbexception.hxx>
+#include <cppuhelper/exc_hlp.hxx>
using namespace ::connectivity::firebird;
@@ -247,8 +248,31 @@ sal_Int32 SAL_CALL Blob::available()
throw (NotConnectedException, IOException, RuntimeException, std::exception)
{
MutexGuard aGuard(m_aMutex);
- checkDisposed(Blob_BASE::rBHelper.bDisposed);
- ensureBlobIsOpened();
+
+ try
+ {
+ checkDisposed(Blob_BASE::rBHelper.bDisposed);
+ ensureBlobIsOpened();
+ }
+ catch (const NotConnectedException&)
+ {
+ throw;
+ }
+ catch (const IOException&)
+ {
+ throw;
+ }
+ catch (const RuntimeException&)
+ {
+ throw;
+ }
+ catch (const Exception& e)
+ {
+ css::uno::Any a(cppu::getCaughtException());
+ throw css::lang::WrappedTargetRuntimeException(
+ "wrapped Exception " + e.Message,
+ css::uno::Reference<css::uno::XInterface>(), a);
+ }
return m_nBlobLength - m_nBlobPosition;
}
@@ -256,7 +280,29 @@ sal_Int32 SAL_CALL Blob::available()
void SAL_CALL Blob::closeInput()
throw(NotConnectedException, IOException, RuntimeException, std::exception)
{
- closeBlob();
+ try
+ {
+ closeBlob();
+ }
+ catch (const NotConnectedException&)
+ {
+ throw;
+ }
+ catch (const IOException&)
+ {
+ throw;
+ }
+ catch (const RuntimeException&)
+ {
+ throw;
+ }
+ catch (const Exception& e)
+ {
+ css::uno::Any a(cppu::getCaughtException());
+ throw css::lang::WrappedTargetRuntimeException(
+ "wrapped Exception " + e.Message,
+ css::uno::Reference<css::uno::XInterface>(), a);
+ }
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 0b32d9dcb86d3b5cc55c24634b39d29980f873a7
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Oct 31 12:12:41 2014 +0000
coverity#735346 Unchecked return value
Change-Id: Ic9aab232667a9b0a3a995d7b033b7ba508fd42dc
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 9242604..a33d7ac 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -2534,8 +2534,10 @@ OString PDFWriterImpl::emitStructureAttributes( PDFStructureElement& i_rEle )
aRef.append( " 0 R>>\n"
"endobj\n\n"
);
- updateObject( nRefObject );
- writeBuffer( aRef.getStr(), aRef.getLength() );
+ if (updateObject(nRefObject))
+ {
+ writeBuffer( aRef.getStr(), aRef.getLength() );
+ }
i_rEle.m_aKids.push_back( PDFStructureElementKid( nRefObject ) );
}
@@ -2573,38 +2575,44 @@ OString PDFWriterImpl::emitStructureAttributes( PDFStructureElement& i_rEle )
if( !aLayout.isEmpty() )
{
aAttribObjects.push_back( createObject() );
- updateObject( aAttribObjects.back() );
- OStringBuffer aObj( 64 );
- aObj.append( aAttribObjects.back() );
- aObj.append( " 0 obj\n"
- "<</O/Layout\n" );
- aLayout.append( ">>\nendobj\n\n" );
- writeBuffer( aObj.getStr(), aObj.getLength() );
- writeBuffer( aLayout.getStr(), aLayout.getLength() );
+ if (updateObject( aAttribObjects.back() ))
+ {
+ OStringBuffer aObj( 64 );
+ aObj.append( aAttribObjects.back() );
+ aObj.append( " 0 obj\n"
+ "<</O/Layout\n" );
+ aLayout.append( ">>\nendobj\n\n" );
+ writeBuffer( aObj.getStr(), aObj.getLength() );
+ writeBuffer( aLayout.getStr(), aLayout.getLength() );
+ }
}
if( !aList.isEmpty() )
{
aAttribObjects.push_back( createObject() );
- updateObject( aAttribObjects.back() );
- OStringBuffer aObj( 64 );
- aObj.append( aAttribObjects.back() );
- aObj.append( " 0 obj\n"
- "<</O/List\n" );
- aList.append( ">>\nendobj\n\n" );
- writeBuffer( aObj.getStr(), aObj.getLength() );
- writeBuffer( aList.getStr(), aList.getLength() );
+ if (updateObject( aAttribObjects.back() ))
+ {
+ OStringBuffer aObj( 64 );
+ aObj.append( aAttribObjects.back() );
+ aObj.append( " 0 obj\n"
+ "<</O/List\n" );
+ aList.append( ">>\nendobj\n\n" );
+ writeBuffer( aObj.getStr(), aObj.getLength() );
+ writeBuffer( aList.getStr(), aList.getLength() );
+ }
}
if( !aTable.isEmpty() )
{
aAttribObjects.push_back( createObject() );
- updateObject( aAttribObjects.back() );
- OStringBuffer aObj( 64 );
- aObj.append( aAttribObjects.back() );
- aObj.append( " 0 obj\n"
- "<</O/Table\n" );
- aTable.append( ">>\nendobj\n\n" );
- writeBuffer( aObj.getStr(), aObj.getLength() );
- writeBuffer( aTable.getStr(), aTable.getLength() );
+ if (updateObject( aAttribObjects.back() ))
+ {
+ OStringBuffer aObj( 64 );
+ aObj.append( aAttribObjects.back() );
+ aObj.append( " 0 obj\n"
+ "<</O/Table\n" );
+ aTable.append( ">>\nendobj\n\n" );
+ writeBuffer( aObj.getStr(), aObj.getLength() );
+ writeBuffer( aTable.getStr(), aTable.getLength() );
+ }
}
OStringBuffer aRet( 64 );
commit 1c5b25e680bb2f6ebbc90df6c8c9e4529948979e
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Oct 31 11:58:27 2014 +0000
coverity#707299 Uncaught exception
and
coverity#707301 Uncaught exception
Change-Id: I6b7b2a9910b8a7d563a08ce84ddf16f550d8818e
diff --git a/sw/source/core/inc/unoport.hxx b/sw/source/core/inc/unoport.hxx
index 294344f..d48156f 100644
--- a/sw/source/core/inc/unoport.hxx
+++ b/sw/source/core/inc/unoport.hxx
@@ -145,12 +145,12 @@ protected:
css::uno::Sequence<css::beans::GetDirectPropertyTolerantResult> SAL_CALL GetPropertyValuesTolerant_Impl(
const css::uno::Sequence< OUString >& rPropertyNames, bool bDirectValuesOnly )
- throw (css::beans::UnknownPropertyException, css::uno::RuntimeException);
+ throw (css::uno::RuntimeException, std::exception);
virtual ~SwXTextPortion();
//SwClient
- virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) SAL_OVERRIDE;
+ virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) SAL_OVERRIDE;
public:
SwXTextPortion(const SwUnoCrsr* pPortionCrsr, ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > const& rParent, SwTextPortionType eType );
diff --git a/sw/source/core/unocore/unoport.cxx b/sw/source/core/unocore/unoport.cxx
index 0aaf06a..7dbedf6 100644
--- a/sw/source/core/unocore/unoport.cxx
+++ b/sw/source/core/unocore/unoport.cxx
@@ -21,6 +21,7 @@
#include <cmdid.h>
#include <osl/mutex.hxx>
+#include <cppuhelper/exc_hlp.hxx>
#include <cppuhelper/interfacecontainer.h>
#include <vcl/svapp.hxx>
#include <svl/itemprop.hxx>
@@ -43,6 +44,7 @@
#include <com/sun/star/beans/SetPropertyTolerantFailed.hpp>
#include <com/sun/star/beans/GetPropertyTolerantResult.hpp>
#include <com/sun/star/beans/TolerantPropertySetResultType.hpp>
+#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
#include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
@@ -620,7 +622,7 @@ uno::Sequence< beans::GetDirectPropertyTolerantResult > SAL_CALL SwXTextPortion:
uno::Sequence< beans::GetDirectPropertyTolerantResult > SAL_CALL SwXTextPortion::GetPropertyValuesTolerant_Impl(
const uno::Sequence< OUString >& rPropertyNames,
bool bDirectValuesOnly )
- throw (beans::UnknownPropertyException, uno::RuntimeException)
+ throw (uno::RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
@@ -628,78 +630,94 @@ uno::Sequence< beans::GetDirectPropertyTolerantResult > SAL_CALL SwXTextPortion:
if(!pUnoCrsr)
throw uno::RuntimeException();
- sal_Int32 nProps = rPropertyNames.getLength();
- const OUString *pProp = rPropertyNames.getConstArray();
+ std::vector< beans::GetDirectPropertyTolerantResult > aResultVector;
- SfxItemSet *pSet = 0;
+ try
+ {
+ sal_Int32 nProps = rPropertyNames.getLength();
+ const OUString *pProp = rPropertyNames.getConstArray();
- const SfxItemPropertyMap& rPropMap = m_pPropSet->getPropertyMap();
+ SfxItemSet *pSet = 0;
- uno::Sequence< beans::PropertyState > aPropertyStates =
- SwUnoCursorHelper::GetPropertyStates(
- *pUnoCrsr, *m_pPropSet,
- rPropertyNames,
- SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION_TOLERANT );
- const beans::PropertyState* pPropertyStates = aPropertyStates.getConstArray();
+ const SfxItemPropertyMap& rPropMap = m_pPropSet->getPropertyMap();
- std::vector< beans::GetDirectPropertyTolerantResult > aResultVector;
- for (sal_Int32 i = 0; i < nProps; ++i)
- {
- beans::GetDirectPropertyTolerantResult aResult;
- try
+
+ uno::Sequence< beans::PropertyState > aPropertyStates =
+ SwUnoCursorHelper::GetPropertyStates(
+ *pUnoCrsr, *m_pPropSet,
+ rPropertyNames,
+ SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION_TOLERANT );
+ const beans::PropertyState* pPropertyStates = aPropertyStates.getConstArray();
+
+ for (sal_Int32 i = 0; i < nProps; ++i)
{
- aResult.Name = pProp[i];
- if(pPropertyStates[i] == beans::PropertyState_MAKE_FIXED_SIZE) // property unknown?
- {
- if( bDirectValuesOnly )
- continue;
- else
- aResult.Result = beans::TolerantPropertySetResultType::UNKNOWN_PROPERTY;
- }
- else
+ beans::GetDirectPropertyTolerantResult aResult;
+ try
{
- const SfxItemPropertySimpleEntry* pEntry = rPropMap.getByName( pProp[i] );
- if (!pEntry)
- throw beans::UnknownPropertyException( "Unknown property: " + pProp[i], static_cast < cppu::OWeakObject * > ( this ) );
- aResult.State = pPropertyStates[i];
-
- aResult.Result = beans::TolerantPropertySetResultType::UNKNOWN_FAILURE;
- //#i104499# ruby portion attributes need special handling:
- if( pEntry->nWID == RES_TXTATR_CJK_RUBY &&
- m_ePortionType == PORTION_RUBY_START )
+ aResult.Name = pProp[i];
+ if(pPropertyStates[i] == beans::PropertyState_MAKE_FIXED_SIZE) // property unknown?
{
- aResult.State = beans::PropertyState_DIRECT_VALUE;
+ if( bDirectValuesOnly )
+ continue;
+ else
+ aResult.Result = beans::TolerantPropertySetResultType::UNKNOWN_PROPERTY;
}
- if (!bDirectValuesOnly || beans::PropertyState_DIRECT_VALUE == aResult.State)
+ else
{
- // get property value
- // (compare to SwXTextPortion::getPropertyValue(s))
- GetPropertyValue( aResult.Value, *pEntry, pUnoCrsr, pSet );
- aResult.Result = beans::TolerantPropertySetResultType::SUCCESS;
- aResultVector.push_back( aResult );
+ const SfxItemPropertySimpleEntry* pEntry = rPropMap.getByName( pProp[i] );
+ if (!pEntry)
+ throw beans::UnknownPropertyException( "Unknown property: " + pProp[i], static_cast < cppu::OWeakObject * > ( this ) );
+ aResult.State = pPropertyStates[i];
+
+ aResult.Result = beans::TolerantPropertySetResultType::UNKNOWN_FAILURE;
+ //#i104499# ruby portion attributes need special handling:
+ if( pEntry->nWID == RES_TXTATR_CJK_RUBY &&
+ m_ePortionType == PORTION_RUBY_START )
+ {
+ aResult.State = beans::PropertyState_DIRECT_VALUE;
+ }
+ if (!bDirectValuesOnly || beans::PropertyState_DIRECT_VALUE == aResult.State)
+ {
+ // get property value
+ // (compare to SwXTextPortion::getPropertyValue(s))
+ GetPropertyValue( aResult.Value, *pEntry, pUnoCrsr, pSet );
+ aResult.Result = beans::TolerantPropertySetResultType::SUCCESS;
+ aResultVector.push_back( aResult );
+ }
}
}
+ catch (const beans::UnknownPropertyException &)
+ {
+ // should not occur because property was searched for before
+ OSL_FAIL( "unexpected exception caught" );
+ aResult.Result = beans::TolerantPropertySetResultType::UNKNOWN_PROPERTY;
+ }
+ catch (const lang::IllegalArgumentException &)
+ {
+ aResult.Result = beans::TolerantPropertySetResultType::ILLEGAL_ARGUMENT;
+ }
+ catch (const beans::PropertyVetoException &)
+ {
+ aResult.Result = beans::TolerantPropertySetResultType::PROPERTY_VETO;
+ }
+ catch (const lang::WrappedTargetException &)
+ {
+ aResult.Result = beans::TolerantPropertySetResultType::WRAPPED_TARGET;
+ }
}
- catch (beans::UnknownPropertyException &)
- {
- // should not occur because property was searched for before
- OSL_FAIL( "unexpected exception caught" );
- aResult.Result = beans::TolerantPropertySetResultType::UNKNOWN_PROPERTY;
- }
- catch (lang::IllegalArgumentException &)
- {
- aResult.Result = beans::TolerantPropertySetResultType::ILLEGAL_ARGUMENT;
- }
- catch (beans::PropertyVetoException &)
- {
- aResult.Result = beans::TolerantPropertySetResultType::PROPERTY_VETO;
- }
- catch (lang::WrappedTargetException &)
- {
- aResult.Result = beans::TolerantPropertySetResultType::WRAPPED_TARGET;
- }
+ delete pSet;
+ }
+ catch (const uno::RuntimeException&)
+ {
+ throw;
+ }
+ catch (const uno::Exception& e)
+ {
+ css::uno::Any a(cppu::getCaughtException());
+ throw css::lang::WrappedTargetRuntimeException(
+ "wrapped Exception " + e.Message,
+ css::uno::Reference<css::uno::XInterface>(), a);
}
- delete pSet;
uno::Sequence< beans::GetDirectPropertyTolerantResult > aResult( aResultVector.size() );
std::vector< beans::GetDirectPropertyTolerantResult >::const_iterator aIt = aResultVector.begin();
commit 9b5718284e22902641e76377cdc96f8399f8657e
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Oct 31 11:42:32 2014 +0000
coverity#707418 Uncaught exception
and
coverity#707419 Uncaught exception
coverity#707420 Uncaught exception
Change-Id: I98d752c14be5f7b1fccb4bdf2eeefb6bbfe12e0e
diff --git a/ucb/source/cacher/cachedcontentresultset.cxx b/ucb/source/cacher/cachedcontentresultset.cxx
index 954aa09..eedcc07 100644
--- a/ucb/source/cacher/cachedcontentresultset.cxx
+++ b/ucb/source/cacher/cachedcontentresultset.cxx
@@ -25,9 +25,11 @@
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/script/Converter.hpp>
#include <com/sun/star/sdbc/ResultSetType.hpp>
+#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
#include <rtl/ustring.hxx>
#include <osl/diagnose.h>
#include <comphelper/processfactory.hxx>
+#include <cppuhelper/exc_hlp.hxx>
#include <boost/scoped_ptr.hpp>
using namespace com::sun::star::beans;
@@ -1275,7 +1277,7 @@ void SAL_CALL CachedContentResultSet
// XContentAccess methods. ( inherited ) ( -- position dependent )
-#define XCONTENTACCESS_queryXXX( queryXXX, XXX, TYPE ) \
+#define XCONTENTACCESS_queryXXX( queryXXX, XXX, TYPE ) \
impl_EnsureNotDisposed(); \
ReacquireableGuard aGuard( m_aMutex ); \
sal_Int32 nRow = m_nRow; \
@@ -1283,33 +1285,46 @@ sal_Int32 nFetchSize = m_nFetchSize; \
sal_Int32 nFetchDirection = m_nFetchDirection; \
if( !m_aCache##XXX.hasRow( nRow ) ) \
{ \
- if( !m_aCache##XXX.hasCausedException( nRow ) ) \
-{ \
- if( !m_xFetchProviderForContentAccess.is() ) \
+ try \
+ { \
+ if( !m_aCache##XXX.hasCausedException( nRow ) ) \
{ \
- OSL_FAIL( "broadcaster was disposed already" );\
- throw RuntimeException(); \
+ if( !m_xFetchProviderForContentAccess.is() ) \
+ { \
+ OSL_FAIL( "broadcaster was disposed already" ); \
+ throw RuntimeException(); \
+ } \
+ aGuard.clear(); \
+ if( impl_isForwardOnly() ) \
+ applyPositionToOrigin( nRow ); \
+ \
+ FETCH_XXX( m_aCache##XXX, m_xFetchProviderForContentAccess, fetch##XXX##s ); \
} \
- aGuard.clear(); \
- if( impl_isForwardOnly() ) \
+ aGuard.reacquire(); \
+ if( !m_aCache##XXX.hasRow( nRow ) ) \
+ { \
+ aGuard.clear(); \
applyPositionToOrigin( nRow ); \
- \
- FETCH_XXX( m_aCache##XXX, m_xFetchProviderForContentAccess, fetch##XXX##s ); \
+ TYPE aRet = ContentResultSetWrapper::queryXXX();\
+ if( m_xContentIdentifierMapping.is() ) \
+ return m_xContentIdentifierMapping->map##XXX( aRet );\
+ return aRet; \
+ } \
+ } \
+ catch (const RuntimeException&) \
+ { \
+ throw; \
} \
- aGuard.reacquire(); \
- if( !m_aCache##XXX.hasRow( nRow ) ) \
+ catch (const Exception& e) \
{ \
- aGuard.clear(); \
- applyPositionToOrigin( nRow ); \
- TYPE aRet = ContentResultSetWrapper::queryXXX(); \
- if( m_xContentIdentifierMapping.is() ) \
- return m_xContentIdentifierMapping->map##XXX( aRet );\
- return aRet; \
+ Any a(cppu::getCaughtException()); \
+ throw WrappedTargetRuntimeException( \
+ "wrapped Exception " + e.Message, \
+ Reference<XInterface>(), a); \
} \
} \
return m_aCache##XXX.get##XXX( nRow );
-
// virtual
OUString SAL_CALL CachedContentResultSet
::queryContentIdentifierString()
commit 337abdbc67d4e021c31bc5990c199fd3f18d6417
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Oct 31 12:46:58 2014 +0000
quieten warning
Change-Id: I91bf3bce86d6b7fb01a26a6785d5bcfd7677878c
diff --git a/vcl/source/gdi/virdev.cxx b/vcl/source/gdi/virdev.cxx
index b9a8b2b..2036523 100644
--- a/vcl/source/gdi/virdev.cxx
+++ b/vcl/source/gdi/virdev.cxx
@@ -225,7 +225,7 @@ VirtualDevice::VirtualDevice( const OutputDevice& rCompDev, sal_uInt16 nBitCount
: mpVirDev( NULL ),
meRefDevMode( REFDEV_NONE )
{
- SAL_WARN_IF( nBitCount > 1 && nBitCount != 8, "vcl.gdi",
+ SAL_WARN_IF( nBitCount > 1 && nBitCount != 8 && nBitCount != rCompDev.GetBitCount(), "vcl.gdi",
"VirtualDevice::VirtualDevice(): Only 0, 1 or 8 allowed for BitCount, not " << nBitCount );
SAL_INFO( "vcl.gdi", "VirtualDevice::VirtualDevice( " << nBitCount << " )" );
More information about the Libreoffice-commits
mailing list