new loplugin: find write-only fields

Change-Id: I0f83939babacf92485420ee63f290a297d7cb717
Reviewed-on: https://gerrit.libreoffice.org/22498
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
This commit is contained in:
Noel Grandin 2016-02-19 10:52:20 +02:00 committed by Noel Grandin
parent 541c4c4509
commit 778e9a65bf
61 changed files with 181 additions and 257 deletions

View File

@ -104,6 +104,7 @@ class ParentBuilder
bool VisitFunctionDecl( const FunctionDecl* function );
bool VisitObjCMethodDecl( const ObjCMethodDecl* method );
void walk( const Stmt* stmt );
bool shouldVisitTemplateInstantiations () const { return true; }
unordered_map< const Stmt*, const Stmt* >* parents;
};

View File

@ -16,7 +16,11 @@
#include "compat.hxx"
/**
Dump a list of calls to methods, and a list of field definitions.
This performs two analyses:
(1) look for unused fields
(2) look for fields that are write-only
We dmp a list of calls to methods, and a list of field definitions.
Then we will post-process the 2 lists and find the set of unused methods.
Be warned that it produces around 5G of log file.
@ -24,7 +28,7 @@ Be warned that it produces around 5G of log file.
The process goes something like this:
$ make check
$ make FORCE_COMPILE_ALL=1 COMPILER_PLUGIN_TOOL='unusedfields' check
$ ./compilerplugins/clang/unusedfields.py unusedfields.log > result.txt
$ ./compilerplugins/clang/unusedfields.py unusedfields.log
and then
$ for dir in *; do make FORCE_COMPILE_ALL=1 UPDATE_FILES=$dir COMPILER_PLUGIN_TOOL='unusedfieldsremove' $dir; done
@ -58,6 +62,7 @@ struct MyFieldInfo
// try to limit the voluminous output a little
static std::set<MyFieldInfo> touchedSet;
static std::set<MyFieldInfo> readFromSet;
static std::set<MyFieldInfo> definitionSet;
@ -76,6 +81,8 @@ public:
std::string output;
for (const MyFieldInfo & s : touchedSet)
output += "touch:\t" + s.parentClass + "\t" + s.fieldName + "\n";
for (const MyFieldInfo & s : readFromSet)
output += "read:\t" + s.parentClass + "\t" + s.fieldName + "\n";
for (const MyFieldInfo & s : definitionSet)
{
output += "definition:\t" + s.parentClass + "\t" + s.fieldName + "\t" + s.fieldType + "\t" + s.sourceLocation + "\n";
@ -204,10 +211,84 @@ bool UnusedFields::VisitFieldDecl( const FieldDecl* fieldDecl )
bool UnusedFields::VisitMemberExpr( const MemberExpr* memberExpr )
{
const ValueDecl* decl = memberExpr->getMemberDecl();
if (!isa<FieldDecl>(decl)) {
const FieldDecl* fieldDecl = dyn_cast<FieldDecl>(decl);
if (!fieldDecl) {
return true;
}
touchedSet.insert(niceName(dyn_cast<FieldDecl>(decl)));
MyFieldInfo fieldInfo = niceName(fieldDecl);
touchedSet.insert(fieldInfo);
// for the write-only analysis
if (ignoreLocation(memberExpr))
return true;
const Stmt* child = memberExpr;
const Stmt* parent = parentStmt(memberExpr);
// walk up the tree until we find something interesting
bool bPotentiallyReadFrom = false;
bool bDump = false;
do {
if (!parent) {
return true;
}
if (isa<CastExpr>(parent) || isa<MemberExpr>(parent) || isa<ParenExpr>(parent) || isa<ParenListExpr>(parent)
|| isa<ExprWithCleanups>(parent) || isa<UnaryOperator>(parent))
{
child = parent;
parent = parentStmt(parent);
}
else if (isa<CaseStmt>(parent))
{
bPotentiallyReadFrom = dyn_cast<CaseStmt>(parent)->getLHS() == child
|| dyn_cast<CaseStmt>(parent)->getRHS() == child;
break;
}
else if (isa<IfStmt>(parent))
{
bPotentiallyReadFrom = dyn_cast<IfStmt>(parent)->getCond() == child;
break;
}
else if (isa<DoStmt>(parent))
{
bPotentiallyReadFrom = dyn_cast<DoStmt>(parent)->getCond() == child;
break;
}
else if (isa<ReturnStmt>(parent) || isa<CXXConstructExpr>(parent) || isa<CallExpr>(parent)
|| isa<ConditionalOperator>(parent) || isa<SwitchStmt>(parent) || isa<ArraySubscriptExpr>(parent)
|| isa<DeclStmt>(parent) || isa<WhileStmt>(parent) || isa<CXXNewExpr>(parent)
|| isa<ForStmt>(parent) || isa<InitListExpr>(parent)
|| isa<BinaryOperator>(parent) || isa<CXXDependentScopeMemberExpr>(parent)
|| isa<UnresolvedMemberExpr>(parent)
|| isa<MaterializeTemporaryExpr>(parent)) //???
{
bPotentiallyReadFrom = true;
break;
}
else if (isa<CXXDeleteExpr>(parent)
|| isa<UnaryExprOrTypeTraitExpr>(parent)
|| isa<CXXUnresolvedConstructExpr>(parent) || isa<CompoundStmt>(parent)
|| isa<CXXTypeidExpr>(parent) || isa<DefaultStmt>(parent))
{
break;
}
else {
bPotentiallyReadFrom = true;
bDump = true;
break;
}
} while (true);
if (bDump)
{
report(
DiagnosticsEngine::Warning,
"oh dear, what can the matter be?",
memberExpr->getLocStart())
<< memberExpr->getSourceRange();
parent->dump();
}
if (bPotentiallyReadFrom)
readFromSet.insert(fieldInfo);
return true;
}

View File

@ -8,6 +8,7 @@ definitionSet = set()
definitionToSourceLocationMap = dict()
definitionToTypeMap = dict()
callSet = set()
readFromSet = set()
sourceLocationSet = set()
# things we need to exclude for reasons like :
# - it's a weird template thingy that confuses the plugin
@ -36,6 +37,10 @@ with io.open(sys.argv[1], "rb", buffering=1024*1024) as txt:
idx1 = line.find("\t",7)
callInfo = (normalizeTypeParams(line[7:idx1]), line[idx1+1:].strip())
callSet.add(callInfo)
elif line.startswith("read:\t"):
idx1 = line.find("\t",6)
readInfo = (normalizeTypeParams(line[6:idx1]), line[idx1+1:].strip())
readFromSet.add(readInfo)
# Invert the definitionToSourceLocationMap
# If we see more than one method at the same sourceLocation, it's being autogenerated as part of a template
@ -49,7 +54,7 @@ for k, definitions in sourceLocationToDefinitionMap.iteritems():
for d in definitions:
definitionSet.remove(d)
tmp1set = set()
untouchedSet = set()
for d in definitionSet:
clazz = d[0] + " " + d[1]
if clazz in exclusionSet:
@ -86,8 +91,45 @@ for d in definitionSet:
or srcLoc.startswith("lotuswordpro/source/filter/lwpsdwdrawheader.hxx")
or srcLoc.startswith("svtools/source/dialogs/insdlg.cxx")):
continue
untouchedSet.add((clazz + " " + definitionToTypeMap[d], srcLoc))
tmp1set.add((clazz + " " + definitionToTypeMap[d], srcLoc))
writeonlySet = set()
for d in definitionSet:
clazz = d[0] + " " + d[1]
if d in readFromSet:
continue
srcLoc = definitionToSourceLocationMap[d];
# ignore external source code
if (srcLoc.startswith("external/")):
continue
# ignore build folder
if (srcLoc.startswith("workdir/")):
continue
# ignore our stable/URE/UNO api
if (srcLoc.startswith("include/com/")
or srcLoc.startswith("include/cppu/")
or srcLoc.startswith("include/cppuhelper/")
or srcLoc.startswith("include/osl/")
or srcLoc.startswith("include/rtl/")
or srcLoc.startswith("include/sal/")
or srcLoc.startswith("include/salhelper/")
or srcLoc.startswith("include/systools/")
or srcLoc.startswith("include/typelib/")
or srcLoc.startswith("include/uno/")):
continue
# this is all representations of on-disk data structures
if (srcLoc.startswith("sc/source/filter/inc/scflt.hxx")
or srcLoc.startswith("sw/source/filter/ww8/")
or srcLoc.startswith("vcl/source/filter/sgvmain.hxx")
or srcLoc.startswith("vcl/source/filter/sgfbram.hxx")
or srcLoc.startswith("vcl/inc/unx/XIM.h")
or srcLoc.startswith("vcl/inc/unx/gtk/gloactiongroup.h")
or srcLoc.startswith("include/svl/svdde.hxx")
or srcLoc.startswith("lotuswordpro/source/filter/lwpsdwdrawheader.hxx")
or srcLoc.startswith("svtools/source/dialogs/insdlg.cxx")):
continue
writeonlySet.add((clazz + " " + definitionToTypeMap[d], srcLoc))
# sort the results using a "natural order" so sequences like [item1,item2,item10] sort nicely
def natural_sort_key(s, _nsre=re.compile('([0-9]+)')):
@ -95,12 +137,18 @@ def natural_sort_key(s, _nsre=re.compile('([0-9]+)')):
for text in re.split(_nsre, s)]
# sort results by name and line number
tmp1list = sorted(tmp1set, key=lambda v: natural_sort_key(v[1]))
tmp1list = sorted(untouchedSet, key=lambda v: natural_sort_key(v[1]))
tmp2list = sorted(writeonlySet, key=lambda v: natural_sort_key(v[1]))
# print out the results
for t in tmp1list:
print t[1]
print " ", t[0]
with open("unusedfields.untouched", "wt") as f:
for t in tmp1list:
f.write( t[1] + "\n" )
f.write( " " + t[0] + "\n" )
with open("unusedfields.writeonly", "wt") as f:
for t in tmp2list:
f.write( t[1] + "\n" )
f.write( " " + t[0] + "\n" )

View File

@ -154,8 +154,7 @@ public:
inline ScRangeItem( const sal_uInt16 nWhich );
inline ScRangeItem( const sal_uInt16 nWhich,
const ScRange& rRange,
const sal_uInt16 nNewFlags = 0 );
const ScRange& rRange );
inline ScRangeItem( const ScRangeItem& rCpy );
inline ScRangeItem& operator=( const ScRangeItem &rCpy );
@ -171,23 +170,21 @@ public:
private:
ScRange aRange;
sal_uInt16 nFlags;
};
inline ScRangeItem::ScRangeItem( const sal_uInt16 nWhichP )
: SfxPoolItem( nWhichP ), nFlags( SCR_INVALID ) // == invalid area
: SfxPoolItem( nWhichP )
{
}
inline ScRangeItem::ScRangeItem( const sal_uInt16 nWhichP,
const ScRange& rRange,
const sal_uInt16 nNew )
: SfxPoolItem( nWhichP ), aRange( rRange ), nFlags( nNew )
const ScRange& rRange )
: SfxPoolItem( nWhichP ), aRange( rRange )
{
}
inline ScRangeItem::ScRangeItem( const ScRangeItem& rCpy )
: SfxPoolItem( rCpy.Which() ), aRange( rCpy.aRange ), nFlags( rCpy.nFlags )
: SfxPoolItem( rCpy.Which() ), aRange( rCpy.aRange )
{}
inline ScRangeItem& ScRangeItem::operator=( const ScRangeItem &rCpy )

View File

@ -61,7 +61,6 @@ class SC_DLLPUBLIC ScChartArray // only parameter-struct
OUString aName;
ScDocument* pDocument;
ScChartPositioner aPositioner;
bool bValid; // for creation out of SchMemChart
private:
ScMemChart* CreateMemChartSingle();

View File

@ -64,7 +64,6 @@ public:
mutable size_t mnRefCount;
ScTokenArray* mpCode;
sc::CompiledFormula* mpCompiledFormula;
ScFormulaCell *mpTopCell;
SCROW mnLength; // How many of these do we have ?
short mnFormatType;

View File

@ -567,7 +567,6 @@ ScFormulaCellGroup::ScFormulaCellGroup() :
mpImpl(new Impl),
mnRefCount(0),
mpCode(nullptr),
mpCompiledFormula(nullptr),
mpTopCell(nullptr),
mnLength(0),
mnFormatType(css::util::NumberFormat::NUMBER),
@ -582,7 +581,6 @@ ScFormulaCellGroup::~ScFormulaCellGroup()
{
SAL_INFO( "sc.core.formulacell", "ScFormulaCellGroup dtor this " << this);
delete mpCode;
delete mpCompiledFormula;
}
void ScFormulaCellGroup::setCode( const ScTokenArray& rCode )

View File

@ -64,8 +64,7 @@ ScChartArray::ScChartArray( ScDocument* pDoc, SCTAB nTab,
const OUString& rChartName ) :
aName( rChartName ),
pDocument( pDoc ),
aPositioner(pDoc, nTab, nStartColP, nStartRowP, nEndColP, nEndRowP),
bValid( true )
aPositioner(pDoc, nTab, nStartColP, nStartRowP, nEndColP, nEndRowP)
{
}
@ -73,14 +72,12 @@ ScChartArray::ScChartArray(
ScDocument* pDoc, const ScRangeListRef& rRangeList, const OUString& rChartName ) :
aName( rChartName ),
pDocument( pDoc ),
aPositioner(pDoc, rRangeList),
bValid( true ) {}
aPositioner(pDoc, rRangeList) {}
ScChartArray::ScChartArray( const ScChartArray& rArr ) :
aName(rArr.aName),
pDocument(rArr.pDocument),
aPositioner(rArr.aPositioner),
bValid(rArr.bValid) {}
aPositioner(rArr.aPositioner) {}
ScChartArray::~ScChartArray() {}

View File

@ -161,8 +161,6 @@ public:
virtual void commit() override;
private:
ScDocument& mrDoc;
ScRange maRange;
};

View File

@ -1207,10 +1207,8 @@ size_t ScOrcusStyles::commit_cell_style()
// auto filter import
ScOrcusAutoFilter::ScOrcusAutoFilter(ScDocument& rDoc):
mrDoc(rDoc)
ScOrcusAutoFilter::ScOrcusAutoFilter(ScDocument&)
{
(void)mrDoc;
}
ScOrcusAutoFilter::~ScOrcusAutoFilter()

View File

@ -353,7 +353,6 @@ ScXMLExport::ScXMLExport(
pGroupColumns (nullptr),
pGroupRows (nullptr),
pDefaults(nullptr),
pChartListener(nullptr),
pCurrentCell(nullptr),
pMergedRangesContainer(nullptr),
pValidationsContainer(nullptr),
@ -435,7 +434,6 @@ ScXMLExport::~ScXMLExport()
delete pMergedRangesContainer;
delete pValidationsContainer;
delete pChangeTrackingExportHelper;
delete pChartListener;
delete pDefaults;
delete pNumberFormatAttributesExportHelper;
}

View File

@ -104,7 +104,6 @@ class ScXMLExport : public SvXMLExport
ScMyOpenCloseColumnRowGroup* pGroupColumns;
ScMyOpenCloseColumnRowGroup* pGroupRows;
ScMyDefaultStyles* pDefaults;
ScChartListener* pChartListener;
const ScMyCell* pCurrentCell;
ScMyMergedRangesContainer* pMergedRangesContainer;

View File

@ -1986,9 +1986,6 @@ ScXMLImport::ScXMLImport(
sLocale(SC_LOCALE),
sCellStyle(SC_UNONAME_CELLSTYL),
pDocElemTokenMap( nullptr ),
pStylesElemTokenMap( nullptr ),
pStylesAttrTokenMap( nullptr ),
pStyleElemTokenMap( nullptr ),
pBodyElemTokenMap( nullptr ),
pContentValidationsElemTokenMap( nullptr ),
pContentValidationElemTokenMap( nullptr ),
@ -2131,9 +2128,6 @@ ScXMLImport::~ScXMLImport() throw()
{
// delete pI18NMap;
delete pDocElemTokenMap;
delete pStylesElemTokenMap;
delete pStylesAttrTokenMap;
delete pStyleElemTokenMap;
delete pBodyElemTokenMap;
delete pContentValidationsElemTokenMap;
delete pContentValidationElemTokenMap;

View File

@ -847,9 +847,6 @@ class ScXMLImport: public SvXMLImport, private boost::noncopyable
rtl::Reference < XMLPropertySetMapper > xTableStylesPropertySetMapper;
SvXMLTokenMap *pDocElemTokenMap;
SvXMLTokenMap *pStylesElemTokenMap;
SvXMLTokenMap *pStylesAttrTokenMap;
SvXMLTokenMap *pStyleElemTokenMap;
SvXMLTokenMap *pBodyElemTokenMap;
SvXMLTokenMap *pContentValidationsElemTokenMap;
SvXMLTokenMap *pContentValidationElemTokenMap;

View File

@ -497,11 +497,10 @@ private:
ScPreviewShell* mpViewShell;
ScAccessibleDocumentPagePreview* mpAccDoc;
MapMode maMapMode;
bool mbValid;
};
ScIAccessibleViewForwarder::ScIAccessibleViewForwarder()
: mpViewShell(nullptr), mpAccDoc(nullptr), mbValid(false)
: mpViewShell(nullptr), mpAccDoc(nullptr)
{
}
@ -510,8 +509,7 @@ ScIAccessibleViewForwarder::ScIAccessibleViewForwarder(ScPreviewShell* pViewShel
const MapMode& aMapMode)
: mpViewShell(pViewShell),
mpAccDoc(pAccDoc),
maMapMode(aMapMode),
mbValid(true)
maMapMode(aMapMode)
{
}

View File

@ -244,7 +244,6 @@ class ScPreviewViewForwarder : public SvxViewForwarder
{
protected:
ScPreviewShell* mpViewShell;
mutable ScPreviewTableInfo* mpTableInfo;
public:
explicit ScPreviewViewForwarder(ScPreviewShell* pViewShell);
virtual ~ScPreviewViewForwarder();
@ -263,15 +262,12 @@ public:
};
ScPreviewViewForwarder::ScPreviewViewForwarder(ScPreviewShell* pViewShell)
:
mpViewShell(pViewShell),
mpTableInfo(nullptr)
: mpViewShell(pViewShell)
{
}
ScPreviewViewForwarder::~ScPreviewViewForwarder()
{
delete mpTableInfo;
}
bool ScPreviewViewForwarder::IsValid() const

View File

@ -75,7 +75,6 @@ private:
ScDocument* pDoc;
ScViewData* pViewData;
ScRangeUtil* pRangeUtil;
OUString aStrSelectedArea;
bool bModifyMode;

View File

@ -56,7 +56,6 @@ ScTpUserLists::ScTpUserLists( vcl::Window* pParent,
pUserLists ( nullptr ),
pDoc ( nullptr ),
pViewData ( nullptr ),
pRangeUtil ( new ScRangeUtil ),
bModifyMode ( false ),
bCancelMode ( false ),
bCopyDone ( false ),
@ -88,7 +87,6 @@ ScTpUserLists::~ScTpUserLists()
void ScTpUserLists::dispose()
{
delete pUserLists;
delete pRangeUtil;
mpFtLists.clear();
mpLbLists.clear();
mpFtEntries.clear();

View File

@ -52,7 +52,6 @@ private:
VclPtr<CheckBox> aCbxManuel;
VclPtr<CheckBox> aCbxMousepointer;
VclPtr<CheckBox> aCbxPen;
VclPtr<CheckBox> aCbxNavigator;
VclPtr<CheckBox> aCbxAnimationAllowed;
VclPtr<CheckBox> aCbxChangePage;
VclPtr<CheckBox> aCbxAlwaysOnTop;

View File

@ -69,7 +69,6 @@ private:
Bitmap maMarkedPreview;
std::shared_ptr<BitmapReplacement> mpReplacement;
std::shared_ptr<BitmapCompressor> mpCompressor;
Size maBitmapSize;
bool mbIsUpToDate;
sal_Int32 mnLastAccessTime;
// When this flag is set then the bitmap is not modified by a cache

View File

@ -43,13 +43,12 @@ class SfxSplitWindow;
class SfxWorkWindow;
// This struct makes all relevant Informationen available of Toolboxes
// This struct makes all relevant Information available of Toolboxes
struct SfxObjectBar_Impl
{
sal_uInt16 nId; // Resource - and ConfigId of Toolbox
sal_uInt16 nMode; // special visibility flags
sal_uInt16 nPos;
sal_uInt16 nIndex;
bool bDestroy;
SfxInterface* pIFace;
@ -57,7 +56,6 @@ struct SfxObjectBar_Impl
nId(0),
nMode(0),
nPos(0),
nIndex(0),
bDestroy(false),
pIFace(nullptr)
{}

View File

@ -34,7 +34,6 @@ struct SfxViewFrame_Impl
Size aSize;
OUString aActualURL;
SfxFrame& rFrame;
svtools::AsynchronLink* pReloader;
VclPtr<vcl::Window> pWindow;
SfxViewFrame* pActiveChild;
VclPtr<vcl::Window> pFocusWin;
@ -53,7 +52,6 @@ struct SfxViewFrame_Impl
explicit SfxViewFrame_Impl(SfxFrame& i_rFrame)
: rFrame(i_rFrame)
, pReloader(nullptr)
, pWindow(nullptr)
, pActiveChild(nullptr)
, pFocusWin(nullptr)
@ -73,7 +71,6 @@ struct SfxViewFrame_Impl
~SfxViewFrame_Impl()
{
delete pReloader;
}
};

View File

@ -170,25 +170,19 @@ namespace slideshow
}
HSLColor::HSLColor() :
maHSLTriple( 0.0, 0.0, 0.0 ),
mnMagicValue( getMagic( maHSLTriple.mnLuminance,
maHSLTriple.mnSaturation ) )
maHSLTriple( 0.0, 0.0, 0.0 )
{
}
HSLColor::HSLColor( double nHue, double nSaturation, double nLuminance ) :
maHSLTriple( nHue, nSaturation, nLuminance ),
mnMagicValue( getMagic( maHSLTriple.mnLuminance,
maHSLTriple.mnSaturation ) )
maHSLTriple( nHue, nSaturation, nLuminance )
{
}
HSLColor::HSLColor( const RGBColor& rColor ) :
maHSLTriple( rgb2hsl( truncateRangeStd( rColor.getRed() ),
truncateRangeStd( rColor.getGreen() ),
truncateRangeStd( rColor.getBlue() ) ) ),
mnMagicValue( getMagic( maHSLTriple.mnLuminance,
maHSLTriple.mnSaturation ) )
truncateRangeStd( rColor.getBlue() ) ) )
{
}

View File

@ -75,8 +75,6 @@ namespace slideshow
HSLTriple maHSLTriple;
/// Pre-calculated value, needed for conversion back to RGB
double mnMagicValue;
};
bool operator==( const HSLColor& rLHS, const HSLColor& rRHS );

View File

@ -157,22 +157,19 @@ namespace svgio
SvgAlign maSvgAlign;
/// bitfield
bool mbDefer : 1; // default is false
bool mbMeetOrSlice : 1; // true = meet (default), false = slice
bool mbSet : 1;
public:
SvgAspectRatio()
: maSvgAlign(Align_xMidYMid),
mbDefer(false),
mbMeetOrSlice(true),
mbSet(false)
{
}
SvgAspectRatio(SvgAlign aSvgAlign, bool bDefer, bool bMeetOrSlice)
SvgAspectRatio(SvgAlign aSvgAlign, bool bMeetOrSlice)
: maSvgAlign(aSvgAlign),
mbDefer(bDefer),
mbMeetOrSlice(bMeetOrSlice),
mbSet(true)
{

View File

@ -417,7 +417,7 @@ namespace svgio
// create mapping
// #i122610 SVG 1.1 defines in section 5.1.2 that if the attribute perserveAspectRatio is not specified,
// then the effect is as if a value of 'xMidYMid meet' were specified.
SvgAspectRatio aRatioDefault(Align_xMidYMid,false,true);
SvgAspectRatio aRatioDefault(Align_xMidYMid,true);
const SvgAspectRatio& rRatio = getSvgAspectRatio().isSet()? getSvgAspectRatio() : aRatioDefault;
// let mapping be created from SvgAspectRatio
@ -527,7 +527,7 @@ namespace svgio
// create mapping
// SVG 1.1 defines in section 5.1.2 that if the attribute perserveAspectRatio is not specified,
// then the effect is as if a value of 'xMidYMid meet' were specified.
SvgAspectRatio aRatioDefault(Align_xMidYMid,false,true);
SvgAspectRatio aRatioDefault(Align_xMidYMid,true);
const SvgAspectRatio& rRatio = getSvgAspectRatio().isSet()? getSvgAspectRatio() : aRatioDefault;
basegfx::B2DHomMatrix aViewBoxMapping;

View File

@ -1304,7 +1304,6 @@ namespace svgio
{
sal_Int32 nPos(0);
SvgAlign aSvgAlign(Align_xMidYMid);
bool bDefer(false);
bool bMeetOrSlice(true);
bool bChanged(false);
@ -1321,7 +1320,6 @@ namespace svgio
{
case SVGTokenDefer:
{
bDefer = true;
bChanged = true;
break;
}
@ -1413,7 +1411,7 @@ namespace svgio
if(bChanged)
{
return SvgAspectRatio(aSvgAlign, bDefer, bMeetOrSlice);
return SvgAspectRatio(aSvgAlign, bMeetOrSlice);
}
}

View File

@ -347,14 +347,12 @@ class StylePoolImpl
{
private:
std::map< const SfxItemSet*, Node > maRoot;
sal_Int32 mnCount;
// #i86923#
SfxItemSet* mpIgnorableItems;
public:
// #i86923#
explicit StylePoolImpl( SfxItemSet* pIgnorableItems = nullptr )
: maRoot(),
mnCount(0),
mpIgnorableItems( pIgnorableItems != nullptr
? pIgnorableItems->Clone( false )
: nullptr )
@ -422,7 +420,6 @@ StylePool::SfxItemSet_Pointer_t StylePoolImpl::insertItemSet( const SfxItemSet&
{
pCurNode->setItemSet( rSet );
bNonPoolable = false; // to avoid a double insertion
++mnCount;
}
// If rSet contains at least one non poolable item, a new itemset has to be inserted
if( bNonPoolable )

View File

@ -167,20 +167,10 @@ void FmFieldWinListBox::StartDrag( sal_Int8 /*_nAction*/, const Point& /*_rPosPi
pTransferColumn->StartDrag( this, DND_ACTION_COPY );
}
FmFieldWinData::FmFieldWinData()
{
}
FmFieldWinData::~FmFieldWinData()
{
}
FmFieldWin::FmFieldWin(SfxBindings* _pBindings, SfxChildWindow* _pMgr, vcl::Window* _pParent)
:SfxFloatingWindow(_pBindings, _pMgr, _pParent, WinBits(WB_STDMODELESS|WB_SIZEABLE))
,SfxControllerItem(SID_FM_FIELDS_CONTROL, *_pBindings)
,::comphelper::OPropertyChangeListener(m_aMutex)
,pData(new FmFieldWinData)
,m_nObjectType(0)
,m_pChangeListener(nullptr)
{
@ -208,7 +198,6 @@ void FmFieldWin::dispose()
// delete m_pChangeListener;
}
pListBox.disposeAndClear();
delete pData;
::SfxControllerItem::dispose();
SfxFloatingWindow::dispose();
}

View File

@ -60,12 +60,6 @@ protected:
class FmFormShell;
class FmFieldWinData
{
public:
FmFieldWinData();
~FmFieldWinData();
};
class FmFieldWin :public SfxFloatingWindow
@ -74,7 +68,6 @@ class FmFieldWin :public SfxFloatingWindow
{
::osl::Mutex m_aMutex;
VclPtr<FmFieldWinListBox> pListBox;
FmFieldWinData* pData;
::dbtools::SharedConnection
m_aConnection;
OUString m_aDatabaseName,

View File

@ -94,8 +94,6 @@ class SwAccessibleMap : public ::accessibility::IAccessibleViewForwarder,
css::uno::WeakReference < css::accessibility::XAccessible > mxCursorContext;
sal_Int32 mnPara;
bool mbShapeSelected;
void FireEvent( const SwAccessibleEvent_Impl& rEvent );

View File

@ -1656,7 +1656,6 @@ SwAccessibleMap::SwAccessibleMap( SwViewShell *pSh ) :
mpSelectedParas( nullptr ),
mpVSh( pSh ),
mpPreview( nullptr ),
mnPara( 1 ),
mbShapeSelected( false ),
mpSeletedFrameMap(nullptr)
{
@ -1886,7 +1885,6 @@ uno::Reference< XAccessible> SwAccessibleMap::GetContext( const SwFrame *pFrame,
switch( pFrame->GetType() )
{
case FRM_TXT:
mnPara++;
pAcc = new SwAccessibleParagraph( this,
static_cast< const SwTextFrame& >( *pFrame ) );
break;

View File

@ -38,7 +38,6 @@ class SwUndoDelete
{
SwNodeIndex* m_pMvStt; // Position of Nodes in UndoNodes-Array
OUString *m_pSttStr, *m_pEndStr;
SwRedlineData* m_pRedlData;
SwRedlineSaveDatas* m_pRedlSaveData;
std::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndoStart;
std::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndoEnd;

View File

@ -64,7 +64,6 @@ class SwUndoSort : public SwUndo, private SwUndRng
SwSortOptions* pSortOpt;
std::vector<std::unique_ptr<SwSortUndoElement>> m_SortList;
SwUndoAttrTable* pUndoTableAttr;
SwRedlineData* pRedlData;
sal_uLong nTableNd;
public:

View File

@ -59,7 +59,6 @@ using namespace ::com::sun::star;
// and by another SwLineLayout via pNext to realize a doubleline portion.
SwMultiPortion::~SwMultiPortion()
{
delete pFieldRest;
}
void SwMultiPortion::Paint( const SwTextPaintInfo & ) const

View File

@ -73,7 +73,6 @@ struct SwBracket
class SwMultiPortion : public SwLinePortion
{
SwLineLayout aRoot; // One or more lines
SwFieldPortion *pFieldRest; // Field rest from the previous line
bool bTab1 :1; // First line tabulator
bool bTab2 :1; // Second line includes tabulator
bool bDouble :1; // Double line
@ -86,8 +85,7 @@ class SwMultiPortion : public SwLinePortion
sal_uInt8 nDirection:2; // Direction (0/90/180/270 degrees)
protected:
explicit SwMultiPortion(sal_Int32 nEnd)
: pFieldRest(nullptr)
, bTab1(false)
: bTab1(false)
, bTab2(false)
, bDouble(false)
, bRuby(false)

View File

@ -102,7 +102,6 @@ SwUndoDelete::SwUndoDelete(
m_pMvStt( nullptr ),
m_pSttStr(nullptr),
m_pEndStr(nullptr),
m_pRedlData(nullptr),
m_pRedlSaveData(nullptr),
m_nNode(0),
m_nNdDiff(0),
@ -524,7 +523,6 @@ SwUndoDelete::~SwUndoDelete()
m_pMvStt->GetNode().GetNodes().Delete( *m_pMvStt, m_nNode );
delete m_pMvStt;
}
delete m_pRedlData;
delete m_pRedlSaveData;
}

View File

@ -45,7 +45,6 @@ SwUndoSort::SwUndoSort(const SwPaM& rRg, const SwSortOptions& rOpt)
: SwUndo(UNDO_SORT_TXT)
, SwUndRng(rRg)
, pUndoTableAttr(nullptr)
, pRedlData(nullptr)
, nTableNd(0)
{
pSortOpt = new SwSortOptions(rOpt);
@ -53,7 +52,7 @@ SwUndoSort::SwUndoSort(const SwPaM& rRg, const SwSortOptions& rOpt)
SwUndoSort::SwUndoSort( sal_uLong nStt, sal_uLong nEnd, const SwTableNode& rTableNd,
const SwSortOptions& rOpt, bool bSaveTable )
: SwUndo(UNDO_SORT_TBL), pUndoTableAttr( nullptr ), pRedlData( nullptr )
: SwUndo(UNDO_SORT_TBL), pUndoTableAttr( nullptr )
{
nSttNode = nStt;
nEndNode = nEnd;
@ -68,7 +67,6 @@ SwUndoSort::~SwUndoSort()
{
delete pSortOpt;
delete pUndoTableAttr;
delete pRedlData;
}
void SwUndoSort::UndoImpl(::sw::UndoRedoContext & rContext)

View File

@ -1047,14 +1047,14 @@ const std::vector< std::pair<OUString, OUString> >& SwFltRDFMark::GetAttributes(
}
// methods of SwFltTOX follow
SwFltTOX::SwFltTOX(SwTOXBase* pBase, sal_uInt16 _nCols)
: SfxPoolItem(RES_FLTR_TOX), pTOXBase(pBase), nCols( _nCols ),
SwFltTOX::SwFltTOX(SwTOXBase* pBase)
: SfxPoolItem(RES_FLTR_TOX), pTOXBase(pBase),
bHadBreakItem( false ), bHadPageDescItem( false )
{
}
SwFltTOX::SwFltTOX(const SwFltTOX& rCpy)
: SfxPoolItem(RES_FLTR_TOX), pTOXBase(rCpy.pTOXBase), nCols( rCpy.nCols ),
: SfxPoolItem(RES_FLTR_TOX), pTOXBase(rCpy.pTOXBase),
bHadBreakItem( rCpy.bHadBreakItem ), bHadPageDescItem( rCpy.bHadPageDescItem )
{
}

View File

@ -5463,7 +5463,6 @@ _HTMLAttr::_HTMLAttr( const SwPosition& rPos, const SfxPoolItem& rItem,
bInsAtStart( true ),
bLikePara( false ),
bValid( true ),
nCount( 1 ),
pNext( nullptr ),
pPrev( nullptr ),
ppHead( ppHd )
@ -5480,7 +5479,6 @@ _HTMLAttr::_HTMLAttr( const _HTMLAttr &rAttr, const SwNodeIndex &rEndPara,
bInsAtStart( rAttr.bInsAtStart ),
bLikePara( rAttr.bLikePara ),
bValid( rAttr.bValid ),
nCount( rAttr.nCount ),
pNext( nullptr ),
pPrev( nullptr ),
ppHead( ppHd )

View File

@ -82,7 +82,6 @@ class _HTMLAttr
bool bValid : 1; // ist das Attribut gueltig?
SfxPoolItem* pItem;
sal_uInt16 nCount; // Anzahl noch zu schliessender Attrs mit einem Wert
_HTMLAttr *pNext; // noch zu schliessene Attrs mit unterschiedl. Werten
_HTMLAttr *pPrev; // bereits geschlossene aber noch nicht gesetze Attrs
_HTMLAttr **ppHead; // der Listenkopf

View File

@ -308,11 +308,10 @@ public:
class SW_DLLPUBLIC SwFltTOX : public SfxPoolItem
{
SwTOXBase* pTOXBase;
sal_uInt16 nCols;
bool bHadBreakItem; // there was a break item BEFORE insertion of the TOX
bool bHadPageDescItem;
public:
SwFltTOX(SwTOXBase* pBase, sal_uInt16 _nCols = 0);
SwFltTOX(SwTOXBase* pBase);
SwFltTOX(const SwFltTOX&);
// "pure virtual Methoden" vom SfxPoolItem
virtual bool operator==(const SfxPoolItem&) const override;

View File

@ -3303,7 +3303,7 @@ eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, OUString& rStr )
const SwPosition* pPos = m_pPaM->GetPoint();
SwFltTOX aFltTOX( pBase, nIndexCols );
SwFltTOX aFltTOX( pBase );
// test if there is already a break item on this node
if(SwContentNode* pNd = pPos->nNode.GetNode().GetContentNode())

View File

@ -94,7 +94,7 @@ void SwInsertBookmarkDlg::Apply()
}
// insert text mark
SwBoxEntry aTmpEntry(m_pBookmarkBox->GetText(), 0 );
SwBoxEntry aTmpEntry(m_pBookmarkBox->GetText() );
if (!m_pBookmarkBox->GetText().isEmpty() &&
(m_pBookmarkBox->GetSwEntryPos(aTmpEntry) == COMBOBOX_ENTRY_NOTFOUND))
@ -129,7 +129,6 @@ SwInsertBookmarkDlg::SwInsertBookmarkDlg( vcl::Window *pParent, SwWrtShell &rS,
// fill Combobox with existing bookmarks
IDocumentMarkAccess* const pMarkAccess = rSh.getIDocumentMarkAccess();
sal_Int32 nId = 0;
for( IDocumentMarkAccess::const_iterator_t ppBookmark = pMarkAccess->getBookmarksBegin();
ppBookmark != pMarkAccess->getBookmarksEnd();
++ppBookmark)
@ -137,7 +136,7 @@ SwInsertBookmarkDlg::SwInsertBookmarkDlg( vcl::Window *pParent, SwWrtShell &rS,
if(IDocumentMarkAccess::MarkType::BOOKMARK == IDocumentMarkAccess::GetType(**ppBookmark))
{
m_pBookmarkBox->InsertSwEntry(
SwBoxEntry(ppBookmark->get()->GetName(), nId++));
SwBoxEntry(ppBookmark->get()->GetName()));
}
}

View File

@ -24,25 +24,19 @@
// Description: ListboxElement
SwBoxEntry::SwBoxEntry() :
bModified(false),
bNew(false),
nId(COMBOBOX_APPEND)
bNew(false)
{
}
SwBoxEntry::SwBoxEntry(const OUString& aNam, sal_Int32 nIdx) :
bModified(false),
SwBoxEntry::SwBoxEntry(const OUString& aNam) :
bNew(false),
aName(aNam),
nId(nIdx)
aName(aNam)
{
}
SwBoxEntry::SwBoxEntry(const SwBoxEntry& rOld) :
bModified(rOld.bModified),
bNew(rOld.bNew),
aName(rOld.aName),
nId(rOld.nId)
aName(rOld.aName)
{
}
@ -58,7 +52,7 @@ void SwComboBox::Init()
sal_Int32 nSize = GetEntryCount();
for( sal_Int32 i=0; i < nSize; ++i )
{
m_EntryList.push_back(SwBoxEntry(ComboBox::GetEntry(i), i));
m_EntryList.push_back(SwBoxEntry(ComboBox::GetEntry(i)));
}
}

View File

@ -34,14 +34,11 @@ class SW_DLLPUBLIC SwBoxEntry
{
friend class SwComboBox;
bool bModified : 1;
bool bNew : 1;
OUString aName;
sal_Int32 nId;
public:
SwBoxEntry(const OUString& aName, sal_Int32 nId=0);
SwBoxEntry(const OUString& aName);
SwBoxEntry(const SwBoxEntry& rOrg);
SwBoxEntry();

View File

@ -55,7 +55,6 @@ namespace fileaccess
bool m_bAbort,m_bHandled;
sal_Int32 m_nErrorCode,m_nMinorCode;
css::uno::Reference< css::task::XInteractionHandler > m_xInteractionHandler;
css::uno::Reference< css::ucb::XProgressHandler > m_xProgressHandler;
css::uno::Reference< css::ucb::XCommandEnvironment > m_xCommandEnvironment;
@ -69,7 +68,6 @@ namespace fileaccess
m_nErrorCode( TASKHANDLER_NO_ERROR ),
m_nMinorCode( TASKHANDLER_NO_ERROR ),
m_xInteractionHandler( nullptr ),
m_xProgressHandler( nullptr ),
m_xCommandEnvironment( xCommandEnv )
{
}

View File

@ -282,8 +282,6 @@ struct GlyphItem
int mnNewWidth; // width after adjustments
int mnXOffset;
int mnYOffset;
sal_GlyphId maGlyphId;
Point maLinearPos; // absolute position of non rotated string
@ -294,7 +292,6 @@ public:
, mnOrigWidth(0)
, mnNewWidth(0)
, mnXOffset(0)
, mnYOffset(0)
, maGlyphId(0)
{}
@ -303,16 +300,14 @@ public:
: mnFlags(nFlags), mnCharPos(nCharPos),
mnOrigWidth(nOrigWidth), mnNewWidth(nOrigWidth),
mnXOffset(0),
mnYOffset(0),
maGlyphId(aGlyphId), maLinearPos(rLinearPos)
{}
GlyphItem( int nCharPos, sal_GlyphId aGlyphId, const Point& rLinearPos,
long nFlags, int nOrigWidth, int nXOffset, int nYOffset )
long nFlags, int nOrigWidth, int nXOffset )
: mnFlags(nFlags), mnCharPos(nCharPos),
mnOrigWidth(nOrigWidth), mnNewWidth(nOrigWidth),
mnXOffset(nXOffset),
mnYOffset(nYOffset),
maGlyphId(aGlyphId), maLinearPos(rLinearPos)
{}

View File

@ -123,7 +123,6 @@ struct ImplSVAppData
sal_uInt64 mnLastInputTime; // GetLastInputTime()
sal_uInt16 mnDispatchLevel; // DispatchLevel
sal_uInt16 mnModalMode; // ModalMode Count
sal_uInt16 mnModalDialog; // ModalDialog Count
SystemWindowFlags mnSysWinMode; // Mode, when SystemWindows should be created
short mnDialogScaleX; // Scale X-Positions and sizes in Dialogs
bool mbInAppMain; // is Application::Main() on stack

View File

@ -700,7 +700,6 @@ private:
Color m_aOverlineColor;
basegfx::B2DPolyPolygon m_aClipRegion;
bool m_bClipRegion;
sal_Int32 m_nAntiAlias;
ComplexTextLayoutMode m_nLayoutMode;
LanguageType m_aDigitLanguage;
sal_Int32 m_nTransparentPercent;
@ -725,7 +724,6 @@ private:
m_aTextLineColor( COL_TRANSPARENT ),
m_aOverlineColor( COL_TRANSPARENT ),
m_bClipRegion( false ),
m_nAntiAlias( 1 ),
m_nLayoutMode( TEXT_LAYOUT_DEFAULT ),
m_aDigitLanguage( 0 ),
m_nTransparentPercent( 0 ),

View File

@ -659,7 +659,6 @@ bool Dialog::Notify( NotifyEvent& rNEvt )
// have re-enabled input for our parent
if( mbInExecute && mbModalMode )
{
// do not change modal counter (pSVData->maAppData.mnModalDialog)
SetModalInputMode( false );
SetModalInputMode( true );
@ -1009,12 +1008,9 @@ void Dialog::SetModalInputMode( bool bModal )
if ( bModal == mbModalMode )
return;
ImplSVData* pSVData = ImplGetSVData();
mbModalMode = bModal;
if ( bModal )
{
pSVData->maAppData.mnModalDialog++;
// Disable the prev Modal Dialog, because our dialog must close at first,
// before the other dialog can be closed (because the other dialog
// is on stack since our dialog returns)
@ -1034,8 +1030,6 @@ void Dialog::SetModalInputMode( bool bModal )
}
else
{
pSVData->maAppData.mnModalDialog--;
if ( mpDialogParent )
{
// #115933# re-enable the whole frame hierarchy again (see above)

View File

@ -583,7 +583,7 @@ bool HbLayoutEngine::Layout(ServerFontLayout& rLayout, ImplLayoutArgs& rArgs)
nXAdvance = nVirtAdv;
Point aNewPos = Point(aCurrPos.X() + nXOffset, -(aCurrPos.Y() + nYOffset));
const GlyphItem aGI(nCharPos, nGlyphIndex, aNewPos, nGlyphFlags, nXAdvance, nXOffset, nYOffset);
const GlyphItem aGI(nCharPos, nGlyphIndex, aNewPos, nGlyphFlags, nXAdvance, nXOffset);
rLayout.AppendGlyph(aGI);
aCurrPos.X() += nXAdvance;

View File

@ -36,9 +36,6 @@ OOXMLFastDocumentHandler::OOXMLFastDocumentHandler(
sal_Int32 nXNoteId )
: m_xContext(context)
, mpStream( pStream )
#ifdef DEBUG_WRITERFILTER
, mpTmpStream()
#endif
, mpDocument( pDocument )
, mnXNoteId( nXNoteId )
, mxContextHandler()

View File

@ -91,9 +91,6 @@ private:
css::uno::Reference< css::uno::XComponentContext > m_xContext;
Stream * mpStream;
#ifdef DEBUG_WRITERFILTER
Stream::Pointer_t mpTmpStream;
#endif
OOXMLDocumentImpl* mpDocument;
sal_Int32 mnXNoteId;
mutable css::uno::Reference<OOXMLFastContextHandler> mxContextHandler;

View File

@ -1,70 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_XMLHELP_SOURCE_CXXHELP_INC_QE_QUERY_HXX
#define INCLUDED_XMLHELP_SOURCE_CXXHELP_INC_QE_QUERY_HXX
#include <sal/types.h>
#include <rtl/ustring.hxx>
#include <vector>
#include <string.h>
namespace xmlsearch {
namespace qe {
class QueryHit
{
public:
QueryHit( sal_Int32 nColumns )
: matchesL_( 2*nColumns ),
matches_( new sal_Int32[ 2*nColumns ] )
{
memset( matches_, 0, sizeof( sal_Int32 ) * matchesL_ );
}
~QueryHit() { delete[] matches_; }
private:
sal_Int32 matchesL_;
sal_Int32 *matches_; // ...concept, word number, ...
}; // end class QueryHit
class QueryHitData
{
public:
QueryHitData( OUString* terms )
: terms_( terms ) { }
~QueryHitData() { delete[] terms_; }
private:
OUString* terms_;
}; // end class QueryHitData
}
}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -126,7 +126,6 @@ Databases::Databases( bool showBasic,
Reference< uno::XComponentContext > xContext )
: m_xContext( xContext ),
m_bShowBasic(showBasic),
m_pErrorDoc( nullptr ),
m_nCustomCSSDocLength( 0 ),
m_pCustomCSSDoc( nullptr ),
m_aCSS(styleSheet.toAsciiLowerCase()),
@ -165,10 +164,6 @@ Databases::~Databases()
delete[] m_pCustomCSSDoc;
// release errorDocument
delete[] m_pErrorDoc;
// unload the databases
{

View File

@ -242,7 +242,6 @@ namespace chelp {
css::uno::Reference< css::ucb::XSimpleFileAccess3 > m_xSFA;
bool m_bShowBasic;
char* m_pErrorDoc;
int m_nCustomCSSDocLength;
char* m_pCustomCSSDoc;

View File

@ -50,7 +50,6 @@
#include <algorithm>
#include <set>
#include <qe/Query.hxx>
#include <qe/DocGenerator.hxx>
#include "resultsetforquery.hxx"
#include "databases.hxx"

View File

@ -18,7 +18,6 @@
*/
#include <qe/DocGenerator.hxx>
#include <qe/Query.hxx>
using namespace xmlsearch;

View File

@ -249,7 +249,6 @@ namespace xmloff
OUString sAttributeName; // the attribute name
OUString sPropertyName; // the property name
css::uno::Type aPropertyType; // the property type
OUString sAttributeDefault; // the default if the attribute is not present
// entries which are special to some value types
const SvXMLEnumMapEntry* pEnumMap; // the enum map, if appliable

View File

@ -327,7 +327,6 @@ class ExtendedAttributes :
{
sal_Int32 m_nAttributes;
sal_Int32 * m_pUids;
OUString * m_pPrefixes;
OUString * m_pLocalNames;
OUString * m_pQNames;
OUString * m_pValues;
@ -337,7 +336,7 @@ class ExtendedAttributes :
public:
inline ExtendedAttributes(
sal_Int32 nAttributes,
sal_Int32 * pUids, OUString * pPrefixes,
sal_Int32 * pUids,
OUString * pLocalNames, OUString * pQNames,
Reference< xml::sax::XAttributeList > const & xAttributeList,
DocumentHandlerImpl * pHandler );
@ -374,13 +373,12 @@ public:
inline ExtendedAttributes::ExtendedAttributes(
sal_Int32 nAttributes,
sal_Int32 * pUids, OUString * pPrefixes,
sal_Int32 * pUids,
OUString * pLocalNames, OUString * pQNames,
Reference< xml::sax::XAttributeList > const & xAttributeList,
DocumentHandlerImpl * pHandler )
: m_nAttributes( nAttributes )
, m_pUids( pUids )
, m_pPrefixes( pPrefixes )
, m_pLocalNames( pLocalNames )
, m_pQNames( pQNames )
, m_pValues( new OUString[ nAttributes ] )
@ -399,7 +397,6 @@ ExtendedAttributes::~ExtendedAttributes() throw ()
m_pHandler->release();
delete [] m_pUids;
delete [] m_pPrefixes;
delete [] m_pLocalNames;
delete [] m_pQNames;
delete [] m_pValues;
@ -577,10 +574,11 @@ void DocumentHandlerImpl::startElement(
pUids[ nPos ] = getUidByPrefix( pPrefixes[ nPos ] );
}
}
delete[] pPrefixes;
// ownership of arrays belongs to attribute list
xAttributes = static_cast< xml::input::XAttributes * >(
new ExtendedAttributes(
nAttribs, pUids, pPrefixes, pLocalNames, pQNames,
nAttribs, pUids, pLocalNames, pQNames,
xAttribs, this ) );
getElementName( rQElementName, &nUid, &aLocalName );