summaryrefslogtreecommitdiff
path: root/codemaker/source
diff options
context:
space:
mode:
authorThorsten Behrens <tbehrens@suse.com>2012-11-29 21:26:09 +0100
committerThorsten Behrens <tbehrens@suse.com>2012-11-30 14:36:36 +0100
commit66a175834c39ccde9475eac3adb72a843110d01f (patch)
treeef925daaf84a85731525c2b14f0cd4a2ed84e2de /codemaker/source
parent90eac3e69749a9227c4b6902b1f3cef1e338c6d1 (diff)
c++ API: use css alias in generated headers, adds global css decl
This changes all generated API headers (.hpp and .hdl) to use a namespace alias 'css' instead of the pointlessly long com::sun::star Makes the change in cppumaker & associated tools, adds a global namespace alias definition in sal/types.h, and removes a kiloton of local, now pointless-to-harmful versions of that alias from all over the code. Change-Id: Ice5a644a6b971a981f01dc0589d48f5add31cc0f
Diffstat (limited to 'codemaker/source')
-rw-r--r--codemaker/source/commoncpp/commoncpp.cxx17
1 files changed, 6 insertions, 11 deletions
diff --git a/codemaker/source/commoncpp/commoncpp.cxx b/codemaker/source/commoncpp/commoncpp.cxx
index 53cd5dae61ab..989052d67030 100644
--- a/codemaker/source/commoncpp/commoncpp.cxx
+++ b/codemaker/source/commoncpp/commoncpp.cxx
@@ -37,8 +37,7 @@
namespace codemaker { namespace cpp {
-rtl::OString scopedCppName(rtl::OString const & type, bool bNoNameSpace,
- bool shortname)
+rtl::OString scopedCppName(rtl::OString const & type, bool ns_alias)
{
char c('/');
sal_Int32 nPos = type.lastIndexOf( c );
@@ -49,8 +48,6 @@ rtl::OString scopedCppName(rtl::OString const & type, bool bNoNameSpace,
c = '.';
}
- if (bNoNameSpace)
- return type.copy(nPos+1);
rtl::OStringBuffer tmpBuf(type.getLength()*2);
nPos = 0;
@@ -60,15 +57,13 @@ rtl::OString scopedCppName(rtl::OString const & type, bool bNoNameSpace,
tmpBuf.append(type.getToken(0, c, nPos));
} while( nPos != -1 );
- if (shortname) {
- rtl::OString s(tmpBuf.makeStringAndClear());
- if (s.indexOf("::com::sun::star") == 0)
- return s.replaceAt(0, 16, "css");
- else
- return s;
+ rtl::OString s(tmpBuf.makeStringAndClear());
+ if (ns_alias && s.indexOf("::com::sun::star::") == 0)
+ {
+ return s.replaceAt(0, 18, "css::"); // nicer shorthand
}
- return tmpBuf.makeStringAndClear();
+ return s;
}