Skip to content

Commit

Permalink
Item2314: perltidy
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/trunk/SmartWordBreakPlugin@5452 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
MichaelTempest authored and MichaelTempest committed Nov 7, 2009
1 parent c466d12 commit 5b525b8
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions lib/Foswiki/Plugins/SmartWordBreakPlugin.pm
Expand Up @@ -10,7 +10,7 @@
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details, published at
# GNU General Public License for more details, published at
# http://www.gnu.org/copyleft/gpl.html

=pod
Expand All @@ -32,15 +32,14 @@ the text had been included from another topic.
=cut


package Foswiki::Plugins::SmartWordBreakPlugin;

# Always use strict to enforce variable scoping
use strict;

use Assert;

use Foswiki::Func (); # The plugins API
use Foswiki::Func (); # The plugins API
use Foswiki::Plugins (); # For the API version

# $VERSION is referred to by Foswiki, and is the only global variable that
Expand Down Expand Up @@ -91,46 +90,48 @@ sub initPlugin {
return 0;
}

undef $core;
undef $core;

Foswiki::Func::registerTagHandler( 'SMARTWORDBREAK', \&_SMARTWORDBREAK );
Foswiki::Func::registerTagHandler( 'WBR', \&_WBR );
Foswiki::Func::registerTagHandler( 'WBR', \&_WBR );

if ( Foswiki::Func::getPreferencesFlag('SMARTWORDBREAKPLUGIN_WHOLEPAGE')
or Foswiki::Func::getPreferencesFlag('SMARTWORDBREAKPLUGIN_TABLES') )
{

if ( Foswiki::Func::getPreferencesFlag('SMARTWORDBREAKPLUGIN_WHOLEPAGE')
or Foswiki::Func::getPreferencesFlag('SMARTWORDBREAKPLUGIN_TABLES') ) {
# postRenderingHandler is required
getCore();
}
}

# Plugin correctly initialized
return 1;
}

###############################################################################
sub getCore {
return $core if $core;
require Foswiki::Plugins::SmartWordBreakPlugin::Core;
$core = new Foswiki::Plugins::SmartWordBreakPlugin::Core;
return $core if $core;

require Foswiki::Plugins::SmartWordBreakPlugin::Core;
$core = new Foswiki::Plugins::SmartWordBreakPlugin::Core;

return $core;
return $core;
}

###############################################################################
# The function used to handle the %SMARTWORDBREAK{...}% macro
sub _SMARTWORDBREAK {
return getCore()->handleSMARTWORDBREAK(@_);
return getCore()->handleSMARTWORDBREAK(@_);
}

###############################################################################
# The function used to handle the %WBR% macro
sub _WBR {
return getCore()->handleWBR(@_);
return getCore()->handleWBR(@_);
}

###############################################################################
sub postRenderingHandler {
return unless $core; # no smart breaks needed
sub postRenderingHandler {
return unless $core; # no smart breaks needed
$core->postRenderingHandler(@_);
}

Expand Down

0 comments on commit 5b525b8

Please sign in to comment.