Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
onlyoffice_core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
onlyoffice_core
Commits
2b0c5147
Commit
2b0c5147
authored
Nov 04, 2016
by
Oleg Korshul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove base.h dependency
parent
db8472a4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
17 deletions
+16
-17
Common/DocxFormat/Source/Base/SmartPtr.h
Common/DocxFormat/Source/Base/SmartPtr.h
+16
-17
No files found.
Common/DocxFormat/Source/Base/SmartPtr.h
View file @
2b0c5147
...
...
@@ -30,7 +30,6 @@
*
*/
#pragma once
#include "Base.h"
#include "../../../../DesktopEditor/common/Types.h"
namespace
NSCommon
...
...
@@ -64,7 +63,7 @@ namespace NSCommon
Release
();
}
AVSINLINE
void
Release
()
inline
void
Release
()
{
if
(
!
IsInit
()
||
(
NULL
==
m_pCountRef
))
return
;
...
...
@@ -78,7 +77,7 @@ namespace NSCommon
m_pData
=
NULL
;
m_pCountRef
=
NULL
;
}
AVSINLINE
void
AddRef
()
inline
void
AddRef
()
{
if
(
!
IsInit
()
||
(
NULL
==
m_pCountRef
))
return
;
...
...
@@ -118,42 +117,42 @@ namespace NSCommon
public:
AVSINLINE
bool
IsInit
()
const
inline
bool
IsInit
()
const
{
return
(
NULL
!=
m_pData
);
}
AVSINLINE
bool
is_init
()
const
inline
bool
is_init
()
const
{
return
IsInit
();
}
template
<
class
T
>
AVSINLINE
const
bool
is
()
const
template
<
class
T
>
inline
const
bool
is
()
const
{
if
(
!
IsInit
())
return
false
;
T
*
pResult
=
dynamic_cast
<
T
*>
(
const_cast
<
Type
*>
(
m_pData
));
return
(
NULL
!=
pResult
);
}
template
<
class
T
>
AVSINLINE
const
T
&
as
()
const
template
<
class
T
>
inline
const
T
&
as
()
const
{
T
*
pResult
=
dynamic_cast
<
T
*>
(
const_cast
<
Type
*>
(
m_pData
));
return
*
pResult
;
}
template
<
class
T
>
AVSINLINE
T
&
as
()
template
<
class
T
>
inline
T
&
as
()
{
T
*
pResult
=
dynamic_cast
<
T
*>
(
const_cast
<
Type
*>
(
m_pData
));
return
*
pResult
;
}
template
<
typename
T
>
AVSINLINE
void
Attach
(
T
*
pCast
,
const
LONG
*
pCountRef
)
inline
void
Attach
(
T
*
pCast
,
const
LONG
*
pCountRef
)
{
m_pData
=
pCast
;
m_pCountRef
=
const_cast
<
LONG
*>
(
pCountRef
);
}
template
<
typename
T
>
AVSINLINE
smart_ptr
<
T
>
smart_dynamic_cast
()
const
inline
smart_ptr
<
T
>
smart_dynamic_cast
()
const
{
smart_ptr
<
T
>
new_type
;
...
...
@@ -172,22 +171,22 @@ namespace NSCommon
return
new_type
;
}
AVSINLINE
Type
&
operator
*
()
{
return
*
m_pData
;
}
AVSINLINE
Type
*
operator
->
()
{
return
m_pData
;
}
inline
Type
&
operator
*
()
{
return
*
m_pData
;
}
inline
Type
*
operator
->
()
{
return
m_pData
;
}
AVSINLINE
const
Type
&
operator
*
()
const
{
return
*
m_pData
;
}
AVSINLINE
const
Type
*
operator
->
()
const
{
return
m_pData
;
}
inline
const
Type
&
operator
*
()
const
{
return
*
m_pData
;
}
inline
const
Type
*
operator
->
()
const
{
return
m_pData
;
}
AVSINLINE
const
Type
&
get
()
{
return
*
m_pData
;
}
const
inline
const
Type
&
get
()
{
return
*
m_pData
;
}
const
AVSINLINE
void
reset
(
Type
*
pPointer
=
NULL
)
inline
void
reset
(
Type
*
pPointer
=
NULL
)
{
*
this
=
pPointer
;
}
};
template
<
typename
T
>
static
AVSINLINE
void
normalize_value
(
T
&
value
,
const
T
&
min
,
const
T
&
max
)
static
inline
void
normalize_value
(
T
&
value
,
const
T
&
min
,
const
T
&
max
)
{
if
(
value
<
min
)
value
=
min
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment