2015-07-02 09:18:31 +02:00
|
|
|
#!/usr/bin/python
|
|
|
|
|
|
|
|
import sys
|
2015-09-30 10:29:19 +02:00
|
|
|
import re
|
2015-07-02 09:18:31 +02:00
|
|
|
|
|
|
|
definitionSet = set()
|
2015-09-30 10:29:19 +02:00
|
|
|
definitionToSourceLocationMap = dict()
|
2015-07-02 09:18:31 +02:00
|
|
|
callSet = set()
|
|
|
|
# things we need to exclude for reasons like :
|
|
|
|
# - it's a weird template thingy that confuses the plugin
|
|
|
|
exclusionSet = set([
|
|
|
|
"double basegfx::DoubleTraits::maxVal()",
|
|
|
|
"double basegfx::DoubleTraits::minVal()",
|
|
|
|
"double basegfx::DoubleTraits::neutral()",
|
|
|
|
"int basegfx::Int32Traits::maxVal()",
|
|
|
|
"int basegfx::Int32Traits::minVal()",
|
|
|
|
"int basegfx::Int32Traits::neutral()",
|
|
|
|
"unsigned long UniqueIndexImpl::Insert(void *)",
|
2015-08-04 16:28:49 +02:00
|
|
|
"class XMLPropertyBackpatcher<short> & XMLTextImportHelper::GetFootnoteBP()",
|
|
|
|
"class XMLPropertyBackpatcher<short> & XMLTextImportHelper::GetSequenceIdBP()",
|
|
|
|
"void XclExpPivotCache::SaveXml(class XclExpXmlStream &)",
|
2015-07-28 08:39:57 +02:00
|
|
|
|
|
|
|
|
2015-07-02 09:18:31 +02:00
|
|
|
# TODO track instantiations of template class constructors
|
|
|
|
"void comphelper::IEventProcessor::release()",
|
2015-07-07 10:12:55 +02:00
|
|
|
"void SotMutexHolder::acquire()",
|
|
|
|
"void SotMutexHolder::release()",
|
2015-07-28 08:39:57 +02:00
|
|
|
|
2015-07-08 10:25:58 +02:00
|
|
|
# only used by Windows build
|
2015-07-02 09:18:31 +02:00
|
|
|
"_Bool basegfx::B2ITuple::equalZero() const",
|
|
|
|
"class basegfx::B2DPolyPolygon basegfx::unotools::UnoPolyPolygon::getPolyPolygonUnsafe() const",
|
2015-07-28 08:39:57 +02:00
|
|
|
"void basegfx::B2IRange::expand(const class basegfx::B2IRange &)",
|
2015-07-07 13:58:41 +02:00
|
|
|
"void OpenGLContext::requestSingleBufferedRendering()",
|
|
|
|
"_Bool TabitemValue::isBothAligned() const",
|
|
|
|
"_Bool TabitemValue::isNotAligned() const",
|
|
|
|
"void StyleSettings::SetSpinSize(long)",
|
|
|
|
"void StyleSettings::SetFloatTitleHeight(long)",
|
|
|
|
"void StyleSettings::SetTitleHeight(long)",
|
|
|
|
"void StyleSettings::SetUseFlatBorders(_Bool)",
|
|
|
|
"void StyleSettings::SetUseFlatMenus(_Bool)",
|
|
|
|
"void StyleSettings::SetCursorSize(long)",
|
|
|
|
"_Bool CommandMediaData::GetPassThroughToOS() const",
|
|
|
|
"void Application::AppEvent(const class ApplicationEvent &)",
|
2015-07-08 10:25:58 +02:00
|
|
|
"int PhysicalFontFace::GetWidth() const",
|
|
|
|
"void PhysicalFontFace::SetBitmapSize(int,int)",
|
2015-07-28 08:39:57 +02:00
|
|
|
"class boost::intrusive_ptr<class FontCharMap> FontCharMap::GetDefaultMap(_Bool)",
|
2015-07-08 10:25:58 +02:00
|
|
|
"_Bool SalObject::IsEraseBackgroundEnabled()",
|
2015-07-14 14:04:41 +02:00
|
|
|
"const class rtl::OUString & connectivity::OColumn::getCatalogName() const",
|
|
|
|
"const class rtl::OUString & connectivity::OColumn::getSchemaName() const",
|
|
|
|
"_Bool connectivity::OColumn::isDefinitelyWritable() const",
|
|
|
|
"_Bool connectivity::OColumn::isReadOnly() const",
|
|
|
|
"_Bool connectivity::OColumn::isWritable() const",
|
2015-07-21 10:44:17 +02:00
|
|
|
"_Bool IDocumentLinksAdministration::GetData(const class rtl::OUString &,const class rtl::OUString &,class com::sun::star::uno::Any &) const",
|
|
|
|
"_Bool IDocumentLinksAdministration::SetData(const class rtl::OUString &,const class rtl::OUString &,const class com::sun::star::uno::Any &)",
|
2015-07-22 10:20:03 +02:00
|
|
|
"_Bool ScImportExport::ImportData(const class rtl::OUString &,const class com::sun::star::uno::Any &)",
|
2015-07-23 09:49:57 +02:00
|
|
|
"void* ScannerManager::GetData()",
|
|
|
|
"void ScannerManager::SetData(void *)",
|
2015-07-13 13:31:13 +02:00
|
|
|
# instantiated from templates, not sure why it is not being picked up
|
2015-07-07 13:58:41 +02:00
|
|
|
"class basegfx::B2DPolygon OutputDevice::PixelToLogic(const class basegfx::B2DPolygon &,const class MapMode &) const",
|
2015-07-17 11:48:35 +02:00
|
|
|
"type-parameter-0-0 * detail::cloner::clone(type-parameter-0-0 *const)",
|
2015-07-17 13:08:16 +02:00
|
|
|
"const class rtl::OUString writerperfect::DocumentHandlerFor::name()",
|
2015-07-08 10:25:58 +02:00
|
|
|
# only used by OSX build
|
|
|
|
"void StyleSettings::SetHideDisabledMenuItems(_Bool)",
|
2015-07-20 16:03:50 +02:00
|
|
|
# debugging methods
|
|
|
|
"void oox::drawingml::TextParagraphProperties::dump() const",
|
2015-07-28 08:39:57 +02:00
|
|
|
"void oox::PropertyMap::dumpCode(class com::sun::star::uno::Reference<class com::sun::star::beans::XPropertySet>)",
|
|
|
|
"void oox::PropertyMap::dumpData(class com::sun::star::uno::Reference<class com::sun::star::beans::XPropertySet>)",
|
2015-07-20 16:03:50 +02:00
|
|
|
"class std::basic_string<char, struct std::char_traits<char>, class std::allocator<char> > writerfilter::ooxml::OOXMLPropertySet::toString()",
|
2015-07-21 10:44:17 +02:00
|
|
|
# deep template magic in SW
|
|
|
|
"Ring<value_type> * sw::Ring::Ring_node_traits::get_next(const Ring<value_type> *)",
|
|
|
|
"Ring<value_type> * sw::Ring::Ring_node_traits::get_previous(const Ring<value_type> *)",
|
|
|
|
"void sw::Ring::Ring_node_traits::set_next(Ring<value_type> *,Ring<value_type> *)",
|
|
|
|
"void sw::Ring::Ring_node_traits::set_previous(Ring<value_type> *,Ring<value_type> *)",
|
|
|
|
# I need to teach the plugin that for loops with range expressions call begin() and end()
|
|
|
|
"class __gnu_debug::_Safe_iterator<class __gnu_cxx::__normal_iterator<class SwAnchoredObject *const *, class std::__cxx1998::vector<class SwAnchoredObject *, class std::allocator<class SwAnchoredObject *> > >, class std::__debug::vector<class SwAnchoredObject *, class std::allocator<class SwAnchoredObject *> > > SwSortedObjs::begin() const",
|
|
|
|
"class __gnu_debug::_Safe_iterator<class __gnu_cxx::__normal_iterator<class SwAnchoredObject *const *, class std::__cxx1998::vector<class SwAnchoredObject *, class std::allocator<class SwAnchoredObject *> > >, class std::__debug::vector<class SwAnchoredObject *, class std::allocator<class SwAnchoredObject *> > > SwSortedObjs::end() const",
|
2015-09-30 10:29:19 +02:00
|
|
|
# loaded by dlopen()
|
|
|
|
"void * getStandardAccessibleFactory()",
|
|
|
|
"void * getSvtAccessibilityComponentFactory()",
|
|
|
|
"struct _rtl_uString * basicide_choose_macro(void *,unsigned char,struct _rtl_uString *)",
|
|
|
|
"void basicide_macro_organizer(short)",
|
|
|
|
"long basicide_handle_basic_error(void *)",
|
|
|
|
"class com::sun::star::uno::XInterface * org_libreoffice_chart2_Chart2ToolboxController(class com::sun::star::uno::XComponentContext *,const class com::sun::star::uno::Sequence<class com::sun::star::uno::Any> &)",
|
|
|
|
"class com::sun::star::uno::XInterface * org_libreoffice_comp_chart2_sidebar_ChartPanelFactory(class com::sun::star::uno::XComponentContext *,const class com::sun::star::uno::Sequence<class com::sun::star::uno::Any> &)",
|
|
|
|
"class chart::opengl::OpenglShapeFactory * getOpenglShapeFactory()",
|
|
|
|
"class VclAbstractDialogFactory * CreateDialogFactory()",
|
|
|
|
"_Bool GetSpecialCharsForEdit(class vcl::Window *,const class vcl::Font &,class rtl::OUString &)",
|
|
|
|
"const struct ImplTextEncodingData * sal_getFullTextEncodingData(unsigned short)"
|
2015-07-02 09:18:31 +02:00
|
|
|
])
|
|
|
|
|
|
|
|
|
2015-09-30 10:29:19 +02:00
|
|
|
# The parsing here is designed to avoid grabbing stuff which is mixed in from gbuild.
|
2015-07-06 10:44:18 +02:00
|
|
|
# I have not yet found a way of suppressing the gbuild output.
|
2015-07-02 09:18:31 +02:00
|
|
|
with open(sys.argv[1]) as txt:
|
|
|
|
for line in txt:
|
2015-09-30 10:29:19 +02:00
|
|
|
if line.startswith("definition:\t"):
|
|
|
|
tokens = line.split("\t")
|
|
|
|
funcInfo = (tokens[1], tokens[2])
|
|
|
|
definitionSet.add(funcInfo)
|
|
|
|
definitionToSourceLocationMap[funcInfo] = tokens[3].strip()
|
|
|
|
elif line.startswith("call:\t"):
|
|
|
|
tokens = line.split("\t")
|
|
|
|
callSet.add((tokens[1], tokens[2].strip()))
|
2015-07-02 09:18:31 +02:00
|
|
|
|
2015-09-30 10:29:19 +02:00
|
|
|
tmp1set = set()
|
|
|
|
for d in definitionSet:
|
|
|
|
clazz = d[0] + " " + d[1]
|
|
|
|
if clazz in exclusionSet:
|
|
|
|
continue
|
|
|
|
if d in callSet:
|
|
|
|
continue
|
2015-07-02 09:18:31 +02:00
|
|
|
# ignore operators, they are normally called from inside STL code
|
2015-09-30 10:29:19 +02:00
|
|
|
if "::operator" in d[1]:
|
2015-07-02 09:18:31 +02:00
|
|
|
continue
|
|
|
|
# ignore the custom RTTI stuff
|
2015-09-30 10:29:19 +02:00
|
|
|
if ( ("::CreateType()" in d[1])
|
|
|
|
or ("::IsA(" in d[1])
|
|
|
|
or ("::Type()" in d[1])):
|
2015-07-02 09:18:31 +02:00
|
|
|
continue
|
|
|
|
# if this method is const, and there is a non-const variant of it, and the non-const variant is in use, then leave it alone
|
2015-09-30 10:29:19 +02:00
|
|
|
if d[0].startswith("const ") and d[1].endswith(" const"):
|
|
|
|
if ((d[0][6:],d[1][:-6]) in callSet):
|
2015-07-17 13:08:16 +02:00
|
|
|
continue
|
2015-09-30 10:29:19 +02:00
|
|
|
elif clazz.endswith(" const"):
|
2015-07-17 15:50:48 +02:00
|
|
|
clazz2 = clazz[:len(clazz)-6] # strip off " const"
|
2015-09-30 10:29:19 +02:00
|
|
|
if ((d[0],clazz2) in callSet):
|
2015-07-17 13:08:16 +02:00
|
|
|
continue
|
2015-09-30 10:29:19 +02:00
|
|
|
if clazz.endswith(" const") and ("::iterator" in clazz):
|
2015-07-17 15:50:48 +02:00
|
|
|
clazz2 = clazz[:len(clazz)-6] # strip off " const"
|
|
|
|
clazz2 = clazz2.replace("::const_iterator", "::iterator")
|
2015-09-30 10:29:19 +02:00
|
|
|
if ((d[0],clazz2) in callSet):
|
2015-07-17 13:08:16 +02:00
|
|
|
continue
|
2015-07-02 09:18:31 +02:00
|
|
|
# if this method is non-const, and there is a const variant of it, and the const variant is in use, then leave it alone
|
2015-09-30 10:29:19 +02:00
|
|
|
if (not clazz.endswith(" const")) and ((d[0],"const " + clazz + " const") in callSet):
|
2015-07-02 09:18:31 +02:00
|
|
|
continue
|
2015-09-30 10:29:19 +02:00
|
|
|
if (not clazz.endswith(" const")) and ("::iterator" in clazz):
|
2015-07-17 13:08:16 +02:00
|
|
|
clazz2 = clazz.replace("::iterator", "::const_iterator") + " const"
|
2015-09-30 10:29:19 +02:00
|
|
|
if ((d[0],clazz2) in callSet):
|
2015-07-17 13:08:16 +02:00
|
|
|
continue
|
2015-08-04 16:28:49 +02:00
|
|
|
# There is lots of macro magic going on in SRCDIR/include/sax/fshelper.hxx that should be using C++11 varag templates
|
2015-09-30 10:29:19 +02:00
|
|
|
if d[1].startswith("sax_fastparser::FastSerializerHelper::"):
|
2015-07-02 09:18:31 +02:00
|
|
|
continue
|
|
|
|
# used by Windows build
|
2015-09-30 10:29:19 +02:00
|
|
|
if any(x in d[1] for x in ["DdeTopic::", "DdeData::", "DdeService::", "DdeTransaction::", "DdeConnection::", "DdeLink::", "DdeItem::", "DdeGetPutItem::"]):
|
2015-07-02 09:18:31 +02:00
|
|
|
continue
|
2015-07-17 15:50:48 +02:00
|
|
|
# the include/tools/rtti.hxx stuff
|
2015-09-30 10:29:19 +02:00
|
|
|
if ("::StaticType()" in d[1]) or ("::IsOf(void *(*)(void))" in d[1]):
|
2015-07-17 15:50:48 +02:00
|
|
|
continue
|
2015-08-04 16:28:49 +02:00
|
|
|
# too much template magic here for my plugin
|
2015-09-30 10:29:19 +02:00
|
|
|
if ( ("cairocanvas::" in d[1])
|
|
|
|
or ("canvas::" in d[1])
|
|
|
|
or ("oglcanvas::" in d[1])
|
|
|
|
or ("vclcanvas::" in d[1])):
|
2015-08-04 16:28:49 +02:00
|
|
|
continue
|
2015-09-30 10:29:19 +02:00
|
|
|
# these are loaded by dlopen() from somewhere
|
|
|
|
if "get_implementation" in d[1]:
|
|
|
|
continue
|
|
|
|
if "component_getFactory" in d[1]:
|
|
|
|
continue
|
|
|
|
if d[0]=="_Bool" and "_supportsService(const class rtl::OUString &)" in d[1]:
|
|
|
|
continue
|
|
|
|
if (d[0]=="class com::sun::star::uno::Reference<class com::sun::star::uno::XInterface>"
|
|
|
|
and "Instance(const class com::sun::star::uno::Reference<class com::sun::star::lang::XMultiServiceFactory> &)" in d[1]):
|
|
|
|
continue
|
|
|
|
# ignore the Java symbols, loaded from the JavaVM
|
|
|
|
if d[1].startswith("Java_"):
|
|
|
|
continue
|
|
|
|
# ignore external code
|
|
|
|
if definitionToSourceLocationMap[d].startswith("external/"):
|
|
|
|
continue
|
|
|
|
# ignore the VCL_BUILDER_DECL_FACTORY stuff
|
|
|
|
if d[0]=="void" and d[1].startswith("make") and ("(class VclPtr<class vcl::Window> &" in d[1]):
|
|
|
|
continue
|
|
|
|
|
|
|
|
tmp1set.add((clazz, definitionToSourceLocationMap[d]))
|
|
|
|
|
|
|
|
def natural_sort_key(s, _nsre=re.compile('([0-9]+)')):
|
|
|
|
return [int(text) if text.isdigit() else text.lower()
|
|
|
|
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]))
|
|
|
|
|
|
|
|
# print out the results
|
|
|
|
for t in tmp1list:
|
|
|
|
print t[1]
|
|
|
|
print " ", t[0]
|
|
|
|
|
2015-08-04 16:28:49 +02:00
|
|
|
|
2015-07-02 09:18:31 +02:00
|
|
|
|
|
|
|
# add an empty line at the end to make it easier for the unusedmethodsremove plugin to mmap() the output file
|
|
|
|
print
|
|
|
|
|
|
|
|
|