Просмотр исходного кода

161220

Split class RAUtils, iSalesDB
Ray Zhang 9 лет назад
Родитель
Сommit
6271c6f732
1 измененных файлов с 11 добавлено и 11 удалено
  1. 11 11
      RedAnt ERP Mobile/common/pdfCreator/TextDrawable.m

+ 11 - 11
RedAnt ERP Mobile/common/pdfCreator/TextDrawable.m

@@ -8,7 +8,7 @@
 
 
 #import "TextDrawable.h"
 #import "TextDrawable.h"
 #import <CoreText/CoreText.h>
 #import <CoreText/CoreText.h>
-#import "RAUtils.h"
+#import "TextUtils.h"
 
 
 @implementation TextDrawable
 @implementation TextDrawable
 
 
@@ -97,7 +97,7 @@
             {
             {
                 NSString *content =  data[self.drawableTemplate[@"source"]];
                 NSString *content =  data[self.drawableTemplate[@"source"]];
                 NSString *pattern = @"\\$\\.\\{([\\s\\S]*?)\\}\\.\\$";
                 NSString *pattern = @"\\$\\.\\{([\\s\\S]*?)\\}\\.\\$";
-                NSArray* matches=[RAUtils expression_varable:content regex:pattern];
+                NSArray* matches=[TextUtils expression_varable:content regex:pattern];
                 //            if (matches) {
                 //            if (matches) {
                 //                for (NSTextCheckingResult *match in matches) {
                 //                for (NSTextCheckingResult *match in matches) {
                 //                    for (int i = 0; i < match.numberOfRanges; ++i) {
                 //                    for (int i = 0; i < match.numberOfRanges; ++i) {
@@ -421,7 +421,7 @@
         NSString* newstring= nil;
         NSString* newstring= nil;
         //   NSString *content =  string.string ;
         //   NSString *content =  string.string ;
         NSString *pattern = @"\\<b\\>([\\s\\S]*?)\\<\\/b\\>";
         NSString *pattern = @"\\<b\\>([\\s\\S]*?)\\<\\/b\\>";
-        //        NSArray* matches=[RAUtils expression_varable:content regex:pattern];
+        //        NSArray* matches=[TextUtils expression_varable:content regex:pattern];
         //        if (matches) {
         //        if (matches) {
         //            for (NSTextCheckingResult *match in matches) {
         //            for (NSTextCheckingResult *match in matches) {
         //                for (int i = 0; i < match.numberOfRanges; ++i) {
         //                for (int i = 0; i < match.numberOfRanges; ++i) {
@@ -429,7 +429,7 @@
         //                }
         //                }
         //            }
         //            }
         //        }
         //        }
-        NSTextCheckingResult * match=[RAUtils expression_findfistMatch:string.string regex:pattern];
+        NSTextCheckingResult * match=[TextUtils expression_findfistMatch:string.string regex:pattern];
         
         
         while(match)
         while(match)
         {
         {
@@ -450,7 +450,7 @@
                 
                 
                 DebugLog(@"string after replace: %@",string.string);
                 DebugLog(@"string after replace: %@",string.string);
                 //newstring=[newstring stringByReplacingOccurrencesOfString:[content substringWithRange:[match rangeAtIndex:i]] withString:[content substringWithRange:[match rangeAtIndex:i+1]]];
                 //newstring=[newstring stringByReplacingOccurrencesOfString:[content substringWithRange:[match rangeAtIndex:i]] withString:[content substringWithRange:[match rangeAtIndex:i+1]]];
-                match=[RAUtils expression_findfistMatch:string.string regex:pattern];
+                match=[TextUtils expression_findfistMatch:string.string regex:pattern];
             }
             }
         }
         }
         //        if (matches)
         //        if (matches)
@@ -503,7 +503,7 @@
         {
         {
             NSString *content =  data[self.drawableTemplate[@"source"]];
             NSString *content =  data[self.drawableTemplate[@"source"]];
             NSString *pattern = @"\\$\\.\\{([\\s\\S]*?)\\}\\.\\$";
             NSString *pattern = @"\\$\\.\\{([\\s\\S]*?)\\}\\.\\$";
-            NSArray* matches=[RAUtils expression_varable:content regex:pattern];
+            NSArray* matches=[TextUtils expression_varable:content regex:pattern];
             //            if (matches) {
             //            if (matches) {
             //                for (NSTextCheckingResult *match in matches) {
             //                for (NSTextCheckingResult *match in matches) {
             //                    for (int i = 0; i < match.numberOfRanges; ++i) {
             //                    for (int i = 0; i < match.numberOfRanges; ++i) {
@@ -541,10 +541,10 @@
     
     
     
     
     
     
-    if([self.text isEqualToString:@"www.newpacificdirect.com"])
-    {
-        int debug=0;
-    }
+//    if([self.text isEqualToString:@"www.newpacificdirect.com"])
+//    {
+//        int debug=0;
+//    }
     
     
     
     
     bool bold = [self.drawableTemplate[@"bold"] boolValue];
     bool bold = [self.drawableTemplate[@"bold"] boolValue];
@@ -687,7 +687,7 @@
     CGRect expand_rect=rect;
     CGRect expand_rect=rect;
     
     
     //    CGRect rect=[RAUtils rectAlign:parentrect rect:scalerect hAlign:self.hAlign vAlign:self.vAlign];
     //    CGRect rect=[RAUtils rectAlign:parentrect rect:scalerect hAlign:self.hAlign vAlign:self.vAlign];
-    rect=[RAUtils rectVAlign:parentrect rect:rect vAlign:self.vAlign];
+    rect=[TextUtils rectVAlign:parentrect rect:rect vAlign:self.vAlign];
     
     
     // CGRect pdfrect = [self to_pdf_rect:p_rect pos:self.rect contextHeight:flip_height];
     // CGRect pdfrect = [self to_pdf_rect:p_rect pos:self.rect contextHeight:flip_height];