From f65ea1618c5e0728b7a0e59ffb9ec4de67f65572 Mon Sep 17 00:00:00 2001 From: wolfgang Date: Mon, 27 Aug 2007 21:54:59 +0000 Subject: [PATCH] git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1161 d1b88da0-ebda-0310-925b-ed51d893ca5b --- SOPE/NGCards/NGCardsSaxHandler.m | 8 +++---- SOPE/NGCards/versitCardsSaxDriver/ChangeLog | 6 +++++ .../versitCardsSaxDriver/VSSaxDriver.m | 23 ++++++++----------- 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/SOPE/NGCards/NGCardsSaxHandler.m b/SOPE/NGCards/NGCardsSaxHandler.m index e91cb36c..dd939c17 100644 --- a/SOPE/NGCards/NGCardsSaxHandler.m +++ b/SOPE/NGCards/NGCardsSaxHandler.m @@ -60,7 +60,7 @@ /* state */ -- (void)resetExceptResult +- (void) resetExceptResult { if (content) { @@ -130,7 +130,7 @@ } } -- (void)endValueTag +- (void) endValueTag { [types removeAllObjects]; [args removeAllObjects]; @@ -151,14 +151,14 @@ currentGroup = nil; } -- (void)startVCardSet +- (void) startVCardSet { currentCardGroup = nil; currentGroup = nil; vcs.isInVCardSet = 1; } -- (void)endVCardSet +- (void) endVCardSet { vcs.isInVCardSet = 0; } diff --git a/SOPE/NGCards/versitCardsSaxDriver/ChangeLog b/SOPE/NGCards/versitCardsSaxDriver/ChangeLog index 454e8397..a39b1406 100644 --- a/SOPE/NGCards/versitCardsSaxDriver/ChangeLog +++ b/SOPE/NGCards/versitCardsSaxDriver/ChangeLog @@ -1,3 +1,9 @@ +2007-08-27 Wolfgang Sourdeau + + * VSSaxDriver.m ([VSSaxDriver + -parseFromSource:_sourcesystemId:_sysId]): report only tags for + which the content is not empty. + 2007-05-03 Wolfgang Sourdeau * VSSaxDriver.m ([VSSaxDriver +initialize]): removed the space diff --git a/SOPE/NGCards/versitCardsSaxDriver/VSSaxDriver.m b/SOPE/NGCards/versitCardsSaxDriver/VSSaxDriver.m index 138df5e4..98c3037a 100644 --- a/SOPE/NGCards/versitCardsSaxDriver/VSSaxDriver.m +++ b/SOPE/NGCards/versitCardsSaxDriver/VSSaxDriver.m @@ -471,20 +471,17 @@ static VSStringFormatter *stringFormatter = nil; withAttrs: (SaxAttributes *) _attrs andContent: (NSString *) _content { - /* - This is called for all non-BEGIN|END types. - */ + VSSaxTag *a; + NSString *testContent; -// _content = [stringFormatter stringByUnescapingRFC2445Text: _content]; + /* This is called for all non-BEGIN|END types. */ + testContent = [[_content unescapedFromCard] stringByReplacingString: @";" + withString: @""]; - /* check whether type should be reported as an attribute in XML */ - - [self _beginTag: _tagName group: _group withAttrs: _attrs]; - - if ([_content length] > 0) + if ([[testContent stringByTrimmingSpaces] length] > 0) { - VSSaxTag *a; - + [self _beginTag: _tagName group: _group withAttrs: _attrs]; + a = [(VSSaxTag *)[VSSaxTag alloc] initWithContentString: [_content unescapedFromCard]]; if (a) @@ -492,9 +489,9 @@ static VSStringFormatter *stringFormatter = nil; [elementList addObject: a]; [a release]; } - } - [self _endTag: _tagName]; + [self _endTag: _tagName]; + } } /* report events for collected elements */ -- 2.39.5